From 27eff9129081e12b793d75bb188f0f2d5056ef49 Mon Sep 17 00:00:00 2001 From: Yeferson Licet <111311418+y3fers0n@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:43:09 -0300 Subject: [PATCH] fix: Ton improvements & tests (#589) * fix: Ton related reports * fix: Update tests --- android/lib/src/main/res/raw/trust_min.js | 14 +- bun.lockb | Bin 416752 -> 411312 bytes .../android-web3-provider/rollup.config.js | 2 + packages/ios-web3-provider/rollup.config.js | 2 + packages/ios-web3-provider/swift/trust-min.js | 4 +- packages/solana/SolanaProvider.ts | 2 + packages/solana/package.json | 3 +- packages/ton/MobileAdapter.ts | 130 ++++++++++++++++-- packages/ton/TonBridge.ts | 32 +++-- packages/ton/package.json | 2 + packages/ton/tests/TonProvider.spec.ts | 31 ++++- packages/ton/types/TonBridge.ts | 6 +- 12 files changed, 186 insertions(+), 42 deletions(-) diff --git a/android/lib/src/main/res/raw/trust_min.js b/android/lib/src/main/res/raw/trust_min.js index bd1fb5d1..1cd307cd 100644 --- a/android/lib/src/main/res/raw/trust_min.js +++ b/android/lib/src/main/res/raw/trust_min.js @@ -1,7 +1,7 @@ -!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("rpc-websockets/dist/lib/client"),require("rpc-websockets/dist/lib/client/websocket.browser")):"function"==typeof define&&define.amd?define(["rpc-websockets/dist/lib/client","rpc-websockets/dist/lib/client/websocket.browser"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RpcWebSocketCommonClient,t.createRpc)}(void 0,(function(t,e){function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=r(t),i=r(e),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})})),r}var a={exports:{}},c=function(t){return t&&t.Math===Math&&t},u=c("object"==typeof globalThis&&globalThis)||c("object"==typeof window&&window)||c("object"==typeof self&&self)||c("object"==typeof o&&o)||c("object"==typeof o&&o)||function(){return this}()||Function("return this")(),f={},h=function(t){try{return!!t()}catch(t){return!0}},l=!h((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),d=!h((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),p=d,g=Function.prototype.call,y=p?g.bind(g):function(){return g.apply(g,arguments)},m={},v={}.propertyIsEnumerable,w=Object.getOwnPropertyDescriptor,b=w&&!v.call({1:2},1);m.f=b?function(t){var e=w(this,t);return!!e&&e.enumerable}:v;var E,S,_=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},A=d,x=Function.prototype,I=x.call,k=A&&x.bind.bind(I,I),T=A?k:function(t){return function(){return I.apply(t,arguments)}},R=T,B=R({}.toString),O=R("".slice),M=function(t){return O(B(t),8,-1)},C=h,L=M,P=Object,N=T("".split),U=C((function(){return!P("z").propertyIsEnumerable(0)}))?function(t){return"String"===L(t)?N(t,""):P(t)}:P,j=function(t){return null==t},D=j,z=TypeError,F=function(t){if(D(t))throw new z("Can't call method on "+t);return t},H=U,$=F,q=function(t){return H($(t))},W="object"==typeof document&&document.all,V=void 0===W&&void 0!==W?function(t){return"function"==typeof t||t===W}:function(t){return"function"==typeof t},K=V,G=function(t){return"object"==typeof t?null!==t:K(t)},Z=u,J=V,Y=function(t,e){return arguments.length<2?(r=Z[t],J(r)?r:void 0):Z[t]&&Z[t][e];var r},X=T({}.isPrototypeOf),Q=u.navigator,tt=Q&&Q.userAgent,et=tt?String(tt):"",rt=u,nt=et,it=rt.process,ot=rt.Deno,st=it&&it.versions||ot&&ot.version,at=st&&st.v8;at&&(S=(E=at.split("."))[0]>0&&E[0]<4?1:+(E[0]+E[1])),!S&&nt&&(!(E=nt.match(/Edge\/(\d+)/))||E[1]>=74)&&(E=nt.match(/Chrome\/(\d+)/))&&(S=+E[1]);var ct=S,ut=ct,ft=h,ht=u.String,lt=!!Object.getOwnPropertySymbols&&!ft((function(){var t=Symbol("symbol detection");return!ht(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ut&&ut<41})),dt=lt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,pt=Y,gt=V,yt=X,mt=Object,vt=dt?function(t){return"symbol"==typeof t}:function(t){var e=pt("Symbol");return gt(e)&&yt(e.prototype,mt(t))},wt=String,bt=function(t){try{return wt(t)}catch(t){return"Object"}},Et=V,St=bt,_t=TypeError,At=function(t){if(Et(t))return t;throw new _t(St(t)+" is not a function")},xt=At,It=j,kt=function(t,e){var r=t[e];return It(r)?void 0:xt(r)},Tt=y,Rt=V,Bt=G,Ot=TypeError,Mt=function(t,e){var r,n;if("string"===e&&Rt(r=t.toString)&&!Bt(n=Tt(r,t)))return n;if(Rt(r=t.valueOf)&&!Bt(n=Tt(r,t)))return n;if("string"!==e&&Rt(r=t.toString)&&!Bt(n=Tt(r,t)))return n;throw new Ot("Can't convert object to primitive value")},Ct={exports:{}},Lt=u,Pt=Object.defineProperty,Nt=function(t,e){try{Pt(Lt,t,{value:e,configurable:!0,writable:!0})}catch(r){Lt[t]=e}return e},Ut=u,jt=Nt,Dt="__core-js_shared__",zt=Ct.exports=Ut[Dt]||jt(Dt,{});(zt.versions||(zt.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ft=Ct.exports,Ht=function(t,e){return Ft[t]||(Ft[t]=e||{})},$t=F,qt=Object,Wt=function(t){return qt($t(t))},Vt=Wt,Kt=T({}.hasOwnProperty),Gt=Object.hasOwn||function(t,e){return Kt(Vt(t),e)},Zt=T,Jt=0,Yt=Math.random(),Xt=Zt(1..toString),Qt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Xt(++Jt+Yt,36)},te=Ht,ee=Gt,re=Qt,ne=lt,ie=dt,oe=u.Symbol,se=te("wks"),ae=ie?oe.for||oe:oe&&oe.withoutSetter||re,ce=function(t){return ee(se,t)||(se[t]=ne&&ee(oe,t)?oe[t]:ae("Symbol."+t)),se[t]},ue=y,fe=G,he=vt,le=kt,de=Mt,pe=TypeError,ge=ce("toPrimitive"),ye=function(t,e){if(!fe(t)||he(t))return t;var r,n=le(t,ge);if(n){if(void 0===e&&(e="default"),r=ue(n,t,e),!fe(r)||he(r))return r;throw new pe("Can't convert object to primitive value")}return void 0===e&&(e="number"),de(t,e)},me=ye,ve=vt,we=function(t){var e=me(t,"string");return ve(e)?e:e+""},be=G,Ee=u.document,Se=be(Ee)&&be(Ee.createElement),_e=function(t){return Se?Ee.createElement(t):{}},Ae=_e,xe=!l&&!h((function(){return 7!==Object.defineProperty(Ae("div"),"a",{get:function(){return 7}}).a})),Ie=l,ke=y,Te=m,Re=_,Be=q,Oe=we,Me=Gt,Ce=xe,Le=Object.getOwnPropertyDescriptor;f.f=Ie?Le:function(t,e){if(t=Be(t),e=Oe(e),Ce)try{return Le(t,e)}catch(t){}if(Me(t,e))return Re(!ke(Te.f,t,e),t[e])};var Pe={},Ne=l&&h((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ue=G,je=String,De=TypeError,ze=function(t){if(Ue(t))return t;throw new De(je(t)+" is not an object")},Fe=l,He=xe,$e=Ne,qe=ze,We=we,Ve=TypeError,Ke=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,Ze="enumerable",Je="configurable",Ye="writable";Pe.f=Fe?$e?function(t,e,r){if(qe(t),e=We(e),qe(r),"function"==typeof t&&"prototype"===e&&"value"in r&&Ye in r&&!r[Ye]){var n=Ge(t,e);n&&n[Ye]&&(t[e]=r.value,r={configurable:Je in r?r[Je]:n[Je],enumerable:Ze in r?r[Ze]:n[Ze],writable:!1})}return Ke(t,e,r)}:Ke:function(t,e,r){if(qe(t),e=We(e),qe(r),He)try{return Ke(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new Ve("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var Xe=Pe,Qe=_,tr=l?function(t,e,r){return Xe.f(t,e,Qe(1,r))}:function(t,e,r){return t[e]=r,t},er={exports:{}},rr=l,nr=Gt,ir=Function.prototype,or=rr&&Object.getOwnPropertyDescriptor,sr=nr(ir,"name"),ar={EXISTS:sr,PROPER:sr&&"something"===function(){}.name,CONFIGURABLE:sr&&(!rr||rr&&or(ir,"name").configurable)},cr=T,ur=V,fr=Ct.exports,hr=cr(Function.toString);ur(fr.inspectSource)||(fr.inspectSource=function(t){return hr(t)});var lr,dr,pr,gr=fr.inspectSource,yr=V,mr=u.WeakMap,vr=yr(mr)&&/native code/.test(String(mr)),wr=Qt,br=Ht("keys"),Er=function(t){return br[t]||(br[t]=wr(t))},Sr={},_r=vr,Ar=u,xr=G,Ir=tr,kr=Gt,Tr=Ct.exports,Rr=Er,Br=Sr,Or="Object already initialized",Mr=Ar.TypeError,Cr=Ar.WeakMap;if(_r||Tr.state){var Lr=Tr.state||(Tr.state=new Cr);Lr.get=Lr.get,Lr.has=Lr.has,Lr.set=Lr.set,lr=function(t,e){if(Lr.has(t))throw new Mr(Or);return e.facade=t,Lr.set(t,e),e},dr=function(t){return Lr.get(t)||{}},pr=function(t){return Lr.has(t)}}else{var Pr=Rr("state");Br[Pr]=!0,lr=function(t,e){if(kr(t,Pr))throw new Mr(Or);return e.facade=t,Ir(t,Pr,e),e},dr=function(t){return kr(t,Pr)?t[Pr]:{}},pr=function(t){return kr(t,Pr)}}var Nr={set:lr,get:dr,has:pr,enforce:function(t){return pr(t)?dr(t):lr(t,{})},getterFor:function(t){return function(e){var r;if(!xr(e)||(r=dr(e)).type!==t)throw new Mr("Incompatible receiver, "+t+" required");return r}}},Ur=T,jr=h,Dr=V,zr=Gt,Fr=l,Hr=ar.CONFIGURABLE,$r=gr,qr=Nr.enforce,Wr=Nr.get,Vr=String,Kr=Object.defineProperty,Gr=Ur("".slice),Zr=Ur("".replace),Jr=Ur([].join),Yr=Fr&&!jr((function(){return 8!==Kr((function(){}),"length",{value:8}).length})),Xr=String(String).split("String"),Qr=er.exports=function(t,e,r){"Symbol("===Gr(Vr(e),0,7)&&(e="["+Zr(Vr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!zr(t,"name")||Hr&&t.name!==e)&&(Fr?Kr(t,"name",{value:e,configurable:!0}):t.name=e),Yr&&r&&zr(r,"arity")&&t.length!==r.arity&&Kr(t,"length",{value:r.arity});try{r&&zr(r,"constructor")&&r.constructor?Fr&&Kr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=qr(t);return zr(n,"source")||(n.source=Jr(Xr,"string"==typeof e?e:"")),t};Function.prototype.toString=Qr((function(){return Dr(this)&&Wr(this).source||$r(this)}),"toString");var tn=V,en=Pe,rn=er.exports,nn=Nt,on=function(t,e,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:e;if(tn(r)&&rn(r,o,n),n.global)i?t[e]=r:nn(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=r:en.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},sn={},an=Math.ceil,cn=Math.floor,un=Math.trunc||function(t){var e=+t;return(e>0?cn:an)(e)},fn=un,hn=function(t){var e=+t;return e!=e||0===e?0:fn(e)},ln=hn,dn=Math.max,pn=Math.min,gn=function(t,e){var r=ln(t);return r<0?dn(r+e,0):pn(r,e)},yn=hn,mn=Math.min,vn=function(t){var e=yn(t);return e>0?mn(e,9007199254740991):0},wn=vn,bn=function(t){return wn(t.length)},En=q,Sn=gn,_n=bn,An=function(t){return function(e,r,n){var i=En(e),o=_n(i);if(0===o)return!t&&-1;var s,a=Sn(n,o);if(t&&r!=r){for(;o>a;)if((s=i[a++])!=s)return!0}else for(;o>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},xn={includes:An(!0),indexOf:An(!1)},In=Gt,kn=q,Tn=xn.indexOf,Rn=Sr,Bn=T([].push),On=function(t,e){var r,n=kn(t),i=0,o=[];for(r in n)!In(Rn,r)&&In(n,r)&&Bn(o,r);for(;e.length>i;)In(n,r=e[i++])&&(~Tn(o,r)||Bn(o,r));return o},Mn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Cn=On,Ln=Mn.concat("length","prototype");sn.f=Object.getOwnPropertyNames||function(t){return Cn(t,Ln)};var Pn={};Pn.f=Object.getOwnPropertySymbols;var Nn=Y,Un=sn,jn=Pn,Dn=ze,zn=T([].concat),Fn=Nn("Reflect","ownKeys")||function(t){var e=Un.f(Dn(t)),r=jn.f;return r?zn(e,r(t)):e},Hn=Gt,$n=Fn,qn=f,Wn=Pe,Vn=function(t,e,r){for(var n=$n(e),i=Wn.f,o=qn.f,s=0;ss;)Ti.f(t,r=i[s++],n[r]);return t};var Mi,Ci=Y("document","documentElement"),Li=ze,Pi=Si,Ni=Mn,Ui=Sr,ji=Ci,Di=_e,zi="prototype",Fi="script",Hi=Er("IE_PROTO"),$i=function(){},qi=function(t){return"<"+Fi+">"+t+""},Wi=function(t){t.write(qi("")),t.close();var e=t.parentWindow.Object;return t=null,e},Vi=function(){try{Mi=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;Vi="undefined"!=typeof document?document.domain&&Mi?Wi(Mi):(e=Di("iframe"),r="java"+Fi+":",e.style.display="none",ji.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(qi("document.F=Object")),t.close(),t.F):Wi(Mi);for(var n=Ni.length;n--;)delete Vi[zi][Ni[n]];return Vi()};Ui[Hi]=!0;var Ki=Object.create||function(t,e){var r;return null!==t?($i[zi]=Li(t),r=new $i,$i[zi]=null,r[Hi]=t):r=Vi(),void 0===e?r:Pi.f(r,e)},Gi={},Zi=T([].slice),Ji=M,Yi=q,Xi=sn.f,Qi=Zi,to="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Gi.f=function(t){return to&&"Window"===Ji(t)?function(t){try{return Xi(t)}catch(t){return Qi(to)}}(t):Xi(Yi(t))};var eo=er.exports,ro=Pe,no=function(t,e,r){return r.get&&eo(r.get,e,{getter:!0}),r.set&&eo(r.set,e,{setter:!0}),ro.f(t,e,r)},io={},oo=ce;io.f=oo;var so=u,ao=so,co=Gt,uo=io,fo=Pe.f,ho=function(t){var e=ao.Symbol||(ao.Symbol={});co(e,t)||fo(e,t,{value:uo.f(t)})},lo=y,po=Y,go=ce,yo=on,mo=function(){var t=po("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,n=go("toPrimitive");e&&!e[n]&&yo(e,n,(function(t){return lo(r,this)}),{arity:1})},vo=Pe.f,wo=Gt,bo=ce("toStringTag"),Eo=function(t,e,r){t&&!r&&(t=t.prototype),t&&!wo(t,bo)&&vo(t,bo,{configurable:!0,value:e})},So=M,_o=T,Ao=function(t){if("Function"===So(t))return _o(t)},xo=At,Io=d,ko=Ao(Ao.bind),To=function(t,e){return xo(t),void 0===e?t:Io?ko(t,e):function(){return t.apply(e,arguments)}},Ro=M,Bo=Array.isArray||function(t){return"Array"===Ro(t)},Oo=T,Mo=h,Co=V,Lo=vi,Po=gr,No=function(){},Uo=Y("Reflect","construct"),jo=/^\s*(?:class|function)\b/,Do=Oo(jo.exec),zo=!jo.test(No),Fo=function(t){if(!Co(t))return!1;try{return Uo(No,[],t),!0}catch(t){return!1}},Ho=function(t){if(!Co(t))return!1;switch(Lo(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return zo||!!Do(jo,Po(t))}catch(t){return!0}};Ho.sham=!0;var $o=!Uo||Mo((function(){var t;return Fo(Fo.call)||!Fo(Object)||!Fo((function(){t=!0}))||t}))?Ho:Fo,qo=Bo,Wo=$o,Vo=G,Ko=ce("species"),Go=Array,Zo=function(t){var e;return qo(t)&&(e=t.constructor,(Wo(e)&&(e===Go||qo(e.prototype))||Vo(e)&&null===(e=e[Ko]))&&(e=void 0)),void 0===e?Go:e},Jo=function(t,e){return new(Zo(t))(0===e?0:e)},Yo=To,Xo=U,Qo=Wt,ts=bn,es=Jo,rs=T([].push),ns=function(t){var e=1===t,r=2===t,n=3===t,i=4===t,o=6===t,s=7===t,a=5===t||o;return function(c,u,f,h){for(var l,d,p=Qo(c),g=Xo(p),y=ts(g),m=Yo(u,f),v=0,w=h||es,b=e?w(c,y):r||s?w(c,0):void 0;y>v;v++)if((a||v in g)&&(d=m(l=g[v],v,p),t))if(e)b[v]=d;else if(d)switch(t){case 3:return!0;case 5:return l;case 6:return v;case 2:rs(b,l)}else switch(t){case 4:return!1;case 7:rs(b,l)}return o?-1:n||i?i:b}},is={forEach:ns(0),map:ns(1),filter:ns(2),some:ns(3),every:ns(4),find:ns(5),findIndex:ns(6),filterReject:ns(7)},os=ui,ss=u,as=y,cs=T,us=l,fs=lt,hs=h,ls=Gt,ds=X,ps=ze,gs=q,ys=we,ms=Ei,vs=_,ws=Ki,bs=xi,Es=sn,Ss=Gi,_s=Pn,As=f,xs=Pe,Is=Si,ks=m,Ts=on,Rs=no,Bs=Ht,Os=Sr,Ms=Qt,Cs=ce,Ls=io,Ps=ho,Ns=mo,Us=Eo,js=Nr,Ds=is.forEach,zs=Er("hidden"),Fs="Symbol",Hs="prototype",$s=js.set,qs=js.getterFor(Fs),Ws=Object[Hs],Vs=ss.Symbol,Ks=Vs&&Vs[Hs],Gs=ss.RangeError,Zs=ss.TypeError,Js=ss.QObject,Ys=As.f,Xs=xs.f,Qs=Ss.f,ta=ks.f,ea=cs([].push),ra=Bs("symbols"),na=Bs("op-symbols"),ia=Bs("wks"),oa=!Js||!Js[Hs]||!Js[Hs].findChild,sa=function(t,e,r){var n=Ys(Ws,e);n&&delete Ws[e],Xs(t,e,r),n&&t!==Ws&&Xs(Ws,e,n)},aa=us&&hs((function(){return 7!==ws(Xs({},"a",{get:function(){return Xs(this,"a",{value:7}).a}})).a}))?sa:Xs,ca=function(t,e){var r=ra[t]=ws(Ks);return $s(r,{type:Fs,tag:t,description:e}),us||(r.description=e),r},ua=function(t,e,r){t===Ws&&ua(na,e,r),ps(t);var n=ys(e);return ps(r),ls(ra,n)?(r.enumerable?(ls(t,zs)&&t[zs][n]&&(t[zs][n]=!1),r=ws(r,{enumerable:vs(0,!1)})):(ls(t,zs)||Xs(t,zs,vs(1,ws(null))),t[zs][n]=!0),aa(t,n,r)):Xs(t,n,r)},fa=function(t,e){ps(t);var r=gs(e),n=bs(r).concat(pa(r));return Ds(n,(function(e){us&&!as(ha,r,e)||ua(t,e,r[e])})),t},ha=function(t){var e=ys(t),r=as(ta,this,e);return!(this===Ws&&ls(ra,e)&&!ls(na,e))&&(!(r||!ls(this,e)||!ls(ra,e)||ls(this,zs)&&this[zs][e])||r)},la=function(t,e){var r=gs(t),n=ys(e);if(r!==Ws||!ls(ra,n)||ls(na,n)){var i=Ys(r,n);return!i||!ls(ra,n)||ls(r,zs)&&r[zs][n]||(i.enumerable=!0),i}},da=function(t){var e=Qs(gs(t)),r=[];return Ds(e,(function(t){ls(ra,t)||ls(Os,t)||ea(r,t)})),r},pa=function(t){var e=t===Ws,r=Qs(e?na:gs(t)),n=[];return Ds(r,(function(t){!ls(ra,t)||e&&!ls(Ws,t)||ea(n,ra[t])})),n};fs||(Vs=function(){if(ds(Ks,this))throw new Zs("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?ms(arguments[0]):void 0,e=Ms(t),r=function(t){var n=void 0===this?ss:this;n===Ws&&as(r,na,t),ls(n,zs)&&ls(n[zs],e)&&(n[zs][e]=!1);var i=vs(1,t);try{aa(n,e,i)}catch(t){if(!(t instanceof Gs))throw t;sa(n,e,i)}};return us&&oa&&aa(Ws,e,{configurable:!0,set:r}),ca(e,t)},Ts(Ks=Vs[Hs],"toString",(function(){return qs(this).tag})),Ts(Vs,"withoutSetter",(function(t){return ca(Ms(t),t)})),ks.f=ha,xs.f=ua,Is.f=fa,As.f=la,Es.f=Ss.f=da,_s.f=pa,Ls.f=function(t){return ca(Cs(t),t)},us&&(Rs(Ks,"description",{configurable:!0,get:function(){return qs(this).description}}),Ts(Ws,"propertyIsEnumerable",ha,{unsafe:!0}))),os({global:!0,constructor:!0,wrap:!0,forced:!fs,sham:!fs},{Symbol:Vs}),Ds(bs(ia),(function(t){Ps(t)})),os({target:Fs,stat:!0,forced:!fs},{useSetter:function(){oa=!0},useSimple:function(){oa=!1}}),os({target:"Object",stat:!0,forced:!fs,sham:!us},{create:function(t,e){return void 0===e?ws(t):fa(ws(t),e)},defineProperty:ua,defineProperties:fa,getOwnPropertyDescriptor:la}),os({target:"Object",stat:!0,forced:!fs},{getOwnPropertyNames:da}),Ns(),Us(Vs,Fs),Os[zs]=!0;var ga=lt&&!!Symbol.for&&!!Symbol.keyFor,ya=ui,ma=Y,va=Gt,wa=Ei,ba=Ht,Ea=ga,Sa=ba("string-to-symbol-registry"),_a=ba("symbol-to-string-registry");ya({target:"Symbol",stat:!0,forced:!Ea},{for:function(t){var e=wa(t);if(va(Sa,e))return Sa[e];var r=ma("Symbol")(e);return Sa[e]=r,_a[r]=e,r}});var Aa=ui,xa=Gt,Ia=vt,ka=bt,Ta=ga,Ra=Ht("symbol-to-string-registry");Aa({target:"Symbol",stat:!0,forced:!Ta},{keyFor:function(t){if(!Ia(t))throw new TypeError(ka(t)+" is not a symbol");if(xa(Ra,t))return Ra[t]}});var Ba=d,Oa=Function.prototype,Ma=Oa.apply,Ca=Oa.call,La="object"==typeof Reflect&&Reflect.apply||(Ba?Ca.bind(Ma):function(){return Ca.apply(Ma,arguments)}),Pa=Bo,Na=V,Ua=M,ja=Ei,Da=T([].push),za=function(t){if(Na(t))return t;if(Pa(t)){for(var e=t.length,r=[],n=0;no&&Ru(i,arguments[o]),i}));h.prototype=u,"Error"!==a?Au?Au(h,f):xu(h,f,{name:!0}):Ou&&i in c&&(Iu(h,c,i),Iu(h,c,"prepareStackTrace")),xu(h,c);try{u.name!==a&&Su(u,"name",a),u.constructor=h}catch(t){}return h}},Cu=ui,Lu=La,Pu=Mu,Nu="WebAssembly",Uu=u[Nu],ju=7!==new Error("e",{cause:7}).cause,Du=function(t,e){var r={};r[t]=Pu(t,e,ju),Cu({global:!0,constructor:!0,arity:1,forced:ju},r)},zu=function(t,e){if(Uu&&Uu[t]){var r={};r[t]=Pu(Nu+"."+t,e,ju),Cu({target:Nu,stat:!0,constructor:!0,arity:1,forced:ju},r)}};Du("Error",(function(t){return function(e){return Lu(t,this,arguments)}})),Du("EvalError",(function(t){return function(e){return Lu(t,this,arguments)}})),Du("RangeError",(function(t){return function(e){return Lu(t,this,arguments)}})),Du("ReferenceError",(function(t){return function(e){return Lu(t,this,arguments)}})),Du("SyntaxError",(function(t){return function(e){return Lu(t,this,arguments)}})),Du("TypeError",(function(t){return function(e){return Lu(t,this,arguments)}})),Du("URIError",(function(t){return function(e){return Lu(t,this,arguments)}})),zu("CompileError",(function(t){return function(e){return Lu(t,this,arguments)}})),zu("LinkError",(function(t){return function(e){return Lu(t,this,arguments)}})),zu("RuntimeError",(function(t){return function(e){return Lu(t,this,arguments)}}));var Fu=l,Hu=h,$u=ze,qu=nu,Wu=Error.prototype.toString,Vu=Hu((function(){if(Fu){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==Wu.call(t))return!0}return"2: 1"!==Wu.call({message:1,name:2})||"Error"!==Wu.call({})}))?function(){var t=$u(this),e=qu(t.name,"Error"),r=qu(t.message);return e?r?e+": "+r:e:r}:Wu,Ku=on,Gu=Vu,Zu=Error.prototype;Zu.toString!==Gu&&Ku(Zu,"toString",Gu);var Ju=!h((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Yu=Gt,Xu=V,Qu=Wt,tf=Ju,ef=Er("IE_PROTO"),rf=Object,nf=rf.prototype,of=tf?rf.getPrototypeOf:function(t){var e=Qu(t);if(Yu(e,ef))return e[ef];var r=e.constructor;return Xu(r)&&e instanceof r?r.prototype:e instanceof rf?nf:null},sf={},af=sf,cf=ce("iterator"),uf=Array.prototype,ff=function(t){return void 0!==t&&(af.Array===t||uf[cf]===t)},hf=vi,lf=kt,df=j,pf=sf,gf=ce("iterator"),yf=function(t){if(!df(t))return lf(t,gf)||lf(t,"@@iterator")||pf[hf(t)]},mf=y,vf=At,wf=ze,bf=bt,Ef=yf,Sf=TypeError,_f=function(t,e){var r=arguments.length<2?Ef(t):e;if(vf(r))return wf(mf(r,t));throw new Sf(bf(t)+" is not iterable")},Af=y,xf=ze,If=kt,kf=function(t,e,r){var n,i;xf(t);try{if(!(n=If(t,"return"))){if("throw"===e)throw r;return r}n=Af(n,t)}catch(t){i=!0,n=t}if("throw"===e)throw r;if(i)throw n;return xf(n),r},Tf=To,Rf=y,Bf=ze,Of=bt,Mf=ff,Cf=bn,Lf=X,Pf=_f,Nf=yf,Uf=kf,jf=TypeError,Df=function(t,e){this.stopped=t,this.result=e},zf=Df.prototype,Ff=function(t,e,r){var n,i,o,s,a,c,u,f=r&&r.that,h=!(!r||!r.AS_ENTRIES),l=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),g=Tf(e,f),y=function(t){return n&&Uf(n,"normal",t),new Df(!0,t)},m=function(t){return h?(Bf(t),p?g(t[0],t[1],y):g(t[0],t[1])):p?g(t,y):g(t)};if(l)n=t.iterator;else if(d)n=t;else{if(!(i=Nf(t)))throw new jf(Of(t)+" is not iterable");if(Mf(i)){for(o=0,s=Cf(t);s>o;o++)if((a=m(t[o]))&&Lf(zf,a))return a;return new Df(!1)}n=Pf(t,i)}for(c=l?t.next:n.next;!(u=Rf(c,n)).done;){try{a=m(u.value)}catch(t){Uf(n,"throw",t)}if("object"==typeof a&&a&&Lf(zf,a))return a}return new Df(!1)},Hf=ui,$f=X,qf=of,Wf=Zc,Vf=Vn,Kf=Ki,Gf=tr,Zf=_,Jf=su,Yf=wu,Xf=Ff,Qf=nu,th=ce("toStringTag"),eh=Error,rh=[].push,nh=function(t,e){var r,n=$f(ih,this);Wf?r=Wf(new eh,n?qf(this):ih):(r=n?this:Kf(ih),Gf(r,th,"Error")),void 0!==e&&Gf(r,"message",Qf(e)),Yf(r,nh,r.stack,1),arguments.length>2&&Jf(r,arguments[2]);var i=[];return Xf(t,rh,{that:i}),Gf(r,"errors",i),r};Wf?Wf(nh,eh):Vf(nh,eh,{name:!0});var ih=nh.prototype=Kf(eh.prototype,{constructor:Zf(1,nh),message:Zf(1,""),name:Zf(1,"AggregateError")});Hf({global:!0,constructor:!0,arity:2},{AggregateError:nh});var oh=ui,sh=La,ah=h,ch=Mu,uh="AggregateError",fh=Y(uh),hh=!ah((function(){return 1!==fh([1]).errors[0]}))&&ah((function(){return 7!==fh([1],uh,{cause:7}).cause}));oh({global:!0,constructor:!0,arity:2,forced:hh},{AggregateError:ch(uh,(function(t){return function(e,r){return sh(t,this,arguments)}}),hh,!0)});var lh=ce,dh=Ki,ph=Pe.f,gh=lh("unscopables"),yh=Array.prototype;void 0===yh[gh]&&ph(yh,gh,{configurable:!0,value:dh(null)});var mh=function(t){yh[gh][t]=!0},vh=Wt,wh=bn,bh=hn,Eh=mh;ui({target:"Array",proto:!0},{at:function(t){var e=vh(this),r=wh(e),n=bh(t),i=n>=0?n:r+n;return i<0||i>=r?void 0:e[i]}}),Eh("at");var Sh=TypeError,_h=function(t){if(t>9007199254740991)throw Sh("Maximum allowed index exceeded");return t},Ah=l,xh=Pe,Ih=_,kh=function(t,e,r){Ah?xh.f(t,e,Ih(0,r)):t[e]=r},Th=h,Rh=ct,Bh=ce("species"),Oh=function(t){return Rh>=51||!Th((function(){var e=[];return(e.constructor={})[Bh]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Mh=ui,Ch=h,Lh=Bo,Ph=G,Nh=Wt,Uh=bn,jh=_h,Dh=kh,zh=Jo,Fh=Oh,Hh=ct,$h=ce("isConcatSpreadable"),qh=Hh>=51||!Ch((function(){var t=[];return t[$h]=!1,t.concat()[0]!==t})),Wh=function(t){if(!Ph(t))return!1;var e=t[$h];return void 0!==e?!!e:Lh(t)};Mh({target:"Array",proto:!0,arity:1,forced:!qh||!Fh("concat")},{concat:function(t){var e,r,n,i,o,s=Nh(this),a=zh(s,0),c=0;for(e=-1,n=arguments.length;e2?arguments[2]:void 0,a=Qh((void 0===s?n:Jh(s,n))-o,n-i),c=1;for(o0;)o in r?r[i]=r[o]:Xh(r,i),i+=c,o+=c;return r},el=mh;ui({target:"Array",proto:!0},{copyWithin:tl}),el("copyWithin");var rl=h,nl=function(t,e){var r=[][t];return!!r&&rl((function(){r.call(null,e||function(){return 1},1)}))},il=is.every;ui({target:"Array",proto:!0,forced:!nl("every")},{every:function(t){return il(this,t,arguments.length>1?arguments[1]:void 0)}});var ol=Wt,sl=gn,al=bn,cl=function(t){for(var e=ol(this),r=al(e),n=arguments.length,i=sl(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,s=void 0===o?r:sl(o,r);s>i;)e[i++]=t;return e},ul=mh;ui({target:"Array",proto:!0},{fill:cl}),ul("fill");var fl=is.filter;ui({target:"Array",proto:!0,forced:!Oh("filter")},{filter:function(t){return fl(this,t,arguments.length>1?arguments[1]:void 0)}});var hl=ui,ll=is.find,dl=mh,pl="find",gl=!0;pl in[]&&Array(1)[pl]((function(){gl=!1})),hl({target:"Array",proto:!0,forced:gl},{find:function(t){return ll(this,t,arguments.length>1?arguments[1]:void 0)}}),dl(pl);var yl=ui,ml=is.findIndex,vl=mh,wl="findIndex",bl=!0;wl in[]&&Array(1)[wl]((function(){bl=!1})),yl({target:"Array",proto:!0,forced:bl},{findIndex:function(t){return ml(this,t,arguments.length>1?arguments[1]:void 0)}}),vl(wl);var El=To,Sl=U,_l=Wt,Al=bn,xl=function(t){var e=1===t;return function(r,n,i){for(var o,s=_l(r),a=Sl(s),c=Al(a),u=El(n,i);c-- >0;)if(u(o=a[c],c,s))switch(t){case 0:return o;case 1:return c}return e?-1:void 0}},Il={findLast:xl(0),findLastIndex:xl(1)},kl=Il.findLast,Tl=mh;ui({target:"Array",proto:!0},{findLast:function(t){return kl(this,t,arguments.length>1?arguments[1]:void 0)}}),Tl("findLast");var Rl=Il.findLastIndex,Bl=mh;ui({target:"Array",proto:!0},{findLastIndex:function(t){return Rl(this,t,arguments.length>1?arguments[1]:void 0)}}),Bl("findLastIndex");var Ol=Bo,Ml=bn,Cl=_h,Ll=To,Pl=function(t,e,r,n,i,o,s,a){for(var c,u,f=i,h=0,l=!!s&&Ll(s,a);h0&&Ol(c)?(u=Ml(c),f=Pl(t,e,c,u,f,o-1)-1):(Cl(f+1),t[f]=c),f++),h++;return f},Nl=Pl,Ul=Nl,jl=Wt,Dl=bn,zl=hn,Fl=Jo;ui({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=jl(this),r=Dl(e),n=Fl(e,0);return n.length=Ul(n,e,e,r,0,void 0===t?1:zl(t)),n}});var Hl=Nl,$l=At,ql=Wt,Wl=bn,Vl=Jo;ui({target:"Array",proto:!0},{flatMap:function(t){var e,r=ql(this),n=Wl(r);return $l(t),(e=Vl(r,0)).length=Hl(e,r,r,n,0,1,t,arguments.length>1?arguments[1]:void 0),e}});var Kl=is.forEach,Gl=nl("forEach")?[].forEach:function(t){return Kl(this,t,arguments.length>1?arguments[1]:void 0)};ui({target:"Array",proto:!0,forced:[].forEach!==Gl},{forEach:Gl});var Zl=ze,Jl=kf,Yl=function(t,e,r,n){try{return n?e(Zl(r)[0],r[1]):e(r)}catch(e){Jl(t,"throw",e)}},Xl=To,Ql=y,td=Wt,ed=Yl,rd=ff,nd=$o,id=bn,od=kh,sd=_f,ad=yf,cd=Array,ud=function(t){var e=td(t),r=nd(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=void 0!==i;o&&(i=Xl(i,n>2?arguments[2]:void 0));var s,a,c,u,f,h,l=ad(e),d=0;if(!l||this===cd&&rd(l))for(s=id(e),a=r?new this(s):cd(s);s>d;d++)h=o?i(e[d],d):e[d],od(a,d,h);else for(a=r?new this:[],f=(u=sd(e,l)).next;!(c=Ql(f,u)).done;d++)h=o?ed(u,i,[c.value,d],!0):c.value,od(a,d,h);return a.length=d,a},fd=ce("iterator"),hd=!1;try{var ld=0,dd={next:function(){return{done:!!ld++}},return:function(){hd=!0}};dd[fd]=function(){return this},Array.from(dd,(function(){throw 2}))}catch(OPt){}var pd=function(t,e){try{if(!e&&!hd)return!1}catch(t){return!1}var r=!1;try{var n={};n[fd]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},gd=ud;ui({target:"Array",stat:!0,forced:!pd((function(t){Array.from(t)}))},{from:gd});var yd=xn.includes,md=mh;ui({target:"Array",proto:!0,forced:h((function(){return!Array(1).includes()}))},{includes:function(t){return yd(this,t,arguments.length>1?arguments[1]:void 0)}}),md("includes");var vd=ui,wd=xn.indexOf,bd=nl,Ed=Ao([].indexOf),Sd=!!Ed&&1/Ed([1],1,-0)<0;vd({target:"Array",proto:!0,forced:Sd||!bd("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return Sd?Ed(this,t,e)||0:wd(this,t,e)}}),ui({target:"Array",stat:!0},{isArray:Bo});var _d,Ad,xd,Id=h,kd=V,Td=G,Rd=of,Bd=on,Od=ce("iterator"),Md=!1;[].keys&&("next"in(xd=[].keys())?(Ad=Rd(Rd(xd)))!==Object.prototype&&(_d=Ad):Md=!0);var Cd=!Td(_d)||Id((function(){var t={};return _d[Od].call(t)!==t}));Cd&&(_d={}),kd(_d[Od])||Bd(_d,Od,(function(){return this}));var Ld={IteratorPrototype:_d,BUGGY_SAFARI_ITERATORS:Md},Pd=Ld.IteratorPrototype,Nd=Ki,Ud=_,jd=Eo,Dd=sf,zd=function(){return this},Fd=function(t,e,r,n){var i=e+" Iterator";return t.prototype=Nd(Pd,{next:Ud(+!n,r)}),jd(t,i,!1),Dd[i]=zd,t},Hd=ui,$d=y,qd=V,Wd=Fd,Vd=of,Kd=Zc,Gd=Eo,Zd=tr,Jd=on,Yd=sf,Xd=ar.PROPER,Qd=ar.CONFIGURABLE,tp=Ld.IteratorPrototype,ep=Ld.BUGGY_SAFARI_ITERATORS,rp=ce("iterator"),np="keys",ip="values",op="entries",sp=function(){return this},ap=function(t,e,r,n,i,o,s){Wd(r,e,n);var a,c,u,f=function(t){if(t===i&&g)return g;if(!ep&&t&&t in d)return d[t];switch(t){case np:case ip:case op:return function(){return new r(this,t)}}return function(){return new r(this)}},h=e+" Iterator",l=!1,d=t.prototype,p=d[rp]||d["@@iterator"]||i&&d[i],g=!ep&&p||f(i),y="Array"===e&&d.entries||p;if(y&&(a=Vd(y.call(new t)))!==Object.prototype&&a.next&&(Vd(a)!==tp&&(Kd?Kd(a,tp):qd(a[rp])||Jd(a,rp,sp)),Gd(a,h,!0)),Xd&&i===ip&&p&&p.name!==ip&&(Qd?Zd(d,"name",ip):(l=!0,g=function(){return $d(p,this)})),i)if(c={values:f(ip),keys:o?g:f(np),entries:f(op)},s)for(u in c)(ep||l||!(u in d))&&Jd(d,u,c[u]);else Hd({target:e,proto:!0,forced:ep||l},c);return d[rp]!==g&&Jd(d,rp,g,{name:i}),Yd[e]=g,c},cp=function(t,e){return{value:t,done:e}},up=q,fp=mh,hp=sf,lp=Nr,dp=Pe.f,pp=ap,gp=cp,yp=l,mp="Array Iterator",vp=lp.set,wp=lp.getterFor(mp),bp=pp(Array,"Array",(function(t,e){vp(this,{type:mp,target:up(t),index:0,kind:e})}),(function(){var t=wp(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,gp(void 0,!0);switch(t.kind){case"keys":return gp(r,!1);case"values":return gp(e[r],!1)}return gp([r,e[r]],!1)}),"values"),Ep=hp.Arguments=hp.Array;if(fp("keys"),fp("values"),fp("entries"),yp&&"values"!==Ep.name)try{dp(Ep,"name",{value:"values"})}catch(OPt){}var Sp=ui,_p=U,Ap=q,xp=nl,Ip=T([].join);Sp({target:"Array",proto:!0,forced:_p!==Object||!xp("join",",")},{join:function(t){return Ip(Ap(this),void 0===t?",":t)}});var kp=La,Tp=q,Rp=hn,Bp=bn,Op=nl,Mp=Math.min,Cp=[].lastIndexOf,Lp=!!Cp&&1/[1].lastIndexOf(1,-0)<0,Pp=Op("lastIndexOf"),Np=Lp||!Pp?function(t){if(Lp)return kp(Cp,this,arguments)||0;var e=Tp(this),r=Bp(e);if(0===r)return-1;var n=r-1;for(arguments.length>1&&(n=Mp(n,Rp(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}:Cp;ui({target:"Array",proto:!0,forced:Np!==[].lastIndexOf},{lastIndexOf:Np});var Up=is.map;ui({target:"Array",proto:!0,forced:!Oh("map")},{map:function(t){return Up(this,t,arguments.length>1?arguments[1]:void 0)}});var jp=ui,Dp=$o,zp=kh,Fp=Array,Hp=h((function(){function t(){}return!(Fp.of.call(t)instanceof t)}));jp({target:"Array",stat:!0,forced:Hp},{of:function(){for(var t=0,e=arguments.length,r=new(Dp(this)?this:Fp)(e);e>t;)zp(r,t,arguments[t++]);return r.length=e,r}});var $p=l,qp=Bo,Wp=TypeError,Vp=Object.getOwnPropertyDescriptor,Kp=$p&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}(),Gp=Kp?function(t,e){if(qp(t)&&!Vp(t,"length").writable)throw new Wp("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},Zp=ui,Jp=Wt,Yp=bn,Xp=Gp,Qp=_h,tg=h((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}();Zp({target:"Array",proto:!0,arity:1,forced:tg},{push:function(t){var e=Jp(this),r=Yp(e),n=arguments.length;Qp(r+n);for(var i=0;i=0:a>c;c+=u)c in s&&(i=r(i,s[c],c,o));return i}},cg={left:ag(!1),right:ag(!0)},ug=u,fg=et,hg=M,lg=function(t){return fg.slice(0,t.length)===t},dg=lg("Bun/")?"BUN":lg("Cloudflare-Workers")?"CLOUDFLARE":lg("Deno/")?"DENO":lg("Node.js/")?"NODE":ug.Bun&&"string"==typeof Bun.version?"BUN":ug.Deno&&"object"==typeof Deno.version?"DENO":"process"===hg(ug.process)?"NODE":ug.window&&ug.document?"BROWSER":"REST",pg="NODE"===dg,gg=cg.left;ui({target:"Array",proto:!0,forced:!pg&&ct>79&&ct<83||!nl("reduce")},{reduce:function(t){var e=arguments.length;return gg(this,t,e,e>1?arguments[1]:void 0)}});var yg=cg.right;ui({target:"Array",proto:!0,forced:!pg&&ct>79&&ct<83||!nl("reduceRight")},{reduceRight:function(t){return yg(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var mg=ui,vg=Bo,wg=T([].reverse),bg=[1,2];mg({target:"Array",proto:!0,forced:String(bg)===String(bg.reverse())},{reverse:function(){return vg(this)&&(this.length=this.length),wg(this)}});var Eg=ui,Sg=Bo,_g=$o,Ag=G,xg=gn,Ig=bn,kg=q,Tg=kh,Rg=ce,Bg=Zi,Og=Oh("slice"),Mg=Rg("species"),Cg=Array,Lg=Math.max;Eg({target:"Array",proto:!0,forced:!Og},{slice:function(t,e){var r,n,i,o=kg(this),s=Ig(o),a=xg(t,s),c=xg(void 0===e?s:e,s);if(Sg(o)&&(r=o.constructor,(_g(r)&&(r===Cg||Sg(r.prototype))||Ag(r)&&null===(r=r[Mg]))&&(r=void 0),r===Cg||void 0===r))return Bg(o,a,c);for(n=new(void 0===r?Cg:r)(Lg(c-a,0)),i=0;a1?arguments[1]:void 0)}});var Ng=Zi,Ug=Math.floor,jg=function(t,e){var r=t.length;if(r<8)for(var n,i,o=1;o0;)t[i]=t[--i];i!==o++&&(t[i]=n)}else for(var s=Ug(r/2),a=jg(Ng(t,0,s),e),c=jg(Ng(t,s),e),u=a.length,f=c.length,h=0,l=0;h3)){if(ry)return!0;if(iy)return iy<603;var t,e,r,n,i="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)oy.push({k:e+n,v:r})}for(oy.sort((function(t,e){return e.v-t.v})),n=0;nYg(r)?1:-1}}(t)),r=Zg(i),n=0;nu-n+r;o--)Iy(c,o-1)}else if(r>n)for(o=u-n;o>f;o--)a=o+r-1,(s=o+n-1)in c?c[a]=c[s]:Iy(c,a);for(o=0;o2?r:Ny(e),o=new t(i);i>n;)o[n]=e[n++];return o},jy=u,Dy=function(t,e){var r=jy[t],n=r&&r.prototype;return n&&n[e]},zy=ui,Fy=At,Hy=q,$y=Uy,qy=mh,Wy=Array,Vy=T(Dy("Array","sort"));zy({target:"Array",proto:!0},{toSorted:function(t){void 0!==t&&Fy(t);var e=Hy(this),r=$y(Wy,e);return Vy(r,t)}}),qy("toSorted");var Ky=ui,Gy=mh,Zy=_h,Jy=bn,Yy=gn,Xy=q,Qy=hn,tm=Array,em=Math.max,rm=Math.min;Ky({target:"Array",proto:!0},{toSpliced:function(t,e){var r,n,i,o,s=Xy(this),a=Jy(s),c=Yy(t,a),u=arguments.length,f=0;for(0===u?r=n=0:1===u?(r=0,n=a-c):(r=u-2,n=rm(em(Qy(e),0),a-c)),i=Zy(a+r-n),o=tm(i);f=i||s<0)throw new lm("Incorrect index");for(var a=new e(i),c=0;cr||c!=c?s*(1/0):s*c},Cm=Mm,Lm=Math.fround||function(t){return Cm(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)},Pm=Array,Nm=Math.abs,Um=Math.pow,jm=Math.floor,Dm=Math.log,zm=Math.LN2,Fm={pack:function(t,e,r){var n,i,o,s=Pm(r),a=8*r-e-1,c=(1<>1,f=23===e?Um(2,-24)-Um(2,-77):0,h=t<0||0===t&&1/t<0?1:0,l=0;for((t=Nm(t))!=t||t===1/0?(i=t!=t?1:0,n=c):(n=jm(Dm(t)/zm),t*(o=Um(2,-n))<1&&(n--,o*=2),(t+=n+u>=1?f/o:f*Um(2,1-u))*o>=2&&(n++,o/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(t*o-1)*Um(2,e),n+=u):(i=t*Um(2,u-1)*Um(2,e),n=0));e>=8;)s[l++]=255&i,i/=256,e-=8;for(n=n<0;)s[l++]=255&n,n/=256,a-=8;return s[l-1]|=128*h,s},unpack:function(t,e){var r,n=t.length,i=8*n-e-1,o=(1<>1,a=i-7,c=n-1,u=t[c--],f=127&u;for(u>>=7;a>0;)f=256*f+t[c--],a-=8;for(r=f&(1<<-a)-1,f>>=-a,a+=e;a>0;)r=256*r+t[c--],a-=8;if(0===f)f=1-s;else{if(f===o)return r?NaN:u?-1/0:1/0;r+=Um(2,e),f-=s}return(u?-1:1)*r*Um(2,f-e)}},Hm=u,$m=T,qm=l,Wm=mm,Vm=tr,Km=no,Gm=wm,Zm=h,Jm=Sm,Ym=hn,Xm=vn,Qm=Im,tv=Lm,ev=Fm,rv=of,nv=Zc,iv=cl,ov=Zi,sv=eu,av=Vn,cv=Eo,uv=Nr,fv=ar.PROPER,hv=ar.CONFIGURABLE,lv="ArrayBuffer",dv="DataView",pv="prototype",gv="Wrong index",yv=uv.getterFor(lv),mv=uv.getterFor(dv),vv=uv.set,wv=Hm[lv],bv=wv,Ev=bv&&bv[pv],Sv=Hm[dv],_v=Sv&&Sv[pv],Av=Object.prototype,xv=Hm.Array,Iv=Hm.RangeError,kv=$m(iv),Tv=$m([].reverse),Rv=ev.pack,Bv=ev.unpack,Ov=function(t){return[255&t]},Mv=function(t){return[255&t,t>>8&255]},Cv=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Lv=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},Pv=function(t){return Rv(tv(t),23,4)},Nv=function(t){return Rv(t,52,8)},Uv=function(t,e,r){Km(t[pv],e,{configurable:!0,get:function(){return r(this)[e]}})},jv=function(t,e,r,n){var i=mv(t),o=Qm(r),s=!!n;if(o+e>i.byteLength)throw new Iv(gv);var a=i.bytes,c=o+i.byteOffset,u=ov(a,c,c+e);return s?u:Tv(u)},Dv=function(t,e,r,n,i,o){var s=mv(t),a=Qm(r),c=n(+i),u=!!o;if(a+e>s.byteLength)throw new Iv(gv);for(var f=s.bytes,h=a+s.byteOffset,l=0;l>24)},setUint8:function(t,e){Hv(this,t,e<<24>>24)}},{unsafe:!0})}else bv=function(t){Jm(this,Ev);var e=Qm(t);vv(this,{type:lv,bytes:kv(xv(e),0),byteLength:e}),qm||(this.byteLength=e,this.detached=!1)},Ev=bv[pv],Sv=function(t,e,r){Jm(this,_v),Jm(t,Ev);var n=yv(t),i=n.byteLength,o=Ym(e);if(o<0||o>i)throw new Iv("Wrong offset");if(o+(r=void 0===r?i-o:Xm(r))>i)throw new Iv("Wrong length");vv(this,{type:dv,buffer:t,byteLength:r,byteOffset:o,bytes:n.bytes}),qm||(this.buffer=t,this.byteLength=r,this.byteOffset=o)},_v=Sv[pv],qm&&(Uv(bv,"byteLength",yv),Uv(Sv,"buffer",mv),Uv(Sv,"byteLength",mv),Uv(Sv,"byteOffset",mv)),Gm(_v,{getInt8:function(t){return jv(this,1,t)[0]<<24>>24},getUint8:function(t){return jv(this,1,t)[0]},getInt16:function(t){var e=jv(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=jv(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return Lv(jv(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return Lv(jv(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return Bv(jv(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return Bv(jv(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){Dv(this,1,t,Ov,e)},setUint8:function(t,e){Dv(this,1,t,Ov,e)},setInt16:function(t,e){Dv(this,2,t,Mv,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){Dv(this,2,t,Mv,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){Dv(this,4,t,Cv,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){Dv(this,4,t,Cv,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){Dv(this,4,t,Pv,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){Dv(this,8,t,Nv,e,arguments.length>2&&arguments[2])}});cv(bv,lv),cv(Sv,dv);var $v={ArrayBuffer:bv,DataView:Sv},qv=yy,Wv="ArrayBuffer",Vv=$v[Wv];ui({global:!0,constructor:!0,forced:u[Wv]!==Vv},{ArrayBuffer:Vv}),qv(Wv);var Kv,Gv,Zv,Jv=mm,Yv=l,Xv=u,Qv=V,tw=G,ew=Gt,rw=vi,nw=bt,iw=tr,ow=on,sw=no,aw=X,cw=of,uw=Zc,fw=ce,hw=Qt,lw=Nr.enforce,dw=Nr.get,pw=Xv.Int8Array,gw=pw&&pw.prototype,yw=Xv.Uint8ClampedArray,mw=yw&&yw.prototype,vw=pw&&cw(pw),ww=gw&&cw(gw),bw=Object.prototype,Ew=Xv.TypeError,Sw=fw("toStringTag"),_w=hw("TYPED_ARRAY_TAG"),Aw="TypedArrayConstructor",xw=Jv&&!!uw&&"Opera"!==rw(Xv.opera),Iw=!1,kw={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Tw={BigInt64Array:8,BigUint64Array:8},Rw=function(t){var e=cw(t);if(tw(e)){var r=dw(e);return r&&ew(r,Aw)?r[Aw]:Rw(e)}},Bw=function(t){if(!tw(t))return!1;var e=rw(t);return ew(kw,e)||ew(Tw,e)};for(Kv in kw)(Zv=(Gv=Xv[Kv])&&Gv.prototype)?lw(Zv)[Aw]=Gv:xw=!1;for(Kv in Tw)(Zv=(Gv=Xv[Kv])&&Gv.prototype)&&(lw(Zv)[Aw]=Gv);if((!xw||!Qv(vw)||vw===Function.prototype)&&(vw=function(){throw new Ew("Incorrect invocation")},xw))for(Kv in kw)Xv[Kv]&&uw(Xv[Kv],vw);if((!xw||!ww||ww===bw)&&(ww=vw.prototype,xw))for(Kv in kw)Xv[Kv]&&uw(Xv[Kv].prototype,ww);if(xw&&cw(mw)!==ww&&uw(mw,ww),Yv&&!ew(ww,Sw))for(Kv in Iw=!0,sw(ww,Sw,{configurable:!0,get:function(){return tw(this)?this[_w]:void 0}}),kw)Xv[Kv]&&iw(Xv[Kv],_w,Kv);var Ow={NATIVE_ARRAY_BUFFER_VIEWS:xw,TYPED_ARRAY_TAG:Iw&&_w,aTypedArray:function(t){if(Bw(t))return t;throw new Ew("Target is not a typed array")},aTypedArrayConstructor:function(t){if(Qv(t)&&(!uw||aw(vw,t)))return t;throw new Ew(nw(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,n){if(Yv){if(r)for(var i in kw){var o=Xv[i];if(o&&ew(o.prototype,t))try{delete o.prototype[t]}catch(r){try{o.prototype[t]=e}catch(t){}}}ww[t]&&!r||ow(ww,t,r?e:xw&&gw[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,r){var n,i;if(Yv){if(uw){if(r)for(n in kw)if((i=Xv[n])&&ew(i,t))try{delete i[t]}catch(t){}if(vw[t]&&!r)return;try{return ow(vw,t,r?e:xw&&vw[t]||e)}catch(t){}}for(n in kw)!(i=Xv[n])||i[t]&&!r||ow(i,t,e)}},getTypedArrayConstructor:Rw,isView:function(t){if(!tw(t))return!1;var e=rw(t);return"DataView"===e||ew(kw,e)||ew(Tw,e)},isTypedArray:Bw,TypedArray:vw,TypedArrayPrototype:ww};ui({target:"ArrayBuffer",stat:!0,forced:!Ow.NATIVE_ARRAY_BUFFER_VIEWS},{isView:Ow.isView});var Mw=ui,Cw=Ao,Lw=h,Pw=ze,Nw=gn,Uw=vn,jw=$v.ArrayBuffer,Dw=$v.DataView,zw=Dw.prototype,Fw=Cw(jw.prototype.slice),Hw=Cw(zw.getUint8),$w=Cw(zw.setUint8);Mw({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Lw((function(){return!new jw(2).slice(1,void 0).byteLength}))},{slice:function(t,e){if(Fw&&void 0===e)return Fw(Pw(this),t);for(var r=Pw(this).byteLength,n=Nw(t,r),i=Nw(void 0===e?r:e,r),o=new jw(Uw(i-n)),s=new Dw(this),a=new Dw(o),c=0;n92||"NODE"===vb&&mb>94||"BROWSER"===vb&&mb>97)return!1;var t=new ArrayBuffer(8),e=wb(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength})),Eb=u,Sb=gb,_b=bb,Ab=Eb.structuredClone,xb=Eb.ArrayBuffer,Ib=Eb.MessageChannel,kb=!1;if(_b)kb=function(t){Ab(t,{transfer:[t]})};else if(xb)try{Ib||(sb=Sb("worker_threads"))&&(Ib=sb.MessageChannel),Ib&&(ab=new Ib,cb=new xb(2),ub=function(t){ab.port1.postMessage(null,[t])},2===cb.byteLength&&(ub(cb),0===cb.byteLength&&(kb=ub)))}catch(OPt){}var Tb=kb,Rb=u,Bb=T,Ob=jc,Mb=Im,Cb=lb,Lb=Zw,Pb=Tb,Nb=bb,Ub=Rb.structuredClone,jb=Rb.ArrayBuffer,Db=Rb.DataView,zb=Math.min,Fb=jb.prototype,Hb=Db.prototype,$b=Bb(Fb.slice),qb=Ob(Fb,"resizable","get"),Wb=Ob(Fb,"maxByteLength","get"),Vb=Bb(Hb.getInt8),Kb=Bb(Hb.setInt8),Gb=(Nb||Pb)&&function(t,e,r){var n,i=Lb(t),o=void 0===e?i:Mb(e),s=!qb||!qb(t);if(Cb(t),Nb&&(t=Ub(t,{transfer:[t]}),i===o&&(r||s)))return t;if(i>=o&&(!r||s))n=$b(t,0,o);else{var a=r&&!s&&Wb?{maxByteLength:Wb(t)}:void 0;n=new jb(o,a);for(var c=new Db(t),u=new Db(n),f=zb(o,i),h=0;h=0&&e<=99?e+1900:e)}}),ui({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString});var fE=hn,hE=Ei,lE=F,dE=RangeError,pE=function(t){var e=hE(lE(this)),r="",n=fE(t);if(n<0||n===1/0)throw new dE("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(e+=e))1&n&&(r+=e);return r},gE=T,yE=vn,mE=Ei,vE=F,wE=gE(pE),bE=gE("".slice),EE=Math.ceil,SE=function(t){return function(e,r,n){var i,o,s=mE(vE(e)),a=yE(r),c=s.length,u=void 0===n?" ":mE(n);return a<=c||""===u?s:((o=wE(u,EE((i=a-c)/u.length))).length>i&&(o=bE(o,0,i)),t?s+o:o+s)}},_E={start:SE(!1),end:SE(!0)},AE=T,xE=h,IE=_E.start,kE=RangeError,TE=isFinite,RE=Math.abs,BE=Date.prototype,OE=BE.toISOString,ME=AE(BE.getTime),CE=AE(BE.getUTCDate),LE=AE(BE.getUTCFullYear),PE=AE(BE.getUTCHours),NE=AE(BE.getUTCMilliseconds),UE=AE(BE.getUTCMinutes),jE=AE(BE.getUTCMonth),DE=AE(BE.getUTCSeconds),zE=xE((function(){return"0385-07-25T07:06:39.999Z"!==OE.call(new Date(-50000000000001))}))||!xE((function(){OE.call(new Date(NaN))}))?function(){if(!TE(ME(this)))throw new kE("Invalid time value");var t=this,e=LE(t),r=NE(t),n=e<0?"-":e>9999?"+":"";return n+IE(RE(e),n?6:4,0)+"-"+IE(jE(t)+1,2,0)+"-"+IE(CE(t),2,0)+"T"+IE(PE(t),2,0)+":"+IE(UE(t),2,0)+":"+IE(DE(t),2,0)+"."+IE(r,3,0)+"Z"}:OE,FE=zE;ui({target:"Date",proto:!0,forced:Date.prototype.toISOString!==FE},{toISOString:FE});var HE=Wt,$E=ye;ui({target:"Date",proto:!0,arity:1,forced:h((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(t){var e=HE(this),r=$E(e,"number");return"number"!=typeof r||isFinite(r)?e.toISOString():null}});var qE=ze,WE=Mt,VE=TypeError,KE=Gt,GE=on,ZE=function(t){if(qE(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw new VE("Incorrect hint");return WE(this,t)},JE=ce("toPrimitive"),YE=Date.prototype;KE(YE,JE)||GE(YE,JE,ZE);var XE=T,QE=on,tS=Date.prototype,eS="Invalid Date",rS="toString",nS=XE(tS[rS]),iS=XE(tS.getTime);String(new Date(NaN))!==eS&&QE(tS,rS,(function(){var t=iS(this);return t==t?nS(this):eS}));var oS=ui,sS=T,aS=Ei,cS=sS("".charAt),uS=sS("".charCodeAt),fS=sS(/./.exec),hS=sS(1..toString),lS=sS("".toUpperCase),dS=/[\w*+\-./@]/,pS=function(t,e){for(var r=hS(t,16);r.length1?arguments[1]:void 0);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!c(this,t)}}),Fx(o,r?{get:function(t){var e=c(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),Zx&&zx(o,"size",{configurable:!0,get:function(){return s(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=Xx(e),o=Xx(n);Vx(t,e,(function(t,e){Yx(this,{type:n,target:t,state:i(t),kind:e,last:null})}),(function(){for(var t=o(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?Kx("keys"===e?r.key:"values"===e?r.value:[r.key,r.value],!1):(t.target=null,Kx(void 0,!0))}),r?"entries":"values",!r,!0),Gx(e)}};jx("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),Qx);var tI=T,eI=Map.prototype,rI={Map:Map,set:tI(eI.set),get:tI(eI.get),has:tI(eI.has),remove:tI(eI.delete),proto:eI},nI=ui,iI=At,oI=F,sI=Ff,aI=h,cI=rI.Map,uI=rI.has,fI=rI.get,hI=rI.set,lI=T([].push),dI=aI((function(){return 1!==cI.groupBy("ab",(function(t){return t})).get("a").length}));nI({target:"Map",stat:!0,forced:dI},{groupBy:function(t,e){oI(t),iI(e);var r=new cI,n=0;return sI(t,(function(t){var i=e(t,n++);uI(r,i)?lI(fI(r,i),t):hI(r,i,[t])})),r}});var pI=Math.log,gI=Math.log1p||function(t){var e=+t;return e>-1e-8&&e<1e-8?e-e*e/2:pI(1+e)},yI=ui,mI=gI,vI=Math.acosh,wI=Math.log,bI=Math.sqrt,EI=Math.LN2;yI({target:"Math",stat:!0,forced:!vI||710!==Math.floor(vI(Number.MAX_VALUE))||vI(1/0)!==1/0},{acosh:function(t){var e=+t;return e<1?NaN:e>94906265.62425156?wI(e)+EI:mI(e-1+bI(e-1)*bI(e+1))}});var SI=ui,_I=Math.asinh,AI=Math.log,xI=Math.sqrt;SI({target:"Math",stat:!0,forced:!(_I&&1/_I(0)>0)},{asinh:function t(e){var r=+e;return isFinite(r)&&0!==r?r<0?-t(-r):AI(r+xI(r*r+1)):r}});var II=ui,kI=Math.atanh,TI=Math.log;II({target:"Math",stat:!0,forced:!(kI&&1/kI(-0)<0)},{atanh:function(t){var e=+t;return 0===e?e:TI((1+e)/(1-e))/2}});var RI=ui,BI=km,OI=Math.abs,MI=Math.pow;RI({target:"Math",stat:!0},{cbrt:function(t){var e=+t;return BI(e)*MI(OI(e),1/3)}});var CI=ui,LI=Math.floor,PI=Math.log,NI=Math.LOG2E;CI({target:"Math",stat:!0},{clz32:function(t){var e=t>>>0;return e?31-LI(PI(e+.5)*NI):32}});var UI=Math.expm1,jI=Math.exp,DI=!UI||UI(10)>22025.465794806718||UI(10)<22025.465794806718||-2e-17!==UI(-2e-17)?function(t){var e=+t;return 0===e?e:e>-1e-6&&e<1e-6?e+e*e/2:jI(e)-1}:UI,zI=ui,FI=DI,HI=Math.cosh,$I=Math.abs,qI=Math.E;zI({target:"Math",stat:!0,forced:!HI||HI(710)===1/0},{cosh:function(t){var e=FI($I(t)-1)+1;return(e+1/(e*qI*qI))*(qI/2)}});var WI=DI;ui({target:"Math",stat:!0,forced:WI!==Math.expm1},{expm1:WI}),ui({target:"Math",stat:!0},{fround:Lm});var VI=ui,KI=Math.hypot,GI=Math.abs,ZI=Math.sqrt;VI({target:"Math",stat:!0,arity:2,forced:!!KI&&KI(1/0,NaN)!==1/0},{hypot:function(t,e){for(var r,n,i=0,o=0,s=arguments.length,a=0;o0?(n=r/a)*n:r;return a===1/0?1/0:a*ZI(i)}});var JI=ui,YI=h,XI=Math.imul;JI({target:"Math",stat:!0,forced:YI((function(){return-5!==XI(4294967295,5)||2!==XI.length}))},{imul:function(t,e){var r=65535,n=+t,i=+e,o=r&n,s=r&i;return 0|o*s+((r&n>>>16)*s+o*(r&i>>>16)<<16>>>0)}});var QI=Math.log,tk=Math.LOG10E,ek=Math.log10||function(t){return QI(t)*tk};ui({target:"Math",stat:!0},{log10:ek}),ui({target:"Math",stat:!0},{log1p:gI});var rk=ui,nk=Math.log,ik=Math.LN2;rk({target:"Math",stat:!0},{log2:function(t){return nk(t)/ik}}),ui({target:"Math",stat:!0},{sign:km});var ok=ui,sk=h,ak=DI,ck=Math.abs,uk=Math.exp,fk=Math.E;ok({target:"Math",stat:!0,forced:sk((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(t){var e=+t;return ck(e)<1?(ak(e)-ak(-e))/2:(uk(e-1)-uk(-e-1))*(fk/2)}});var hk=ui,lk=DI,dk=Math.exp;hk({target:"Math",stat:!0},{tanh:function(t){var e=+t,r=lk(e),n=lk(-e);return r===1/0?1:n===1/0?-1:(r-n)/(dk(e)+dk(-e))}}),Eo(Math,"Math",!0),ui({target:"Math",stat:!0},{trunc:un});var pk=T(1..valueOf),gk="\t\n\v\f\r                 \u2028\u2029\ufeff",yk=F,mk=Ei,vk=gk,wk=T("".replace),bk=RegExp("^["+vk+"]+"),Ek=RegExp("(^|[^"+vk+"])["+vk+"]+$"),Sk=function(t){return function(e){var r=mk(yk(e));return 1&t&&(r=wk(r,bk,"")),2&t&&(r=wk(r,Ek,"$1")),r}},_k={start:Sk(1),end:Sk(2),trim:Sk(3)},Ak=ui,xk=l,Ik=u,kk=so,Tk=T,Rk=ei,Bk=Gt,Ok=eu,Mk=X,Ck=vt,Lk=ye,Pk=h,Nk=sn.f,Uk=f.f,jk=Pe.f,Dk=pk,zk=_k.trim,Fk="Number",Hk=Ik[Fk];kk[Fk];var $k=Hk.prototype,qk=Ik.TypeError,Wk=Tk("".slice),Vk=Tk("".charCodeAt),Kk=function(t){var e,r,n,i,o,s,a,c,u=Lk(t,"number");if(Ck(u))throw new qk("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=zk(u),43===(e=Vk(u,0))||45===e){if(88===(r=Vk(u,2))||120===r)return NaN}else if(48===e){switch(Vk(u,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(s=(o=Wk(u,2)).length,a=0;ai)return NaN;return parseInt(o,n)}return+u},Gk=Rk(Fk,!Hk(" 0o1")||!Hk("0b1")||Hk("+0x1")),Zk=function(t){var e,r=arguments.length<1?0:Hk(function(t){var e=Lk(t,"number");return"bigint"==typeof e?e:Kk(e)}(t));return Mk($k,e=this)&&Pk((function(){Dk(e)}))?Ok(Object(r),this,Zk):r};Zk.prototype=$k,Gk&&($k.constructor=Zk),Ak({global:!0,constructor:!0,wrap:!0,forced:Gk},{Number:Zk});Gk&&function(t,e){for(var r,n=xk?Nk(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;n.length>i;i++)Bk(e,r=n[i])&&!Bk(t,r)&&jk(t,r,Uk(e,r))}(kk[Fk],Hk),ui({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)});var Jk=u.isFinite,Yk=Number.isFinite||function(t){return"number"==typeof t&&Jk(t)};ui({target:"Number",stat:!0},{isFinite:Yk});var Xk=G,Qk=Math.floor,tT=Number.isInteger||function(t){return!Xk(t)&&isFinite(t)&&Qk(t)===t};ui({target:"Number",stat:!0},{isInteger:tT}),ui({target:"Number",stat:!0},{isNaN:function(t){return t!=t}});var eT=ui,rT=tT,nT=Math.abs;eT({target:"Number",stat:!0},{isSafeInteger:function(t){return rT(t)&&nT(t)<=9007199254740991}}),ui({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991}),ui({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991});var iT=u,oT=h,sT=Ei,aT=_k.trim,cT=gk,uT=T("".charAt),fT=iT.parseFloat,hT=iT.Symbol,lT=hT&&hT.iterator,dT=1/fT(cT+"-0")!=-1/0||lT&&!oT((function(){fT(Object(lT))}))?function(t){var e=aT(sT(t)),r=fT(e);return 0===r&&"-"===uT(e,0)?-0:r}:fT,pT=dT;ui({target:"Number",stat:!0,forced:Number.parseFloat!==pT},{parseFloat:pT});var gT=u,yT=h,mT=T,vT=Ei,wT=_k.trim,bT=gk,ET=gT.parseInt,ST=gT.Symbol,_T=ST&&ST.iterator,AT=/^[+-]?0x/i,xT=mT(AT.exec),IT=8!==ET(bT+"08")||22!==ET(bT+"0x16")||_T&&!yT((function(){ET(Object(_T))}))?function(t,e){var r=wT(vT(t));return ET(r,e>>>0||(xT(AT,r)?16:10))}:ET,kT=IT;ui({target:"Number",stat:!0,forced:Number.parseInt!==kT},{parseInt:kT});var TT=ui,RT=T,BT=hn,OT=pk,MT=pE,CT=ek,LT=h,PT=RangeError,NT=String,UT=isFinite,jT=Math.abs,DT=Math.floor,zT=Math.pow,FT=Math.round,HT=RT(1..toExponential),$T=RT(MT),qT=RT("".slice),WT="-6.9000e-11"===HT(-69e-12,4)&&"1.25e+0"===HT(1.255,2)&&"1.235e+4"===HT(12345,3)&&"3e+1"===HT(25,0);TT({target:"Number",proto:!0,forced:!WT||!(LT((function(){HT(1,1/0)}))&<((function(){HT(1,-1/0)})))||!!LT((function(){HT(1/0,1/0),HT(NaN,1/0)}))},{toExponential:function(t){var e=OT(this);if(void 0===t)return HT(e);var r=BT(t);if(!UT(e))return String(e);if(r<0||r>20)throw new PT("Incorrect fraction digits");if(WT)return HT(e,r);var n,i,o,s,a="";if(e<0&&(a="-",e=-e),0===e)i=0,n=$T("0",r+1);else{var c=CT(e);i=DT(c);var u=zT(10,i-r),f=FT(e/u);2*e>=(2*f+1)*u&&(f+=1),f>=zT(10,r+1)&&(f/=10,i+=1),n=NT(f)}return 0!==r&&(n=qT(n,0,1)+"."+qT(n,1)),0===i?(o="+",s="0"):(o=i>0?"+":"-",s=NT(jT(i))),a+(n+="e"+o+s)}});var VT=ui,KT=T,GT=hn,ZT=pk,JT=pE,YT=h,XT=RangeError,QT=String,tR=Math.floor,eR=KT(JT),rR=KT("".slice),nR=KT(1..toFixed),iR=function(t,e,r){return 0===e?r:e%2==1?iR(t,e-1,r*t):iR(t*t,e/2,r)},oR=function(t,e,r){for(var n=-1,i=r;++n<6;)i+=e*t[n],t[n]=i%1e7,i=tR(i/1e7)},sR=function(t,e){for(var r=6,n=0;--r>=0;)n+=t[r],t[r]=tR(n/e),n=n%e*1e7},aR=function(t){for(var e=6,r="";--e>=0;)if(""!==r||0===e||0!==t[e]){var n=QT(t[e]);r=""===r?n:r+eR("0",7-n.length)+n}return r};VT({target:"Number",proto:!0,forced:YT((function(){return"0.000"!==nR(8e-5,3)||"1"!==nR(.9,0)||"1.25"!==nR(1.255,2)||"1000000000000000128"!==nR(0xde0b6b3a7640080,0)}))||!YT((function(){nR({})}))},{toFixed:function(t){var e,r,n,i,o=ZT(this),s=GT(t),a=[0,0,0,0,0,0],c="",u="0";if(s<0||s>20)throw new XT("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return QT(o);if(o<0&&(c="-",o=-o),o>1e-21)if(e=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e}(o*iR(2,69,1))-69,r=e<0?o*iR(2,-e,1):o/iR(2,e,1),r*=4503599627370496,(e=52-e)>0){for(oR(a,0,r),n=s;n>=7;)oR(a,1e7,0),n-=7;for(oR(a,iR(10,n,1),0),n=e-1;n>=23;)sR(a,1<<23),n-=23;sR(a,1<0?c+((i=u.length)<=s?"0."+eR("0",s-i)+u:rR(u,0,i-s)+"."+rR(u,i-s)):c+u}});var cR=ui,uR=h,fR=pk,hR=T(1..toPrecision);cR({target:"Number",proto:!0,forced:uR((function(){return"1"!==hR(1,void 0)}))||!uR((function(){hR({})}))},{toPrecision:function(t){return void 0===t?hR(fR(this)):hR(fR(this),t)}});var lR=l,dR=T,pR=y,gR=h,yR=xi,mR=Pn,vR=m,wR=Wt,bR=U,ER=Object.assign,SR=Object.defineProperty,_R=dR([].concat),AR=!ER||gR((function(){if(lR&&1!==ER({b:1},ER(SR({},"a",{enumerable:!0,get:function(){SR(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!==ER({},t)[r]||yR(ER({},e)).join("")!==n}))?function(t,e){for(var r=wR(t),n=arguments.length,i=1,o=mR.f,s=vR.f;n>i;)for(var a,c=bR(arguments[i++]),u=o?_R(yR(c),o(c)):yR(c),f=u.length,h=0;f>h;)a=u[h++],lR&&!pR(s,c,a)||(r[a]=c[a]);return r}:ER,xR=AR;ui({target:"Object",stat:!0,arity:2,forced:Object.assign!==xR},{assign:xR}),ui({target:"Object",stat:!0,sham:!l},{create:Ki});var IR=u,kR=qg,TR=!h((function(){if(!(kR&&kR<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete IR[t]}})),RR=At,BR=Wt,OR=Pe;l&&ui({target:"Object",proto:!0,forced:TR},{__defineGetter__:function(t,e){OR.f(BR(this),t,{get:RR(e),enumerable:!0,configurable:!0})}});var MR=ui,CR=l,LR=Si.f;MR({target:"Object",stat:!0,forced:Object.defineProperties!==LR,sham:!CR},{defineProperties:LR});var PR=ui,NR=l,UR=Pe.f;PR({target:"Object",stat:!0,forced:Object.defineProperty!==UR,sham:!NR},{defineProperty:UR});var jR=At,DR=Wt,zR=Pe;l&&ui({target:"Object",proto:!0,forced:TR},{__defineSetter__:function(t,e){zR.f(DR(this),t,{set:jR(e),enumerable:!0,configurable:!0})}});var FR=l,HR=h,$R=T,qR=of,WR=xi,VR=q,KR=$R(m.f),GR=$R([].push),ZR=FR&&HR((function(){var t=Object.create(null);return t[2]=2,!KR(t,2)})),JR=function(t){return function(e){for(var r,n=VR(e),i=WR(n),o=ZR&&null===qR(n),s=i.length,a=0,c=[];s>a;)r=i[a++],FR&&!(o?r in n:KR(n,r))||GR(c,t?[r,n[r]]:n[r]);return c}},YR={entries:JR(!0),values:JR(!1)},XR=YR.entries;ui({target:"Object",stat:!0},{entries:function(t){return XR(t)}});var QR=ui,tB=ax,eB=h,rB=G,nB=QA.exports.onFreeze,iB=Object.freeze;QR({target:"Object",stat:!0,forced:eB((function(){iB(1)})),sham:!tB},{freeze:function(t){return iB&&rB(t)?iB(nB(t)):t}});var oB=Ff,sB=kh;ui({target:"Object",stat:!0},{fromEntries:function(t){var e={};return oB(t,(function(t,r){sB(e,t,r)}),{AS_ENTRIES:!0}),e}});var aB=ui,cB=h,uB=q,fB=f.f,hB=l;aB({target:"Object",stat:!0,forced:!hB||cB((function(){fB(1)})),sham:!hB},{getOwnPropertyDescriptor:function(t,e){return fB(uB(t),e)}});var lB=Fn,dB=q,pB=f,gB=kh;ui({target:"Object",stat:!0,sham:!l},{getOwnPropertyDescriptors:function(t){for(var e,r,n=dB(t),i=pB.f,o=lB(n),s={},a=0;o.length>a;)void 0!==(r=i(n,e=o[a++]))&&gB(s,e,r);return s}});var yB=ui,mB=h,vB=Gi.f;yB({target:"Object",stat:!0,forced:mB((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:vB});var wB=Wt,bB=of,EB=Ju;ui({target:"Object",stat:!0,forced:h((function(){bB(1)})),sham:!EB},{getPrototypeOf:function(t){return bB(wB(t))}});var SB=ui,_B=Y,AB=T,xB=At,IB=F,kB=we,TB=Ff,RB=h,BB=Object.groupBy,OB=_B("Object","create"),MB=AB([].push),CB=!BB||RB((function(){return 1!==BB("ab",(function(t){return t})).a.length}));SB({target:"Object",stat:!0,forced:CB},{groupBy:function(t,e){IB(t),xB(e);var r=OB(null),n=0;return TB(t,(function(t){var i=kB(e(t,n++));i in r?MB(r[i],t):r[i]=[t]})),r}}),ui({target:"Object",stat:!0},{hasOwn:Gt});var LB=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};ui({target:"Object",stat:!0},{is:LB});var PB=sx;ui({target:"Object",stat:!0,forced:Object.isExtensible!==PB},{isExtensible:PB});var NB=ui,UB=h,jB=G,DB=M,zB=tx,FB=Object.isFrozen;NB({target:"Object",stat:!0,forced:zB||UB((function(){FB(1)}))},{isFrozen:function(t){return!jB(t)||(!(!zB||"ArrayBuffer"!==DB(t))||!!FB&&FB(t))}});var HB=ui,$B=h,qB=G,WB=M,VB=tx,KB=Object.isSealed;HB({target:"Object",stat:!0,forced:VB||$B((function(){KB(1)}))},{isSealed:function(t){return!qB(t)||(!(!VB||"ArrayBuffer"!==WB(t))||!!KB&&KB(t))}});var GB=Wt,ZB=xi;ui({target:"Object",stat:!0,forced:h((function(){ZB(1)}))},{keys:function(t){return ZB(GB(t))}});var JB=ui,YB=l,XB=TR,QB=Wt,tO=we,eO=of,rO=f.f;YB&&JB({target:"Object",proto:!0,forced:XB},{__lookupGetter__:function(t){var e,r=QB(this),n=tO(t);do{if(e=rO(r,n))return e.get}while(r=eO(r))}});var nO=ui,iO=l,oO=TR,sO=Wt,aO=we,cO=of,uO=f.f;iO&&nO({target:"Object",proto:!0,forced:oO},{__lookupSetter__:function(t){var e,r=sO(this),n=aO(t);do{if(e=uO(r,n))return e.set}while(r=cO(r))}});var fO=ui,hO=G,lO=QA.exports.onFreeze,dO=ax,pO=h,gO=Object.preventExtensions;fO({target:"Object",stat:!0,forced:pO((function(){gO(1)})),sham:!dO},{preventExtensions:function(t){return gO&&hO(t)?gO(lO(t)):t}});var yO=l,mO=no,vO=G,wO=zc,bO=Wt,EO=F,SO=Object.getPrototypeOf,_O=Object.setPrototypeOf,AO=Object.prototype,xO="__proto__";if(yO&&SO&&_O&&!(xO in AO))try{mO(AO,xO,{configurable:!0,get:function(){return SO(bO(this))},set:function(t){var e=EO(this);wO(t)&&vO(e)&&_O(e,t)}})}catch(OPt){}var IO=ui,kO=G,TO=QA.exports.onFreeze,RO=ax,BO=h,OO=Object.seal;IO({target:"Object",stat:!0,forced:BO((function(){OO(1)})),sham:!RO},{seal:function(t){return OO&&kO(t)?OO(TO(t)):t}}),ui({target:"Object",stat:!0},{setPrototypeOf:Zc});var MO=vi,CO=hi?{}.toString:function(){return"[object "+MO(this)+"]"};hi||on(Object.prototype,"toString",CO,{unsafe:!0});var LO=YR.values;ui({target:"Object",stat:!0},{values:function(t){return LO(t)}});ui({global:!0,forced:parseFloat!==dT},{parseFloat:dT});ui({global:!0,forced:parseInt!==IT},{parseInt:IT});var PO,NO,UO,jO,DO=$o,zO=bt,FO=TypeError,HO=function(t){if(DO(t))return t;throw new FO(zO(t)+" is not a constructor")},$O=ze,qO=HO,WO=j,VO=ce("species"),KO=function(t,e){var r,n=$O(t).constructor;return void 0===n||WO(r=$O(n)[VO])?e:qO(r)},GO=TypeError,ZO=function(t,e){if(t1?pP(arguments,1):[],r=gP.f(this),n=mP((function(){return dP(yP(t),void 0,e)}));return(n.error?r.reject:r.resolve)(n.value),r.promise}});var bP=yC;ui({target:"Promise",stat:!0},{withResolvers:function(){var t=bP.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var EP=La,SP=At,_P=ze;ui({target:"Reflect",stat:!0,forced:!h((function(){Reflect.apply((function(){}))}))},{apply:function(t,e,r){return EP(SP(t),e,_P(r))}});var AP=ui,xP=La,IP=xS,kP=HO,TP=ze,RP=G,BP=Ki,OP=h,MP=Y("Reflect","construct"),CP=Object.prototype,LP=[].push,PP=OP((function(){function t(){}return!(MP((function(){}),[],t)instanceof t)})),NP=!OP((function(){MP((function(){}))})),UP=PP||NP;AP({target:"Reflect",stat:!0,forced:UP,sham:UP},{construct:function(t,e){kP(t),TP(e);var r=arguments.length<3?t:kP(arguments[2]);if(NP&&!PP)return MP(t,e,r);if(t===r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return xP(LP,n,e),new(xP(IP,t,n))}var i=r.prototype,o=BP(RP(i)?i:CP),s=xP(t,o,e);return RP(s)?s:o}});var jP=l,DP=ze,zP=we,FP=Pe;ui({target:"Reflect",stat:!0,forced:h((function(){Reflect.defineProperty(FP.f({},1,{value:1}),1,{value:2})})),sham:!jP},{defineProperty:function(t,e,r){DP(t);var n=zP(e);DP(r);try{return FP.f(t,n,r),!0}catch(t){return!1}}});var HP=ui,$P=ze,qP=f.f;HP({target:"Reflect",stat:!0},{deleteProperty:function(t,e){var r=qP($P(t),e);return!(r&&!r.configurable)&&delete t[e]}});var WP=Gt,VP=function(t){return void 0!==t&&(WP(t,"value")||WP(t,"writable"))},KP=y,GP=G,ZP=ze,JP=VP,YP=f,XP=of;ui({target:"Reflect",stat:!0},{get:function t(e,r){var n,i,o=arguments.length<3?e:arguments[2];return ZP(e)===o?e[r]:(n=YP.f(e,r))?JP(n)?n.value:void 0===n.get?void 0:KP(n.get,o):GP(i=XP(e))?t(i,r,o):void 0}});var QP=ze,tN=f;ui({target:"Reflect",stat:!0,sham:!l},{getOwnPropertyDescriptor:function(t,e){return tN.f(QP(t),e)}});var eN=ze,rN=of;ui({target:"Reflect",stat:!0,sham:!Ju},{getPrototypeOf:function(t){return rN(eN(t))}}),ui({target:"Reflect",stat:!0},{has:function(t,e){return e in t}});var nN=ze,iN=sx;ui({target:"Reflect",stat:!0},{isExtensible:function(t){return nN(t),iN(t)}}),ui({target:"Reflect",stat:!0},{ownKeys:Fn});var oN=Y,sN=ze;ui({target:"Reflect",stat:!0,sham:!ax},{preventExtensions:function(t){sN(t);try{var e=oN("Object","preventExtensions");return e&&e(t),!0}catch(t){return!1}}});var aN=ui,cN=y,uN=ze,fN=G,hN=VP,lN=Pe,dN=f,pN=of,gN=_;var yN=h((function(){var t=function(){},e=lN.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,e)}));aN({target:"Reflect",stat:!0,forced:yN},{set:function t(e,r,n){var i,o,s,a=arguments.length<4?e:arguments[3],c=dN.f(uN(e),r);if(!c){if(fN(o=pN(e)))return t(o,r,n,a);c=gN(0)}if(hN(c)){if(!1===c.writable||!fN(a))return!1;if(i=dN.f(a,r)){if(i.get||i.set||!1===i.writable)return!1;i.value=n,lN.f(a,r,i)}else lN.f(a,r,gN(0,n))}else{if(void 0===(s=c.set))return!1;cN(s,a,n)}return!0}});var mN=ze,vN=qc,wN=Zc;wN&&ui({target:"Reflect",stat:!0},{setPrototypeOf:function(t,e){mN(t),vN(e);try{return wN(t,e),!0}catch(t){return!1}}});var bN=u,EN=Eo;ui({global:!0},{Reflect:{}}),EN(bN.Reflect,"Reflect",!0);var SN=G,_N=M,AN=ce("match"),xN=function(t){var e;return SN(t)&&(void 0!==(e=t[AN])?!!e:"RegExp"===_N(t))},IN=ze,kN=function(){var t=IN(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},TN=y,RN=Gt,BN=X,ON=kN,MN=RegExp.prototype,CN=function(t){var e=t.flags;return void 0!==e||"flags"in MN||RN(t,"flags")||!BN(MN,t)?e:TN(ON,t)},LN=h,PN=u.RegExp,NN=LN((function(){var t=PN("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),UN=NN||LN((function(){return!PN("a","y").sticky})),jN=NN||LN((function(){var t=PN("^r","gy");return t.lastIndex=2,null!==t.exec("str")})),DN={BROKEN_CARET:jN,MISSED_STICKY:UN,UNSUPPORTED_Y:NN},zN=h,FN=u.RegExp,HN=zN((function(){var t=FN(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})),$N=h,qN=u.RegExp,WN=$N((function(){var t=qN("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")})),VN=l,KN=u,GN=T,ZN=ei,JN=eu,YN=tr,XN=Ki,QN=sn.f,tU=X,eU=xN,rU=Ei,nU=CN,iU=DN,oU=Yc,sU=on,aU=h,cU=Gt,uU=Nr.enforce,fU=yy,hU=HN,lU=WN,dU=ce("match"),pU=KN.RegExp,gU=pU.prototype,yU=KN.SyntaxError,mU=GN(gU.exec),vU=GN("".charAt),wU=GN("".replace),bU=GN("".indexOf),EU=GN("".slice),SU=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,_U=/a/g,AU=/a/g,xU=new pU(_U)!==_U,IU=iU.MISSED_STICKY,kU=iU.UNSUPPORTED_Y,TU=VN&&(!xU||IU||hU||lU||aU((function(){return AU[dU]=!1,pU(_U)!==_U||pU(AU)===AU||"/a/i"!==String(pU(_U,"i"))})));if(ZN("RegExp",TU)){for(var RU=function(t,e){var r,n,i,o,s,a,c=tU(gU,this),u=eU(t),f=void 0===e,h=[],l=t;if(!c&&u&&f&&t.constructor===RU)return t;if((u||tU(gU,t))&&(t=t.source,f&&(e=nU(l))),t=void 0===t?"":rU(t),e=void 0===e?"":rU(e),l=t,hU&&"dotAll"in _U&&(n=!!e&&bU(e,"s")>-1)&&(e=wU(e,/s/g,"")),r=e,IU&&"sticky"in _U&&(i=!!e&&bU(e,"y")>-1)&&kU&&(e=wU(e,/y/g,"")),lU&&(o=function(t){for(var e,r=t.length,n=0,i="",o=[],s=XN(null),a=!1,c=!1,u=0,f="";n<=r;n++){if("\\"===(e=vU(t,n)))e+=vU(t,++n);else if("]"===e)a=!1;else if(!a)switch(!0){case"["===e:a=!0;break;case"("===e:if(i+=e,"?:"===EU(t,n+1,n+3))continue;mU(SU,EU(t,n+1))&&(n+=2,c=!0),u++;continue;case">"===e&&c:if(""===f||cU(s,f))throw new yU("Invalid capture group name");s[f]=!0,o[o.length]=[f,u],c=!1,f="";continue}c?f+=e:i+=e}return[i,o]}(t),t=o[0],h=o[1]),s=JN(pU(t,e),c?this:gU,RU),(n||i||h.length)&&(a=uU(s),n&&(a.dotAll=!0,a.raw=RU(function(t){for(var e,r=t.length,n=0,i="",o=!1;n<=r;n++)"\\"!==(e=vU(t,n))?o||"."!==e?("["===e?o=!0:"]"===e&&(o=!1),i+=e):i+="[\\s\\S]":i+=e+vU(t,++n);return i}(t),r)),i&&(a.sticky=!0),h.length&&(a.groups=h)),t!==l)try{YN(s,"source",""===l?"(?:)":l)}catch(t){}return s},BU=QN(pU),OU=0;BU.length>OU;)oU(RU,pU,BU[OU++]);gU.constructor=RU,RU.prototype=gU,sU(KN,"RegExp",RU,{constructor:!0})}fU("RegExp");var MU=l,CU=HN,LU=M,PU=no,NU=Nr.get,UU=RegExp.prototype,jU=TypeError;MU&&CU&&PU(UU,"dotAll",{configurable:!0,get:function(){if(this!==UU){if("RegExp"===LU(this))return!!NU(this).dotAll;throw new jU("Incompatible receiver, RegExp required")}}});var DU=y,zU=T,FU=Ei,HU=kN,$U=DN,qU=Ki,WU=Nr.get,VU=HN,KU=WN,GU=Ht("native-string-replace",String.prototype.replace),ZU=RegExp.prototype.exec,JU=ZU,YU=zU("".charAt),XU=zU("".indexOf),QU=zU("".replace),tj=zU("".slice),ej=function(){var t=/a/,e=/b*/g;return DU(ZU,t,"a"),DU(ZU,e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),rj=$U.BROKEN_CARET,nj=void 0!==/()??/.exec("")[1];(ej||nj||rj||VU||KU)&&(JU=function(t){var e,r,n,i,o,s,a,c=this,u=WU(c),f=FU(t),h=u.raw;if(h)return h.lastIndex=c.lastIndex,e=DU(JU,h,f),c.lastIndex=h.lastIndex,e;var l=u.groups,d=rj&&c.sticky,p=DU(HU,c),g=c.source,y=0,m=f;if(d&&(p=QU(p,"y",""),-1===XU(p,"g")&&(p+="g"),m=tj(f,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==YU(f,c.lastIndex-1))&&(g="(?: "+g+")",m=" "+m,y++),r=new RegExp("^(?:"+g+")",p)),nj&&(r=new RegExp("^"+g+"$(?!\\s)",p)),ej&&(n=c.lastIndex),i=DU(ZU,d?r:c,m),d?i?(i.input=tj(i.input,y),i[0]=tj(i[0],y),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:ej&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),nj&&i&&i.length>1&&DU(GU,i[0],r,(function(){for(o=1;or.size?OD(r.getIterator(),(function(t){LD(e,t)&&CD(n,t)})):BD(e,(function(t){r.includes(t)&&CD(n,t)})),n},ND=h,UD=PD;ui({target:"Set",proto:!0,real:!0,forced:!xD("intersection")||ND((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:UD});var jD=Fj,DD=Dj.has,zD=rD,FD=dD,HD=Yj,$D=$j,qD=kf,WD=function(t){var e=jD(this),r=FD(t);if(zD(e)<=r.size)return!1!==HD(e,(function(t){if(r.includes(t))return!1}),!0);var n=r.getIterator();return!1!==$D(n,(function(t){if(DD(e,t))return qD(n,"normal",!1)}))},VD=WD;ui({target:"Set",proto:!0,real:!0,forced:!xD("isDisjointFrom")},{isDisjointFrom:VD});var KD=Fj,GD=rD,ZD=Yj,JD=dD,YD=function(t){var e=KD(this),r=JD(t);return!(GD(e)>r.size)&&!1!==ZD(e,(function(t){if(!r.includes(t))return!1}),!0)},XD=YD;ui({target:"Set",proto:!0,real:!0,forced:!xD("isSubsetOf")},{isSubsetOf:XD});var QD=Fj,tz=Dj.has,ez=rD,rz=dD,nz=$j,iz=kf,oz=function(t){var e=QD(this),r=rz(t);if(ez(e)=0?n:r+n;return i<0||i>=r?void 0:Tz(e,i)}});var Rz=T,Bz=hn,Oz=Ei,Mz=F,Cz=Rz("".charAt),Lz=Rz("".charCodeAt),Pz=Rz("".slice),Nz=function(t){return function(e,r){var n,i,o=Oz(Mz(e)),s=Bz(r),a=o.length;return s<0||s>=a?t?"":void 0:(n=Lz(o,s))<55296||n>56319||s+1===a||(i=Lz(o,s+1))<56320||i>57343?t?Cz(o,s):n:t?Pz(o,s,s+2):i-56320+(n-55296<<10)+65536}},Uz={codeAt:Nz(!1),charAt:Nz(!0)},jz=Uz.codeAt;ui({target:"String",proto:!0},{codePointAt:function(t){return jz(this,t)}});var Dz=xN,zz=TypeError,Fz=function(t){if(Dz(t))throw new zz("The method doesn't accept regular expressions");return t},Hz=ce("match"),$z=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[Hz]=!1,"/./"[t](e)}catch(t){}}return!1},qz=ui,Wz=Ao,Vz=f.f,Kz=vn,Gz=Ei,Zz=Fz,Jz=F,Yz=$z,Xz=Wz("".slice),Qz=Math.min,tF=Yz("endsWith"),eF=!tF&&!!function(){var t=Vz(String.prototype,"endsWith");return t&&!t.writable}();qz({target:"String",proto:!0,forced:!eF&&!tF},{endsWith:function(t){var e=Gz(Jz(this));Zz(t);var r=arguments.length>1?arguments[1]:void 0,n=e.length,i=void 0===r?n:Qz(Kz(r),n),o=Gz(t);return Xz(e,i-o.length,i)===o}});var rF=ui,nF=T,iF=gn,oF=RangeError,sF=String.fromCharCode,aF=String.fromCodePoint,cF=nF([].join);rF({target:"String",stat:!0,arity:1,forced:!!aF&&1!==aF.length},{fromCodePoint:function(t){for(var e,r=[],n=arguments.length,i=0;n>i;){if(e=+arguments[i++],iF(e,1114111)!==e)throw new oF(e+" is not a valid code point");r[i]=e<65536?sF(e):sF(55296+((e-=65536)>>10),e%1024+56320)}return cF(r,"")}});var uF=ui,fF=Fz,hF=F,lF=Ei,dF=$z,pF=T("".indexOf);uF({target:"String",proto:!0,forced:!dF("includes")},{includes:function(t){return!!~pF(lF(hF(this)),lF(fF(t)),arguments.length>1?arguments[1]:void 0)}});var gF=ui,yF=F,mF=Ei,vF=T("".charCodeAt);gF({target:"String",proto:!0},{isWellFormed:function(){for(var t=mF(yF(this)),e=t.length,r=0;r=56320||++r>=e||56320!=(64512&vF(t,r))))return!1}return!0}});var wF=Uz.charAt,bF=Ei,EF=Nr,SF=ap,_F=cp,AF="String Iterator",xF=EF.set,IF=EF.getterFor(AF);SF(String,"String",(function(t){xF(this,{type:AF,string:bF(t),index:0})}),(function(){var t,e=IF(this),r=e.string,n=e.index;return n>=r.length?_F(void 0,!0):(t=wF(r,n),e.index+=t.length,_F(t,!1))}));var kF=y,TF=on,RF=ij,BF=h,OF=ce,MF=tr,CF=OF("species"),LF=RegExp.prototype,PF=function(t,e,r,n){var i=OF(t),o=!BF((function(){var e={};return e[i]=function(){return 7},7!==""[t](e)})),s=o&&!BF((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[CF]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return e=!0,null},r[i](""),!e}));if(!o||!s||r){var a=/./[i],c=e(i,""[t],(function(t,e,r,n,i){var s=e.exec;return s===RF||s===LF.exec?o&&!i?{done:!0,value:kF(a,e,r,n)}:{done:!0,value:kF(t,r,e,n)}:{done:!1}}));TF(String.prototype,t,c[0]),TF(LF,i,c[1])}n&&MF(LF[i],"sham",!0)},NF=Uz.charAt,UF=function(t,e,r){return e+(r?NF(t,e).length:1)},jF=y,DF=ze,zF=V,FF=M,HF=ij,$F=TypeError,qF=function(t,e){var r=t.exec;if(zF(r)){var n=jF(r,t,e);return null!==n&&DF(n),n}if("RegExp"===FF(t))return jF(HF,t,e);throw new $F("RegExp#exec called on incompatible receiver")},WF=y,VF=ze,KF=j,GF=vn,ZF=Ei,JF=F,YF=kt,XF=UF,QF=qF;PF("match",(function(t,e,r){return[function(e){var r=JF(this),n=KF(e)?void 0:YF(e,t);return n?WF(n,e,r):new RegExp(e)[t](ZF(r))},function(t){var n=VF(this),i=ZF(t),o=r(e,n,i);if(o.done)return o.value;if(!n.global)return QF(n,i);var s=n.unicode;n.lastIndex=0;for(var a,c=[],u=0;null!==(a=QF(n,i));){var f=ZF(a[0]);c[u]=f,""===f&&(n.lastIndex=XF(i,GF(n.lastIndex),s)),u++}return 0===u?null:c}]}));var tH=ui,eH=y,rH=Ao,nH=Fd,iH=cp,oH=F,sH=vn,aH=Ei,cH=ze,uH=j,fH=xN,hH=CN,lH=kt,dH=on,pH=h,gH=KO,yH=UF,mH=qF,vH=Nr,wH=ce("matchAll"),bH="RegExp String",EH=bH+" Iterator",SH=vH.set,_H=vH.getterFor(EH),AH=RegExp.prototype,xH=TypeError,IH=rH("".indexOf),kH=rH("".matchAll),TH=!!kH&&!pH((function(){kH("a",/./)})),RH=nH((function(t,e,r,n){SH(this,{type:EH,regexp:t,string:e,global:r,unicode:n,done:!1})}),bH,(function(){var t=_H(this);if(t.done)return iH(void 0,!0);var e=t.regexp,r=t.string,n=mH(e,r);return null===n?(t.done=!0,iH(void 0,!0)):t.global?(""===aH(n[0])&&(e.lastIndex=yH(r,sH(e.lastIndex),t.unicode)),iH(n,!1)):(t.done=!0,iH(n,!1))})),BH=function(t){var e,r,n,i=cH(this),o=aH(t),s=gH(i,RegExp),a=aH(hH(i));return e=new s(s===RegExp?i.source:i,a),r=!!~IH(a,"g"),n=!!~IH(a,"u"),e.lastIndex=sH(i.lastIndex),new RH(e,o,r,n)};tH({target:"String",proto:!0,forced:TH},{matchAll:function(t){var e,r,n,i=oH(this);if(uH(t)){if(TH)return kH(i,t)}else{if(fH(t)&&(e=aH(oH(hH(t))),!~IH(e,"g")))throw new xH("`.matchAll` does not allow non-global regexes");if(TH)return kH(i,t);if(n=lH(t,wH))return eH(n,t,i)}return r=aH(i),new RegExp(t,"g")[wH](r)}}),wH in AH||dH(AH,wH,BH);var OH=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(et),MH=_E.end;ui({target:"String",proto:!0,forced:OH},{padEnd:function(t){return MH(this,t,arguments.length>1?arguments[1]:void 0)}});var CH=_E.start;ui({target:"String",proto:!0,forced:OH},{padStart:function(t){return CH(this,t,arguments.length>1?arguments[1]:void 0)}});var LH=ui,PH=T,NH=q,UH=Wt,jH=Ei,DH=bn,zH=PH([].push),FH=PH([].join);LH({target:"String",stat:!0},{raw:function(t){var e=NH(UH(t).raw),r=DH(e);if(!r)return"";for(var n=arguments.length,i=[],o=0;;){if(zH(i,jH(e[o++])),o===r)return FH(i,"");o]*>)/g,ZH=/\$([$&'`]|\d{1,2})/g,JH=function(t,e,r,n,i,o){var s=r+t.length,a=n.length,c=ZH;return void 0!==i&&(i=$H(i),c=GH),VH(o,c,(function(o,c){var u;switch(WH(c,0)){case"$":return"$";case"&":return t;case"`":return KH(e,0,r);case"'":return KH(e,s);case"<":u=i[KH(c,1,-1)];break;default:var f=+c;if(0===f)return o;if(f>a){var h=qH(f/10);return 0===h?o:h<=a?void 0===n[h-1]?WH(c,1):n[h-1]+WH(c,1):o}u=n[f-1]}return void 0===u?"":u}))},YH=La,XH=y,QH=T,t$=PF,e$=h,r$=ze,n$=V,i$=j,o$=hn,s$=vn,a$=Ei,c$=F,u$=UF,f$=kt,h$=JH,l$=qF,d$=ce("replace"),p$=Math.max,g$=Math.min,y$=QH([].concat),m$=QH([].push),v$=QH("".indexOf),w$=QH("".slice),b$=function(t){return void 0===t?t:String(t)},E$="$0"==="a".replace(/./,"$0"),S$=!!/./[d$]&&""===/./[d$]("a","$0"),_$=!e$((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}));t$("replace",(function(t,e,r){var n=S$?"$":"$0";return[function(t,r){var n=c$(this),i=i$(t)?void 0:f$(t,d$);return i?XH(i,t,n,r):XH(e,a$(n),t,r)},function(t,i){var o=r$(this),s=a$(t);if("string"==typeof i&&-1===v$(i,n)&&-1===v$(i,"$<")){var a=r(e,o,s,i);if(a.done)return a.value}var c=n$(i);c||(i=a$(i));var u,f=o.global;f&&(u=o.unicode,o.lastIndex=0);for(var h,l=[];null!==(h=l$(o,s))&&(m$(l,h),f);){""===a$(h[0])&&(o.lastIndex=u$(s,s$(o.lastIndex),u))}for(var d="",p=0,g=0;g=p&&(d+=w$(s,p,v)+y,p=v+m.length)}return d+w$(s,p)}]}),!_$||!E$||S$);var A$=ui,x$=y,I$=T,k$=F,T$=V,R$=j,B$=xN,O$=Ei,M$=kt,C$=CN,L$=JH,P$=ce("replace"),N$=TypeError,U$=I$("".indexOf);I$("".replace);var j$=I$("".slice),D$=Math.max;A$({target:"String",proto:!0},{replaceAll:function(t,e){var r,n,i,o,s,a,c,u,f,h=k$(this),l=0,d="";if(!R$(t)){if(B$(t)&&(r=O$(k$(C$(t))),!~U$(r,"g")))throw new N$("`.replaceAll` does not allow non-global regexes");if(n=M$(t,P$))return x$(n,t,h,e)}for(i=O$(h),o=O$(t),(s=T$(e))||(e=O$(e)),a=o.length,c=D$(1,a),u=U$(i,o);-1!==u;)f=s?O$(e(o,u,i)):L$(o,i,u,[],void 0,e),d+=j$(i,l,u)+f,l=u+a,u=u+c>i.length?-1:U$(i,o,u+c);return l1||"".split(/.?/).length;J$("split",(function(t,e,r){var n="0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:G$(e,this,t,r)}:e;return[function(e,r){var i=Q$(this),o=X$(e)?void 0:iq(e,t);return o?G$(o,e,i,r):G$(n,nq(i),e,r)},function(t,i){var o=Y$(this),s=nq(t);if(!lq){var a=r(n,o,s,i,n!==e);if(a.done)return a.value}var c=tq(o,RegExp),u=o.unicode,f=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(aq?"g":"y"),h=new c(aq?"^(?:"+o.source+")":o,f),l=void 0===i?4294967295:i>>>0;if(0===l)return[];if(0===s.length)return null===oq(h,s)?[s]:[];for(var d=0,p=0,g=[];p1?arguments[1]:void 0,e.length)),n=mq(t);return Eq(e,r,r+n.length)===n}});var xq=ui,Iq=F,kq=hn,Tq=Ei,Rq=T("".slice),Bq=Math.max,Oq=Math.min;xq({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(t,e){var r,n,i=Tq(Iq(this)),o=i.length,s=kq(t);return s===1/0&&(s=0),s<0&&(s=Bq(o+s,0)),(r=void 0===e?o:kq(e))<=0||r===1/0||s>=(n=Oq(s+r,o))?"":Rq(i,s,n)}});var Mq=ui,Cq=y,Lq=T,Pq=F,Nq=Ei,Uq=h,jq=Array,Dq=Lq("".charAt),zq=Lq("".charCodeAt),Fq=Lq([].join),Hq="".toWellFormed,$q=Hq&&Uq((function(){return"1"!==Cq(Hq,1)}));Mq({target:"String",proto:!0,forced:$q},{toWellFormed:function(){var t=Nq(Pq(this));if($q)return Cq(Hq,t);for(var e=t.length,r=jq(e),n=0;n=56320||n+1>=e||56320!=(64512&zq(t,n+1))?r[n]="�":(r[n]=Dq(t,n),r[++n]=Dq(t,n))}return Fq(r,"")}});var qq=ar.PROPER,Wq=h,Vq=gk,Kq=function(t){return Wq((function(){return!!Vq[t]()||"​…᠎"!=="​…᠎"[t]()||qq&&Vq[t].name!==t}))},Gq=_k.trim;ui({target:"String",proto:!0,forced:Kq("trim")},{trim:function(){return Gq(this)}});var Zq=_k.end,Jq=Kq("trimEnd")?function(){return Zq(this)}:"".trimEnd;ui({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==Jq},{trimRight:Jq});ui({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==Jq},{trimEnd:Jq});var Yq=_k.start,Xq=Kq("trimStart")?function(){return Yq(this)}:"".trimStart;ui({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==Xq},{trimLeft:Xq});ui({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==Xq},{trimStart:Xq});var Qq=F,tW=Ei,eW=/"/g,rW=T("".replace),nW=function(t,e,r,n){var i=tW(Qq(t)),o="<"+e;return""!==r&&(o+=" "+r+'="'+rW(tW(n),eW,""")+'"'),o+">"+i+""},iW=h,oW=function(t){return iW((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))},sW=nW;ui({target:"String",proto:!0,forced:oW("anchor")},{anchor:function(t){return sW(this,"a","name",t)}});var aW=nW;ui({target:"String",proto:!0,forced:oW("big")},{big:function(){return aW(this,"big","","")}});var cW=nW;ui({target:"String",proto:!0,forced:oW("blink")},{blink:function(){return cW(this,"blink","","")}});var uW=nW;ui({target:"String",proto:!0,forced:oW("bold")},{bold:function(){return uW(this,"b","","")}});var fW=nW;ui({target:"String",proto:!0,forced:oW("fixed")},{fixed:function(){return fW(this,"tt","","")}});var hW=nW;ui({target:"String",proto:!0,forced:oW("fontcolor")},{fontcolor:function(t){return hW(this,"font","color",t)}});var lW=nW;ui({target:"String",proto:!0,forced:oW("fontsize")},{fontsize:function(t){return lW(this,"font","size",t)}});var dW=nW;ui({target:"String",proto:!0,forced:oW("italics")},{italics:function(){return dW(this,"i","","")}});var pW=nW;ui({target:"String",proto:!0,forced:oW("link")},{link:function(t){return pW(this,"a","href",t)}});var gW=nW;ui({target:"String",proto:!0,forced:oW("small")},{small:function(){return gW(this,"small","","")}});var yW=nW;ui({target:"String",proto:!0,forced:oW("strike")},{strike:function(){return yW(this,"strike","","")}});var mW=nW;ui({target:"String",proto:!0,forced:oW("sub")},{sub:function(){return mW(this,"sub","","")}});var vW=nW;ui({target:"String",proto:!0,forced:oW("sup")},{sup:function(){return vW(this,"sup","","")}});var wW={exports:{}},bW=u,EW=h,SW=pd,_W=Ow.NATIVE_ARRAY_BUFFER_VIEWS,AW=bW.ArrayBuffer,xW=bW.Int8Array,IW=!_W||!EW((function(){xW(1)}))||!EW((function(){new xW(-1)}))||!SW((function(t){new xW,new xW(null),new xW(1.5),new xW(t)}),!0)||EW((function(){return 1!==new xW(new AW(2),1,void 0).length})),kW=g_,TW=RangeError,RW=function(t,e){var r=kW(t);if(r%e)throw new TW("Wrong offset");return r},BW=Math.round,OW=function(t){var e=BW(t);return e<0?0:e>255?255:255&e},MW=vi,CW=function(t){var e=MW(t);return"BigInt64Array"===e||"BigUint64Array"===e},LW=ye,PW=TypeError,NW=function(t){var e=LW(t,"number");if("number"==typeof e)throw new PW("Can't convert number to bigint");return BigInt(e)},UW=To,jW=y,DW=HO,zW=Wt,FW=bn,HW=_f,$W=yf,qW=ff,WW=CW,VW=Ow.aTypedArrayConstructor,KW=NW,GW=function(t){var e,r,n,i,o,s,a,c,u=DW(this),f=zW(t),h=arguments.length,l=h>1?arguments[1]:void 0,d=void 0!==l,p=$W(f);if(p&&!qW(p))for(c=(a=HW(f,p)).next,f=[];!(s=jW(c,a)).done;)f.push(s.value);for(d&&h>2&&(l=UW(l,arguments[2])),r=FW(f),n=new(VW(u))(r),i=WW(n),e=0;r>e;e++)o=d?l(f[e],e):f[e],n[e]=i?KW(o):+o;return n},ZW=ui,JW=u,YW=y,XW=l,QW=IW,tV=Ow,eV=$v,rV=Sm,nV=_,iV=tr,oV=tT,sV=vn,aV=Im,cV=RW,uV=OW,fV=we,hV=Gt,lV=vi,dV=G,pV=vt,gV=Ki,yV=X,mV=Zc,vV=sn.f,wV=GW,bV=is.forEach,EV=yy,SV=no,_V=Pe,AV=f,xV=Uy,IV=eu,kV=Nr.get,TV=Nr.set,RV=Nr.enforce,BV=_V.f,OV=AV.f,MV=JW.RangeError,CV=eV.ArrayBuffer,LV=CV.prototype,PV=eV.DataView,NV=tV.NATIVE_ARRAY_BUFFER_VIEWS,UV=tV.TYPED_ARRAY_TAG,jV=tV.TypedArray,DV=tV.TypedArrayPrototype,zV=tV.isTypedArray,FV="BYTES_PER_ELEMENT",HV="Wrong length",$V=function(t,e){SV(t,e,{configurable:!0,get:function(){return kV(this)[e]}})},qV=function(t){var e;return yV(LV,t)||"ArrayBuffer"===(e=lV(t))||"SharedArrayBuffer"===e},WV=function(t,e){return zV(t)&&!pV(e)&&e in t&&oV(+e)&&e>=0},VV=function(t,e){return e=fV(e),WV(t,e)?nV(2,t[e]):OV(t,e)},KV=function(t,e,r){return e=fV(e),!(WV(t,e)&&dV(r)&&hV(r,"value"))||hV(r,"get")||hV(r,"set")||r.configurable||hV(r,"writable")&&!r.writable||hV(r,"enumerable")&&!r.enumerable?BV(t,e,r):(t[e]=r.value,t)};XW?(NV||(AV.f=VV,_V.f=KV,$V(DV,"buffer"),$V(DV,"byteOffset"),$V(DV,"byteLength"),$V(DV,"length")),ZW({target:"Object",stat:!0,forced:!NV},{getOwnPropertyDescriptor:VV,defineProperty:KV}),wW.exports=function(t,e,r){var n=t.match(/\d+/)[0]/8,i=t+(r?"Clamped":"")+"Array",o="get"+t,s="set"+t,a=JW[i],c=a,u=c&&c.prototype,f={},h=function(t,e){BV(t,e,{get:function(){return function(t,e){var r=kV(t);return r.view[o](e*n+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,i){var o=kV(t);o.view[s](e*n+o.byteOffset,r?uV(i):i,!0)}(this,e,t)},enumerable:!0})};NV?QW&&(c=e((function(t,e,r,i){return rV(t,u),IV(dV(e)?qV(e)?void 0!==i?new a(e,cV(r,n),i):void 0!==r?new a(e,cV(r,n)):new a(e):zV(e)?xV(c,e):YW(wV,c,e):new a(aV(e)),t,c)})),mV&&mV(c,jV),bV(vV(a),(function(t){t in c||iV(c,t,a[t])})),c.prototype=u):(c=e((function(t,e,r,i){rV(t,u);var o,s,a,f=0,l=0;if(dV(e)){if(!qV(e))return zV(e)?xV(c,e):YW(wV,c,e);o=e,l=cV(r,n);var d=e.byteLength;if(void 0===i){if(d%n)throw new MV(HV);if((s=d-l)<0)throw new MV(HV)}else if((s=sV(i)*n)+l>d)throw new MV(HV);a=s/n}else a=aV(e),o=new CV(s=a*n);for(TV(t,{buffer:o,byteOffset:l,byteLength:s,length:a,view:new PV(o)});f=0?n:r+n;return i<0||i>=r?void 0:e[i]}));var YV=Ow,XV=T(tl),QV=YV.aTypedArray;(0,YV.exportTypedArrayMethod)("copyWithin",(function(t,e){return XV(QV(this),t,e,arguments.length>2?arguments[2]:void 0)}));var tK=is.every,eK=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("every",(function(t){return tK(eK(this),t,arguments.length>1?arguments[1]:void 0)}));var rK=cl,nK=NW,iK=vi,oK=y,sK=h,aK=Ow.aTypedArray,cK=Ow.exportTypedArrayMethod,uK=T("".slice);cK("fill",(function(t){var e=arguments.length;aK(this);var r="Big"===uK(iK(this),0,3)?nK(t):+t;return oK(rK,this,r,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),sK((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})));var fK=Uy,hK=Ow.getTypedArrayConstructor,lK=function(t,e){return fK(hK(t),e)},dK=is.filter,pK=lK,gK=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("filter",(function(t){var e=dK(gK(this),t,arguments.length>1?arguments[1]:void 0);return pK(this,e)}));var yK=is.find,mK=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("find",(function(t){return yK(mK(this),t,arguments.length>1?arguments[1]:void 0)}));var vK=is.findIndex,wK=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("findIndex",(function(t){return vK(wK(this),t,arguments.length>1?arguments[1]:void 0)}));var bK=Il.findLast,EK=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("findLast",(function(t){return bK(EK(this),t,arguments.length>1?arguments[1]:void 0)}));var SK=Il.findLastIndex,_K=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("findLastIndex",(function(t){return SK(_K(this),t,arguments.length>1?arguments[1]:void 0)}));var AK=is.forEach,xK=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("forEach",(function(t){AK(xK(this),t,arguments.length>1?arguments[1]:void 0)})),(0,Ow.exportTypedArrayStaticMethod)("from",GW,IW);var IK=xn.includes,kK=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("includes",(function(t){return IK(kK(this),t,arguments.length>1?arguments[1]:void 0)}));var TK=xn.indexOf,RK=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("indexOf",(function(t){return TK(RK(this),t,arguments.length>1?arguments[1]:void 0)}));var BK=u,OK=h,MK=T,CK=Ow,LK=bp,PK=ce("iterator"),NK=BK.Uint8Array,UK=MK(LK.values),jK=MK(LK.keys),DK=MK(LK.entries),zK=CK.aTypedArray,FK=CK.exportTypedArrayMethod,HK=NK&&NK.prototype,$K=!OK((function(){HK[PK].call([1])})),qK=!!HK&&HK.values&&HK[PK]===HK.values&&"values"===HK.values.name,WK=function(){return UK(zK(this))};FK("entries",(function(){return DK(zK(this))}),$K),FK("keys",(function(){return jK(zK(this))}),$K),FK("values",WK,$K||!qK,{name:"values"}),FK(PK,WK,$K||!qK,{name:"values"});var VK=Ow.aTypedArray,KK=Ow.exportTypedArrayMethod,GK=T([].join);KK("join",(function(t){return GK(VK(this),t)}));var ZK=La,JK=Np,YK=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return ZK(JK,YK(this),e>1?[t,arguments[1]]:[t])}));var XK=is.map,QK=Ow.aTypedArray,tG=Ow.getTypedArrayConstructor;(0,Ow.exportTypedArrayMethod)("map",(function(t){return XK(QK(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(tG(t))(e)}))}));var eG=Ow.aTypedArrayConstructor;(0,Ow.exportTypedArrayStaticMethod)("of",(function(){for(var t=0,e=arguments.length,r=new(eG(this))(e);e>t;)r[t]=arguments[t++];return r}),IW);var rG=cg.left,nG=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return rG(nG(this),t,e,e>1?arguments[1]:void 0)}));var iG=cg.right,oG=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return iG(oG(this),t,e,e>1?arguments[1]:void 0)}));var sG=Ow.aTypedArray,aG=Ow.exportTypedArrayMethod,cG=Math.floor;aG("reverse",(function(){for(var t,e=this,r=sG(e).length,n=cG(r/2),i=0;i1?arguments[1]:void 0,1),r=pG(t);if(SG)return fG(wG,this,r,e);var n=this.length,i=lG(r),o=0;if(i+e>n)throw new yG("Wrong length");for(;oi;)s[i]=r[i++];return s}),h((function(){new Int8Array(1).slice()})));var kG=is.some,TG=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("some",(function(t){return kG(TG(this),t,arguments.length>1?arguments[1]:void 0)}));var RG=Ao,BG=h,OG=At,MG=Dg,CG=Fg,LG=Hg,PG=ct,NG=qg,UG=Ow.aTypedArray,jG=Ow.exportTypedArrayMethod,DG=u.Uint16Array,zG=DG&&RG(DG.prototype.sort),FG=!(!zG||BG((function(){zG(new DG(2),null)}))&&BG((function(){zG(new DG(2),{})}))),HG=!!zG&&!BG((function(){if(PG)return PG<74;if(CG)return CG<67;if(LG)return!0;if(NG)return NG<602;var t,e,r=new DG(516),n=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,n[t]=t-2*e+3;for(zG(r,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==n[t])return!0}));jG("sort",(function(t){return void 0!==t&&OG(t),HG?zG(this,t):MG(UG(this),function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t))}),!HG||FG);var $G=vn,qG=gn,WG=Ow.aTypedArray,VG=Ow.getTypedArrayConstructor;(0,Ow.exportTypedArrayMethod)("subarray",(function(t,e){var r=WG(this),n=r.length,i=qG(t,n);return new(VG(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,$G((void 0===e?n:qG(e,n))-i))}));var KG=La,GG=Ow,ZG=h,JG=Zi,YG=u.Int8Array,XG=GG.aTypedArray,QG=GG.exportTypedArrayMethod,tZ=[].toLocaleString,eZ=!!YG&&ZG((function(){tZ.call(new YG(1))}));QG("toLocaleString",(function(){return KG(tZ,eZ?JG(XG(this)):XG(this),JG(arguments))}),ZG((function(){return[1,2].toLocaleString()!==new YG([1,2]).toLocaleString()}))||!ZG((function(){YG.prototype.toLocaleString.call([1,2])})));var rZ=Oy,nZ=Ow.aTypedArray,iZ=Ow.getTypedArrayConstructor;(0,Ow.exportTypedArrayMethod)("toReversed",(function(){return rZ(nZ(this),iZ(this))}));var oZ=At,sZ=Uy,aZ=Ow.aTypedArray,cZ=Ow.getTypedArrayConstructor,uZ=Ow.exportTypedArrayMethod,fZ=T(Ow.TypedArrayPrototype.sort);uZ("toSorted",(function(t){void 0!==t&&oZ(t);var e=aZ(this),r=sZ(cZ(e),e);return fZ(r,t)}));var hZ=Ow.exportTypedArrayMethod,lZ=h,dZ=T,pZ=u.Uint8Array,gZ=pZ&&pZ.prototype||{},yZ=[].toString,mZ=dZ([].join);lZ((function(){yZ.call({})}))&&(yZ=function(){return mZ(this)});var vZ=gZ.toString!==yZ;hZ("toString",yZ,vZ);var wZ=dm,bZ=CW,EZ=hn,SZ=NW,_Z=Ow.aTypedArray,AZ=Ow.getTypedArrayConstructor,xZ=Ow.exportTypedArrayMethod,IZ=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}();xZ("with",{with:function(t,e){var r=_Z(this),n=EZ(t),i=bZ(r)?SZ(e):+e;return wZ(r,AZ(r),n,i)}}.with,!IZ);var kZ=ui,TZ=T,RZ=Ei,BZ=String.fromCharCode,OZ=TZ("".charAt),MZ=TZ(/./.exec),CZ=TZ("".slice),LZ=/^[\da-f]{2}$/i,PZ=/^[\da-f]{4}$/i;kZ({global:!0},{unescape:function(t){for(var e,r,n=RZ(t),i="",o=n.length,s=0;s1?arguments[1]:void 0,i=r>2?arguments[2]:void 0;return new(YY("Promise"))((function(r){var o=qY(t);void 0!==n&&(n=HY(n,i));var s=JY(o,eX),a=s?void 0:ZY(o)||iX,c=WY(e)?new e:[],u=s?VY(o,s):new QY(GY(KY(o,a)));r(tX(u,n,c))}))},aX=ui,cX=sX,uX=h,fX=Array.fromAsync,hX=!fX||uX((function(){var t=0;return fX.call((function(){return t++,[]}),{length:0}),1!==t}));aX({target:"Array",stat:!0,forced:hX},{fromAsync:cX});var lX=is.filterReject,dX=mh;ui({target:"Array",proto:!0,forced:!0},{filterOut:function(t){return lX(this,t,arguments.length>1?arguments[1]:void 0)}}),dX("filterOut");var pX=is.filterReject,gX=mh;ui({target:"Array",proto:!0,forced:!0},{filterReject:function(t){return pX(this,t,arguments.length>1?arguments[1]:void 0)}}),gX("filterReject");var yX=To,mX=U,vX=Wt,wX=we,bX=bn,EX=Ki,SX=Uy,_X=Array,AX=T([].push),xX=function(t,e,r,n){for(var i,o,s,a=vX(t),c=mX(a),u=yX(e,r),f=EX(null),h=bX(c),l=0;h>l;l++)s=c[l],(o=wX(u(s,l,a)))in f?AX(f[o],s):f[o]=[s];if(n&&(i=n(a))!==_X)for(o in f)f[o]=SX(i,f[o]);return f},IX=xX,kX=mh;ui({target:"Array",proto:!0},{group:function(t){return IX(this,t,arguments.length>1?arguments[1]:void 0)}}),kX("group");var TX=xX,RX=mh;ui({target:"Array",proto:!0,forced:!nl("groupBy")},{groupBy:function(t){return TX(this,t,arguments.length>1?arguments[1]:void 0)}}),RX("groupBy");var BX=To,OX=U,MX=Wt,CX=bn,LX=rI.Map,PX=rI.get,NX=rI.has,UX=rI.set,jX=T([].push),DX=function(t){for(var e,r,n=MX(this),i=OX(n),o=BX(t,arguments.length>1?arguments[1]:void 0),s=new LX,a=CX(i),c=0;a>c;c++)e=o(r=i[c],c,n),NX(s,e)?jX(PX(s,e),r):UX(s,e,[r]);return s},zX=mh,FX=DX;ui({target:"Array",proto:!0,name:"groupToMap",forced:!nl("groupByToMap")},{groupByToMap:FX}),zX("groupByToMap");var HX=mh;ui({target:"Array",proto:!0,forced:false},{groupToMap:DX}),HX("groupToMap");var $X=ui,qX=Bo,WX=Object.isFrozen,VX=function(t,e){if(!WX||!qX(t)||!WX(t))return!1;for(var r,n=0,i=t.length;nt,c=!1;if(void 0===r)s=void 0;else if(d2(r))s=r.step,c=!!r.inclusive;else{if(typeof r!=n)throw new E2(y2);s=r}if(l2(s)&&(s=a?o:-o),typeof s!=n)throw new E2(y2);if(s===1/0||s===-1/0||s===i&&t!==e)throw new b2(y2);v2(this,{type:m2,start:t,end:e,step:s,inclusive:c,hitsEnd:t!=t||e!=e||s!=s||e>t!=s>i,currentCount:i,zero:i}),g2||(this.start=t,this.end=e,this.step=s,this.inclusive=c)}),m2,(function(){var t=w2(this);if(t.hitsEnd)return h2(void 0,!0);var e=t.start,r=t.end,n=e+t.step*t.currentCount++;n===r&&(t.hitsEnd=!0);var i=t.inclusive;return(r>e?i?n>r:n>=r:i?r>n:r>=n)?(t.hitsEnd=!0,h2(void 0,!0)):h2(n,!1)})),_2=function(t){p2(S2.prototype,t,{get:function(){return w2(this)[t]},set:function(){},configurable:!0,enumerable:!1})};g2&&(_2("start"),_2("end"),_2("inclusive"),_2("step"));var A2=S2,x2=A2;"function"==typeof BigInt&&ui({target:"BigInt",stat:!0,forced:!0},{range:function(t,e,r){return new x2(t,e,r,"bigint",BigInt(0),BigInt(1))}});var I2=Y,k2=Ki,T2=G,R2=Object,B2=TypeError,O2=I2("Map"),M2=I2("WeakMap"),C2=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=k2(null)};C2.prototype.get=function(t,e){return this[t]||(this[t]=e())},C2.prototype.next=function(t,e,r){var n=r?this.objectsByIndex[t]||(this.objectsByIndex[t]=new M2):this.primitives||(this.primitives=new O2),i=n.get(e);return i||n.set(e,i=new C2),i};var L2=new C2,P2=function(){var t,e,r=L2,n=arguments.length;for(t=0;t1&&arguments[1]);return V2([255&e,e>>8&255],10)}});var G2=ui,Z2=T(DataView.prototype.getUint8);G2({target:"DataView",proto:!0,forced:!0},{getUint8Clamped:function(t){return Z2(this,t)}});var J2=vi,Y2=TypeError,X2=function(t){if("DataView"===J2(t))return t;throw new Y2("Argument is not a DataView")},Q2=Mm,t5=Math.f16round||function(t){return Q2(t,.0009765625,65504,6103515625e-14)},e5=ui,r5=X2,n5=Im,i5=Fm.pack,o5=t5,s5=T(DataView.prototype.setUint16);e5({target:"DataView",proto:!0},{setFloat16:function(t,e){r5(this);var r=n5(t),n=i5(o5(e),10,2);return s5(this,r,n[1]<<8|n[0],arguments.length>2&&arguments[2])}});var a5=ui,c5=X2,u5=Im,f5=OW,h5=T(DataView.prototype.setUint8);a5({target:"DataView",proto:!0,forced:!0},{setUint8Clamped:function(t,e){c5(this);var r=u5(t);return h5(this,r,f5(e))}});var l5=ui,d5=l,p5=At,g5=Sm,y5=on,m5=wm,v5=no,w5=ce,b5=Nr,E5=BQ,S5=Y("SuppressedError"),_5=ReferenceError,A5=w5("dispose"),x5=w5("toStringTag"),I5="DisposableStack",k5=b5.set,T5=b5.getterFor(I5),R5="sync-dispose",B5="disposed",O5=function(t){var e=T5(t);if(e.state===B5)throw new _5(I5+" already disposed");return e},M5=function(){k5(g5(this,C5),{type:I5,state:"pending",stack:[]}),d5||(this.disposed=!1)},C5=M5.prototype;m5(C5,{dispose:function(){var t=T5(this);if(t.state!==B5){t.state=B5,d5||(this.disposed=!0);for(var e,r=t.stack,n=r.length,i=!1;n;){var o=r[--n];r[n]=null;try{o()}catch(t){i?e=new S5(t,e):(i=!0,e=t)}}if(t.stack=null,i)throw e}},use:function(t){return E5(O5(this),t,R5),t},adopt:function(t,e){var r=O5(this);return p5(e),E5(r,void 0,R5,(function(){e(t)})),t},defer:function(t){var e=O5(this);p5(t),E5(e,void 0,R5,t)},move:function(){var t=O5(this),e=new M5;return T5(e).stack=t.stack,t.stack=[],t.state=B5,d5||(this.disposed=!0),e}}),d5&&v5(C5,"disposed",{configurable:!0,get:function(){return T5(this).state===B5}}),y5(C5,A5,C5.dispose,{name:"dispose"}),y5(C5,x5,I5,{nonWritable:!0}),l5({global:!0,constructor:!0},{DisposableStack:M5});var L5=T,P5=At,N5=function(){return L5(P5(this))};ui({target:"Function",proto:!0,forced:!0},{demethodize:N5});var U5=ui,j5=T,D5=V,z5=gr,F5=Gt,H5=l,$5=Object.getOwnPropertyDescriptor,q5=/^\s*class\b/,W5=j5(q5.exec);U5({target:"Function",stat:!0,sham:!0,forced:!0},{isCallable:function(t){return D5(t)&&!function(t){try{if(!H5||!W5(q5,z5(t)))return!1}catch(t){}var e=$5(t,"prototype");return!!e&&F5(e,"writable")&&!e.writable}(t)}}),ui({target:"Function",stat:!0,forced:!0},{isConstructor:$o});var V5=ce,K5=Pe.f,G5=V5("metadata"),Z5=Function.prototype;void 0===Z5[G5]&&K5(Z5,G5,{value:null}),ui({target:"Function",proto:!0,forced:!0,name:"demethodize"},{unThis:N5});var J5=y,Y5=OA,X5=function(t,e){return[e,t]},Q5=function(){return J5(Y5,this,X5)};ui({target:"Iterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:Q5});var t3=ui,e3=y,r3=At,n3=ze,i3=yf,o3=Array,s3=M_((function(){for(;;){var t=this.iterator;if(!t){var e=this.nextIterableIndex++,r=this.iterables;if(e>=r.length)return void(this.done=!0);var n=r[e];this.iterables[e]=null,t=this.iterator=e3(n.method,n.iterable),this.next=t.next}var i=n3(e3(this.next,t));if(!i.done)return i.value;this.iterator=null,this.next=null}}));t3({target:"Iterator",stat:!0,forced:!0},{concat:function(){for(var t=arguments.length,e=o3(t),r=0;r1?arguments[1]:void 0);return!1!==t8(e,(function(t,n){if(!r(t,n,e))return!1}),!0)}});var e8=To,r8=W6,n8=sQ,i8=rI.Map,o8=rI.set;ui({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(t){var e=r8(this),r=e8(t,arguments.length>1?arguments[1]:void 0),n=new i8;return n8(e,(function(t,i){r(t,i,e)&&o8(n,i,t)})),n}});var s8=To,a8=W6,c8=sQ;ui({target:"Map",proto:!0,real:!0,forced:!0},{find:function(t){var e=a8(this),r=s8(t,arguments.length>1?arguments[1]:void 0),n=c8(e,(function(t,n){if(r(t,n,e))return{value:t}}),!0);return n&&n.value}});var u8=To,f8=W6,h8=sQ;ui({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(t){var e=f8(this),r=u8(t,arguments.length>1?arguments[1]:void 0),n=h8(e,(function(t,n){if(r(t,n,e))return{key:n}}),!0);return n&&n.key}});var l8=To,d8=ze,p8=Wt,g8=Ff,y8=function(t,e,r){return function(n){var i=p8(n),o=arguments.length,s=o>1?arguments[1]:void 0,a=void 0!==s,c=a?l8(s,o>2?arguments[2]:void 0):void 0,u=new t,f=0;return g8(i,(function(t){var n=a?c(t,f++):t;r?e(u,d8(n)[0],n[1]):e(u,n)})),u}};ui({target:"Map",stat:!0,forced:!0},{from:y8(rI.Map,rI.set,!0)});var m8=W6,v8=rI.get,w8=rI.has,b8=rI.set;ui({target:"Map",proto:!0,real:!0,forced:!0},{getOrInsert:function(t,e){return w8(m8(this),t)?v8(this,t):(b8(this,t,e),e)}});var E8=At,S8=W6,_8=rI.get,A8=rI.has,x8=rI.set;ui({target:"Map",proto:!0,real:!0,forced:!0},{getOrInsertComputed:function(t,e){if(S8(this),E8(e),A8(this,t))return _8(this,t);0===t&&1/t==-1/0&&(t=0);var r=e(t);return x8(this,t,r),r}});var I8=function(t,e){return t===e||t!=t&&e!=e},k8=W6,T8=sQ;ui({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(t){return!0===T8(k8(this),(function(e){if(I8(e,t))return!0}),!0)}});var R8=y,B8=Ff,O8=V,M8=At,C8=rI.Map;ui({target:"Map",stat:!0,forced:!0},{keyBy:function(t,e){var r=new(O8(this)?this:C8);M8(e);var n=M8(r.set);return B8(t,(function(t){R8(n,r,e(t),t)})),r}});var L8=W6,P8=sQ;ui({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(t){var e=P8(L8(this),(function(e,r){if(e===t)return{key:r}}),!0);return e&&e.key}});var N8=To,U8=W6,j8=sQ,D8=rI.Map,z8=rI.set;ui({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(t){var e=U8(this),r=N8(t,arguments.length>1?arguments[1]:void 0),n=new D8;return j8(e,(function(t,i){z8(n,r(t,i,e),t)})),n}});var F8=To,H8=W6,$8=sQ,q8=rI.Map,W8=rI.set;ui({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(t){var e=H8(this),r=F8(t,arguments.length>1?arguments[1]:void 0),n=new q8;return $8(e,(function(t,i){W8(n,i,r(t,i,e))})),n}});var V8=W6,K8=Ff,G8=rI.set;ui({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(t){for(var e=V8(this),r=arguments.length,n=0;n1?arguments[1]:void 0);return!0===n4(e,(function(t,n){if(r(t,n,e))return!0}),!0)}});var i4=At,o4=W6,s4=TypeError,a4=rI.get,c4=rI.has,u4=rI.set;ui({target:"Map",proto:!0,real:!0,forced:!0},{update:function(t,e){var r=o4(this),n=arguments.length;i4(e);var i=c4(r,t);if(!i&&n<3)throw new s4("Updating absent value");var o=i?a4(r,t):i4(n>2?arguments[2]:void 0)(t,r);return u4(r,t,e(o,t,r)),r}});var f4=y,h4=At,l4=V,d4=ze,p4=TypeError,g4=function(t,e){var r,n=d4(this),i=h4(n.get),o=h4(n.has),s=h4(n.set),a=arguments.length>2?arguments[2]:void 0;if(!l4(e)&&!l4(a))throw new p4("At least one callback required");return f4(o,n,t)?(r=f4(i,n,t),l4(e)&&(r=e(r),f4(s,n,t,r))):l4(a)&&(r=a(),f4(s,n,t,r)),r};ui({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:g4}),ui({target:"Map",proto:!0,real:!0,forced:!0},{upsert:g4});var y4=ui,m4=Math.min,v4=Math.max;y4({target:"Math",stat:!0,forced:!0},{clamp:function(t,e,r){return m4(r,v4(e,t))}}),ui({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{DEG_PER_RAD:Math.PI/180});var w4=ui,b4=180/Math.PI;w4({target:"Math",stat:!0,forced:!0},{degrees:function(t){return t*b4}});var E4=Math.scale||function(t,e,r,n,i){var o=+t,s=+e,a=+r,c=+n,u=+i;return o!=o||s!=s||a!=a||c!=c||u!=u?NaN:o===1/0||o===-1/0?o:(o-s)*(u-c)/(a-s)+c},S4=E4,_4=Lm;ui({target:"Math",stat:!0,forced:!0},{fscale:function(t,e,r,n,i){return _4(S4(t,e,r,n,i))}}),ui({target:"Math",stat:!0},{f16round:t5}),ui({target:"Math",stat:!0,forced:!0},{iaddh:function(t,e,r,n){var i=t>>>0,o=r>>>0;return(e>>>0)+(n>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}}),ui({target:"Math",stat:!0,forced:!0},{imulh:function(t,e){var r=65535,n=+t,i=+e,o=n&r,s=i&r,a=n>>16,c=i>>16,u=(a*s>>>0)+(o*s>>>16);return a*c+(u>>16)+((o*c>>>0)+(u&r)>>16)}}),ui({target:"Math",stat:!0,forced:!0},{isubh:function(t,e,r,n){var i=t>>>0,o=r>>>0;return(e>>>0)-(n>>>0)-((~i&o|(i^~o)&i-o>>>0)>>>31)|0}}),ui({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI});var A4=ui,x4=Math.PI/180;A4({target:"Math",stat:!0,forced:!0},{radians:function(t){return t*x4}}),ui({target:"Math",stat:!0,forced:!0},{scale:E4});var I4=ui,k4=ze,T4=Yk,R4=Fd,B4=cp,O4=Nr,M4="Seeded Random",C4=M4+" Generator",L4=O4.set,P4=O4.getterFor(C4),N4=TypeError,U4=R4((function(t){L4(this,{type:C4,seed:t%2147483647})}),M4,(function(){var t=P4(this),e=t.seed=(1103515245*t.seed+12345)%2147483647;return B4((1073741823&e)/1073741823,!1)}));I4({target:"Math",stat:!0,forced:!0},{seededPRNG:function(t){var e=k4(t).seed;if(!T4(e))throw new N4('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new U4(e)}}),ui({target:"Math",stat:!0,forced:!0},{signbit:function(t){var e=+t;return e==e&&0===e?1/e==-1/0:e<0}});var j4=ui,D4=T,z4=Ff,F4=RangeError,H4=TypeError,$4=1/0,q4=Math.abs,W4=Math.pow,V4=D4([].push),K4=W4(2,1023),G4=W4(2,53)-1,Z4=Number.MAX_VALUE,J4=W4(2,971),Y4={},X4={},Q4={},t9={},e9={},r9=function(t,e){var r=t+e;return{hi:r,lo:e-(r-t)}};j4({target:"Math",stat:!0},{sumPrecise:function(t){var e=[],r=0,n=t9;switch(z4(t,(function(t){if(++r>=G4)throw new F4("Maximum allowed index exceeded");if("number"!=typeof t)throw new H4("Value is not a number");n!==Y4&&(t!=t?n=Y4:t===$4?n=n===X4?Y4:Q4:t===-1/0?n=n===Q4?Y4:X4:0===t&&1/t!==$4||n!==t9&&n!==e9||(n=e9,V4(e,t)))})),n){case Y4:return NaN;case X4:return-1/0;case Q4:return $4;case t9:return-0}for(var i,o,s,a,c,u,f=[],h=0,l=0;l=0?f[y]:0;if(y--,q4(h)>1||h>0&&m>0||h<0&&m<0)return h>0?$4:-1/0;if(a=(s=r9(h*K4,m/2)).hi,c=s.lo,c*=2,q4(2*a)===$4)return a>0?a===K4&&c===-J4/2&&y>=0&&f[y]<0?Z4:$4:a===-K4&&c===J4/2&&y>=0&&f[y]>0?-Z4:-1/0;0!==c&&(f[++y]=c,c=0),a*=2}for(;y>=0&&(a=(s=r9(a,f[y--])).hi,0===(c=s.lo)););return y>=0&&(c<0&&f[y]<0||c>0&&f[y]>0)&&(o=2*c)===(i=a+o)-a&&(a=i),a}}),ui({target:"Math",stat:!0,forced:!0},{umulh:function(t,e){var r=65535,n=+t,i=+e,o=n&r,s=i&r,a=n>>>16,c=i>>>16,u=(a*s>>>0)+(o*s>>>16);return a*c+(u>>>16)+((o*c>>>0)+(u&r)>>>16)}});var n9=ui,i9=T,o9=hn,s9="Invalid number representation",a9=RangeError,c9=SyntaxError,u9=TypeError,f9=parseInt,h9=Math.pow,l9=/^[\d.a-z]+$/,d9=i9("".charAt),p9=i9(l9.exec),g9=i9(1..toString),y9=i9("".slice),m9=i9("".split);n9({target:"Number",stat:!0,forced:!0},{fromString:function(t,e){var r=1;if("string"!=typeof t)throw new u9(s9);if(!t.length)throw new c9(s9);if("-"===d9(t,0)&&(r=-1,!(t=y9(t,1)).length))throw new c9(s9);var n=void 0===e?10:o9(e);if(n<2||n>36)throw new a9("Invalid radix");if(!p9(l9,t))throw new c9(s9);var i=m9(t,"."),o=f9(i[0],n);if(i.length>1&&(o+=f9(i[1],n)/h9(n,i[1].length)),10===n&&g9(o,n)!==t)throw new c9(s9);return r*o}});var v9=A2;ui({target:"Number",stat:!0,forced:!0},{range:function(t,e,r){return new v9(t,e,r,"number",0,1)}});var w9=Nr,b9=Fd,E9=cp,S9=Gt,_9=xi,A9=Wt,x9="Object Iterator",I9=w9.set,k9=w9.getterFor(x9),T9=b9((function(t,e){var r=A9(t);I9(this,{type:x9,mode:e,object:r,keys:_9(r),index:0})}),"Object",(function(){for(var t=k9(this),e=t.keys;;){if(null===e||t.index>=e.length)return t.object=t.keys=null,E9(void 0,!0);var r=e[t.index++],n=t.object;if(S9(n,r)){switch(t.mode){case"keys":return E9(r,!1);case"values":return E9(n[r],!1)}return E9([r,n[r]],!1)}}})),R9=T9;ui({target:"Object",stat:!0,forced:!0},{iterateEntries:function(t){return new R9(t,"entries")}});var B9=T9;ui({target:"Object",stat:!0,forced:!0},{iterateKeys:function(t){return new B9(t,"keys")}});var O9=T9;ui({target:"Object",stat:!0,forced:!0},{iterateValues:function(t){return new O9(t,"values")}});var M9=ui,C9=y,L9=l,P9=yy,N9=At,U9=ze,j9=Sm,D9=V,z9=j,F9=G,H9=kt,$9=on,q9=wm,W9=no,V9=tC,K9=Nr,G9=ce("observable"),Z9="Observable",J9="Subscription",Y9="SubscriptionObserver",X9=K9.getterFor,Q9=K9.set,t7=X9(Z9),e7=X9(J9),r7=X9(Y9),n7=function(t){this.observer=U9(t),this.cleanup=null,this.subscriptionObserver=null};n7.prototype={type:J9,clean:function(){var t=this.cleanup;if(t){this.cleanup=null;try{t()}catch(t){V9(t)}}},close:function(){if(!L9){var t=this.facade,e=this.subscriptionObserver;t.closed=!0,e&&(e.closed=!0)}this.observer=null},isClosed:function(){return null===this.observer}};var i7=function(t,e){var r,n=Q9(this,new n7(t));L9||(this.closed=!1);try{(r=H9(t,"start"))&&C9(r,t,this)}catch(t){V9(t)}if(!n.isClosed()){var i=n.subscriptionObserver=new o7(n);try{var o=e(i),s=o;z9(o)||(n.cleanup=D9(o.unsubscribe)?function(){s.unsubscribe()}:N9(o))}catch(t){return void i.error(t)}n.isClosed()&&n.clean()}};i7.prototype=q9({},{unsubscribe:function(){var t=e7(this);t.isClosed()||(t.close(),t.clean())}}),L9&&W9(i7.prototype,"closed",{configurable:!0,get:function(){return e7(this).isClosed()}});var o7=function(t){Q9(this,{type:Y9,subscriptionState:t}),L9||(this.closed=!1)};o7.prototype=q9({},{next:function(t){var e=r7(this).subscriptionState;if(!e.isClosed()){var r=e.observer;try{var n=H9(r,"next");n&&C9(n,r,t)}catch(t){V9(t)}}},error:function(t){var e=r7(this).subscriptionState;if(!e.isClosed()){var r=e.observer;e.close();try{var n=H9(r,"error");n?C9(n,r,t):V9(t)}catch(t){V9(t)}e.clean()}},complete:function(){var t=r7(this).subscriptionState;if(!t.isClosed()){var e=t.observer;t.close();try{var r=H9(e,"complete");r&&C9(r,e)}catch(t){V9(t)}t.clean()}}}),L9&&W9(o7.prototype,"closed",{configurable:!0,get:function(){return r7(this).subscriptionState.isClosed()}});var s7=function(t){j9(this,a7),Q9(this,{type:Z9,subscriber:N9(t)})},a7=s7.prototype;q9(a7,{subscribe:function(t){var e=arguments.length;return new i7(D9(t)?{next:t,error:e>1?arguments[1]:void 0,complete:e>2?arguments[2]:void 0}:F9(t)?t:{},t7(this).subscriber)}}),$9(a7,G9,(function(){return this})),M9({global:!0,constructor:!0,forced:!0},{Observable:s7}),P9(Z9);var c7=ui,u7=Y,f7=y,h7=ze,l7=$o,d7=_f,p7=kt,g7=Ff,y7=ce("observable");c7({target:"Observable",stat:!0,forced:!0},{from:function(t){var e=l7(this)?this:u7("Observable"),r=p7(h7(t),y7);if(r){var n=h7(f7(r,t));return n.constructor===e?n:new e((function(t){return n.subscribe(t)}))}var i=d7(t);return new e((function(t){g7(i,(function(e,r){if(t.next(e),t.closed)return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}),t.complete()}))}});var m7=ui,v7=Y,w7=$o,b7=v7("Array");m7({target:"Observable",stat:!0,forced:!0},{of:function(){for(var t=w7(this)?this:v7("Observable"),e=arguments.length,r=b7(e),n=0;n@`~"+Att+"]"),Ltt=btt(Ott.exec),Ptt={"\t":"t","\n":"n","\v":"v","\f":"f","\r":"r"},Ntt=function(t){var e=Rtt(Ttt(t,0),16);return e.length<3?"\\x"+_tt(e,2,"0"):"\\u"+_tt(e,4,"0")};wtt({target:"RegExp",stat:!0,forced:!Itt||"\\x61b"!==Itt("ab")},{escape:function(t){Ett(t);for(var e=t.length,r=xtt(e),n=0;n=56320||n+1>=e||56320!=(64512&Ttt(t,n+1))?r[n]=Ntt(i):(r[n]=i,r[++n]=ktt(t,n))}}return Btt(r,"")}});var Utt=Fj,jtt=Dj.add;ui({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=Utt(this),e=0,r=arguments.length;e1?arguments[1]:void 0);return!1!==net(e,(function(t){if(!r(t,t,e))return!1}),!0)}});var iet=To,oet=Fj,set=Yj,aet=Dj.Set,cet=Dj.add;ui({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(t){var e=oet(this),r=iet(t,arguments.length>1?arguments[1]:void 0),n=new aet;return set(e,(function(t){r(t,t,e)&&cet(n,t)})),n}});var uet=To,fet=Fj,het=Yj;ui({target:"Set",proto:!0,real:!0,forced:!0},{find:function(t){var e=fet(this),r=uet(t,arguments.length>1?arguments[1]:void 0),n=het(e,(function(t){if(r(t,t,e))return{value:t}}),!0);return n&&n.value}});ui({target:"Set",stat:!0,forced:!0},{from:y8(Dj.Set,Dj.add,!1)});var det=y,pet=Ytt,get=PD;ui({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(t){return det(get,this,pet(t))}});var yet=y,met=Ytt,vet=WD;ui({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(t){return yet(vet,this,met(t))}});var wet=y,bet=Ytt,Eet=YD;ui({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(t){return wet(Eet,this,bet(t))}});var _et=y,Aet=Ytt,xet=oz;ui({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(t){return _et(xet,this,Aet(t))}});var Iet=ui,ket=T,Tet=Fj,Ret=Yj,Bet=Ei,Oet=ket([].join),Met=ket([].push);Iet({target:"Set",proto:!0,real:!0,forced:!0},{join:function(t){var e=Tet(this),r=void 0===t?",":Bet(t),n=[];return Ret(e,(function(t){Met(n,t)})),Oet(n,r)}});var Cet=To,Let=Fj,Pet=Yj,Net=Dj.Set,Uet=Dj.add;ui({target:"Set",proto:!0,real:!0,forced:!0},{map:function(t){var e=Let(this),r=Cet(t,arguments.length>1?arguments[1]:void 0),n=new Net;return Pet(e,(function(t){Uet(n,r(t,t,e))})),n}});ui({target:"Set",stat:!0,forced:!0},{of:J8(Dj.Set,Dj.add,!1)});var jet=At,Det=Fj,zet=Yj,Fet=TypeError;ui({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=Det(this),r=arguments.length<2,n=r?void 0:arguments[1];if(jet(t),zet(e,(function(i){r?(r=!1,n=i):n=t(n,i,i,e)})),r)throw new Fet("Reduce of empty set with no initial value");return n}});var Het=To,$et=Fj,qet=Yj;ui({target:"Set",proto:!0,real:!0,forced:!0},{some:function(t){var e=$et(this),r=Het(t,arguments.length>1?arguments[1]:void 0);return!0===qet(e,(function(t){if(r(t,t,e))return!0}),!0)}});var Wet=y,Vet=Ytt,Ket=pz;ui({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(t){return Wet(Ket,this,Vet(t))}});var Get=y,Zet=Ytt,Jet=Ez;ui({target:"Set",proto:!0,real:!0,forced:!0},{union:function(t){return Get(Jet,this,Zet(t))}});var Yet=Uz.charAt,Xet=F,Qet=hn,trt=Ei;ui({target:"String",proto:!0,forced:!0},{at:function(t){var e=trt(Xet(this)),r=e.length,n=Qet(t),i=n>=0?n:r+n;return i<0||i>=r?void 0:Yet(e,i)}});var ert=T,rrt=q,nrt=Ei,irt=bn,ort=TypeError,srt=ert([].push),art=ert([].join),crt=function(t){var e=rrt(t),r=irt(e);if(!r)return"";for(var n=arguments.length,i=[],o=0;;){var s=e[o++];if(void 0===s)throw new ort("Incorrect template");if(srt(i,nrt(s)),o===r)return art(i,"");o=r.length?hrt(void 0,!0):(t=yrt(r,n),e.index+=t.length,hrt({codePoint:grt(t,0),position:n},!1))}));urt({target:"String",proto:!0,forced:!0},{codePoints:function(){return new brt(drt(lrt(this)))}});var Ert=T,Srt=WeakMap.prototype,_rt={WeakMap:WeakMap,set:Ert(Srt.set),get:Ert(Srt.get),has:Ert(Srt.has),remove:Ert(Srt.delete)},Art=Y,xrt=T,Irt=String.fromCharCode,krt=Art("String","fromCodePoint"),Trt=xrt("".charAt),Rrt=xrt("".charCodeAt),Brt=xrt("".indexOf),Ort=xrt("".slice),Mrt=function(t,e){var r=Rrt(t,e);return r>=48&&r<=57},Crt=function(t,e,r){if(r>=t.length)return-1;for(var n=0;e=48&&t<=57?t-48:t>=97&&t<=102?t-97+10:t>=65&&t<=70?t-65+10:-1},Prt=ax,Nrt=ui,Urt=er.exports,jrt=T,Drt=La,zrt=ze,Frt=Wt,Hrt=V,$rt=bn,qrt=Pe.f,Wrt=Zi,Vrt=_rt,Krt=crt,Grt=function(t){for(var e,r="",n=0,i=0;(i=Brt(t,"\\",i))>-1;){if(r+=Ort(t,n,i),++i===t.length)return;var o=Trt(t,i++);switch(o){case"b":r+="\b";break;case"t":r+="\t";break;case"n":r+="\n";break;case"v":r+="\v";break;case"f":r+="\f";break;case"r":r+="\r";break;case"\r":i1114111)return;r+=krt(e);break;default:if(Mrt(o,0))return;r+=o}n=i}return r+Ort(t,n)},Zrt=gk,Jrt=new Vrt.WeakMap,Yrt=Vrt.get,Xrt=Vrt.has,Qrt=Vrt.set,tnt=Array,ent=TypeError,rnt=Object.freeze||Object,nnt=Object.isFrozen,int=Math.min,ont=jrt("".charAt),snt=jrt("".slice),ant=jrt("".split),cnt=jrt(/./.exec),unt=/([\n\u2028\u2029]|\r\n?)/g,fnt=RegExp("^["+Zrt+"]*"),hnt=RegExp("[^"+Zrt+"]"),lnt="Invalid tag",dnt=function(t){var e,r,n,i,o=Frt(t),s=$rt(o),a=tnt(s),c=tnt(s),u=0;if(!s)throw new ent(lnt);for(;u0)throw new ent("Invalid opening line");e[1]=""}if(h){if(1===e.length||cnt(hnt,e[e.length-1]))throw new ent("Invalid closing line");e[e.length-2]="",e[e.length-1]=""}for(var l=2;l1?arguments[1]:void 0,i=r>2?arguments[2]:void 0;return new(Jnt("Promise"))((function(r){Ynt(e),r(Xnt(t,n,i))})).then((function(t){return Qnt(tit(e),t)}))}),!0);var eit=is.filterReject,rit=lK,nit=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("filterOut",(function(t){var e=eit(nit(this),t,arguments.length>1?arguments[1]:void 0);return rit(this,e)}),!0);var iit=is.filterReject,oit=lK,sit=Ow.aTypedArray;(0,Ow.exportTypedArrayMethod)("filterReject",(function(t){var e=iit(sit(this),t,arguments.length>1?arguments[1]:void 0);return oit(this,e)}),!0);var ait=xX,cit=Ow.aTypedArray,uit=Ow.getTypedArrayConstructor;(0,Ow.exportTypedArrayMethod)("groupBy",(function(t){var e=arguments.length>1?arguments[1]:void 0;return ait(cit(this),t,e,uit)}),!0);var fit=bn,hit=CW,lit=gn,dit=NW,pit=hn,git=h,yit=Ow.aTypedArray,mit=Ow.getTypedArrayConstructor,vit=Ow.exportTypedArrayMethod,wit=Math.max,bit=Math.min,Eit=!git((function(){var t=new Int8Array([1]),e=t.toSpliced(1,0,{valueOf:function(){return t[0]=2,3}});return 2!==e[0]||3!==e[1]}));vit("toSpliced",(function(t,e){var r,n,i,o,s,a,c,u=yit(this),f=mit(u),h=fit(u),l=lit(t,h),d=arguments.length,p=0;if(0===d)r=n=0;else if(1===d)r=0,n=h-l;else if(n=bit(wit(pit(e),0),h-l),r=d-2){o=new f(r),i=hit(o);for(var g=2;g>16&255,i>>8&255,255&i];if(2===n){if(r&&0!==o[1])throw new Kit("Extra bits");return[o[0]]}if(3===n){if(r&&0!==o[2])throw new Kit("Extra bits");return[o[0],o[1]]}return o},Xit=function(t,e,r){for(var n=e.length,i=0;i0){if("stop-before-partial"===o)break;if("loose"!==o)throw new Kit("Missing padding");if(1===u.length)throw new Kit("Malformed padding: exactly one additional character");a=Xit(s,Yit(u,i,!1),a)}c=t.length;break}var h=Zit(t,f);if(++f,"="===h){if(u.length<2)throw new Kit("Padding is too early");if(f=Jit(t,f),2===u.length){if(f===t.length){if("stop-before-partial"===o)break;throw new Kit("Malformed padding: only one =")}"="===Zit(t,f)&&(++f,f=Jit(t,f))}if(f1?arguments[1]:void 0,null,9007199254740991);return eot(not,e.bytes)}});var iot=u,oot=T,sot=iot.Uint8Array,aot=iot.SyntaxError,cot=iot.parseInt,uot=Math.min,fot=/[^\da-f]/i,hot=oot(fot.exec),lot=oot("".slice),dot=function(t,e){var r=t.length;if(r%2!=0)throw new aot("String should be an even number of characters");for(var n=e?uot(e.length,r/2):r/2,i=e||new sot(n),o=0,s=0;s1?arguments[1]:void 0,this,this.length);return{read:e.read,written:e.written}}});var _ot=ui,Aot=vtt,xot=wot,Iot=lb,kot=dot;u.Uint8Array&&_ot({target:"Uint8Array",proto:!0},{setFromHex:function(t){xot(this),Aot(t),Iot(this.buffer);var e=kot(t,this).read;return{read:e,written:e/2}}});var Tot=ui,Rot=u,Bot=Bit,Oot=wot,Mot=lb,Cot=Uit,Lot=Pit.i2c,Pot=Pit.i2cUrl,Not=T("".charAt);Rot.Uint8Array&&Tot({target:"Uint8Array",proto:!0},{toBase64:function(){var t=Oot(this),e=arguments.length?Bot(arguments[0]):void 0,r="base64"===Cot(e)?Lot:Pot,n=!!e&&!!e.omitPadding;Mot(this.buffer);for(var i,o="",s=0,a=t.length,c=function(t){return Not(r,i>>6*t&63)};s+2>(-2*a&6)));return o}});var Nst=ui,Ust=u,jst=Y,Dst=T,zst=y,Fst=h,Hst=Ei,$st=ZO,qst=Pit.i2c,Wst=jst("btoa"),Vst=Dst("".charAt),Kst=Dst("".charCodeAt),Gst=!!Wst&&!Fst((function(){return"aGk="!==Wst("hi")})),Zst=Gst&&!Fst((function(){Wst()})),Jst=Gst&&Fst((function(){return"bnVsbA=="!==Wst(null)})),Yst=Gst&&1!==Wst.length;Nst({global:!0,bind:!0,enumerable:!0,forced:!Gst||Zst||Jst||Yst},{btoa:function(t){if($st(arguments.length,1),Gst)return zst(Wst,Ust,Hst(t));for(var e,r,n=Hst(t),i="",o=0,s=qst;Vst(n,o)||(s="=",o%1);){if((r=Kst(n,o+=3/4))>255)throw new(jst("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");i+=Vst(s,63&(e=e<<8|r)>>8-o%1*8)}return i}});var Xst={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Qst=_e("span").classList,tat=Qst&&Qst.constructor&&Qst.constructor.prototype,eat=tat===Object.prototype?void 0:tat,rat=u,nat=Xst,iat=eat,oat=Gl,sat=tr,aat=function(t){if(t&&t.forEach!==oat)try{sat(t,"forEach",oat)}catch(e){t.forEach=oat}};for(var cat in nat)nat[cat]&&aat(rat[cat]&&rat[cat].prototype);aat(iat);var uat=u,fat=Xst,hat=eat,lat=bp,dat=tr,pat=Eo,gat=ce("iterator"),yat=lat.values,mat=function(t,e){if(t){if(t[gat]!==yat)try{dat(t,gat,yat)}catch(e){t[gat]=yat}if(pat(t,e,!0),fat[e])for(var r in lat)if(t[r]!==lat[r])try{dat(t,r,lat[r])}catch(e){t[r]=lat[r]}}};for(var vat in fat)mat(uat[vat]&&uat[vat].prototype,vat);mat(hat,"DOMTokenList");var wat={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}},bat=ui,Eat=Y,Sat=gb,_at=h,Aat=Ki,xat=_,Iat=Pe.f,kat=on,Tat=no,Rat=Gt,Bat=Sm,Oat=ze,Mat=Vu,Cat=nu,Lat=wat,Pat=lu,Nat=Nr,Uat=l,jat="DOMException",Dat="DATA_CLONE_ERR",zat=Eat("Error"),Fat=Eat(jat)||function(){try{(new(Eat("MessageChannel")||Sat("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(t){if(t.name===Dat&&25===t.code)return t.constructor}}(),Hat=Fat&&Fat.prototype,$at=zat.prototype,qat=Nat.set,Wat=Nat.getterFor(jat),Vat="stack"in new zat(jat),Kat=function(t){return Rat(Lat,t)&&Lat[t].m?Lat[t].c:0},Gat=function(){Bat(this,Zat);var t=arguments.length,e=Cat(t<1?void 0:arguments[0]),r=Cat(t<2?void 0:arguments[1],"Error"),n=Kat(r);if(qat(this,{type:jat,name:r,message:e,code:n}),Uat||(this.name=r,this.message=e,this.code=n),Vat){var i=new zat(e);i.name=jat,Iat(this,"stack",xat(1,Pat(i.stack,1)))}},Zat=Gat.prototype=Aat($at),Jat=function(t){return{enumerable:!0,configurable:!0,get:t}},Yat=function(t){return Jat((function(){return Wat(this)[t]}))};Uat&&(Tat(Zat,"code",Yat("code")),Tat(Zat,"message",Yat("message")),Tat(Zat,"name",Yat("name"))),Iat(Zat,"constructor",xat(1,Gat));var Xat=_at((function(){return!(new Fat instanceof zat)})),Qat=Xat||_at((function(){return $at.toString!==Mat||"2: 1"!==String(new Fat(1,2))})),tct=Xat||_at((function(){return 25!==new Fat(1,"DataCloneError").code}));Xat||25!==Fat[Dat]||Hat[Dat];bat({global:!0,constructor:!0,forced:Xat},{DOMException:Xat?Gat:Fat});var ect=Eat(jat),rct=ect.prototype;for(var nct in Qat&&Fat===ect&&kat(rct,"toString",Mat),tct&&Uat&&Fat===ect&&Tat(rct,"code",Jat((function(){return Kat(Oat(this).name)}))),Lat)if(Rat(Lat,nct)){var ict=Lat[nct],oct=ict.s,sct=xat(6,ict.c);Rat(ect,oct)||Iat(ect,oct,sct),Rat(rct,oct)||Iat(rct,oct,sct)}var act=ui,cct=u,uct=Y,fct=_,hct=Pe.f,lct=Gt,dct=Sm,pct=eu,gct=nu,yct=wat,mct=lu,vct=l,wct="DOMException",bct=uct("Error"),Ect=uct(wct),Sct=function(){dct(this,_ct);var t=arguments.length,e=gct(t<1?void 0:arguments[0]),r=gct(t<2?void 0:arguments[1],"Error"),n=new Ect(e,r),i=new bct(e);return i.name=wct,hct(n,"stack",fct(1,mct(i.stack,1))),pct(n,this,Sct),n},_ct=Sct.prototype=Ect.prototype,Act="stack"in new bct(wct),xct="stack"in new Ect(1,2),Ict=Ect&&vct&&Object.getOwnPropertyDescriptor(cct,wct),kct=!(!Ict||Ict.writable&&Ict.configurable),Tct=Act&&!kct&&!xct;act({global:!0,constructor:!0,forced:Tct},{DOMException:Tct?Sct:Ect});var Rct=uct(wct),Bct=Rct.prototype;if(Bct.constructor!==Rct)for(var Oct in hct(Bct,"constructor",fct(1,Rct)),yct)if(lct(yct,Oct)){var Mct=yct[Oct],Cct=Mct.s;lct(Rct,Cct)||hct(Rct,Cct,fct(6,Mct.c))}var Lct="DOMException";Eo(Y(Lct),Lct);var Pct=_M.clear;ui({global:!0,bind:!0,enumerable:!0,forced:u.clearImmediate!==Pct},{clearImmediate:Pct});var Nct=u,Uct=La,jct=V,Dct=dg,zct=et,Fct=Zi,Hct=ZO,$ct=Nct.Function,qct=/MSIE .\./.test(zct)||"BUN"===Dct&&function(){var t=Nct.Bun.version.split(".");return t.length<3||"0"===t[0]&&(t[1]<3||"3"===t[1]&&"0"===t[2])}(),Wct=function(t,e){var r=e?2:1;return qct?function(n,i){var o=Hct(arguments.length,1)>r,s=jct(n)?n:$ct(n),a=o?Fct(arguments,r):[],c=o?function(){Uct(s,this,a)}:s;return e?t(c,i):t(c)}:t},Vct=ui,Kct=u,Gct=_M.set,Zct=Wct,Jct=Kct.setImmediate?Zct(Gct,!1):Gct;Vct({global:!0,bind:!0,enumerable:!0,forced:Kct.setImmediate!==Jct},{setImmediate:Jct});var Yct=u,Xct=QM,Qct=At,tut=ZO,eut=l;ui({global:!0,enumerable:!0,dontCallGetSet:!0,forced:h((function(){return eut&&1!==Object.getOwnPropertyDescriptor(Yct,"queueMicrotask").value.length}))},{queueMicrotask:function(t){tut(arguments.length,1),Xct(Qct(t))}});var rut=ui,nut=u,iut=no,out=l,sut=TypeError,aut=Object.defineProperty,cut=nut.self!==nut;try{if(out){var uut=Object.getOwnPropertyDescriptor(nut,"self");!cut&&uut&&uut.get&&uut.enumerable||iut(nut,"self",{get:function(){return nut},set:function(t){if(this!==nut)throw new sut("Illegal invocation");aut(nut,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else rut({global:!0,simple:!0,forced:cut},{self:nut})}catch(OPt){}var fut,hut=ui,lut=u,dut=Y,put=T,gut=h,yut=Qt,mut=V,vut=$o,wut=j,but=G,Eut=vt,Sut=Ff,_ut=ze,Aut=vi,xut=Gt,Iut=kh,kut=tr,Tut=bn,Rut=ZO,But=CN,Out=rI,Mut=Dj,Cut=Yj,Lut=Tb,Put=pu,Nut=bb,Uut=lut.Object,jut=lut.Array,Dut=lut.Date,zut=lut.Error,Fut=lut.TypeError,Hut=lut.PerformanceMark,$ut=dut("DOMException"),qut=Out.Map,Wut=Out.has,Vut=Out.get,Kut=Out.set,Gut=Mut.Set,Zut=Mut.add,Jut=Mut.has,Yut=dut("Object","keys"),Xut=put([].push),Qut=put((!0).valueOf),tft=put(1..valueOf),eft=put("".valueOf),rft=put(Dut.prototype.getTime),nft=yut("structuredClone"),ift="DataCloneError",oft="Transferring",sft=function(t){return!gut((function(){var e=new lut.Set([7]),r=t(e),n=t(Uut(7));return r===e||!r.has(7)||!but(n)||7!=+n}))&&t},aft=function(t,e){return!gut((function(){var r=new e,n=t({a:r,b:r});return!(n&&n.a===n.b&&n.a instanceof e&&n.a.stack===r.stack)}))},cft=lut.structuredClone,uft=!aft(cft,zut)||!aft(cft,$ut)||(fut=cft,!!gut((function(){var t=fut(new lut.AggregateError([1],nft,{cause:3}));return"AggregateError"!==t.name||1!==t.errors[0]||t.message!==nft||3!==t.cause}))),fft=!cft&&sft((function(t){return new Hut(nft,{detail:t}).detail})),hft=sft(cft)||fft,lft=function(t){throw new $ut("Uncloneable type: "+t,ift)},dft=function(t,e){throw new $ut((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",ift)},pft=function(t,e){return hft||dft(e),hft(t)},gft=function(t,e,r){if(Wut(e,t))return Vut(e,t);var n,i,o,s,a,c;if("SharedArrayBuffer"===(r||Aut(t)))n=hft?hft(t):t;else{var u=lut.DataView;u||mut(t.slice)||dft("ArrayBuffer");try{if(mut(t.slice)&&!t.resizable)n=t.slice(0);else{i=t.byteLength,o="maxByteLength"in t?{maxByteLength:t.maxByteLength}:void 0,n=new ArrayBuffer(i,o),s=new u(t),a=new u(n);for(c=0;c1&&!wut(arguments[1])?_ut(arguments[1]):void 0,i=n?n.transfer:void 0;void 0!==i&&(r=function(t,e){if(!but(t))throw new Fut("Transfer option cannot be converted to a sequence");var r=[];Sut(t,(function(t){Xut(r,_ut(t))}));for(var n,i,o,s,a,c=0,u=Tut(r),f=new Gut;c>1,t+=Lft(t/e);t>455;)t=Lft(t/35),n+=36;return Lft(n+36*t/(t+38))},qft=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r=55296&&i<=56319&&r=o&&nLft((Tft-s)/h))throw new Mft(Oft);for(s+=(f-o)*h,o=f,r=0;rTft)throw new Mft(Oft);if(n===o){for(var l=s,d=36;;){var p=d<=a?1:d>=a+26?26:d-a;if(l0&&t&r;r>>=1)e++;return e},Zht=function(t){var e=null;switch(t.length){case 1:e=t[0];break;case 2:e=(31&t[0])<<6|63&t[1];break;case 3:e=(15&t[0])<<12|(63&t[1])<<6|63&t[2];break;case 4:e=(7&t[0])<<18|(63&t[1])<<12|(63&t[2])<<6|63&t[3]}return e>1114111?null:e},Jht=function(t){for(var e=(t=Dht(t,Wht," ")).length,r="",n=0;ne){r+="%",n++;continue}var o=Kht(t,n+1);if(o!=o){r+=i,n++;continue}n+=2;var s=Ght(o);if(0===s)i=Cht(o);else{if(1===s||s>4){r+="�",n++;continue}for(var a=[o],c=1;ce||"%"!==Nht(t,n));){var u=Kht(t,n+1);if(u!=u){n+=3;break}if(u>191||u<128)break;jht(a,u),n+=2,c++}if(a.length!==s){r+="�";continue}var f=Zht(a);null===f?r+="�":i=Lht(f)}}r+=i,n++}return r},Yht=/[!'()~]|%20/g,Xht={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Qht=function(t){return Xht[t]},tlt=function(t){return Dht(Mht(t),Yht,Qht)},elt=nht((function(t,e){_ht(this,{type:Sht,target:Aht(t).entries,index:0,kind:e})}),Eht,(function(){var t=xht(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,mht(void 0,!0);var n=e[r];switch(t.kind){case"keys":return mht(n.key,!1);case"values":return mht(n.value,!1)}return mht([n.key,n.value],!1)}),!0),rlt=function(t){this.entries=[],this.url=null,void 0!==t&&(hht(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===Nht(t,0)?$ht(t,1):t:lht(t)))};rlt.prototype={type:Eht,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,n,i,o,s,a,c=this.entries,u=yht(t);if(u)for(r=(e=ght(t,u)).next;!(n=Zft(r,e)).done;){if(o=(i=ght(fht(n.value))).next,(s=Zft(o,i)).done||(a=Zft(o,i)).done||!Zft(o,i).done)throw new Oht("Expected sequence with length 2");jht(c,{key:lht(s.value),value:lht(a.value)})}else for(var f in t)aht(t,f)&&jht(c,{key:f,value:lht(t[f])})},parseQuery:function(t){if(t)for(var e,r,n=this.entries,i=Hht(t,"&"),o=0;o0?arguments[0]:void 0));Yft||(this.size=t.entries.length)},ilt=nlt.prototype;if(eht(ilt,{append:function(t,e){var r=Aht(this);vht(arguments.length,2),jht(r.entries,{key:lht(t),value:lht(e)}),Yft||this.length++,r.updateURL()},delete:function(t){for(var e=Aht(this),r=vht(arguments.length,1),n=e.entries,i=lht(t),o=r<2?void 0:arguments[1],s=void 0===o?o:lht(o),a=0;ae.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=Aht(this).entries,n=cht(t,arguments.length>1?arguments[1]:void 0),i=0;i1?alt(arguments[1]):{})}}),sht(kht)){var clt=function(t){return oht(this,Rht),new kht(t,arguments.length>1?alt(arguments[1]):{})};Rht.constructor=clt,clt.prototype=Rht,Wft({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:clt})}}var ult,flt=ui,hlt=l,llt=Ift,dlt=u,plt=To,glt=T,ylt=on,mlt=no,vlt=Sm,wlt=Gt,blt=AR,Elt=ud,Slt=Zi,_lt=Uz.codeAt,Alt=function(t){var e,r,n=[],i=zft(Dft(Fft(t),Bft,"."),".");for(e=0;e?@[\\\]^|]/,cdt=/[\0\t\n\r #/:<>?@[\\\]^|]/,udt=/^[\u0000-\u0020]+/,fdt=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,hdt=/[\t\n\r]/g,ldt=function(t){var e,r,n,i;if("number"==typeof t){for(e=[],r=0;r<4;r++)Jlt(e,t%256),t=Ult(t/256);return Flt(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,i=0,o=0;o<8;o++)0!==t[o]?(i>r&&(e=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return i>r?n:e}(t),r=0;r<8;r++)i&&0===t[r]||(i&&(i=!1),n===r?(e+=r?":":"::",i=!0):(e+=Hlt(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},ddt={},pdt=blt({},ddt,{" ":1,'"':1,"<":1,">":1,"`":1}),gdt=blt({},pdt,{"#":1,"?":1,"{":1,"}":1}),ydt=blt({},gdt,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),mdt=function(t,e){var r=_lt(t,0);return r>32&&r<127&&!wlt(e,t)?t:encodeURIComponent(t)},vdt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},wdt=function(t,e){var r;return 2===t.length&&zlt(tdt,Dlt(t,0))&&(":"===(r=Dlt(t,1))||!e&&"|"===r)},bdt=function(t){var e;return t.length>1&&wdt(Glt(t,0,2))&&(2===t.length||"/"===(e=Dlt(t,2))||"\\"===e||"?"===e||"#"===e)},Edt=function(t){return"."===t||"%2e"===Zlt(t)},Sdt={},_dt={},Adt={},xdt={},Idt={},kdt={},Tdt={},Rdt={},Bdt={},Odt={},Mdt={},Cdt={},Ldt={},Pdt={},Ndt={},Udt={},jdt={},Ddt={},zdt={},Fdt={},Hdt={},$dt=function(t,e,r){var n,i,o,s=xlt(t);if(e){if(i=this.parse(s))throw new Plt(i);this.searchParams=null}else{if(void 0!==r&&(n=new $dt(r,!0)),i=this.parse(s,null,n))throw new Plt(i);(o=Clt(new Mlt)).bindURL(this),this.searchParams=o}};$dt.prototype={type:"URL",parse:function(t,e,r){var n,i,o,s,a,c=this,u=e||Sdt,f=0,h="",l=!1,d=!1,p=!1;for(t=xlt(t),e||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=Wlt(t,udt,""),t=Wlt(t,fdt,"$1")),t=Wlt(t,hdt,""),n=Elt(t);f<=n.length;){switch(i=n[f],u){case Sdt:if(!i||!zlt(tdt,i)){if(e)return Ylt;u=Adt;continue}h+=Zlt(i),u=_dt;break;case _dt:if(i&&(zlt(edt,i)||"+"===i||"-"===i||"."===i))h+=Zlt(i);else{if(":"!==i){if(e)return Ylt;h="",u=Adt,f=0;continue}if(e&&(c.isSpecial()!==wlt(vdt,h)||"file"===h&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=h,e)return void(c.isSpecial()&&vdt[c.scheme]===c.port&&(c.port=null));h="","file"===c.scheme?u=Pdt:c.isSpecial()&&r&&r.scheme===c.scheme?u=xdt:c.isSpecial()?u=Rdt:"/"===n[f+1]?(u=Idt,f++):(c.cannotBeABaseURL=!0,qlt(c.path,""),u=zdt)}break;case Adt:if(!r||r.cannotBeABaseURL&&"#"!==i)return Ylt;if(r.cannotBeABaseURL&&"#"===i){c.scheme=r.scheme,c.path=Slt(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,u=Hdt;break}u="file"===r.scheme?Pdt:kdt;continue;case xdt:if("/"!==i||"/"!==n[f+1]){u=kdt;continue}u=Bdt,f++;break;case Idt:if("/"===i){u=Odt;break}u=Ddt;continue;case kdt:if(c.scheme=r.scheme,i===ult)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=Slt(r.path),c.query=r.query;else if("/"===i||"\\"===i&&c.isSpecial())u=Tdt;else if("?"===i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=Slt(r.path),c.query="",u=Fdt;else{if("#"!==i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=Slt(r.path),c.path.length--,u=Ddt;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=Slt(r.path),c.query=r.query,c.fragment="",u=Hdt}break;case Tdt:if(!c.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,u=Ddt;continue}u=Odt}else u=Bdt;break;case Rdt:if(u=Bdt,"/"!==i||"/"!==Dlt(h,f+1))continue;f++;break;case Bdt:if("/"!==i&&"\\"!==i){u=Odt;continue}break;case Odt:if("@"===i){l&&(h="%40"+h),l=!0,o=Elt(h);for(var g=0;g65535)return Qlt;c.port=c.isSpecial()&&v===vdt[c.scheme]?null:v,h=""}if(e)return;u=jdt;continue}return Qlt}h+=i;break;case Pdt:if(c.scheme="file","/"===i||"\\"===i)u=Ndt;else{if(!r||"file"!==r.scheme){u=Ddt;continue}switch(i){case ult:c.host=r.host,c.path=Slt(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=Slt(r.path),c.query="",u=Fdt;break;case"#":c.host=r.host,c.path=Slt(r.path),c.query=r.query,c.fragment="",u=Hdt;break;default:bdt(Flt(Slt(n,f),""))||(c.host=r.host,c.path=Slt(r.path),c.shortenPath()),u=Ddt;continue}}break;case Ndt:if("/"===i||"\\"===i){u=Udt;break}r&&"file"===r.scheme&&!bdt(Flt(Slt(n,f),""))&&(wdt(r.path[0],!0)?qlt(c.path,r.path[0]):c.host=r.host),u=Ddt;continue;case Udt:if(i===ult||"/"===i||"\\"===i||"?"===i||"#"===i){if(!e&&wdt(h))u=Ddt;else if(""===h){if(c.host="",e)return;u=jdt}else{if(s=c.parseHost(h))return s;if("localhost"===c.host&&(c.host=""),e)return;h="",u=jdt}continue}h+=i;break;case jdt:if(c.isSpecial()){if(u=Ddt,"/"!==i&&"\\"!==i)continue}else if(e||"?"!==i)if(e||"#"!==i){if(i!==ult&&(u=Ddt,"/"!==i))continue}else c.fragment="",u=Hdt;else c.query="",u=Fdt;break;case Ddt:if(i===ult||"/"===i||"\\"===i&&c.isSpecial()||!e&&("?"===i||"#"===i)){if(".."===(a=Zlt(a=h))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(c.shortenPath(),"/"===i||"\\"===i&&c.isSpecial()||qlt(c.path,"")):Edt(h)?"/"===i||"\\"===i&&c.isSpecial()||qlt(c.path,""):("file"===c.scheme&&!c.path.length&&wdt(h)&&(c.host&&(c.host=""),h=Dlt(h,0)+":"),qlt(c.path,h)),h="","file"===c.scheme&&(i===ult||"?"===i||"#"===i))for(;c.path.length>1&&""===c.path[0];)Vlt(c.path);"?"===i?(c.query="",u=Fdt):"#"===i&&(c.fragment="",u=Hdt)}else h+=mdt(i,gdt);break;case zdt:"?"===i?(c.query="",u=Fdt):"#"===i?(c.fragment="",u=Hdt):i!==ult&&(c.path[0]+=mdt(i,ddt));break;case Fdt:e||"#"!==i?i!==ult&&("'"===i&&c.isSpecial()?c.query+="%27":c.query+="#"===i?"%23":mdt(i,ddt)):(c.fragment="",u=Hdt);break;case Hdt:i!==ult&&(c.fragment+=mdt(i,pdt))}f++}},parseHost:function(t){var e,r,n;if("["===Dlt(t,0)){if("]"!==Dlt(t,t.length-1))return Xlt;if(e=function(t){var e,r,n,i,o,s,a,c=[0,0,0,0,0,0,0,0],u=0,f=null,h=0,l=function(){return Dlt(t,h)};if(":"===l()){if(":"!==Dlt(t,1))return;h+=2,f=++u}for(;l();){if(8===u)return;if(":"!==l()){for(e=r=0;r<4&&zlt(sdt,l());)e=16*e+Nlt(l(),16),h++,r++;if("."===l()){if(0===r)return;if(h-=r,u>6)return;for(n=0;l();){if(i=null,n>0){if(!("."===l()&&n<4))return;h++}if(!zlt(rdt,l()))return;for(;zlt(rdt,l());){if(o=Nlt(l(),10),null===i)i=o;else{if(0===i)return;i=10*i+o}if(i>255)return;h++}c[u]=256*c[u]+i,2!=++n&&4!==n||u++}if(4!==n)return;break}if(":"===l()){if(h++,!l())return}else if(l())return;c[u++]=e}else{if(null!==f)return;h++,f=++u}}if(null!==f)for(s=u-f,u=7;0!==u&&s>0;)a=c[u],c[u--]=c[f+s-1],c[f+--s]=a;else if(8!==u)return;return c}(Glt(t,1,-1)),!e)return Xlt;this.host=e}else if(this.isSpecial()){if(t=Alt(t),zlt(adt,t))return Xlt;if(e=function(t){var e,r,n,i,o,s,a,c=Klt(t,".");if(c.length&&""===c[c.length-1]&&c.length--,(e=c.length)>4)return t;for(r=[],n=0;n1&&"0"===Dlt(i,0)&&(o=zlt(ndt,i)?16:8,i=Glt(i,8===o?1:2)),""===i)s=0;else{if(!zlt(10===o?odt:8===o?idt:sdt,i))return t;s=Nlt(i,o)}qlt(r,s)}for(n=0;n=jlt(256,5-e))return null}else if(s>255)return null;for(a=$lt(r),n=0;n1?arguments[1]:void 0,n=Blt(e,new $dt(t,!1,r));hlt||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},Wdt=qdt.prototype,Vdt=function(t,e){return{get:function(){return Olt(this)[t]()},set:e&&function(t){return Olt(this)[e](t)},configurable:!0,enumerable:!0}};if(hlt&&(mlt(Wdt,"href",Vdt("serialize","setHref")),mlt(Wdt,"origin",Vdt("getOrigin")),mlt(Wdt,"protocol",Vdt("getProtocol","setProtocol")),mlt(Wdt,"username",Vdt("getUsername","setUsername")),mlt(Wdt,"password",Vdt("getPassword","setPassword")),mlt(Wdt,"host",Vdt("getHost","setHost")),mlt(Wdt,"hostname",Vdt("getHostname","setHostname")),mlt(Wdt,"port",Vdt("getPort","setPort")),mlt(Wdt,"pathname",Vdt("getPathname","setPathname")),mlt(Wdt,"search",Vdt("getSearch","setSearch")),mlt(Wdt,"searchParams",Vdt("getSearchParams")),mlt(Wdt,"hash",Vdt("getHash","setHash"))),ylt(Wdt,"toJSON",(function(){return Olt(this).serialize()}),{enumerable:!0}),ylt(Wdt,"toString",(function(){return Olt(this).serialize()}),{enumerable:!0}),Llt){var Kdt=Llt.createObjectURL,Gdt=Llt.revokeObjectURL;Kdt&&ylt(qdt,"createObjectURL",plt(Kdt,Llt)),Gdt&&ylt(qdt,"revokeObjectURL",plt(Gdt,Llt))}Ilt(qdt,"URL"),flt({global:!0,constructor:!0,forced:!llt,sham:!hlt},{URL:qdt});var Zdt=ui,Jdt=h,Ydt=ZO,Xdt=Ei,Qdt=Ift,tpt=Y("URL"),ept=Qdt&&Jdt((function(){tpt.canParse()})),rpt=Jdt((function(){return 1!==tpt.canParse.length}));Zdt({target:"URL",stat:!0,forced:!ept||rpt},{canParse:function(t){var e=Ydt(arguments.length,1),r=Xdt(t),n=e<2||void 0===arguments[1]?void 0:Xdt(arguments[1]);try{return!!new tpt(r,n)}catch(t){return!1}}});var npt=ui,ipt=ZO,opt=Ei,spt=Ift,apt=Y("URL");npt({target:"URL",stat:!0,forced:!spt},{parse:function(t){var e=ipt(arguments.length,1),r=opt(t),n=e<2||void 0===arguments[1]?void 0:opt(arguments[1]);try{return new apt(r,n)}catch(t){return null}}});var cpt=y;ui({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return cpt(URL.prototype.toString,this)}});var upt=on,fpt=T,hpt=Ei,lpt=ZO,dpt=URLSearchParams,ppt=dpt.prototype,gpt=fpt(ppt.append),ypt=fpt(ppt.delete),mpt=fpt(ppt.forEach),vpt=fpt([].push),wpt=new dpt("a=1&a=2&b=3");wpt.delete("a",1),wpt.delete("b",void 0),wpt+""!="a=2"&&upt(ppt,"delete",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return ypt(this,t);var n=[];mpt(this,(function(t,e){vpt(n,{key:e,value:t})})),lpt(e,1);for(var i,o=hpt(t),s=hpt(r),a=0,c=0,u=!1,f=n.length;a>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r}function Fpt(t,e,r){function n(t,n,i,o){var s;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let r=0;r>>9<<4)+1}function $pt(t,e){const r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function qpt(t,e,r,n,i,o){return $pt((s=$pt($pt(e,t),$pt(n,o)))<<(a=i)|s>>>32-a,r);var s,a}function Wpt(t,e,r,n,i,o,s){return qpt(e&r|~e&n,t,e,i,o,s)}function Vpt(t,e,r,n,i,o,s){return qpt(e&n|r&~n,t,e,i,o,s)}function Kpt(t,e,r,n,i,o,s){return qpt(e^r^n,t,e,i,o,s)}function Gpt(t,e,r,n,i,o,s){return qpt(r^(e|~n),t,e,i,o,s)}Fpt("v3",48,(function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let r=0;r>5]>>>i%32&255,o=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);e.push(o)}return e}(function(t,e){t[e>>5]|=128<>5]|=(255&t[n/8])<>>32-e}Fpt("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let r=0;r>>0;u=c,c=a,a=Xpt(s,30)>>>0,s=i,i=o}r[0]=r[0]+i>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+a>>>0,r[3]=r[3]+c>>>0,r[4]=r[4]+u>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}));var Qpt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},tgt=[],egt=[],rgt="undefined"!=typeof Uint8Array?Uint8Array:Array,ngt=!1;function igt(){ngt=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0;e<64;++e)tgt[e]=t[e],egt[t.charCodeAt(e)]=e;egt["-".charCodeAt(0)]=62,egt["_".charCodeAt(0)]=63}function ogt(t,e,r){for(var n,i,o=[],s=e;s>18&63]+tgt[i>>12&63]+tgt[i>>6&63]+tgt[63&i]);return o.join("")}function sgt(t){var e;ngt||igt();for(var r=t.length,n=r%3,i="",o=[],s=16383,a=0,c=r-n;ac?c:a+s));return 1===n?(e=t[r-1],i+=tgt[e>>2],i+=tgt[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=tgt[e>>10],i+=tgt[e>>4&63],i+=tgt[e<<2&63],i+="="),o.push(i),o.join("")}function agt(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,f=-7,h=r?i-1:0,l=r?-1:1,d=t[e+h];for(h+=l,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+h],h+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+h],h+=l,f-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)}function cgt(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,f=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?l/c:l*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*g}var ugt={}.toString,fgt=Array.isArray||function(t){return"[object Array]"==ugt.call(t)};pgt.TYPED_ARRAY_SUPPORT=void 0===Qpt.TYPED_ARRAY_SUPPORT||Qpt.TYPED_ARRAY_SUPPORT;var hgt=lgt();function lgt(){return pgt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function dgt(t,e){if(lgt()=lgt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+lgt().toString(16)+" bytes");return 0|t}function bgt(t){return!(null==t||!t._isBuffer)}function Egt(t,e){if(bgt(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Ggt(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Zgt(t).length;default:if(n)return Ggt(t).length;e=(""+e).toLowerCase(),n=!0}}function Sgt(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Ugt(this,e,r);case"utf8":case"utf-8":return Cgt(this,e,r);case"ascii":return Pgt(this,e,r);case"latin1":case"binary":return Ngt(this,e,r);case"base64":return Mgt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jgt(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _gt(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Agt(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=pgt.from(e,n)),bgt(e))return 0===e.length?-1:xgt(t,e,r,n,i);if("number"==typeof e)return e&=255,pgt.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):xgt(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function xgt(t,e,r,n,i){var o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){for(var h=!0,l=0;li&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function Mgt(t,e,r){return 0===e&&r===t.length?sgt(t):sgt(t.slice(e,r))}function Cgt(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)>127&&(f=c);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(f=c)}null===f?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=h}return function(t){var e=t.length;if(e<=Lgt)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),""},pgt.prototype.compare=function(t,e,r,n,i){if(!bgt(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(n,i),u=t.slice(e,r),f=0;fi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return Igt(this,t,e,r);case"utf8":case"utf-8":return kgt(this,t,e,r);case"ascii":return Tgt(this,t,e,r);case"latin1":case"binary":return Rgt(this,t,e,r);case"base64":return Bgt(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ogt(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},pgt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Lgt=4096;function Pgt(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function zgt(t,e,r,n,i,o){if(!bgt(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function Fgt(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function Hgt(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function $gt(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function qgt(t,e,r,n,i){return i||$gt(t,0,r,4),cgt(t,e,r,n,23,4),r+4}function Wgt(t,e,r,n,i){return i||$gt(t,0,r,8),cgt(t,e,r,n,52,8),r+8}pgt.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},pgt.prototype.readUInt8=function(t,e){return e||Dgt(t,1,this.length),this[t]},pgt.prototype.readUInt16LE=function(t,e){return e||Dgt(t,2,this.length),this[t]|this[t+1]<<8},pgt.prototype.readUInt16BE=function(t,e){return e||Dgt(t,2,this.length),this[t]<<8|this[t+1]},pgt.prototype.readUInt32LE=function(t,e){return e||Dgt(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},pgt.prototype.readUInt32BE=function(t,e){return e||Dgt(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},pgt.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||Dgt(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},pgt.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||Dgt(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},pgt.prototype.readInt8=function(t,e){return e||Dgt(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},pgt.prototype.readInt16LE=function(t,e){e||Dgt(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},pgt.prototype.readInt16BE=function(t,e){e||Dgt(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},pgt.prototype.readInt32LE=function(t,e){return e||Dgt(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},pgt.prototype.readInt32BE=function(t,e){return e||Dgt(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},pgt.prototype.readFloatLE=function(t,e){return e||Dgt(t,4,this.length),agt(this,t,!0,23,4)},pgt.prototype.readFloatBE=function(t,e){return e||Dgt(t,4,this.length),agt(this,t,!1,23,4)},pgt.prototype.readDoubleLE=function(t,e){return e||Dgt(t,8,this.length),agt(this,t,!0,52,8)},pgt.prototype.readDoubleBE=function(t,e){return e||Dgt(t,8,this.length),agt(this,t,!1,52,8)},pgt.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||zgt(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},pgt.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||zgt(this,t,e,1,255,0),pgt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},pgt.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||zgt(this,t,e,2,65535,0),pgt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Fgt(this,t,e,!0),e+2},pgt.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||zgt(this,t,e,2,65535,0),pgt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Fgt(this,t,e,!1),e+2},pgt.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||zgt(this,t,e,4,4294967295,0),pgt.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Hgt(this,t,e,!0),e+4},pgt.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||zgt(this,t,e,4,4294967295,0),pgt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Hgt(this,t,e,!1),e+4},pgt.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);zgt(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s|0)-a&255;return e+r},pgt.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||zgt(this,t,e,1,127,-128),pgt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},pgt.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||zgt(this,t,e,2,32767,-32768),pgt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Fgt(this,t,e,!0),e+2},pgt.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||zgt(this,t,e,2,32767,-32768),pgt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Fgt(this,t,e,!1),e+2},pgt.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||zgt(this,t,e,4,2147483647,-2147483648),pgt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Hgt(this,t,e,!0),e+4},pgt.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||zgt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),pgt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Hgt(this,t,e,!1),e+4},pgt.prototype.writeFloatLE=function(t,e,r){return qgt(this,t,e,!0,r)},pgt.prototype.writeFloatBE=function(t,e,r){return qgt(this,t,e,!1,r)},pgt.prototype.writeDoubleLE=function(t,e,r){return Wgt(this,t,e,!0,r)},pgt.prototype.writeDoubleBE=function(t,e,r){return Wgt(this,t,e,!1,r)},pgt.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!pgt.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Zgt(t){return function(t){var e,r,n,i,o,s;ngt||igt();var a=t.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[a-2]?2:"="===t[a-1]?1:0,s=new rgt(3*a/4-o),n=o>0?a-4:a;var c=0;for(e=0,r=0;e>16&255,s[c++]=i>>8&255,s[c++]=255&i;return 2===o?(i=egt[t.charCodeAt(e)]<<2|egt[t.charCodeAt(e+1)]>>4,s[c++]=255&i):1===o&&(i=egt[t.charCodeAt(e)]<<10|egt[t.charCodeAt(e+1)]<<4|egt[t.charCodeAt(e+2)]>>2,s[c++]=i>>8&255,s[c++]=255&i),s}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Vgt,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Jgt(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Ygt(t){return null!=t&&(!!t._isBuffer||Xgt(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Xgt(t.slice(0,0))}(t))}function Xgt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var Qgt=Object.freeze({__proto__:null,Buffer:pgt,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),pgt.alloc(+t)},isBuffer:Ygt,kMaxLength:hgt});function tyt(){}function eyt(){eyt.init.call(this)}function ryt(t){return void 0===t._maxListeners?eyt.defaultMaxListeners:t._maxListeners}function nyt(t,e,r,n){var i,o,s,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=t._events)?(o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]):(o=t._events=new tyt,t._eventsCount=0),s){if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),!s.warned&&(i=ryt(t))&&i>0&&s.length>i){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=s.length,a=c,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=o[e]=r,++t._eventsCount;return t}function iyt(t,e,r){var n=!1;function i(){t.removeListener(e,i),n||(n=!0,r.apply(t,arguments))}return i.listener=r,i}function oyt(t){var e=this._events;if(e){var r=e[t];if("function"==typeof r)return 1;if(r)return r.length}return 0}function syt(t,e){for(var r=new Array(e);e--;)r[e]=t[e];return r}tyt.prototype=Object.create(null),eyt.EventEmitter=eyt,eyt.usingDomains=!1,eyt.prototype.domain=void 0,eyt.prototype._events=void 0,eyt.prototype._maxListeners=void 0,eyt.defaultMaxListeners=10,eyt.init=function(){this.domain=null,eyt.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new tyt,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},eyt.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},eyt.prototype.getMaxListeners=function(){return ryt(this)},eyt.prototype.emit=function(t){var e,r,n,i,o,s,a,c="error"===t;if(s=this._events)c=c&&null==s.error;else if(!c)return!1;if(a=this.domain,c){if(e=arguments[1],!a){if(e instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=a,e.domainThrown=!1,a.emit("error",e),!1}if(!(r=s[t]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=syt(t,n),o=0;o0;)if(r[o]===e||r[o].listener&&r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new tyt,this;delete n[t]}else!function(t,e){for(var r=e,n=r+1,i=t.length;n0?Reflect.ownKeys(this._events):[]};var ayt=Object.freeze({__proto__:null,default:eyt,EventEmitter:eyt});const cyt="PROMISES",uyt="CALLBACK";class fyt{static isCallbackAdapterRequest(t){return void 0!==t.id}constructor(t){this.setStrategy(t)}setHandler(t){return this.handler=t,this}request(t,e){if(!this.handler)throw new Error("No handler defined for Adapter");return fyt.isCallbackAdapterRequest(t)?this.handler({network:e,id:t.id,name:t.method,params:t.params,object:t.params}):this.handler({name:t.method,network:e,params:t.params,object:t.params})}setStrategy(t){return this.strategy=t,this}getStrategy(){return this.strategy}}class hyt extends Error{constructor(t,e){super(),this.code=t,this.message=e}toString(){return`${this.message} (${this.code})`}}var lyt=Object.defineProperty,dyt=Object.defineProperties,pyt=Object.getOwnPropertyDescriptors,gyt=Object.getOwnPropertySymbols,yyt=Object.prototype.hasOwnProperty,myt=Object.prototype.propertyIsEnumerable,vyt=(t,e,r)=>e in t?lyt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;class wyt extends fyt{constructor(){super(uyt),this.callback=new Map}async request(t,e){return new Promise(((r,n)=>{const i=(new Date).getTime()+Math.floor(1e3*Math.random());this.callback.set(i.toString(),{reject:n,resolve:r}),super.request(((t,e)=>dyt(t,pyt(e)))(((t,e)=>{for(var r in e||(e={}))yyt.call(e,r)&&vyt(t,r,e[r]);if(gyt)for(var r of gyt(e))myt.call(e,r)&&vyt(t,r,e[r]);return t})({},t),{id:i}),e)}))}sendResponse(t,e){if(this.callback.has(t.toString())){const r=this.callback.get(t.toString());this.callback.delete(t.toString()),null==r||r.resolve(e)}else console.error(`Unable to find callback for requestId: ${t}`)}sendError(t,e){if(this.callback.has(t.toString())){const r=this.callback.get(t.toString());this.callback.delete(t.toString());let n=e;"string"==typeof n&&!isNaN(parseInt(n,10))&&(n=new hyt(parseInt(n,10),n)),null==r||r.reject(n)}else console.error(`Unable to find callback for requestId: ${t}`)}}class byt extends fyt{constructor(){super(cyt)}request(t,e){return super.request(t,e)}}class Eyt extends eyt{setAdapter(t){return this.adapter=t,this}async request(t){try{if(!this.adapter)throw new Error("No adapter set, maybe you forgot to register the provider?");const e=await this.adapter.request(t,this.getNetwork());return this.emit("onResponseReady",t,e),e}catch(t){throw t}}sendResponse(t,e){if(!this.adapter)throw new Error("Adapter not found");if(this.adapter.getStrategy()!==uyt)throw new Error("Trying to send callback request on promisified adapter");this.adapter.sendResponse(t,e)}sendError(t,e){if(!this.adapter)throw new Error("Adapter not found");if(this.adapter.getStrategy()!==uyt)throw new Error("Trying to send callback request on promisified adapter");this.adapter.sendError(t,e)}}class Syt{constructor(t){const e=t.strategy===uyt?new wyt:new byt;t.handler&&e.setHandler(t.handler),this.setAdapter(e)}setHandler(t){this.adapter.setHandler(t)}setAdapter(t){return this.adapter=t,this}registerProvider(t){return t.setAdapter(this.adapter),this}registerProviders(t){return t.forEach((t=>this.registerProvider(t))),this}sendResponse(t,e){"CALLBACK"===this.adapter.getStrategy()&&this.adapter.sendResponse(t,e)}sendError(t,e){"CALLBACK"===this.adapter.getStrategy()&&this.adapter.sendError(t,e)}}function _yt(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Ayt(t,...e){if(!function(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function xyt(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}const Iyt="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,kyt=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Tyt=(t,e)=>t<<32-e|t>>>e;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ryt(t){return"string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}(t)),Ayt(t),t}class Byt{clone(){return this._cloneInto()}}function Oyt(t){const e=e=>t().update(Ryt(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Myt(t=32){if(Iyt&&"function"==typeof Iyt.getRandomValues)return Iyt.getRandomValues(new Uint8Array(t));if(Iyt&&"function"==typeof Iyt.randomBytes)return Iyt.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const Cyt=(t,e,r)=>t&e^~t&r,Lyt=(t,e,r)=>t&e^t&r^e&r;class Pyt extends Byt{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=kyt(this.buffer)}update(t){xyt(this);const{view:e,buffer:r,blockLen:n}=this,i=(t=Ryt(t)).length;for(let o=0;on-o&&(this.process(r,0),o=0);for(let t=o;t>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;t.setUint32(e+c,s,n),t.setUint32(e+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=kyt(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t>Uyt&Nyt)}:{h:0|Number(t>>Uyt&Nyt),l:0|Number(t&Nyt)}}const Dyt={fromBig:jyt,split:function(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),shrSH:(t,e,r)=>t>>>r,shrSL:(t,e,r)=>t<<32-r|e>>>r,rotrSH:(t,e,r)=>t>>>r|e<<32-r,rotrSL:(t,e,r)=>t<<32-r|e>>>r,rotrBH:(t,e,r)=>t<<64-r|e>>>r-32,rotrBL:(t,e,r)=>t>>>r-32|e<<64-r,rotr32H:(t,e)=>e,rotr32L:(t,e)=>t,rotlSH:(t,e,r)=>t<>>32-r,rotlSL:(t,e,r)=>e<>>32-r,rotlBH:(t,e,r)=>e<>>64-r,rotlBL:(t,e,r)=>t<>>64-r,add:function(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:0|i}},add3L:(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),add3H:(t,e,r,n)=>e+r+n+(t/2**32|0)|0,add4L:(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),add4H:(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,add5H:(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0,add5L:(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},[zyt,Fyt]=(()=>Dyt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((t=>BigInt(t)))))(),Hyt=new Uint32Array(80),$yt=new Uint32Array(80);class qyt extends Pyt{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:e,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:f,Fl:h,Gh:l,Gl:d,Hh:p,Hl:g}=this;return[t,e,r,n,i,o,s,a,c,u,f,h,l,d,p,g]}set(t,e,r,n,i,o,s,a,c,u,f,h,l,d,p,g){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|f,this.Fl=0|h,this.Gh=0|l,this.Gl=0|d,this.Hh=0|p,this.Hl=0|g}process(t,e){for(let r=0;r<16;r++,e+=4)Hyt[r]=t.getUint32(e),$yt[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|Hyt[t-15],r=0|$yt[t-15],n=Dyt.rotrSH(e,r,1)^Dyt.rotrSH(e,r,8)^Dyt.shrSH(e,r,7),i=Dyt.rotrSL(e,r,1)^Dyt.rotrSL(e,r,8)^Dyt.shrSL(e,r,7),o=0|Hyt[t-2],s=0|$yt[t-2],a=Dyt.rotrSH(o,s,19)^Dyt.rotrBH(o,s,61)^Dyt.shrSH(o,s,6),c=Dyt.rotrSL(o,s,19)^Dyt.rotrBL(o,s,61)^Dyt.shrSL(o,s,6),u=Dyt.add4L(i,c,$yt[t-7],$yt[t-16]),f=Dyt.add4H(u,n,a,Hyt[t-7],Hyt[t-16]);Hyt[t]=0|f,$yt[t]=0|u}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:f,El:h,Fh:l,Fl:d,Gh:p,Gl:g,Hh:y,Hl:m}=this;for(let t=0;t<80;t++){const e=Dyt.rotrSH(f,h,14)^Dyt.rotrSH(f,h,18)^Dyt.rotrBH(f,h,41),v=Dyt.rotrSL(f,h,14)^Dyt.rotrSL(f,h,18)^Dyt.rotrBL(f,h,41),w=f&l^~f&p,b=h&d^~h&g,E=Dyt.add5L(m,v,b,Fyt[t],$yt[t]),S=Dyt.add5H(E,y,e,w,zyt[t],Hyt[t]),_=0|E,A=Dyt.rotrSH(r,n,28)^Dyt.rotrBH(r,n,34)^Dyt.rotrBH(r,n,39),x=Dyt.rotrSL(r,n,28)^Dyt.rotrBL(r,n,34)^Dyt.rotrBL(r,n,39),I=r&i^r&s^i&s,k=n&o^n&a^o&a;y=0|p,m=0|g,p=0|l,g=0|d,l=0|f,d=0|h,({h:f,l:h}=Dyt.add(0|c,0|u,0|S,0|_)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|r,o=0|n;const T=Dyt.add3L(_,x,k);r=Dyt.add3H(T,S,A,I),n=0|T}({h:r,l:n}=Dyt.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=Dyt.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=Dyt.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=Dyt.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:f,l:h}=Dyt.add(0|this.Eh,0|this.El,0|f,0|h)),({h:l,l:d}=Dyt.add(0|this.Fh,0|this.Fl,0|l,0|d)),({h:p,l:g}=Dyt.add(0|this.Gh,0|this.Gl,0|p,0|g)),({h:y,l:m}=Dyt.add(0|this.Hh,0|this.Hl,0|y,0|m)),this.set(r,n,i,o,s,a,c,u,f,h,l,d,p,g,y,m)}roundClean(){Hyt.fill(0),$yt.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Wyt=Oyt((()=>new qyt)),Vyt=BigInt(0),Kyt=BigInt(1),Gyt=BigInt(2);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Zyt(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function Jyt(t){if(!Zyt(t))throw new Error("Uint8Array expected")}function Yyt(t,e){if("boolean"!=typeof e)throw new Error(t+" boolean expected, got "+e)}const Xyt=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function Qyt(t){Jyt(t);let e="";for(let r=0;r=rmt&&t<=nmt?t-rmt:t>=imt&&t<=omt?t-(imt-10):t>=smt&&t<=amt?t-(smt-10):void 0}function umt(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let e=0,i=0;e"bigint"==typeof t&&Vyt<=t;function mmt(t,e,r){return ymt(t)&&ymt(e)&&ymt(r)&&e<=t&&tVyt;t>>=Kyt,e+=1);return e}const bmt=t=>(Gyt<new Uint8Array(t),Smt=t=>Uint8Array.from(t);function _mt(t,e,r){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=Emt(t),i=Emt(t),o=0;const s=()=>{n.fill(1),i.fill(0),o=0},a=(...t)=>r(i,n,...t),c=(t=Emt())=>{i=a(Smt([0]),t),n=a(),0!==t.length&&(i=a(Smt([1]),t),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const r=[];for(;t{let r;for(s(),c(t);!(r=e(u()));)c();return s(),r}}const Amt={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||Zyt(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function xmt(t,e,r={}){const n=(e,r,n)=>{const i=Amt[r];if("function"!=typeof i)throw new Error("invalid validator function");const o=t[e];if(!(n&&void 0===o||i(o,t)))throw new Error("param "+String(e)+" is invalid. Expected "+r+", got "+o)};for(const[t,r]of Object.entries(e))n(t,r,!1);for(const[t,e]of Object.entries(r))n(t,e,!0);return t}function Imt(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(void 0!==i)return i;const o=t(r,...n);return e.set(r,o),o}}var kmt=Object.freeze({__proto__:null,isBytes:Zyt,abytes:Jyt,abool:Yyt,bytesToHex:Qyt,numberToHexUnpadded:tmt,hexToNumber:emt,hexToBytes:umt,bytesToNumberBE:fmt,bytesToNumberLE:hmt,numberToBytesBE:lmt,numberToBytesLE:dmt,numberToVarBytesBE:function(t){return umt(tmt(t))},ensureBytes:pmt,concatBytes:gmt,equalBytes:function(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n>BigInt(e)&Kyt},bitSet:function(t,e,r){return t|(r?Kyt:Vyt)<{throw new Error("not implemented")},memoized:Imt});/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Tmt=BigInt(0),Rmt=BigInt(1),Bmt=BigInt(2),Omt=BigInt(3),Mmt=BigInt(4),Cmt=BigInt(5),Lmt=BigInt(8);function Pmt(t,e){const r=t%e;return r>=Tmt?r:e+r}function Nmt(t,e,r){if(eTmt;)e&Rmt&&(n=n*t%r),t=t*t%r,e>>=Rmt;return n}function Umt(t,e,r){let n=t;for(;e-- >Tmt;)n*=n,n%=r;return n}function jmt(t,e){if(t===Tmt)throw new Error("invert: expected non-zero number");if(e<=Tmt)throw new Error("invert: expected positive modulus, got "+e);let r=Pmt(t,e),n=e,i=Tmt,o=Rmt;for(;r!==Tmt;){const t=n%r,e=i-o*(n/r);n=r,r=t,i=o,o=e}if(n!==Rmt)throw new Error("invert: does not exist");return Pmt(i,e)}function Dmt(t){if(t%Mmt===Omt){const e=(t+Rmt)/Mmt;return function(t,r){const n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw new Error("Cannot find square root");return n}}if(t%Lmt===Cmt){const e=(t-Cmt)/Lmt;return function(t,r){const n=t.mul(r,Bmt),i=t.pow(n,e),o=t.mul(r,i),s=t.mul(t.mul(o,Bmt),i),a=t.mul(o,t.sub(s,t.ONE));if(!t.eql(t.sqr(a),r))throw new Error("Cannot find square root");return a}}return function(t){const e=(t-Rmt)/Bmt;let r,n,i;for(r=t-Rmt,n=0;r%Bmt===Tmt;r/=Bmt,n++);for(i=Bmt;i1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===n){const e=(t+Rmt)/Mmt;return function(t,r){const n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw new Error("Cannot find square root");return n}}const o=(r+Rmt)/Bmt;return function(t,s){if(t.pow(s,e)===t.neg(t.ONE))throw new Error("Cannot find square root");let a=n,c=t.pow(t.mul(t.ONE,i),r),u=t.pow(s,o),f=t.pow(s,r);for(;!t.eql(f,t.ONE);){if(t.eql(f,t.ZERO))return t.ZERO;let e=1;for(let r=t.sqr(f);e 0, got "+t);const{nBitLength:i,nByteLength:o}=Fmt(t,e);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const a=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:bmt(i),ZERO:Tmt,ONE:Rmt,create:e=>Pmt(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return Tmt<=e&&et===Tmt,isOdd:t=>(t&Rmt)===Rmt,neg:e=>Pmt(-e,t),eql:(t,e)=>t===e,sqr:e=>Pmt(e*e,t),add:(e,r)=>Pmt(e+r,t),sub:(e,r)=>Pmt(e-r,t),mul:(e,r)=>Pmt(e*r,t),pow:(t,e)=>function(t,e,r){if(rTmt;)r&Rmt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Rmt;return n}(a,t,e),div:(e,r)=>Pmt(e*jmt(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>jmt(e,t),sqrt:n.sqrt||(e=>(s||(s=Dmt(t)),s(a,e))),invertBatch:t=>function(t,e){const r=new Array(e.length),n=e.reduce(((e,n,i)=>t.is0(n)?e:(r[i]=e,t.mul(e,n))),t.ONE),i=t.inv(n);return e.reduceRight(((e,n,i)=>t.is0(n)?e:(r[i]=t.mul(e,r[i]),t.mul(e,n))),i),r}(a,t),cmov:(t,e,r)=>r?e:t,toBytes:t=>r?dmt(t,o):lmt(t,o),fromBytes:t=>{if(t.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+t.length);return r?hmt(t):fmt(t)}});return Object.freeze(a)}function $mt(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function qmt(t){const e=$mt(t);return e+Math.ceil(e/2)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Wmt=BigInt(0),Vmt=BigInt(1);function Kmt(t,e){const r=e.negate();return t?r:e}function Gmt(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Zmt(t,e){Gmt(t,e);return{windows:Math.ceil(e/t)+1,windowSize:2**(t-1)}}const Jmt=new WeakMap,Ymt=new WeakMap;function Xmt(t){return Ymt.get(t)||1}function Qmt(t,e){return{constTimeNegate:Kmt,hasPrecomputes:t=>1!==Xmt(t),unsafeLadder(e,r,n=t.ZERO){let i=e;for(;r>Wmt;)r&Vmt&&(n=n.add(i)),i=i.double(),r>>=Vmt;return n},precomputeWindow(t,r){const{windows:n,windowSize:i}=Zmt(r,e),o=[];let s=t,a=s;for(let t=0;t>=h,r>s&&(r-=f,i+=Vmt);const o=e,l=e+Math.abs(r)-1,d=t%2!=0,p=r<0;0===r?c=c.add(Kmt(d,n[o])):a=a.add(Kmt(p,n[l]))}return{p:a,f:c}},wNAFUnsafe(r,n,i,o=t.ZERO){const{windows:s,windowSize:a}=Zmt(r,e),c=BigInt(2**r-1),u=2**r,f=BigInt(r);for(let t=0;t>=f,r>a&&(r-=u,i+=Vmt),0===r)continue;let s=n[e+Math.abs(r)-1];r<0&&(s=s.negate()),o=o.add(s)}return o},getPrecomputes(t,e,r){let n=Jmt.get(e);return n||(n=this.precomputeWindow(e,t),1!==t&&Jmt.set(e,r(n))),n},wNAFCached(t,e,r){const n=Xmt(t);return this.wNAF(n,this.getPrecomputes(n,t,r),e)},wNAFCachedUnsafe(t,e,r,n){const i=Xmt(t);return 1===i?this.unsafeLadder(t,e,n):this.wNAFUnsafe(i,this.getPrecomputes(i,t,r),e,n)},setWindowSize(t,r){Gmt(r,e),Ymt.set(t,r),Jmt.delete(t)}}}function tvt(t,e,r,n){if(function(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach(((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)}))}(r,t),function(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach(((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)}))}(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,o=wmt(BigInt(r.length)),s=o>12?o-3:o>4?o-2:o?2:1,a=(1<=0;t-=s){c.fill(i);for(let e=0;e>BigInt(t)&BigInt(a));c[o]=c[o].add(r[e])}let e=i;for(let t=c.length-1,r=i;t>0;t--)r=r.add(c[t]),e=e.add(r);if(u=u.add(e),0!==t)for(let t=0;t(t[e]="function",t)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});xmt(t,e)}(t.Fp),xmt(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Fmt(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rvt=BigInt(0),nvt=BigInt(1),ivt=BigInt(2),ovt=BigInt(8),svt={zip215:!0};function avt(t){const e=function(t){const e=evt(t);return xmt(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}(t),{Fp:r,n:n,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=e,u=ivt<{try{return{isValid:!0,value:r.sqrt(t*r.inv(e))}}catch(t){return{isValid:!1,value:rvt}}}),d=e.adjustScalarBytes||(t=>t),p=e.domain||((t,e,r)=>{if(Yyt("phflag",r),e.length||r)throw new Error("Contexts/pre-hash are not supported");return t});function g(t,e){vmt("coordinate "+t,e,rvt,u)}function y(t){if(!(t instanceof w))throw new Error("ExtendedPoint expected")}const m=Imt(((t,e)=>{const{ex:n,ey:i,ez:o}=t,s=t.is0();null==e&&(e=s?ovt:r.inv(o));const a=f(n*e),c=f(i*e),u=f(o*e);if(s)return{x:rvt,y:nvt};if(u!==nvt)throw new Error("invZ was invalid");return{x:a,y:c}})),v=Imt((t=>{const{a:r,d:n}=e;if(t.is0())throw new Error("bad point: ZERO");const{ex:i,ey:o,ez:s,et:a}=t,c=f(i*i),u=f(o*o),h=f(s*s),l=f(h*h),d=f(c*r);if(f(h*f(d+u))!==f(l+f(n*f(c*u))))throw new Error("bad point: equation left != right (1)");if(f(i*o)!==f(s*a))throw new Error("bad point: equation left != right (2)");return!0}));class w{constructor(t,e,r,n){this.ex=t,this.ey=e,this.ez=r,this.et=n,g("x",t),g("y",e),g("z",r),g("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(t){if(t instanceof w)throw new Error("extended point not allowed");const{x:e,y:r}=t||{};return g("x",e),g("y",r),new w(e,r,nvt,f(e*r))}static normalizeZ(t){const e=r.invertBatch(t.map((t=>t.ez)));return t.map(((t,r)=>t.toAffine(e[r]))).map(w.fromAffine)}static msm(t,e){return tvt(w,h,t,e)}_setWindowSize(t){S.setWindowSize(this,t)}assertValidity(){v(this)}equals(t){y(t);const{ex:e,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=t,a=f(e*s),c=f(i*n),u=f(r*s),h=f(o*n);return a===c&&u===h}is0(){return this.equals(w.ZERO)}negate(){return new w(f(-this.ex),this.ey,this.ez,f(-this.et))}double(){const{a:t}=e,{ex:r,ey:n,ez:i}=this,o=f(r*r),s=f(n*n),a=f(ivt*f(i*i)),c=f(t*o),u=r+n,h=f(f(u*u)-o-s),l=c+s,d=l-a,p=c-s,g=f(h*d),y=f(l*p),m=f(h*p),v=f(d*l);return new w(g,y,v,m)}add(t){y(t);const{a:r,d:n}=e,{ex:i,ey:o,ez:s,et:a}=this,{ex:c,ey:u,ez:h,et:l}=t;if(r===BigInt(-1)){const t=f((o-i)*(u+c)),e=f((o+i)*(u-c)),r=f(e-t);if(r===rvt)return this.double();const n=f(s*ivt*l),d=f(a*ivt*h),p=d+n,g=e+t,y=d-n,m=f(p*r),v=f(g*y),b=f(p*y),E=f(r*g);return new w(m,v,E,b)}const d=f(i*c),p=f(o*u),g=f(a*n*l),m=f(s*h),v=f((i+o)*(c+u)-d-p),b=m-g,E=m+g,S=f(p-r*d),_=f(v*b),A=f(E*S),x=f(v*S),I=f(b*E);return new w(_,A,I,x)}subtract(t){return this.add(t.negate())}wNAF(t){return S.wNAFCached(this,t,w.normalizeZ)}multiply(t){const e=t;vmt("scalar",e,nvt,n);const{p:r,f:i}=this.wNAF(e);return w.normalizeZ([r,i])[0]}multiplyUnsafe(t,e=w.ZERO){const r=t;return vmt("scalar",r,rvt,n),r===rvt?E:this.is0()||r===nvt?this:S.wNAFCachedUnsafe(this,r,w.normalizeZ,e)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return S.unsafeLadder(this,n).is0()}toAffine(t){return m(this,t)}clearCofactor(){const{h:t}=e;return t===nvt?this:this.multiplyUnsafe(t)}static fromHex(t,n=!1){const{d:i,a:o}=e,s=r.BYTES;t=pmt("pointHex",t,s),Yyt("zip215",n);const a=t.slice(),c=t[s-1];a[s-1]=-129&c;const h=hmt(a),d=n?u:r.ORDER;vmt("pointHex.y",h,rvt,d);const p=f(h*h),g=f(p-nvt),y=f(i*p-o);let{isValid:m,value:v}=l(g,y);if(!m)throw new Error("Point.fromHex: invalid y coordinate");const b=(v&nvt)===nvt,E=!!(128&c);if(!n&&v===rvt&&E)throw new Error("Point.fromHex: x=0 and x_0=1");return E!==b&&(v=f(-v)),w.fromAffine({x:v,y:h})}static fromPrivateKey(t){return x(t).point}toRawBytes(){const{x:t,y:e}=this.toAffine(),n=dmt(e,r.BYTES);return n[n.length-1]|=t&nvt?128:0,n}toHex(){return Qyt(this.toRawBytes())}}w.BASE=new w(e.Gx,e.Gy,nvt,f(e.Gx*e.Gy)),w.ZERO=new w(rvt,nvt,nvt,rvt);const{BASE:b,ZERO:E}=w,S=Qmt(w,8*a);function _(t){return Pmt(t,n)}function A(t){return _(hmt(t))}function x(t){const e=r.BYTES;t=pmt("private key",t,e);const n=pmt("hashed private key",o(t),2*e),i=d(n.slice(0,e)),s=n.slice(e,2*e),a=A(i),c=b.multiply(a),u=c.toRawBytes();return{head:i,prefix:s,scalar:a,point:c,pointBytes:u}}function I(t=new Uint8Array,...e){const r=gmt(...e);return A(o(p(r,pmt("context",t),!!i)))}const k=svt;b._setWindowSize(8);return{CURVE:e,getPublicKey:function(t){return x(t).pointBytes},sign:function(t,e,o={}){t=pmt("message",t),i&&(t=i(t));const{prefix:s,scalar:a,pointBytes:c}=x(e),u=I(o.context,s,t),f=b.multiply(u).toRawBytes(),h=_(u+I(o.context,f,c,t)*a);return vmt("signature.s",h,rvt,n),pmt("result",gmt(f,dmt(h,r.BYTES)),2*r.BYTES)},verify:function(t,e,n,o=k){const{context:s,zip215:a}=o,c=r.BYTES;t=pmt("signature",t,2*c),e=pmt("message",e),n=pmt("publicKey",n,c),void 0!==a&&Yyt("zip215",a),i&&(e=i(e));const u=hmt(t.slice(c,2*c));let f,h,l;try{f=w.fromHex(n,a),h=w.fromHex(t.slice(0,c),a),l=b.multiplyUnsafe(u)}catch(t){return!1}if(!a&&f.isSmallOrder())return!1;const d=I(s,h.toRawBytes(),f.toRawBytes(),e);return h.add(f.multiplyUnsafe(d)).subtract(l).clearCofactor().equals(w.ZERO)},ExtendedPoint:w,utils:{getExtendedPublicKey:x,randomPrivateKey:()=>s(r.BYTES),precompute:(t=8,e=w.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0),BigInt(1);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const cvt=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),uvt=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const fvt=BigInt(1),hvt=BigInt(2);BigInt(3);const lvt=BigInt(5),dvt=BigInt(8);function pvt(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function gvt(t,e){const r=cvt,n=Pmt(e*e*e,r),i=function(t){const e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=cvt,s=t*t%o*t%o,a=Umt(s,hvt,o)*s%o,c=Umt(a,fvt,o)*t%o,u=Umt(c,lvt,o)*c%o,f=Umt(u,e,o)*u%o,h=Umt(f,r,o)*f%o,l=Umt(h,n,o)*h%o,d=Umt(l,i,o)*l%o,p=Umt(d,i,o)*l%o,g=Umt(p,e,o)*u%o;return{pow_p_5_8:Umt(g,hvt,o)*t%o,b2:s}}(t*Pmt(n*n*e,r)).pow_p_5_8;let o=Pmt(t*n*i,r);const s=Pmt(e*o*o,r),a=o,c=Pmt(o*uvt,r),u=s===t,f=s===Pmt(-t,r),h=s===Pmt(-t*uvt,r);return u&&(o=a),(f||h)&&(o=c),(Pmt(o,r)&Rmt)===Rmt&&(o=Pmt(-o,r)),{isValid:u||f,value:o}}const yvt=(()=>Hmt(cvt,void 0,!0))(),mvt=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:yvt,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:dvt,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Wyt,randomBytes:Myt,adjustScalarBytes:pvt,uvRatio:gvt}))(),vvt=(()=>avt(mvt))();var wvt={exports:{}},bvt=s(Qgt);!function(t){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:bvt.Buffer}catch(t){}function s(t,e){var n=t.charCodeAt(e);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+t)}function a(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,n,i){for(var o=0,s=0,a=Math.min(t.length,n),c=e;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=a(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(t){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?h[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var u=l[t],f=d[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(f).toString(t);n=(p=p.idivn(f)).isZero()?g+n:h[u-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,h=67108863&c,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}i.prototype.toArrayLike=function(t,e,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,v=y>>>13,w=0|s[3],b=8191&w,E=w>>>13,S=0|s[4],_=8191&S,A=S>>>13,x=0|s[5],I=8191&x,k=x>>>13,T=0|s[6],R=8191&T,B=T>>>13,O=0|s[7],M=8191&O,C=O>>>13,L=0|s[8],P=8191&L,N=L>>>13,U=0|s[9],j=8191&U,D=U>>>13,z=0|a[0],F=8191&z,H=z>>>13,$=0|a[1],q=8191&$,W=$>>>13,V=0|a[2],K=8191&V,G=V>>>13,Z=0|a[3],J=8191&Z,Y=Z>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ct=8191&at,ut=at>>>13,ft=0|a[8],ht=8191&ft,lt=ft>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(u+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(l,F)|0))<<13)|0;u=((o=Math.imul(l,H))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,H))+Math.imul(g,F)|0,o=Math.imul(g,H);var mt=(u+(n=n+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(l,q)|0))<<13)|0;u=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,H))+Math.imul(v,F)|0,o=Math.imul(v,H),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,W)|0;var vt=(u+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(l,K)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(b,F),i=(i=Math.imul(b,H))+Math.imul(E,F)|0,o=Math.imul(E,H),n=n+Math.imul(m,q)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,G)|0;var wt=(u+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(l,J)|0))<<13)|0;u=((o=o+Math.imul(l,Y)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(_,F),i=(i=Math.imul(_,H))+Math.imul(A,F)|0,o=Math.imul(A,H),n=n+Math.imul(b,q)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,Y)|0;var bt=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(l,Q)|0))<<13)|0;u=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(I,F),i=(i=Math.imul(I,H))+Math.imul(k,F)|0,o=Math.imul(k,H),n=n+Math.imul(_,q)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(m,J)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0;var Et=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(l,rt)|0))<<13)|0;u=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,H))+Math.imul(B,F)|0,o=Math.imul(B,H),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(_,K)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0;var St=(u+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(l,ot)|0))<<13)|0;u=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,H))+Math.imul(C,F)|0,o=Math.imul(C,H),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,q)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var _t=(u+(n=n+Math.imul(h,ct)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(l,ct)|0))<<13)|0;u=((o=o+Math.imul(l,ut)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,H))+Math.imul(N,F)|0,o=Math.imul(N,H),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0;var At=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,lt)|0)+Math.imul(l,ht)|0))<<13)|0;u=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,F),i=(i=Math.imul(j,H))+Math.imul(D,F)|0,o=Math.imul(D,H),n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(m,ct)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,ut)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,lt)|0;var xt=(u+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,gt)|0)+Math.imul(l,pt)|0))<<13)|0;u=((o=o+Math.imul(l,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(j,q),i=(i=Math.imul(j,W))+Math.imul(D,q)|0,o=Math.imul(D,W),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,ut)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,ut)|0,n=n+Math.imul(m,ht)|0,i=(i=i+Math.imul(m,lt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,lt)|0;var It=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,K),i=(i=Math.imul(j,G))+Math.imul(D,K)|0,o=Math.imul(D,G),n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(_,ct)|0,i=(i=i+Math.imul(_,ut)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ut)|0,n=n+Math.imul(b,ht)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,lt)|0;var kt=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,gt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((o=o+Math.imul(v,gt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(j,J),i=(i=Math.imul(j,Y))+Math.imul(D,J)|0,o=Math.imul(D,Y),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,ut)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,ut)|0,n=n+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,lt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,lt)|0;var Tt=(u+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,gt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,ut)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,lt)|0;var Rt=(u+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,gt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((o=o+Math.imul(A,gt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(j,rt),i=(i=Math.imul(j,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,ut)|0,n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(B,ht)|0,o=o+Math.imul(B,lt)|0;var Bt=(u+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,gt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(j,ot),i=(i=Math.imul(j,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ut)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,ut)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,lt)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,lt)|0;var Ot=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(B,pt)|0))<<13)|0;u=((o=o+Math.imul(B,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(j,ct),i=(i=Math.imul(j,ut))+Math.imul(D,ct)|0,o=Math.imul(D,ut),n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,lt)|0;var Mt=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((o=o+Math.imul(C,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(j,ht),i=(i=Math.imul(j,lt))+Math.imul(D,ht)|0,o=Math.imul(D,lt);var Ct=(u+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,gt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Lt=(u+(n=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,gt))+Math.imul(D,pt)|0))<<13)|0;return u=((o=Math.imul(D,gt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,c[0]=yt,c[1]=mt,c[2]=vt,c[3]=wt,c[4]=bt,c[5]=Et,c[6]=St,c[7]=_t,c[8]=At,c[9]=xt,c[10]=It,c[11]=kt,c[12]=Tt,c[13]=Rt,c[14]=Bt,c[15]=Ot,c[16]=Mt,c[17]=Ct,c[18]=Lt,0!==u&&(c[19]=u,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(t,e,r){return y(t,e,r)}Math.imul||(g=p),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?p(this,t,e):r<1024?y(this,t,e):m(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),m(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<67108864);for(var n=0,i=0;i>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=i);u--){var h=0|this.words[u];this.words[u]=f<<26-o|h>>>o,f=h&a}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,c=n.length-o.length;if("mod"!==e){(a=new i(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;h--){var l=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(o,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=l)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var n=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/t|0,n=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),c=new i(1),u=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),h=e.clone();!e.isZero();){for(var l=0,d=1;!(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;!(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(f),c.isub(h)),a.iushrn(1),c.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(c)):(n.isub(e),a.isub(o),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),c=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;!(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var h=0,l=1;!(n.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new A(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},n(b,w),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},A.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){r(!(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var h=this.pow(f,o),l=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();r(y=0;n--){for(var u=e.words[n],f=c-1;f>=0;f--){var h=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}c=26}return o},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new x(t)},n(x,A),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,o)}(wvt);var Evt=wvt.exports,Svt={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */!function(t,e){var r=bvt,n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}(Svt,Svt.exports);var _vt=Svt.exports.Buffer;var Avt=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r>>0,u=new Uint8Array(o);r>>0,u[l]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=h,r++}for(var d=o-i;d!==o&&0===u[d];)d++;var p=_vt.allocUnsafe(n+(o-d));p.fill(0,0,n);for(var g=n;d!==o;)p[g++]=u[d++];return p}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=_vt.from(e)),!_vt.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,n=0,i=0,o=e.length;i!==o&&0===e[i];)i++,r++;for(var c=(o-i)*u+1>>>0,f=new Uint8Array(c);i!==o;){for(var h=e[i],l=0,d=c-1;(0!==h||l>>0,f[d]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");n=l,i++}for(var p=c-n;p!==c&&0===f[p];)p++;for(var g=a.repeat(r);p0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function kvt(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const Tvt=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Rvt=(t,e)=>t<<32-e|t>>>e;function Bvt(t){return"string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}(t)),Ivt(t),t}class Ovt{clone(){return this._cloneInto()}}function Mvt(t){const e=e=>t().update(Bvt(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}const Cvt=(t,e,r)=>t&e^~t&r,Lvt=(t,e,r)=>t&e^t&r^e&r;class Pvt extends Ovt{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Tvt(this.buffer)}update(t){kvt(this);const{view:e,buffer:r,blockLen:n}=this,i=(t=Bvt(t)).length;for(let o=0;on-o&&(this.process(r,0),o=0);for(let t=o;t>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;t.setUint32(e+c,s,n),t.setUint32(e+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=Tvt(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t>>3,i=Rvt(r,17)^Rvt(r,19)^r>>>10;jvt[t]=i+jvt[t-7]+n+jvt[t-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let t=0;t<64;t++){const e=u+(Rvt(s,6)^Rvt(s,11)^Rvt(s,25))+Cvt(s,a,c)+Nvt[t]+jvt[t]|0,f=(Rvt(r,2)^Rvt(r,13)^Rvt(r,22))+Lvt(r,n,i)|0;u=c,c=a,a=s,s=o+e|0,o=i,i=n,n=r,r=e+f|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){jvt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const zvt=Mvt((()=>new Dvt));var Fvt={};function Hvt(t,e,r){return e<=t&&t<=r}function $vt(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function qvt(t){this.tokens=[].slice.call(t)}qvt.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};var Wvt=-1;function Vvt(t,e){if(t)throw TypeError("Decoder error");return e||65533}var Kvt="utf-8";function Gvt(t,e){if(!(this instanceof Gvt))return new Gvt(t,e);if((t=void 0!==t?String(t).toLowerCase():Kvt)!==Kvt)throw new Error("Encoding not supported. Only utf-8 is supported");e=$vt(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(e.fatal),this._ignoreBOM=Boolean(e.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function Zvt(t,e){if(!(this instanceof Zvt))return new Zvt(t,e);if((t=void 0!==t?String(t).toLowerCase():Kvt)!==Kvt)throw new Error("Encoding not supported. Only utf-8 is supported");e=$vt(e),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(e.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function Jvt(t){var e=t.fatal,r=0,n=0,i=0,o=128,s=191;this.handler=function(t,a){if(-1===a&&0!==i)return i=0,Vvt(e);if(-1===a)return Wvt;if(0===i){if(Hvt(a,0,127))return a;if(Hvt(a,194,223))i=1,r=a-192;else if(Hvt(a,224,239))224===a&&(o=160),237===a&&(s=159),i=2,r=a-224;else{if(!Hvt(a,240,244))return Vvt(e);240===a&&(o=144),244===a&&(s=143),i=3,r=a-240}return r<<=6*i,null}if(!Hvt(a,o,s))return r=i=n=0,o=128,s=191,t.prepend(a),Vvt(e);if(o=128,s=191,r+=a-128<<6*(i-(n+=1)),n!==i)return null;var c=r;return r=i=n=0,c}}function Yvt(t){t.fatal,this.handler=function(t,e){if(-1===e)return Wvt;if(Hvt(e,0,127))return e;var r,n;Hvt(e,128,2047)?(r=1,n=192):Hvt(e,2048,65535)?(r=2,n=224):Hvt(e,65536,1114111)&&(r=3,n=240);for(var i=[(e>>6*r)+n];r>0;){var o=e>>6*(r-1);i.push(128|63&o),r-=1}return i}}Gvt.prototype={decode:function(t,e){var r;r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=$vt(e),this._streaming||(this._decoder=new Jvt({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(e.stream);for(var n,i=new qvt(r),o=[];!i.endOfStream()&&(n=this._decoder.handler(i,i.read()))!==Wvt;)null!==n&&(Array.isArray(n)?o.push.apply(o,n):o.push(n));if(!this._streaming){do{if((n=this._decoder.handler(i,i.read()))===Wvt)break;null!==n&&(Array.isArray(n)?o.push.apply(o,n):o.push(n))}while(!i.endOfStream());this._decoder=null}return o.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===o[0]?(this._BOMseen=!0,o.shift()):this._BOMseen=!0)),function(t){for(var e="",r=0;r>10),56320+(1023&n)))}return e}(o)}},Zvt.prototype={encode:function(t,e){t=t?String(t):"",e=$vt(e),this._streaming||(this._encoder=new Yvt(this._options)),this._streaming=Boolean(e.stream);for(var r,n=[],i=new qvt(function(t){for(var e=String(t),r=e.length,n=0,i=[];n57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=t.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=1023&o,c=1023&s;i.push(65536+(a<<10)+c),n+=1}else i.push(65533)}n+=1}return i}(t));!i.endOfStream()&&(r=this._encoder.handler(i,i.read()))!==Wvt;)Array.isArray(r)?n.push.apply(n,r):n.push(r);if(!this._streaming){for(;(r=this._encoder.handler(i,i.read()))!==Wvt;)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)}};var Xvt=s(Object.freeze({__proto__:null,TextEncoder:Zvt,TextDecoder:Gvt})),Qvt=o&&o.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),twt=o&&o.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ewt=o&&o.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},rwt=o&&o.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&Qvt(e,t,r);return twt(e,t),e},nwt=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fvt,"__esModule",{value:!0});var iwt=Fvt.deserializeUnchecked=bwt=Fvt.deserialize=mwt=Fvt.serialize=Fvt.BinaryReader=Fvt.BinaryWriter=Fvt.BorshError=Fvt.baseDecode=Fvt.baseEncode=void 0;const owt=nwt(wvt.exports),swt=nwt(xvt),awt=rwt(Xvt),cwt=new("function"!=typeof TextDecoder?awt.TextDecoder:TextDecoder)("utf-8",{fatal:!0});Fvt.baseEncode=function(t){return"string"==typeof t&&(t=pgt.from(t,"utf8")),swt.default.encode(pgt.from(t))},Fvt.baseDecode=function(t){return pgt.from(swt.default.decode(t))};const uwt=1024;class fwt extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}Fvt.BorshError=fwt;class hwt{constructor(){this.buf=pgt.alloc(uwt),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=pgt.concat([this.buf,pgt.alloc(uwt)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(pgt.from(new owt.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(pgt.from(new owt.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(pgt.from(new owt.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(pgt.from(new owt.default(t).toArray("le",64)))}writeBuffer(t){this.buf=pgt.concat([pgt.from(this.buf.subarray(0,this.length)),t,pgt.alloc(uwt)]),this.length+=t.length}writeString(t){this.maybeResize();const e=pgt.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(pgt.from(t))}writeArray(t,e){this.maybeResize(),this.writeU32(t.length);for(const r of t)this.maybeResize(),e(r)}toArray(){return this.buf.subarray(0,this.length)}}function lwt(t,e,r){const n=r.value;r.value=function(...t){try{return n.apply(this,t)}catch(t){if(t instanceof RangeError){const e=t.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(e)>=0)throw new fwt("Reached the end of buffer when deserializing")}throw t}}}Fvt.BinaryWriter=hwt;class dwt{constructor(t){this.buf=t,this.offset=0}readU8(){const t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){const t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){const t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){const t=this.readBuffer(8);return new owt.default(t,"le")}readU128(){const t=this.readBuffer(16);return new owt.default(t,"le")}readU256(){const t=this.readBuffer(32);return new owt.default(t,"le")}readU512(){const t=this.readBuffer(64);return new owt.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new fwt(`Expected buffer length ${t} isn't within bounds`);const e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){const t=this.readU32(),e=this.readBuffer(t);try{return cwt.decode(e)}catch(t){throw new fwt(`Error decoding UTF-8 string: ${t}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){const e=this.readU32(),r=Array();for(let n=0;n{gwt(t,e,r,n[0],i)}));else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),gwt(t,e,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach(((r,o)=>{gwt(t,e,o,n.key,i),gwt(t,e,r,n.value,i)}));break;default:throw new fwt(`FieldType ${n} unrecognized`)}else ywt(t,r,i)}catch(t){throw t instanceof fwt&&t.addToFieldPath(e),t}}function ywt(t,e,r){if("function"==typeof e.borshSerialize)return void e.borshSerialize(r);const n=t.get(e.constructor);if(!n)throw new fwt(`Class ${e.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map((([n,i])=>{gwt(t,n,e[n],i,r)}));else{if("enum"!==n.kind)throw new fwt(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`);{const i=e[n.field];for(let o=0;ovwt(t,e,r[0],n)))}if("option"===r.kind){return n.readU8()?vwt(t,e,r.type,n):void 0}if("map"===r.kind){let i=new Map;const o=n.readU32();for(let s=0;s=n.values.length)throw new fwt(`Enum index: ${i} is out of range`);const[o,s]=n.values[i],a=vwt(t,o,s,r);return new e({[o]:a})}throw new fwt(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}var bwt=Fvt.deserialize=function(t,e,r,n=dwt){const i=new n(r),o=wwt(t,e,i);if(i.offsetthis.span)throw new RangeError("indeterminate span");return this.span}replicate(t){const e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}}function Iwt(t,e){return e.property?t+"["+e.property+"]":t}Ewt.Layout=xwt,Ewt.nameWithProperty=Iwt,Ewt.bindConstructorLayout=function(t,e){if("function"!=typeof t)throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(t,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof xwt))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw new Error("layout is already bound to a constructor");t.layout_=e,e.boundConstructor_=t,e.makeDestinationObject=()=>new t,Object.defineProperty(t.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(t,"decode",{value:(t,r)=>e.decode(t,r),writable:!0})};class kwt extends xwt{isCount(){throw new Error("ExternalLayout is abstract")}}Ewt.ExternalLayout=kwt;class Twt extends kwt{constructor(t=1,e){if(!Number.isInteger(t)||0>=t)throw new TypeError("elementSpan must be a (positive) integer");super(-1,e),this.elementSpan=t}isCount(){return!0}decode(t,e=0){_wt(t);const r=t.length-e;return Math.floor(r/this.elementSpan)}encode(t,e,r){return 0}}Ewt.GreedyCount=Twt;class Rwt extends kwt{constructor(t,e=0,r){if(!(t instanceof xwt))throw new TypeError("layout must be a Layout");if(!Number.isInteger(e))throw new TypeError("offset must be integer or undefined");super(t.span,r||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof Bwt||this.layout instanceof Owt}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,r=0){return this.layout.encode(t,e,r+this.offset)}}Ewt.OffsetLayout=Rwt;class Bwt extends xwt{constructor(t,e){if(super(t,e),6t+n.encode(i,e,r+t)),0);return this.count instanceof kwt&&this.count.encode(t.length,e,r),i}}Ewt.Sequence=Wwt;class Vwt extends xwt{constructor(t,e,r){if(!Array.isArray(t)||!t.reduce(((t,e)=>t&&e instanceof xwt),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof e&&void 0===r&&(r=e,e=void 0);for(const e of t)if(0>e.span&&void 0===e.property)throw new Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=t.reduce(((t,e)=>t+e.getSpan()),0)}catch(t){}super(n,e),this.fields=t,this.decodePrefixes=!!r}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce(((r,n)=>{const i=n.getSpan(t,e);return e+=i,r+i}),0)}catch(t){throw new RangeError("indeterminate span")}return r}decode(t,e=0){_wt(t);const r=this.makeDestinationObject();for(const n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(t,e)),e+=n.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return r}encode(t,e,r=0){const n=r;let i=0,o=0;for(const n of this.fields){let s=n.span;if(o=0s&&(s=n.getSpan(e,r)))}i=r,r+=s}return i+o-n}fromArray(t){const e=this.makeDestinationObject();for(const r of this.fields)void 0!==r.property&&0r.span?e=-1:0<=e&&(e+=r.span)}}}Ewt.Structure=Vwt;class Kwt{constructor(t){this.property=t}decode(t,e){throw new Error("UnionDiscriminator is abstract")}encode(t,e,r){throw new Error("UnionDiscriminator is abstract")}}Ewt.UnionDiscriminator=Kwt;class Gwt extends Kwt{constructor(t,e){if(!(t instanceof kwt&&t.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,r){return this.layout.encode(t,e,r)}}Ewt.UnionLayoutDiscriminator=Gwt;class Zwt extends xwt{constructor(t,e,r){let n;if(t instanceof Bwt||t instanceof Owt)n=new Gwt(new Rwt(t));else if(t instanceof kwt&&t.isCount())n=new Gwt(t);else{if(!(t instanceof Kwt))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");n=t}if(void 0===e&&(e=null),!(null===e||e instanceof xwt))throw new TypeError("defaultLayout must be null or a Layout");if(null!==e){if(0>e.span)throw new Error("defaultLayout must have constant span");void 0===e.property&&(e=e.replicate("content"))}let i=-1;e&&(i=e.span,0<=i&&(t instanceof Bwt||t instanceof Owt)&&(i+=n.layout.span)),super(i,r),this.discriminator=n,this.usesPrefixDiscriminator=t instanceof Bwt||t instanceof Owt,this.defaultLayout=e,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(t){return o(t)},this.configGetSourceVariant=function(t){o=t.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;const r=this.getVariant(t,e);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;const e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(const e in this.registry){const r=this.registry[e];if(r.property&&Object.prototype.hasOwnProperty.call(t,r.property))return r}throw new Error("unable to infer src variant")}decode(t,e=0){let r;const n=this.discriminator,i=n.decode(t,e),o=this.registry[i];if(void 0===o){const o=this.defaultLayout;let s=0;this.usesPrefixDiscriminator&&(s=n.layout.span),r=this.makeDestinationObject(),r[n.property]=i,r[o.property]=o.decode(t,e+s)}else r=o.decode(t,e);return r}encode(t,e,r=0){const n=this.getSourceVariant(t);if(void 0===n){const n=this.discriminator,i=this.defaultLayout;let o=0;return this.usesPrefixDiscriminator&&(o=n.layout.span),n.encode(t[n.property],e,r),o+i.encode(t[i.property],e,r+o)}return n.encode(t,e,r)}addVariant(t,e,r){const n=new Jwt(this,t,e,r);return this.registry[t]=n,n}getVariant(t,e=0){let r;return r=t instanceof Uint8Array?this.discriminator.decode(t,e):t,this.registry[r]}}Ewt.Union=Zwt;class Jwt extends xwt{constructor(t,e,r,n){if(!(t instanceof Zwt))throw new TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof r&&void 0===n&&(n=r,r=null),r){if(!(r instanceof xwt))throw new TypeError("layout must be a Layout");if(null!==t.defaultLayout&&0<=r.span&&r.span>t.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof n)throw new TypeError("variant must have a String property")}let i=t.span;0>t.span&&(i=r?r.span:0,0<=i&&t.usesPrefixDiscriminator&&(i+=t.discriminator.layout.span)),super(i,n),this.union=t,this.variant=e,this.layout=r||null}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let n=0;return this.layout&&(n=this.layout.getSpan(t,e+r)),r+n}decode(t,e=0){const r=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw new Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(t,e+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(t,e,r=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,r);let i=n;if(this.layout&&(this.layout.encode(t[this.property],e,r+n),i+=this.layout.getSpan(e,r+n),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}function Ywt(t){return 0>t&&(t+=4294967296),t}Ewt.VariantLayout=Jwt;class Xwt extends xwt{constructor(t,e,r){if(!(t instanceof Bwt||t instanceof Owt))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof e&&void 0===r&&(r=e,e=!1),4=e)throw new TypeError("bits must be positive integer");const n=8*t.span,i=t.fields.reduce(((t,e)=>t+e.bits),0);if(e+i>n)throw new Error("bits too long for span remainder ("+(n-i)+" of "+n+" remain)");this.container=t,this.bits=e,this.valueMask=(1<>>this.start}encode(t){if("number"!=typeof t||!Number.isInteger(t)||t!==Ywt(t&this.valueMask))throw new TypeError(Iwt("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const e=this.container._packedGetValue(),r=Ywt(t<r&&(r=this.length.decode(t,e)),r}decode(t,e=0){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),Awt(t).slice(e,e+r)}encode(t,e,r){let n=this.length;if(this.length instanceof kwt&&(n=t.length),!(t instanceof Uint8Array&&n===t.length))throw new TypeError(Iwt("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>e.length)throw new RangeError("encoding overruns Uint8Array");const i=Awt(t);return Awt(e).write(i.toString("hex"),r,n,"hex"),this.length instanceof kwt&&this.length.encode(n,e,r),n}}Ewt.Blob=ebt;class rbt extends xwt{constructor(t){super(-1,t)}getSpan(t,e=0){_wt(t);let r=e;for(;re.length)throw new RangeError("encoding overruns Buffer");const o=Awt(e);return n.copy(o,r),o[r+i]=0,i+1}}Ewt.CString=rbt;class nbt extends xwt{constructor(t,e){if("string"==typeof t&&void 0===e&&(e=t,t=void 0),void 0===t)t=-1;else if(!Number.isInteger(t))throw new TypeError("maxSpan must be an integer");super(-1,e),this.maxSpan=t}getSpan(t,e=0){return _wt(t),t.length-e}decode(t,e=0){const r=this.getSpan(t,e);if(0<=this.maxSpan&&this.maxSpane.length)throw new RangeError("encoding overruns Buffer");return n.copy(Awt(e),r),i}}Ewt.UTF8=nbt;class ibt extends xwt{constructor(t,e){super(0,e),this.value=t}decode(t,e){return this.value}encode(t,e,r){return 0}}Ewt.Constant=ibt,Ewt.greedy=(t,e)=>new Twt(t,e);var obt=Ewt.offset=(t,e,r)=>new Rwt(t,e,r),sbt=Ewt.u8=t=>new Bwt(1,t),abt=Ewt.u16=t=>new Bwt(2,t);Ewt.u24=t=>new Bwt(3,t);var cbt=Ewt.u32=t=>new Bwt(4,t);Ewt.u40=t=>new Bwt(5,t),Ewt.u48=t=>new Bwt(6,t);var ubt=Ewt.nu64=t=>new Uwt(t);Ewt.u16be=t=>new Owt(2,t),Ewt.u24be=t=>new Owt(3,t),Ewt.u32be=t=>new Owt(4,t),Ewt.u40be=t=>new Owt(5,t),Ewt.u48be=t=>new Owt(6,t),Ewt.nu64be=t=>new jwt(t),Ewt.s8=t=>new Mwt(1,t),Ewt.s16=t=>new Mwt(2,t),Ewt.s24=t=>new Mwt(3,t),Ewt.s32=t=>new Mwt(4,t),Ewt.s40=t=>new Mwt(5,t),Ewt.s48=t=>new Mwt(6,t);var fbt=Ewt.ns64=t=>new Dwt(t);Ewt.s16be=t=>new Cwt(2,t),Ewt.s24be=t=>new Cwt(3,t),Ewt.s32be=t=>new Cwt(4,t),Ewt.s40be=t=>new Cwt(5,t),Ewt.s48be=t=>new Cwt(6,t),Ewt.ns64be=t=>new zwt(t),Ewt.f32=t=>new Fwt(t),Ewt.f32be=t=>new Hwt(t),Ewt.f64=t=>new $wt(t),Ewt.f64be=t=>new qwt(t);var hbt=Ewt.struct=(t,e,r)=>new Vwt(t,e,r);Ewt.bits=(t,e,r)=>new Xwt(t,e,r);var lbt=Ewt.seq=(t,e,r)=>new Wwt(t,e,r);Ewt.union=(t,e,r)=>new Zwt(t,e,r),Ewt.unionLayoutDiscriminator=(t,e)=>new Gwt(t,e);var dbt=Ewt.blob=(t,e)=>new ebt(t,e);Ewt.cstr=t=>new rbt(t),Ewt.utf8=(t,e)=>new nbt(t,e),Ewt.constant=(t,e)=>new ibt(t,e);var pbt={};Object.defineProperty(pbt,"__esModule",{value:!0});var gbt=pbt.toBigIntLE=function(t){{const e=pgt.from(t);e.reverse();const r=e.toString("hex");return 0===r.length?BigInt(0):BigInt(`0x${r}`)}};pbt.toBigIntBE=function(t){{const e=t.toString("hex");return 0===e.length?BigInt(0):BigInt(`0x${e}`)}};var ybt,mbt=pbt.toBufferLE=function(t,e){{const r=t.toString(16),n=pgt.from(r.padStart(2*e,"0").slice(0,2*e),"hex");return n.reverse(),n}};pbt.toBufferBE=function(t,e){{const r=t.toString(16);return pgt.from(r.padStart(2*e,"0").slice(0,2*e),"hex")}};class vbt extends TypeError{constructor(t,e){let r;const{message:n,...i}=t,{path:o}=t;super(0===o.length?n:"At path: "+o.join(".")+" -- "+n),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[t,...e()]}}}function wbt(t){return"object"==typeof t&&null!=t}function bbt(t){return"string"==typeof t?JSON.stringify(t):""+t}function Ebt(t,e,r,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:o}=e,{type:s}=r,{refinement:a,message:c="Expected a value of type `"+s+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+bbt(n)+"`"}=t;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:c}}function*Sbt(t,e,r,n){(function(t){return wbt(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const i of t){const t=Ebt(i,e,r,n);t&&(yield t)}}function*_bt(t,e,r={}){const{path:n=[],branch:i=[t],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i};if(o&&(t=e.coercer(t,a),s&&"type"!==e.type&&wbt(e.schema)&&wbt(t)&&!Array.isArray(t)))for(const r in t)void 0===e.schema[r]&&delete t[r];let c=!0;for(const r of e.validator(t,a))c=!1,yield[r,void 0];for(let[r,u,f]of e.entries(t,a)){const e=_bt(u,f,{path:void 0===r?n:[...n,r],branch:void 0===r?i:[...i,u],coerce:o,mask:s});for(const n of e)n[0]?(c=!1,yield[n[0],void 0]):o&&(u=n[1],void 0===r?t=u:t instanceof Map?t.set(r,u):t instanceof Set?t.add(u):wbt(t)&&(t[r]=u))}if(c)for(const r of e.refiner(t,a))c=!1,yield[r,void 0];c&&(yield[void 0,t])}class Abt{constructor(t){const{type:e,schema:r,validator:n,refiner:i,coercer:o=t=>t,entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(t,e)=>Sbt(n(t,e),e,this,t):()=>[],this.refiner=i?(t,e)=>Sbt(i(t,e),e,this,t):()=>[]}assert(t){return function(t,e){const r=kbt(t,e);if(r[0])throw r[0]}(t,this)}create(t){return xbt(t,this)}is(t){return Ibt(t,this)}mask(t){return function(t,e){const r=kbt(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(t,this)}validate(t,e={}){return kbt(t,this,e)}}function xbt(t,e){const r=kbt(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function Ibt(t,e){return!kbt(t,e)[0]}function kbt(t,e,r={}){const n=_bt(t,e,r),i=function(t){const{done:e,value:r}=t.next();return e?void 0:r}(n);if(i[0]){const t=new vbt(i[0],(function*(){for(const t of n)t[0]&&(yield t[0])}));return[t,void 0]}return[void 0,i[1]]}function Tbt(t,e){return new Abt({type:t,schema:null,validator:e})}function Rbt(t){return new Abt({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||"Expected an array value, but received: "+bbt(t)})}function Bbt(){return Tbt("boolean",(t=>"boolean"==typeof t))}function Obt(t){return Tbt("instance",(e=>e instanceof t||"Expected a `"+t.name+"` instance, but received: "+bbt(e)))}function Mbt(t){const e=bbt(t),r=typeof t;return new Abt({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||"Expected the literal `"+e+"`, but received: "+bbt(r)})}function Cbt(t){return new Abt({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})}function Lbt(){return Tbt("number",(t=>"number"==typeof t&&!isNaN(t)||"Expected a number, but received: "+bbt(t)))}function Pbt(t){return new Abt({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function Nbt(t,e){return new Abt({type:"record",schema:null,*entries(r){if(wbt(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator:t=>wbt(t)||"Expected an object, but received: "+bbt(t)})}function Ubt(){return Tbt("string",(t=>"string"==typeof t||"Expected a string, but received: "+bbt(t)))}function jbt(t){const e=Tbt("never",(()=>!1));return new Abt({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;iArray.isArray(t)||"Expected an array, but received: "+bbt(t)})}function Dbt(t){const e=Object.keys(t);return new Abt({type:"type",schema:t,*entries(r){if(wbt(r))for(const n of e)yield[n,r[n],t[n]]},validator:t=>wbt(t)||"Expected an object, but received: "+bbt(t)})}function zbt(t){const e=t.map((t=>t.type)).join(" | ");return new Abt({type:"union",schema:null,validator(r,n){const i=[];for(const e of t){const[...t]=_bt(r,e,n),[o]=t;if(!o[0])return[];for(const[e]of t)e&&i.push(e)}return["Expected the value to satisfy a union of `"+e+"`, but received: "+bbt(r),...i]}})}function Fbt(){return Tbt("unknown",(()=>!0))}function Hbt(t,e,r){return new Abt({...t,coercer:(n,i)=>Ibt(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}var $bt=new Uint8Array(16);function qbt(){if(!ybt&&!(ybt="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ybt($bt)}var Wbt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Vbt(t){return"string"==typeof t&&Wbt.test(t)}for(var Kbt,Gbt,Zbt=[],Jbt=0;Jbt<256;++Jbt)Zbt.push((Jbt+256).toString(16).substr(1));function Ybt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Zbt[t[e+0]]+Zbt[t[e+1]]+Zbt[t[e+2]]+Zbt[t[e+3]]+"-"+Zbt[t[e+4]]+Zbt[t[e+5]]+"-"+Zbt[t[e+6]]+Zbt[t[e+7]]+"-"+Zbt[t[e+8]]+Zbt[t[e+9]]+"-"+Zbt[t[e+10]]+Zbt[t[e+11]]+Zbt[t[e+12]]+Zbt[t[e+13]]+Zbt[t[e+14]]+Zbt[t[e+15]]).toLowerCase();if(!Vbt(r))throw TypeError("Stringified UUID is invalid");return r}var Xbt=0,Qbt=0;function tEt(t){if(!Vbt(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r}function eEt(t,e,r){function n(t,n,i,o){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r>>9<<4)+1}function nEt(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function iEt(t,e,r,n,i,o){return nEt((s=nEt(nEt(e,t),nEt(n,o)))<<(a=i)|s>>>32-a,r);var s,a}function oEt(t,e,r,n,i,o,s){return iEt(e&r|~e&n,t,e,i,o,s)}function sEt(t,e,r,n,i,o,s){return iEt(e&n|r&~n,t,e,i,o,s)}function aEt(t,e,r,n,i,o,s){return iEt(e^r^n,t,e,i,o,s)}function cEt(t,e,r,n,i,o,s){return iEt(r^(e|~n),t,e,i,o,s)}var uEt=eEt("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r>5]>>>i%32&255,s=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);e.push(s)}return e}(function(t,e){t[e>>5]|=128<>5]|=(255&t[n/8])<>>32-e}var dEt=eEt("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var n=unescape(encodeURIComponent(t));t=[];for(var i=0;i>>0;w=v,v=m,m=lEt(y,30)>>>0,y=g,g=S}r[0]=r[0]+g>>>0,r[1]=r[1]+y>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+w>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),pEt=dEt;var gEt=Object.freeze({__proto__:null,v1:function(t,e,r){var n=e&&r||0,i=e||new Array(16),o=(t=t||{}).node||Kbt,s=void 0!==t.clockseq?t.clockseq:Gbt;if(null==o||null==s){var a=t.random||(t.rng||qbt)();null==o&&(o=Kbt=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=Gbt=16383&(a[6]<<8|a[7]))}var c=void 0!==t.msecs?t.msecs:Date.now(),u=void 0!==t.nsecs?t.nsecs:Qbt+1,f=c-Xbt+(u-Qbt)/1e4;if(f<0&&void 0===t.clockseq&&(s=s+1&16383),(f<0||c>Xbt)&&void 0===t.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Xbt=c,Qbt=u,Gbt=s;var h=(1e4*(268435455&(c+=122192928e5))+u)%4294967296;i[n++]=h>>>24&255,i[n++]=h>>>16&255,i[n++]=h>>>8&255,i[n++]=255&h;var l=c/4294967296*1e4&268435455;i[n++]=l>>>8&255,i[n++]=255&l,i[n++]=l>>>24&15|16,i[n++]=l>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var d=0;d<6;++d)i[n+d]=o[d];return e||Ybt(i)},v3:fEt,v4:function(t,e,r){var n=(t=t||{}).random||(t.rng||qbt)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return Ybt(n)},v5:pEt,NIL:"00000000-0000-0000-0000-000000000000",version:function(t){if(!Vbt(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)},validate:Vbt,stringify:Ybt,parse:tEt}),yEt=s(gEt);const mEt=yEt.v4;var vEt=function(t,e,r,n){if("string"!=typeof t)throw new TypeError(t+" must be a string");const i="number"==typeof(n=n||{}).version?n.version:2;if(1!==i&&2!==i)throw new TypeError(i+" must be 1 or 2");const o={method:t};if(2===i&&(o.jsonrpc="2.0"),e){if("object"!=typeof e&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");o.params=e}if(void 0===r){const t="function"==typeof n.generator?n.generator:function(){return mEt()};o.id=t(o,n)}else 2===i&&null===r?n.notificationIdNull&&(o.id=null):o.id=r;return o};const wEt=yEt.v4,bEt=vEt,EEt=function(t,e){if(!(this instanceof EEt))return new EEt(t,e);e||(e={}),this.options={reviver:void 0!==e.reviver?e.reviver:null,replacer:void 0!==e.replacer?e.replacer:null,generator:void 0!==e.generator?e.generator:function(){return wEt()},version:void 0!==e.version?e.version:2,notificationIdNull:"boolean"==typeof e.notificationIdNull&&e.notificationIdNull},this.callServer=t};var SEt=EEt;EEt.prototype.request=function(t,e,r,n){const i=this;let o=null;const s=Array.isArray(t)&&"function"==typeof e;if(1===this.options.version&&s)throw new TypeError("JSON-RPC 1.0 does not support batching");if(s||!s&&t&&"object"==typeof t&&"function"==typeof e)n=e,o=t;else{"function"==typeof r&&(n=r,r=void 0);const i="function"==typeof n;try{o=bEt(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(t){if(i)return n(t);throw t}if(!i)return o}let a;try{a=JSON.stringify(o,this.options.replacer)}catch(t){return n(t)}return this.callServer(a,(function(t,e){i._parseResponse(t,e,n)})),o},EEt.prototype._parseResponse=function(t,e,r){if(t)return void r(t);if(!e)return r();let n;try{n=JSON.parse(e,this.options.reviver)}catch(t){return r(t)}if(3===r.length){if(Array.isArray(n)){const t=function(t){return void 0!==t.error},e=function(e){return!t(e)};return r(null,n.filter(t),n.filter(e))}return r(null,n.error,n.result)}r(null,n)};const _Et=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]),AEt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),xEt=new Uint32Array(64);class IEt extends Pyt{constructor(){super(64,32,8,!1),this.A=0|AEt[0],this.B=0|AEt[1],this.C=0|AEt[2],this.D=0|AEt[3],this.E=0|AEt[4],this.F=0|AEt[5],this.G=0|AEt[6],this.H=0|AEt[7]}get(){const{A:t,B:e,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[t,e,r,n,i,o,s,a]}set(t,e,r,n,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)xEt[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=xEt[t-15],r=xEt[t-2],n=Tyt(e,7)^Tyt(e,18)^e>>>3,i=Tyt(r,17)^Tyt(r,19)^r>>>10;xEt[t]=i+xEt[t-7]+n+xEt[t-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let t=0;t<64;t++){const e=u+(Tyt(s,6)^Tyt(s,11)^Tyt(s,25))+Cyt(s,a,c)+_Et[t]+xEt[t]|0,f=(Tyt(r,2)^Tyt(r,13)^Tyt(r,22))+Lyt(r,n,i)|0;u=c,c=a,a=s,s=o+e|0,o=i,i=n,n=r,r=e+f|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){xEt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const kEt=Oyt((()=>new IEt));class TEt extends Byt{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");_yt(t.outputLen),_yt(t.blockLen)}(t);const r=Ryt(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?t.create().update(r).digest():r);for(let t=0;tnew TEt(t,e).update(r).digest();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function BEt(t){void 0!==t.lowS&&Yyt("lowS",t.lowS),void 0!==t.prehash&&Yyt("prehash",t.prehash)}REt.create=(t,e)=>new TEt(t,e);const{bytesToNumberBE:OEt,hexToBytes:MEt}=kmt,CEt={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(t,e)=>{const{Err:r}=CEt;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(1&e.length)throw new r("tlv.encode: unpadded data");const n=e.length/2,i=tmt(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const o=n>127?tmt(i.length/2|128):"";return tmt(t)+o+i+e},decode(t,e){const{Err:r}=CEt;let n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");const i=e[n++];let o=0;if(!!(128&i)){const t=127&i;if(!t)throw new r("tlv.decode(long): indefinite length not supported");if(t>4)throw new r("tlv.decode(long): byte length is too big");const s=e.subarray(n,n+t);if(s.length!==t)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(const t of s)o=o<<8|t;if(n+=t,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;const s=e.subarray(n,n+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(n+o)}}},_int:{encode(t){const{Err:e}=CEt;if(t{const i=e.toAffine();return gmt(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),o=e.fromBytes||(t=>{const e=t.subarray(1);return{x:r.fromBytes(e.subarray(0,r.BYTES)),y:r.fromBytes(e.subarray(r.BYTES,2*r.BYTES))}});function s(t){const{a:n,b:i}=e,o=r.sqr(t),s=r.mul(o,t);return r.add(r.add(s,r.mul(t,n)),i)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function a(t){const{allowedPrivateKeyLengths:r,nByteLength:n,wrapPrivateKey:i,n:o}=e;if(r&&"bigint"!=typeof t){if(Zyt(t)&&(t=Qyt(t)),"string"!=typeof t||!r.includes(t.length))throw new Error("invalid private key");t=t.padStart(2*n,"0")}let s;try{s="bigint"==typeof t?t:fmt(pmt("private key",t,n))}catch(e){throw new Error("invalid private key, expected hex or "+n+" bytes, got "+typeof t)}return i&&(s=Pmt(s,o)),vmt("private key",s,PEt,o),s}function c(t){if(!(t instanceof h))throw new Error("ProjectivePoint expected")}const u=Imt(((t,e)=>{const{px:n,py:i,pz:o}=t;if(r.eql(o,r.ONE))return{x:n,y:i};const s=t.is0();null==e&&(e=s?r.ONE:r.inv(o));const a=r.mul(n,e),c=r.mul(i,e),u=r.mul(o,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error("invZ was invalid");return{x:a,y:c}})),f=Imt((t=>{if(t.is0()){if(e.allowInfinityPoint&&!r.is0(t.py))return;throw new Error("bad point: ZERO")}const{x:n,y:i}=t.toAffine();if(!r.isValid(n)||!r.isValid(i))throw new Error("bad point: x or y not FE");const o=r.sqr(i),a=s(n);if(!r.eql(o,a))throw new Error("bad point: equation left != right");if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));class h{constructor(t,e,n){if(this.px=t,this.py=e,this.pz=n,null==t||!r.isValid(t))throw new Error("x required");if(null==e||!r.isValid(e))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required");Object.freeze(this)}static fromAffine(t){const{x:e,y:n}=t||{};if(!t||!r.isValid(e)||!r.isValid(n))throw new Error("invalid affine point");if(t instanceof h)throw new Error("projective point not allowed");const i=t=>r.eql(t,r.ZERO);return i(e)&&i(n)?h.ZERO:new h(e,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){const e=r.invertBatch(t.map((t=>t.pz)));return t.map(((t,r)=>t.toAffine(e[r]))).map(h.fromAffine)}static fromHex(t){const e=h.fromAffine(o(pmt("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return h.BASE.multiply(a(t))}static msm(t,e){return tvt(h,n,t,e)}_setWindowSize(t){d.setWindowSize(this,t)}assertValidity(){f(this)}hasEvenY(){const{y:t}=this.toAffine();if(r.isOdd)return!r.isOdd(t);throw new Error("Field doesn't support isOdd")}equals(t){c(t);const{px:e,py:n,pz:i}=this,{px:o,py:s,pz:a}=t,u=r.eql(r.mul(e,a),r.mul(o,i)),f=r.eql(r.mul(n,a),r.mul(s,i));return u&&f}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:t,b:n}=e,i=r.mul(n,NEt),{px:o,py:s,pz:a}=this;let c=r.ZERO,u=r.ZERO,f=r.ZERO,l=r.mul(o,o),d=r.mul(s,s),p=r.mul(a,a),g=r.mul(o,s);return g=r.add(g,g),f=r.mul(o,a),f=r.add(f,f),c=r.mul(t,f),u=r.mul(i,p),u=r.add(c,u),c=r.sub(d,u),u=r.add(d,u),u=r.mul(c,u),c=r.mul(g,c),f=r.mul(i,f),p=r.mul(t,p),g=r.sub(l,p),g=r.mul(t,g),g=r.add(g,f),f=r.add(l,l),l=r.add(f,l),l=r.add(l,p),l=r.mul(l,g),u=r.add(u,l),p=r.mul(s,a),p=r.add(p,p),l=r.mul(p,g),c=r.sub(c,l),f=r.mul(p,d),f=r.add(f,f),f=r.add(f,f),new h(c,u,f)}add(t){c(t);const{px:n,py:i,pz:o}=this,{px:s,py:a,pz:u}=t;let f=r.ZERO,l=r.ZERO,d=r.ZERO;const p=e.a,g=r.mul(e.b,NEt);let y=r.mul(n,s),m=r.mul(i,a),v=r.mul(o,u),w=r.add(n,i),b=r.add(s,a);w=r.mul(w,b),b=r.add(y,m),w=r.sub(w,b),b=r.add(n,o);let E=r.add(s,u);return b=r.mul(b,E),E=r.add(y,v),b=r.sub(b,E),E=r.add(i,o),f=r.add(a,u),E=r.mul(E,f),f=r.add(m,v),E=r.sub(E,f),d=r.mul(p,b),f=r.mul(g,v),d=r.add(f,d),f=r.sub(m,d),d=r.add(m,d),l=r.mul(f,d),m=r.add(y,y),m=r.add(m,y),v=r.mul(p,v),b=r.mul(g,b),m=r.add(m,v),v=r.sub(y,v),v=r.mul(p,v),b=r.add(b,v),y=r.mul(m,b),l=r.add(l,y),y=r.mul(E,b),f=r.mul(w,f),f=r.sub(f,y),y=r.mul(w,m),d=r.mul(E,d),d=r.add(d,y),new h(f,l,d)}subtract(t){return this.add(t.negate())}is0(){return this.equals(h.ZERO)}wNAF(t){return d.wNAFCached(this,t,h.normalizeZ)}multiplyUnsafe(t){const{endo:n,n:i}=e;vmt("scalar",t,LEt,i);const o=h.ZERO;if(t===LEt)return o;if(this.is0()||t===PEt)return this;if(!n||d.hasPrecomputes(this))return d.wNAFCachedUnsafe(this,t,h.normalizeZ);let{k1neg:s,k1:a,k2neg:c,k2:u}=n.splitScalar(t),f=o,l=o,p=this;for(;a>LEt||u>LEt;)a&PEt&&(f=f.add(p)),u&PEt&&(l=l.add(p)),p=p.double(),a>>=PEt,u>>=PEt;return s&&(f=f.negate()),c&&(l=l.negate()),l=new h(r.mul(l.px,n.beta),l.py,l.pz),f.add(l)}multiply(t){const{endo:n,n:i}=e;let o,s;if(vmt("scalar",t,PEt,i),n){const{k1neg:e,k1:i,k2neg:a,k2:c}=n.splitScalar(t);let{p:u,f:f}=this.wNAF(i),{p:l,f:p}=this.wNAF(c);u=d.constTimeNegate(e,u),l=d.constTimeNegate(a,l),l=new h(r.mul(l.px,n.beta),l.py,l.pz),o=u.add(l),s=f.add(p)}else{const{p:e,f:r}=this.wNAF(t);o=e,s=r}return h.normalizeZ([o,s])[0]}multiplyAndAddUnsafe(t,e,r){const n=h.BASE,i=(t,e)=>e!==LEt&&e!==PEt&&t.equals(n)?t.multiply(e):t.multiplyUnsafe(e),o=i(this,e).add(i(t,r));return o.is0()?void 0:o}toAffine(t){return u(this,t)}isTorsionFree(){const{h:t,isTorsionFree:r}=e;if(t===PEt)return!0;if(r)return r(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:t,clearCofactor:r}=e;return t===PEt?this:r?r(h,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return Yyt("isCompressed",t),this.assertValidity(),i(h,this,t)}toHex(t=!0){return Yyt("isCompressed",t),Qyt(this.toRawBytes(t))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const l=e.nBitLength,d=Qmt(h,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:a,weierstrassEquation:s,isWithinCurveOrder:function(t){return mmt(t,PEt,e.n)}}}function jEt(t){const e=function(t){const e=evt(t);return xmt(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:r,n:n}=e,i=r.BYTES+1,o=2*r.BYTES+1;function s(t){return Pmt(t,n)}function a(t){return jmt(t,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:f,isWithinCurveOrder:h}=UEt({...e,toBytes(t,e,n){const i=e.toAffine(),o=r.toBytes(i.x),s=gmt;return Yyt("isCompressed",n),n?s(Uint8Array.from([e.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,r.toBytes(i.y))},fromBytes(t){const e=t.length,n=t[0],s=t.subarray(1);if(e!==i||2!==n&&3!==n){if(e===o&&4===n){return{x:r.fromBytes(s.subarray(0,r.BYTES)),y:r.fromBytes(s.subarray(r.BYTES,2*r.BYTES))}}throw new Error("invalid Point, expected length of "+i+", or uncompressed "+o+", got "+e)}{const t=fmt(s);if(!mmt(t,PEt,r.ORDER))throw new Error("Point is not on curve");const e=f(t);let i;try{i=r.sqrt(e)}catch(t){const e=t instanceof Error?": "+t.message:"";throw new Error("Point is not on curve"+e)}return!(1&~n)!==((i&PEt)===PEt)&&(i=r.neg(i)),{x:t,y:i}}}}),l=t=>Qyt(lmt(t,e.nByteLength));function d(t){return t>n>>PEt}const p=(t,e,r)=>fmt(t.slice(e,r));class g{constructor(t,e,r){this.r=t,this.s=e,this.recovery=r,this.assertValidity()}static fromCompact(t){const r=e.nByteLength;return t=pmt("compactSignature",t,2*r),new g(p(t,0,r),p(t,r,2*r))}static fromDER(t){const{r:e,s:r}=CEt.toSig(pmt("DER",t));return new g(e,r)}assertValidity(){vmt("r",this.r,PEt,n),vmt("s",this.s,PEt,n)}addRecoveryBit(t){return new g(this.r,this.s,t)}recoverPublicKey(t){const{r:n,s:i,recovery:o}=this,u=w(pmt("msgHash",t));if(null==o||![0,1,2,3].includes(o))throw new Error("recovery id invalid");const f=2===o||3===o?n+e.n:n;if(f>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const h=1&o?"03":"02",d=c.fromHex(h+l(f)),p=a(f),g=s(-u*p),y=s(i*p),m=c.BASE.multiplyAndAddUnsafe(d,g,y);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return umt(this.toDERHex())}toDERHex(){return CEt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return umt(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const y={isValidPrivateKey(t){try{return u(t),!0}catch(t){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const t=qmt(e.n);return function(t,e,r=!1){const n=t.length,i=$mt(e),o=qmt(e);if(n<16||n1024)throw new Error("expected "+o+"-1024 bytes of input, got "+n);const s=Pmt(r?fmt(t):hmt(t),e-Rmt)+Rmt;return r?dmt(s,i):lmt(s,i)}(e.randomBytes(t),e.n)},precompute:(t=8,e=c.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)};function m(t){const e=Zyt(t),r="string"==typeof t,n=(e||r)&&t.length;return e?n===i||n===o:r?n===2*i||n===2*o:t instanceof c}const v=e.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const r=fmt(t),n=8*t.length-e.nBitLength;return n>0?r>>BigInt(n):r},w=e.bits2int_modN||function(t){return s(v(t))},b=bmt(e.nBitLength);function E(t){return vmt("num < 2^"+e.nBitLength,t,LEt,b),lmt(t,e.nByteLength)}function S(t,n,i=_){if(["recovered","canonical"].some((t=>t in i)))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:f}=e;let{lowS:l,prehash:p,extraEntropy:y}=i;null==l&&(l=!0),t=pmt("msgHash",t),BEt(i),p&&(t=pmt("prehashed msgHash",o(t)));const m=w(t),b=u(n),S=[E(b),E(m)];if(null!=y&&!1!==y){const t=!0===y?f(r.BYTES):y;S.push(pmt("extraEntropy",t))}const A=gmt(...S),x=m;return{seed:A,k2sig:function(t){const e=v(t);if(!h(e))return;const r=a(e),n=c.BASE.multiply(e).toAffine(),i=s(n.x);if(i===LEt)return;const o=s(r*s(x+i*b));if(o===LEt)return;let u=(n.x===i?0:2)|Number(n.y&PEt),f=o;return l&&d(o)&&(f=function(t){return d(t)?s(-t):t}(o),u^=1),new g(i,f,u)}}}const _={lowS:e.lowS,prehash:!1},A={lowS:e.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return c.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,r=!0){if(m(t))throw new Error("first arg must be private key");if(!m(e))throw new Error("second arg must be public key");return c.fromHex(e).multiply(u(t)).toRawBytes(r)},sign:function(t,r,n=_){const{seed:i,k2sig:o}=S(t,r,n),s=e;return _mt(s.hash.outputLen,s.nByteLength,s.hmac)(i,o)},verify:function(t,r,n,i=A){var o;const u=t;r=pmt("msgHash",r),n=pmt("publicKey",n);const{lowS:f,prehash:h,format:l}=i;if(BEt(i),"strict"in i)throw new Error("options.strict was renamed to lowS");if(void 0!==l&&"compact"!==l&&"der"!==l)throw new Error("format must be compact or der");const d="string"==typeof u||Zyt(u),p=!d&&!l&&"object"==typeof u&&null!==u&&"bigint"==typeof u.r&&"bigint"==typeof u.s;if(!d&&!p)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let y,m;try{if(p&&(y=new g(u.r,u.s)),d){try{"compact"!==l&&(y=g.fromDER(u))}catch(t){if(!(t instanceof CEt.Err))throw t}y||"der"===l||(y=g.fromCompact(u))}m=c.fromHex(n)}catch(t){return!1}if(!y)return!1;if(f&&y.hasHighS())return!1;h&&(r=e.hash(r));const{r:v,s:b}=y,E=w(r),S=a(b),_=s(E*S),x=s(v*S),I=null===(o=c.BASE.multiplyAndAddUnsafe(m,_,x))||void 0===o?void 0:o.toAffine();return!!I&&s(I.x)===v},ProjectivePoint:c,Signature:g,utils:y}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function DEt(t){return{hash:t,hmac:(e,...r)=>REt(t,e,function(...t){let e=0;for(let r=0;r(t+e/$Et)/e;const WEt=Hmt(zEt,void 0,void 0,{sqrt:function(t){const e=zEt,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,f=u*u*t%e,h=Umt(f,r,e)*f%e,l=Umt(h,r,e)*f%e,d=Umt(l,$Et,e)*u%e,p=Umt(d,i,e)*d%e,g=Umt(p,o,e)*p%e,y=Umt(g,a,e)*g%e,m=Umt(y,c,e)*y%e,v=Umt(m,a,e)*g%e,w=Umt(v,r,e)*f%e,b=Umt(w,s,e)*p%e,E=Umt(b,n,e)*u%e,S=Umt(E,$Et,e);if(!WEt.eql(WEt.sqr(S),t))throw new Error("Cannot find square root");return S}}),VEt=function(t,e){const r=e=>jEt({...t,...DEt(e)});return Object.freeze({...r(e),create:r})}({a:BigInt(0),b:BigInt(7),Fp:WEt,n:FEt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=FEt,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-HEt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),a=qEt(o*t,e),c=qEt(-n*t,e);let u=Pmt(t-a*r-c*i,e),f=Pmt(-a*n-c*o,e);const h=u>s,l=f>s;if(h&&(u=e-u),l&&(f=e-f),u>s||f>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:u,k2neg:l,k2:f}}}},kEt);function KEt(t){try{return vvt.ExtendedPoint.fromHex(t),!0}catch{return!1}}BigInt(0),VEt.ProjectivePoint,vvt.utils.randomPrivateKey;const GEt=(t,e)=>vvt.sign(t,e.slice(0,32)),ZEt=vvt.verify,JEt=t=>pgt.isBuffer(t)?t:t instanceof Uint8Array?pgt.from(t.buffer,t.byteOffset,t.byteLength):pgt.from(t);class YEt{constructor(t){Object.assign(this,t)}encode(){return pgt.from(mwt(XEt,this))}static decode(t){return bwt(XEt,this,t)}static decodeUnchecked(t){return iwt(XEt,this,t)}}const XEt=new Map;var QEt;const tSt=32;let eSt=1;class rSt extends YEt{constructor(t){if(super({}),this._bn=void 0,function(t){return void 0!==t._bn}(t))this._bn=t._bn;else{if("string"==typeof t){const e=xvt.decode(t);if(e.length!=tSt)throw new Error("Invalid public key input");this._bn=new Evt(e)}else this._bn=new Evt(t);if(this._bn.byteLength()>tSt)throw new Error("Invalid public key input")}}static unique(){const t=new rSt(eSt);return eSt+=1,new rSt(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return xvt.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){const t=this._bn.toArrayLike(pgt);if(t.length===tSt)return t;const e=pgt.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,r){const n=pgt.concat([t.toBuffer(),pgt.from(e),r.toBuffer()]),i=zvt(n);return new rSt(i)}static createProgramAddressSync(t,e){let r=pgt.alloc(0);t.forEach((function(t){if(t.length>32)throw new TypeError("Max seed length exceeded");r=pgt.concat([r,JEt(t)])})),r=pgt.concat([r,e.toBuffer(),pgt.from("ProgramDerivedAddress")]);const n=zvt(r);if(KEt(n))throw new Error("Invalid seeds, address must fall off the curve");return new rSt(n)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let r,n=255;for(;0!=n;){try{const i=t.concat(pgt.from([n]));r=this.createProgramAddressSync(i,e)}catch(t){if(t instanceof TypeError)throw t;n--;continue}return[r,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){return KEt(new rSt(t).toBytes())}}QEt=rSt,rSt.default=new QEt("11111111111111111111111111111111"),XEt.set(rSt,{kind:"struct",fields:[["_bn","u256"]]}),new rSt("BPFLoader1111111111111111111111111111111111");const nSt=1232;class iSt extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(iSt.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class oSt extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}}Object.defineProperty(oSt.prototype,"name",{value:"TransactionExpiredTimeoutError"});class sSt extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}}Object.defineProperty(sSt.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class aSt{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){const t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(const e of this.keySegments()){if(t256)throw new Error("Account index overflow encountered during compilation");const e=new Map;this.keySegments().flat().forEach(((t,r)=>{e.set(t.toBase58(),r)}));const r=t=>{const r=e.get(t.toBase58());if(void 0===r)throw new Error("Encountered an unknown instruction account key during compilation");return r};return t.map((t=>({programIdIndex:r(t.programId),accountKeyIndexes:t.keys.map((t=>r(t.pubkey))),data:t.data})))}}const cSt=(t="publicKey")=>dbt(32,t),uSt=(t="signature")=>dbt(64,t),fSt=(t="string")=>{const e=hbt([cbt("length"),cbt("lengthPadding"),dbt(obt(cbt(),-8),"chars")],t),r=e.decode.bind(e),n=e.encode.bind(e),i=e;return i.decode=(t,e)=>r(t,e).chars.toString(),i.encode=(t,e,r)=>{const i={chars:pgt.from(t,"utf8")};return n(i,e,r)},i.alloc=t=>cbt().span+cbt().span+pgt.from(t,"utf8").length,i};function hSt(t){let e=0,r=0;for(;;){let n=t.shift();if(e|=(127&n)<<7*r,r+=1,!(128&n))break}return e}function lSt(t,e){let r=e;for(;;){let e=127&r;if(r>>=7,0==r){t.push(e);break}e|=128,t.push(e)}}function dSt(t,e){if(!t)throw new Error(e||"Assertion failed")}class pSt{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){const r=new Map,n=t=>{const e=t.toBase58();let n=r.get(e);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(e,n)),n},i=n(e);i.isSigner=!0,i.isWritable=!0;for(const e of t){n(e.programId).isInvoked=!0;for(const t of e.keys){const e=n(t.pubkey);e.isSigner||(e.isSigner=t.isSigner),e.isWritable||(e.isWritable=t.isWritable)}}return new pSt(e,r)}getMessageComponents(){const t=[...this.keyMetaMap.entries()];dSt(t.length<=256,"Max static account keys length exceeded");const e=t.filter((([,t])=>t.isSigner&&t.isWritable)),r=t.filter((([,t])=>t.isSigner&&!t.isWritable)),n=t.filter((([,t])=>!t.isSigner&&t.isWritable)),i=t.filter((([,t])=>!t.isSigner&&!t.isWritable)),o={numRequiredSignatures:e.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{dSt(e.length>0,"Expected at least one writable signer key");const[t]=e[0];dSt(t===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const s=[...e.map((([t])=>new rSt(t))),...r.map((([t])=>new rSt(t))),...n.map((([t])=>new rSt(t))),...i.map((([t])=>new rSt(t)))];return[o,s]}extractTableLookup(t){const[e,r]=this.drainKeysFoundInLookupTable(t.state.addresses,(t=>!t.isSigner&&!t.isInvoked&&t.isWritable)),[n,i]=this.drainKeysFoundInLookupTable(t.state.addresses,(t=>!t.isSigner&&!t.isInvoked&&!t.isWritable));if(0!==e.length||0!==n.length)return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:n},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(t,e){const r=new Array,n=new Array;for(const[i,o]of this.keyMetaMap.entries())if(e(o)){const e=new rSt(i),o=t.findIndex((t=>t.equals(e)));o>=0&&(dSt(o<256,"Max lookup table index exceeded"),r.push(o),n.push(e),this.keyMetaMap.delete(i))}return[r,n]}}const gSt="Reached end of buffer unexpectedly";function ySt(t){if(0===t.length)throw new Error(gSt);return t.shift()}function mSt(t,...e){var r;const[n]=e;if(2===e.length?n+(null!==(r=e[1])&&void 0!==r?r:0)>t.length:n>=t.length)throw new Error(gSt);return t.splice(...e)}class vSt{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((t=>new rSt(t))),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex])))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map((t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:xvt.decode(t.data)})))}get addressTableLookups(){return[]}getAccountKeys(){return new aSt(this.staticAccountKeys)}static compile(t){const e=pSt.compile(t.instructions,t.payerKey),[r,n]=e.getMessageComponents(),i=new aSt(n).compileInstructions(t.instructions).map((t=>({programIdIndex:t.programIdIndex,accounts:t.accountKeyIndexes,data:xvt.encode(t.data)})));return new vSt({header:r,accountKeys:n,recentBlockhash:t.recentBlockhash,instructions:i})}isAccountSigner(t){return t=this.header.numRequiredSignatures){return t-e!this.isProgramId(e)))}serialize(){const t=this.accountKeys.length;let e=[];lSt(e,t);const r=this.instructions.map((t=>{const{accounts:e,programIdIndex:r}=t,n=Array.from(xvt.decode(t.data));let i=[];lSt(i,e.length);let o=[];return lSt(o,n.length),{programIdIndex:r,keyIndicesCount:pgt.from(i),keyIndices:e,dataLength:pgt.from(o),data:n}}));let n=[];lSt(n,r.length);let i=pgt.alloc(nSt);pgt.from(n).copy(i);let o=n.length;r.forEach((t=>{const e=hbt([sbt("programIdIndex"),dbt(t.keyIndicesCount.length,"keyIndicesCount"),lbt(sbt("keyIndex"),t.keyIndices.length,"keyIndices"),dbt(t.dataLength.length,"dataLength"),lbt(sbt("userdatum"),t.data.length,"data")]).encode(t,i,o);o+=e})),i=i.slice(0,o);const s=hbt([dbt(1,"numRequiredSignatures"),dbt(1,"numReadonlySignedAccounts"),dbt(1,"numReadonlyUnsignedAccounts"),dbt(e.length,"keyCount"),lbt(cSt("key"),t,"keys"),cSt("recentBlockhash")]),a={numRequiredSignatures:pgt.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:pgt.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:pgt.from([this.header.numReadonlyUnsignedAccounts]),keyCount:pgt.from(e),keys:this.accountKeys.map((t=>JEt(t.toBytes()))),recentBlockhash:xvt.decode(this.recentBlockhash)};let c=pgt.alloc(2048);const u=s.encode(a,c);return i.copy(c,u),c.slice(0,u+i.length)}static from(t){let e=[...t];const r=ySt(e);if(r!==(127&r))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const n=ySt(e),i=ySt(e),o=hSt(e);let s=[];for(let t=0;t0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new aSt(this.staticAccountKeys,e)}isAccountSigner(t){return t=r){const e=t-r,n=this.addressTableLookups.reduce(((t,e)=>t+e.writableIndexes.length),0);return e=this.header.numRequiredSignatures){return t-et.key.equals(r.accountKey)));if(!n)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const t of r.writableIndexes){if(!(tt.toBytes())),recentBlockhash:xvt.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:e,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:n},s);return s.slice(0,a)}serializeInstructions(){let t=0;const e=new Uint8Array(nSt);for(const r of this.compiledInstructions){const n=Array();lSt(n,r.accountKeyIndexes.length);const i=Array();lSt(i,r.data.length);t+=hbt([sbt("programIdIndex"),dbt(n.length,"encodedAccountKeyIndexesLength"),lbt(sbt(),r.accountKeyIndexes.length,"accountKeyIndexes"),dbt(i.length,"encodedDataLength"),dbt(r.data.length,"data")]).encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},e,t)}return e.slice(0,t)}serializeAddressTableLookups(){let t=0;const e=new Uint8Array(nSt);for(const r of this.addressTableLookups){const n=Array();lSt(n,r.writableIndexes.length);const i=Array();lSt(i,r.readonlyIndexes.length);t+=hbt([cSt("accountKey"),dbt(n.length,"encodedWritableIndexesLength"),lbt(sbt(),r.writableIndexes.length,"writableIndexes"),dbt(i.length,"encodedReadonlyIndexesLength"),lbt(sbt(),r.readonlyIndexes.length,"readonlyIndexes")]).encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},e,t)}return e.slice(0,t)}static deserialize(t){let e=[...t];const r=ySt(e),n=127&r;dSt(r!==n,"Expected versioned message but received legacy message");dSt(0===n,`Expected versioned message with version 0 but found version ${n}`);const i={numRequiredSignatures:ySt(e),numReadonlySignedAccounts:ySt(e),numReadonlyUnsignedAccounts:ySt(e)},o=[],s=hSt(e);for(let t=0;t{const e=bSt.deserializeMessageVersion(t);if("legacy"===e)return vSt.from(t);if(0===e)return wSt.deserialize(t);throw new Error(`Transaction message version ${e} deserialization is not supported`)}};let ESt=function(t){return t[t.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",t[t.PROCESSED=1]="PROCESSED",t[t.TIMED_OUT=2]="TIMED_OUT",t[t.NONCE_INVALID=3]="NONCE_INVALID",t}({});const SSt=pgt.alloc(64).fill(0);class _St{constructor(t){this.keys=void 0,this.programId=void 0,this.data=pgt.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map((({pubkey:t,isSigner:e,isWritable:r})=>({pubkey:t.toJSON(),isSigner:e,isWritable:r}))),programId:this.programId.toJSON(),data:[...this.data]}}}class ASt{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){const{minContextSlot:e,nonceInfo:r}=t;this.minNonceContextSlot=e,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){const{blockhash:e,lastValidBlockHeight:r}=t;this.recentBlockhash=e,this.lastValidBlockHeight=r}else{const{recentBlockhash:e,nonceInfo:r}=t;r&&(this.nonceInfo=r),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map((t=>t.toJSON())),signers:this.signatures.map((({publicKey:t})=>t.toJSON()))}}add(...t){if(0===t.length)throw new Error("No instructions");return t.forEach((t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new _St(t))})),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let t,e,r;if(this.nonceInfo?(t=this.nonceInfo.nonce,e=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw new Error("Transaction recentBlockhash required");if(e.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");r=this.signatures[0].publicKey}for(let t=0;t{t.keys.forEach((t=>{i.push({...t})}));const e=t.programId.toString();n.includes(e)||n.push(e)})),n.forEach((t=>{i.push({pubkey:new rSt(t),isSigner:!1,isWritable:!1})}));const o=[];i.forEach((t=>{const e=t.pubkey.toString(),r=o.findIndex((t=>t.pubkey.toString()===e));r>-1?(o[r].isWritable=o[r].isWritable||t.isWritable,o[r].isSigner=o[r].isSigner||t.isSigner):o.push(t)})),o.sort((function(t,e){if(t.isSigner!==e.isSigner)return t.isSigner?-1:1;if(t.isWritable!==e.isWritable)return t.isWritable?-1:1;return t.pubkey.toBase58().localeCompare(e.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})}));const s=o.findIndex((t=>t.pubkey.equals(r)));if(s>-1){const[t]=o.splice(s,1);t.isSigner=!0,t.isWritable=!0,o.unshift(t)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const t of this.signatures){const e=o.findIndex((e=>e.pubkey.equals(t.publicKey)));if(!(e>-1))throw new Error(`unknown signer: ${t.publicKey.toString()}`);o[e].isSigner||(o[e].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))}let a=0,c=0,u=0;const f=[],h=[];o.forEach((({pubkey:t,isSigner:e,isWritable:r})=>{e?(f.push(t.toString()),a+=1,r||(c+=1)):(h.push(t.toString()),r||(u+=1))}));const l=f.concat(h),d=e.map((t=>{const{data:e,programId:r}=t;return{programIdIndex:l.indexOf(r.toString()),accounts:t.keys.map((t=>l.indexOf(t.pubkey.toString()))),data:xvt.encode(e)}}));return d.forEach((t=>{dSt(t.programIdIndex>=0),t.accounts.forEach((t=>dSt(t>=0)))})),new vSt({header:{numRequiredSignatures:a,numReadonlySignedAccounts:c,numReadonlyUnsignedAccounts:u},accountKeys:l,recentBlockhash:t,instructions:d})}_compile(){const t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);if(this.signatures.length===e.length){const r=this.signatures.every(((t,r)=>e[r].equals(t.publicKey)));if(r)return t}return this.signatures=e.map((t=>({signature:null,publicKey:t}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(0===t.length)throw new Error("No signers");const e=new Set;this.signatures=t.filter((t=>{const r=t.toString();return!e.has(r)&&(e.add(r),!0)})).map((t=>({signature:null,publicKey:t})))}sign(...t){if(0===t.length)throw new Error("No signers");const e=new Set,r=[];for(const n of t){const t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}this.signatures=r.map((t=>({signature:null,publicKey:t.publicKey})));const n=this._compile();this._partialSign(n,...r)}partialSign(...t){if(0===t.length)throw new Error("No signers");const e=new Set,r=[];for(const n of t){const t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}const n=this._compile();this._partialSign(n,...r)}_partialSign(t,...e){const r=t.serialize();e.forEach((t=>{const e=GEt(r,t.secretKey);this._addSignature(t.publicKey,JEt(e))}))}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){dSt(64===e.length);const r=this.signatures.findIndex((e=>t.equals(e.publicKey)));if(r<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[r].signature=pgt.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){const r={};for(const{signature:n,publicKey:i}of this.signatures)null===n?e&&(r.missing||(r.missing=[])).push(i):ZEt(n,t,i.toBytes())||(r.invalid||(r.invalid=[])).push(i);return r.invalid||r.missing?r:void 0}serialize(t){const{requireAllSignatures:e,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),n=this.serializeMessage();if(r){const t=this._getMessageSignednessErrors(n,e);if(t){let e="Signature verification failed.";throw t.invalid&&(e+=`\nInvalid signature for public key${1===t.invalid.length?"":"(s)"} [\`${t.invalid.map((t=>t.toBase58())).join("`, `")}\`].`),t.missing&&(e+=`\nMissing signature for public key${1===t.missing.length?"":"(s)"} [\`${t.missing.map((t=>t.toBase58())).join("`, `")}\`].`),new Error(e)}}return this._serialize(n)}_serialize(t){const{signatures:e}=this,r=[];lSt(r,e.length);const n=r.length+64*e.length+t.length,i=pgt.alloc(n);return dSt(e.length<256),pgt.from(r).copy(i,0),e.forEach((({signature:t},e)=>{null!==t&&(dSt(64===t.length,"signature has invalid length"),pgt.from(t).copy(i,r.length+64*e))})),t.copy(i,r.length+64*e.length),dSt(i.length<=nSt,`Transaction too large: ${i.length} > 1232`),i}get keys(){return dSt(1===this.instructions.length),this.instructions[0].keys.map((t=>t.pubkey))}get programId(){return dSt(1===this.instructions.length),this.instructions[0].programId}get data(){return dSt(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t];const r=hSt(e);let n=[];for(let t=0;t0&&(r.feePayer=t.accountKeys[0]),e.forEach(((e,n)=>{const i={signature:e==xvt.encode(SSt)?null:xvt.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)})),t.instructions.forEach((e=>{const n=e.accounts.map((e=>{const n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some((t=>t.publicKey.toString()===n.toString()))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));r.instructions.push(new _St({keys:n,programId:t.accountKeys[e.programIdIndex],data:xvt.decode(e.data)}))})),r._message=t,r._json=r.toJSON(),r}}class xSt{get version(){return this.message.version}constructor(t,e){if(this.signatures=void 0,this.message=void 0,void 0!==e)dSt(e.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=e;else{const e=[];for(let r=0;rt.equals(n.publicKey)));dSt(t>=0,`Cannot sign with non signer key ${n.publicKey.toBase58()}`),this.signatures[t]=GEt(e,n.secretKey)}}addSignature(t,e){dSt(64===e.byteLength,"Signature must be 64 bytes long");const r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((e=>e.equals(t)));dSt(r>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=e}}function ISt(t){return new Promise((e=>setTimeout(e,t)))}new rSt("SysvarC1ock11111111111111111111111111111111"),new rSt("SysvarEpochSchedu1e111111111111111111111111"),new rSt("Sysvar1nstructions1111111111111111111111111"),new rSt("SysvarRecentB1ockHashes11111111111111111111"),new rSt("SysvarRent111111111111111111111111111111111"),new rSt("SysvarRewards111111111111111111111111111111"),new rSt("SysvarS1otHashes111111111111111111111111111"),new rSt("SysvarS1otHistory11111111111111111111111111"),new rSt("SysvarStakeHistory1111111111111111111111111");const kSt=ubt("lamportsPerSignature"),TSt=hbt([cbt("version"),cbt("state"),cSt("authorizedPubkey"),cSt("nonce"),hbt([kSt],"feeCalculator")]);TSt.span;class RSt{constructor(t){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}static fromAccountData(t){const e=TSt.decode(JEt(t),0);return new RSt({authorizedPubkey:new rSt(e.authorizedPubkey),nonce:new rSt(e.nonce).toString(),feeCalculator:e.feeCalculator})}}const BSt=(OSt=8,t=>{const e=dbt(OSt,t),{encode:r,decode:n}=(t=>({decode:t.decode.bind(t),encode:t.encode.bind(t)}))(e),i=e;return i.decode=(t,e)=>{const r=n(t,e);return gbt(pgt.from(r))},i.encode=(t,e,n)=>{const i=mbt(t,OSt);return r(i,e,n)},i});var OSt;function MSt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}Object.freeze({Create:{index:0,layout:hbt([cbt("instruction"),fbt("lamports"),fbt("space"),cSt("programId")])},Assign:{index:1,layout:hbt([cbt("instruction"),cSt("programId")])},Transfer:{index:2,layout:hbt([cbt("instruction"),BSt("lamports")])},CreateWithSeed:{index:3,layout:hbt([cbt("instruction"),cSt("base"),fSt("seed"),fbt("lamports"),fbt("space"),cSt("programId")])},AdvanceNonceAccount:{index:4,layout:hbt([cbt("instruction")])},WithdrawNonceAccount:{index:5,layout:hbt([cbt("instruction"),fbt("lamports")])},InitializeNonceAccount:{index:6,layout:hbt([cbt("instruction"),cSt("authorized")])},AuthorizeNonceAccount:{index:7,layout:hbt([cbt("instruction"),cSt("authorized")])},Allocate:{index:8,layout:hbt([cbt("instruction"),fbt("space")])},AllocateWithSeed:{index:9,layout:hbt([cbt("instruction"),cSt("base"),fSt("seed"),fbt("space"),cSt("programId")])},AssignWithSeed:{index:10,layout:hbt([cbt("instruction"),cSt("base"),fSt("seed"),cSt("programId")])},TransferWithSeed:{index:11,layout:hbt([cbt("instruction"),BSt("lamports"),fSt("seed"),cSt("programId")])},UpgradeNonceAccount:{index:12,layout:hbt([cbt("instruction")])}}),new rSt("11111111111111111111111111111111"),new rSt("BPFLoader2111111111111111111111111111111111");var CSt=Object.prototype.toString,LSt=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};function PSt(t,e){var r,n,i,o,s,a,c;if(!0===t)return"true";if(!1===t)return"false";switch(typeof t){case"object":if(null===t)return null;if(t.toJSON&&"function"==typeof t.toJSON)return PSt(t.toJSON(),e);if("[object Array]"===(c=CSt.call(t))){for(i="[",n=t.length-1,r=0;r-1&&(i+=PSt(t[r],!0)),i+"]"}if("[object Object]"===c){for(n=(o=LSt(t).sort()).length,i="",r=0;r1;)t/=2,e++;return e}class jSt{constructor(t,e,r,n,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=e,this.warmup=r,this.firstNormalEpoch=n,this.firstNormalSlot=i}getEpoch(t){return this.getEpochAndSlotIndex(t)[0]}getEpochAndSlotIndex(t){if(t>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,1+(t|=t>>32))}(t+32+1))-USt(32)-1;return[e,t-(this.getSlotsInEpoch(e)-32)]}{const e=t-this.firstNormalSlot,r=Math.floor(e/this.slotsPerEpoch);return[this.firstNormalEpoch+r,e%this.slotsPerEpoch]}}getFirstSlotInEpoch(t){return t<=this.firstNormalEpoch?32*(Math.pow(2,t)-1):(t-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(t){return this.getFirstSlotInEpoch(t)+this.getSlotsInEpoch(t)-1}getSlotsInEpoch(t){return t{const r=i.default(t,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...e});return this.underlyingSocket="socket"in r?r.socket:r,r}),t,e,r),this.underlyingSocket=void 0}call(...t){var e;const r=null===(e=this.underlyingSocket)||void 0===e?void 0:e.readyState;return 1===r?super.call(...t):Promise.reject(new Error("Tried to call a JSON-RPC method `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+r+")"))}notify(...t){var e;const r=null===(e=this.underlyingSocket)||void 0===e?void 0:e.readyState;return 1===r?super.notify(...t):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+r+")"))}}class $St{constructor(t){this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}isActive(){const t=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===t}static deserialize(t){const e=function(t,e){let r;try{r=t.layout.decode(e)}catch(t){throw new Error("invalid instruction; "+t)}if(r.typeIndex!==t.index)throw new Error(`invalid account data; account type mismatch ${r.typeIndex} != ${t.index}`);return r}(qSt,t),r=t.length-56;dSt(r>=0,"lookup table is invalid"),dSt(r%32==0,"lookup table is invalid");const n=r/32,{addresses:i}=hbt([lbt(cSt(),n,"addresses")]).decode(t.slice(56));return{deactivationSlot:e.deactivationSlot,lastExtendedSlot:e.lastExtendedSlot,lastExtendedSlotStartIndex:e.lastExtendedStartIndex,authority:0!==e.authority.length?new rSt(e.authority[0]):void 0,addresses:i.map((t=>new rSt(t)))}}}const qSt={index:1,layout:hbt([cbt("typeIndex"),BSt("deactivationSlot"),ubt("lastExtendedSlot"),sbt("lastExtendedStartIndex"),sbt(),lbt(cSt(),obt(sbt(),-1),"authority")])},WSt=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;const VSt=Hbt(Obt(rSt),Ubt(),(t=>new rSt(t))),KSt=jbt([Ubt(),Mbt("base64")]),GSt=Hbt(Obt(pgt),KSt,(t=>pgt.from(t[0],"base64")));function ZSt(t){let e,r;if("string"==typeof t)e=t;else if(t){const{commitment:n,...i}=t;e=n,r=i}return{commitment:e,config:r}}function JSt(t){return zbt([Dbt({jsonrpc:Mbt("2.0"),id:Ubt(),result:t}),Dbt({jsonrpc:Mbt("2.0"),id:Ubt(),error:Dbt({code:Fbt(),message:Ubt(),data:Pbt(Tbt("any",(()=>!0)))})})])}const YSt=JSt(Fbt());function XSt(t){return Hbt(JSt(t),YSt,(e=>"error"in e?e:{...e,result:xbt(e.result,t)}))}function QSt(t){return XSt(Dbt({context:Dbt({slot:Lbt()}),value:t}))}function t_t(t){return Dbt({context:Dbt({slot:Lbt()}),value:t})}function e_t(t,e){return 0===t?new wSt({header:e.header,staticAccountKeys:e.accountKeys.map((t=>new rSt(t))),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map((t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:xvt.decode(t.data)}))),addressTableLookups:e.addressTableLookups}):new vSt(e)}const r_t=Dbt({foundation:Lbt(),foundationTerm:Lbt(),initial:Lbt(),taper:Lbt(),terminal:Lbt()}),n_t=XSt(Rbt(Cbt(Dbt({epoch:Lbt(),effectiveSlot:Lbt(),amount:Lbt(),postBalance:Lbt(),commission:Pbt(Cbt(Lbt()))})))),i_t=Rbt(Dbt({slot:Lbt(),prioritizationFee:Lbt()})),o_t=Dbt({total:Lbt(),validator:Lbt(),foundation:Lbt(),epoch:Lbt()}),s_t=Dbt({epoch:Lbt(),slotIndex:Lbt(),slotsInEpoch:Lbt(),absoluteSlot:Lbt(),blockHeight:Pbt(Lbt()),transactionCount:Pbt(Lbt())}),a_t=Dbt({slotsPerEpoch:Lbt(),leaderScheduleSlotOffset:Lbt(),warmup:Bbt(),firstNormalEpoch:Lbt(),firstNormalSlot:Lbt()}),c_t=Nbt(Ubt(),Rbt(Lbt())),u_t=Cbt(zbt([Dbt({}),Ubt()])),f_t=Dbt({err:u_t}),h_t=Mbt("receivedSignature"),l_t=Dbt({"solana-core":Ubt(),"feature-set":Pbt(Lbt())}),d_t=QSt(Dbt({err:Cbt(zbt([Dbt({}),Ubt()])),logs:Cbt(Rbt(Ubt())),accounts:Pbt(Cbt(Rbt(Cbt(Dbt({executable:Bbt(),owner:Ubt(),lamports:Lbt(),data:Rbt(Ubt()),rentEpoch:Pbt(Lbt())}))))),unitsConsumed:Pbt(Lbt()),returnData:Pbt(Cbt(Dbt({programId:Ubt(),data:jbt([Ubt(),Mbt("base64")])})))})),p_t=QSt(Dbt({byIdentity:Nbt(Ubt(),Rbt(Lbt())),range:Dbt({firstSlot:Lbt(),lastSlot:Lbt()})}));const g_t=XSt(r_t),y_t=XSt(o_t),m_t=XSt(i_t),v_t=XSt(s_t),w_t=XSt(a_t),b_t=XSt(c_t),E_t=XSt(Lbt()),S_t=QSt(Dbt({total:Lbt(),circulating:Lbt(),nonCirculating:Lbt(),nonCirculatingAccounts:Rbt(VSt)})),__t=Dbt({amount:Ubt(),uiAmount:Cbt(Lbt()),decimals:Lbt(),uiAmountString:Pbt(Ubt())}),A_t=QSt(Rbt(Dbt({address:VSt,amount:Ubt(),uiAmount:Cbt(Lbt()),decimals:Lbt(),uiAmountString:Pbt(Ubt())}))),x_t=QSt(Rbt(Dbt({pubkey:VSt,account:Dbt({executable:Bbt(),owner:VSt,lamports:Lbt(),data:GSt,rentEpoch:Lbt()})}))),I_t=Dbt({program:Ubt(),parsed:Fbt(),space:Lbt()}),k_t=QSt(Rbt(Dbt({pubkey:VSt,account:Dbt({executable:Bbt(),owner:VSt,lamports:Lbt(),data:I_t,rentEpoch:Lbt()})}))),T_t=QSt(Rbt(Dbt({lamports:Lbt(),address:VSt}))),R_t=Dbt({executable:Bbt(),owner:VSt,lamports:Lbt(),data:GSt,rentEpoch:Lbt()}),B_t=Dbt({pubkey:VSt,account:R_t}),O_t=Hbt(zbt([Obt(pgt),I_t]),zbt([KSt,I_t]),(t=>Array.isArray(t)?xbt(t,GSt):t)),M_t=Dbt({executable:Bbt(),owner:VSt,lamports:Lbt(),data:O_t,rentEpoch:Lbt()}),C_t=Dbt({pubkey:VSt,account:M_t}),L_t=Dbt({state:zbt([Mbt("active"),Mbt("inactive"),Mbt("activating"),Mbt("deactivating")]),active:Lbt(),inactive:Lbt()}),P_t=XSt(Rbt(Dbt({signature:Ubt(),slot:Lbt(),err:u_t,memo:Cbt(Ubt()),blockTime:Pbt(Cbt(Lbt()))}))),N_t=XSt(Rbt(Dbt({signature:Ubt(),slot:Lbt(),err:u_t,memo:Cbt(Ubt()),blockTime:Pbt(Cbt(Lbt()))}))),U_t=Dbt({subscription:Lbt(),result:t_t(R_t)}),j_t=Dbt({pubkey:VSt,account:R_t}),D_t=Dbt({subscription:Lbt(),result:t_t(j_t)}),z_t=Dbt({parent:Lbt(),slot:Lbt(),root:Lbt()}),F_t=Dbt({subscription:Lbt(),result:z_t}),H_t=zbt([Dbt({type:zbt([Mbt("firstShredReceived"),Mbt("completed"),Mbt("optimisticConfirmation"),Mbt("root")]),slot:Lbt(),timestamp:Lbt()}),Dbt({type:Mbt("createdBank"),parent:Lbt(),slot:Lbt(),timestamp:Lbt()}),Dbt({type:Mbt("frozen"),slot:Lbt(),timestamp:Lbt(),stats:Dbt({numTransactionEntries:Lbt(),numSuccessfulTransactions:Lbt(),numFailedTransactions:Lbt(),maxTransactionsPerEntry:Lbt()})}),Dbt({type:Mbt("dead"),slot:Lbt(),timestamp:Lbt(),err:Ubt()})]),$_t=Dbt({subscription:Lbt(),result:H_t}),q_t=Dbt({subscription:Lbt(),result:t_t(zbt([f_t,h_t]))}),W_t=Dbt({subscription:Lbt(),result:Lbt()}),V_t=Dbt({pubkey:Ubt(),gossip:Cbt(Ubt()),tpu:Cbt(Ubt()),rpc:Cbt(Ubt()),version:Cbt(Ubt())}),K_t=Dbt({votePubkey:Ubt(),nodePubkey:Ubt(),activatedStake:Lbt(),epochVoteAccount:Bbt(),epochCredits:Rbt(jbt([Lbt(),Lbt(),Lbt()])),commission:Lbt(),lastVote:Lbt(),rootSlot:Cbt(Lbt())}),G_t=XSt(Dbt({current:Rbt(K_t),delinquent:Rbt(K_t)})),Z_t=zbt([Mbt("processed"),Mbt("confirmed"),Mbt("finalized")]),J_t=Dbt({slot:Lbt(),confirmations:Cbt(Lbt()),err:u_t,confirmationStatus:Pbt(Z_t)}),Y_t=QSt(Rbt(Cbt(J_t))),X_t=XSt(Lbt()),Q_t=Dbt({accountKey:VSt,writableIndexes:Rbt(Lbt()),readonlyIndexes:Rbt(Lbt())}),tAt=Dbt({signatures:Rbt(Ubt()),message:Dbt({accountKeys:Rbt(Ubt()),header:Dbt({numRequiredSignatures:Lbt(),numReadonlySignedAccounts:Lbt(),numReadonlyUnsignedAccounts:Lbt()}),instructions:Rbt(Dbt({accounts:Rbt(Lbt()),data:Ubt(),programIdIndex:Lbt()})),recentBlockhash:Ubt(),addressTableLookups:Pbt(Rbt(Q_t))})}),eAt=Dbt({pubkey:VSt,signer:Bbt(),writable:Bbt(),source:Pbt(zbt([Mbt("transaction"),Mbt("lookupTable")]))}),rAt=Dbt({accountKeys:Rbt(eAt),signatures:Rbt(Ubt())}),nAt=Dbt({parsed:Fbt(),program:Ubt(),programId:VSt}),iAt=Dbt({accounts:Rbt(VSt),data:Ubt(),programId:VSt}),oAt=Hbt(zbt([iAt,nAt]),zbt([Dbt({parsed:Fbt(),program:Ubt(),programId:Ubt()}),Dbt({accounts:Rbt(Ubt()),data:Ubt(),programId:Ubt()})]),(t=>xbt(t,"accounts"in t?iAt:nAt))),sAt=Dbt({signatures:Rbt(Ubt()),message:Dbt({accountKeys:Rbt(eAt),instructions:Rbt(oAt),recentBlockhash:Ubt(),addressTableLookups:Pbt(Cbt(Rbt(Q_t)))})}),aAt=Dbt({accountIndex:Lbt(),mint:Ubt(),owner:Pbt(Ubt()),uiTokenAmount:__t}),cAt=Dbt({writable:Rbt(VSt),readonly:Rbt(VSt)}),uAt=Dbt({err:u_t,fee:Lbt(),innerInstructions:Pbt(Cbt(Rbt(Dbt({index:Lbt(),instructions:Rbt(Dbt({accounts:Rbt(Lbt()),data:Ubt(),programIdIndex:Lbt()}))})))),preBalances:Rbt(Lbt()),postBalances:Rbt(Lbt()),logMessages:Pbt(Cbt(Rbt(Ubt()))),preTokenBalances:Pbt(Cbt(Rbt(aAt))),postTokenBalances:Pbt(Cbt(Rbt(aAt))),loadedAddresses:Pbt(cAt),computeUnitsConsumed:Pbt(Lbt())}),fAt=Dbt({err:u_t,fee:Lbt(),innerInstructions:Pbt(Cbt(Rbt(Dbt({index:Lbt(),instructions:Rbt(oAt)})))),preBalances:Rbt(Lbt()),postBalances:Rbt(Lbt()),logMessages:Pbt(Cbt(Rbt(Ubt()))),preTokenBalances:Pbt(Cbt(Rbt(aAt))),postTokenBalances:Pbt(Cbt(Rbt(aAt))),loadedAddresses:Pbt(cAt),computeUnitsConsumed:Pbt(Lbt())}),hAt=zbt([Mbt(0),Mbt("legacy")]),lAt=Dbt({pubkey:Ubt(),lamports:Lbt(),postBalance:Cbt(Lbt()),rewardType:Cbt(Ubt()),commission:Pbt(Cbt(Lbt()))}),dAt=XSt(Cbt(Dbt({blockhash:Ubt(),previousBlockhash:Ubt(),parentSlot:Lbt(),transactions:Rbt(Dbt({transaction:tAt,meta:Cbt(uAt),version:Pbt(hAt)})),rewards:Pbt(Rbt(lAt)),blockTime:Cbt(Lbt()),blockHeight:Cbt(Lbt())}))),pAt=XSt(Cbt(Dbt({blockhash:Ubt(),previousBlockhash:Ubt(),parentSlot:Lbt(),rewards:Pbt(Rbt(lAt)),blockTime:Cbt(Lbt()),blockHeight:Cbt(Lbt())}))),gAt=XSt(Cbt(Dbt({blockhash:Ubt(),previousBlockhash:Ubt(),parentSlot:Lbt(),transactions:Rbt(Dbt({transaction:rAt,meta:Cbt(uAt),version:Pbt(hAt)})),rewards:Pbt(Rbt(lAt)),blockTime:Cbt(Lbt()),blockHeight:Cbt(Lbt())}))),yAt=XSt(Cbt(Dbt({blockhash:Ubt(),previousBlockhash:Ubt(),parentSlot:Lbt(),transactions:Rbt(Dbt({transaction:sAt,meta:Cbt(fAt),version:Pbt(hAt)})),rewards:Pbt(Rbt(lAt)),blockTime:Cbt(Lbt()),blockHeight:Cbt(Lbt())}))),mAt=XSt(Cbt(Dbt({blockhash:Ubt(),previousBlockhash:Ubt(),parentSlot:Lbt(),transactions:Rbt(Dbt({transaction:rAt,meta:Cbt(fAt),version:Pbt(hAt)})),rewards:Pbt(Rbt(lAt)),blockTime:Cbt(Lbt()),blockHeight:Cbt(Lbt())}))),vAt=XSt(Cbt(Dbt({blockhash:Ubt(),previousBlockhash:Ubt(),parentSlot:Lbt(),rewards:Pbt(Rbt(lAt)),blockTime:Cbt(Lbt()),blockHeight:Cbt(Lbt())}))),wAt=XSt(Cbt(Dbt({blockhash:Ubt(),previousBlockhash:Ubt(),parentSlot:Lbt(),transactions:Rbt(Dbt({transaction:tAt,meta:Cbt(uAt)})),rewards:Pbt(Rbt(lAt)),blockTime:Cbt(Lbt())}))),bAt=XSt(Cbt(Dbt({blockhash:Ubt(),previousBlockhash:Ubt(),parentSlot:Lbt(),signatures:Rbt(Ubt()),blockTime:Cbt(Lbt())}))),EAt=XSt(Cbt(Dbt({slot:Lbt(),meta:Cbt(uAt),blockTime:Pbt(Cbt(Lbt())),transaction:tAt,version:Pbt(hAt)}))),SAt=XSt(Cbt(Dbt({slot:Lbt(),transaction:sAt,meta:Cbt(fAt),blockTime:Pbt(Cbt(Lbt())),version:Pbt(hAt)}))),_At=QSt(Dbt({blockhash:Ubt(),feeCalculator:Dbt({lamportsPerSignature:Lbt()})})),AAt=QSt(Dbt({blockhash:Ubt(),lastValidBlockHeight:Lbt()})),xAt=QSt(Bbt()),IAt=XSt(Rbt(Dbt({slot:Lbt(),numTransactions:Lbt(),numSlots:Lbt(),samplePeriodSecs:Lbt()}))),kAt=QSt(Cbt(Dbt({feeCalculator:Dbt({lamportsPerSignature:Lbt()})}))),TAt=XSt(Ubt()),RAt=XSt(Ubt()),BAt=Dbt({err:u_t,logs:Rbt(Ubt()),signature:Ubt()}),OAt=Dbt({result:t_t(BAt),subscription:Lbt()}),MAt={"solana-client":"js/0.0.0-development"};class CAt{constructor(t,e){let r,n,i,o,s,a;var c;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const t={};return async e=>{var r;const{commitment:n,config:i}=ZSt(e),o=this._buildArgs([],n,void 0,i),s=NSt(o);return t[s]=null!==(r=t[s])&&void 0!==r?r:(async()=>{try{const t=xbt(await this._rpcRequest("getBlockHeight",o),XSt(Lbt()));if("error"in t)throw new zSt(t.error,"failed to get block height information");return t.result}finally{delete t[s]}})(),await t[s]}})(),e&&"string"==typeof e?this._commitment=e:e&&(this._commitment=e.commitment,this._confirmTransactionInitialTimeout=e.confirmTransactionInitialTimeout,r=e.wsEndpoint,n=e.httpHeaders,i=e.fetch,o=e.fetchMiddleware,s=e.disableRetryOnRateLimit,a=e.httpAgent),this._rpcEndpoint=function(t){if(!1===/^https?:/.test(t))throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return t}(t),this._rpcWsEndpoint=r||function(t){const e=t.match(WSt);if(null==e)throw TypeError(`Failed to validate endpoint URL \`${t}\``);const[r,n,i,o]=e,s=t.startsWith("https:")?"wss:":"ws:",a=null==i?null:parseInt(i.slice(1),10);return`${s}//${n}${null==a?"":`:${a+1}`}${o}`}(t),this._rpcClient=function(t,e,r,n,i,o){const s=r||FSt;let a;null!=o&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),n&&(a=async(t,e)=>{const r=await new Promise(((r,i)=>{try{n(t,e,((t,e)=>r([t,e])))}catch(t){i(t)}}));return await s(...r)});const c=new SEt((async(r,n)=>{const o={method:"POST",body:r,agent:void 0,headers:Object.assign({"Content-Type":"application/json"},e||{},MAt)};try{let e,r=5,c=500;for(;e=a?await a(t,o):await s(t,o),429===e.status&&!0!==i&&(r-=1,0!==r);)console.error(`Server responded with ${e.status} ${e.statusText}. Retrying after ${c}ms delay...`),await ISt(c),c*=2;const u=await e.text();e.ok?n(null,u):n(new Error(`${e.status} ${e.statusText}: ${u}`))}catch(t){t instanceof Error&&n(t)}}),{});return c}(t,n,i,o,s,a),this._rpcRequest=(c=this._rpcClient,(t,e)=>new Promise(((r,n)=>{c.request(t,e,((t,e)=>{t?n(t):r(e)}))}))),this._rpcBatchRequest=function(t){return e=>new Promise(((r,n)=>{0===e.length&&r([]);const i=e.map((e=>t.request(e.methodName,e.args)));t.request(i,((t,e)=>{t?n(t):r(e)}))}))}(this._rpcClient),this._rpcWebSocket=new HSt(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(t,e){const{commitment:r,config:n}=ZSt(e),i=this._buildArgs([t.toBase58()],r,void 0,n),o=xbt(await this._rpcRequest("getBalance",i),QSt(Lbt()));if("error"in o)throw new zSt(o.error,`failed to get balance for ${t.toBase58()}`);return o.result}async getBalance(t,e){return await this.getBalanceAndContext(t,e).then((t=>t.value)).catch((e=>{throw new Error("failed to get balance of account "+t.toBase58()+": "+e)}))}async getBlockTime(t){const e=xbt(await this._rpcRequest("getBlockTime",[t]),XSt(Cbt(Lbt())));if("error"in e)throw new zSt(e.error,`failed to get block time for slot ${t}`);return e.result}async getMinimumLedgerSlot(){const t=xbt(await this._rpcRequest("minimumLedgerSlot",[]),XSt(Lbt()));if("error"in t)throw new zSt(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){const t=xbt(await this._rpcRequest("getFirstAvailableBlock",[]),E_t);if("error"in t)throw new zSt(t.error,"failed to get first available block");return t.result}async getSupply(t){let e={};e="string"==typeof t?{commitment:t}:t?{...t,commitment:t&&t.commitment||this.commitment}:{commitment:this.commitment};const r=xbt(await this._rpcRequest("getSupply",[e]),S_t);if("error"in r)throw new zSt(r.error,"failed to get supply");return r.result}async getTokenSupply(t,e){const r=this._buildArgs([t.toBase58()],e),n=xbt(await this._rpcRequest("getTokenSupply",r),QSt(__t));if("error"in n)throw new zSt(n.error,"failed to get token supply");return n.result}async getTokenAccountBalance(t,e){const r=this._buildArgs([t.toBase58()],e),n=xbt(await this._rpcRequest("getTokenAccountBalance",r),QSt(__t));if("error"in n)throw new zSt(n.error,"failed to get token account balance");return n.result}async getTokenAccountsByOwner(t,e,r){const{commitment:n,config:i}=ZSt(r);let o=[t.toBase58()];"mint"in e?o.push({mint:e.mint.toBase58()}):o.push({programId:e.programId.toBase58()});const s=this._buildArgs(o,n,"base64",i),a=xbt(await this._rpcRequest("getTokenAccountsByOwner",s),x_t);if("error"in a)throw new zSt(a.error,`failed to get token accounts owned by account ${t.toBase58()}`);return a.result}async getParsedTokenAccountsByOwner(t,e,r){let n=[t.toBase58()];"mint"in e?n.push({mint:e.mint.toBase58()}):n.push({programId:e.programId.toBase58()});const i=this._buildArgs(n,r,"jsonParsed"),o=xbt(await this._rpcRequest("getTokenAccountsByOwner",i),k_t);if("error"in o)throw new zSt(o.error,`failed to get token accounts owned by account ${t.toBase58()}`);return o.result}async getLargestAccounts(t){const e={...t,commitment:t&&t.commitment||this.commitment},r=e.filter||e.commitment?[e]:[],n=xbt(await this._rpcRequest("getLargestAccounts",r),T_t);if("error"in n)throw new zSt(n.error,"failed to get largest accounts");return n.result}async getTokenLargestAccounts(t,e){const r=this._buildArgs([t.toBase58()],e),n=xbt(await this._rpcRequest("getTokenLargestAccounts",r),A_t);if("error"in n)throw new zSt(n.error,"failed to get token largest accounts");return n.result}async getAccountInfoAndContext(t,e){const{commitment:r,config:n}=ZSt(e),i=this._buildArgs([t.toBase58()],r,"base64",n),o=xbt(await this._rpcRequest("getAccountInfo",i),QSt(Cbt(R_t)));if("error"in o)throw new zSt(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getParsedAccountInfo(t,e){const{commitment:r,config:n}=ZSt(e),i=this._buildArgs([t.toBase58()],r,"jsonParsed",n),o=xbt(await this._rpcRequest("getAccountInfo",i),QSt(Cbt(M_t)));if("error"in o)throw new zSt(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getAccountInfo(t,e){try{return(await this.getAccountInfoAndContext(t,e)).value}catch(e){throw new Error("failed to get info about account "+t.toBase58()+": "+e)}}async getMultipleParsedAccounts(t,e){const{commitment:r,config:n}=ZSt(e),i=t.map((t=>t.toBase58())),o=this._buildArgs([i],r,"jsonParsed",n),s=xbt(await this._rpcRequest("getMultipleAccounts",o),QSt(Rbt(Cbt(M_t))));if("error"in s)throw new zSt(s.error,`failed to get info for accounts ${i}`);return s.result}async getMultipleAccountsInfoAndContext(t,e){const{commitment:r,config:n}=ZSt(e),i=t.map((t=>t.toBase58())),o=this._buildArgs([i],r,"base64",n),s=xbt(await this._rpcRequest("getMultipleAccounts",o),QSt(Rbt(Cbt(R_t))));if("error"in s)throw new zSt(s.error,`failed to get info for accounts ${i}`);return s.result}async getMultipleAccountsInfo(t,e){return(await this.getMultipleAccountsInfoAndContext(t,e)).value}async getStakeActivation(t,e,r){const{commitment:n,config:i}=ZSt(e),o=this._buildArgs([t.toBase58()],n,void 0,{...i,epoch:null!=r?r:null==i?void 0:i.epoch}),s=xbt(await this._rpcRequest("getStakeActivation",o),XSt(L_t));if("error"in s)throw new zSt(s.error,`failed to get Stake Activation ${t.toBase58()}`);return s.result}async getProgramAccounts(t,e){const{commitment:r,config:n}=ZSt(e),{encoding:i,...o}=n||{},s=this._buildArgs([t.toBase58()],r,i||"base64",o),a=await this._rpcRequest("getProgramAccounts",s),c=Rbt(B_t),u=!0===o.withContext?xbt(a,QSt(c)):xbt(a,XSt(c));if("error"in u)throw new zSt(u.error,`failed to get accounts owned by program ${t.toBase58()}`);return u.result}async getParsedProgramAccounts(t,e){const{commitment:r,config:n}=ZSt(e),i=this._buildArgs([t.toBase58()],r,"jsonParsed",n),o=xbt(await this._rpcRequest("getProgramAccounts",i),XSt(Rbt(C_t)));if("error"in o)throw new zSt(o.error,`failed to get accounts owned by program ${t.toBase58()}`);return o.result}async confirmTransaction(t,e){let r,n;if("string"==typeof t)r=t;else{var i;const e=t;if(null!==(i=e.abortSignal)&&void 0!==i&&i.aborted)return Promise.reject(e.abortSignal.reason);r=e.signature}try{n=xvt.decode(r)}catch(t){throw new Error("signature must be base58 encoded: "+r)}return dSt(64===n.length,"signature has invalid length"),"string"==typeof t?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:e||this.commitment,signature:r}):"lastValidBlockHeight"in t?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e||this.commitment,strategy:t}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:e||this.commitment,strategy:t})}getCancellationPromise(t){return new Promise(((e,r)=>{null!=t&&(t.aborted?r(t.reason):t.addEventListener("abort",(()=>{r(t.reason)})))}))}getTransactionConfirmationPromise({commitment:t,signature:e}){let r,n,i=!1;const o=new Promise(((o,s)=>{try{r=this.onSignature(e,((t,e)=>{r=void 0;const n={context:e,value:t};o({__type:ESt.PROCESSED,response:n})}),t);const a=new Promise((t=>{null==r?t():n=this._onSubscriptionStateChange(r,(e=>{"subscribed"===e&&t()}))}));(async()=>{if(await a,i)return;const r=await this.getSignatureStatus(e);if(i)return;if(null==r)return;const{context:n,value:c}=r;if(null!=c)if(null!=c&&c.err)s(c.err);else{switch(t){case"confirmed":case"single":case"singleGossip":if("processed"===c.confirmationStatus)return;break;case"finalized":case"max":case"root":if("processed"===c.confirmationStatus||"confirmed"===c.confirmationStatus)return}i=!0,o({__type:ESt.PROCESSED,response:{context:n,value:c}})}})()}catch(t){s(t)}}));return{abortConfirmation:()=>{n&&(n(),n=void 0),null!=r&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:o}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t,strategy:{abortSignal:e,lastValidBlockHeight:r,signature:n}}){let i=!1;const o=new Promise((e=>{const n=async()=>{try{return await this.getBlockHeight(t)}catch(t){return-1}};(async()=>{let t=await n();if(!i){for(;t<=r;){if(await ISt(1e3),i)return;if(t=await n(),i)return}e({__type:ESt.BLOCKHEIGHT_EXCEEDED})}})()})),{abortConfirmation:s,confirmationPromise:a}=this.getTransactionConfirmationPromise({commitment:t,signature:n}),c=this.getCancellationPromise(e);let u;try{const t=await Promise.race([c,a,o]);if(t.__type!==ESt.PROCESSED)throw new iSt(n);u=t.response}finally{i=!0,s()}return u}async confirmTransactionUsingDurableNonceStrategy({commitment:t,strategy:{abortSignal:e,minContextSlot:r,nonceAccountPubkey:n,nonceValue:i,signature:o}}){let s=!1;const a=new Promise((e=>{let o=i,a=null;const c=async()=>{try{const{context:e,value:i}=await this.getNonceAndContext(n,{commitment:t,minContextSlot:r});return a=e.slot,null==i?void 0:i.nonce}catch(t){return o}};(async()=>{if(o=await c(),!s)for(;;){if(i!==o)return void e({__type:ESt.NONCE_INVALID,slotInWhichNonceDidAdvance:a});if(await ISt(2e3),s)return;if(o=await c(),s)return}})()})),{abortConfirmation:c,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:t,signature:o}),f=this.getCancellationPromise(e);let h;try{const e=await Promise.race([f,u,a]);if(e.__type===ESt.PROCESSED)h=e.response;else{var l;let n;for(;;){var d;const t=await this.getSignatureStatus(o);if(null==t)break;if(!(t.context.slot<(null!==(d=e.slotInWhichNonceDidAdvance)&&void 0!==d?d:r))){n=t;break}await ISt(400)}if(null===(l=n)||void 0===l||!l.value)throw new sSt(o);{const e=t||"finalized",{confirmationStatus:r}=n.value;switch(e){case"processed":case"recent":if("processed"!==r&&"confirmed"!==r&&"finalized"!==r)throw new sSt(o);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==r&&"finalized"!==r)throw new sSt(o);break;case"finalized":case"max":case"root":if("finalized"!==r)throw new sSt(o)}h={context:n.context,value:{err:n.value.err}}}}}finally{s=!0,c()}return h}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:t,signature:e}){let r;const n=new Promise((e=>{let n=this._confirmTransactionInitialTimeout||6e4;switch(t){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":n=this._confirmTransactionInitialTimeout||3e4}r=setTimeout((()=>e({__type:ESt.TIMED_OUT,timeoutMs:n})),n)})),{abortConfirmation:i,confirmationPromise:o}=this.getTransactionConfirmationPromise({commitment:t,signature:e});let s;try{const t=await Promise.race([o,n]);if(t.__type!==ESt.PROCESSED)throw new oSt(e,t.timeoutMs/1e3);s=t.response}finally{clearTimeout(r),i()}return s}async getClusterNodes(){const t=xbt(await this._rpcRequest("getClusterNodes",[]),XSt(Rbt(V_t)));if("error"in t)throw new zSt(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(t){const e=this._buildArgs([],t),r=xbt(await this._rpcRequest("getVoteAccounts",e),G_t);if("error"in r)throw new zSt(r.error,"failed to get vote accounts");return r.result}async getSlot(t){const{commitment:e,config:r}=ZSt(t),n=this._buildArgs([],e,void 0,r),i=xbt(await this._rpcRequest("getSlot",n),XSt(Lbt()));if("error"in i)throw new zSt(i.error,"failed to get slot");return i.result}async getSlotLeader(t){const{commitment:e,config:r}=ZSt(t),n=this._buildArgs([],e,void 0,r),i=xbt(await this._rpcRequest("getSlotLeader",n),XSt(Ubt()));if("error"in i)throw new zSt(i.error,"failed to get slot leader");return i.result}async getSlotLeaders(t,e){const r=[t,e],n=xbt(await this._rpcRequest("getSlotLeaders",r),XSt(Rbt(VSt)));if("error"in n)throw new zSt(n.error,"failed to get slot leaders");return n.result}async getSignatureStatus(t,e){const{context:r,value:n}=await this.getSignatureStatuses([t],e);dSt(1===n.length);return{context:r,value:n[0]}}async getSignatureStatuses(t,e){const r=[t];e&&r.push(e);const n=xbt(await this._rpcRequest("getSignatureStatuses",r),Y_t);if("error"in n)throw new zSt(n.error,"failed to get signature status");return n.result}async getTransactionCount(t){const{commitment:e,config:r}=ZSt(t),n=this._buildArgs([],e,void 0,r),i=xbt(await this._rpcRequest("getTransactionCount",n),XSt(Lbt()));if("error"in i)throw new zSt(i.error,"failed to get transaction count");return i.result}async getTotalSupply(t){return(await this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(t){const e=this._buildArgs([],t),r=xbt(await this._rpcRequest("getInflationGovernor",e),g_t);if("error"in r)throw new zSt(r.error,"failed to get inflation");return r.result}async getInflationReward(t,e,r){const{commitment:n,config:i}=ZSt(r),o=this._buildArgs([t.map((t=>t.toBase58()))],n,void 0,{...i,epoch:null!=e?e:null==i?void 0:i.epoch}),s=xbt(await this._rpcRequest("getInflationReward",o),n_t);if("error"in s)throw new zSt(s.error,"failed to get inflation reward");return s.result}async getInflationRate(){const t=xbt(await this._rpcRequest("getInflationRate",[]),y_t);if("error"in t)throw new zSt(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(t){const{commitment:e,config:r}=ZSt(t),n=this._buildArgs([],e,void 0,r),i=xbt(await this._rpcRequest("getEpochInfo",n),v_t);if("error"in i)throw new zSt(i.error,"failed to get epoch info");return i.result}async getEpochSchedule(){const t=xbt(await this._rpcRequest("getEpochSchedule",[]),w_t);if("error"in t)throw new zSt(t.error,"failed to get epoch schedule");const e=t.result;return new jSt(e.slotsPerEpoch,e.leaderScheduleSlotOffset,e.warmup,e.firstNormalEpoch,e.firstNormalSlot)}async getLeaderSchedule(){const t=xbt(await this._rpcRequest("getLeaderSchedule",[]),b_t);if("error"in t)throw new zSt(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(t,e){const r=this._buildArgs([t],e),n=xbt(await this._rpcRequest("getMinimumBalanceForRentExemption",r),X_t);return"error"in n?(console.warn("Unable to fetch minimum balance for rent exemption"),0):n.result}async getRecentBlockhashAndContext(t){const e=this._buildArgs([],t),r=xbt(await this._rpcRequest("getRecentBlockhash",e),_At);if("error"in r)throw new zSt(r.error,"failed to get recent blockhash");return r.result}async getRecentPerformanceSamples(t){const e=xbt(await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),IAt);if("error"in e)throw new zSt(e.error,"failed to get recent performance samples");return e.result}async getFeeCalculatorForBlockhash(t,e){const r=this._buildArgs([t],e),n=xbt(await this._rpcRequest("getFeeCalculatorForBlockhash",r),kAt);if("error"in n)throw new zSt(n.error,"failed to get fee calculator");const{context:i,value:o}=n.result;return{context:i,value:null!==o?o.feeCalculator:null}}async getFeeForMessage(t,e){const r=JEt(t.serialize()).toString("base64"),n=this._buildArgs([r],e),i=xbt(await this._rpcRequest("getFeeForMessage",n),QSt(Cbt(Lbt())));if("error"in i)throw new zSt(i.error,"failed to get fee for message");if(null===i.result)throw new Error("invalid blockhash");return i.result}async getRecentPrioritizationFees(t){var e;const r=null==t||null===(e=t.lockedWritableAccounts)||void 0===e?void 0:e.map((t=>t.toBase58())),n=null!=r&&r.length?[r]:[],i=xbt(await this._rpcRequest("getRecentPrioritizationFees",n),m_t);if("error"in i)throw new zSt(i.error,"failed to get recent prioritization fees");return i.result}async getRecentBlockhash(t){try{return(await this.getRecentBlockhashAndContext(t)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(t){try{return(await this.getLatestBlockhashAndContext(t)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(t){const{commitment:e,config:r}=ZSt(t),n=this._buildArgs([],e,void 0,r),i=xbt(await this._rpcRequest("getLatestBlockhash",n),AAt);if("error"in i)throw new zSt(i.error,"failed to get latest blockhash");return i.result}async isBlockhashValid(t,e){const{commitment:r,config:n}=ZSt(e),i=this._buildArgs([t],r,void 0,n),o=xbt(await this._rpcRequest("isBlockhashValid",i),xAt);if("error"in o)throw new zSt(o.error,"failed to determine if the blockhash `"+t+"`is valid");return o.result}async getVersion(){const t=xbt(await this._rpcRequest("getVersion",[]),XSt(l_t));if("error"in t)throw new zSt(t.error,"failed to get version");return t.result}async getGenesisHash(){const t=xbt(await this._rpcRequest("getGenesisHash",[]),XSt(Ubt()));if("error"in t)throw new zSt(t.error,"failed to get genesis hash");return t.result}async getBlock(t,e){const{commitment:r,config:n}=ZSt(e),i=this._buildArgsAtLeastConfirmed([t],r,void 0,n),o=await this._rpcRequest("getBlock",i);try{switch(null==n?void 0:n.transactionDetails){case"accounts":{const t=xbt(o,gAt);if("error"in t)throw t.error;return t.result}case"none":{const t=xbt(o,pAt);if("error"in t)throw t.error;return t.result}default:{const t=xbt(o,dAt);if("error"in t)throw t.error;const{result:e}=t;return e?{...e,transactions:e.transactions.map((({transaction:t,meta:e,version:r})=>({meta:e,transaction:{...t,message:e_t(r,t.message)},version:r})))}:null}}}catch(t){throw new zSt(t,"failed to get confirmed block")}}async getParsedBlock(t,e){const{commitment:r,config:n}=ZSt(e),i=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n),o=await this._rpcRequest("getBlock",i);try{switch(null==n?void 0:n.transactionDetails){case"accounts":{const t=xbt(o,mAt);if("error"in t)throw t.error;return t.result}case"none":{const t=xbt(o,vAt);if("error"in t)throw t.error;return t.result}default:{const t=xbt(o,yAt);if("error"in t)throw t.error;return t.result}}}catch(t){throw new zSt(t,"failed to get block")}}async getBlockProduction(t){let e,r;if("string"==typeof t)r=t;else if(t){const{commitment:n,...i}=t;r=n,e=i}const n=this._buildArgs([],r,"base64",e),i=xbt(await this._rpcRequest("getBlockProduction",n),p_t);if("error"in i)throw new zSt(i.error,"failed to get block production information");return i.result}async getTransaction(t,e){const{commitment:r,config:n}=ZSt(e),i=this._buildArgsAtLeastConfirmed([t],r,void 0,n),o=xbt(await this._rpcRequest("getTransaction",i),EAt);if("error"in o)throw new zSt(o.error,"failed to get transaction");const s=o.result;return s?{...s,transaction:{...s.transaction,message:e_t(s.version,s.transaction.message)}}:s}async getParsedTransaction(t,e){const{commitment:r,config:n}=ZSt(e),i=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n),o=xbt(await this._rpcRequest("getTransaction",i),SAt);if("error"in o)throw new zSt(o.error,"failed to get transaction");return o.result}async getParsedTransactions(t,e){const{commitment:r,config:n}=ZSt(e),i=t.map((t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n)})));return(await this._rpcBatchRequest(i)).map((t=>{const e=xbt(t,SAt);if("error"in e)throw new zSt(e.error,"failed to get transactions");return e.result}))}async getTransactions(t,e){const{commitment:r,config:n}=ZSt(e),i=t.map((t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,void 0,n)})));return(await this._rpcBatchRequest(i)).map((t=>{const e=xbt(t,EAt);if("error"in e)throw new zSt(e.error,"failed to get transactions");const r=e.result;return r?{...r,transaction:{...r.transaction,message:e_t(r.version,r.transaction.message)}}:r}))}async getConfirmedBlock(t,e){const r=this._buildArgsAtLeastConfirmed([t],e),n=xbt(await this._rpcRequest("getConfirmedBlock",r),wAt);if("error"in n)throw new zSt(n.error,"failed to get confirmed block");const i=n.result;if(!i)throw new Error("Confirmed block "+t+" not found");const o={...i,transactions:i.transactions.map((({transaction:t,meta:e})=>{const r=new vSt(t.message);return{meta:e,transaction:{...t,message:r}}}))};return{...o,transactions:o.transactions.map((({transaction:t,meta:e})=>({meta:e,transaction:ASt.populate(t.message,t.signatures)})))}}async getBlocks(t,e,r){const n=this._buildArgsAtLeastConfirmed(void 0!==e?[t,e]:[t],r),i=xbt(await this._rpcRequest("getBlocks",n),XSt(Rbt(Lbt())));if("error"in i)throw new zSt(i.error,"failed to get blocks");return i.result}async getBlockSignatures(t,e){const r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),n=xbt(await this._rpcRequest("getBlock",r),bAt);if("error"in n)throw new zSt(n.error,"failed to get block");const i=n.result;if(!i)throw new Error("Block "+t+" not found");return i}async getConfirmedBlockSignatures(t,e){const r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),n=xbt(await this._rpcRequest("getConfirmedBlock",r),bAt);if("error"in n)throw new zSt(n.error,"failed to get confirmed block");const i=n.result;if(!i)throw new Error("Confirmed block "+t+" not found");return i}async getConfirmedTransaction(t,e){const r=this._buildArgsAtLeastConfirmed([t],e),n=xbt(await this._rpcRequest("getConfirmedTransaction",r),EAt);if("error"in n)throw new zSt(n.error,"failed to get transaction");const i=n.result;if(!i)return i;const o=new vSt(i.transaction.message),s=i.transaction.signatures;return{...i,transaction:ASt.populate(o,s)}}async getParsedConfirmedTransaction(t,e){const r=this._buildArgsAtLeastConfirmed([t],e,"jsonParsed"),n=xbt(await this._rpcRequest("getConfirmedTransaction",r),SAt);if("error"in n)throw new zSt(n.error,"failed to get confirmed transaction");return n.result}async getParsedConfirmedTransactions(t,e){const r=t.map((t=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([t],e,"jsonParsed")})));return(await this._rpcBatchRequest(r)).map((t=>{const e=xbt(t,SAt);if("error"in e)throw new zSt(e.error,"failed to get confirmed transactions");return e.result}))}async getConfirmedSignaturesForAddress(t,e,r){let n={},i=await this.getFirstAvailableBlock();for(;!("until"in n)&&!(--e<=0||e0&&(n.until=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}let o=await this.getSlot("finalized");for(;!("before"in n||++r>o);)try{const t=await this.getConfirmedBlockSignatures(r);t.signatures.length>0&&(n.before=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}return(await this.getConfirmedSignaturesForAddress2(t,n)).map((t=>t.signature))}async getConfirmedSignaturesForAddress2(t,e,r){const n=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),i=xbt(await this._rpcRequest("getConfirmedSignaturesForAddress2",n),P_t);if("error"in i)throw new zSt(i.error,"failed to get confirmed signatures for address");return i.result}async getSignaturesForAddress(t,e,r){const n=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),i=xbt(await this._rpcRequest("getSignaturesForAddress",n),N_t);if("error"in i)throw new zSt(i.error,"failed to get signatures for address");return i.result}async getAddressLookupTable(t,e){const{context:r,value:n}=await this.getAccountInfoAndContext(t,e);let i=null;return null!==n&&(i=new $St({key:t,state:$St.deserialize(n.data)})),{context:r,value:i}}async getNonceAndContext(t,e){const{context:r,value:n}=await this.getAccountInfoAndContext(t,e);let i=null;return null!==n&&(i=RSt.fromAccountData(n.data)),{context:r,value:i}}async getNonce(t,e){return await this.getNonceAndContext(t,e).then((t=>t.value)).catch((e=>{throw new Error("failed to get nonce for account "+t.toBase58()+": "+e)}))}async requestAirdrop(t,e){const r=xbt(await this._rpcRequest("requestAirdrop",[t.toBase58(),e]),TAt);if("error"in r)throw new zSt(r.error,`airdrop to ${t.toBase58()} failed`);return r.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await ISt(100);const t=Date.now()-this._blockhashInfo.lastFetch>=3e4;if(null!==this._blockhashInfo.latestBlockhash&&!t)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const t=Date.now(),e=this._blockhashInfo.latestBlockhash,r=e?e.blockhash:null;for(let t=0;t<50;t++){const t=await this.getLatestBlockhash("finalized");if(r!==t.blockhash)return this._blockhashInfo={latestBlockhash:t,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},t;await ISt(200)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-t}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(t){const{commitment:e,config:r}=ZSt(t),n=this._buildArgs([],e,"base64",r),i=xbt(await this._rpcRequest("getStakeMinimumDelegation",n),QSt(Lbt()));if("error"in i)throw new zSt(i.error,"failed to get stake minimum delegation");return i.result}async simulateTransaction(t,e,r){if("message"in t){const n=t.serialize(),i=pgt.from(n).toString("base64");if(Array.isArray(e)||void 0!==r)throw new Error("Invalid arguments");const o=e||{};o.encoding="base64","commitment"in o||(o.commitment=this.commitment);const s=[i,o],a=xbt(await this._rpcRequest("simulateTransaction",s),d_t);if("error"in a)throw new Error("failed to simulate transaction: "+a.error.message);return a.result}let n;if(t instanceof ASt){let e=t;n=new ASt,n.feePayer=e.feePayer,n.instructions=t.instructions,n.nonceInfo=e.nonceInfo,n.signatures=e.signatures}else n=ASt.populate(t),n._message=n._json=void 0;if(void 0!==e&&!Array.isArray(e))throw new Error("Invalid arguments");const i=e;if(n.nonceInfo&&i)n.sign(...i);else{let t=this._disableBlockhashCaching;for(;;){const e=await this._blockhashWithExpiryBlockHeight(t);if(n.lastValidBlockHeight=e.lastValidBlockHeight,n.recentBlockhash=e.blockhash,!i)break;if(n.sign(...i),!n.signature)throw new Error("!signature");const r=n.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(r)&&!this._blockhashInfo.transactionSignatures.includes(r)){this._blockhashInfo.simulatedSignatures.push(r);break}t=!0}}const o=n._compile(),s=o.serialize(),a=n._serialize(s).toString("base64"),c={encoding:"base64",commitment:this.commitment};if(r){const t=(Array.isArray(r)?r:o.nonProgramIds()).map((t=>t.toBase58()));c.accounts={encoding:"base64",addresses:t}}i&&(c.sigVerify=!0);const u=[a,c],f=xbt(await this._rpcRequest("simulateTransaction",u),d_t);if("error"in f){let t;if("data"in f.error&&(t=f.error.data.logs,t&&Array.isArray(t))){const e="\n ",r=e+t.join(e);console.error(f.error.message,r)}throw new DSt("failed to simulate transaction: "+f.error.message,t)}return f.result}async sendTransaction(t,e,r){if("version"in t){if(e&&Array.isArray(e))throw new Error("Invalid arguments");const r=t.serialize();return await this.sendRawTransaction(r,e)}if(void 0===e||!Array.isArray(e))throw new Error("Invalid arguments");const n=e;if(t.nonceInfo)t.sign(...n);else{let e=this._disableBlockhashCaching;for(;;){const r=await this._blockhashWithExpiryBlockHeight(e);if(t.lastValidBlockHeight=r.lastValidBlockHeight,t.recentBlockhash=r.blockhash,t.sign(...n),!t.signature)throw new Error("!signature");const i=t.signature.toString("base64");if(!this._blockhashInfo.transactionSignatures.includes(i)){this._blockhashInfo.transactionSignatures.push(i);break}e=!0}}const i=t.serialize();return await this.sendRawTransaction(i,r)}async sendRawTransaction(t,e){const r=JEt(t).toString("base64");return await this.sendEncodedTransaction(r,e)}async sendEncodedTransaction(t,e){const r={encoding:"base64"},n=e&&e.skipPreflight,i=!0===n?"processed":e&&e.preflightCommitment||this.commitment;e&&null!=e.maxRetries&&(r.maxRetries=e.maxRetries),e&&null!=e.minContextSlot&&(r.minContextSlot=e.minContextSlot),n&&(r.skipPreflight=n),i&&(r.preflightCommitment=i);const o=[t,r],s=xbt(await this._rpcRequest("sendTransaction",o),RAt);if("error"in s){let t;throw"data"in s.error&&(t=s.error.data.logs),new DSt("failed to send transaction: "+s.error.message,t)}return s.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()}),5e3),this._updateSubscriptions()}_wsOnError(t){this._rpcWebSocketConnected=!1,console.error("ws error:",t.message)}_wsOnClose(t){this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==t?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((([t,e])=>{this._setSubscription(t,{...e,state:"pending"})}))):this._updateSubscriptions()}_setSubscription(t,e){var r;const n=null===(r=this._subscriptionsByHash[t])||void 0===r?void 0:r.state;if(this._subscriptionsByHash[t]=e,n!==e.state){const r=this._subscriptionStateChangeCallbacksByHash[t];r&&r.forEach((t=>{try{t(e.state)}catch{}}))}}_onSubscriptionStateChange(t,e){var r;const n=this._subscriptionHashByClientSubscriptionId[t];if(null==n)return()=>{};const i=(r=this._subscriptionStateChangeCallbacksByHash)[n]||(r[n]=new Set);return i.add(e),()=>{i.delete(e),0===i.size&&delete this._subscriptionStateChangeCallbacksByHash[n]}}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length)return void(this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(t){t instanceof Error&&console.log(`Error when closing socket connection: ${t.message}`)}}),500)));if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();const t=this._rpcWebSocketGeneration,e=()=>t===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map((async t=>{const r=this._subscriptionsByHash[t];if(void 0!==r)switch(r.state){case"pending":case"unsubscribed":if(0===r.callbacks.size)return delete this._subscriptionsByHash[t],"unsubscribed"===r.state&&delete this._subscriptionCallbacksByServerSubscriptionId[r.serverSubscriptionId],void await this._updateSubscriptions();await(async()=>{const{args:n,method:i}=r;try{this._setSubscription(t,{...r,state:"subscribing"});const e=await this._rpcWebSocket.call(i,n);this._setSubscription(t,{...r,serverSubscriptionId:e,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[e]=r.callbacks,await this._updateSubscriptions()}catch(o){if(o instanceof Error&&console.error(`${i} error for argument`,n,o.message),!e())return;this._setSubscription(t,{...r,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":0===r.callbacks.size&&await(async()=>{const{serverSubscriptionId:n,unsubscribeMethod:i}=r;if(this._subscriptionsAutoDisposedByRpc.has(n))this._subscriptionsAutoDisposedByRpc.delete(n);else{this._setSubscription(t,{...r,state:"unsubscribing"}),this._setSubscription(t,{...r,state:"unsubscribing"});try{await this._rpcWebSocket.call(i,[n])}catch(n){if(n instanceof Error&&console.error(`${i} error:`,n.message),!e())return;return this._setSubscription(t,{...r,state:"subscribed"}),void await this._updateSubscriptions()}}this._setSubscription(t,{...r,state:"unsubscribed"}),await this._updateSubscriptions()})()}})))}_handleServerNotification(t,e){const r=this._subscriptionCallbacksByServerSubscriptionId[t];void 0!==r&&r.forEach((t=>{try{t(...e)}catch(t){console.error(t)}}))}_wsOnAccountNotification(t){const{result:e,subscription:r}=xbt(t,U_t);this._handleServerNotification(r,[e.value,e.context])}_makeSubscription(t,e){const r=this._nextClientSubscriptionId++,n=NSt([t.method,e]),i=this._subscriptionsByHash[n];return void 0===i?this._subscriptionsByHash[n]={...t,args:e,callbacks:new Set([t.callback]),state:"pending"}:i.callbacks.add(t.callback),this._subscriptionHashByClientSubscriptionId[r]=n,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];const e=this._subscriptionsByHash[n];dSt(void 0!==e,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),e.callbacks.delete(t.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(t,e,r){const n=this._buildArgs([t.toBase58()],r||this._commitment||"finalized","base64");return this._makeSubscription({callback:e,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},n)}async removeAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"account change")}_wsOnProgramAccountNotification(t){const{result:e,subscription:r}=xbt(t,D_t);this._handleServerNotification(r,[{accountId:e.value.pubkey,accountInfo:e.value.account},e.context])}onProgramAccountChange(t,e,r,n){const i=this._buildArgs([t.toBase58()],r||this._commitment||"finalized","base64",n?{filters:n}:void 0);return this._makeSubscription({callback:e,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}async removeProgramAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"program account change")}onLogs(t,e,r){const n=this._buildArgs(["object"==typeof t?{mentions:[t.toString()]}:t],r||this._commitment||"finalized");return this._makeSubscription({callback:e,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},n)}async removeOnLogsListener(t){await this._unsubscribeClientSubscription(t,"logs")}_wsOnLogsNotification(t){const{result:e,subscription:r}=xbt(t,OAt);this._handleServerNotification(r,[e.value,e.context])}_wsOnSlotNotification(t){const{result:e,subscription:r}=xbt(t,F_t);this._handleServerNotification(r,[e])}onSlotChange(t){return this._makeSubscription({callback:t,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(t){await this._unsubscribeClientSubscription(t,"slot change")}_wsOnSlotUpdatesNotification(t){const{result:e,subscription:r}=xbt(t,$_t);this._handleServerNotification(r,[e])}onSlotUpdate(t){return this._makeSubscription({callback:t,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(t){await this._unsubscribeClientSubscription(t,"slot update")}async _unsubscribeClientSubscription(t,e){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${t}\` for '${e}' events could not be found.`)}_buildArgs(t,e,r,n){const i=e||this._commitment;if(i||r||n){let e={};r&&(e.encoding=r),i&&(e.commitment=i),n&&(e=Object.assign(e,n)),t.push(e)}return t}_buildArgsAtLeastConfirmed(t,e,r,n){const i=e||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(t,e,r,n)}_wsOnSignatureNotification(t){const{result:e,subscription:r}=xbt(t,q_t);"receivedSignature"!==e.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===e.value?[{type:"received"},e.context]:[{type:"status",result:e.value},e.context])}onSignature(t,e,r){const n=this._buildArgs([t],r||this._commitment||"finalized"),i=this._makeSubscription({callback:(t,r)=>{if("status"===t.type){e(t.result,r);try{this.removeSignatureListener(i)}catch(t){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},n);return i}onSignatureWithOptions(t,e,r){const{commitment:n,...i}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([t],n,void 0,i),s=this._makeSubscription({callback:(t,r)=>{e(t,r);try{this.removeSignatureListener(s)}catch(t){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return s}async removeSignatureListener(t){await this._unsubscribeClientSubscription(t,"signature result")}_wsOnRootNotification(t){const{result:e,subscription:r}=xbt(t,W_t);this._handleServerNotification(r,[e])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}}var LAt;Object.freeze({CreateLookupTable:{index:0,layout:hbt([cbt("instruction"),BSt("recentSlot"),sbt("bumpSeed")])},FreezeLookupTable:{index:1,layout:hbt([cbt("instruction")])},ExtendLookupTable:{index:2,layout:hbt([cbt("instruction"),BSt(),lbt(cSt(),obt(cbt(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:hbt([cbt("instruction")])},CloseLookupTable:{index:4,layout:hbt([cbt("instruction")])}}),new rSt("AddressLookupTab1e1111111111111111111111111"),Object.freeze({RequestUnits:{index:0,layout:hbt([sbt("instruction"),cbt("units"),cbt("additionalFee")])},RequestHeapFrame:{index:1,layout:hbt([sbt("instruction"),cbt("bytes")])},SetComputeUnitLimit:{index:2,layout:hbt([sbt("instruction"),cbt("units")])},SetComputeUnitPrice:{index:3,layout:hbt([sbt("instruction"),BSt("microLamports")])}}),new rSt("ComputeBudget111111111111111111111111111111"),hbt([sbt("numSignatures"),sbt("padding"),abt("signatureOffset"),abt("signatureInstructionIndex"),abt("publicKeyOffset"),abt("publicKeyInstructionIndex"),abt("messageDataOffset"),abt("messageDataSize"),abt("messageInstructionIndex")]),new rSt("Ed25519SigVerify111111111111111111111111111"),VEt.utils.isValidPrivateKey,VEt.getPublicKey,hbt([sbt("numSignatures"),abt("signatureOffset"),sbt("signatureInstructionIndex"),abt("ethAddressOffset"),sbt("ethAddressInstructionIndex"),abt("messageDataOffset"),abt("messageDataSize"),sbt("messageInstructionIndex"),dbt(20,"ethAddress"),dbt(64,"signature"),sbt("recoveryId")]),new rSt("KeccakSecp256k11111111111111111111111111111"),new rSt("StakeConfig11111111111111111111111111111111");class PAt{constructor(t,e,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=r}}LAt=PAt,PAt.default=new LAt(0,0,rSt.default),Object.freeze({Initialize:{index:0,layout:hbt([cbt("instruction"),((t="authorized")=>hbt([cSt("staker"),cSt("withdrawer")],t))(),((t="lockup")=>hbt([fbt("unixTimestamp"),fbt("epoch"),cSt("custodian")],t))()])},Authorize:{index:1,layout:hbt([cbt("instruction"),cSt("newAuthorized"),cbt("stakeAuthorizationType")])},Delegate:{index:2,layout:hbt([cbt("instruction")])},Split:{index:3,layout:hbt([cbt("instruction"),fbt("lamports")])},Withdraw:{index:4,layout:hbt([cbt("instruction"),fbt("lamports")])},Deactivate:{index:5,layout:hbt([cbt("instruction")])},Merge:{index:7,layout:hbt([cbt("instruction")])},AuthorizeWithSeed:{index:8,layout:hbt([cbt("instruction"),cSt("newAuthorized"),cbt("stakeAuthorizationType"),fSt("authoritySeed"),cSt("authorityOwner")])}}),Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),new rSt("Stake11111111111111111111111111111111111111"),Object.freeze({InitializeAccount:{index:0,layout:hbt([cbt("instruction"),((t="voteInit")=>hbt([cSt("nodePubkey"),cSt("authorizedVoter"),cSt("authorizedWithdrawer"),sbt("commission")],t))()])},Authorize:{index:1,layout:hbt([cbt("instruction"),cSt("newAuthorized"),cbt("voteAuthorizationType")])},Withdraw:{index:3,layout:hbt([cbt("instruction"),fbt("lamports")])},UpdateValidatorIdentity:{index:4,layout:hbt([cbt("instruction")])},AuthorizeWithSeed:{index:10,layout:hbt([cbt("instruction"),((t="voteAuthorizeWithSeedArgs")=>hbt([cbt("voteAuthorizationType"),cSt("currentAuthorityDerivedKeyOwnerPubkey"),fSt("currentAuthorityDerivedKeySeed"),cSt("newAuthorized")],t))()])}}),Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),new rSt("Vote111111111111111111111111111111111111111"),new rSt("Va1idator1nfo111111111111111111111111111111"),Dbt({name:Ubt(),website:Pbt(Ubt()),details:Pbt(Ubt()),keybaseUsername:Pbt(Ubt())}),new rSt("Vote111111111111111111111111111111111111111"),hbt([cSt("nodePubkey"),cSt("authorizedWithdrawer"),sbt("commission"),ubt(),lbt(hbt([ubt("slot"),cbt("confirmationCount")]),obt(cbt(),-8),"votes"),sbt("rootSlotValid"),ubt("rootSlot"),ubt(),lbt(hbt([ubt("epoch"),cSt("authorizedVoter")]),obt(cbt(),-8),"authorizedVoters"),hbt([lbt(hbt([cSt("authorizedPubkey"),ubt("epochOfLastAuthorizedSwitch"),ubt("targetEpoch")]),32,"buf"),ubt("idx"),sbt("isEmpty")],"priorVoters"),ubt(),lbt(hbt([ubt("epoch"),ubt("credits"),ubt("prevCredits")]),obt(cbt(),-8),"epochCredits"),hbt([ubt("slot"),ubt("timestamp")],"lastTimestamp")]);const NAt="solana:signAndSendTransaction",UAt="solana:signIn",jAt="solana:signMessage",DAt="solana:signTransaction",zAt="standard:connect",FAt="standard:disconnect",HAt="standard:events";var $At,qAt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};class WAt extends Event{constructor(t){super("wallet-standard:register-wallet",{bubbles:!1,cancelable:!1,composed:!1}),((t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)})(this,$At,void 0),((t,e,r,n)=>{qAt(t,e,"write to private field"),n?n.call(t,r):e.set(t,r)})(this,$At,t)}get detail(){return((t,e,r)=>(qAt(t,e,"read from private field"),r?r.call(t):e.get(t)))(this,$At)}get type(){return"wallet-standard:register-wallet"}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}function VAt(t){!function(t){const e=({register:e})=>e(t);try{window.dispatchEvent(new WAt(e))}catch(t){console.error("wallet-standard:register-wallet event could not be dispatched\n",t)}try{window.addEventListener("wallet-standard:app-ready",(({detail:t})=>e(t)))}catch(t){console.error("wallet-standard:app-ready event listener could not be added\n",t)}}(t.getInstanceWithAdapter())}$At=new WeakMap;const KAt=["solana:mainnet"];function GAt(t){return KAt.includes(t)}function ZAt(t){return"version"in t}var JAt,YAt,XAt,QAt,txt,ext,rxt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},nxt=(t,e,r)=>(rxt(t,e,"read from private field"),r?r.call(t):e.get(t)),ixt=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},oxt=(t,e,r,n)=>(rxt(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);const sxt=KAt,axt=[NAt,DAt,jAt],cxt=class{constructor({address:t,publicKey:e,label:r,icon:n}){ixt(this,JAt,void 0),ixt(this,YAt,void 0),ixt(this,XAt,void 0),ixt(this,QAt,void 0),ixt(this,txt,void 0),ixt(this,ext,void 0),new.target===cxt&&Object.freeze(this),oxt(this,JAt,t),oxt(this,YAt,e),oxt(this,XAt,sxt),oxt(this,QAt,axt),oxt(this,txt,r),oxt(this,ext,n)}get address(){return nxt(this,JAt)}get publicKey(){return nxt(this,YAt).slice()}get chains(){return nxt(this,XAt).slice()}get features(){return nxt(this,QAt).slice()}get label(){return nxt(this,txt)}get icon(){return nxt(this,ext)}};let uxt=cxt;JAt=new WeakMap,YAt=new WeakMap,XAt=new WeakMap,QAt=new WeakMap,txt=new WeakMap,ext=new WeakMap;var fxt,hxt,lxt,dxt,pxt,gxt,yxt,mxt,vxt,wxt,bxt,Ext,Sxt,_xt,Axt,xxt,Ixt,kxt,Txt,Rxt,Bxt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Oxt=(t,e,r)=>(Bxt(t,e,"read from private field"),r?r.call(t):e.get(t)),Mxt=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Cxt=(t,e,r,n)=>(Bxt(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Lxt=(t,e,r)=>(Bxt(t,e,"access private method"),r);const Pxt="trust:",Nxt=class{constructor(t){Mxt(this,mxt),Mxt(this,wxt),Mxt(this,fxt,{}),Mxt(this,hxt,"1.0.0"),Mxt(this,lxt,"Trust"),Mxt(this,dxt,"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTgiIGhlaWdodD0iNjUiIHZpZXdCb3g9IjAgMCA1OCA2NSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgOS4zODk0OUwyOC44OTA3IDBWNjUuMDA0MkM4LjI1NDUgNTYuMzM2OSAwIDM5LjcyNDggMCAzMC4zMzUzVjkuMzg5NDlaIiBmaWxsPSIjMDUwMEZGIi8+CjxwYXRoIGQ9Ik01Ny43ODIyIDkuMzg5NDlMMjguODkxNSAwVjY1LjAwNDJDNDkuNTI3NyA1Ni4zMzY5IDU3Ljc4MjIgMzkuNzI0OCA1Ny43ODIyIDMwLjMzNTNWOS4zODk0OVoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8yMjAxXzY5NDIpIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMjIwMV82OTQyIiB4MT0iNTEuMzYxNSIgeTE9Ii00LjE1MjkzIiB4Mj0iMjkuNTM4NCIgeTI9IjY0LjUxNDciIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agb2Zmc2V0PSIwLjAyMTEyIiBzdG9wLWNvbG9yPSIjMDAwMEZGIi8+CjxzdG9wIG9mZnNldD0iMC4wNzYyNDIzIiBzdG9wLWNvbG9yPSIjMDA5NEZGIi8+CjxzdG9wIG9mZnNldD0iMC4xNjMwODkiIHN0b3AtY29sb3I9IiM0OEZGOTEiLz4KPHN0b3Agb2Zmc2V0PSIwLjQyMDA0OSIgc3RvcC1jb2xvcj0iIzAwOTRGRiIvPgo8c3RvcCBvZmZzZXQ9IjAuNjgyODg2IiBzdG9wLWNvbG9yPSIjMDAzOEZGIi8+CjxzdG9wIG9mZnNldD0iMC45MDI0NjUiIHN0b3AtY29sb3I9IiMwNTAwRkYiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K"),Mxt(this,pxt,null),Mxt(this,gxt,void 0),Mxt(this,yxt,((t,e)=>{var r;return null!=(r=Oxt(this,fxt)[t])&&r.push(e)||(Oxt(this,fxt)[t]=[e]),()=>Lxt(this,wxt,bxt).call(this,t,e)})),Mxt(this,Ext,(()=>{var t;const e=null==(t=Oxt(this,gxt).publicKey)?void 0:t.toBase58();if(e){const t=Oxt(this,gxt).publicKey.toBytes(),r=Oxt(this,pxt);(!r||r.address!==e||!function(t,e){return function(t,e){if(t===e)return!0;const r=t.length;if(r!==e.length)return!1;for(let n=0;n{Oxt(this,pxt)&&(Cxt(this,pxt,null),Lxt(this,mxt,vxt).call(this,"change",{accounts:this.accounts}))})),Mxt(this,_xt,(()=>{Oxt(this,gxt).publicKey?Oxt(this,Ext).call(this):Oxt(this,Sxt).call(this)})),Mxt(this,Axt,(async({silent:t}={})=>(Oxt(this,pxt)||await Oxt(this,gxt).connect(t?{onlyIfTrusted:!0}:void 0),Oxt(this,Ext).call(this),{accounts:this.accounts}))),Mxt(this,xxt,(async()=>{await Oxt(this,gxt).disconnect()})),Mxt(this,Ixt,(async(...t)=>{if(!Oxt(this,pxt))throw new Error("not connected");const e=[];if(1===t.length){const{transaction:r,account:n,chain:i,options:o}=t[0],{minContextSlot:s,preflightCommitment:a,skipPreflight:c,maxRetries:u}=o||{};if(n!==Oxt(this,pxt))throw new Error("invalid account");if(!GAt(i))throw new Error("invalid chain");const{signature:f}=await Oxt(this,gxt).signAndSendTransaction(xSt.deserialize(r),{preflightCommitment:a,minContextSlot:s,maxRetries:u,skipPreflight:c});e.push({signature:new Uint8Array(xvt.decode(f))})}else if(t.length>1)for(const r of t)e.push(...await Oxt(this,Ixt).call(this,r));return e})),Mxt(this,kxt,(async(...t)=>{if(!Oxt(this,pxt))throw new Error("not connected");const e=[];if(1===t.length){const{transaction:r,account:n,chain:i}=t[0];if(n!==Oxt(this,pxt))throw new Error("invalid account");if(i&&!GAt(i))throw new Error("invalid chain");const o=await Oxt(this,gxt).signTransaction(xSt.deserialize(r)),s=ZAt(o)?o.serialize():new Uint8Array(o.serialize({requireAllSignatures:!1,verifySignatures:!1}));e.push({signedTransaction:s})}else if(t.length>1){let r;for(const e of t){if(e.account!==Oxt(this,pxt))throw new Error("invalid account");if(e.chain){if(!GAt(e.chain))throw new Error("invalid chain");if(r){if(e.chain!==r)throw new Error("conflicting chain")}else r=e.chain}}const n=t.map((({transaction:t})=>xSt.deserialize(t))),i=await Oxt(this,gxt).signAllTransactions(n);e.push(...i.map((t=>({signedTransaction:ZAt(t)?t.serialize():new Uint8Array(t.serialize({requireAllSignatures:!1,verifySignatures:!1}))}))))}return e})),Mxt(this,Txt,(async(...t)=>{if(!Oxt(this,pxt))throw new Error("not connected");const e=[];if(1===t.length){const{message:r,account:n}=t[0];if(n!==Oxt(this,pxt))throw new Error("invalid account");const{signature:i}=await Oxt(this,gxt).signMessage(r);e.push({signedMessage:r,signature:i})}else if(t.length>1)for(const r of t)e.push(...await Oxt(this,Txt).call(this,r));return e})),Mxt(this,Rxt,(async(...t)=>{const e=[];if(!(t.length>1))return[await Oxt(this,gxt).signIn(t[0])];for(const r of t)e.push(await Oxt(this,gxt).signIn(r));return e})),new.target===Nxt&&Object.freeze(this),Cxt(this,gxt,t),t.on("connect",Oxt(this,Ext),this),t.on("disconnect",Oxt(this,Sxt),this),t.on("accountChanged",Oxt(this,_xt),this),Oxt(this,Ext).call(this)}get version(){return Oxt(this,hxt)}get name(){return Oxt(this,lxt)}get icon(){return Oxt(this,dxt)}get chains(){return KAt.slice()}get features(){return{[zAt]:{version:"1.0.0",connect:Oxt(this,Axt)},[FAt]:{version:"1.0.0",disconnect:Oxt(this,xxt)},[HAt]:{version:"1.0.0",on:Oxt(this,yxt)},[NAt]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:Oxt(this,Ixt)},[DAt]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:Oxt(this,kxt)},[jAt]:{version:"1.0.0",signMessage:Oxt(this,Txt)},[UAt]:{version:"1.0.0",signIn:Oxt(this,Rxt)},[Pxt]:{trust:Oxt(this,gxt)}}}get accounts(){return Oxt(this,pxt)?[Oxt(this,pxt)]:[]}};let Uxt=Nxt;fxt=new WeakMap,hxt=new WeakMap,lxt=new WeakMap,dxt=new WeakMap,pxt=new WeakMap,gxt=new WeakMap,yxt=new WeakMap,mxt=new WeakSet,vxt=function(t,...e){var r;null==(r=Oxt(this,fxt)[t])||r.forEach((t=>t.apply(null,e)))},wxt=new WeakSet,bxt=function(t,e){var r;Oxt(this,fxt)[t]=null==(r=Oxt(this,fxt)[t])?void 0:r.filter((t=>e!==t))},Ext=new WeakMap,Sxt=new WeakMap,_xt=new WeakMap,Axt=new WeakMap,xxt=new WeakMap,Ixt=new WeakMap,kxt=new WeakMap,Txt=new WeakMap,Rxt=new WeakMap;class jxt{constructor(t,e=!1){this.useLegacySign=!1,this.provider=t,this.useLegacySign=e}async connect(t){const e=await this.provider.internalRequest({method:"requestAccounts",params:{options:t}});return this.provider.emit("connect"),{publicKey:new rSt(e[0])}}async signTransaction(t){if(this.useLegacySign)return await this.legacySign(t);const e=JSON.stringify(t);let r,n="legacy";ZAt(t)?(n=t.version,r=pgt.from(t.message.serialize()).toString("base64")):r=pgt.from(t.serializeMessage()).toString("base64");const i=pgt.from(t.serialize({requireAllSignatures:!1,verifySignatures:!1})).toString("base64"),o=await this.provider.internalRequest({method:"signRawTransaction",params:{data:e,raw:i,rawMessage:r,version:n}});return this.provider.mapSignedTransaction(t,o)}async legacySign(t){const e=JSON.stringify(t),r="number"!=typeof t.version?"legacy":t.version,n=xvt.encode("legacy"===r?t.serializeMessage():0===r?t.message.serialize():t.serialize());try{const i=await this.provider.internalRequest({method:"signRawTransaction",params:{data:e,raw:n,version:r}});return this.provider.mapSignedTransaction(t,i)}catch(t){console.log(`<== Error: ${t}`)}}async request(t,e){var r;switch(t.method){case"signTransaction":return this.signTransaction(t.params);case"connect":return this.connect(null==(r=null==t?void 0:t.params)?void 0:r.options)}return e()}}var Dxt,zxt,Fxt,Hxt,$xt,qxt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Wxt=(t,e,r)=>(qxt(t,e,"read from private field"),r?r.call(t):e.get(t)),Vxt=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Kxt=(t,e,r,n)=>(qxt(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Gxt=(t,e,r)=>(qxt(t,e,"access private method"),r);const Zxt=class extends Eyt{constructor(t){super(),Vxt(this,Hxt),Vxt(this,Dxt,!1),Vxt(this,zxt,!0),this.isTrust=!0,this.isTrustWallet=!0,Vxt(this,Fxt,!1),t&&(typeof t.enableAdapter<"u"&&Kxt(this,zxt,t.enableAdapter),typeof t.cluster<"u"&&(this.connection=new CAt(t.cluster,"confirmed")),typeof t.disableMobileAdapter<"u"&&Kxt(this,Dxt,t.disableMobileAdapter),typeof t.useLegacySign<"u"&&Kxt(this,Fxt,t.useLegacySign),typeof t.isTrust<"u"&&(this.isTrust=t.isTrust,this.isTrustWallet=t.isTrust)),Wxt(this,zxt)&&VAt(this),Wxt(this,Dxt)||(this.mobileAdapter=new jxt(this,Wxt(this,Fxt)))}static bufferToHex(t){return"0x"+pgt.from(t).toString("hex")}static messageToBuffer(t){let e=pgt.from([]);try{e="string"==typeof t?pgt.from(t.replace("0x",""),"hex"):pgt.from(t)}catch(t){console.log(`messageToBuffer error: ${t}`)}return e}getInstanceWithAdapter(){return new Uxt(this)}async connect(t){const e=await Gxt(this,Hxt,$xt).call(this,{method:"connect",params:{options:t}});return this.publicKey=e.publicKey,e}disconnect(){return new Promise((t=>{this.publicKey=null,this.emit("disconnect"),t()}))}async signAndSendTransaction(t,e){const r=await this.signTransaction(t);return{signature:await this.connection.sendRawTransaction(r.serialize(),e)}}signTransaction(t){return Gxt(this,Hxt,$xt).call(this,{method:"signTransaction",params:t})}signAllTransactions(t){return Promise.all(t.map((t=>this.signTransaction(t))))}async signRawTransactionMulti(t){return(await Gxt(this,Hxt,$xt).call(this,{method:"signRawTransactionMulti",params:{transactions:t.map((t=>{const e=JSON.stringify(t);let r,n="legacy";ZAt(t)?(n=t.version,r=pgt.from(t.message.serialize()).toString("base64")):r=pgt.from(t.serializeMessage()).toString("base64");return{data:e,raw:pgt.from(t.serialize({requireAllSignatures:!1,verifySignatures:!1})).toString("base64"),rawMessage:r,version:n}}))}})).map(((e,r)=>this.mapSignedTransaction(t[r],e)))}async signMessage(t){var e;const r=Zxt.bufferToHex(t),n=await Gxt(this,Hxt,$xt).call(this,{method:"signMessage",params:{data:r}});return{signature:new Uint8Array(pgt.from(Zxt.messageToBuffer(n).buffer)),publicKey:null==(e=this.publicKey)?void 0:e.toBase58()}}signIn(t){throw new Error("Method not implemented.")}getNetwork(){return Zxt.NETWORK}mapSignedTransaction(t,e){return t.addSignature(this.publicKey,xvt.decode(e)),t}request(t){throw new Error("Not implemented")}internalRequest(t){return super.request(t)}};let Jxt=Zxt;Dxt=new WeakMap,zxt=new WeakMap,Fxt=new WeakMap,Hxt=new WeakSet,$xt=function(t){const e=()=>this.internalRequest(t);return this.mobileAdapter?this.mobileAdapter.request(t,e):e()},Jxt.NETWORK="solana";var Yxt={},Xxt={},Qxt={},tIt={},eIt={},rIt={},nIt={},iIt={},oIt={};function sIt(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function aIt(t){if("boolean"!=typeof t)throw new Error(`boolean expected, not ${t}`)}function cIt(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}function uIt(t,...e){if(!cIt(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function fIt(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");sIt(t.outputLen),sIt(t.blockLen)}function hIt(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function lIt(t,e){uIt(t);const r=e.outputLen;if(t.lengthnew Uint8Array(t.buffer,t.byteOffset,t.byteLength);t.u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));t.createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);t.rotr=(t,e)=>t<<32-e|t>>>e;t.rotl=(t,e)=>t<>>32-e>>>0,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];t.byteSwap=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,t.byteSwapIfBE=t.isLE?t=>t:e=>(0,t.byteSwap)(e),t.byteSwap32=function(e){for(let r=0;re.toString(16).padStart(2,"0")));t.bytesToHex=function(t){(0,r.bytes)(t);let e="";for(let r=0;r=i&&t<=o?t-i:t>=s&&t<=a?t-(s-10):t>=c&&t<=u?t-(c-10):void 0}t.hexToBytes=function(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let e=0,i=0;e{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o=0&&et().update(l(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e},t.wrapConstructorWithOpts=function(t){const e=(e,r)=>t(r).update(l(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e},t.wrapXOFConstructorWithOpts=function(t){const e=(e,r)=>t(r).update(l(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e},t.randomBytes=function(t=32){if(e.crypto&&"function"==typeof e.crypto.getRandomValues)return e.crypto.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}}(pIt),Object.defineProperty(iIt,"__esModule",{value:!0}),iIt.HashMD=iIt.Maj=iIt.Chi=void 0;const yIt=oIt,mIt=pIt;iIt.Chi=(t,e,r)=>t&e^~t&r;iIt.Maj=(t,e,r)=>t&e^t&r^e&r;iIt.HashMD=class extends mIt.Hash{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,mIt.createView)(this.buffer)}update(t){(0,yIt.exists)(this);const{view:e,buffer:r,blockLen:n}=this,i=(t=(0,mIt.toBytes)(t)).length;for(let o=0;on-o&&(this.process(r,0),o=0);for(let t=o;t>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;t.setUint32(e+c,s,n),t.setUint32(e+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=(0,mIt.createView)(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t>>3,i=(0,wIt.rotr)(r,17)^(0,wIt.rotr)(r,19)^r>>>10;SIt[t]=i+SIt[t-7]+n+SIt[t-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let t=0;t<64;t++){const e=u+((0,wIt.rotr)(s,6)^(0,wIt.rotr)(s,11)^(0,wIt.rotr)(s,25))+(0,vIt.Chi)(s,a,c)+bIt[t]+SIt[t]|0,f=((0,wIt.rotr)(r,2)^(0,wIt.rotr)(r,13)^(0,wIt.rotr)(r,22))+(0,vIt.Maj)(r,n,i)|0;u=c,c=a,a=s,s=o+e|0,o=i,i=n,n=r,r=e+f|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){SIt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class AIt extends _It{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}}nIt.sha256=(0,wIt.wrapConstructor)((()=>new _It)),nIt.sha224=(0,wIt.wrapConstructor)((()=>new AIt));var xIt={},IIt={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const e=oIt,r=pIt;class n extends r.Hash{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,(0,e.hash)(t);const i=(0,r.toBytes)(n);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)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,s=new Uint8Array(o);s.set(i.length>o?t.create().update(i).digest():i);for(let t=0;tnew n(t,e).update(r).digest(),t.hmac.create=(t,e)=>new n(t,e)}(IIt);var kIt={},TIt={},RIt={},BIt={};Object.defineProperty(BIt,"__esModule",{value:!0}),BIt.bitMask=void 0,BIt.isBytes=LIt,BIt.abytes=PIt,BIt.bytesToHex=UIt,BIt.numberToHexUnpadded=jIt,BIt.hexToNumber=DIt,BIt.hexToBytes=HIt,BIt.bytesToNumberBE=function(t){return DIt(UIt(t))},BIt.bytesToNumberLE=function(t){return PIt(t),DIt(UIt(Uint8Array.from(t).reverse()))},BIt.numberToBytesBE=$It,BIt.numberToBytesLE=function(t,e){return $It(t,e).reverse()},BIt.numberToVarBytesBE=function(t){return HIt(jIt(t))},BIt.ensureBytes=function(t,e,r){let n;if("string"==typeof e)try{n=HIt(e)}catch(r){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${r}`)}else{if(!LIt(e))throw new Error(`${t} must be hex string or Uint8Array`);n=Uint8Array.from(e)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n},BIt.concatBytes=qIt,BIt.equalBytes=function(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;nOIt;t>>=MIt,e+=1);return e},BIt.bitGet=function(t,e){return t>>BigInt(e)&MIt},BIt.bitSet=function(t,e,r){return t|(r?MIt:OIt)<{n.fill(1),i.fill(0),o=0},a=(...t)=>r(i,n,...t),c=(t=WIt())=>{i=a(VIt([0]),t),n=a(),0!==t.length&&(i=a(VIt([1]),t),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const r=[];for(;t{let r;for(s(),c(t);!(r=e(u()));)c();return s(),r}},BIt.validateObject=function(t,e,r={}){const n=(e,r,n)=>{const i=KIt[r];if("function"!=typeof i)throw new Error(`Invalid validator "${r}", expected function`);const o=t[e];if(!(n&&void 0===o||i(o,t)))throw new Error(`Invalid param ${String(e)}=${o} (${typeof o}), expected ${r}`)};for(const[t,r]of Object.entries(e))n(t,r,!1);for(const[t,e]of Object.entries(r))n(t,e,!0);return t};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const OIt=BigInt(0),MIt=BigInt(1),CIt=BigInt(2);function LIt(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}function PIt(t){if(!LIt(t))throw new Error("Uint8Array expected")}const NIt=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function UIt(t){PIt(t);let e="";for(let r=0;r=zIt._0&&t<=zIt._9?t-zIt._0:t>=zIt._A&&t<=zIt._F?t-(zIt._A-10):t>=zIt._a&&t<=zIt._f?t-(zIt._a-10):void 0}function HIt(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let e=0,i=0;e(CIt<new Uint8Array(t),VIt=t=>Uint8Array.from(t);const KIt={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||LIt(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};Object.defineProperty(RIt,"__esModule",{value:!0}),RIt.isNegativeLE=void 0,RIt.mod=rkt,RIt.pow=nkt,RIt.pow2=function(t,e,r){let n=t;for(;e-- >ZIt;)n*=n,n%=r;return n},RIt.invert=ikt,RIt.tonelliShanks=okt,RIt.FpSqrt=skt,RIt.validateField=function(t){const e=akt.reduce(((t,e)=>(t[e]="function",t)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,GIt.validateObject)(t,e)},RIt.FpPow=ckt,RIt.FpInvertBatch=ukt,RIt.FpDiv=function(t,e,r){return t.mul(e,"bigint"==typeof r?ikt(r,t.ORDER):t.inv(r))},RIt.FpIsSquare=function(t){const e=(t.ORDER-JIt)/YIt;return r=>{const n=t.pow(r,e);return t.eql(n,t.ZERO)||t.eql(n,t.ONE)}},RIt.nLength=fkt,RIt.Field=function(t,e,r=!1,n={}){if(t<=ZIt)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:o}=fkt(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=skt(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:(0,GIt.bitMask)(i),ZERO:ZIt,ONE:JIt,create:e=>rkt(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("Invalid field element: expected bigint, got "+typeof e);return ZIt<=e&&et===ZIt,isOdd:t=>(t&JIt)===JIt,neg:e=>rkt(-e,t),eql:(t,e)=>t===e,sqr:e=>rkt(e*e,t),add:(e,r)=>rkt(e+r,t),sub:(e,r)=>rkt(e-r,t),mul:(e,r)=>rkt(e*r,t),pow:(t,e)=>ckt(a,t,e),div:(e,r)=>rkt(e*ikt(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>ikt(e,t),sqrt:n.sqrt||(t=>s(a,t)),invertBatch:t=>ukt(a,t),cmov:(t,e,r)=>r?e:t,toBytes:t=>r?(0,GIt.numberToBytesLE)(t,o):(0,GIt.numberToBytesBE)(t,o),fromBytes:t=>{if(t.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${t.length}`);return r?(0,GIt.bytesToNumberLE)(t):(0,GIt.bytesToNumberBE)(t)}});return Object.freeze(a)},RIt.FpSqrtOdd=function(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const r=t.sqrt(e);return t.isOdd(r)?r:t.neg(r)},RIt.FpSqrtEven=function(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r},RIt.hashToPrivateScalar=function(t,e,r=!1){t=(0,GIt.ensureBytes)("privateHash",t);const n=t.length,i=fkt(e).nByteLength+8;if(i<24||n1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);const o=r?(0,GIt.bytesToNumberLE)(t):(0,GIt.bytesToNumberBE)(t);return rkt(o,e-JIt)+JIt},RIt.getFieldBytesLength=hkt,RIt.getMinHashLength=lkt,RIt.mapHashToField=function(t,e,r=!1){const n=t.length,i=hkt(e),o=lkt(e);if(n<16||n1024)throw new Error(`expected ${o}-1024 bytes of input, got ${n}`);const s=r?(0,GIt.bytesToNumberBE)(t):(0,GIt.bytesToNumberLE)(t),a=rkt(s,e-JIt)+JIt;return r?(0,GIt.numberToBytesLE)(a,i):(0,GIt.numberToBytesBE)(a,i)};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const GIt=BIt,ZIt=BigInt(0),JIt=BigInt(1),YIt=BigInt(2),XIt=BigInt(3),QIt=BigInt(4),tkt=BigInt(5),ekt=BigInt(8);function rkt(t,e){const r=t%e;return r>=ZIt?r:e+r}function nkt(t,e,r){if(r<=ZIt||e 0");if(r===JIt)return ZIt;let n=JIt;for(;e>ZIt;)e&JIt&&(n=n*t%r),t=t*t%r,e>>=JIt;return n}function ikt(t,e){if(t===ZIt||e<=ZIt)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=rkt(t,e),n=e,i=ZIt,o=JIt;for(;r!==ZIt;){const t=n%r,e=i-o*(n/r);n=r,r=t,i=o,o=e}if(n!==JIt)throw new Error("invert: does not exist");return rkt(i,e)}function okt(t){const e=(t-JIt)/YIt;let r,n,i;for(r=t-JIt,n=0;r%YIt===ZIt;r/=YIt,n++);for(i=YIt;i(rkt(t,e)&JIt)===JIt;const akt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ckt(t,e,r){if(r 0");if(r===ZIt)return t.ONE;if(r===JIt)return e;let n=t.ONE,i=e;for(;r>ZIt;)r&JIt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=JIt;return n}function ukt(t,e){const r=new Array(e.length),n=e.reduce(((e,n,i)=>t.is0(n)?e:(r[i]=e,t.mul(e,n))),t.ONE),i=t.inv(n);return e.reduceRight(((e,n,i)=>t.is0(n)?e:(r[i]=t.mul(e,r[i]),t.mul(e,n))),i),r}function fkt(t,e){const r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function hkt(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function lkt(t){const e=hkt(t);return e+Math.ceil(e/2)}Object.defineProperty(TIt,"__esModule",{value:!0}),TIt.wNAF=function(t,e){const r=(t,e)=>{const r=e.negate();return t?r:e},n=t=>({windows:Math.ceil(e/t)+1,windowSize:2**(t-1)});return{constTimeNegate:r,unsafeLadder(e,r){let n=t.ZERO,i=e;for(;r>gkt;)r&ykt&&(n=n.add(i)),i=i.double(),r>>=ykt;return n},precomputeWindow(t,e){const{windows:r,windowSize:i}=n(e),o=[];let s=t,a=s;for(let t=0;t>=l,n>a&&(n-=h,o+=ykt);const s=e,d=e+Math.abs(n)-1,p=t%2!=0,g=n<0;0===n?u=u.add(r(p,i[s])):c=c.add(r(g,i[d]))}return{p:c,f:u}},wNAFCached(t,e,r,n){const i=t._WINDOW_SIZE||1;let o=e.get(t);return o||(o=this.precomputeWindow(t,i),1!==i&&e.set(t,n(o))),this.wNAF(i,o,r)}}},TIt.validateBasic=function(t){return(0,dkt.validateField)(t.Fp),(0,pkt.validateObject)(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,dkt.nLength)(t.n,t.nBitLength),...t,p:t.Fp.ORDER})};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const dkt=RIt,pkt=BIt,gkt=BigInt(0),ykt=BigInt(1);!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DER=void 0,t.weierstrassPoints=l,t.weierstrass=function(o){const s=function(t){const r=(0,e.validateBasic)(t);return n.validateObject(r,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...r})}(o),{Fp:u,n:f}=s,h=u.BYTES+1,d=2*u.BYTES+1;function p(t){return r.mod(t,f)}function g(t){return r.invert(t,f)}const{ProjectivePoint:y,normPrivateKeyToScalar:m,weierstrassEquation:v,isWithinCurveOrder:w}=l({...s,toBytes(t,e,r){const i=e.toAffine(),o=u.toBytes(i.x),s=n.concatBytes;return r?s(Uint8Array.from([e.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,u.toBytes(i.y))},fromBytes(t){const e=t.length,r=t[0],i=t.subarray(1);if(e!==h||2!==r&&3!==r){if(e===d&&4===r){return{x:u.fromBytes(i.subarray(0,u.BYTES)),y:u.fromBytes(i.subarray(u.BYTES,2*u.BYTES))}}throw new Error(`Point of length ${e} was invalid. Expected ${h} compressed bytes or ${d} uncompressed bytes`)}{const t=n.bytesToNumberBE(i);if(!(a<(o=t)&&on.bytesToHex(n.numberToBytesBE(t,s.nByteLength));function E(t){return t>f>>c}const S=(t,e,r)=>n.bytesToNumberBE(t.slice(e,r));class _{constructor(t,e,r){this.r=t,this.s=e,this.recovery=r,this.assertValidity()}static fromCompact(t){const e=s.nByteLength;return t=(0,i.ensureBytes)("compactSignature",t,2*e),new _(S(t,0,e),S(t,e,2*e))}static fromDER(e){const{r:r,s:n}=t.DER.toSig((0,i.ensureBytes)("DER",e));return new _(r,n)}assertValidity(){if(!w(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!w(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(t){return new _(this.r,this.s,t)}recoverPublicKey(t){const{r:e,s:r,recovery:n}=this,o=k((0,i.ensureBytes)("msgHash",t));if(null==n||![0,1,2,3].includes(n))throw new Error("recovery id invalid");const a=2===n||3===n?e+s.n:e;if(a>=u.ORDER)throw new Error("recovery id 2 or 3 invalid");const c=1&n?"03":"02",f=y.fromHex(c+b(a)),h=g(a),l=p(-o*h),d=p(r*h),m=y.BASE.multiplyAndAddUnsafe(f,l,d);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return E(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,p(-this.s),this.recovery):this}toDERRawBytes(){return n.hexToBytes(this.toDERHex())}toDERHex(){return t.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return n.hexToBytes(this.toCompactHex())}toCompactHex(){return b(this.r)+b(this.s)}}const A={isValidPrivateKey(t){try{return m(t),!0}catch(t){return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const t=r.getMinHashLength(s.n);return r.mapHashToField(s.randomBytes(t),s.n)},precompute:(t=8,e=y.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)};function x(t){const e=n.isBytes(t),r="string"==typeof t,i=(e||r)&&t.length;return e?i===h||i===d:r?i===2*h||i===2*d:t instanceof y}const I=s.bits2int||function(t){const e=n.bytesToNumberBE(t),r=8*t.length-s.nBitLength;return r>0?e>>BigInt(r):e},k=s.bits2int_modN||function(t){return p(I(t))},T=n.bitMask(s.nBitLength);function R(t){if("bigint"!=typeof t)throw new Error("bigint expected");if(!(a<=t&&tt in r)))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:f}=s;let{lowS:h,prehash:l,extraEntropy:d}=r;null==h&&(h=!0),t=(0,i.ensureBytes)("msgHash",t),l&&(t=(0,i.ensureBytes)("prehashed msgHash",o(t)));const v=k(t),b=m(e),S=[R(b),R(v)];if(null!=d&&!1!==d){const t=!0===d?f(u.BYTES):d;S.push((0,i.ensureBytes)("extraEntropy",t))}const A=n.concatBytes(...S),x=v;return{seed:A,k2sig:function(t){const e=I(t);if(!w(e))return;const r=g(e),n=y.BASE.multiply(e).toAffine(),i=p(n.x);if(i===a)return;const o=p(r*p(x+i*b));if(o===a)return;let s=(n.x===i?0:2)|Number(n.y&c),u=o;return h&&E(o)&&(u=function(t){return E(t)?p(-t):t}(o),s^=1),new _(i,u,s)}}}const O={lowS:s.lowS,prehash:!1},M={lowS:s.lowS,prehash:!1};return y.BASE._setWindowSize(8),{CURVE:s,getPublicKey:function(t,e=!0){return y.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,r=!0){if(x(t))throw new Error("first arg must be private key");if(!x(e))throw new Error("second arg must be public key");const n=y.fromHex(e);return n.multiply(m(t)).toRawBytes(r)},sign:function(t,e,r=O){const{seed:i,k2sig:o}=B(t,e,r),a=s,c=n.createHmacDrbg(a.hash.outputLen,a.nByteLength,a.hmac);return c(i,o)},verify:function(e,r,o,a=M){var c;const u=e;if(r=(0,i.ensureBytes)("msgHash",r),o=(0,i.ensureBytes)("publicKey",o),"strict"in a)throw new Error("options.strict was renamed to lowS");const{lowS:f,prehash:h}=a;let l,d;try{if("string"==typeof u||n.isBytes(u))try{l=_.fromDER(u)}catch(e){if(!(e instanceof t.DER.Err))throw e;l=_.fromCompact(u)}else{if("object"!=typeof u||"bigint"!=typeof u.r||"bigint"!=typeof u.s)throw new Error("PARSE");{const{r:t,s:e}=u;l=new _(t,e)}}d=y.fromHex(o)}catch(t){if("PARSE"===t.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(f&&l.hasHighS())return!1;h&&(r=s.hash(r));const{r:m,s:v}=l,w=k(r),b=g(v),E=p(w*b),S=p(m*b),A=null===(c=y.BASE.multiplyAndAddUnsafe(d,E,S))||void 0===c?void 0:c.toAffine();if(!A)return!1;const x=p(A.x);return x===m},ProjectivePoint:y,Signature:_,utils:A}},t.SWUFpSqrtRatio=d,t.mapToCurveSimpleSWU=function(t,e){if(r.validateField(t),!t.isValid(e.A)||!t.isValid(e.B)||!t.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const n=d(t,e.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return r=>{let i,o,s,a,c,u,f,h;i=t.sqr(r),i=t.mul(i,e.Z),o=t.sqr(i),o=t.add(o,i),s=t.add(o,t.ONE),s=t.mul(s,e.B),a=t.cmov(e.Z,t.neg(o),!t.eql(o,t.ZERO)),a=t.mul(a,e.A),o=t.sqr(s),u=t.sqr(a),c=t.mul(u,e.A),o=t.add(o,c),o=t.mul(o,s),u=t.mul(u,a),c=t.mul(u,e.B),o=t.add(o,c),f=t.mul(i,s);const{isValid:l,value:d}=n(o,u);h=t.mul(i,r),h=t.mul(h,d),f=t.cmov(f,s,l),h=t.cmov(h,d,l);const p=t.isOdd(r)===t.isOdd(h);return h=t.cmov(t.neg(h),h,p),f=t.div(f,a),{x:f,y:h}}};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const e=TIt,r=RIt,n=BIt,i=BIt;const{bytesToNumberBE:o,hexToBytes:s}=n;t.DER={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:r}=t.DER;if(e.length<2||2!==e[0])throw new r("Invalid signature integer tag");const n=e[1],i=e.subarray(2,n+2);if(!n||i.length!==n)throw new r("Invalid signature integer: wrong length");if(128&i[0])throw new r("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new r("Invalid signature integer: unnecessary leading zero");return{d:o(i),l:e.subarray(n+2)}},toSig(e){const{Err:r}=t.DER,i="string"==typeof e?s(e):e;n.abytes(i);let o=i.length;if(o<2||48!=i[0])throw new r("Invalid signature tag");if(i[1]!==o-2)throw new r("Invalid signature: incorrect length");const{d:a,l:c}=t.DER._parseInt(i.subarray(2)),{d:u,l:f}=t.DER._parseInt(c);if(f.length)throw new r("Invalid signature: left bytes after parsing");return{r:a,s:u}},hexFromSig(t){const e=t=>8&Number.parseInt(t[0],16)?"00"+t:t,r=t=>{const e=t.toString(16);return 1&e.length?`0${e}`:e},n=e(r(t.s)),i=e(r(t.r)),o=n.length/2,s=i.length/2,a=r(o),c=r(s);return`30${r(s+o+4)}02${c}${i}02${a}${n}`}};const a=BigInt(0),c=BigInt(1),u=BigInt(2),f=BigInt(3),h=BigInt(4);function l(t){const o=function(t){const r=(0,e.validateBasic)(t);n.validateObject(r,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:i,Fp:o,a:s}=r;if(i){if(!o.eql(s,o.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof i||"bigint"!=typeof i.beta||"function"!=typeof i.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...r})}(t),{Fp:s}=o,u=o.toBytes||((t,e,r)=>{const i=e.toAffine();return n.concatBytes(Uint8Array.from([4]),s.toBytes(i.x),s.toBytes(i.y))}),h=o.fromBytes||(t=>{const e=t.subarray(1);return{x:s.fromBytes(e.subarray(0,s.BYTES)),y:s.fromBytes(e.subarray(s.BYTES,2*s.BYTES))}});function l(t){const{a:e,b:r}=o,n=s.sqr(t),i=s.mul(n,t);return s.add(s.add(i,s.mul(t,e)),r)}if(!s.eql(s.sqr(o.Gy),l(o.Gx)))throw new Error("bad generator point: equation left != right");function d(t){return"bigint"==typeof t&&as.eql(t,s.ZERO);return n(e)&&n(r)?v.ZERO:new v(e,r,s.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){const e=s.invertBatch(t.map((t=>t.pz)));return t.map(((t,r)=>t.toAffine(e[r]))).map(v.fromAffine)}static fromHex(t){const e=v.fromAffine(h((0,i.ensureBytes)("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return v.BASE.multiply(g(t))}_setWindowSize(t){this._WINDOW_SIZE=t,y.delete(this)}assertValidity(){if(this.is0()){if(o.allowInfinityPoint&&!s.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:t,y:e}=this.toAffine();if(!s.isValid(t)||!s.isValid(e))throw new Error("bad point: x or y not FE");const r=s.sqr(e),n=l(t);if(!s.eql(r,n))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:t}=this.toAffine();if(s.isOdd)return!s.isOdd(t);throw new Error("Field doesn't support isOdd")}equals(t){m(t);const{px:e,py:r,pz:n}=this,{px:i,py:o,pz:a}=t,c=s.eql(s.mul(e,a),s.mul(i,n)),u=s.eql(s.mul(r,a),s.mul(o,n));return c&&u}negate(){return new v(this.px,s.neg(this.py),this.pz)}double(){const{a:t,b:e}=o,r=s.mul(e,f),{px:n,py:i,pz:a}=this;let c=s.ZERO,u=s.ZERO,h=s.ZERO,l=s.mul(n,n),d=s.mul(i,i),p=s.mul(a,a),g=s.mul(n,i);return g=s.add(g,g),h=s.mul(n,a),h=s.add(h,h),c=s.mul(t,h),u=s.mul(r,p),u=s.add(c,u),c=s.sub(d,u),u=s.add(d,u),u=s.mul(c,u),c=s.mul(g,c),h=s.mul(r,h),p=s.mul(t,p),g=s.sub(l,p),g=s.mul(t,g),g=s.add(g,h),h=s.add(l,l),l=s.add(h,l),l=s.add(l,p),l=s.mul(l,g),u=s.add(u,l),p=s.mul(i,a),p=s.add(p,p),l=s.mul(p,g),c=s.sub(c,l),h=s.mul(p,d),h=s.add(h,h),h=s.add(h,h),new v(c,u,h)}add(t){m(t);const{px:e,py:r,pz:n}=this,{px:i,py:a,pz:c}=t;let u=s.ZERO,h=s.ZERO,l=s.ZERO;const d=o.a,p=s.mul(o.b,f);let g=s.mul(e,i),y=s.mul(r,a),w=s.mul(n,c),b=s.add(e,r),E=s.add(i,a);b=s.mul(b,E),E=s.add(g,y),b=s.sub(b,E),E=s.add(e,n);let S=s.add(i,c);return E=s.mul(E,S),S=s.add(g,w),E=s.sub(E,S),S=s.add(r,n),u=s.add(a,c),S=s.mul(S,u),u=s.add(y,w),S=s.sub(S,u),l=s.mul(d,E),u=s.mul(p,w),l=s.add(u,l),u=s.sub(y,l),l=s.add(y,l),h=s.mul(u,l),y=s.add(g,g),y=s.add(y,g),w=s.mul(d,w),E=s.mul(p,E),y=s.add(y,w),w=s.sub(g,w),w=s.mul(d,w),E=s.add(E,w),g=s.mul(y,E),h=s.add(h,g),g=s.mul(S,E),u=s.mul(b,u),u=s.sub(u,g),g=s.mul(b,y),l=s.mul(S,l),l=s.add(l,g),new v(u,h,l)}subtract(t){return this.add(t.negate())}is0(){return this.equals(v.ZERO)}wNAF(t){return b.wNAFCached(this,y,t,(t=>{const e=s.invertBatch(t.map((t=>t.pz)));return t.map(((t,r)=>t.toAffine(e[r]))).map(v.fromAffine)}))}multiplyUnsafe(t){const e=v.ZERO;if(t===a)return e;if(p(t),t===c)return this;const{endo:r}=o;if(!r)return b.unsafeLadder(this,t);let{k1neg:n,k1:i,k2neg:u,k2:f}=r.splitScalar(t),h=e,l=e,d=this;for(;i>a||f>a;)i&c&&(h=h.add(d)),f&c&&(l=l.add(d)),d=d.double(),i>>=c,f>>=c;return n&&(h=h.negate()),u&&(l=l.negate()),l=new v(s.mul(l.px,r.beta),l.py,l.pz),h.add(l)}multiply(t){p(t);let e,r,n=t;const{endo:i}=o;if(i){const{k1neg:t,k1:o,k2neg:a,k2:c}=i.splitScalar(n);let{p:u,f:f}=this.wNAF(o),{p:h,f:l}=this.wNAF(c);u=b.constTimeNegate(t,u),h=b.constTimeNegate(a,h),h=new v(s.mul(h.px,i.beta),h.py,h.pz),e=u.add(h),r=f.add(l)}else{const{p:t,f:i}=this.wNAF(n);e=t,r=i}return v.normalizeZ([e,r])[0]}multiplyAndAddUnsafe(t,e,r){const n=v.BASE,i=(t,e)=>e!==a&&e!==c&&t.equals(n)?t.multiply(e):t.multiplyUnsafe(e),o=i(this,e).add(i(t,r));return o.is0()?void 0:o}toAffine(t){const{px:e,py:r,pz:n}=this,i=this.is0();null==t&&(t=i?s.ONE:s.inv(n));const o=s.mul(e,t),a=s.mul(r,t),c=s.mul(n,t);if(i)return{x:s.ZERO,y:s.ZERO};if(!s.eql(c,s.ONE))throw new Error("invZ was invalid");return{x:o,y:a}}isTorsionFree(){const{h:t,isTorsionFree:e}=o;if(t===c)return!0;if(e)return e(v,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:t,clearCofactor:e}=o;return t===c?this:e?e(v,this):this.multiplyUnsafe(o.h)}toRawBytes(t=!0){return this.assertValidity(),u(v,this,t)}toHex(t=!0){return n.bytesToHex(this.toRawBytes(t))}}v.BASE=new v(o.Gx,o.Gy,s.ONE),v.ZERO=new v(s.ZERO,s.ONE,s.ZERO);const w=o.nBitLength,b=(0,e.wNAF)(v,o.endo?Math.ceil(w/2):w);return{CURVE:o,ProjectivePoint:v,normPrivateKeyToScalar:g,weierstrassEquation:l,isWithinCurveOrder:d}}function d(t,e){const r=t.ORDER;let n=a;for(let t=r-c;t%u===a;t/=u)n+=c;const i=n,o=u<{let n=y,o=t.pow(r,p),s=t.sqr(o);s=t.mul(s,r);let a=t.mul(e,s);a=t.pow(a,d),a=t.mul(a,o),o=t.mul(a,r),s=t.mul(a,e);let f=t.mul(s,o);a=t.pow(f,g);let h=t.eql(a,t.ONE);o=t.mul(s,m),a=t.mul(f,n),s=t.cmov(o,s,h),f=t.cmov(a,f,h);for(let e=i;e>c;e--){let r=e-u;r=u<{let o=t.sqr(i);const s=t.mul(e,i);o=t.mul(o,s);let a=t.pow(o,r);a=t.mul(a,s);const c=t.mul(a,n),u=t.mul(t.sqr(a),i),f=t.eql(u,e);return{isValid:f,value:t.cmov(c,a,f)}}}return v}}(kIt),Object.defineProperty(xIt,"__esModule",{value:!0}),xIt.getHash=bkt,xIt.createCurve=function(t,e){const r=e=>(0,wkt.weierstrass)({...t,...bkt(e)});return Object.freeze({...r(e),create:r})};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const mkt=IIt,vkt=pIt,wkt=kIt;function bkt(t){return{hash:t,hmac:(e,...r)=>(0,mkt.hmac)(t,e,(0,vkt.concatBytes)(...r)),randomBytes:vkt.randomBytes}}var Ekt={};Object.defineProperty(Ekt,"__esModule",{value:!0}),Ekt.expand_message_xmd=Tkt,Ekt.expand_message_xof=Rkt,Ekt.hash_to_field=Bkt,Ekt.isogenyMap=function(t,e){const r=e.map((t=>Array.from(t).reverse()));return(e,n)=>{const[i,o,s,a]=r.map((r=>r.reduce(((r,n)=>t.add(t.mul(r,e),n)))));return e=t.div(i,o),n=t.mul(n,t.div(s,a)),{x:e,y:n}}},Ekt.createHasher=function(t,e,r){if("function"!=typeof e)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const o=Bkt(n,2,{...r,DST:r.DST,...i}),s=t.fromAffine(e(o[0])),a=t.fromAffine(e(o[1])),c=s.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,i){const o=Bkt(n,1,{...r,DST:r.encodeDST,...i}),s=t.fromAffine(e(o[0])).clearCofactor();return s.assertValidity(),s},mapToCurve(r){if(!Array.isArray(r))throw new Error("mapToCurve: expected array of bigints");for(const t of r)if("bigint"!=typeof t)throw new Error(`mapToCurve: expected array of bigints, got ${t} in array`);const n=t.fromAffine(e(r)).clearCofactor();return n.assertValidity(),n}}};const Skt=RIt,_kt=BIt,Akt=_kt.bytesToNumberBE;function xkt(t,e){if(t<0||t>=1<<8*e)throw new Error(`bad I2OSP call: value=${t} length=${e}`);const r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=255&t,t>>>=8;return new Uint8Array(r)}function Ikt(t,e){const r=new Uint8Array(t.length);for(let n=0;n255&&(e=n((0,_kt.concatBytes)((0,_kt.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));const{outputLen:i,blockLen:o}=n,s=Math.ceil(r/i);if(s>255)throw new Error("Invalid xmd length");const a=(0,_kt.concatBytes)(e,xkt(e.length,1)),c=xkt(0,o),u=xkt(r,2),f=new Array(s),h=n((0,_kt.concatBytes)(c,t,u,xkt(0,1),a));f[0]=n((0,_kt.concatBytes)(h,xkt(1,1),a));for(let t=1;t<=s;t++){const e=[Ikt(h,f[t-1]),xkt(t+1,1),a];f[t]=n((0,_kt.concatBytes)(...e))}return(0,_kt.concatBytes)(...f).slice(0,r)}function Rkt(t,e,r,n,i){if((0,_kt.abytes)(t),(0,_kt.abytes)(e),kkt(r),e.length>255){const t=Math.ceil(2*n/8);e=i.create({dkLen:t}).update((0,_kt.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(t).update(xkt(r,2)).update(e).update(xkt(e.length,1)).digest()}function Bkt(t,e,r){(0,_kt.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:n,k:i,m:o,hash:s,expand:a,DST:c}=r;(0,_kt.abytes)(t),kkt(e);const u="string"==typeof c?(0,_kt.utf8ToBytes)(c):c,f=n.toString(2).length,h=Math.ceil((f+i)/8),l=e*o*h;let d;if("xmd"===a)d=Tkt(t,u,l,s);else if("xof"===a)d=Rkt(t,u,l,i,s);else{if("_internal_pass"!==a)throw new Error('expand must be "xmd" or "xof"');d=t}const p=new Array(e);for(let t=0;t(t+e/h)/e;function d(t){const e=c,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),u=BigInt(44),f=BigInt(88),l=t*t*t%e,d=l*l*t%e,g=(0,o.pow2)(d,r,e)*d%e,y=(0,o.pow2)(g,r,e)*d%e,m=(0,o.pow2)(y,h,e)*l%e,v=(0,o.pow2)(m,i,e)*m%e,w=(0,o.pow2)(v,s,e)*v%e,b=(0,o.pow2)(w,u,e)*w%e,E=(0,o.pow2)(b,f,e)*b%e,S=(0,o.pow2)(E,u,e)*w%e,_=(0,o.pow2)(S,r,e)*d%e,A=(0,o.pow2)(_,a,e)*v%e,x=(0,o.pow2)(A,n,e)*l%e,I=(0,o.pow2)(x,h,e);if(!p.eql(p.sqr(I),t))throw new Error("Cannot find square root");return I}const p=(0,o.Field)(c,void 0,void 0,{sqrt:d});t.secp256k1=(0,n.createCurve)({a:BigInt(0),b:BigInt(7),Fp:p,n:u,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=u,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-f*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),c=l(s*t,e),h=l(-n*t,e);let d=(0,o.mod)(t-c*r-h*i,e),p=(0,o.mod)(-c*n-h*s,e);const g=d>a,y=p>a;if(g&&(d=e-d),y&&(p=e-p),d>a||p>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:d,k2neg:y,k2:p}}}},e.sha256);const g=BigInt(0),y=t=>"bigint"==typeof t&&gt.charCodeAt(0))));n=(0,s.concatBytes)(r,r),m[t]=n}return(0,e.sha256)((0,s.concatBytes)(n,...r))}const w=t=>t.toRawBytes(!0).slice(1),b=t=>(0,s.numberToBytesBE)(t,32),E=t=>(0,o.mod)(t,c),S=t=>(0,o.mod)(t,u),_=t.secp256k1.ProjectivePoint;function A(e){let r=t.secp256k1.utils.normPrivateKeyToScalar(e),n=_.fromPrivateKey(r);return{scalar:n.hasEvenY()?r:S(-r),bytes:w(n)}}function x(t){if(!y(t))throw new Error("bad x: need 0 < x < p");const e=E(t*t);let r=d(E(e*t+BigInt(7)));r%h!==g&&(r=E(-r));const n=new _(t,r,f);return n.assertValidity(),n}function I(...t){return S((0,s.bytesToNumberBE)(v("BIP0340/challenge",...t)))}function k(t){return A(t).bytes}function T(t,e,n=(0,r.randomBytes)(32)){const i=(0,s.ensureBytes)("message",t),{bytes:o,scalar:a}=A(e),c=(0,s.ensureBytes)("auxRand",n,32),u=b(a^(0,s.bytesToNumberBE)(v("BIP0340/aux",c))),f=v("BIP0340/nonce",u,o,i),h=S((0,s.bytesToNumberBE)(f));if(h===g)throw new Error("sign failed: k is zero");const{bytes:l,scalar:d}=A(h),p=I(l,o,i),y=new Uint8Array(64);if(y.set(l,0),y.set(b(S(d+p*a)),32),!R(y,i,o))throw new Error("sign: Invalid signature produced");return y}function R(t,e,r){const n=(0,s.ensureBytes)("signature",t,64),i=(0,s.ensureBytes)("message",e),o=(0,s.ensureBytes)("publicKey",r,32);try{const t=x((0,s.bytesToNumberBE)(o)),e=(0,s.bytesToNumberBE)(n.subarray(0,32));if(!y(e))return!1;const r=(0,s.bytesToNumberBE)(n.subarray(32,64));if(!(t=>"bigint"==typeof t&&g_.BASE.multiplyAndAddUnsafe(t,e,r))(t,r,S(-a));return!(!c||!c.hasEvenY()||c.toAffine().x!==e)}catch(t){return!1}}t.schnorr={getPublicKey:k,sign:T,verify:R,utils:{randomPrivateKey:t.secp256k1.utils.randomPrivateKey,lift_x:x,pointToBytes:w,numberToBytesBE:s.numberToBytesBE,bytesToNumberBE:s.bytesToNumberBE,taggedHash:v,mod:o.mod}};const B=(()=>(0,i.isogenyMap)(p,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((t=>t.map((t=>BigInt(t)))))))(),O=(()=>(0,a.mapToCurveSimpleSWU)(p,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:p.create(BigInt("-11"))}))(),M=(()=>(0,i.createHasher)(t.secp256k1.ProjectivePoint,(t=>{const{x:e,y:r}=O(p.create(t[0]));return B(e,r)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:p.ORDER,m:1,k:128,expand:"xmd",hash:e.sha256}))();t.hashToCurve=M.hashToCurve,t.encodeToCurve=M.encodeToCurve}(rIt),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.secp256k1=void 0;var e=rIt;Object.defineProperty(t,"secp256k1",{enumerable:!0,get:function(){return e.secp256k1}})}(eIt),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_WITHDRAWALS_PER_PAYLOAD=t.RLP_EMPTY_STRING=t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.SECP256K1_ORDER_DIV_2=t.SECP256K1_ORDER=t.MAX_INTEGER_BIGINT=t.MAX_INTEGER=t.MAX_UINT64=void 0;const e=bvt,r=eIt;t.MAX_UINT64=BigInt("0xffffffffffffffff"),t.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),t.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),t.SECP256K1_ORDER=r.secp256k1.CURVE.n,t.SECP256K1_ORDER_DIV_2=r.secp256k1.CURVE.n/BigInt(2),t.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=e.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=e.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=e.Buffer.from(t.KECCAK256_RLP_S,"hex"),t.RLP_EMPTY_STRING=e.Buffer.from([128]),t.MAX_WITHDRAWALS_PER_PAYLOAD=16}(tIt);var Okt={};Object.defineProperty(Okt,"__esModule",{value:!0}),Okt.GWEI_TO_WEI=void 0,Okt.GWEI_TO_WEI=BigInt(1e9);var Mkt={},Ckt={};function Lkt(t){if(Array.isArray(t)){const e=[];let r=0;for(let n=0;nt.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return t.slice(e,r)}function Nkt(t){if(0===t[0])throw new Error("invalid RLP: extra zeros");return Hkt(Fkt(t))}function Ukt(t,e){if(t<56)return Uint8Array.from([t+e]);const r=Vkt(t),n=Vkt(e+55+r.length/2);return Uint8Array.from($kt(n+r))}function jkt(t,e=!1){if(null==t||0===t.length)return Uint8Array.from([]);const r=Dkt(Gkt(t));if(e)return r;if(0!==r.remainder.length)throw new Error("invalid RLP: remainder must be zero");return r.data}function Dkt(t){let e,r,n,i,o;const s=[],a=t[0];if(a<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(a<=183){if(e=a-127,n=128===a?Uint8Array.from([]):Pkt(t,1,e),2===e&&n[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:n,remainder:t.slice(e)}}if(a<=191){if(r=a-182,t.length-1t.length)throw new Error("invalid RLP: total length is larger than the data");for(i=Pkt(t,r,n);i.length;)o=Dkt(i),s.push(o.data),i=o.remainder;return{data:s,remainder:t.slice(n)}}}Object.defineProperty(Ckt,"__esModule",{value:!0}),Ckt.RLP=Ckt.utils=Ckt.decode=Ckt.encode=void 0,Ckt.encode=Lkt,Ckt.decode=jkt;const zkt=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function Fkt(t){let e="";for(let r=0;rt+e.length),0),r=new Uint8Array(e);for(let e=0,n=0;e=2&&"0"===t[0]&&"x"===t[1]}function Gkt(t){if(t instanceof Uint8Array)return t;if("string"==typeof t)return Kkt(t)?$kt(function(t){return t.length%2?`0${t}`:t}("string"!=typeof(e=t)?e:Kkt(e)?e.slice(2):e)):Wkt(t);var e;if("number"==typeof t||"bigint"==typeof t)return t?$kt(Vkt(t)):Uint8Array.from([]);if(null==t)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof t)}Ckt.utils={bytesToHex:Fkt,concatBytes:qkt,hexToBytes:$kt,utf8ToBytes:Wkt},Ckt.RLP={encode:Lkt,decode:jkt};var Zkt={},Jkt={},Ykt={};Object.defineProperty(Ykt,"__esModule",{value:!0}),Ykt.add5L=Ykt.add5H=Ykt.add4H=Ykt.add4L=Ykt.add3H=Ykt.add3L=Ykt.add=Ykt.rotlBL=Ykt.rotlBH=Ykt.rotlSL=Ykt.rotlSH=Ykt.rotr32L=Ykt.rotr32H=Ykt.rotrBL=Ykt.rotrBH=Ykt.rotrSL=Ykt.rotrSH=Ykt.shrSL=Ykt.shrSH=Ykt.toBig=Ykt.split=Ykt.fromBig=void 0;const Xkt=BigInt(2**32-1),Qkt=BigInt(32);function tTt(t,e=!1){return e?{h:Number(t&Xkt),l:Number(t>>Qkt&Xkt)}:{h:0|Number(t>>Qkt&Xkt),l:0|Number(t&Xkt)}}function eTt(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0);Ykt.toBig=rTt;const nTt=(t,e,r)=>t>>>r;Ykt.shrSH=nTt;const iTt=(t,e,r)=>t<<32-r|e>>>r;Ykt.shrSL=iTt;const oTt=(t,e,r)=>t>>>r|e<<32-r;Ykt.rotrSH=oTt;const sTt=(t,e,r)=>t<<32-r|e>>>r;Ykt.rotrSL=sTt;const aTt=(t,e,r)=>t<<64-r|e>>>r-32;Ykt.rotrBH=aTt;const cTt=(t,e,r)=>t>>>r-32|e<<64-r;Ykt.rotrBL=cTt;const uTt=(t,e)=>e;Ykt.rotr32H=uTt;const fTt=(t,e)=>t;Ykt.rotr32L=fTt;const hTt=(t,e,r)=>t<>>32-r;Ykt.rotlSH=hTt;const lTt=(t,e,r)=>e<>>32-r;Ykt.rotlSL=lTt;const dTt=(t,e,r)=>e<>>64-r;Ykt.rotlBH=dTt;const pTt=(t,e,r)=>t<>>64-r;function gTt(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:0|i}}Ykt.rotlBL=pTt,Ykt.add=gTt;const yTt=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);Ykt.add3L=yTt;const mTt=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;Ykt.add3H=mTt;const vTt=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);Ykt.add4L=vTt;const wTt=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0;Ykt.add4H=wTt;const bTt=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0);Ykt.add5L=bTt;const ETt=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0;Ykt.add5H=ETt;const STt={fromBig:tTt,split:eTt,toBig:rTt,shrSH:nTt,shrSL:iTt,rotrSH:oTt,rotrSL:sTt,rotrBH:aTt,rotrBL:cTt,rotr32H:uTt,rotr32L:fTt,rotlSH:hTt,rotlSL:lTt,rotlBH:dTt,rotlBL:pTt,add:gTt,add3L:yTt,add3H:mTt,add4L:vTt,add4H:wTt,add5H:ETt,add5L:bTt};Ykt.default=STt,Object.defineProperty(Jkt,"__esModule",{value:!0}),Jkt.shake256=Jkt.shake128=Jkt.keccak_512=Jkt.keccak_384=Jkt.keccak_256=Jkt.keccak_224=Jkt.sha3_512=Jkt.sha3_384=Jkt.sha3_256=Jkt.sha3_224=Jkt.Keccak=Jkt.keccakP=void 0;const _Tt=oIt,ATt=Ykt,xTt=pIt,ITt=[],kTt=[],TTt=[],RTt=BigInt(0),BTt=BigInt(1),OTt=BigInt(2),MTt=BigInt(7),CTt=BigInt(256),LTt=BigInt(113);for(let t=0,e=BTt,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],ITt.push(2*(5*n+r)),kTt.push((t+1)*(t+2)/2%64);let i=RTt;for(let t=0;t<7;t++)e=(e<>MTt)*LTt)%CTt,e&OTt&&(i^=BTt<<(BTt<r>32?(0,ATt.rotlBH)(t,e,r):(0,ATt.rotlSH)(t,e,r),jTt=(t,e,r)=>r>32?(0,ATt.rotlBL)(t,e,r):(0,ATt.rotlSL)(t,e,r);function DTt(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const n=(e+8)%10,i=(e+2)%10,o=r[i],s=r[i+1],a=UTt(o,s,1)^r[n],c=jTt(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=c}let e=t[2],i=t[3];for(let r=0;r<24;r++){const n=kTt[r],o=UTt(e,i,n),s=jTt(e,i,n),a=ITt[r];e=t[a],i=t[a+1],t[a]=o,t[a+1]=s}for(let e=0;e<50;e+=10){for(let n=0;n<10;n++)r[n]=t[e+n];for(let n=0;n<10;n++)t[e+n]^=~r[(n+2)%10]&r[(n+4)%10]}t[0]^=PTt[n],t[1]^=NTt[n]}r.fill(0)}Jkt.keccakP=DTt;class zTt extends xTt.Hash{constructor(t,e,r,n=!1,i=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,_Tt.number)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,xTt.u32)(this.state)}keccak(){xTt.isLE||(0,xTt.byteSwap32)(this.state32),DTt(this.state32,this.rounds),xTt.isLE||(0,xTt.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,_Tt.exists)(this);const{blockLen:e,state:r}=this,n=(t=(0,xTt.toBytes)(t)).length;for(let i=0;i=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);t.set(e.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,_Tt.number)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,_Tt.output)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return t||(t=new zTt(e,r,n,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}}Jkt.Keccak=zTt;const FTt=(t,e,r)=>(0,xTt.wrapConstructor)((()=>new zTt(e,t,r)));Jkt.sha3_224=FTt(6,144,28),Jkt.sha3_256=FTt(6,136,32),Jkt.sha3_384=FTt(6,104,48),Jkt.sha3_512=FTt(6,72,64),Jkt.keccak_224=FTt(1,144,28),Jkt.keccak_256=FTt(1,136,32),Jkt.keccak_384=FTt(1,104,48),Jkt.keccak_512=FTt(1,72,64);const HTt=(t,e,r)=>(0,xTt.wrapXOFConstructorWithOpts)(((n={})=>new zTt(e,t,void 0===n.dkLen?r:n.dkLen,!0)));function $Tt(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}Jkt.shake128=HTt(31,168,16),Jkt.shake256=HTt(31,136,32);var qTt={exports:{}};!function(t,e){var r=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=e.utf8ToBytes=e.createView=e.concatBytes=e.toHex=e.bytesToHex=e.assertBytes=e.assertBool=void 0,e.bytesToUtf8=function(t){if(!(t instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof t);return(new TextDecoder).decode(t)},e.hexToBytes=function(t){const e=t.startsWith("0x")?t.substring(2):t;return(0,i.hexToBytes)(e)},e.equalsBytes=function(t,e){if(t.length!==e.length)return!1;for(let r=0;r(n.default.bytes(e),t(e))};const n=r(oIt),i=pIt,s=n.default.bool;e.assertBool=s;const a=n.default.bytes;e.assertBytes=a;var c=pIt;Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return c.bytesToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return c.bytesToHex}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return c.concatBytes}}),Object.defineProperty(e,"createView",{enumerable:!0,get:function(){return c.createView}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return c.utf8ToBytes}}),e.crypto=(()=>{const e="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,r=$Tt.bind(t);return{node:r&&!e?r("crypto"):void 0,web:e}})()}(qTt,qTt.exports),Object.defineProperty(Zkt,"__esModule",{value:!0}),Zkt.keccak512=Zkt.keccak384=Zkt.keccak256=Zkt.keccak224=void 0;const WTt=Jkt,VTt=qTt.exports;Zkt.keccak224=(0,VTt.wrapHash)(WTt.keccak_224),Zkt.keccak256=(()=>{const t=(0,VTt.wrapHash)(WTt.keccak_256);return t.create=WTt.keccak_256.create,t})(),Zkt.keccak384=(0,VTt.wrapHash)(WTt.keccak_384),Zkt.keccak512=(0,VTt.wrapHash)(WTt.keccak_512);var KTt={},GTt={},ZTt={};function JTt(t){if("string"!=typeof t)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof t);return"0"===t[0]&&"x"===t[1]}Object.defineProperty(ZTt,"__esModule",{value:!0}),ZTt.isHexString=ZTt.getKeys=ZTt.fromAscii=ZTt.fromUtf8=ZTt.toAscii=ZTt.arrayContainsArray=ZTt.getBinarySize=ZTt.padToEven=ZTt.stripHexPrefix=ZTt.isHexPrefixed=void 0,ZTt.isHexPrefixed=JTt;function YTt(t){let e=t;if("string"!=typeof e)throw new Error("[padToEven] value must be type 'string', received "+typeof e);return e.length%2&&(e=`0${e}`),e}ZTt.stripHexPrefix=t=>{if("string"!=typeof t)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof t);return JTt(t)?t.slice(2):t},ZTt.padToEven=YTt,ZTt.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof t);return pgt.byteLength(t,"utf8")},ZTt.arrayContainsArray=function(t,e,r){if(!0!==Array.isArray(t))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof t}'`);if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof e}'`);return e[!0===r?"some":"every"]((e=>t.indexOf(e)>=0))},ZTt.toAscii=function(t){let e="",r=0;const n=t.length;for("0x"===t.substring(0,2)&&(r=2);r0&&t.length!==2+2*e)},Object.defineProperty(GTt,"__esModule",{value:!0}),GTt.assertIsString=GTt.assertIsArray=GTt.assertIsBuffer=GTt.assertIsHexString=void 0;const XTt=ZTt;GTt.assertIsHexString=function(t){if(!(0,XTt.isHexString)(t)){throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${t}`)}};GTt.assertIsBuffer=function(t){if(!pgt.isBuffer(t)){throw new Error(`This method only supports Buffer but input was: ${t}`)}};GTt.assertIsArray=function(t){if(!Array.isArray(t)){throw new Error(`This method only supports number arrays but input was: ${t}`)}};GTt.assertIsString=function(t){if("string"!=typeof t){throw new Error(`This method only supports strings but input was: ${t}`)}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.intToUnpaddedBuffer=t.bigIntToUnpaddedBuffer=t.bigIntToHex=t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.short=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToInt=t.bigIntToBuffer=t.bufferToBigInt=t.bufferToHex=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;const e=GTt,r=ZTt;t.intToHex=function(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Received an invalid integer type: ${t}`);return`0x${t.toString(16)}`};t.intToBuffer=function(e){const n=(0,t.intToHex)(e);return pgt.from((0,r.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return pgt.allocUnsafe(t).fill(0)};const n=function(e,r,n){const i=(0,t.zeros)(r);return n?e.length0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t};t.unpadBuffer=function(t){return(0,e.assertIsBuffer)(t),i(t)};t.unpadArray=function(t){return(0,e.assertIsArray)(t),i(t)};t.unpadHexString=function(t){return(0,e.assertIsHexString)(t),t=(0,r.stripHexPrefix)(t),"0x"+i(t)};t.toBuffer=function(e){if(null==e)return pgt.allocUnsafe(0);if(pgt.isBuffer(e))return pgt.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return pgt.from(e);if("string"==typeof e){if(!(0,r.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return pgt.from((0,r.padToEven)((0,r.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if("bigint"==typeof e){if(e0&&0===r[0])throw new Error(`${e} cannot have leading zeroes, received: ${r.toString("hex")}`)},t.arrToBufArr=function t(e){return Array.isArray(e)?e.map((e=>t(e))):pgt.from(e)},t.bufArrToArr=function t(e){return Array.isArray(e)?e.map((e=>t(e))):Uint8Array.from(null!=e?e:[])};t.bigIntToHex=t=>"0x"+t.toString(16),t.bigIntToUnpaddedBuffer=function(e){return(0,t.unpadBuffer)(s(e))},t.intToUnpaddedBuffer=function(e){return(0,t.unpadBuffer)((0,t.intToBuffer)(e))}}(KTt),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.accountBodyToRLP=t.accountBodyToSlim=t.accountBodyFromSlim=t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;const e=Ckt,r=Zkt,n=eIt,i=qTt.exports,o=KTt,s=tIt,a=GTt,c=ZTt,u=BigInt(0);class f{constructor(t=u,e=u,r=s.KECCAK256_RLP,n=s.KECCAK256_NULL){this.nonce=t,this.balance=e,this.storageRoot=r,this.codeHash=n,this._validate()}static fromAccountData(t){const{nonce:e,balance:r,storageRoot:n,codeHash:i}=t;return new f(void 0!==e?(0,o.bufferToBigInt)((0,o.toBuffer)(e)):void 0,void 0!==r?(0,o.bufferToBigInt)((0,o.toBuffer)(r)):void 0,void 0!==n?(0,o.toBuffer)(n):void 0,void 0!==i?(0,o.toBuffer)(i):void 0)}static fromRlpSerializedAccount(t){const r=(0,o.arrToBufArr)(e.RLP.decode(Uint8Array.from(t)));if(!Array.isArray(r))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(r)}static fromValuesArray(t){const[e,r,n,i]=t;return new f((0,o.bufferToBigInt)(e),(0,o.bufferToBigInt)(r),n,i)}_validate(){if(this.nonce=8?h+=n[t].toUpperCase():h+=n[t];return h};t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.generateAddress=function(t,n){return(0,a.assertIsBuffer)(t),(0,a.assertIsBuffer)(n),(0,o.bufferToBigInt)(n)===BigInt(0)?pgt.from((0,r.keccak256)(e.RLP.encode((0,o.bufArrToArr)([t,null])))).slice(-20):pgt.from((0,r.keccak256)(e.RLP.encode((0,o.bufArrToArr)([t,n])))).slice(-20)};t.generateAddress2=function(t,e,n){if((0,a.assertIsBuffer)(t),(0,a.assertIsBuffer)(e),(0,a.assertIsBuffer)(n),20!==t.length)throw new Error("Expected from to be of length 20");if(32!==e.length)throw new Error("Expected salt to be of length 32");const i=(0,r.keccak256)(pgt.concat([pgt.from("ff","hex"),t,e,(0,r.keccak256)(n)]));return(0,o.toBuffer)(i).slice(-20)};t.isValidPrivate=function(t){return n.secp256k1.utils.isValidPrivateKey(t)};t.isValidPublic=function(t,e=!1){if((0,a.assertIsBuffer)(t),64===t.length)try{return n.secp256k1.ProjectivePoint.fromHex(pgt.concat([pgt.from([4]),t])),!0}catch(t){return!1}if(!e)return!1;try{return n.secp256k1.ProjectivePoint.fromHex(t),!0}catch(t){return!1}};t.pubToAddress=function(t,e=!1){if((0,a.assertIsBuffer)(t),e&&64!==t.length&&(t=pgt.from(n.secp256k1.ProjectivePoint.fromHex(t).toRawBytes(!1).slice(1))),64!==t.length)throw new Error("Expected pubKey to be of length 64");return pgt.from((0,r.keccak256)(t)).slice(-20)},t.publicToAddress=t.pubToAddress;t.privateToPublic=function(t){return(0,a.assertIsBuffer)(t),pgt.from(n.secp256k1.ProjectivePoint.fromPrivateKey(t).toRawBytes(!1).slice(1))};t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.importPublic=function(t){return(0,a.assertIsBuffer)(t),64!==t.length&&(t=pgt.from(n.secp256k1.ProjectivePoint.fromHex(t).toRawBytes(!1).slice(1))),t};t.zeroAddress=function(){const t=(0,o.zeros)(20);return(0,o.bufferToHex)(t)};function h(t){const[e,r,n,i]=t;return[e,r,0===(0,o.arrToBufArr)(n).length?s.KECCAK256_RLP:n,0===(0,o.arrToBufArr)(i).length?s.KECCAK256_NULL:i]}t.isZeroAddress=function(e){try{(0,a.assertIsString)(e)}catch(t){return!1}return(0,t.zeroAddress)()===e},t.accountBodyFromSlim=h;const l=new Uint8Array(0);t.accountBodyToSlim=function(t){const[e,r,n,i]=t;return[e,r,(0,o.arrToBufArr)(n).equals(s.KECCAK256_RLP)?l:n,(0,o.arrToBufArr)(i).equals(s.KECCAK256_NULL)?l:i]},t.accountBodyToRLP=function(t,r=!0){const n=r?h(t):t;return(0,o.arrToBufArr)(e.RLP.encode(n))}}(Mkt);var QTt={};Object.defineProperty(QTt,"__esModule",{value:!0}),QTt.Address=void 0;const tRt=Mkt,eRt=KTt;class rRt{constructor(t){if(20!==t.length)throw new Error("Invalid address length");this.buf=t}static zero(){return new rRt((0,eRt.zeros)(20))}static fromString(t){if(!(0,tRt.isValidAddress)(t))throw new Error("Invalid address");return new rRt((0,eRt.toBuffer)(t))}static fromPublicKey(t){if(!pgt.isBuffer(t))throw new Error("Public key should be Buffer");const e=(0,tRt.pubToAddress)(t);return new rRt(e)}static fromPrivateKey(t){if(!pgt.isBuffer(t))throw new Error("Private key should be Buffer");const e=(0,tRt.privateToAddress)(t);return new rRt(e)}static generate(t,e){if("bigint"!=typeof e)throw new Error("Expected nonce to be a bigint");return new rRt((0,tRt.generateAddress)(t.buf,(0,eRt.bigIntToBuffer)(e)))}static generate2(t,e,r){if(!pgt.isBuffer(e))throw new Error("Expected salt to be a Buffer");if(!pgt.isBuffer(r))throw new Error("Expected initCode to be a Buffer");return new rRt((0,tRt.generateAddress2)(t.buf,e,r))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(rRt.zero())}isPrecompileOrSystemAddress(){const t=(0,eRt.bufferToBigInt)(this.buf),e=BigInt(0),r=BigInt("0xffff");return t>=e&&t<=r}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return pgt.from(this.buf)}}QTt.Address=rRt;var nRt={},iRt={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=void 0;const e=KTt,r=ZTt;var n;!function(t){t[t.Number=0]="Number",t[t.BigInt=1]="BigInt",t[t.Buffer=2]="Buffer",t[t.PrefixedHexString=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=function(t,i){if(null===t)return null;if(void 0===t)return;if("string"==typeof t&&!(0,r.isHexString)(t))throw new Error(`A string must be provided with a 0x-prefix, given: ${t}`);if("number"==typeof t&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const o=(0,e.toBuffer)(t);switch(i){case n.Buffer:return o;case n.BigInt:return(0,e.bufferToBigInt)(o);case n.Number:{const t=(0,e.bufferToBigInt)(o);if(t>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(t)}case n.PrefixedHexString:return(0,e.bufferToHex)(o);default:throw new Error("unknown outputType")}}}(iRt),Object.defineProperty(nRt,"__esModule",{value:!0}),nRt.Withdrawal=void 0;const oRt=QTt,sRt=KTt,aRt=iRt;class cRt{constructor(t,e,r,n){this.index=t,this.validatorIndex=e,this.address=r,this.amount=n}static fromWithdrawalData(t){const{index:e,validatorIndex:r,address:n,amount:i}=t,o=(0,aRt.toType)(e,aRt.TypeOutput.BigInt),s=(0,aRt.toType)(r,aRt.TypeOutput.BigInt),a=new oRt.Address((0,aRt.toType)(n,aRt.TypeOutput.Buffer)),c=(0,aRt.toType)(i,aRt.TypeOutput.BigInt);return new cRt(o,s,a,c)}static fromValuesArray(t){if(4!==t.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[e,r,n,i]=t;return cRt.fromWithdrawalData({index:e,validatorIndex:r,address:n,amount:i})}static toBufferArray(t){const{index:e,validatorIndex:r,address:n,amount:i}=t,o=(0,aRt.toType)(e,aRt.TypeOutput.BigInt)===BigInt(0)?pgt.alloc(0):(0,aRt.toType)(e,aRt.TypeOutput.Buffer),s=(0,aRt.toType)(r,aRt.TypeOutput.BigInt)===BigInt(0)?pgt.alloc(0):(0,aRt.toType)(r,aRt.TypeOutput.Buffer);let a;a=n instanceof oRt.Address?n.buf:(0,aRt.toType)(n,aRt.TypeOutput.Buffer);return[o,s,a,(0,aRt.toType)(i,aRt.TypeOutput.BigInt)===BigInt(0)?pgt.alloc(0):(0,aRt.toType)(i,aRt.TypeOutput.Buffer)]}raw(){return cRt.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,sRt.bigIntToHex)(this.index),validatorIndex:(0,sRt.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,sRt.bigIntToHex)(this.amount)}}}nRt.Withdrawal=cRt;var uRt={};Object.defineProperty(uRt,"__esModule",{value:!0}),uRt.hashPersonalMessage=uRt.isValidSignature=uRt.fromRpcSig=uRt.toCompactSig=uRt.toRpcSig=uRt.ecrecover=uRt.ecsign=void 0;const fRt=Zkt,hRt=eIt,lRt=KTt,dRt=tIt,pRt=GTt;function gRt(t,e){return t===BigInt(0)||t===BigInt(1)?t:void 0===e?t-BigInt(27):t-(e*BigInt(2)+BigInt(35))}function yRt(t){return t===BigInt(0)||t===BigInt(1)}uRt.ecsign=function(t,e,r){const n=hRt.secp256k1.sign(t,e),i=n.toCompactRawBytes();return{r:pgt.from(i.slice(0,32)),s:pgt.from(i.slice(32,64)),v:void 0===r?BigInt(n.recovery+27):BigInt(n.recovery+35)+BigInt(r)*BigInt(2)}};uRt.ecrecover=function(t,e,r,n,i){const o=pgt.concat([(0,lRt.setLengthLeft)(r,32),(0,lRt.setLengthLeft)(n,32)],64),s=gRt(e,i);if(!yRt(s))throw new Error("Invalid signature v value");const a=hRt.secp256k1.Signature.fromCompact(o).addRecoveryBit(Number(s)).recoverPublicKey(t);return pgt.from(a.toRawBytes(!1).slice(1))};uRt.toRpcSig=function(t,e,r,n){if(!yRt(gRt(t,n)))throw new Error("Invalid signature v value");return(0,lRt.bufferToHex)(pgt.concat([(0,lRt.setLengthLeft)(e,32),(0,lRt.setLengthLeft)(r,32),(0,lRt.toBuffer)(t)]))};uRt.toCompactSig=function(t,e,r,n){if(!yRt(gRt(t,n)))throw new Error("Invalid signature v value");let i=r;return(t>BigInt(28)&&t%BigInt(2)===BigInt(1)||t===BigInt(1)||t===BigInt(28))&&(i=pgt.from(r),i[0]|=128),(0,lRt.bufferToHex)(pgt.concat([(0,lRt.setLengthLeft)(e,32),(0,lRt.setLengthLeft)(i,32)]))};uRt.fromRpcSig=function(t){const e=(0,lRt.toBuffer)(t);let r,n,i;if(e.length>=65)r=e.slice(0,32),n=e.slice(32,64),i=(0,lRt.bufferToBigInt)(e.slice(64));else{if(64!==e.length)throw new Error("Invalid signature length");r=e.slice(0,32),n=e.slice(32,64),i=BigInt((0,lRt.bufferToInt)(e.slice(32,33))>>7),n[0]&=127}return i<27&&(i+=BigInt(27)),{v:i,r:r,s:n}};uRt.isValidSignature=function(t,e,r,n=!0,i){if(32!==e.length||32!==r.length)return!1;if(!yRt(gRt(t,i)))return!1;const o=(0,lRt.bufferToBigInt)(e),s=(0,lRt.bufferToBigInt)(r);return!(o===BigInt(0)||o>=dRt.SECP256K1_ORDER||s===BigInt(0)||s>=dRt.SECP256K1_ORDER)&&!(n&&s>=dRt.SECP256K1_ORDER_DIV_2)};uRt.hashPersonalMessage=function(t){(0,pRt.assertIsBuffer)(t);const e=pgt.from(`Ethereum Signed Message:\n${t.length}`,"utf-8");return pgt.from((0,fRt.keccak256)(pgt.concat([e,t])))};var mRt={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.compactBytesToNibbles=t.bytesToNibbles=t.nibblesToCompactBytes=t.nibblesToBytes=t.hasTerminator=void 0;t.hasTerminator=t=>t.length>0&&16===t[t.length-1];t.nibblesToBytes=(t,e)=>{for(let r=0,n=0;n{let r=0;(0,t.hasTerminator)(e)&&(r=1,e=e.subarray(0,e.length-1));const n=new Uint8Array(e.length/2+1);return n[0]=r<<5,1&~e.length||(n[0]|=16,n[0]|=e[0],e=e.subarray(1)),(0,t.nibblesToBytes)(e,n.subarray(1)),n};t.bytesToNibbles=t=>{const e=2*t.length+1,r=new Uint8Array(e);for(let e=0;e{if(0===e.length)return e;let r=(0,t.bytesToNibbles)(e);r[0]<2&&(r=r.subarray(0,r.length-1));const n=2-(1&r[0]);return r.subarray(n)}}(mRt);var vRt={},wRt=s(ayt);Object.defineProperty(vRt,"__esModule",{value:!0}),vRt.AsyncEventEmitter=void 0;const bRt=wRt;class ERt extends bRt.EventEmitter{emit(t,...e){var r;let[n,i]=e;const o=this;let s=null!==(r=o._events[t])&&void 0!==r?r:[];return void 0===i&&"function"==typeof n&&(i=n,n=void 0),"newListener"!==t&&"removeListener"!==t||(n={event:n,fn:i},i=void 0),s=Array.isArray(s)?s:[s],async function(t,e,r){let n;for await(const i of e)try{i.length<2?i.call(t,r):await new Promise(((e,n)=>{i.call(t,r,(t=>{t?n(t):e()}))}))}catch(t){n=t}if(n)throw n}(o,s.slice(),n).then(i).catch(i),o.listenerCount(t)>0}once(t,e){const r=this;let n;if("function"!=typeof e)throw new TypeError("listener must be a function");return n=e.length>=2?function(i,o){r.removeListener(t,n),e(i,o)}:function(i){r.removeListener(t,n),e(i,n)},r.on(t,n),r}first(t,e){var r;let n=null!==(r=this._events[t])&&void 0!==r?r:[];if("function"!=typeof e)throw new TypeError("listener must be a function");return Array.isArray(n)||(this._events[t]=n=[n]),n.unshift(e),this}before(t,e,r){return this.beforeOrAfter(t,e,r)}after(t,e,r){return this.beforeOrAfter(t,e,r,"after")}beforeOrAfter(t,e,r,n){var i;let o,s,a=null!==(i=this._events[t])&&void 0!==i?i:[];const c="after"===n?1:0;if("function"!=typeof r)throw new TypeError("listener must be a function");if("function"!=typeof e)throw new TypeError("target must be a function");for(Array.isArray(a)||(this._events[t]=a=[a]),s=a.length,o=a.length;o--;)if(a[o]===e){s=o+c;break}return a.splice(s,0,r),this}on(t,e){return super.on(t,e)}addListener(t,e){return super.addListener(t,e)}prependListener(t,e){return super.prependListener(t,e)}prependOnceListener(t,e){return super.prependOnceListener(t,e)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,e){return super.removeListener(t,e)}eventNames(){return super.eventNames()}listeners(t){return super.listeners(t)}listenerCount(t){return super.listenerCount(t)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(t){return super.setMaxListeners(t)}}vRt.AsyncEventEmitter=ERt;var SRt={};Object.defineProperty(SRt,"__esModule",{value:!0}),SRt.Lock=void 0;SRt.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((t=>this.promiseResolverQueue.push(t)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const t=this.promiseResolverQueue.shift();t&&t(!0)}}};var _Rt={},ARt={};function xRt(){throw new Error("setTimeout has not been defined")}function IRt(){throw new Error("clearTimeout has not been defined")}var kRt=xRt,TRt=IRt;function RRt(t){if(kRt===setTimeout)return setTimeout(t,0);if((kRt===xRt||!kRt)&&setTimeout)return kRt=setTimeout,setTimeout(t,0);try{return kRt(t,0)}catch(e){try{return kRt.call(null,t,0)}catch(e){return kRt.call(this,t,0)}}}"function"==typeof Qpt.setTimeout&&(kRt=setTimeout),"function"==typeof Qpt.clearTimeout&&(TRt=clearTimeout);var BRt,ORt=[],MRt=!1,CRt=-1;function LRt(){MRt&&BRt&&(MRt=!1,BRt.length?ORt=BRt.concat(ORt):CRt=-1,ORt.length&&PRt())}function PRt(){if(!MRt){var t=RRt(LRt);MRt=!0;for(var e=ORt.length;e;){for(BRt=ORt,ORt=[];++CRt1)for(var r=1;r=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),_Bt(e)?r.showHidden=e:e&&FBt(r,e),RBt(r.showHidden)&&(r.showHidden=!1),RBt(r.depth)&&(r.depth=2),RBt(r.colors)&&(r.colors=!1),RBt(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=mBt),wBt(r,t,r.depth)}function mBt(t,e){var r=yBt.styles[e];return r?"["+yBt.colors[r][0]+"m"+t+"["+yBt.colors[r][1]+"m":t}function vBt(t,e){return t}function wBt(t,e,r){if(t.customInspect&&e&&LBt(e.inspect)&&e.inspect!==yBt&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,t);return kBt(n)||(n=wBt(t,n,r)),n}var i=function(t,e){if(RBt(e))return t.stylize("undefined","undefined");if(kBt(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(IBt(e))return t.stylize(""+e,"number");if(_Bt(e))return t.stylize(""+e,"boolean");if(ABt(e))return t.stylize("null","null")}(t,e);if(i)return i;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),CBt(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return bBt(e);if(0===o.length){if(LBt(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(BBt(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(MBt(e))return t.stylize(Date.prototype.toString.call(e),"date");if(CBt(e))return bBt(e)}var c,u="",f=!1,h=["{","}"];(SBt(e)&&(f=!0,h=["[","]"]),LBt(e))&&(u=" [Function"+(e.name?": "+e.name:"")+"]");return BBt(e)&&(u=" "+RegExp.prototype.toString.call(e)),MBt(e)&&(u=" "+Date.prototype.toUTCString.call(e)),CBt(e)&&(u=" "+bBt(e)),0!==o.length||f&&0!=e.length?r<0?BBt(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=f?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,u,h)):h[0]+u+h[1]}function bBt(t){return"["+Error.prototype.toString.call(t)+"]"}function EBt(t,e,r,n,i,o){var s,a,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),HBt(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=ABt(r)?wBt(t,c.value,null):wBt(t,c.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),RBt(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function SBt(t){return Array.isArray(t)}function _Bt(t){return"boolean"==typeof t}function ABt(t){return null===t}function xBt(t){return null==t}function IBt(t){return"number"==typeof t}function kBt(t){return"string"==typeof t}function TBt(t){return"symbol"==typeof t}function RBt(t){return void 0===t}function BBt(t){return OBt(t)&&"[object RegExp]"===UBt(t)}function OBt(t){return"object"==typeof t&&null!==t}function MBt(t){return OBt(t)&&"[object Date]"===UBt(t)}function CBt(t){return OBt(t)&&("[object Error]"===UBt(t)||t instanceof Error)}function LBt(t){return"function"==typeof t}function PBt(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function NBt(t){return pgt.isBuffer(t)}function UBt(t){return Object.prototype.toString.call(t)}function jBt(t){return t<10?"0"+t.toString(10):t.toString(10)}yBt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},yBt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var DBt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function zBt(){console.log("%s - %s",function(){var t=new Date,e=[jBt(t.getHours()),jBt(t.getMinutes()),jBt(t.getSeconds())].join(":");return[t.getDate(),DBt[t.getMonth()],e].join(" ")}(),hBt.apply(null,arguments))}function FBt(t,e){if(!e||!OBt(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function HBt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var $Bt="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function qBt(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if($Bt&&t[$Bt]){var e;if("function"!=typeof(e=t[$Bt]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,$Bt,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o0?this.tail.next=e:this.head=e,this.tail=e,++this.length},ZBt.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},ZBt.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},ZBt.prototype.clear=function(){this.head=this.tail=null,this.length=0},ZBt.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},ZBt.prototype.concat=function(t){if(0===this.length)return pgt.alloc(0);if(1===this.length)return this.head.data;for(var e=pgt.allocUnsafe(t>>>0),r=this.head,n=0;r;)r.data.copy(e,n),n+=r.data.length,r=r.next;return e};var JBt=pgt.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function YBt(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!JBt(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=QBt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=tOt;break;default:return void(this.write=XBt)}this.charBuffer=new pgt(6),this.charReceived=0,this.charLength=0}function XBt(t){return t.toString(this.encoding)}function QBt(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function tOt(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}YBt.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived);var i;n=(e+=t.toString(this.encoding,0,n)).length-1;if((i=e.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,n)}return e},YBt.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},YBt.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e},nOt.ReadableState=rOt;var eOt=gBt("stream");function rOt(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof OOt&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new ZBt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(this.decoder=new YBt(t.encoding),this.encoding=t.encoding)}function nOt(t){if(!(this instanceof nOt))return new nOt(t);this._readableState=new rOt(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),eyt.call(this)}function iOt(t,e,r,n,i){var o=function(t,e){var r=null;pgt.isBuffer(e)||"string"==typeof e||null==e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(e,r);if(o)t.emit("error",o);else if(null===r)e.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,aOt(t)}(t,e);else if(e.objectMode||r&&r.length>0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var a=new Error("stream.unshift() after end event");t.emit("error",a)}else{var c;!e.decoder||i||n||(r=e.decoder.write(r),c=!e.objectMode&&0===r.length),i||(e.reading=!1),c||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&aOt(t))),function(t,e){e.readingMore||(e.readingMore=!0,NRt(uOt,t,e))}(t,e)}else i||(e.reading=!1);return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=oOt?t=oOt:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function aOt(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(eOt("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?NRt(cOt,t):cOt(t))}function cOt(t){eOt("emit readable"),t.emit("readable"),lOt(t)}function uOt(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=pgt.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function pOt(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,NRt(gOt,e,t))}function gOt(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function yOt(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return eOt("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?pOt(this):aOt(this),null;if(0===(t=sOt(t,e))&&e.ended)return 0===e.length&&pOt(this),null;var n,i=e.needReadable;return eOt("need readable",i),(0===e.length||e.length-t0?dOt(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&pOt(this)),null!==n&&this.emit("data",n),n},nOt.prototype._read=function(t){this.emit("error",new Error("not implemented"))},nOt.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,eOt("pipe count=%d opts=%j",n.pipesCount,e);var i=!e||!1!==e.end?s:u;function o(t){eOt("onunpipe"),t===r&&u()}function s(){eOt("onend"),t.end()}n.endEmitted?NRt(i):r.once("end",i),t.on("unpipe",o);var a=function(t){return function(){var e=t._readableState;eOt("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&t.listeners("data").length&&(e.flowing=!0,lOt(t))}}(r);t.on("drain",a);var c=!1;function u(){eOt("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",a),t.removeListener("error",l),t.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",u),r.removeListener("data",h),c=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||a()}var f=!1;function h(e){eOt("ondata"),f=!1,!1!==t.write(e)||f||((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==yOt(n.pipes,t))&&!c&&(eOt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function l(e){eOt("onerror",e),g(),t.removeListener("error",l),0===function(t,e){return t.listeners(e).length}(t,"error")&&t.emit("error",e)}function d(){t.removeListener("finish",p),g()}function p(){eOt("onfinish"),t.removeListener("close",d),g()}function g(){eOt("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",l),t.once("close",d),t.once("finish",p),t.emit("pipe",r),n.flowing||(eOt("pipe resume"),r.resume()),t},nOt.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},bOt.prototype._write=function(t,e,r){r(new Error("not implemented"))},bOt.prototype._writev=null,bOt.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,IOt(t,e),r&&(e.finished?NRt(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},cBt(OOt,nOt);for(var TOt=Object.keys(bOt.prototype),ROt=0;ROtt._pos){var n=r.substr(t._pos);if("x-user-defined"===t._charset){for(var i=new pgt(n.length),o=0;ot._pos&&(t.push(new pgt(new Uint8Array(s.result.slice(t._pos)))),t._pos=s.result.byteLength)},s.onload=function(){t.push(null)},s.readAsArrayBuffer(r)}t._xhr.readyState===zOt&&"ms-stream"!==t._mode&&t.push(null)},cBt(HOt,bOt);var $Ot=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];HOt.prototype.setHeader=function(t,e){var r=t.toLowerCase();-1===$Ot.indexOf(r)&&(this._headers[r]={name:t,value:e})},HOt.prototype.getHeader=function(t){return this._headers[t.toLowerCase()].value},HOt.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},HOt.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e,r=t._opts,n=t._headers;if("POST"!==r.method&&"PUT"!==r.method&&"PATCH"!==r.method||(e=function(){if(void 0!==ZRt)return ZRt;try{new Qpt.Blob([new ArrayBuffer(1)]),ZRt=!0}catch(t){ZRt=!1}return ZRt}()?new Qpt.Blob(t._body.map((function(t){return function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if("function"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(Ygt(t)){for(var e=new Uint8Array(t.length),r=t.length,n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},GOt=Math.floor,ZOt=String.fromCharCode;function JOt(t){throw new RangeError(KOt[t])}function YOt(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function XOt(t,e,r){var n=0;for(t=r?GOt(t/700):t>>1,t+=GOt(t/e);t>455;n+=36)t=GOt(t/35);return GOt(n+36*t/(t+38))}function QOt(t){return function(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]);var i=function(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}((t=t.replace(VOt,".")).split("."),e).join(".");return n+i}(t,(function(t){return WOt.test(t)?"xn--"+function(t){var e,r,n,i,o,s,a,c,u,f,h,l,d,p,g,y=[];for(t=function(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i=e&&hGOt((qOt-r)/(d=n+1))&&JOt("overflow"),r+=(a-e)*d,e=a,s=0;sqOt&&JOt("overflow"),h==e){for(c=r,u=36;!(c<(f=u<=o?1:u>=o+26?26:u-o));u+=36)g=c-f,p=36-f,y.push(ZOt(YOt(f+g%p,0))),c=GOt(g/p);y.push(ZOt(YOt(c,0))),o=XOt(r,d,n==i),r=0,++n}++r,++e}return y.join("")}(t):t}))}function tMt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var eMt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function rMt(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}function nMt(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n0&&a>s&&(a=s);for(var c=0;c=0?(u=d.substr(0,p),f=d.substr(p+1)):(u=d,f=""),h=decodeURIComponent(u),l=decodeURIComponent(f),tMt(i,h)?eMt(i[h])?i[h].push(l):i[h]=[i[h],l]:i[h]=l}return i}const sMt=Qpt.URL,aMt=Qpt.URLSearchParams;var cMt={parse:_Mt,resolve:TMt,resolveObject:RMt,fileURLToPath:xMt,format:IMt,Url:uMt,URL:sMt,URLSearchParams:aMt};function uMt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var fMt=/^([a-z0-9.+-]+:)/i,hMt=/:[0-9]*$/,lMt=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,dMt=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),pMt=["'"].concat(dMt),gMt=["%","/","?",";","#"].concat(pMt),yMt=["/","?","#"],mMt=255,vMt=/^[+a-z0-9A-Z_-]{0,63}$/,wMt=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,bMt={javascript:!0,"javascript:":!0},EMt={javascript:!0,"javascript:":!0},SMt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function _Mt(t,e,r){if(t&&OBt(t)&&t instanceof uMt)return t;var n=new uMt;return n.parse(t,e,r),n}function AMt(t,e,r,n){if(!kBt(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),o=-1!==i&&i127?S+="x":S+=E[_];if(!S.match(vMt)){var x=b.slice(0,u),I=b.slice(u+1),k=E.match(wMt);k&&(x.push(k[1]),I.unshift(k[2])),I.length&&(a="/"+I.join(".")+a),t.hostname=x.join(".");break}}}}t.hostname.length>mMt?t.hostname="":t.hostname=t.hostname.toLowerCase(),w||(t.hostname=QOt(t.hostname)),l=t.port?":"+t.port:"";var T=t.hostname||"";t.host=T+l,t.href+=t.host,w&&(t.hostname=t.hostname.substr(1,t.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!bMt[p])for(u=0,h=pMt.length;u0)&&n.host.split("@"))&&(n.auth=g.shift(),n.host=n.hostname=g.shift())),n.search=t.search,n.query=t.query,ABt(n.pathname)&&ABt(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!b.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=b.slice(-1)[0],_=(n.host||t.host||b.length>1)&&("."===S||".."===S)||""===S,A=0,x=b.length;x>=0;x--)"."===(S=b[x])?b.splice(x,1):".."===S?(b.splice(x,1),A++):A&&(b.splice(x,1),A--);if(!v&&!w)for(;A--;A)b.unshift("..");!v||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),_&&"/"!==b.join("/").substr(-1)&&b.push("");var I=""===b[0]||b[0]&&"/"===b[0].charAt(0);return E&&(n.hostname=n.host=I?"":b.length?b.shift():"",(g=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=g.shift(),n.host=n.hostname=g.shift())),(v=v||n.host&&b.length)&&!I&&b.unshift(""),b.length?n.pathname=b.join("/"):(n.pathname=null,n.path=null),ABt(n.pathname)&&ABt(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},uMt.prototype.parseHost=function(){return BMt(this)};var OMt=Object.freeze({__proto__:null,parse:_Mt,resolve:TMt,resolveObject:RMt,fileURLToPath:xMt,format:IMt,URL:sMt,URLSearchParams:aMt,default:cMt,Url:uMt});function MMt(t,e){"string"==typeof t&&(t=_Mt(t));var r=-1===Qpt.location.protocol.search(/^https?:$/)?"http:":"",n=t.protocol||r,i=t.hostname||t.host,o=t.port,s=t.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),t.url=(i?n+"//"+i:"")+(o?":"+o:"")+s,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var a=new HOt(t);return e&&a.on("response",e),a}function CMt(t,e){var r=MMt(t,e);return r.end(),r}function LMt(){}LMt.defaultMaxSockets=4;var PMt=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],NMt={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},UMt={request:MMt,get:CMt,Agent:LMt,METHODS:PMt,STATUS_CODES:NMt},jMt=s(Object.freeze({__proto__:null,request:MMt,get:CMt,Agent:LMt,METHODS:PMt,STATUS_CODES:NMt,default:UMt}));function DMt(t,e){"string"==typeof t&&(t=_Mt(t));var r=-1===Qpt.location.protocol.search(/^https?:$/)?"http:":"",n=t.protocol||r,i=t.hostname||t.host,o=t.port,s=t.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),t.url=(i?n+"//"+i:"")+(o?":"+o:"")+s,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var a=new HOt(t);return e&&a.on("response",e),a}function zMt(t,e){var r=DMt(t,e);return r.end(),r}function FMt(){}FMt.defaultMaxSockets=4;var HMt=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],$Mt={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},qMt={request:DMt,get:zMt,Agent:FMt,METHODS:HMt,STATUS_CODES:$Mt},WMt=s(Object.freeze({__proto__:null,request:DMt,get:zMt,Agent:FMt,METHODS:HMt,STATUS_CODES:$Mt,default:qMt})),VMt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function KMt(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function GMt(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o=0;)t[e]=0}var QMt=256,tCt=286,eCt=30,rCt=15,nCt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],iCt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],oCt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],sCt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],aCt=new Array(576);XMt(aCt);var cCt=new Array(60);XMt(cCt);var uCt=new Array(512);XMt(uCt);var fCt=new Array(256);XMt(fCt);var hCt=new Array(29);XMt(hCt);var lCt,dCt,pCt,gCt=new Array(eCt);function yCt(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function mCt(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function vCt(t){return t<256?uCt[t]:uCt[256+(t>>>7)]}function wCt(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function bCt(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1}function _Ct(t,e,r){var n,i,o=new Array(16),s=0;for(n=1;n<=rCt;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=e;i++){var a=t[2*i+1];0!==a&&(t[2*i]=SCt(o[a]++,a))}}function ACt(t){var e;for(e=0;e8?wCt(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function ICt(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)kCt(t,o,r);i=c;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],kCt(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,kCt(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,s,a,c=e.dyn_tree,u=e.max_code,f=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(o=0;o<=rCt;o++)t.bl_count[o]=0;for(c[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(o=c[2*c[2*(n=t.heap[r])+1]+1]+1)>p&&(o=p,g++),c[2*n+1]=o,n>u||(t.bl_count[o]++,s=0,n>=d&&(s=l[n-d]),a=c[2*n],t.opt_len+=a*(o+s),h&&(t.static_len+=a*(f[2*n+1]+s)));if(0!==g){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(n=t.bl_count[o];0!==n;)(i=t.heap[--r])>u||(c[2*i+1]!==o&&(t.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}(t,e),_Ct(o,u,t.bl_count)}function BCt(t,e,r){var n,i,o=-1,s=e[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=e[2*(n+1)+1],++a>=7;n=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}function NCt(t,e,r,n){var i,o,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e=3&&0===t.bl_tree[2*sCt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?LCt(t,e,r,n):4===t.strategy||o===i?(bCt(t,2+(n?1:0),3),TCt(t,aCt,cCt)):(bCt(t,4+(n?1:0),3),function(t,e,r,n){var i;for(bCt(t,e-257,5),bCt(t,r-1,5),bCt(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(fCt[r]+QMt+1)]++,t.dyn_dtree[2*vCt(e)]++),t.last_lit===t.lit_bufsize-1}function jCt(t,e,r,n){for(var i=65535&t,o=t>>>16&65535,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16}var DCt=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();function zCt(t,e,r,n){var i=DCt,o=n+r;t^=-1;for(var s=n;s>>8^i[255&(t^e[s])];return~t}var FCt,HCt=-2,$Ct=258,qCt=262,WCt=103,VCt=113,KCt=666;function GCt(t,e){return t.msg=VMt[e],e}function ZCt(t){return(t<<1)-(t>4?9:0)}function JCt(t){for(var e=t.length;--e>=0;)t[e]=0}function YCt(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(GMt(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function XCt(t,e){NCt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,YCt(t.strm)}function QCt(t,e){t.pending_buf[t.pending++]=e}function tLt(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function eLt(t,e,r,n){var i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,GMt(e,t.input,t.next_in,i,r),1===t.state.wrap?t.adler=jCt(t.adler,e,i,r):2===t.state.wrap&&(t.adler=zCt(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)}function rLt(t,e){var r,n,i=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,c=t.strstart>t.w_size-qCt?t.strstart-(t.w_size-qCt):0,u=t.window,f=t.w_mask,h=t.prev,l=t.strstart+$Ct,d=u[o+s-1],p=u[o+s];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(r=e)+s]===p&&u[r+s-1]===d&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&os){if(t.match_start=e,s=n,n>=a)break;d=u[o+s-1],p=u[o+s]}}}while((e=h[e&f])>c&&0!=--i);return s<=t.lookahead?s:t.lookahead}function nLt(t){var e,r,n,i,o,s=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-qCt)){GMt(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--r);e=r=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--r);i+=s}if(0===t.strm.avail_in)break;if(r=eLt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=r,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=UCt(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=UCt(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<5||e<0)return t?GCt(t,HCt):HCt;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||n.status===KCt&&4!==e)return GCt(t,0===t.avail_out?-5:HCt);if(n.strm=t,r=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,QCt(n,31),QCt(n,139),QCt(n,8),n.gzhead?(QCt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),QCt(n,255&n.gzhead.time),QCt(n,n.gzhead.time>>8&255),QCt(n,n.gzhead.time>>16&255),QCt(n,n.gzhead.time>>24&255),QCt(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),QCt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(QCt(n,255&n.gzhead.extra.length),QCt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=zCt(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(QCt(n,0),QCt(n,0),QCt(n,0),QCt(n,0),QCt(n,0),QCt(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),QCt(n,3),n.status=VCt);else{var s=8+(n.w_bits-8<<4)<<8;s|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=VCt,tLt(n,s),0!==n.strstart&&(tLt(n,t.adler>>>16),tLt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(t.adler=zCt(t.adler,n.pending_buf,n.pending-i,i)),YCt(t),i=n.pending,n.pending!==n.pending_buf_size));)QCt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(t.adler=zCt(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=zCt(t.adler,n.pending_buf,n.pending-i,i)),YCt(t),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(t.adler=zCt(t.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=zCt(t.adler,n.pending_buf,n.pending-i,i)),YCt(t),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(t.adler=zCt(t.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=WCt)}else n.status=WCt;if(n.status===WCt&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&YCt(t),n.pending+2<=n.pending_buf_size&&(QCt(n,255&t.adler),QCt(n,t.adler>>8&255),t.adler=0,n.status=VCt)):n.status=VCt),0!==n.pending){if(YCt(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&ZCt(e)<=ZCt(r)&&4!==e)return GCt(t,-5);if(n.status===KCt&&0!==t.avail_in)return GCt(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&n.status!==KCt){var a=2===n.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(nLt(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=UCt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(XCt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(XCt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(XCt(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var r,n,i,o,s=t.window;;){if(t.lookahead<=$Ct){if(nLt(t),t.lookahead<=$Ct&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=t.strstart+$Ct;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=UCt(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=UCt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(XCt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(XCt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(XCt(t,!1),0===t.strm.avail_out)?1:2}(n,e):FCt[n.level].func(n,e);if(3!==a&&4!==a||(n.status=KCt),1===a||3===a)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===a&&(1===e?PCt(n):5!==e&&(LCt(n,0,0,!1),3===e&&(JCt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),YCt(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(QCt(n,255&t.adler),QCt(n,t.adler>>8&255),QCt(n,t.adler>>16&255),QCt(n,t.adler>>24&255),QCt(n,255&t.total_in),QCt(n,t.total_in>>8&255),QCt(n,t.total_in>>16&255),QCt(n,t.total_in>>24&255)):(tLt(n,t.adler>>>16),tLt(n,65535&t.adler)),YCt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)}FCt=[new sLt(0,0,0,0,(function(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(nLt(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,XCt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-qCt&&(XCt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(XCt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(XCt(t,!1),t.strm.avail_out),1)})),new sLt(4,4,8,4,iLt),new sLt(4,5,16,8,iLt),new sLt(4,6,32,32,iLt),new sLt(4,4,16,16,oLt),new sLt(8,16,32,32,oLt),new sLt(8,16,128,128,oLt),new sLt(8,32,128,256,oLt),new sLt(32,128,258,1024,oLt),new sLt(32,258,258,4096,oLt)];function fLt(t,e){var r,n,i,o,s,a,c,u,f,h,l,d,p,g,y,m,v,w,b,E,S,_,A,x,I;r=t.state,n=t.next_in,x=t.input,i=n+(t.avail_in-5),o=t.next_out,I=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),c=r.dmax,u=r.wsize,f=r.whave,h=r.wnext,l=r.window,d=r.hold,p=r.bits,g=r.lencode,y=r.distcode,m=(1<>>=b=w>>>24,p-=b,0===(b=w>>>16&255))I[o++]=65535&w;else{if(!(16&b)){if(64&b){if(32&b){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}w=g[(65535&w)+(d&(1<>>=b,p-=b),p<15&&(d+=x[n++]<>>=b=w>>>24,p-=b,16&(b=w>>>16&255)){if(S=65535&w,p<(b&=15)&&(d+=x[n++]<c){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=b,p-=b,S>(b=o-s)){if((b=S-b)>f&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(_=0,A=l,0===h){if(_+=u-b,b2;)I[o++]=A[_++],I[o++]=A[_++],I[o++]=A[_++],E-=3;E&&(I[o++]=A[_++],E>1&&(I[o++]=A[_++]))}else{_=o-S;do{I[o++]=I[_++],I[o++]=I[_++],I[o++]=I[_++],E-=3}while(E>2);E&&(I[o++]=I[_++],E>1&&(I[o++]=I[_++]))}break}if(64&b){t.msg="invalid distance code",r.mode=30;break t}w=y[(65535&w)+(d&(1<>3,d&=(1<<(p-=E<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n=1&&0===B[E];E--);if(S>E&&(S=E),0===E)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(b=1;b0&&(0===t||1!==E))return-1;for(O[1]=0,v=1;v852||2===t&&I>592)return 1;for(;;){p=v-A,s[w]d?(g=M[C+s[w]],y=T[R+s[w]]):(g=96,y=0),c=1<>A)+(u-=c)]=p<<24|g<<16|y}while(0!==u);for(c=1<>=1;if(0!==c?(k&=c-1,k+=c):k=0,w++,0==--B[v]){if(v===E)break;v=e[r+s[w]]}if(v>S&&(k&h)!==f){for(0===A&&(A=S),l+=b,x=1<<(_=v-A);_+A852||2===t&&I>592)return 1;i[f=k&h]=S<<24|_<<16|l-o}}return 0!==k&&(i[l+k]=v-A<<24|64<<16),a.bits=S,0}var mLt=-2,vLt=12,wLt=30;function bLt(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function ELt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new JMt(320),this.work=new JMt(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function SLt(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,function(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new YMt(852),e.distcode=e.distdyn=new YMt(592),e.sane=1,e.back=-1,0):mLt}(t)):mLt}function _Lt(t,e){var r,n;return t?(n=new ELt,t.state=n,n.window=null,r=function(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?mLt:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,SLt(t))):mLt}(t,e),0!==r&&(t.state=null),r):mLt}var ALt,xLt,ILt=!0;function kLt(t){if(ILt){var e;for(ALt=new YMt(512),xLt=new YMt(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(yLt(1,t.lens,0,288,ALt,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;yLt(2,t.lens,0,32,xLt,0,t.work,{bits:5}),ILt=!1}t.lencode=ALt,t.lenbits=9,t.distcode=xLt,t.distbits=5}function TLt(t,e){var r,n,i,o,s,a,c,u,f,h,l,d,p,g,y,m,v,w,b,E,S,_,A,x,I=0,k=new ZMt(4),T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return mLt;(r=t.state).mode===vLt&&(r.mode=13),s=t.next_out,i=t.output,c=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,u=r.hold,f=r.bits,h=a,l=c,_=0;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;f<16;){if(0===a)break t;a--,u+=n[o++]<>>8&255,r.check=zCt(r.check,k,2,0),u=0,f=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",r.mode=wLt;break}if(8!=(15&u)){t.msg="unknown compression method",r.mode=wLt;break}if(f-=4,S=8+(15&(u>>>=4)),0===r.wbits)r.wbits=S;else if(S>r.wbits){t.msg="invalid window size",r.mode=wLt;break}r.dmax=1<>8&1),512&r.flags&&(k[0]=255&u,k[1]=u>>>8&255,r.check=zCt(r.check,k,2,0)),u=0,f=0,r.mode=3;case 3:for(;f<32;){if(0===a)break t;a--,u+=n[o++]<>>8&255,k[2]=u>>>16&255,k[3]=u>>>24&255,r.check=zCt(r.check,k,4,0)),u=0,f=0,r.mode=4;case 4:for(;f<16;){if(0===a)break t;a--,u+=n[o++]<>8),512&r.flags&&(k[0]=255&u,k[1]=u>>>8&255,r.check=zCt(r.check,k,2,0)),u=0,f=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===a)break t;a--,u+=n[o++]<>>8&255,r.check=zCt(r.check,k,2,0)),u=0,f=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>a&&(d=a),d&&(r.head&&(S=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),GMt(r.head.extra,n,o,d,S)),512&r.flags&&(r.check=zCt(r.check,n,d,o)),a-=d,o+=d,r.length-=d),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===a)break t;d=0;do{S=n[o+d++],r.head&&S&&r.length<65536&&(r.head.name+=String.fromCharCode(S))}while(S&&d>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=vLt;break;case 10:for(;f<32;){if(0===a)break t;a--,u+=n[o++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===a)break t;a--,u+=n[o++]<>>=1)){case 0:r.mode=14;break;case 1:if(kLt(r),r.mode=20,6===e){u>>>=2,f-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=wLt}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===a)break t;a--,u+=n[o++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=wLt;break}if(r.length=65535&u,u=0,f=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(d=r.length){if(d>a&&(d=a),d>c&&(d=c),0===d)break t;GMt(i,n,o,d,s),a-=d,o+=d,c-=d,s+=d,r.length-=d;break}r.mode=vLt;break;case 17:for(;f<14;){if(0===a)break t;a--,u+=n[o++]<>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=wLt;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,f-=3}for(;r.have<19;)r.lens[T[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,A={bits:r.lenbits},_=yLt(0,r.lens,0,19,r.lencode,0,r.work,A),r.lenbits=A.bits,_){t.msg="invalid code lengths set",r.mode=wLt;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,v=65535&I,!((y=I>>>24)<=f);){if(0===a)break t;a--,u+=n[o++]<>>=y,f-=y,r.lens[r.have++]=v;else{if(16===v){for(x=y+2;f>>=y,f-=y,0===r.have){t.msg="invalid bit length repeat",r.mode=wLt;break}S=r.lens[r.have-1],d=3+(3&u),u>>>=2,f-=2}else if(17===v){for(x=y+3;f>>=y)),u>>>=3,f-=3}else{for(x=y+7;f>>=y)),u>>>=7,f-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=wLt;break}for(;d--;)r.lens[r.have++]=S}}if(r.mode===wLt)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=wLt;break}if(r.lenbits=9,A={bits:r.lenbits},_=yLt(1,r.lens,0,r.nlen,r.lencode,0,r.work,A),r.lenbits=A.bits,_){t.msg="invalid literal/lengths set",r.mode=wLt;break}if(r.distbits=6,r.distcode=r.distdyn,A={bits:r.distbits},_=yLt(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,A),r.distbits=A.bits,_){t.msg="invalid distances set",r.mode=wLt;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(a>=6&&c>=258){t.next_out=s,t.avail_out=c,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=f,fLt(t,l),s=t.next_out,i=t.output,c=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,u=r.hold,f=r.bits,r.mode===vLt&&(r.back=-1);break}for(r.back=0;m=(I=r.lencode[u&(1<>>16&255,v=65535&I,!((y=I>>>24)<=f);){if(0===a)break t;a--,u+=n[o++]<>w)])>>>16&255,v=65535&I,!(w+(y=I>>>24)<=f);){if(0===a)break t;a--,u+=n[o++]<>>=w,f-=w,r.back+=w}if(u>>>=y,f-=y,r.back+=y,r.length=v,0===m){r.mode=26;break}if(32&m){r.back=-1,r.mode=vLt;break}if(64&m){t.msg="invalid literal/length code",r.mode=wLt;break}r.extra=15&m,r.mode=22;case 22:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;m=(I=r.distcode[u&(1<>>16&255,v=65535&I,!((y=I>>>24)<=f);){if(0===a)break t;a--,u+=n[o++]<>w)])>>>16&255,v=65535&I,!(w+(y=I>>>24)<=f);){if(0===a)break t;a--,u+=n[o++]<>>=w,f-=w,r.back+=w}if(u>>>=y,f-=y,r.back+=y,64&m){t.msg="invalid distance code",r.mode=wLt;break}r.offset=v,r.extra=15&m,r.mode=24;case 24:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=wLt;break}r.mode=25;case 25:if(0===c)break t;if(d=l-c,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=wLt;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),g=r.window}else g=i,p=s-r.offset,d=r.length;d>c&&(d=c),c-=d,r.length-=d;do{i[s++]=g[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===c)break t;i[s++]=r.length,c--,r.mode=21;break;case 27:if(r.wrap){for(;f<32;){if(0===a)break t;a--,u|=n[o++]<=o.wsize?(GMt(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),GMt(o.window,e,r-n,i,o.wnext),(n-=i)?(GMt(o.window,e,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave7)throw new TypeError("Bad argument");this.mode=t,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function OLt(t,e){for(var r=0;r15&&(s=2,n-=16),i<1||i>9||8!==r||n<8||n>15||e<0||e>9||o<0||o>4)return GCt(t,HCt);8===n&&(n=9);var a=new aLt;return t.state=a,a.strm=t,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<CLt.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBitsCLt.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.levelCLt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevelCLt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=CLt.Z_FILTERED&&t.strategy!=CLt.Z_HUFFMAN_ONLY&&t.strategy!=CLt.Z_RLE&&t.strategy!=CLt.Z_FIXED&&t.strategy!=CLt.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!pgt.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new CLt.Zlib(e);var r=this;this._hadError=!1,this._binding.onerror=function(t,e){r._binding=null,r._hadError=!0;var n=new Error(t);n.errno=e,n.code=LLt[e],r.emit("error",n)};var n=CLt.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(n=t.level);var i=CLt.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(i=t.strategy),this._binding.init(t.windowBits||CLt.Z_DEFAULT_WINDOWBITS,n,t.memLevel||CLt.Z_DEFAULT_MEMLEVEL,i,t.dictionary),this._buffer=new pgt(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=i,this.once("end",this.close)}Object.keys(LLt).forEach((function(t){LLt[LLt[t]]=t})),cBt(hPt,POt),hPt.prototype.params=function(t,e,r){if(tCLt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+t);if(e!=CLt.Z_FILTERED&&e!=CLt.Z_HUFFMAN_ONLY&&e!=CLt.Z_RLE&&e!=CLt.Z_FIXED&&e!=CLt.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+e);if(this._level!==t||this._strategy!==e){var n=this;this.flush(CLt.Z_SYNC_FLUSH,(function(){n._binding.params(t,e),n._hadError||(n._level=t,n._strategy=e,r&&r())}))}else YRt.nextTick(r)},hPt.prototype.reset=function(){return this._binding.reset()},hPt.prototype._flush=function(t){this._transform(new pgt(0),"",t)},hPt.prototype.flush=function(t,e){var r=this._writableState;if(("function"==typeof t||void 0===t&&!e)&&(e=t,t=CLt.Z_FULL_FLUSH),r.ended)e&&YRt.nextTick(e);else if(r.ending)e&&this.once("end",e);else if(r.needDrain){var n=this;this.once("drain",(function(){n.flush(e)}))}else this._flushFlag=t,this.write(new pgt(0),"",e)},hPt.prototype.close=function(t){if(t&&YRt.nextTick(t),!this._closed){this._closed=!0,this._binding.close();var e=this;YRt.nextTick((function(){e.emit("close")}))}},hPt.prototype._transform=function(t,e,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!t||i.length===t.length);if(null===!t&&!pgt.isBuffer(t))return r(new Error("invalid input"));o?n=CLt.Z_FINISH:(n=this._flushFlag,t.length>=i.length&&(this._flushFlag=this._opts.flush||CLt.Z_NO_FLUSH)),this._processChunk(t,n,r)},hPt.prototype._processChunk=function(t,e,r){var n=t&&t.length,i=this._chunkSize-this._offset,o=0,s=this,a="function"==typeof r;if(!a){var c,u=[],f=0;this.on("error",(function(t){c=t}));do{var h=this._binding.writeSync(e,t,o,n,this._buffer,this._offset,i)}while(!this._hadError&&p(h[0],h[1]));if(this._hadError)throw c;var l=pgt.concat(u,f);return this.close(),l}var d=this._binding.write(e,t,o,n,this._buffer,this._offset,i);function p(c,h){if(!s._hadError){var l=i-h;if(function(t,e){if(!t)throw new Error(e)}(l>=0,"have should not go down"),l>0){var d=s._buffer.slice(s._offset,s._offset+l);s._offset+=l,a?s.push(d):(u.push(d),f+=d.length)}if((0===h||s._offset>=s._chunkSize)&&(i=s._chunkSize,s._offset=0,s._buffer=new pgt(s._chunkSize)),0===h){if(o+=n-c,n=c,!a)return!0;var g=s._binding.write(e,t,o,n,s._buffer,s._offset,s._chunkSize);return g.callback=p,void(g.buffer=t)}if(!a)return!1;r()}}d.buffer=t,d.callback=p},cBt(iPt,hPt),cBt(oPt,hPt),cBt(sPt,hPt),cBt(aPt,hPt),cBt(cPt,hPt),cBt(uPt,hPt),cBt(fPt,hPt);var lPt={codes:LLt,createDeflate:PLt,createInflate:NLt,createDeflateRaw:ULt,createInflateRaw:jLt,createGzip:DLt,createGunzip:zLt,createUnzip:FLt,deflate:HLt,deflateSync:$Lt,gzip:qLt,gzipSync:WLt,deflateRaw:VLt,deflateRawSync:KLt,unzip:GLt,unzipSync:ZLt,inflate:JLt,inflateSync:YLt,gunzip:XLt,gunzipSync:QLt,inflateRaw:tPt,inflateRawSync:ePt,Deflate:iPt,Inflate:oPt,Gzip:sPt,Gunzip:aPt,DeflateRaw:cPt,InflateRaw:uPt,Unzip:fPt,Zlib:hPt},dPt=s(Object.freeze({__proto__:null,codes:LLt,createDeflate:PLt,createInflate:NLt,createDeflateRaw:ULt,createInflateRaw:jLt,createGzip:DLt,createGunzip:zLt,createUnzip:FLt,deflate:HLt,deflateSync:$Lt,gzip:qLt,gzipSync:WLt,deflateRaw:VLt,deflateRawSync:KLt,unzip:GLt,unzipSync:ZLt,inflate:JLt,inflateSync:YLt,gunzip:XLt,gunzipSync:QLt,inflateRaw:tPt,inflateRawSync:ePt,Deflate:iPt,Inflate:oPt,Gzip:sPt,Gunzip:aPt,DeflateRaw:cPt,InflateRaw:uPt,Unzip:fPt,Zlib:hPt,default:lPt})),pPt=s(GBt),gPt=s(OMt);Object.defineProperty(ARt,"__esModule",{value:!0}),ARt.InvalidStatusCodeError=ARt.InvalidCertError=void 0;const yPt=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class mPt extends Error{constructor(t,e){super(t),this.fingerprint256=e}}ARt.InvalidCertError=mPt;class vPt extends Error{constructor(t){super(`Request Failed. Status Code: ${t}`),this.statusCode=t}}function wPt(t,e){if(!e||"text"===e||"json"===e)try{let r=new TextDecoder("utf8",{fatal:!0}).decode(t);if("text"===e)return r;try{return JSON.parse(r)}catch(t){if("json"===e)throw t;return r}}catch(t){if("text"===e||"json"===e)throw t}return t}ARt.InvalidStatusCodeError=vPt;let bPt={};function EPt(t,e){let r={...yPt,...e};const n=jMt,i=WMt,o=dPt,{promisify:s}=pPt,{resolve:a}=gPt,c=!!/^https/.test(t);let u={method:r.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const f=t=>t.replace(/:| /g,"").toLowerCase();if(r.keepAlive){var h;const t={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},e=[c,c&&(null===(h=r.sslPinnedCertificates)||void 0===h?void 0:h.map((t=>f(t))).sort())].join();u.agent=bPt[e]||(bPt[e]=new(c?i:n).Agent(t))}"json"===r.type&&(u.headers["Content-Type"]="application/json"),r.data&&(r.method||(u.method="POST"),u.body="json"===r.type?JSON.stringify(r.data):r.data),u.headers={...u.headers,...r.headers},r.sslAllowSelfSigned&&(u.rejectUnauthorized=!1);return new Promise(((e,h)=>{var l;const d=async e=>{if(e&&"DEPTH_ZERO_SELF_SIGNED_CERT"===e.code)try{await EPt(t,{...r,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(t){t&&t.fingerprint256&&(e=new mPt(`Self-signed SSL certificate: ${t.fingerprint256}`,t.fingerprint256))}h(e)},p=(c?i:n).request(t,u,(n=>{n.on("error",d),(async()=>{try{e(await(async e=>{const n=e.statusCode;if(r.redirect&&300<=n&&n<400&&e.headers.location){if(10==r._redirectCount)throw new Error("Request failed. Too much redirects.");return r._redirectCount+=1,await EPt(a(t,e.headers.location),r)}if(r.expectStatusCode&&n!==r.expectStatusCode)throw e.resume(),new vPt(n);let i=[];for await(const t of e)i.push(t);let c=pgt.concat(i);const u=e.headers["content-encoding"];"br"===u&&(c=await s(o.brotliDecompress)(c)),"gzip"!==u&&"deflate"!==u||(c=await s(o.unzip)(c));const f=wPt(c,r.type);return r.full?{headers:e.headers,status:n,body:f}:f})(n))}catch(t){h(t)}})()}));p.on("error",d);const g=null===(l=r.sslPinnedCertificates)||void 0===l?void 0:l.map((t=>f(t))),y=t=>{var e;const r=f((null===(e=t.getPeerCertificate())||void 0===e?void 0:e.fingerprint256)||"");if((r||!t.isSessionReused())&&!g.includes(r))return p.emit("error",new mPt(`Invalid SSL certificate: ${r} Expected: ${g}`,r)),p.abort()};r.sslPinnedCertificates&&p.on("socket",(t=>{const e=t.listeners("secureConnect").map((t=>(t.name||"").replace("bound ",""))).includes("mfetchSecureConnect");e||t.on("secureConnect",y.bind(null,t))})),r.keepAlive&&p.setNoDelay(!0),u.body&&p.write(u.body),p.end()}))}const SPt=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map((t=>t.toLowerCase()))),_Pt=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map((t=>t.toLowerCase())));async function APt(t,e){let r={...yPt,...e};const n=new Headers;"json"===r.type&&n.set("Content-Type","application/json");let i=new URL(t);if(i.username){const t=btoa(`${i.username}:${i.password}`);n.set("Authorization",`Basic ${t}`),i.username="",i.password=""}t=""+i;for(let t in r.headers){const e=t.toLowerCase();(SPt.has(e)||r.cors&&!_Pt.has(e))&&n.set(t,r.headers[t])}let o={headers:n,redirect:r.redirect?"follow":"manual"};r.referrer||(o.referrerPolicy="no-referrer"),r.cors&&(o.mode="cors"),r.data&&(r.method||(o.method="POST"),o.body="json"===r.type?JSON.stringify(r.data):r.data);const s=await fetch(t,o);if(r.expectStatusCode&&s.status!==r.expectStatusCode)throw new vPt(s.status);const a=wPt(new Uint8Array(await s.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(s.headers.entries()),status:s.status,body:a}:a}const xPt=!!("object"==typeof process&&process.versions&&process.versions.node&&process.versions.v8);ARt.default=function(t,e){return(xPt?EPt:APt)(t,e)},Object.defineProperty(_Rt,"__esModule",{value:!0}),_Rt.getProvider=_Rt.fetchFromProvider=void 0;const IPt=ARt;_Rt.fetchFromProvider=async(t,e)=>(await(0,IPt.default)(t,{headers:{"content-type":"application/json"},type:"json",data:{method:e.method,params:e.params,jsonrpc:"2.0",id:1}})).result;_Rt.getProvider=t=>{var e;if("string"==typeof t)return t;if(void 0!==(null==t||null===(e=t.connection)||void 0===e?void 0:e.url))return t.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")},function(t){var e=o&&o.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),r=o&&o.__exportStar||function(t,r){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||e(r,t,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.toAscii=t.stripHexPrefix=t.padToEven=t.isHexString=t.isHexPrefixed=t.getKeys=t.getBinarySize=t.fromUtf8=t.fromAscii=t.arrayContainsArray=void 0,r(tIt,t),r(Okt,t),r(Mkt,t),r(QTt,t),r(nRt,t),r(uRt,t),r(KTt,t),r(iRt,t),r(mRt,t),r(vRt,t);var n=ZTt;Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return n.arrayContainsArray}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return n.fromUtf8}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return n.getBinarySize}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return n.getKeys}}),Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return n.isHexPrefixed}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return n.isHexString}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return n.padToEven}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return n.stripHexPrefix}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return n.toAscii}}),r(SRt,t),r(_Rt,t)}(Qxt);var kPt={},TPt={},RPt={},BPt={},OPt={};Object.defineProperty(OPt,"__esModule",{value:!0}),OPt.StructError=void 0;class MPt extends TypeError{constructor(t,e){let r;const{message:n,explanation:i,...o}=t,{path:s}=t,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(null!=i?i:a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!==(n=r)&&void 0!==n?n:r=[t,...e()]}}}OPt.StructError=MPt;var CPt={},LPt={};function PPt(t){return"object"==typeof t&&null!==t}function NPt(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function UPt(t,e,r,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:o}=e,{type:s}=r,{refinement:a,message:c=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${NPt(n)}\``}=t;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:c}}Object.defineProperty(LPt,"__esModule",{value:!0}),LPt.run=LPt.toFailures=LPt.toFailure=LPt.shiftIterator=LPt.print=LPt.isPlainObject=LPt.isObject=void 0,LPt.isObject=PPt,LPt.isPlainObject=function(t){if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},LPt.print=NPt,LPt.shiftIterator=function(t){const{done:e,value:r}=t.next();return e?void 0:r},LPt.toFailure=UPt,LPt.toFailures=function*(t,e,r,n){(function(t){return PPt(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const i of t){const t=UPt(i,e,r,n);t&&(yield t)}},LPt.run=function*t(e,r,n={}){const{path:i=[],branch:o=[e],coerce:s=!1,mask:a=!1}=n,c={path:i,branch:o};if(s&&(e=r.coercer(e,c),a&&"type"!==r.type&&PPt(r.schema)&&PPt(e)&&!Array.isArray(e)))for(const t in e)void 0===r.schema[t]&&delete e[t];let u="valid";for(const t of r.validator(e,c))t.explanation=n.message,u="not_valid",yield[t,void 0];for(let[f,h,l]of r.entries(e,c)){const r=t(h,l,{path:void 0===f?i:[...i,f],branch:void 0===f?o:[...o,h],coerce:s,mask:a,message:n.message});for(const t of r)t[0]?(u=null===t[0].refinement||void 0===t[0].refinement?"not_valid":"not_refined",yield[t[0],void 0]):s&&(h=t[1],void 0===f?e=h:e instanceof Map?e.set(f,h):e instanceof Set?e.add(h):PPt(e)&&(void 0!==h||f in e)&&(e[f]=h))}if("not_valid"!==u)for(const t of r.refiner(e,c))t.explanation=n.message,u="not_refined",yield[t,void 0];"valid"===u&&(yield[void 0,e])},Object.defineProperty(CPt,"__esModule",{value:!0}),CPt.validate=CPt.is=CPt.mask=CPt.create=CPt.assert=CPt.Struct=void 0;const jPt=OPt,DPt=LPt;function zPt(t,e,r){const n=qPt(t,e,{message:r});if(n[0])throw n[0]}function FPt(t,e,r){const n=qPt(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function HPt(t,e,r){const n=qPt(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function $Pt(t,e){return!qPt(t,e)[0]}function qPt(t,e,r={}){const n=(0,DPt.run)(t,e,r),i=(0,DPt.shiftIterator)(n);if(i[0]){return[new jPt.StructError(i[0],(function*(){for(const t of n)t[0]&&(yield t[0])})),void 0]}return[void 0,i[1]]}CPt.Struct=class{constructor(t){const{type:e,schema:r,validator:n,refiner:i,coercer:o=t=>t,entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(t,e)=>{const r=n(t,e);return(0,DPt.toFailures)(r,e,this,t)}:()=>[],this.refiner=i?(t,e)=>{const r=i(t,e);return(0,DPt.toFailures)(r,e,this,t)}:()=>[]}assert(t,e){return zPt(t,this,e)}create(t,e){return FPt(t,this,e)}is(t){return $Pt(t,this)}mask(t,e){return HPt(t,this,e)}validate(t,e={}){return qPt(t,this,e)}},CPt.assert=zPt,CPt.create=FPt,CPt.mask=HPt,CPt.is=$Pt,CPt.validate=qPt;var WPt,VPt,KPt={},GPt={},ZPt={};function JPt(){if(WPt)return ZPt;WPt=1,Object.defineProperty(ZPt,"__esModule",{value:!0}),ZPt.pick=ZPt.partial=ZPt.omit=ZPt.lazy=ZPt.dynamic=ZPt.deprecated=ZPt.define=ZPt.assign=void 0;const t=CPt,e=YPt();return ZPt.assign=function(...t){var r;const n="type"===(null===(r=t[0])||void 0===r?void 0:r.type),i=t.map((({schema:t})=>t)),o=Object.assign({},...i);return n?(0,e.type)(o):(0,e.object)(o)},ZPt.define=function(e,r){return new t.Struct({type:e,schema:null,validator:r})},ZPt.deprecated=function(e,r){return new t.Struct({...e,refiner:(t,r)=>void 0===t||e.refiner(t,r),validator:(t,n)=>void 0===t||(r(t,n),e.validator(t,n))})},ZPt.dynamic=function(e){return new t.Struct({type:"dynamic",schema:null,*entries(t,r){const n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})},ZPt.lazy=function(e){let r;return new t.Struct({type:"lazy",schema:null,*entries(t,n){var i;null!==(i=r)&&void 0!==i||(r=e()),yield*r.entries(t,n)},validator(t,n){var i;return null!==(i=r)&&void 0!==i||(r=e()),r.validator(t,n)},coercer(t,n){var i;return null!==(i=r)&&void 0!==i||(r=e()),r.coercer(t,n)},refiner(t,n){var i;return null!==(i=r)&&void 0!==i||(r=e()),r.refiner(t,n)}})},ZPt.omit=function(t,r){const{schema:n}=t,i={...n};for(const t of r)delete i[t];return"type"===t.type?(0,e.type)(i):(0,e.object)(i)},ZPt.partial=function(r){const n=r instanceof t.Struct,i=n?{...r.schema}:{...r};for(const t in i)i[t]=(0,e.optional)(i[t]);return n&&"type"===r.type?(0,e.type)(i):(0,e.object)(i)},ZPt.pick=function(t,r){const{schema:n}=t,i={};for(const t of r)i[t]=n[t];return"type"===t.type?(0,e.type)(i):(0,e.object)(i)},ZPt}function YPt(){if(VPt)return GPt;VPt=1,Object.defineProperty(GPt,"__esModule",{value:!0}),GPt.unknown=GPt.union=GPt.type=GPt.tuple=GPt.string=GPt.set=GPt.regexp=GPt.record=GPt.optional=GPt.object=GPt.number=GPt.nullable=GPt.never=GPt.map=GPt.literal=GPt.intersection=GPt.integer=GPt.instance=GPt.func=GPt.enums=GPt.date=GPt.boolean=GPt.bigint=GPt.array=GPt.any=void 0;const t=CPt,e=LPt,r=JPt();function n(){return(0,r.define)("never",(()=>!1))}return GPt.any=function(){return(0,r.define)("any",(()=>!0))},GPt.array=function(r){return new t.Struct({type:"array",schema:r,*entries(t){if(r&&Array.isArray(t))for(const[e,n]of t.entries())yield[e,n,r]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${(0,e.print)(t)}`})},GPt.bigint=function(){return(0,r.define)("bigint",(t=>"bigint"==typeof t))},GPt.boolean=function(){return(0,r.define)("boolean",(t=>"boolean"==typeof t))},GPt.date=function(){return(0,r.define)("date",(t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${(0,e.print)(t)}`))},GPt.enums=function(r){const n={},i=r.map((t=>(0,e.print)(t))).join();for(const t of r)n[t]=t;return new t.Struct({type:"enums",schema:n,validator:t=>r.includes(t)||`Expected one of \`${i}\`, but received: ${(0,e.print)(t)}`})},GPt.func=function(){return(0,r.define)("func",(t=>"function"==typeof t||`Expected a function, but received: ${(0,e.print)(t)}`))},GPt.instance=function(t){return(0,r.define)("instance",(r=>r instanceof t||`Expected a \`${t.name}\` instance, but received: ${(0,e.print)(r)}`))},GPt.integer=function(){return(0,r.define)("integer",(t=>"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${(0,e.print)(t)}`))},GPt.intersection=function(e){return new t.Struct({type:"intersection",schema:null,*entries(t,r){for(const{entries:n}of e)yield*n(t,r)},*validator(t,r){for(const{validator:n}of e)yield*n(t,r)},*refiner(t,r){for(const{refiner:n}of e)yield*n(t,r)}})},GPt.literal=function(r){const n=(0,e.print)(r),i=typeof r;return new t.Struct({type:"literal",schema:"string"===i||"number"===i||"boolean"===i?r:null,validator:t=>t===r||`Expected the literal \`${n}\`, but received: ${(0,e.print)(t)}`})},GPt.map=function(r,n){return new t.Struct({type:"map",schema:null,*entries(t){if(r&&n&&t instanceof Map)for(const[e,i]of t.entries())yield[e,e,r],yield[e,i,n]},coercer:t=>t instanceof Map?new Map(t):t,validator:t=>t instanceof Map||`Expected a \`Map\` object, but received: ${(0,e.print)(t)}`})},GPt.never=n,GPt.nullable=function(e){return new t.Struct({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})},GPt.number=function(){return(0,r.define)("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${(0,e.print)(t)}`))},GPt.object=function(r){const i=r?Object.keys(r):[],o=n();return new t.Struct({type:"object",schema:null!=r?r:null,*entries(t){if(r&&(0,e.isObject)(t)){const e=new Set(Object.keys(t));for(const n of i)e.delete(n),yield[n,t[n],r[n]];for(const r of e)yield[r,t[r],o]}},validator:t=>(0,e.isObject)(t)||`Expected an object, but received: ${(0,e.print)(t)}`,coercer:t=>(0,e.isObject)(t)?{...t}:t})},GPt.optional=function(e){return new t.Struct({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})},GPt.record=function(r,n){return new t.Struct({type:"record",schema:null,*entries(t){if((0,e.isObject)(t))for(const e in t){const i=t[e];yield[e,e,r],yield[e,i,n]}},validator:t=>(0,e.isObject)(t)||`Expected an object, but received: ${(0,e.print)(t)}`})},GPt.regexp=function(){return(0,r.define)("regexp",(t=>t instanceof RegExp))},GPt.set=function(r){return new t.Struct({type:"set",schema:null,*entries(t){if(r&&t instanceof Set)for(const e of t)yield[e,e,r]},coercer:t=>t instanceof Set?new Set(t):t,validator:t=>t instanceof Set||`Expected a \`Set\` object, but received: ${(0,e.print)(t)}`})},GPt.string=function(){return(0,r.define)("string",(t=>"string"==typeof t||`Expected a string, but received: ${(0,e.print)(t)}`))},GPt.tuple=function(r){const i=n();return new t.Struct({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const e=Math.max(r.length,t.length);for(let n=0;nArray.isArray(t)||`Expected an array, but received: ${(0,e.print)(t)}`})},GPt.type=function(r){const n=Object.keys(r);return new t.Struct({type:"type",schema:r,*entries(t){if((0,e.isObject)(t))for(const e of n)yield[e,t[e],r[e]]},validator:t=>(0,e.isObject)(t)||`Expected an object, but received: ${(0,e.print)(t)}`,coercer:t=>(0,e.isObject)(t)?{...t}:t})},GPt.union=function(r){const n=r.map((t=>t.type)).join(" | ");return new t.Struct({type:"union",schema:null,coercer(t){for(const e of r){const[r,n]=e.validate(t,{coerce:!0});if(!r)return n}return t},validator(t,i){const o=[];for(const n of r){const[...r]=(0,e.run)(t,n,i),[s]=r;if(null==s||!s[0])return[];for(const[t]of r)t&&o.push(t)}return[`Expected the value to satisfy a union of \`${n}\`, but received: ${(0,e.print)(t)}`,...o]}})},GPt.unknown=function(){return(0,r.define)("unknown",(()=>!0))},GPt}Object.defineProperty(KPt,"__esModule",{value:!0}),KPt.trimmed=KPt.defaulted=KPt.coerce=void 0;const XPt=CPt,QPt=LPt,tNt=YPt();function eNt(t,e,r){return new XPt.Struct({...t,coercer:(n,i)=>(0,XPt.is)(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}KPt.coerce=eNt,KPt.defaulted=function(t,e,r={}){return eNt(t,(0,tNt.unknown)(),(t=>{const n="function"==typeof e?e():e;if(void 0===t)return n;if(!r.strict&&(0,QPt.isPlainObject)(t)&&(0,QPt.isPlainObject)(n)){const e={...t};let r=!1;for(const t in n)void 0===e[t]&&(e[t]=n[t],r=!0);if(r)return e}return t}))},KPt.trimmed=function(t){return eNt(t,(0,tNt.string)(),(t=>t.trim()))};var rNt={};Object.defineProperty(rNt,"__esModule",{value:!0}),rNt.refine=rNt.size=rNt.pattern=rNt.nonempty=rNt.min=rNt.max=rNt.empty=void 0;const nNt=CPt,iNt=LPt;function oNt(t){return t instanceof Map||t instanceof Set?t.size:t.length}function sNt(t,e,r){return new nNt.Struct({...t,*refiner(n,i){yield*t.refiner(n,i);const o=r(n,i),s=(0,iNt.toFailures)(o,i,t,n);for(const t of s)yield{...t,refinement:e}}})}rNt.empty=function(t){return sNt(t,"empty",(e=>{const r=oNt(e);return 0===r||`Expected an empty ${t.type} but received one with a size of \`${r}\``}))},rNt.max=function(t,e,r={}){const{exclusive:n}=r;return sNt(t,"max",(r=>n?rn?r>e:r>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${r}\``))},rNt.nonempty=function(t){return sNt(t,"nonempty",(e=>oNt(e)>0||`Expected a nonempty ${t.type} but received an empty one`))},rNt.pattern=function(t,e){return sNt(t,"pattern",(r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`))},rNt.size=function(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return sNt(t,"size",(t=>{if("number"==typeof t||t instanceof Date)return e<=t&&t<=r||`${n} ${i} but received \`${t}\``;if(t instanceof Map||t instanceof Set){const{size:o}=t;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}const{length:o}=t;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}))},rNt.refine=sNt,function(t){var e=o&&o.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),r=o&&o.__exportStar||function(t,r){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||e(r,t,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(OPt,t),r(CPt,t),r(KPt,t),r(rNt,t),r(YPt(),t),r(JPt(),t)}(BPt);var aNt={};class cNt extends Error{constructor(t,{cause:e}={}){super(t),this.name=cNt.name,e&&(this.cause=e),this.message=t}}var uNt=s(Object.freeze({__proto__:null,ErrorWithCause:cNt}));const fNt=t=>{if(t&&"object"==typeof t&&"cause"in t){if("function"==typeof t.cause){const e=t.cause();return e instanceof Error?e:void 0}return t.cause instanceof Error?t.cause:void 0}},hNt=(t,e)=>{if(!(t instanceof Error))return"";const r=t.stack||"";if(e.has(t))return r+"\ncauses have become circular...";const n=fNt(t);return n?(e.add(t),r+"\ncaused by: "+hNt(n,e)):r},lNt=(t,e,r)=>{if(!(t instanceof Error))return"";const n=r?"":t.message||"";if(e.has(t))return n+": ...";const i=fNt(t);if(i){e.add(t);const r="cause"in t&&"function"==typeof t.cause;return n+(r?"":": ")+lNt(i,e,r)}return n};var dNt=Object.freeze({__proto__:null,findCauseByReference:(t,e)=>{if(!t||!e)return;if(!(t instanceof Error))return;if(!(e.prototype instanceof Error)&&e!==Error)return;const r=new Set;let n=t;for(;n&&!r.has(n);){if(r.add(n),n instanceof e)return n;n=fNt(n)}},getErrorCause:fNt,stackWithCauses:t=>hNt(t,new Set),messageWithCauses:t=>lNt(t,new Set)}),pNt=s(dNt);const{ErrorWithCause:gNt}=uNt,{findCauseByReference:yNt,getErrorCause:mNt,messageWithCauses:vNt,stackWithCauses:wNt}=pNt;var bNt={ErrorWithCause:gNt,findCauseByReference:yNt,getErrorCause:mNt,stackWithCauses:wNt,messageWithCauses:vNt},ENt={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.getKnownPropertyNames=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0,t.isNonEmptyArray=function(t){return Array.isArray(t)&&t.length>0},t.isNullOrUndefined=function(t){return null==t},t.isObject=function(t){return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)};var e;function r(t){return t.charCodeAt(0)<=127}t.hasProperty=(t,e)=>Object.hasOwnProperty.call(t,e),t.getKnownPropertyNames=function(t){return Object.getOwnPropertyNames(t)},(e=t.JsonSize||(t.JsonSize={}))[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date",t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,t.isPlainObject=function(t){if("object"!=typeof t||null===t)return!1;try{let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}catch(t){return!1}},t.isASCII=r,t.calculateStringSize=function(e){var n;return e.split("").reduce(((t,e)=>r(e)?t+1:t+2),0)+(null!==(n=e.match(t.ESCAPE_CHARACTERS_REGEXP))&&void 0!==n?n:[]).length},t.calculateNumberSize=function(t){return t.toString().length}}(ENt),Object.defineProperty(aNt,"__esModule",{value:!0}),aNt.wrapError=aNt.getErrorMessage=aNt.isErrorWithStack=aNt.isErrorWithMessage=aNt.isErrorWithCode=void 0;const SNt=bNt,_Nt=ENt;function ANt(t){return"object"==typeof t&&null!==t&&"code"in t}function xNt(t){return"object"==typeof t&&null!==t&&"message"in t}aNt.isErrorWithCode=ANt,aNt.isErrorWithMessage=xNt,aNt.isErrorWithStack=function(t){return"object"==typeof t&&null!==t&&"stack"in t},aNt.getErrorMessage=function(t){return xNt(t)&&"string"==typeof t.message?t.message:(0,_Nt.isNullOrUndefined)(t)?"":String(t)},aNt.wrapError=function(t,e){if(function(t){return t instanceof Error||(0,_Nt.isObject)(t)&&"Error"===t.constructor.name}(t)){let r;return r=2===Error.length?new Error(e,{cause:t}):new SNt.ErrorWithCause(e,{cause:t}),ANt(t)&&(r.code=t.code),r}return e.length>0?new Error(`${String(t)}: ${e}`):new Error(String(t))},Object.defineProperty(RPt,"__esModule",{value:!0}),RPt.assertExhaustive=RPt.assertStruct=RPt.assert=RPt.AssertionError=void 0;const INt=BPt,kNt=aNt;function TNt(t,e){return r=t,Boolean("string"==typeof(null==r||null===(n=r.prototype)||void 0===n||null===(n=n.constructor)||void 0===n?void 0:n.name))?new t({message:e}):t({message:e});var r,n}class RNt extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}RPt.AssertionError=RNt,RPt.assert=function(t,e="Assertion failed.",r=RNt){if(!t){if(e instanceof Error)throw e;throw TNt(r,e)}},RPt.assertStruct=function(t,e,r="Assertion failed",n=RNt){try{(0,INt.assert)(t,e)}catch(t){throw TNt(n,`${r}: ${function(t){return(0,kNt.getErrorMessage)(t).replace(/\.$/u,"")}(t)}.`)}},RPt.assertExhaustive=function(t){throw new Error("Invalid branch reached. Should be detected during compilation.")};var BNt={};Object.defineProperty(BNt,"__esModule",{value:!0}),BNt.base64=void 0;const ONt=BPt,MNt=RPt;BNt.base64=(t,e={})=>{var r,n;const i=null!==(r=e.paddingRequired)&&void 0!==r&&r,o=null!==(n=e.characterSet)&&void 0!==n?n:"base64";let s,a;return"base64"===o?s=String.raw`[A-Za-z0-9+\/]`:((0,MNt.assert)("base64url"===o),s=String.raw`[-_A-Za-z0-9]`),a=i?new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,ONt.pattern)(t,a)};var CNt={},LNt={};!function(t){function e(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function r(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}function n(...t){const e=t=>t,r=(t,e)=>r=>t(e(r)),n=t.map((t=>t.encode)).reduceRight(r,e),i=t.map((t=>t.decode)).reduce(r,e);return{encode:n,decode:i}}function i(t){return{encode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("alphabet.encode input should be an array of numbers");return r.map((r=>{if(e(r),r<0||r>=t.length)throw new Error(`Digit index outside alphabet: ${r} (alphabet: ${t.length})`);return t[r]}))},decode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("alphabet.decode input should be array of strings");return e.map((e=>{if("string"!=typeof e)throw new Error(`alphabet.decode: not string element=${e}`);const r=t.indexOf(e);if(-1===r)throw new Error(`Unknown letter: "${e}". Allowed: ${t}`);return r}))}}}function o(t=""){if("string"!=typeof t)throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("join.encode input should be array of strings");for(let t of e)if("string"!=typeof t)throw new Error(`join.encode: non-string input=${t}`);return e.join(t)},decode:e=>{if("string"!=typeof e)throw new Error("join.decode input should be string");return e.split(t)}}}function s(t,r="="){if(e(t),"string"!=typeof r)throw new Error("padding chr should be string");return{encode(e){if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("padding.encode input should be array of strings");for(let t of e)if("string"!=typeof t)throw new Error(`padding.encode: non-string input=${t}`);for(;e.length*t%8;)e.push(r);return e},decode(e){if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("padding.encode input should be array of strings");for(let t of e)if("string"!=typeof t)throw new Error(`padding.decode: non-string input=${t}`);let n=e.length;if(n*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&e[n-1]===r;n--)if(!((n-1)*t%8))throw new Error("Invalid padding: string has too much padding");return e.slice(0,n)}}}function a(t){if("function"!=typeof t)throw new Error("normalize fn should be function");return{encode:t=>t,decode:e=>t(e)}}function c(t,r,n){if(r<2)throw new Error(`convertRadix: wrong from=${r}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let i=0;const o=[],s=Array.from(t);for(s.forEach((t=>{if(e(t),t<0||t>=r)throw new Error(`Wrong integer: ${t}`)}));;){let t=0,e=!0;for(let o=i;oe?u(e,t%e):t,f=(t,e)=>t+(e-u(t,e));function h(t,r,n,i){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(r<=0||r>32)throw new Error(`convertRadix2: wrong from=${r}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(f(r,n)>32)throw new Error(`convertRadix2: carry overflow from=${r} to=${n} carryBits=${f(r,n)}`);let o=0,s=0;const a=2**n-1,c=[];for(const i of t){if(e(i),i>=2**r)throw new Error(`convertRadix2: invalid data word=${i} from=${r}`);if(o=o<32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${r}`);for(s+=r;s>=n;s-=n)c.push((o>>s-n&a)>>>0);o&=2**s-1}if(o=o<=r)throw new Error("Excess padding");if(!i&&o)throw new Error(`Non-zero padding: ${o}`);return i&&s>0&&c.push(o>>>0),c}function l(t){return e(t),{encode:e=>{if(!r(e))throw new Error("radix.encode input should be Uint8Array");return c(Array.from(e),256,t)},decode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(c(e,t,256))}}}function d(t,n=!1){if(e(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(f(8,t)>32||f(t,8)>32)throw new Error("radix2: carry overflow");return{encode:e=>{if(!r(e))throw new Error("radix2.encode input should be Uint8Array");return h(Array.from(e),8,t,!n)},decode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(h(e,t,8,n))}}}function p(t){if("function"!=typeof t)throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch(t){}}}function g(t,n){if(e(t),"function"!=typeof n)throw new Error("checksum fn should be function");return{encode(e){if(!r(e))throw new Error("checksum.encode: input should be Uint8Array");const i=n(e).slice(0,t),o=new Uint8Array(e.length+t);return o.set(e),o.set(i,e.length),o},decode(e){if(!r(e))throw new Error("checksum.decode: input should be Uint8Array");const i=e.slice(0,-t),o=n(i).slice(0,t),s=e.slice(-t);for(let e=0;et.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),t.base64=n(d(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s(6),o("")),t.base64nopad=n(d(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),o("")),t.base64url=n(d(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(6),o("")),t.base64urlnopad=n(d(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),o(""));const y=t=>n(l(58),i(t),o(""));t.base58=y("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=y("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=y("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const m=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(e){let r="";for(let n=0;nn(g(4,(t=>e(e(t)))),t.base58),t.base58check=t.createBase58check;const v=n(i("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),w=[996825010,642813549,513874426,1027748829,705979059];function b(t){const e=t>>25;let r=(33554431&t)<<5;for(let t=0;t>t&1)&&(r^=w[t]);return r}function E(t,e,r=1){const n=t.length;let i=1;for(let e=0;e126)throw new Error(`Invalid prefix (${t})`);i=b(i)^r>>5}i=b(i);for(let e=0;en)throw new TypeError(`Length ${i} exceeds limit ${n}`);const o=t.toLowerCase(),s=E(o,r,e);return`${o}1${v.encode(r)}${s}`}function a(t,r=90){if("string"!=typeof t)throw new Error("bech32.decode input should be string, not "+typeof t);if(t.length<8||!1!==r&&t.length>r)throw new TypeError(`Wrong string length: ${t.length} (${t}). Expected (8..${r})`);const n=t.toLowerCase();if(t!==n&&t!==t.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=n.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const o=n.slice(0,i),s=n.slice(i+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const a=v.decode(s).slice(0,-6),c=E(o,a,e);if(!s.endsWith(c))throw new Error(`Invalid checksum in ${t}: expected "${c}"`);return{prefix:o,words:a}}return{encode:s,decode:a,encodeFromBytes:function(t,e){return s(t,i(e))},decodeToBytes:function(t){const{prefix:e,words:r}=a(t,!1);return{prefix:e,words:r,bytes:n(r)}},decodeUnsafe:p(a),fromWords:n,fromWordsUnsafe:o,toWords:i}}t.bech32=S("bech32"),t.bech32m=S("bech32m"),t.utf8={encode:t=>(new TextDecoder).decode(t),decode:t=>(new TextEncoder).encode(t)},t.hex=n(d(4),i("0123456789abcdef"),o(""),a((t=>{if("string"!=typeof t||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})));const _={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},A="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";t.bytesToString=(t,e)=>{if("string"!=typeof t||!_.hasOwnProperty(t))throw new TypeError(A);if(!r(e))throw new TypeError("bytesToString() expects Uint8Array");return _[t].encode(e)},t.str=t.bytesToString;t.stringToBytes=(t,e)=>{if(!_.hasOwnProperty(t))throw new TypeError(A);if("string"!=typeof e)throw new TypeError("stringToBytes() expects string");return _[t].decode(e)},t.bytes=t.stringToBytes}(LNt);var PNt={},NNt={},UNt={};function jNt(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function DNt(t,...e){if(!function(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function zNt(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");jNt(t.outputLen),jNt(t.blockLen)}function FNt(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function HNt(t,e){DNt(t);const r=e.outputLen;if(t.length>VNt&WNt)}:{h:0|Number(t>>VNt&WNt),l:0|Number(t&WNt)}}function GNt(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0);qNt.toBig=ZNt;const JNt=(t,e,r)=>t>>>r;qNt.shrSH=JNt;const YNt=(t,e,r)=>t<<32-r|e>>>r;qNt.shrSL=YNt;const XNt=(t,e,r)=>t>>>r|e<<32-r;qNt.rotrSH=XNt;const QNt=(t,e,r)=>t<<32-r|e>>>r;qNt.rotrSL=QNt;const tUt=(t,e,r)=>t<<64-r|e>>>r-32;qNt.rotrBH=tUt;const eUt=(t,e,r)=>t>>>r-32|e<<64-r;qNt.rotrBL=eUt;const rUt=(t,e)=>e;qNt.rotr32H=rUt;const nUt=(t,e)=>t;qNt.rotr32L=nUt;const iUt=(t,e,r)=>t<>>32-r;qNt.rotlSH=iUt;const oUt=(t,e,r)=>e<>>32-r;qNt.rotlSL=oUt;const sUt=(t,e,r)=>e<>>64-r;qNt.rotlBH=sUt;const aUt=(t,e,r)=>t<>>64-r;function cUt(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:0|i}}qNt.rotlBL=aUt;const uUt=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);qNt.add3L=uUt;const fUt=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;qNt.add3H=fUt;const hUt=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);qNt.add4L=hUt;const lUt=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0;qNt.add4H=lUt;const dUt=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0);qNt.add5L=dUt;const pUt=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0;qNt.add5H=pUt;const gUt={fromBig:KNt,split:GNt,toBig:ZNt,shrSH:JNt,shrSL:YNt,rotrSH:XNt,rotrSL:QNt,rotrBH:tUt,rotrBL:eUt,rotr32H:rUt,rotr32L:nUt,rotlSH:iUt,rotlSL:oUt,rotlBH:sUt,rotlBL:aUt,add:cUt,add3L:uUt,add3H:fUt,add4L:hUt,add4H:lUt,add5H:pUt,add5L:dUt};qNt.default=gUt;var yUt={},mUt={};Object.defineProperty(mUt,"__esModule",{value:!0}),mUt.crypto=void 0,mUt.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=void 0,t.isBytes=function(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name},t.byteSwap32=function(e){for(let r=0;r=0&&et().update(a(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e},t.wrapConstructorWithOpts=function(t){const e=(e,r)=>t(r).update(a(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e},t.wrapXOFConstructorWithOpts=function(t){const e=(e,r)=>t(r).update(a(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e},t.randomBytes=function(t=32){if(e.crypto&&"function"==typeof e.crypto.getRandomValues)return e.crypto.getRandomValues(new Uint8Array(t));if(e.crypto&&"function"==typeof e.crypto.randomBytes)return e.crypto.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")};const e=mUt,r=UNt;t.u8=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength);t.u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));t.createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);t.rotr=(t,e)=>t<<32-e|t>>>e;t.rotl=(t,e)=>t<>>32-e>>>0,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];t.byteSwap=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,t.byteSwapIfBE=t.isLE?t=>t:e=>(0,t.byteSwap)(e);const n=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));const i={_0:48,_9:57,A:65,F:70,a:97,f:102};function o(t){return t>=i._0&&t<=i._9?t-i._0:t>=i.A&&t<=i.F?t-(i.A-10):t>=i.a&&t<=i.f?t-(i.a-10):void 0}function s(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}function a(t){return"string"==typeof t&&(t=s(t)),(0,r.abytes)(t),t}t.nextTick=async()=>{};t.Hash=class{clone(){return this._cloneInto()}}}(yUt),Object.defineProperty(NNt,"__esModule",{value:!0}),NNt.shake256=NNt.shake128=NNt.keccak_512=NNt.keccak_384=NNt.keccak_256=NNt.keccak_224=NNt.sha3_512=NNt.sha3_384=NNt.sha3_256=NNt.sha3_224=NNt.Keccak=void 0,NNt.keccakP=LUt;const vUt=UNt,wUt=qNt,bUt=yUt,EUt=[],SUt=[],_Ut=[],AUt=BigInt(0),xUt=BigInt(1),IUt=BigInt(2),kUt=BigInt(7),TUt=BigInt(256),RUt=BigInt(113);for(let t=0,e=xUt,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],EUt.push(2*(5*n+r)),SUt.push((t+1)*(t+2)/2%64);let i=AUt;for(let t=0;t<7;t++)e=(e<>kUt)*RUt)%TUt,e&IUt&&(i^=xUt<<(xUt<r>32?(0,wUt.rotlBH)(t,e,r):(0,wUt.rotlSH)(t,e,r),CUt=(t,e,r)=>r>32?(0,wUt.rotlBL)(t,e,r):(0,wUt.rotlSL)(t,e,r);function LUt(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const n=(e+8)%10,i=(e+2)%10,o=r[i],s=r[i+1],a=MUt(o,s,1)^r[n],c=CUt(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=c}let e=t[2],i=t[3];for(let r=0;r<24;r++){const n=SUt[r],o=MUt(e,i,n),s=CUt(e,i,n),a=EUt[r];e=t[a],i=t[a+1],t[a]=o,t[a+1]=s}for(let e=0;e<50;e+=10){for(let n=0;n<10;n++)r[n]=t[e+n];for(let n=0;n<10;n++)t[e+n]^=~r[(n+2)%10]&r[(n+4)%10]}t[0]^=BUt[n],t[1]^=OUt[n]}r.fill(0)}class PUt extends bUt.Hash{constructor(t,e,r,n=!1,i=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,vUt.anumber)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,bUt.u32)(this.state)}keccak(){bUt.isLE||(0,bUt.byteSwap32)(this.state32),LUt(this.state32,this.rounds),bUt.isLE||(0,bUt.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,vUt.aexists)(this);const{blockLen:e,state:r}=this,n=(t=(0,bUt.toBytes)(t)).length;for(let i=0;i=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);t.set(e.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,vUt.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,vUt.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return t||(t=new PUt(e,r,n,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}}NNt.Keccak=PUt;const NUt=(t,e,r)=>(0,bUt.wrapConstructor)((()=>new PUt(e,t,r)));NNt.sha3_224=NUt(6,144,28),NNt.sha3_256=NUt(6,136,32),NNt.sha3_384=NUt(6,104,48),NNt.sha3_512=NUt(6,72,64),NNt.keccak_224=NUt(1,144,28),NNt.keccak_256=NUt(1,136,32),NNt.keccak_384=NUt(1,104,48),NNt.keccak_512=NUt(1,72,64);const UUt=(t,e,r)=>(0,bUt.wrapXOFConstructorWithOpts)(((n={})=>new PUt(e,t,void 0===n.dkLen?r:n.dkLen,!0)));var jUt,DUt;function zUt(){return jUt||(jUt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.isValidChecksumAddress=t.getChecksumAddress=t.isValidHexAddress=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.HexChecksumAddressStruct=t.HexAddressStruct=t.StrictHexStruct=t.HexStruct=void 0;const e=BPt,r=NNt,n=RPt,i=FUt();function o(r){return(0,e.is)(r,t.HexStruct)}function s(r){return(0,e.is)(r,t.StrictHexStruct)}function a(o){(0,n.assert)((0,e.is)(o,t.HexChecksumAddressStruct),"Invalid hex address.");const s=u(o.toLowerCase()),a=u((0,i.bytesToHex)((0,r.keccak_256)(s)));return`0x${s.split("").map(((t,r)=>{const i=a[r];return(0,n.assert)((0,e.is)(i,(0,e.string)()),"Hash shorter than address."),parseInt(i,16)>7?t.toUpperCase():t})).join("")}`}function c(r){return!!(0,e.is)(r,t.HexChecksumAddressStruct)&&a(r)===r}function u(t){return t.startsWith("0x")||t.startsWith("0X")?t.substring(2):t}t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu),t.HexAddressStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]{40}$/u),t.HexChecksumAddressStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-fA-F]{40}$/u),t.isHexString=o,t.isStrictHexString=s,t.assertIsHexString=function(t){(0,n.assert)(o(t),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(t){(0,n.assert)(s(t),'Value must be a hexadecimal string, starting with "0x".')},t.isValidHexAddress=function(r){return(0,e.is)(r,t.HexAddressStruct)||c(r)},t.getChecksumAddress=a,t.isValidChecksumAddress=c,t.add0x=function(t){return t.startsWith("0x")?t:t.startsWith("0X")?`0x${t.substring(2)}`:`0x${t}`},t.remove0x=u}(PNt)),PNt}function FUt(){if(DUt)return CNt;DUt=1,Object.defineProperty(CNt,"__esModule",{value:!0}),CNt.createDataView=CNt.concatBytes=CNt.valueToBytes=CNt.base64ToBytes=CNt.stringToBytes=CNt.numberToBytes=CNt.signedBigIntToBytes=CNt.bigIntToBytes=CNt.hexToBytes=CNt.bytesToBase64=CNt.bytesToString=CNt.bytesToNumber=CNt.bytesToSignedBigInt=CNt.bytesToBigInt=CNt.bytesToHex=CNt.assertIsBytes=CNt.isBytes=void 0;const t=LNt,e=RPt,r=zUt();const n=function(){const t=[];return()=>{if(0===t.length)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}();function i(t){return t instanceof Uint8Array}function o(t){(0,e.assert)(i(t),"Value must be a Uint8Array.")}function s(t){if(o(t),0===t.length)return"0x";const e=n(),i=new Array(t.length);for(let r=0;r=BigInt(0),"Value must be a non-negative bigint.");return c(t.toString(16))}function f(t){(0,e.assert)("number"==typeof t,"Value must be a number."),(0,e.assert)(t>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");return c(t.toString(16))}function h(t){return(0,e.assert)("string"==typeof t,"Value must be a string."),(new TextEncoder).encode(t)}function l(t){if("bigint"==typeof t)return u(t);if("number"==typeof t)return f(t);if("string"==typeof t)return t.startsWith("0x")?c(t):h(t);if(i(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}return CNt.isBytes=i,CNt.assertIsBytes=o,CNt.bytesToHex=s,CNt.bytesToBigInt=a,CNt.bytesToSignedBigInt=function(t){o(t);let e=BigInt(0);for(const r of t)e=(e<0,"Byte length must be greater than 0."),(0,e.assert)(function(t,r){(0,e.assert)(r>0);const n=t>>BigInt(31);return!((~t&n)+(t&~n)>>BigInt(8*r-1))}(t,r),"Byte length is too small to represent the given value.");let n=t;const i=new Uint8Array(r);for(let t=0;t>=BigInt(8);return i.reverse()},CNt.numberToBytes=f,CNt.stringToBytes=h,CNt.base64ToBytes=function(r){return(0,e.assert)("string"==typeof r,"Value must be a string."),t.base64.decode(r)},CNt.valueToBytes=l,CNt.concatBytes=function(t){const e=new Array(t.length);let r=0;for(let n=0;n[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})$/u,t.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,t.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,t.CAIP_ACCOUNT_ID_REGEX=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})):(?[-.%a-zA-Z0-9]{1,128})$/u,t.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,t.CAIP_ASSET_TYPE_REGEX=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32}))\/(?[-a-z0-9]{3,8}):(?[-.%a-zA-Z0-9]{1,128})$/u,t.CAIP_ASSET_ID_REGEX=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32}))\/(?[-a-z0-9]{3,8}):(?[-.%a-zA-Z0-9]{1,128})\/(?[-.%a-zA-Z0-9]{1,78})$/u,t.CaipChainIdStruct=(0,e.pattern)((0,e.string)(),t.CAIP_CHAIN_ID_REGEX),t.CaipNamespaceStruct=(0,e.pattern)((0,e.string)(),t.CAIP_NAMESPACE_REGEX),t.CaipReferenceStruct=(0,e.pattern)((0,e.string)(),t.CAIP_REFERENCE_REGEX),t.CaipAccountIdStruct=(0,e.pattern)((0,e.string)(),t.CAIP_ACCOUNT_ID_REGEX),t.CaipAccountAddressStruct=(0,e.pattern)((0,e.string)(),t.CAIP_ACCOUNT_ADDRESS_REGEX),t.CaipAssetTypeStruct=(0,e.pattern)((0,e.string)(),t.CAIP_ASSET_TYPE_REGEX),t.CaipAssetIdStruct=(0,e.pattern)((0,e.string)(),t.CAIP_ASSET_ID_REGEX),(r=t.KnownCaipNamespace||(t.KnownCaipNamespace={})).Bip122="bip122",r.Eip155="eip155",r.Wallet="wallet",t.isCaipChainId=function(r){return(0,e.is)(r,t.CaipChainIdStruct)},t.isCaipNamespace=n,t.isCaipReference=i,t.isCaipAccountId=function(r){return(0,e.is)(r,t.CaipAccountIdStruct)},t.isCaipAccountAddress=function(r){return(0,e.is)(r,t.CaipAccountAddressStruct)},t.isCaipAssetType=function(r){return(0,e.is)(r,t.CaipAssetTypeStruct)},t.isCaipAssetId=function(r){return(0,e.is)(r,t.CaipAssetIdStruct)},t.parseCaipChainId=function(e){const r=t.CAIP_CHAIN_ID_REGEX.exec(e);if(null==r||!r.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:r.groups.namespace,reference:r.groups.reference}},t.parseCaipAccountId=function(e){const r=t.CAIP_ACCOUNT_ID_REGEX.exec(e);if(null==r||!r.groups)throw new Error("Invalid CAIP account ID.");return{address:r.groups.accountAddress,chainId:r.groups.chainId,chain:{namespace:r.groups.namespace,reference:r.groups.reference}}},t.toCaipChainId=function(e,r){if(!n(e))throw new Error(`Invalid "namespace", must match: ${t.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(r))throw new Error(`Invalid "reference", must match: ${t.CAIP_REFERENCE_REGEX.toString()}`);return`${e}:${r}`}}(HUt);var $Ut={};Object.defineProperty($Ut,"__esModule",{value:!0}),$Ut.ChecksumStruct=void 0;const qUt=BPt,WUt=BNt;$Ut.ChecksumStruct=(0,qUt.size)((0,WUt.base64)((0,qUt.string)(),{paddingRequired:!0}),44,44);var VUt={};Object.defineProperty(VUt,"__esModule",{value:!0}),VUt.createHex=VUt.createBytes=VUt.createBigInt=VUt.createNumber=void 0;const KUt=BPt,GUt=RPt,ZUt=FUt(),JUt=zUt(),YUt=(0,KUt.union)([(0,KUt.number)(),(0,KUt.bigint)(),(0,KUt.string)(),JUt.StrictHexStruct]),XUt=(0,KUt.coerce)((0,KUt.number)(),YUt,Number),QUt=(0,KUt.coerce)((0,KUt.bigint)(),YUt,BigInt);(0,KUt.union)([JUt.StrictHexStruct,(0,KUt.instance)(Uint8Array)]);const tjt=(0,KUt.coerce)((0,KUt.instance)(Uint8Array),(0,KUt.union)([JUt.StrictHexStruct]),ZUt.hexToBytes),ejt=(0,KUt.coerce)(JUt.StrictHexStruct,(0,KUt.instance)(Uint8Array),ZUt.bytesToHex);VUt.createNumber=function(t){try{const e=(0,KUt.create)(t,XUt);return(0,GUt.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){if(e instanceof KUt.StructError)throw new Error(`Expected a number-like value, got "${t}".`);throw e}},VUt.createBigInt=function(t){try{return(0,KUt.create)(t,QUt)}catch(t){if(t instanceof KUt.StructError)throw new Error(`Expected a number-like value, got "${String(t.value)}".`);throw t}},VUt.createBytes=function(t){if("string"==typeof t&&"0x"===t.toLowerCase())return new Uint8Array;try{return(0,KUt.create)(t,tjt)}catch(t){if(t instanceof KUt.StructError)throw new Error(`Expected a bytes-like value, got "${String(t.value)}".`);throw t}},VUt.createHex=function(t){if(t instanceof Uint8Array&&0===t.length||"string"==typeof t&&"0x"===t.toLowerCase())return"0x";try{return(0,KUt.create)(t,ejt)}catch(t){if(t instanceof KUt.StructError)throw new Error(`Expected a bytes-like value, got "${String(t.value)}".`);throw t}};var rjt,njt,ijt={},ojt=o&&o.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},sjt=o&&o.__classPrivateFieldSet||function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};Object.defineProperty(ijt,"__esModule",{value:!0}),ijt.FrozenSet=ijt.FrozenMap=void 0;class ajt{get size(){return ojt(this,rjt,"f").size}[(rjt=new WeakMap,Symbol.iterator)](){return ojt(this,rjt,"f")[Symbol.iterator]()}constructor(t){rjt.set(this,void 0),sjt(this,rjt,new Map(t),"f"),Object.freeze(this)}entries(){return ojt(this,rjt,"f").entries()}forEach(t,e){return ojt(this,rjt,"f").forEach(((r,n,i)=>t.call(e,r,n,this)))}get(t){return ojt(this,rjt,"f").get(t)}has(t){return ojt(this,rjt,"f").has(t)}keys(){return ojt(this,rjt,"f").keys()}values(){return ojt(this,rjt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([t,e])=>`${String(t)} => ${String(e)}`)).join(", ")} `:""}}`}}ijt.FrozenMap=ajt;class cjt{get size(){return ojt(this,njt,"f").size}[(njt=new WeakMap,Symbol.iterator)](){return ojt(this,njt,"f")[Symbol.iterator]()}constructor(t){njt.set(this,void 0),sjt(this,njt,new Set(t),"f"),Object.freeze(this)}entries(){return ojt(this,njt,"f").entries()}forEach(t,e){return ojt(this,njt,"f").forEach(((r,n,i)=>t.call(e,r,n,this)))}has(t){return ojt(this,njt,"f").has(t)}keys(){return ojt(this,njt,"f").keys()}values(){return ojt(this,njt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((t=>String(t))).join(", ")} `:""}}`}}ijt.FrozenSet=cjt,Object.freeze(ajt),Object.freeze(ajt.prototype),Object.freeze(cjt),Object.freeze(cjt.prototype);var ujt={};Object.defineProperty(ujt,"__esModule",{value:!0});var fjt={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.getSafeJson=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=t.exactOptional=t.object=void 0;const e=BPt,r=RPt,n=ENt;function i({path:t,branch:e}){const r=t[t.length-1];return(0,n.hasProperty)(e[e.length-2],r)}function o(t){return new e.Struct({...t,type:`optional ${t.type}`,validator:(e,r)=>!i(r)||t.validator(e,r),refiner:(e,r)=>!i(r)||t.refiner(e,r)})}t.object=t=>(0,e.object)(t),t.exactOptional=o;function s(r){return(0,e.create)(r,t.JsonStruct)}t.UnsafeJsonStruct=(0,e.union)([(0,e.literal)(null),(0,e.boolean)(),(0,e.define)("finite number",(t=>(0,e.is)(t,(0,e.number)())&&Number.isFinite(t))),(0,e.string)(),(0,e.array)((0,e.lazy)((()=>t.UnsafeJsonStruct))),(0,e.record)((0,e.string)(),(0,e.lazy)((()=>t.UnsafeJsonStruct)))]),t.JsonStruct=(0,e.coerce)(t.UnsafeJsonStruct,(0,e.any)(),(e=>((0,r.assertStruct)(e,t.UnsafeJsonStruct),JSON.parse(JSON.stringify(e,((t,e)=>{if("__proto__"!==t&&"constructor"!==t)return e})))))),t.isValidJson=function(t){try{return s(t),!0}catch{return!1}},t.getSafeJson=s,t.getJsonSize=function(e){(0,r.assertStruct)(e,t.JsonStruct,"Invalid JSON value");const n=JSON.stringify(e);return(new TextEncoder).encode(n).byteLength},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,t.object)({code:(0,e.integer)(),message:(0,e.string)(),data:o(t.JsonStruct),stack:o((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)]),t.JsonRpcRequestStruct=(0,t.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:o(t.JsonRpcParamsStruct)}),t.JsonRpcNotificationStruct=(0,t.object)({jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:o(t.JsonRpcParamsStruct)}),t.isJsonRpcNotification=function(r){return(0,e.is)(r,t.JsonRpcNotificationStruct)},t.assertIsJsonRpcNotification=function(e,n){(0,r.assertStruct)(e,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",n)},t.isJsonRpcRequest=function(r){return(0,e.is)(r,t.JsonRpcRequestStruct)},t.assertIsJsonRpcRequest=function(e,n){(0,r.assertStruct)(e,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",n)},t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,t.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,t.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]),t.isPendingJsonRpcResponse=function(r){return(0,e.is)(r,t.PendingJsonRpcResponseStruct)},t.assertIsPendingJsonRpcResponse=function(e,n){(0,r.assertStruct)(e,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",n)},t.isJsonRpcResponse=function(r){return(0,e.is)(r,t.JsonRpcResponseStruct)},t.assertIsJsonRpcResponse=function(e,n){(0,r.assertStruct)(e,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",n)},t.isJsonRpcSuccess=function(r){return(0,e.is)(r,t.JsonRpcSuccessStruct)},t.assertIsJsonRpcSuccess=function(e,n){(0,r.assertStruct)(e,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",n)},t.isJsonRpcFailure=function(r){return(0,e.is)(r,t.JsonRpcFailureStruct)},t.assertIsJsonRpcFailure=function(e,n){(0,r.assertStruct)(e,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",n)},t.isJsonRpcError=function(r){return(0,e.is)(r,t.JsonRpcErrorStruct)},t.assertIsJsonRpcError=function(e,n){(0,r.assertStruct)(e,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",n)},t.getJsonRpcIdValidator=function(t){const{permitEmptyString:e,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...t};return t=>Boolean("number"==typeof t&&(r||Number.isInteger(t))||"string"==typeof t&&(e||t.length>0)||n&&null===t)}}(fjt);var hjt={};Object.defineProperty(hjt,"__esModule",{value:!0});var ljt,djt,pjt={},gjt={exports:{}};function yjt(){if(djt)return ljt;djt=1;var t=1e3,e=60*t,r=60*e,n=24*r,i=7*n,o=365.25*n;function s(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}return ljt=function(a,c){c=c||{};var u=typeof a;if("string"===u&&a.length>0)return function(s){if((s=String(s)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*n;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*e;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===u&&isFinite(a))return c.long?function(i){var o=Math.abs(i);if(o>=n)return s(i,o,n,"day");if(o>=r)return s(i,o,r,"hour");if(o>=e)return s(i,o,e,"minute");if(o>=t)return s(i,o,t,"second");return i+" ms"}(a):function(i){var o=Math.abs(i);if(o>=n)return Math.round(i/n)+"d";if(o>=r)return Math.round(i/r)+"h";if(o>=e)return Math.round(i/e)+"m";if(o>=t)return Math.round(i/t)+"s";return i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},ljt}var mjt=function(t){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t);(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,r){const n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function n(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(n),...e.skips.map(n).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e{"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=mjt(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(gjt,gjt.exports);var vjt=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pjt,"__esModule",{value:!0}),pjt.createModuleLogger=pjt.createProjectLogger=void 0;const wjt=(0,vjt(gjt.exports).default)("metamask");pjt.createProjectLogger=function(t){return wjt.extend(t)},pjt.createModuleLogger=function(t,e){return t.extend(e)};var bjt={};Object.defineProperty(bjt,"__esModule",{value:!0}),bjt.hexToBigInt=bjt.hexToNumber=bjt.bigIntToHex=bjt.numberToHex=void 0;const Ejt=RPt,Sjt=zUt();bjt.numberToHex=t=>((0,Ejt.assert)("number"==typeof t,"Value must be a number."),(0,Ejt.assert)(t>=0,"Value must be a non-negative number."),(0,Ejt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Sjt.add0x)(t.toString(16)));bjt.bigIntToHex=t=>((0,Ejt.assert)("bigint"==typeof t,"Value must be a bigint."),(0,Ejt.assert)(t>=0,"Value must be a non-negative bigint."),(0,Sjt.add0x)(t.toString(16)));bjt.hexToNumber=t=>{(0,Sjt.assertIsHexString)(t);const e=parseInt(t,16);return(0,Ejt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};bjt.hexToBigInt=t=>((0,Sjt.assertIsHexString)(t),BigInt((0,Sjt.add0x)(t)));var _jt={};Object.defineProperty(_jt,"__esModule",{value:!0});var Ajt={};Object.defineProperty(Ajt,"__esModule",{value:!0}),Ajt.createDeferredPromise=void 0,Ajt.createDeferredPromise=function({suppressUnhandledRejection:t=!1}={}){let e,r;const n=new Promise(((t,n)=>{e=t,r=n}));return t&&n.catch((t=>{})),{promise:n,resolve:e,reject:r}};var xjt={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,(e=t.Duration||(t.Duration={}))[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year";const r=(t,e)=>{if(!(t=>Number.isInteger(t)&&t>=0)(t))throw new Error(`"${e}" must be a non-negative integer. Received: "${t}".`)};t.inMilliseconds=function(t,e){return r(t,"count"),t*e},t.timeSince=function(t){return r(t,"timestamp"),Date.now()-t}}(xjt);var Ijt={};Object.defineProperty(Ijt,"__esModule",{value:!0});var kjt={},Tjt={exports:{}};var Rjt={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var Bjt="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};!function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Rjt,o=Bjt,s=(e=t.exports={}).re=[],a=e.safeRe=[],c=e.src=[],u=e.t={};let f=0;const h="[a-zA-Z0-9-]",l=[["\\s",1],["\\d",i],[h,n]],d=(t,e,r)=>{const n=(t=>{for(const[e,r]of l)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t})(e),i=f++;o(t,i,e),u[t]=i,c[i]=e,s[i]=new RegExp(e,r?"g":void 0),a[i]=new RegExp(n,r?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),d("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${h}+`),d("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),d("FULL",`^${c[u.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),d("LOOSE",`^${c[u.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),d("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),d("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),d("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),d("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?`+`(?:${c[u.BUILD]})?(?:$|[^\\d])`),d("COERCERTL",c[u.COERCE],!0),d("COERCERTLFULL",c[u.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",d("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",d("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Tjt,Tjt.exports);const Ojt=Object.freeze({loose:!0}),Mjt=Object.freeze({});var Cjt=t=>t?"object"!=typeof t?Ojt:t:Mjt;const Ljt=/^[0-9]+$/,Pjt=(t,e)=>{const r=Ljt.test(t),n=Ljt.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:tPjt(e,t)};const Ujt=Bjt,{MAX_LENGTH:jjt,MAX_SAFE_INTEGER:Djt}=Rjt,{safeRe:zjt,t:Fjt}=Tjt.exports,Hjt=Cjt,{compareIdentifiers:$jt}=Njt;class qjt{constructor(t,e){if(e=Hjt(e),t instanceof qjt){if(t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>jjt)throw new TypeError(`version is longer than ${jjt} characters`);Ujt("SemVer",t,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;const r=t.trim().match(e.loose?zjt[Fjt.LOOSE]:zjt[Fjt.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Djt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Djt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Djt||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(e===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(t)}}if(e){let n=[e,t];!1===r&&(n=[e]),0===$jt(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}var Wjt=qjt;const Vjt=Wjt;var Kjt=(t,e,r=!1)=>{if(t instanceof Vjt)return t;try{return new Vjt(t,e)}catch(t){if(!r)return null;throw t}};const Gjt=Kjt;var Zjt=(t,e)=>{const r=Gjt(t,e);return r?r.version:null};const Jjt=Kjt;var Yjt=(t,e)=>{const r=Jjt(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};const Xjt=Wjt;var Qjt=(t,e,r,n,i)=>{"string"==typeof r&&(i=n,n=r,r=void 0);try{return new Xjt(t instanceof Xjt?t.version:t,r).inc(e,n,i).version}catch(t){return null}};const tDt=Kjt;var eDt=(t,e)=>{const r=tDt(t,null,!0),n=tDt(e,null,!0),i=r.compare(n);if(0===i)return null;const o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c)return a.patch||a.minor?s.patch?"patch":s.minor?"minor":"major":"major";const u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};const rDt=Wjt;var nDt=(t,e)=>new rDt(t,e).major;const iDt=Wjt;var oDt=(t,e)=>new iDt(t,e).minor;const sDt=Wjt;var aDt=(t,e)=>new sDt(t,e).patch;const cDt=Kjt;var uDt=(t,e)=>{const r=cDt(t,e);return r&&r.prerelease.length?r.prerelease:null};const fDt=Wjt;var hDt=(t,e,r)=>new fDt(t,r).compare(new fDt(e,r));const lDt=hDt;var dDt=(t,e,r)=>lDt(e,t,r);const pDt=hDt;var gDt=(t,e)=>pDt(t,e,!0);const yDt=Wjt;var mDt=(t,e,r)=>{const n=new yDt(t,r),i=new yDt(e,r);return n.compare(i)||n.compareBuild(i)};const vDt=mDt;var wDt=(t,e)=>t.sort(((t,r)=>vDt(t,r,e)));const bDt=mDt;var EDt=(t,e)=>t.sort(((t,r)=>bDt(r,t,e)));const SDt=hDt;var _Dt=(t,e,r)=>SDt(t,e,r)>0;const ADt=hDt;var xDt=(t,e,r)=>ADt(t,e,r)<0;const IDt=hDt;var kDt=(t,e,r)=>0===IDt(t,e,r);const TDt=hDt;var RDt=(t,e,r)=>0!==TDt(t,e,r);const BDt=hDt;var ODt=(t,e,r)=>BDt(t,e,r)>=0;const MDt=hDt;var CDt=(t,e,r)=>MDt(t,e,r)<=0;const LDt=kDt,PDt=RDt,NDt=_Dt,UDt=ODt,jDt=xDt,DDt=CDt;var zDt=(t,e,r,n)=>{switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t===r;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t!==r;case"":case"=":case"==":return LDt(t,r,n);case"!=":return PDt(t,r,n);case">":return NDt(t,r,n);case">=":return UDt(t,r,n);case"<":return jDt(t,r,n);case"<=":return DDt(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};const FDt=Wjt,HDt=Kjt,{safeRe:$Dt,t:qDt}=Tjt.exports;var WDt=(t,e)=>{if(t instanceof FDt)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;let r=null;if((e=e||{}).rtl){const n=e.includePrerelease?$Dt[qDt.COERCERTLFULL]:$Dt[qDt.COERCERTL];let i;for(;(i=n.exec(t))&&(!r||r.index+r[0].length!==t.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),n.lastIndex=i.index+i[1].length+i[2].length;n.lastIndex=-1}else r=t.match(e.includePrerelease?$Dt[qDt.COERCEFULL]:$Dt[qDt.COERCE]);if(null===r)return null;const n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return HDt(`${n}.${i}.${o}${s}${a}`,e)};var VDt,KDt,GDt,ZDt,JDt=class{constructor(){this.max=1e3,this.map=new Map}get(t){const e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}delete(t){return this.map.delete(t)}set(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){const t=this.map.keys().next().value;this.delete(t)}this.map.set(t,e)}return this}};function YDt(){if(KDt)return VDt;KDt=1;const t=/\s+/g;class e{constructor(r,o){if(o=n(o),r instanceof e)return r.loose===!!o.loose&&r.includePrerelease===!!o.includePrerelease?r:new e(r.raw,o);if(r instanceof i)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=r.trim().replace(t," "),this.set=this.raw.split("||").map((t=>this.parseRange(t.trim()))).filter((t=>t.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const t=this.set[0];if(this.set=this.set.filter((t=>!p(t[0]))),0===this.set.length)this.set=[t];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&g(t[0])){this.set=[t];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let t=0;t0&&(this.formatted+="||");const e=this.set[t];for(let t=0;t0&&(this.formatted+=" "),this.formatted+=e[t].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){const e=((this.options.includePrerelease&&l)|(this.options.loose&&d))+":"+t,n=r.get(e);if(n)return n;const s=this.options.loose,g=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];t=t.replace(g,k(this.options.includePrerelease)),o("hyphen replace",t),t=t.replace(a[c.COMPARATORTRIM],u),o("comparator trim",t),t=t.replace(a[c.TILDETRIM],f),o("tilde trim",t),t=t.replace(a[c.CARETTRIM],h),o("caret trim",t);let y=t.split(" ").map((t=>m(t,this.options))).join(" ").split(/\s+/).map((t=>I(t,this.options)));s&&(y=y.filter((t=>(o("loose invalid filter",t,this.options),!!t.match(a[c.COMPARATORLOOSE]))))),o("range list",y);const v=new Map,w=y.map((t=>new i(t,this.options)));for(const t of w){if(p(t))return[t];v.set(t.value,t)}v.size>1&&v.has("")&&v.delete("");const b=[...v.values()];return r.set(e,b),b}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>y(e,r)&&t.set.some((t=>y(t,r)&&e.every((e=>t.every((t=>e.intersects(t,r)))))))))}test(t){if(!t)return!1;if("string"==typeof t)try{t=new s(t,this.options)}catch(t){return!1}for(let e=0;e"<0.0.0-0"===t.value,g=t=>""===t.value,y=(t,e)=>{let r=!0;const n=t.slice();let i=n.pop();for(;r&&n.length;)r=n.every((t=>i.intersects(t,e))),i=n.pop();return r},m=(t,e)=>(o("comp",t,e),t=E(t,e),o("caret",t),t=w(t,e),o("tildes",t),t=_(t,e),o("xrange",t),t=x(t,e),o("stars",t),t),v=t=>!t||"x"===t.toLowerCase()||"*"===t,w=(t,e)=>t.trim().split(/\s+/).map((t=>b(t,e))).join(" "),b=(t,e)=>{const r=e.loose?a[c.TILDELOOSE]:a[c.TILDE];return t.replace(r,((e,r,n,i,s)=>{let a;return o("tilde",t,e,r,n,i,s),v(r)?a="":v(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:v(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${r}.${n}.${i}-${s} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,o("tilde return",a),a}))},E=(t,e)=>t.trim().split(/\s+/).map((t=>S(t,e))).join(" "),S=(t,e)=>{o("caret",t,e);const r=e.loose?a[c.CARETLOOSE]:a[c.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,((e,r,i,s,a)=>{let c;return o("caret",t,e,r,i,s,a),v(r)?c="":v(i)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(s)?c="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===r?"0"===i?`>=${r}.${i}.${s}-${a} <${r}.${i}.${+s+1}-0`:`>=${r}.${i}.${s}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${s}-${a} <${+r+1}.0.0-0`):(o("no pr"),c="0"===r?"0"===i?`>=${r}.${i}.${s}${n} <${r}.${i}.${+s+1}-0`:`>=${r}.${i}.${s}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${s} <${+r+1}.0.0-0`),o("caret return",c),c}))},_=(t,e)=>(o("replaceXRanges",t,e),t.split(/\s+/).map((t=>A(t,e))).join(" ")),A=(t,e)=>{t=t.trim();const r=e.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return t.replace(r,((r,n,i,s,a,c)=>{o("xRange",t,r,n,i,s,a,c);const u=v(i),f=u||v(s),h=f||v(a),l=h;return"="===n&&l&&(n=""),c=e.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&l?(f&&(s=0),a=0,">"===n?(n=">=",f?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===n&&(n="<",f?i=+i+1:s=+s+1),"<"===n&&(c="-0"),r=`${n+i}.${s}.${a}${c}`):f?r=`>=${i}.0.0${c} <${+i+1}.0.0-0`:h&&(r=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",r),r}))},x=(t,e)=>(o("replaceStars",t,e),t.trim().replace(a[c.STAR],"")),I=(t,e)=>(o("replaceGTE0",t,e),t.trim().replace(a[e.includePrerelease?c.GTE0PRE:c.GTE0],"")),k=t=>(e,r,n,i,o,s,a,c,u,f,h,l)=>`${r=v(n)?"":v(i)?`>=${n}.0.0${t?"-0":""}`:v(o)?`>=${n}.${i}.0${t?"-0":""}`:s?`>=${r}`:`>=${r}${t?"-0":""}`} ${c=v(u)?"":v(f)?`<${+u+1}.0.0-0`:v(h)?`<${u}.${+f+1}.0-0`:l?`<=${u}.${f}.${h}-${l}`:t?`<${u}.${f}.${+h+1}-0`:`<=${c}`}`.trim(),T=(t,e,r)=>{for(let r=0;r0){const n=t[r].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0};return VDt}function XDt(){if(ZDt)return GDt;ZDt=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(n,i){if(i=r(i),n instanceof e){if(n.loose===!!i.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),s("comparator",n,i),this.options=i,this.loose=!!i.loose,this.parse(n),this.semver===t?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(e){const r=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],o=e.match(r);if(!o)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=t}toString(){return this.value}test(e){if(s("Comparator.test",e,this.options.loose),this.semver===t||e===t)return!0;if("string"==typeof e)try{e=new a(e,this.options)}catch(t){return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(t.value,n).test(this.value):""===t.operator?""===t.value||new c(this.value,n).test(t.semver):(!(n=r(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==t.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!t.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!t.operator.startsWith("<"))||(!(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))||(!!(o(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))||!!(o(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))))))}}GDt=e;const r=Cjt,{safeRe:n,t:i}=Tjt.exports,o=zDt,s=Bjt,a=Wjt,c=YDt();return GDt}const QDt=YDt();var tzt=(t,e,r)=>{try{e=new QDt(e,r)}catch(t){return!1}return e.test(t)};const ezt=YDt();var rzt=(t,e)=>new ezt(t,e).set.map((t=>t.map((t=>t.value)).join(" ").trim().split(" ")));const nzt=Wjt,izt=YDt();var ozt=(t,e,r)=>{let n=null,i=null,o=null;try{o=new izt(e,r)}catch(t){return null}return t.forEach((t=>{o.test(t)&&(n&&-1!==i.compare(t)||(n=t,i=new nzt(n,r)))})),n};const szt=Wjt,azt=YDt();var czt=(t,e,r)=>{let n=null,i=null,o=null;try{o=new azt(e,r)}catch(t){return null}return t.forEach((t=>{o.test(t)&&(n&&1!==i.compare(t)||(n=t,i=new szt(n,r)))})),n};const uzt=Wjt,fzt=YDt(),hzt=_Dt;var lzt=(t,e)=>{t=new fzt(t,e);let r=new uzt("0.0.0");if(t.test(r))return r;if(r=new uzt("0.0.0-0"),t.test(r))return r;r=null;for(let e=0;e{const e=new uzt(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":i&&!hzt(e,i)||(i=e);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}})),!i||r&&!hzt(r,i)||(r=i)}return r&&t.test(r)?r:null};const dzt=YDt();var pzt=(t,e)=>{try{return new dzt(t,e).range||"*"}catch(t){return null}};const gzt=Wjt,yzt=XDt(),{ANY:mzt}=yzt,vzt=YDt(),wzt=tzt,bzt=_Dt,Ezt=xDt,Szt=CDt,_zt=ODt;var Azt=(t,e,r,n)=>{let i,o,s,a,c;switch(t=new gzt(t,n),e=new vzt(e,n),r){case">":i=bzt,o=Szt,s=Ezt,a=">",c=">=";break;case"<":i=Ezt,o=_zt,s=bzt,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(wzt(t,e,n))return!1;for(let r=0;r{t.semver===mzt&&(t=new yzt(">=0.0.0")),f=f||t,h=h||t,i(t.semver,f.semver,n)?f=t:s(t.semver,h.semver,n)&&(h=t)})),f.operator===a||f.operator===c)return!1;if((!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===c&&s(t,h.semver))return!1}return!0};const xzt=Azt;var Izt=(t,e,r)=>xzt(t,e,">",r);const kzt=Azt;var Tzt=(t,e,r)=>kzt(t,e,"<",r);const Rzt=YDt();var Bzt=(t,e,r)=>(t=new Rzt(t,r),e=new Rzt(e,r),t.intersects(e,r));const Ozt=tzt,Mzt=hDt;const Czt=YDt(),Lzt=XDt(),{ANY:Pzt}=Lzt,Nzt=tzt,Uzt=hDt,jzt=[new Lzt(">=0.0.0-0")],Dzt=[new Lzt(">=0.0.0")],zzt=(t,e,r)=>{if(t===e)return!0;if(1===t.length&&t[0].semver===Pzt){if(1===e.length&&e[0].semver===Pzt)return!0;t=r.includePrerelease?jzt:Dzt}if(1===e.length&&e[0].semver===Pzt){if(r.includePrerelease)return!0;e=Dzt}const n=new Set;let i,o,s,a,c,u,f;for(const e of t)">"===e.operator||">="===e.operator?i=Fzt(i,e,r):"<"===e.operator||"<="===e.operator?o=Hzt(o,e,r):n.add(e.semver);if(n.size>1)return null;if(i&&o){if(s=Uzt(i.semver,o.semver,r),s>0)return null;if(0===s&&(">="!==i.operator||"<="!==o.operator))return null}for(const t of n){if(i&&!Nzt(t,String(i),r))return null;if(o&&!Nzt(t,String(o),r))return null;for(const n of e)if(!Nzt(t,String(n),r))return!1;return!0}let h=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver,l=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;h&&1===h.prerelease.length&&"<"===o.operator&&0===h.prerelease[0]&&(h=!1);for(const t of e){if(f=f||">"===t.operator||">="===t.operator,u=u||"<"===t.operator||"<="===t.operator,i)if(l&&t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===l.major&&t.semver.minor===l.minor&&t.semver.patch===l.patch&&(l=!1),">"===t.operator||">="===t.operator){if(a=Fzt(i,t,r),a===t&&a!==i)return!1}else if(">="===i.operator&&!Nzt(i.semver,String(t),r))return!1;if(o)if(h&&t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===h.major&&t.semver.minor===h.minor&&t.semver.patch===h.patch&&(h=!1),"<"===t.operator||"<="===t.operator){if(c=Hzt(o,t,r),c===t&&c!==o)return!1}else if("<="===o.operator&&!Nzt(o.semver,String(t),r))return!1;if(!t.operator&&(o||i)&&0!==s)return!1}return!(i&&u&&!o&&0!==s)&&(!(o&&f&&!i&&0!==s)&&(!l&&!h))},Fzt=(t,e,r)=>{if(!t)return e;const n=Uzt(t.semver,e.semver,r);return n>0?t:n<0||">"===e.operator&&">="===t.operator?e:t},Hzt=(t,e,r)=>{if(!t)return e;const n=Uzt(t.semver,e.semver,r);return n<0?t:n>0||"<"===e.operator&&"<="===t.operator?e:t};var $zt=(t,e,r={})=>{if(t===e)return!0;t=new Czt(t,r),e=new Czt(e,r);let n=!1;t:for(const i of t.set){for(const t of e.set){const e=zzt(i,t,r);if(n=n||null!==e,e)continue t}if(n)return!1}return!0};const qzt=Tjt.exports,Wzt=Rjt,Vzt=Wjt,Kzt=Njt,Gzt=(t,e,r)=>{const n=[];let i=null,o=null;const s=t.sort(((t,e)=>Mzt(t,e,r)));for(const t of s){Ozt(t,e,r)?(o=t,i||(i=t)):(o&&n.push([i,o]),o=null,i=null)}i&&n.push([i,null]);const a=[];for(const[t,e]of n)t===e?a.push(t):e||t!==s[0]?e?t===s[0]?a.push(`<=${e}`):a.push(`${t} - ${e}`):a.push(`>=${t}`):a.push("*");const c=a.join(" || "),u="string"==typeof e.raw?e.raw:String(e);return c.lengthnull!==(0,r.valid)(t)||`Expected SemVer version, got "${t}"`)),t.VersionRangeStruct=(0,e.refine)((0,e.string)(),"Version range",(t=>null!==(0,r.validRange)(t)||`Expected SemVer range, got "${t}"`)),t.isValidSemVerVersion=function(r){return(0,e.is)(r,t.VersionStruct)},t.isValidSemVerRange=function(r){return(0,e.is)(r,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(e){(0,n.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,n.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(t,e){return(0,r.gt)(t,e)},t.gtRange=function(t,e){return(0,r.gtr)(t,e)},t.satisfiesVersionRange=function(t,e){return(0,r.satisfies)(t,e,{includePrerelease:!0})}}(kjt),function(t){var e=o&&o.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),r=o&&o.__exportStar||function(t,r){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||e(r,t,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(RPt,t),r(BNt,t),r(FUt(),t),r(HUt,t),r($Ut,t),r(VUt,t),r(ijt,t),r(ujt,t),r(aNt,t),r(zUt(),t),r(fjt,t),r(hjt,t),r(pjt,t),r(ENt,t),r(bjt,t),r(_jt,t),r(Ajt,t),r(xjt,t),r(Ijt,t),r(kjt,t)}(TPt),Object.defineProperty(kPt,"__esModule",{value:!0}),kPt.normalize=kPt.recoverPublicKey=kPt.concatSig=kPt.legacyToBuffer=kPt.isNullish=kPt.padWithZeroes=void 0;const Jzt=Qxt,Yzt=TPt;function Xzt(t,e){if(""!==t&&!/^[a-f0-9]+$/iu.test(t))throw new Error(`Expected an unprefixed hex string. Received: ${t}`);if(e<0)throw new Error(`Expected a non-negative integer target length. Received: ${e}`);return String.prototype.padStart.call(t,e,"0")}function Qzt(t){return null==t}kPt.padWithZeroes=Xzt,kPt.isNullish=Qzt,kPt.legacyToBuffer=function(t){return"string"!=typeof t||(0,Jzt.isHexString)(t)?(0,Jzt.toBuffer)(t):pgt.from(t)},kPt.concatSig=function(t,e,r){const n=(0,Jzt.fromSigned)(e),i=(0,Jzt.fromSigned)(r),o=(0,Jzt.bufferToInt)(t),s=Xzt((0,Jzt.toUnsigned)(n).toString("hex"),64),a=Xzt((0,Jzt.toUnsigned)(i).toString("hex"),64),c=(0,Yzt.remove0x)((0,Yzt.numberToHex)(o));return(0,Yzt.add0x)(s.concat(a,c))},kPt.recoverPublicKey=function(t,e){const r=(0,Jzt.fromRpcSig)(e);return(0,Jzt.ecrecover)(t,r.v,r.r,r.s)},kPt.normalize=function(t){if(!Qzt(t)){if("number"==typeof t){if(t<0)return"0x";const e=(0,Yzt.numberToBytes)(t);t=(0,Yzt.bytesToHex)(e)}if("string"!=typeof t){let e="eth-sig-util.normalize() requires hex string or integer input.";throw e+=` received ${typeof t}: ${t}`,new Error(e)}return(0,Yzt.add0x)(t.toLowerCase())}},Object.defineProperty(Xxt,"__esModule",{value:!0}),Xxt.extractPublicKey=Xxt.recoverPersonalSignature=Xxt.personalSign=void 0;const tFt=Qxt,eFt=kPt;function rFt(t,e){const r=(0,tFt.hashPersonalMessage)((0,eFt.legacyToBuffer)(t));return(0,eFt.recoverPublicKey)(r,e)}Xxt.personalSign=function({privateKey:t,data:e}){if((0,eFt.isNullish)(e))throw new Error("Missing data parameter");if((0,eFt.isNullish)(t))throw new Error("Missing privateKey parameter");const r=(0,eFt.legacyToBuffer)(e),n=(0,tFt.hashPersonalMessage)(r),i=(0,tFt.ecsign)(n,t);return(0,eFt.concatSig)((0,tFt.toBuffer)(i.v),i.r,i.s)},Xxt.recoverPersonalSignature=function({data:t,signature:e}){if((0,eFt.isNullish)(t))throw new Error("Missing data parameter");if((0,eFt.isNullish)(e))throw new Error("Missing signature parameter");const r=rFt(t,e),n=(0,tFt.publicToAddress)(r);return(0,tFt.bufferToHex)(n)},Xxt.extractPublicKey=function({data:t,signature:e}){if((0,eFt.isNullish)(t))throw new Error("Missing data parameter");if((0,eFt.isNullish)(e))throw new Error("Missing signature parameter");return`0x${rFt(t,e).toString("hex")}`};var nFt={},iFt={},oFt={},sFt={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ParserError=t.getErrorStack=t.getErrorMessage=void 0;const e=TPt;t.getErrorMessage=t=>"string"==typeof t?t:t instanceof Error||(0,e.isObject)(t)&&(0,e.hasProperty)(t,"message")&&"string"==typeof t.message?t.message:"Unknown error.";t.getErrorStack=t=>{if(t instanceof Error)return t.stack};class r extends Error{constructor(e,r){super(e),this.name="ParserError";const n=(0,t.getErrorStack)(r);n&&(this.stack=n)}}t.ParserError=r}(sFt);var aFt={},cFt={};Object.defineProperty(cFt,"__esModule",{value:!0}),cFt.iterate=void 0;const uFt=TPt;cFt.iterate=function*(t,e=32){for(let r=0;r{(0,uFt.assert)(t>=0,"Cannot skip a negative number of bytes."),(0,uFt.assert)(t%e==0,"Length must be a multiple of the size."),r+=t},i=t.subarray(r);yield{skip:n,value:i}}return{skip:()=>{},value:new Uint8Array}};var fFt={},hFt={},lFt={},dFt={};Object.defineProperty(dFt,"__esModule",{value:!0}),dFt.padEnd=dFt.padStart=dFt.set=void 0;const pFt=TPt;dFt.set=(t,e,r)=>(0,pFt.concatBytes)([t.subarray(0,r),e,t.subarray(r+e.length)]);dFt.padStart=(t,e=32)=>{const r=new Uint8Array(Math.max(e-t.length,0)).fill(0);return(0,pFt.concatBytes)([r,t])};dFt.padEnd=(t,e=32)=>{const r=new Uint8Array(Math.max(e-t.length,0)).fill(0);return(0,pFt.concatBytes)([t,r])},function(t){var e=o&&o.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),r=o&&o.__exportStar||function(t,r){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||e(r,t,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(dFt,t)}(lFt),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.address=t.getAddress=void 0;const e=TPt,r=sFt,n=lFt;t.getAddress=t=>{const i=(0,e.createBytes)(t);return(0,e.assert)(i.length<=20,new r.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${i.length} bytes.`)),(0,n.padStart)(i,20)},t.address={isDynamic:!1,isType:t=>"address"===t,getByteLength:()=>32,encode({buffer:r,value:i,packed:o}){const s=(0,t.getAddress)(i);if(o)return(0,e.concatBytes)([r,s]);const a=(0,n.padStart)(s);return(0,e.concatBytes)([r,a])},decode:({value:t})=>(0,e.add0x)((0,e.bytesToHex)(t.slice(12,32)))}}(hFt);var gFt={},yFt={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.fixedBytes=t.getByteLength=void 0;const e=TPt,r=sFt,n=lFt,i=/^bytes([0-9]{1,2})$/u;t.getByteLength=t=>{var n;const o=null===(n=t.match(i))||void 0===n?void 0:n[1];(0,e.assert)(o,`Invalid byte length. Expected a number between 1 and 32, but received "${t}".`);const s=Number(o);return(0,e.assert)(s>0&&s<=32,new r.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${t}".`)),s},t.fixedBytes={isDynamic:!1,isType:t=>i.test(t),getByteLength:()=>32,encode({type:i,buffer:o,value:s,packed:a}){const c=(0,t.getByteLength)(i),u=(0,e.createBytes)(s);return(0,e.assert)(u.length<=c,new r.ParserError(`Expected a value of length ${c}, but received a value of length ${u.length}.`)),(0,e.concatBytes)(a?[o,(0,n.padEnd)(u,c)]:[o,(0,n.padEnd)(u)])},decode({type:e,value:r}){const n=(0,t.getByteLength)(e);return r.slice(0,n)}}}(yFt);var mFt,vFt,wFt={};function bFt(){return mFt||(mFt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.tuple=t.getTupleElements=void 0;const e=TPt,r=sFt,n=LFt(),i=/^\((.+)\)$/u;t.getTupleElements=t=>{(0,e.assert)(t.startsWith("(")&&t.endsWith(")"),new r.ParserError(`Invalid tuple type. Expected tuple type, but received "${t}".`));const n=[];let i="",o=0;for(let e=1;e(0,t.getTupleElements)(e).some((t=>{const e=(0,n.getParser)(t);return(0,n.isDynamicParser)(e,t)})),isType:t=>(t=>i.test(t))(t),getByteLength(e){if((0,n.isDynamicParser)(this,e))return 32;return(0,t.getTupleElements)(e).reduce(((t,e)=>t+(0,n.getParser)(e).getByteLength(e)),0)},encode({type:e,buffer:r,value:i,packed:o,tight:s}){const a=(0,t.getTupleElements)(e);return(0,n.pack)({types:a,values:i,byteArray:r,packed:o,tight:s})},decode({type:e,value:r,skip:i}){const o=(0,t.getTupleElements)(e);return i(this.getByteLength(e)-32),(0,n.unpack)(o,r)}}}(wFt)),wFt}var EFt={},SFt={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.number=t.getBigInt=t.assertNumberLength=t.getLength=t.isSigned=void 0;const e=TPt,r=sFt,n=lFt,i=/^u?int(?[0-9]*)?$/u;t.isSigned=t=>!t.startsWith("u");t.getLength=t=>{var n;if("int"===t||"uint"===t)return 256;const o=t.match(i);(0,e.assert)(null==o||null===(n=o.groups)||void 0===n?void 0:n.length,new r.ParserError(`Invalid number type. Expected a number type, but received "${t}".`));const s=parseInt(o.groups.length,10);return(0,e.assert)(s>=8&&s<=256,new r.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${t}".`)),(0,e.assert)(s%8==0,new r.ParserError(`Invalid number length. Expected a multiple of 8, but received "${t}".`)),s};t.assertNumberLength=(n,i)=>{const o=(0,t.getLength)(i),s=BigInt(2)**BigInt(o-((0,t.isSigned)(i)?1:0))-BigInt(1);(0,t.isSigned)(i)?(0,e.assert)(n>=-(s+BigInt(1))&&n<=s,new r.ParserError(`Number "${n}" is out of range for type "${i}".`)):(0,e.assert)(n<=s,new r.ParserError(`Number "${n}" is out of range for type "${i}".`))};t.getBigInt=t=>{try{return(0,e.createBigInt)(t)}catch{throw new r.ParserError(`Invalid number. Expected a valid number value, but received "${t}".`)}},t.number={isDynamic:!1,isType:t=>i.test(t),getByteLength:()=>32,encode({type:r,buffer:i,value:o,packed:s}){const a=(0,t.getBigInt)(o);if((0,t.assertNumberLength)(a,r),(0,t.isSigned)(r)){if(s){const n=(0,t.getLength)(r)/8;return(0,e.concatBytes)([i,(0,e.signedBigIntToBytes)(a,n)])}return(0,e.concatBytes)([i,(0,n.padStart)((0,e.signedBigIntToBytes)(a,32))])}if(s){const o=(0,t.getLength)(r)/8;return(0,e.concatBytes)([i,(0,n.padStart)((0,e.bigIntToBytes)(a),o)])}return(0,e.concatBytes)([i,(0,n.padStart)((0,e.bigIntToBytes)(a))])},decode({type:r,value:n}){const i=n.subarray(0,32);if((0,t.isSigned)(r)){const n=(0,e.bytesToSignedBigInt)(i);return(0,t.assertNumberLength)(n,r),n}const o=(0,e.bytesToBigInt)(i);return(0,t.assertNumberLength)(o,r),o}}}(SFt),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.bool=t.getBooleanValue=void 0;const e=BPt,r=TPt,n=sFt,i=SFt,o=(0,e.coerce)((0,e.boolean)(),(0,e.union)([(0,e.literal)("true"),(0,e.literal)("false")]),(t=>"true"===t));t.getBooleanValue=t=>{try{return(0,e.create)(t,o)?BigInt(1):BigInt(0)}catch{throw new n.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${t}".`)}},t.bool={isDynamic:!1,isType:t=>"bool"===t,getByteLength:()=>32,encode({buffer:e,value:n,packed:o,tight:s}){const a=(0,t.getBooleanValue)(n);return o?(0,r.concatBytes)([e,(0,r.bigIntToBytes)(a)]):i.number.encode({type:"uint256",buffer:e,value:a,packed:o,tight:s})},decode:t=>i.number.decode({...t,type:"uint256"})===BigInt(1)}}(EFt);var _Ft={};Object.defineProperty(_Ft,"__esModule",{value:!0}),_Ft.bytes=void 0;const AFt=TPt,xFt=lFt;_Ft.bytes={isDynamic:!0,isType:t=>"bytes"===t,getByteLength:()=>32,encode({buffer:t,value:e,packed:r}){const n=(0,AFt.createBytes)(e);if(r)return(0,AFt.concatBytes)([t,n]);const i=32*Math.ceil(n.byteLength/32);return(0,AFt.concatBytes)([t,(0,xFt.padStart)((0,AFt.numberToBytes)(n.byteLength)),(0,xFt.padEnd)(n,i)])},decode({value:t}){const e=t.subarray(0,32),r=(0,AFt.bytesToNumber)(e);return t.slice(32,32+r)}};var IFt={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.fn=t.getFunction=void 0;const e=BPt,r=TPt,n=sFt,i=yFt,o=(0,e.coerce)((0,e.object)({address:r.StrictHexStruct,selector:r.StrictHexStruct}),(0,e.union)([r.StrictHexStruct,(0,e.instance)(Uint8Array)]),(t=>{const e=(0,r.createBytes)(t);return(0,r.assert)(24===e.length,new n.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${e.length} bytes.`)),{address:(0,r.bytesToHex)(e.subarray(0,20)),selector:(0,r.bytesToHex)(e.subarray(20,24))}}));t.getFunction=t=>{const n=(0,e.create)(t,o);return(0,r.concatBytes)([(0,r.hexToBytes)(n.address),(0,r.hexToBytes)(n.selector)])},t.fn={isDynamic:!1,isType:t=>"function"===t,getByteLength:()=>32,encode({buffer:e,value:r,packed:n,tight:o}){const s=(0,t.getFunction)(r);return i.fixedBytes.encode({type:"bytes24",buffer:e,value:s,packed:n,tight:o})},decode:({value:t})=>({address:(0,r.bytesToHex)(t.slice(0,20)),selector:(0,r.bytesToHex)(t.slice(20,24))})}}(IFt);var kFt={};Object.defineProperty(kFt,"__esModule",{value:!0});var TFt={};Object.defineProperty(TFt,"__esModule",{value:!0}),TFt.string=void 0;const RFt=TPt,BFt=_Ft;var OFt,MFt;function CFt(){return OFt||(OFt=1,function(t){var e=o&&o.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),r=o&&o.__exportStar||function(t,r){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||e(r,t,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(hFt,t),r((vFt||(vFt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.array=t.getTupleType=t.getArrayType=t.isArrayType=void 0;const e=TPt,r=sFt,n=LFt(),i=lFt,o=yFt,s=bFt(),a=/^(?.*)\[(?\d*?)\]$/u;t.isArrayType=t=>a.test(t),t.getArrayType=t=>{var n;const i=t.match(a);return(0,e.assert)(null==i||null===(n=i.groups)||void 0===n?void 0:n.type,new r.ParserError(`Invalid array type. Expected an array type, but received "${t}".`)),[i.groups.type,i.groups.length?parseInt(i.groups.length,10):void 0]},t.getTupleType=(t,e)=>`(${new Array(e).fill(t).join(",")})`,t.array={isDynamic(e){const[r,i]=(0,t.getArrayType)(e);return void 0===i||(0,n.isDynamicParser)((0,n.getParser)(r),r)},isType:e=>(0,t.isArrayType)(e),getByteLength(i){(0,e.assert)((0,t.isArrayType)(i),new r.ParserError(`Expected an array type, but received "${i}".`));const[o,a]=(0,t.getArrayType)(i);return(0,n.isDynamicParser)(this,i)||void 0===a?32:s.tuple.getByteLength((0,t.getTupleType)(o,a))},encode({type:a,buffer:c,value:u,packed:f,tight:h}){const[l,d]=(0,t.getArrayType)(a);if((0,e.assert)(!f||!(0,t.isArrayType)(l),new r.ParserError("Cannot pack nested arrays.")),f&&(0,n.isDynamicParser)((0,n.getParser)(l),l))return(0,n.pack)({types:new Array(u.length).fill(l),values:u,byteArray:c,packed:f,arrayPacked:!0,tight:h});if(d)return(0,e.assert)(d===u.length,new r.ParserError(`Array length does not match type length. Expected a length of ${d}, but received ${u.length}.`)),s.tuple.encode({type:(0,t.getTupleType)(l,d),buffer:c,value:u,packed:o.fixedBytes.isType(l)&&h,tight:h});if(f)return(0,n.pack)({types:new Array(u.length).fill(l),values:u,byteArray:c,packed:o.fixedBytes.isType(l)&&h,arrayPacked:!0,tight:h});const p=(0,i.padStart)((0,e.numberToBytes)(u.length));return(0,n.pack)({types:new Array(u.length).fill(l),values:u,byteArray:(0,e.concatBytes)([c,p]),packed:f,tight:h})},decode({type:i,value:o,...a}){const[c,u]=(0,t.getArrayType)(i);if(u){const n=s.tuple.decode({type:(0,t.getTupleType)(c,u),value:o,...a});return(0,e.assert)(n.length===u,new r.ParserError(`Array length does not match type length. Expected a length of ${u}, but received ${n.length}.`)),n}const f=(0,e.bytesToNumber)(o.subarray(0,32));return(0,n.unpack)(new Array(f).fill(c),o.subarray(32))}}}(gFt)),gFt),t),r(EFt,t),r(_Ft,t),r(yFt,t),r(IFt,t),r(SFt,t),r(kFt,t),r(TFt,t),r(bFt(),t)}(fFt)),fFt}function LFt(){return MFt||(MFt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.unpack=t.pack=t.isDynamicParser=t.getParser=void 0;const e=TPt,r=sFt,n=cFt,i=CFt(),o=lFt;t.getParser=t=>{const e={address:i.address,array:i.array,bool:i.bool,bytes:i.bytes,fixedBytes:i.fixedBytes,function:i.fn,number:i.number,string:i.string,tuple:i.tuple},n=e[t];if(n)return n;const o=Object.values(e).find((e=>e.isType(t)));if(o)return o;throw new r.ParserError(`The type "${t}" is not supported.`)};t.isDynamicParser=(t,e)=>{const{isDynamic:r}=t;return"function"==typeof r?r(e):r};t.pack=({types:n,values:i,packed:s=!1,tight:a=!1,arrayPacked:c=!1,byteArray:u=new Uint8Array})=>{(0,e.assert)(n.length===i.length,new r.ParserError(`The number of types (${n.length}) does not match the number of values (${i.length}).`));const{staticBuffer:f,dynamicBuffer:h,pointers:l}=n.reduce((({staticBuffer:r,dynamicBuffer:n,pointers:o},u,f)=>{const h=(0,t.getParser)(u),l=i[f];if(s||c||!(0,t.isDynamicParser)(h,u))return{staticBuffer:h.encode({buffer:r,value:l,type:u,packed:s,tight:a}),dynamicBuffer:n,pointers:o};return{staticBuffer:(0,e.concatBytes)([r,new Uint8Array(32)]),dynamicBuffer:h.encode({buffer:n,value:l,type:u,packed:s,tight:a}),pointers:[...o,{position:r.length,pointer:n.length}]}}),{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,e.assert)(!s&&!c||0===h.length,new r.ParserError("Invalid pack state."));const d=f.length,p=l.reduce(((t,{pointer:r,position:n})=>{const i=(0,o.padStart)((0,e.numberToBytes)(d+r));return(0,o.set)(t,i,n)}),f);return(0,e.concatBytes)([u,p,h])};t.unpack=(i,o)=>{const s=(0,n.iterate)(o);return i.map((n=>{const{value:{value:i,skip:a},done:c}=s.next();(0,e.assert)(!c,new r.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${n}".`));const u=(0,t.getParser)(n);if((0,t.isDynamicParser)(u,n)){const t=(0,e.bytesToNumber)(i.subarray(0,32)),r=o.subarray(t);return u.decode({type:n,value:r,skip:a})}return u.decode({type:n,value:i,skip:a})}))}}(aFt)),aFt}TFt.string={isDynamic:!0,isType:t=>"string"===t,getByteLength:()=>32,encode:({buffer:t,value:e,packed:r,tight:n})=>BFt.bytes.encode({type:"bytes",buffer:t,value:(0,RFt.stringToBytes)(e),packed:r,tight:n}),decode:t=>(0,RFt.bytesToString)(BFt.bytes.decode(t))},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSingle=t.decode=t.encodePacked=t.encodeSingle=t.encode=void 0;const e=TPt,r=sFt,n=LFt();t.encode=(t,e,i,o)=>{try{return(0,n.pack)({types:t,values:e,packed:i,tight:o})}catch(t){if(t instanceof r.ParserError)throw new r.ParserError(`Unable to encode value: ${t.message}`,t);throw new r.ParserError(`An unexpected error occurred: ${(0,r.getErrorMessage)(t)}`,t)}};t.encodeSingle=(e,r)=>(0,t.encode)([e],[r]);t.encodePacked=(e,r,n)=>(0,t.encode)(e,r,!0,n);t.decode=(t,i)=>{const o=(0,e.createBytes)(i);try{return(0,n.unpack)(t,o)}catch(t){if(t instanceof r.ParserError)throw new r.ParserError(`Unable to decode value: ${t.message}`,t);throw new r.ParserError(`An unexpected error occurred: ${(0,r.getErrorMessage)(t)}`,t)}};t.decodeSingle=(n,i)=>{const o=(0,t.decode)([n],i);return(0,e.assert)(1===o.length,new r.ParserError("Decoded value array has unexpected length.")),o[0]}}(oFt);var PFt={},NFt={};Object.defineProperty(NFt,"__esModule",{value:!0}),function(t){var e=o&&o.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),r=o&&o.__exportStar||function(t,r){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||e(r,t,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(NFt,t)}(PFt),function(t){var e=o&&o.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),r=o&&o.__exportStar||function(t,r){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||e(r,t,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(oFt,t),r(sFt,t),r(PFt,t)}(iFt),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.recoverTypedSignature=t.signTypedData=t.typedSignatureHash=t.TypedDataUtils=t.TYPED_MESSAGE_SCHEMA=t.SignTypedDataVersion=void 0;const e=Qxt,r=iFt,n=CFt(),i=lFt,o=TPt,s=Zkt,a=kPt;var c;function u(t,e){if(!Object.keys(c).includes(t))throw new Error(`Invalid version: '${t}'`);if(e&&!e.includes(t))throw new Error(`SignTypedDataVersion not allowed: '${t}'. Allowed versions are: ${e.join(", ")}`)}function f(t,e){(0,o.assert)(null!==e,`Unable to encode value: Invalid number. Expected a valid number value, but received "${e}".`);const r=BigInt(e),i=(0,n.getLength)(t),s=BigInt(2)**BigInt(i)-BigInt(1);return(0,o.assert)(r>=-s&&r<=s,`Unable to encode value: Number "${e}" is out of range for type "${t}".`),r}function h(t){let e=BigInt(0);for(let r=0;r=49?n-BigInt(49)+BigInt(10):n>=17?n-BigInt(17)+BigInt(10):n}return(0,i.padStart)((0,o.bigIntToBytes)(e),20)}function l(t,n,a,p,g){if(u(g,[c.V3,c.V4]),void 0!==t[a])return["bytes32",g===c.V4&&null==p?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,e.arrToBufArr)((0,s.keccak256)(d(a,p,t,g)))];if("function"===a)throw new Error('Unsupported or invalid type: "function"');if(void 0===p)throw new Error(`missing value for field ${n} of type ${a}`);if("address"===a){if("number"==typeof p)return["address",(0,i.padStart)((0,o.numberToBytes)(p),20)];if((0,o.isStrictHexString)(p))return["address",(0,o.add0x)(p)];if("string"==typeof p)return["address",h(p).subarray(0,20)]}if("bool"===a)return["bool",Boolean(p)];if("bytes"===a)return"number"==typeof p?p=(0,o.numberToBytes)(p):(0,o.isStrictHexString)(p)||"0x"===p?p=(0,o.hexToBytes)(p):"string"==typeof p&&(p=(0,o.stringToBytes)(p)),["bytes32",(0,e.arrToBufArr)((0,s.keccak256)(p))];if(a.startsWith("bytes")&&"bytes"!==a&&!a.includes("["))return"number"==typeof p?p<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,o.bigIntToBytes)(BigInt(p))]:(0,o.isStrictHexString)(p)?["bytes32",(0,o.hexToBytes)(p)]:["bytes32",p];if(a.startsWith("int")&&!a.includes("[")){const t=f(a,p);return t>=BigInt(0)?["uint256",t]:["int256",t]}if("string"===a)return p="number"==typeof p?(0,o.numberToBytes)(p):(0,o.stringToBytes)(null!=p?p:""),["bytes32",(0,e.arrToBufArr)((0,s.keccak256)(p))];if(a.endsWith("]")){if(g===c.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const i=a.slice(0,a.lastIndexOf("[")),o=p.map((e=>l(t,n,i,e,g)));return["bytes32",(0,e.arrToBufArr)((0,s.keccak256)((0,r.encode)(o.map((([t])=>t)),o.map((([,t])=>t)))))]}return[a,p]}function d(t,n,i,o){u(o,[c.V3,c.V4]);const s=["bytes32"],a=[m(t,i)];for(const e of i[t]){if(o===c.V3&&void 0===n[e.name])continue;const[t,r]=l(i,e.name,e.type,n[e.name],o);s.push(t),a.push(r)}return(0,e.arrToBufArr)((0,r.encode)(s,a))}function p(t,e){let r="";const n=g(t,e);n.delete(t);const i=[t,...Array.from(n).sort()];for(const t of i){if(!e[t])throw new Error(`No type definition specified: ${t}`);r+=`${t}(${e[t].map((({name:t,type:e})=>`${e} ${t}`)).join(",")})`}return r}function g(t,e,r=new Set){if("string"!=typeof t)throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(t)}`);const n=t.match(/^\w*/u);if([t]=n,r.has(t)||void 0===e[t])return r;r.add(t);for(const n of e[t])g(n.type,e,r);return r}function y(t,r,n,i){u(i,[c.V3,c.V4]);const o=d(t,r,n,i),a=(0,s.keccak256)(o);return(0,e.arrToBufArr)(a)}function m(t,r){const n=(0,o.stringToBytes)(p(t,r));return(0,e.arrToBufArr)((0,s.keccak256)(n))}function v(e){const r={};for(const n in t.TYPED_MESSAGE_SCHEMA.properties)e[n]&&(r[n]=e[n]);return"types"in r&&(r.types=Object.assign({EIP712Domain:[]},r.types)),r}function w(t,e){u(e,[c.V3,c.V4]);const r=v(t),{domain:n}=r;return y("EIP712Domain",n,{EIP712Domain:r.types.EIP712Domain},e)}function b(t,e){if((0,n.isArrayType)(t)&&Array.isArray(e)){const[r]=(0,n.getArrayType)(t);return e.map((t=>b(r,t)))}if("address"===t){if("number"==typeof e)return(0,i.padStart)((0,o.numberToBytes)(e),20);if((0,o.isStrictHexString)(e))return(0,i.padStart)((0,o.hexToBytes)(e).subarray(0,20),20);if(e instanceof Uint8Array)return(0,i.padStart)(e.subarray(0,20),20)}if("bool"===t)return Boolean(e);if(t.startsWith("bytes")&&"bytes"!==t){const r=(0,n.getByteLength)(t);if("number"==typeof e)return e<0?new Uint8Array:(0,o.numberToBytes)(e).subarray(0,r);if((0,o.isStrictHexString)(e))return(0,o.hexToBytes)(e).subarray(0,r);if(e instanceof Uint8Array)return e.subarray(0,r)}if(t.startsWith("uint")&&"number"==typeof e)return Math.abs(e);if(t.startsWith("int")&&"number"==typeof e){const r=(0,n.getLength)(t);return BigInt.asIntN(r,BigInt(e))}return e}function E(t){return t.map((t=>"number"==typeof t?(0,i.padStart)((0,o.numberToBytes)(t),32):(0,o.isStrictHexString)(t)?(0,i.padStart)((0,o.hexToBytes)(t).subarray(0,32),32):t instanceof Uint8Array?(0,i.padStart)(t.subarray(0,32),32):t))}function S(t,e){return e.map((e=>{if("string"==typeof e||"number"==typeof e||"bigint"==typeof e){const r=f(t,e);if(r>=BigInt(0))return(0,i.padStart)((0,o.bigIntToBytes)(r),32);const s=(0,n.getLength)(t),a=BigInt.asIntN(s,r);return(0,o.signedBigIntToBytes)(a,32)}return e}))}function _(t){const i=new Error("Expect argument to be non-empty array");if("object"!=typeof t||!("length"in t)||!t.length)throw i;const o=t.map((({name:t,type:e,value:r})=>{if("address[]"===e)return{name:t,type:"bytes32[]",value:E(r)};if(e.startsWith("int")&&(0,n.isArrayType)(e)){const[i,o]=(0,n.getArrayType)(e);return{name:t,type:`bytes32[${null!=o?o:""}]`,value:S(i,r)}}return{name:t,type:e,value:b(e,r)}})),c=o.map((t=>"bytes"!==t.type?t.value:(0,a.legacyToBuffer)(t.value))),u=o.map((t=>{if("function"===t.type)throw new Error('Unsupported or invalid type: "function"');return t.type})),f=t.map((t=>{if(!t.name)throw i;return`${t.type} ${t.name}`}));return(0,e.arrToBufArr)((0,s.keccak256)((0,r.encodePacked)(["bytes32","bytes32"],[(0,s.keccak256)((0,r.encodePacked)(["string[]"],[f],!0)),(0,s.keccak256)((0,r.encodePacked)(u,c,!0))])))}!function(t){t.V1="V1",t.V3="V3",t.V4="V4"}(c=t.SignTypedDataVersion||(t.SignTypedDataVersion={})),t.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},t.TypedDataUtils={encodeData:d,encodeType:p,findTypeDependencies:g,hashStruct:y,hashType:m,sanitizeData:v,eip712Hash:function(t,r){u(r,[c.V3,c.V4]);const n=v(t),i=[(0,o.hexToBytes)("1901")];return i.push(w(t,r)),"EIP712Domain"!==n.primaryType&&i.push(y(n.primaryType,n.message,n.types,r)),(0,e.arrToBufArr)((0,s.keccak256)((0,o.concatBytes)(i)))},eip712DomainHash:w},t.typedSignatureHash=function(t){const e=_(t);return(0,o.bytesToHex)(e)},t.signTypedData=function({privateKey:r,data:n,version:i}){if(u(i),(0,a.isNullish)(n))throw new Error("Missing data parameter");if((0,a.isNullish)(r))throw new Error("Missing private key parameter");const s=i===c.V1?_(n):t.TypedDataUtils.eip712Hash(n,i),f=(0,e.ecsign)(s,r);return(0,a.concatSig)((0,e.arrToBufArr)((0,o.bigIntToBytes)(f.v)),f.r,f.s)},t.recoverTypedSignature=function({data:r,signature:n,version:i}){if(u(i),(0,a.isNullish)(r))throw new Error("Missing data parameter");if((0,a.isNullish)(n))throw new Error("Missing signature parameter");const s=i===c.V1?_(r):t.TypedDataUtils.eip712Hash(r,i),f=(0,a.recoverPublicKey)(s,n),h=(0,e.publicToAddress)(f);return(0,o.bytesToHex)(h)}}(nFt);var UFt={},jFt={exports:{}},DFt=s(Object.freeze({__proto__:null,default:{}}));!function(t){!function(t){var e=function(t){var e,r=new Float64Array(16);if(t)for(e=0;e>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r,t[e+4]=n>>24&255,t[e+5]=n>>16&255,t[e+6]=n>>8&255,t[e+7]=255&n}function p(t,e,r,n,i){var o,s=0;for(o=0;o>>8)-1}function g(t,e,r,n){return p(t,e,r,n,16)}function y(t,e,r,n){return p(t,e,r,n,32)}function m(t,e,r,n){!function(t,e,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,d=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,g=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,y=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,m=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,w=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,b=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=o,S=s,_=a,A=c,x=u,I=f,k=h,T=l,R=d,B=p,O=g,M=y,C=m,L=v,P=w,N=b,U=0;U<20;U+=2)E^=(i=(C^=(i=(R^=(i=(x^=(i=E+C|0)<<7|i>>>25)+E|0)<<9|i>>>23)+x|0)<<13|i>>>19)+R|0)<<18|i>>>14,I^=(i=(S^=(i=(L^=(i=(B^=(i=I+S|0)<<7|i>>>25)+I|0)<<9|i>>>23)+B|0)<<13|i>>>19)+L|0)<<18|i>>>14,O^=(i=(k^=(i=(_^=(i=(P^=(i=O+k|0)<<7|i>>>25)+O|0)<<9|i>>>23)+P|0)<<13|i>>>19)+_|0)<<18|i>>>14,N^=(i=(M^=(i=(T^=(i=(A^=(i=N+M|0)<<7|i>>>25)+N|0)<<9|i>>>23)+A|0)<<13|i>>>19)+T|0)<<18|i>>>14,E^=(i=(A^=(i=(_^=(i=(S^=(i=E+A|0)<<7|i>>>25)+E|0)<<9|i>>>23)+S|0)<<13|i>>>19)+_|0)<<18|i>>>14,I^=(i=(x^=(i=(T^=(i=(k^=(i=I+x|0)<<7|i>>>25)+I|0)<<9|i>>>23)+k|0)<<13|i>>>19)+T|0)<<18|i>>>14,O^=(i=(B^=(i=(R^=(i=(M^=(i=O+B|0)<<7|i>>>25)+O|0)<<9|i>>>23)+M|0)<<13|i>>>19)+R|0)<<18|i>>>14,N^=(i=(P^=(i=(L^=(i=(C^=(i=N+P|0)<<7|i>>>25)+N|0)<<9|i>>>23)+C|0)<<13|i>>>19)+L|0)<<18|i>>>14;E=E+o|0,S=S+s|0,_=_+a|0,A=A+c|0,x=x+u|0,I=I+f|0,k=k+h|0,T=T+l|0,R=R+d|0,B=B+p|0,O=O+g|0,M=M+y|0,C=C+m|0,L=L+v|0,P=P+w|0,N=N+b|0,t[0]=E>>>0&255,t[1]=E>>>8&255,t[2]=E>>>16&255,t[3]=E>>>24&255,t[4]=S>>>0&255,t[5]=S>>>8&255,t[6]=S>>>16&255,t[7]=S>>>24&255,t[8]=_>>>0&255,t[9]=_>>>8&255,t[10]=_>>>16&255,t[11]=_>>>24&255,t[12]=A>>>0&255,t[13]=A>>>8&255,t[14]=A>>>16&255,t[15]=A>>>24&255,t[16]=x>>>0&255,t[17]=x>>>8&255,t[18]=x>>>16&255,t[19]=x>>>24&255,t[20]=I>>>0&255,t[21]=I>>>8&255,t[22]=I>>>16&255,t[23]=I>>>24&255,t[24]=k>>>0&255,t[25]=k>>>8&255,t[26]=k>>>16&255,t[27]=k>>>24&255,t[28]=T>>>0&255,t[29]=T>>>8&255,t[30]=T>>>16&255,t[31]=T>>>24&255,t[32]=R>>>0&255,t[33]=R>>>8&255,t[34]=R>>>16&255,t[35]=R>>>24&255,t[36]=B>>>0&255,t[37]=B>>>8&255,t[38]=B>>>16&255,t[39]=B>>>24&255,t[40]=O>>>0&255,t[41]=O>>>8&255,t[42]=O>>>16&255,t[43]=O>>>24&255,t[44]=M>>>0&255,t[45]=M>>>8&255,t[46]=M>>>16&255,t[47]=M>>>24&255,t[48]=C>>>0&255,t[49]=C>>>8&255,t[50]=C>>>16&255,t[51]=C>>>24&255,t[52]=L>>>0&255,t[53]=L>>>8&255,t[54]=L>>>16&255,t[55]=L>>>24&255,t[56]=P>>>0&255,t[57]=P>>>8&255,t[58]=P>>>16&255,t[59]=P>>>24&255,t[60]=N>>>0&255,t[61]=N>>>8&255,t[62]=N>>>16&255,t[63]=N>>>24&255}(t,e,r,n)}function v(t,e,r,n){!function(t,e,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,d=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,g=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,y=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,m=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,w=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,b=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=0;E<20;E+=2)o^=(i=(m^=(i=(d^=(i=(u^=(i=o+m|0)<<7|i>>>25)+o|0)<<9|i>>>23)+u|0)<<13|i>>>19)+d|0)<<18|i>>>14,f^=(i=(s^=(i=(v^=(i=(p^=(i=f+s|0)<<7|i>>>25)+f|0)<<9|i>>>23)+p|0)<<13|i>>>19)+v|0)<<18|i>>>14,g^=(i=(h^=(i=(a^=(i=(w^=(i=g+h|0)<<7|i>>>25)+g|0)<<9|i>>>23)+w|0)<<13|i>>>19)+a|0)<<18|i>>>14,b^=(i=(y^=(i=(l^=(i=(c^=(i=b+y|0)<<7|i>>>25)+b|0)<<9|i>>>23)+c|0)<<13|i>>>19)+l|0)<<18|i>>>14,o^=(i=(c^=(i=(a^=(i=(s^=(i=o+c|0)<<7|i>>>25)+o|0)<<9|i>>>23)+s|0)<<13|i>>>19)+a|0)<<18|i>>>14,f^=(i=(u^=(i=(l^=(i=(h^=(i=f+u|0)<<7|i>>>25)+f|0)<<9|i>>>23)+h|0)<<13|i>>>19)+l|0)<<18|i>>>14,g^=(i=(p^=(i=(d^=(i=(y^=(i=g+p|0)<<7|i>>>25)+g|0)<<9|i>>>23)+y|0)<<13|i>>>19)+d|0)<<18|i>>>14,b^=(i=(w^=(i=(v^=(i=(m^=(i=b+w|0)<<7|i>>>25)+b|0)<<9|i>>>23)+m|0)<<13|i>>>19)+v|0)<<18|i>>>14;t[0]=o>>>0&255,t[1]=o>>>8&255,t[2]=o>>>16&255,t[3]=o>>>24&255,t[4]=f>>>0&255,t[5]=f>>>8&255,t[6]=f>>>16&255,t[7]=f>>>24&255,t[8]=g>>>0&255,t[9]=g>>>8&255,t[10]=g>>>16&255,t[11]=g>>>24&255,t[12]=b>>>0&255,t[13]=b>>>8&255,t[14]=b>>>16&255,t[15]=b>>>24&255,t[16]=h>>>0&255,t[17]=h>>>8&255,t[18]=h>>>16&255,t[19]=h>>>24&255,t[20]=l>>>0&255,t[21]=l>>>8&255,t[22]=l>>>16&255,t[23]=l>>>24&255,t[24]=d>>>0&255,t[25]=d>>>8&255,t[26]=d>>>16&255,t[27]=d>>>24&255,t[28]=p>>>0&255,t[29]=p>>>8&255,t[30]=p>>>16&255,t[31]=p>>>24&255}(t,e,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function b(t,e,r,n,i,o,s){var a,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=o[c];for(;i>=64;){for(m(f,u,s,w),c=0;c<64;c++)t[e+c]=r[n+c]^f[c];for(a=1,c=8;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;i-=64,e+=64,n+=64}if(i>0)for(m(f,u,s,w),c=0;c=64;){for(m(c,a,i,w),s=0;s<64;s++)t[e+s]=c[s];for(o=1,s=8;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,e+=64}if(r>0)for(m(c,a,i,w),s=0;s>>13|r<<3),n=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&t[8]|(255&t[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(o>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),c=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function x(t,e,r,n,i,o){var s=new A(o);return s.update(r,n,i),s.finish(t,e),0}function I(t,e,r,n,i,o){var s=new Uint8Array(16);return x(s,0,r,n,i,o),g(t,e,s,0)}function k(t,e,r,n,i){var o;if(r<32)return-1;for(_(t,0,e,0,r,n,i),x(t,16,t,32,r-32,t),o=0;o<16;o++)t[o]=0;return 0}function T(t,e,r,n,i){var o,s=new Uint8Array(32);if(r<32)return-1;if(S(s,0,32,n,i),0!==I(e,16,e,32,r-32,s))return-1;for(_(t,0,e,0,r,n,i),o=0;o<32;o++)t[o]=0;return 0}function R(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function B(t){var e,r,n=1;for(e=0;e<16;e++)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function O(t,e,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(t[o]^e[o]),t[o]^=n,e[o]^=n}function M(t,r){var n,i,o,s=e(),a=e();for(n=0;n<16;n++)a[n]=r[n];for(B(a),B(a),B(a),i=0;i<2;i++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,O(a,s,1-o)}for(n=0;n<16;n++)t[2*n]=255&a[n],t[2*n+1]=a[n]>>8}function C(t,e){var r=new Uint8Array(32),n=new Uint8Array(32);return M(r,t),M(n,e),y(r,0,n,0)}function L(t){var e=new Uint8Array(32);return M(e,t),1&e[0]}function P(t,e){var r;for(r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function N(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]+r[n]}function U(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]-r[n]}function j(t,e,r){var n,i,o=0,s=0,a=0,c=0,u=0,f=0,h=0,l=0,d=0,p=0,g=0,y=0,m=0,v=0,w=0,b=0,E=0,S=0,_=0,A=0,x=0,I=0,k=0,T=0,R=0,B=0,O=0,M=0,C=0,L=0,P=0,N=r[0],U=r[1],j=r[2],D=r[3],z=r[4],F=r[5],H=r[6],$=r[7],q=r[8],W=r[9],V=r[10],K=r[11],G=r[12],Z=r[13],J=r[14],Y=r[15];o+=(n=e[0])*N,s+=n*U,a+=n*j,c+=n*D,u+=n*z,f+=n*F,h+=n*H,l+=n*$,d+=n*q,p+=n*W,g+=n*V,y+=n*K,m+=n*G,v+=n*Z,w+=n*J,b+=n*Y,s+=(n=e[1])*N,a+=n*U,c+=n*j,u+=n*D,f+=n*z,h+=n*F,l+=n*H,d+=n*$,p+=n*q,g+=n*W,y+=n*V,m+=n*K,v+=n*G,w+=n*Z,b+=n*J,E+=n*Y,a+=(n=e[2])*N,c+=n*U,u+=n*j,f+=n*D,h+=n*z,l+=n*F,d+=n*H,p+=n*$,g+=n*q,y+=n*W,m+=n*V,v+=n*K,w+=n*G,b+=n*Z,E+=n*J,S+=n*Y,c+=(n=e[3])*N,u+=n*U,f+=n*j,h+=n*D,l+=n*z,d+=n*F,p+=n*H,g+=n*$,y+=n*q,m+=n*W,v+=n*V,w+=n*K,b+=n*G,E+=n*Z,S+=n*J,_+=n*Y,u+=(n=e[4])*N,f+=n*U,h+=n*j,l+=n*D,d+=n*z,p+=n*F,g+=n*H,y+=n*$,m+=n*q,v+=n*W,w+=n*V,b+=n*K,E+=n*G,S+=n*Z,_+=n*J,A+=n*Y,f+=(n=e[5])*N,h+=n*U,l+=n*j,d+=n*D,p+=n*z,g+=n*F,y+=n*H,m+=n*$,v+=n*q,w+=n*W,b+=n*V,E+=n*K,S+=n*G,_+=n*Z,A+=n*J,x+=n*Y,h+=(n=e[6])*N,l+=n*U,d+=n*j,p+=n*D,g+=n*z,y+=n*F,m+=n*H,v+=n*$,w+=n*q,b+=n*W,E+=n*V,S+=n*K,_+=n*G,A+=n*Z,x+=n*J,I+=n*Y,l+=(n=e[7])*N,d+=n*U,p+=n*j,g+=n*D,y+=n*z,m+=n*F,v+=n*H,w+=n*$,b+=n*q,E+=n*W,S+=n*V,_+=n*K,A+=n*G,x+=n*Z,I+=n*J,k+=n*Y,d+=(n=e[8])*N,p+=n*U,g+=n*j,y+=n*D,m+=n*z,v+=n*F,w+=n*H,b+=n*$,E+=n*q,S+=n*W,_+=n*V,A+=n*K,x+=n*G,I+=n*Z,k+=n*J,T+=n*Y,p+=(n=e[9])*N,g+=n*U,y+=n*j,m+=n*D,v+=n*z,w+=n*F,b+=n*H,E+=n*$,S+=n*q,_+=n*W,A+=n*V,x+=n*K,I+=n*G,k+=n*Z,T+=n*J,R+=n*Y,g+=(n=e[10])*N,y+=n*U,m+=n*j,v+=n*D,w+=n*z,b+=n*F,E+=n*H,S+=n*$,_+=n*q,A+=n*W,x+=n*V,I+=n*K,k+=n*G,T+=n*Z,R+=n*J,B+=n*Y,y+=(n=e[11])*N,m+=n*U,v+=n*j,w+=n*D,b+=n*z,E+=n*F,S+=n*H,_+=n*$,A+=n*q,x+=n*W,I+=n*V,k+=n*K,T+=n*G,R+=n*Z,B+=n*J,O+=n*Y,m+=(n=e[12])*N,v+=n*U,w+=n*j,b+=n*D,E+=n*z,S+=n*F,_+=n*H,A+=n*$,x+=n*q,I+=n*W,k+=n*V,T+=n*K,R+=n*G,B+=n*Z,O+=n*J,M+=n*Y,v+=(n=e[13])*N,w+=n*U,b+=n*j,E+=n*D,S+=n*z,_+=n*F,A+=n*H,x+=n*$,I+=n*q,k+=n*W,T+=n*V,R+=n*K,B+=n*G,O+=n*Z,M+=n*J,C+=n*Y,w+=(n=e[14])*N,b+=n*U,E+=n*j,S+=n*D,_+=n*z,A+=n*F,x+=n*H,I+=n*$,k+=n*q,T+=n*W,R+=n*V,B+=n*K,O+=n*G,M+=n*Z,C+=n*J,L+=n*Y,b+=(n=e[15])*N,s+=38*(S+=n*j),a+=38*(_+=n*D),c+=38*(A+=n*z),u+=38*(x+=n*F),f+=38*(I+=n*H),h+=38*(k+=n*$),l+=38*(T+=n*q),d+=38*(R+=n*W),p+=38*(B+=n*V),g+=38*(O+=n*K),y+=38*(M+=n*G),m+=38*(C+=n*Z),v+=38*(L+=n*J),w+=38*(P+=n*Y),o=(n=(o+=38*(E+=n*U))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),t[0]=o,t[1]=s,t[2]=a,t[3]=c,t[4]=u,t[5]=f,t[6]=h,t[7]=l,t[8]=d,t[9]=p,t[10]=g,t[11]=y,t[12]=m,t[13]=v,t[14]=w,t[15]=b}function D(t,e){j(t,e,e)}function z(t,r){var n,i=e();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)D(i,i),2!==n&&4!==n&&j(i,i,r);for(n=0;n<16;n++)t[n]=i[n]}function F(t,r){var n,i=e();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)D(i,i),1!==n&&j(i,i,r);for(n=0;n<16;n++)t[n]=i[n]}function H(t,r,n){var i,o,s=new Uint8Array(32),c=new Float64Array(80),u=e(),f=e(),h=e(),l=e(),d=e(),p=e();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,P(c,n),o=0;o<16;o++)f[o]=c[o],l[o]=u[o]=h[o]=0;for(u[0]=l[0]=1,o=254;o>=0;--o)O(u,f,i=s[o>>>3]>>>(7&o)&1),O(h,l,i),N(d,u,h),U(u,u,h),N(h,f,l),U(f,f,l),D(l,d),D(p,u),j(u,h,u),j(h,f,d),N(d,u,h),U(u,u,h),D(f,u),U(h,l,p),j(u,h,a),N(u,u,l),j(h,h,u),j(u,l,p),j(l,f,c),D(f,d),O(u,f,i),O(h,l,i);for(o=0;o<16;o++)c[o+16]=u[o],c[o+32]=h[o],c[o+48]=f[o],c[o+64]=l[o];var g=c.subarray(32),y=c.subarray(16);return z(g,g),j(y,y,g),M(t,y),0}function $(t,e){return H(t,e,i)}function q(t,e){return r(e,32),$(t,e)}function W(t,e,r){var i=new Uint8Array(32);return H(i,r,e),v(t,n,i,w)}A.prototype.blocks=function(t,e,r){for(var n,i,o,s,a,c,u,f,h,l,d,p,g,y,m,v,w,b,E,S=this.fin?0:2048,_=this.h[0],A=this.h[1],x=this.h[2],I=this.h[3],k=this.h[4],T=this.h[5],R=this.h[6],B=this.h[7],O=this.h[8],M=this.h[9],C=this.r[0],L=this.r[1],P=this.r[2],N=this.r[3],U=this.r[4],j=this.r[5],D=this.r[6],z=this.r[7],F=this.r[8],H=this.r[9];r>=16;)l=h=0,l+=(_+=8191&(n=255&t[e+0]|(255&t[e+1])<<8))*C,l+=(A+=8191&(n>>>13|(i=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*H),l+=(x+=8191&(i>>>10|(o=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*F),l+=(I+=8191&(o>>>7|(s=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*z),h=(l+=(k+=8191&(s>>>4|(a=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*D))>>>13,l&=8191,l+=(T+=a>>>1&8191)*(5*j),l+=(R+=8191&(a>>>14|(c=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*U),l+=(B+=8191&(c>>>11|(u=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*N),l+=(O+=8191&(u>>>8|(f=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*P),d=h+=(l+=(M+=f>>>5|S)*(5*L))>>>13,d+=_*L,d+=A*C,d+=x*(5*H),d+=I*(5*F),h=(d+=k*(5*z))>>>13,d&=8191,d+=T*(5*D),d+=R*(5*j),d+=B*(5*U),d+=O*(5*N),h+=(d+=M*(5*P))>>>13,d&=8191,p=h,p+=_*P,p+=A*L,p+=x*C,p+=I*(5*H),h=(p+=k*(5*F))>>>13,p&=8191,p+=T*(5*z),p+=R*(5*D),p+=B*(5*j),p+=O*(5*U),g=h+=(p+=M*(5*N))>>>13,g+=_*N,g+=A*P,g+=x*L,g+=I*C,h=(g+=k*(5*H))>>>13,g&=8191,g+=T*(5*F),g+=R*(5*z),g+=B*(5*D),g+=O*(5*j),y=h+=(g+=M*(5*U))>>>13,y+=_*U,y+=A*N,y+=x*P,y+=I*L,h=(y+=k*C)>>>13,y&=8191,y+=T*(5*H),y+=R*(5*F),y+=B*(5*z),y+=O*(5*D),m=h+=(y+=M*(5*j))>>>13,m+=_*j,m+=A*U,m+=x*N,m+=I*P,h=(m+=k*L)>>>13,m&=8191,m+=T*C,m+=R*(5*H),m+=B*(5*F),m+=O*(5*z),v=h+=(m+=M*(5*D))>>>13,v+=_*D,v+=A*j,v+=x*U,v+=I*N,h=(v+=k*P)>>>13,v&=8191,v+=T*L,v+=R*C,v+=B*(5*H),v+=O*(5*F),w=h+=(v+=M*(5*z))>>>13,w+=_*z,w+=A*D,w+=x*j,w+=I*U,h=(w+=k*N)>>>13,w&=8191,w+=T*P,w+=R*L,w+=B*C,w+=O*(5*H),b=h+=(w+=M*(5*F))>>>13,b+=_*F,b+=A*z,b+=x*D,b+=I*j,h=(b+=k*U)>>>13,b&=8191,b+=T*N,b+=R*P,b+=B*L,b+=O*C,E=h+=(b+=M*(5*H))>>>13,E+=_*H,E+=A*F,E+=x*z,E+=I*D,h=(E+=k*j)>>>13,E&=8191,E+=T*U,E+=R*N,E+=B*P,E+=O*L,_=l=8191&(h=(h=((h+=(E+=M*C)>>>13)<<2)+h|0)+(l&=8191)|0),A=d+=h>>>=13,x=p&=8191,I=g&=8191,k=y&=8191,T=m&=8191,R=v&=8191,B=w&=8191,O=b&=8191,M=E&=8191,e+=16,r-=16;this.h[0]=_,this.h[1]=A,this.h[2]=x,this.h[3]=I,this.h[4]=k,this.h[5]=T,this.h[6]=R,this.h[7]=B,this.h[8]=O,this.h[9]=M},A.prototype.finish=function(t,e){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},A.prototype.update=function(t,e,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n=16&&(i=r-r%16,this.blocks(t,e,i),e+=i,r-=i),r){for(n=0;n=128;){for(S=0;S<16;S++)_=8*S+Z,B[S]=r[_+0]<<24|r[_+1]<<16|r[_+2]<<8|r[_+3],O[S]=r[_+4]<<24|r[_+5]<<16|r[_+6]<<8|r[_+7];for(S=0;S<80;S++)if(i=M,o=C,s=L,a=P,c=N,u=U,f=j,D,l=z,d=F,p=H,g=$,y=q,m=W,v=V,K,I=65535&(x=K),k=x>>>16,T=65535&(A=D),R=A>>>16,I+=65535&(x=(q>>>14|N<<18)^(q>>>18|N<<14)^(N>>>9|q<<23)),k+=x>>>16,T+=65535&(A=(N>>>14|q<<18)^(N>>>18|q<<14)^(q>>>9|N<<23)),R+=A>>>16,I+=65535&(x=q&W^~q&V),k+=x>>>16,T+=65535&(A=N&U^~N&j),R+=A>>>16,I+=65535&(x=G[2*S+1]),k+=x>>>16,T+=65535&(A=G[2*S]),R+=A>>>16,A=B[S%16],k+=(x=O[S%16])>>>16,T+=65535&A,R+=A>>>16,T+=(k+=(I+=65535&x)>>>16)>>>16,I=65535&(x=E=65535&I|k<<16),k=x>>>16,T=65535&(A=b=65535&T|(R+=T>>>16)<<16),R=A>>>16,I+=65535&(x=(z>>>28|M<<4)^(M>>>2|z<<30)^(M>>>7|z<<25)),k+=x>>>16,T+=65535&(A=(M>>>28|z<<4)^(z>>>2|M<<30)^(z>>>7|M<<25)),R+=A>>>16,k+=(x=z&F^z&H^F&H)>>>16,T+=65535&(A=M&C^M&L^C&L),R+=A>>>16,h=65535&(T+=(k+=(I+=65535&x)>>>16)>>>16)|(R+=T>>>16)<<16,w=65535&I|k<<16,I=65535&(x=g),k=x>>>16,T=65535&(A=a),R=A>>>16,k+=(x=E)>>>16,T+=65535&(A=b),R+=A>>>16,C=i,L=o,P=s,N=a=65535&(T+=(k+=(I+=65535&x)>>>16)>>>16)|(R+=T>>>16)<<16,U=c,j=u,D=f,M=h,F=l,H=d,$=p,q=g=65535&I|k<<16,W=y,V=m,K=v,z=w,S%16==15)for(_=0;_<16;_++)A=B[_],I=65535&(x=O[_]),k=x>>>16,T=65535&A,R=A>>>16,A=B[(_+9)%16],I+=65535&(x=O[(_+9)%16]),k+=x>>>16,T+=65535&A,R+=A>>>16,b=B[(_+1)%16],I+=65535&(x=((E=O[(_+1)%16])>>>1|b<<31)^(E>>>8|b<<24)^(E>>>7|b<<25)),k+=x>>>16,T+=65535&(A=(b>>>1|E<<31)^(b>>>8|E<<24)^b>>>7),R+=A>>>16,b=B[(_+14)%16],k+=(x=((E=O[(_+14)%16])>>>19|b<<13)^(b>>>29|E<<3)^(E>>>6|b<<26))>>>16,T+=65535&(A=(b>>>19|E<<13)^(E>>>29|b<<3)^b>>>6),R+=A>>>16,R+=(T+=(k+=(I+=65535&x)>>>16)>>>16)>>>16,B[_]=65535&T|R<<16,O[_]=65535&I|k<<16;I=65535&(x=z),k=x>>>16,T=65535&(A=M),R=A>>>16,A=t[0],k+=(x=e[0])>>>16,T+=65535&A,R+=A>>>16,R+=(T+=(k+=(I+=65535&x)>>>16)>>>16)>>>16,t[0]=M=65535&T|R<<16,e[0]=z=65535&I|k<<16,I=65535&(x=F),k=x>>>16,T=65535&(A=C),R=A>>>16,A=t[1],k+=(x=e[1])>>>16,T+=65535&A,R+=A>>>16,R+=(T+=(k+=(I+=65535&x)>>>16)>>>16)>>>16,t[1]=C=65535&T|R<<16,e[1]=F=65535&I|k<<16,I=65535&(x=H),k=x>>>16,T=65535&(A=L),R=A>>>16,A=t[2],k+=(x=e[2])>>>16,T+=65535&A,R+=A>>>16,R+=(T+=(k+=(I+=65535&x)>>>16)>>>16)>>>16,t[2]=L=65535&T|R<<16,e[2]=H=65535&I|k<<16,I=65535&(x=$),k=x>>>16,T=65535&(A=P),R=A>>>16,A=t[3],k+=(x=e[3])>>>16,T+=65535&A,R+=A>>>16,R+=(T+=(k+=(I+=65535&x)>>>16)>>>16)>>>16,t[3]=P=65535&T|R<<16,e[3]=$=65535&I|k<<16,I=65535&(x=q),k=x>>>16,T=65535&(A=N),R=A>>>16,A=t[4],k+=(x=e[4])>>>16,T+=65535&A,R+=A>>>16,R+=(T+=(k+=(I+=65535&x)>>>16)>>>16)>>>16,t[4]=N=65535&T|R<<16,e[4]=q=65535&I|k<<16,I=65535&(x=W),k=x>>>16,T=65535&(A=U),R=A>>>16,A=t[5],k+=(x=e[5])>>>16,T+=65535&A,R+=A>>>16,R+=(T+=(k+=(I+=65535&x)>>>16)>>>16)>>>16,t[5]=U=65535&T|R<<16,e[5]=W=65535&I|k<<16,I=65535&(x=V),k=x>>>16,T=65535&(A=j),R=A>>>16,A=t[6],k+=(x=e[6])>>>16,T+=65535&A,R+=A>>>16,R+=(T+=(k+=(I+=65535&x)>>>16)>>>16)>>>16,t[6]=j=65535&T|R<<16,e[6]=V=65535&I|k<<16,I=65535&(x=K),k=x>>>16,T=65535&(A=D),R=A>>>16,A=t[7],k+=(x=e[7])>>>16,T+=65535&A,R+=A>>>16,R+=(T+=(k+=(I+=65535&x)>>>16)>>>16)>>>16,t[7]=D=65535&T|R<<16,e[7]=K=65535&I|k<<16,Z+=128,n-=128}return n}function J(t,e,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,Z(i,o,e,r),r%=128,n=0;n=0;--i)X(t,e,n=r[i/8|0]>>(7&i)&1),Y(e,t),Y(t,t),X(t,e,n)}function et(t,r){var n=[e(),e(),e(),e()];R(n[0],f),R(n[1],h),R(n[2],s),j(n[3],f,h),tt(t,n,r)}function rt(t,n,i){var o,s=new Uint8Array(64),a=[e(),e(),e(),e()];for(i||r(n,32),J(s,n,32),s[0]&=248,s[31]&=127,s[31]|=64,et(a,s),Q(t,a),o=0;o<32;o++)n[o+32]=t[o];return 0}var nt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,e){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>4)*nt[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=r*nt[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function ot(t){var e,r=new Float64Array(64);for(e=0;e<64;e++)r[e]=t[e];for(e=0;e<64;e++)t[e]=0;it(t,r)}function st(t,r,n,i){var o,s,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),f=new Float64Array(64),h=[e(),e(),e(),e()];J(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var l=n+64;for(o=0;o>7&&U(t[0],o,t[0]),j(t[3],t[0],t[1]),0)}(d,i))return-1;for(a=0;a=0},t.sign.keyPair=function(){var t=new Uint8Array(ft),e=new Uint8Array(ht);return rt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(dt(t),t.length!==ht)throw new Error("bad secret key size");for(var e=new Uint8Array(ft),r=0;r0&&(o=2048-i-16),n.padding="0".repeat(o),VFt({publicKey:t,data:JSON.stringify(n),version:r})},UFt.decrypt=KFt,UFt.decryptSafely=function({encryptedData:t,privateKey:e}){if((0,WFt.isNullish)(t))throw new Error("Missing encryptedData parameter");if((0,WFt.isNullish)(e))throw new Error("Missing privateKey parameter");return JSON.parse(KFt({encryptedData:t,privateKey:e})).data},UFt.getEncryptionPublicKey=function(t){const e=pgt.from(t,"hex"),r=qFt.box.keyPair.fromSecretKey(e).publicKey;return $Ft.base64.encode(r)},function(t){var e=o&&o.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),r=o&&o.__exportStar||function(t,r){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||e(r,t,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.normalize=t.concatSig=void 0,r(Xxt,t),r(nFt,t),r(UFt,t);var n=kPt;Object.defineProperty(t,"concatSig",{enumerable:!0,get:function(){return n.concatSig}}),Object.defineProperty(t,"normalize",{enumerable:!0,get:function(){return n.normalize}})}(Yxt);class GFt extends Error{constructor(t,e){super(),this.code=t,this.message=e}toString(){return`${this.message} (${this.code})`}}var ZFt,JFt=(t,e,r)=>(((t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)})(t,e,"read from private field"),r?r.call(t):e.get(t));const YFt=class{constructor(t){((t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)})(this,ZFt,["eth_newFilter","eth_newBlockFilter","eth_newPendingTransactionFilter","eth_uninstallFilter","eth_subscribe"]),this.provider=t}static isUTF8(t){try{return new TextDecoder("utf8",{fatal:!0}).decode(t),!0}catch{return!1}}static bufferToHex(t){return"0x"+pgt.from(t).toString("hex")}static messageToBuffer(t){let e=pgt.from([]);try{e="string"==typeof t?pgt.from(t.replace("0x",""),"hex"):pgt.from(t)}catch(t){console.log(`messageToBuffer error: ${t}`)}return e}async request(t){if(JFt(this,ZFt).includes(t.method))return Promise.reject(new GFt(4200,`EthereumProvider does not support calling ${t.method}`));switch(t.method){case"wallet_requestPermissions":return this.provider.internalRequest({method:"wallet_requestPermissions",params:t.params});case"eth_requestAccounts":return this.provider.internalRequest({method:"requestAccounts",params:{}});case"eth_sign":return this.ethSign(t.params);case"personal_sign":return this.personalSign(t.params);case"personal_ecRecover":return this.personalECRecover(t.params);case"eth_signTypedData_v3":return this.ethSignTypedData(t.params,Yxt.SignTypedDataVersion.V3);case"eth_signTypedData_v4":return this.ethSignTypedData(t.params,Yxt.SignTypedDataVersion.V4);case"eth_signTypedData":return this.ethSignTypedData(t.params,Yxt.SignTypedDataVersion.V1);case"eth_sendTransaction":return this.provider.internalRequest({method:"signTransaction",params:t.params[0]});case"wallet_watchAsset":{const{options:e,type:r}=t.params,{address:n,symbol:i,decimals:o}=e;return this.provider.internalRequest({method:"watchAsset",params:{type:r,contract:n,symbol:i,decimals:o||0}})}case"wallet_addEthereumChain":return this.provider.internalRequest({method:"addEthereumChain",params:t.params[0]});case"wallet_switchEthereumChain":return this.provider.internalRequest({method:"switchEthereumChain",params:t.params[0]});default:return await this.provider.getRPC().call({method:t.method,jsonrpc:"2.0",params:t.params})}}personalECRecover(t){return this.provider.internalRequest({method:"ecRecover",params:{signature:t[1],message:t[0]}})}async personalSign(t){const[e]=await this.provider.request({method:"eth_accounts"});if(!e)throw new Error("Unable to execute personal_sign");let[r,n]=t;"string"==typeof r&&e.toLowerCase()===r.toLowerCase()&&(r=t[1],n=t[0]);const i=YFt.messageToBuffer(r);return this.provider.internalRequest({method:"signPersonalMessage",params:{data:0===i.length?YFt.bufferToHex(r):r,address:n}})}ethSign(t){if(!t)throw new Error("Missing params");const[e,r]=t,n=YFt.messageToBuffer(r),i=YFt.bufferToHex(n);return this.provider.internalRequest({method:YFt.isUTF8(n)?"signPersonalMessage":"signMessage",params:{data:i,address:e,isEthSign:!0}})}async ethSignTypedData(t,e){const[r]=await this.provider.request({method:"eth_accounts"});if(!r)throw new Error("Unable to execute ethSignTypedData, address is not present");let[n,i]=t;"string"==typeof n&&r.toLowerCase()===n.toLowerCase()&&(n=t[1],i=t[0]);const o="string"==typeof n?JSON.parse(n):n,{chainId:s}=o.domain||{};if(typeof s<"u"&&Number(s)!==Number(this.provider.getChainId()))throw new Error("Provided chainId does not match the currently active chain");const a=e!==Yxt.SignTypedDataVersion.V1?Yxt.TypedDataUtils.eip712Hash(o,e):"";return this.provider.internalRequest({method:"signTypedMessage",params:{data:"0x"+a.toString("hex"),raw:"string"==typeof n?n:JSON.stringify(n),address:i,version:e}})}};let XFt=YFt;ZFt=new WeakMap;var QFt,tHt=Object.defineProperty,eHt=Object.getOwnPropertySymbols,rHt=Object.prototype.hasOwnProperty,nHt=Object.prototype.propertyIsEnumerable,iHt=(t,e,r)=>e in t?tHt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,oHt=(t,e)=>{for(var r in e||(e={}))rHt.call(e,r)&&iHt(t,r,e[r]);if(eHt)for(var r of eHt(e))nHt.call(e,r)&&iHt(t,r,e[r]);return t},sHt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};class aHt{constructor(t){((t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)})(this,QFt,void 0),((t,e,r,n)=>{sHt(t,e,"write to private field"),n?n.call(t,r):e.set(t,r)})(this,QFt,t)}async getBlockNumber(){return(await this.call({jsonrpc:"2.0",method:"eth_blockNumber",params:[]})).result}async getBlockByNumber(t){return(await this.call({jsonrpc:"2.0",method:"eth_getBlockByNumber",params:[t,!1]})).result}getFilterLogs(t){return this.call({jsonrpc:"2.0",method:"eth_getLogs",params:[t]})}async call(t){const e=await(await fetch(((t,e,r)=>(sHt(t,e,"read from private field"),r?r.call(t):e.get(t)))(this,QFt),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(oHt({id:(new Date).getTime()+Math.floor(1e3*Math.random())},t))})).json();if(!e.result&&e.error)throw new Error(e.error.message||"rpc error");return e.result}}QFt=new WeakMap;var cHt,uHt,fHt,hHt,lHt,dHt,pHt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},gHt=(t,e,r)=>(pHt(t,e,"read from private field"),r?r.call(t):e.get(t)),yHt=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},mHt=(t,e,r,n)=>(pHt(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);const vHt=class extends Eyt{constructor(t){super(),yHt(this,cHt,void 0),yHt(this,uHt,void 0),yHt(this,fHt,!1),yHt(this,hHt,!1),yHt(this,lHt,void 0),yHt(this,dHt,void 0),this.isTrust=!0,this.isTrustWallet=!0,this.request=this.request.bind(this),t&&(t.chainId&&mHt(this,cHt,t.chainId),(t.rpc||t.rpcUrl)&&mHt(this,uHt,t.rpc||t.rpcUrl),typeof t.overwriteMetamask<"u"&&mHt(this,hHt,t.overwriteMetamask),typeof t.disableMobileAdapter<"u"&&mHt(this,fHt,t.disableMobileAdapter),typeof t.isTrust<"u"&&(this.isTrust=t.isTrust,this.isTrustWallet=t.isTrust),mHt(this,dHt,new aHt(gHt(this,uHt)))),gHt(this,fHt)||(this.mobileAdapter=new XFt(this)),super.on("onResponseReady",this.onResponseReady.bind(this)),this.connect()}connect(){this.emit("connect",{chainId:gHt(this,cHt)})}enable(){return this.request({method:"eth_requestAccounts"})}sendAsync(t,e){Array.isArray(t)?Promise.all(t.map((t=>this.request(t)))).then((t=>e(null,t))).catch((t=>e(t,null))):this.request(t).then((t=>e(null,t))).catch((t=>e(t,null)))}_send(t){const e={jsonrpc:"2.0",result:null};switch(t.method){case"eth_accounts":case"eth_coinbase":case"net_version":case"eth_chainId":e.result=this.handleStaticRequests({method:"eth_accounts"});break;default:throw new GFt(4200,`Trust does not support calling ${t.method} synchronously without a callback. Please provide a callback parameter to call ${t.method} asynchronously.`)}return e}send(t,e){if("string"==typeof t&&(!e||Array.isArray(e))){const r=this;return new Promise(((n,i)=>{try{const o=r.request({method:t,params:e});o instanceof Promise?o.then(n).catch(i):n(o)}catch(t){i(t)}}))}return t&&"object"==typeof t&&"function"==typeof e?this.request(t).then(e):this._send(t)}internalRequest(t){return super.request(t)}request(t){if(this.mobileAdapter){const e=this.handleStaticRequests(t,(()=>this.mobileAdapter.request(t)));return e instanceof Promise?e:Promise.resolve(e)}return this.handleStaticRequests(t,(()=>this.internalRequest(t)))}handleStaticRequests(t,e){switch(t.method){case"net_version":return gHt(this,cHt)?parseInt(gHt(this,cHt)):void 0;case"eth_chainId":return gHt(this,cHt);case"eth_accounts":case"eth_coinbase":return gHt(this,lHt)?[gHt(this,lHt)]:[]}if(e)return e()}onResponseReady(t,e){var r,n,i,o;if(e)switch(t.method){case"eth_requestAccounts":case"requestAccounts":mHt(this,lHt,e[0]);break;case"wallet_requestPermissions":mHt(this,lHt,null==(o=null==(i=null==(n=null==(r=e[0])?void 0:r.caveats)?void 0:n[0])?void 0:i.value)?void 0:o[0])}}getNetwork(){return vHt.NETWORK}get connected(){return!0}get isMetaMask(){return gHt(this,hHt)}getChainId(){return gHt(this,cHt)}getNetworkVersion(){return this.handleStaticRequests({method:"net_version "})}setChainId(t){mHt(this,cHt,t)}setRPCUrl(t){mHt(this,uHt,t),mHt(this,dHt,new aHt(gHt(this,uHt)))}getRPC(){return gHt(this,dHt)}setOverwriteMetamask(t){mHt(this,hHt,t)}getAddress(){return gHt(this,lHt)}setAddress(t){mHt(this,lHt,t)}setRPC(t){mHt(this,dHt,t)}};let wHt=vHt;cHt=new WeakMap,uHt=new WeakMap,fHt=new WeakMap,hHt=new WeakMap,lHt=new WeakMap,dHt=new WeakMap,wHt.NETWORK="ethereum";class bHt{constructor(t){this.provider=t}async request(t,e){if("getKey"===t.method){const e=await this.provider.internalRequest({method:"requestAccounts",params:t.params}),r=JSON.parse(e);return{algo:"secp256k1",address:r.address,bech32Address:r.address,pubKey:pgt.from(r.pubKey,"hex")}}const r={signAmino:"signTransaction",signDirect:"signTransaction",signArbitrary:"signMessage",sendTx:"sendTransaction"};return r[t.method]?this.provider.internalRequest({method:r[t.method],params:t.params}):e()}}var EHt,SHt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},_Ht=(t,e,r)=>(SHt(t,e,"read from private field"),r?r.call(t):e.get(t));const AHt=class extends Eyt{constructor(t){super(),((t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)})(this,EHt,!1),this.isKeplr=!0,this.isTrust=!0,this.isTrustWallet=!0,t&&(typeof t.disableMobileAdapter<"u"&&((t,e,r,n)=>{SHt(t,e,"write to private field"),n?n.call(t,r):e.set(t,r)})(this,EHt,t.disableMobileAdapter),typeof t.isKeplr<"u"&&(this.isKeplr=t.isKeplr),typeof t.isTrust<"u"&&(this.isTrust=t.isTrust,this.isTrustWallet=t.isTrust)),_Ht(this,EHt)||(this.mobileAdapter=new bHt(this))}static bufferToHex(t){return"0x"+pgt.from(t).toString("hex")}getNetwork(){return AHt.NETWORK}isMobileAdapterEnabled(){return!_Ht(this,EHt)}enable(t){return this.request({method:"enable",params:{chainIds:t}})}internalRequest(t){return super.request(t)}request(t){const e=()=>this.internalRequest(t);return this.mobileAdapter?this.mobileAdapter.request(t,e):e()}getKey(t){return this.request({method:"getKey",params:{chainId:t}})}async sendTx(t,e,r){const n=pgt.from(e).toString("base64"),i=await this.request({method:"sendTx",params:{raw:n,chainId:t,mode:r}});return new Uint8Array(pgt.from(i,"hex"))}async signArbitrary(t,e,r){const n=pgt.from(r),i=AHt.bufferToHex(n);return await this.request({method:"signArbitrary",params:{chainId:t,data:i,signerAddress:e}})}async signAmino(t,e,r){const n=await this.request({method:"signAmino",params:{chainId:t,sign_doc:r}}),{signed:i,signature:o}=JSON.parse(n);return{signed:i,signature:o}}async signDirect(t,e,r){const n={bodyBytes:AHt.bufferToHex(r.bodyBytes),authInfoBytes:AHt.bufferToHex(r.authInfoBytes)},i=await this.request({method:"signDirect",params:{signerAddress:e,chainId:t,sign_doc:n}}),{signature:o}=JSON.parse(i);return{signed:r,signature:o}}experimentalSuggestChain(){}getOfflineSignerDirect(t){return{getAccounts:async()=>[await this.getKey(t)],signDirect:async(e,r)=>{if(t!==r.chainId)throw new Error("Unmatched chain id with the offline signer");if((await this.getKey(r.chainId)).address!==e)throw new Error("Unknown signer address");return await this.signDirect(t,e,r)}}}getOfflineSigner(t){return this.getOfflineSignerAmino(t)}getOfflineSignerAuto(t){return this.getOfflineSignerAmino(t)}getOfflineSignerAmino(t){return{getAccounts:async()=>{const e=await this.getKey(t);return[{address:e.bech32Address,algo:"secp256k1",pubkey:e.pubKey}]},sign:(e,r)=>this.signAmino(t,e,r),signAmino:(e,r)=>this.signAmino(t,e,r)}}};let xHt=AHt;EHt=new WeakMap,xHt.NETWORK="cosmos";var IHt,kHt={exports:{}},THt="object"==typeof Reflect?Reflect:null,RHt=THt&&"function"==typeof THt.apply?THt.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};IHt=THt&&"function"==typeof THt.ownKeys?THt.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var BHt=Number.isNaN||function(t){return t!=t};function OHt(){OHt.init.call(this)}kHt.exports=OHt,kHt.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}FHt(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&FHt(t,"error",e,r)}(t,i,{once:!0})}))},OHt.EventEmitter=OHt,OHt.prototype._events=void 0,OHt.prototype._eventsCount=0,OHt.prototype._maxListeners=void 0;var MHt=10;function CHt(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function LHt(t){return void 0===t._maxListeners?OHt.defaultMaxListeners:t._maxListeners}function PHt(t,e,r,n){var i,o,s;if(CHt(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=LHt(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,function(t){console&&console.warn&&console.warn(t)}(a)}return t}function NHt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function UHt(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=NHt.bind(n);return i.listener=r,n.wrapFn=i,i}function jHt(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)RHt(a,this,e);else{var c=a.length,u=zHt(a,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},OHt.prototype.listeners=function(t){return jHt(this,t,!0)},OHt.prototype.rawListeners=function(t){return jHt(this,t,!1)},OHt.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):DHt.call(t,e)},OHt.prototype.listenerCount=DHt,OHt.prototype.eventNames=function(){return this._eventsCount>0?IHt(this._events):[]};const HHt="CALLBACK";class $Ht extends kHt.exports.EventEmitter{setAdapter(t){return this.adapter=t,this}async request(t){try{if(!this.adapter)throw new Error("No adapter set, maybe you forgot to register the provider?");const e=await this.adapter.request(t,this.getNetwork());return this.emit("onResponseReady",t,e),e}catch(t){throw t}}sendResponse(t,e){if(!this.adapter)throw new Error("Adapter not found");if(this.adapter.getStrategy()!==HHt)throw new Error("Trying to send callback request on promisified adapter");this.adapter.sendResponse(t,e)}sendError(t,e){if(!this.adapter)throw new Error("Adapter not found");if(this.adapter.getStrategy()!==HHt)throw new Error("Trying to send callback request on promisified adapter");this.adapter.sendError(t,e)}}const qHt=class extends $Ht{constructor(t){super(),this._isConnected=!1,this.chainId=null,this.address=null,t&&t.network&&(this._network=t.network,t.chainId&&(this.chainId=t.chainId))}static bufferToHex(t){return"0x"+pgt.from(t).toString("hex")}static messageToBuffer(t){let e=pgt.from([]);try{e="string"==typeof t?pgt.from(t.replace("0x",""),"hex"):pgt.from(t)}catch(t){console.log(`messageToBuffer error: ${t}`)}return e}setConfig(t){this._network=t.network,this.address=t.address,this.chainId=t.chainId}async connect(){const t=await this.account();return this._isConnected=!0,this.emit("connect"),t}disconnect(){this._isConnected=!1,this.emit("disconnect")}isConnected(){return this._isConnected}async account(){const t=await this.request({method:"requestAccounts",params:{}});return JSON.parse(t)}network(){return this._network}getNetwork(){return qHt.NETWORK}async signMessage(t){const e="APTOS",r=(await this.account()).address;let n=e;const i=window.location.protocol+"//"+window.location.hostname;t.address&&(n+="\naddress: "+r),t.application&&(n+="\napplication: "+i),t.chainId&&(n+="\nchainId: "+this.chainId),n+="\nmessage: "+t.message,n+="\nnonce: "+t.nonce;const o=pgt.from(n),s=qHt.bufferToHex(o);return this.request({method:"signMessage",params:{data:s}}).then((o=>({address:r,application:i,chainId:this.chainId,fullMessage:n,message:t.message,nonce:t.nonce,prefix:e,signature:o})))}async signAndSubmitTransaction(t){const e=await this.signTransaction(t),r=await this.request({method:"sendTransaction",params:{tx:e}});return{hash:qHt.messageToBuffer(r).toString()}}async signTransaction(t){const e=await this.request({method:"signTransaction",params:{data:t}});return JSON.parse(qHt.messageToBuffer(e).toString())}};let WHt=qHt;WHt.NETWORK="aptos";var VHt=Object.defineProperty,KHt=Object.defineProperties,GHt=Object.getOwnPropertyDescriptors,ZHt=Object.getOwnPropertySymbols,JHt=Object.prototype.hasOwnProperty,YHt=Object.prototype.propertyIsEnumerable,XHt=(t,e,r)=>e in t?VHt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,QHt=(t,e)=>{for(var r in e||(e={}))JHt.call(e,r)&&XHt(t,r,e[r]);if(ZHt)for(var r of ZHt(e))YHt.call(e,r)&&XHt(t,r,e[r]);return t},t$t=(t,e)=>KHt(t,GHt(e)),e$t=(t,e)=>{var r={};for(var n in t)JHt.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&ZHt)for(var n of ZHt(t))e.indexOf(n)<0&&YHt.call(t,n)&&(r[n]=t[n]);return r};class r$t{constructor(t){this.provider=t}static mapToCamelCase(t){return QHt(QHt({},t),null!=t&&t.messages?{messages:((null==t?void 0:t.messages)||[]).map((t=>{var e=t,{state_init:r}=e,n=e$t(e,["state_init"]);return t$t(QHt({},n),{stateInit:r})}))}:{})}async request(t,e){switch(t){case"tonConnect_connect":{const t=await this.provider.internalRequest("requestAccounts",e);return JSON.parse(t).map((t=>{if("ton_addr"===t.name){const e=t,{nonBounceable:r,type:n}=e,i=e$t(e,["nonBounceable","type"]);return n&&console.warn("type parameter removed from request"),i}if("ton_proof"===t.name){const e=t;return t$t(QHt({},e),{proof:t$t(QHt({},e.proof),{timestamp:parseInt(e.proof.timestamp)})})}return t}))}case"tonConnect_reconnect":{const t=await this.provider.internalRequest("tonConnect_reconnect",e);return JSON.parse(t)}case"ton_rawSign":return this.provider.internalRequest("signMessage",e);case"ton_sendTransaction":case"tonConnect_sendTransaction":{const r=await this.provider.internalRequest("signTransaction",r$t.mapToCamelCase(e[0])),{nonce:n,hash:i}=JSON.parse(r);return"ton_sendTransaction"===t?n:i}case"ton_requestAccounts":{const t=await this.provider.internalRequest("requestAccounts",e),[{nonBounceable:r}]=JSON.parse(t);return[r]}case"ton_requestWallets":{const t=await this.provider.internalRequest("requestAccounts",e),[{nonBounceable:r,publicKey:n}]=JSON.parse(t);return[{address:r,publicKey:n,version:this.provider.version}]}default:return this.provider.internalRequest(t,e)}}}const n$t=class extends Eyt{constructor(t){super(),this.version="v4R2",t&&t.version&&(this.version=t.version),null!=t&&t.disableMobileAdapter||(this.mobileAdapter=new r$t(this))}disconnect(){return this.send("tonConnect_disconnect",{})}isConnected(){return Promise.resolve(!0)}async send(t,e){return this.mobileAdapter?await this.mobileAdapter.request(t,e):await(()=>this.internalRequest(t,e))()}internalRequest(t,e){return super.request({method:t,params:e})}getNetwork(){return n$t.NETWORK}};let i$t=n$t;i$t.NETWORK="ton";class o$t extends Error{constructor(t,e){super(t),this.code=e}}var s$t=Object.defineProperty,a$t=Object.defineProperties,c$t=Object.getOwnPropertyDescriptors,u$t=Object.getOwnPropertySymbols,f$t=Object.prototype.hasOwnProperty,h$t=Object.prototype.propertyIsEnumerable,l$t=(t,e,r)=>e in t?s$t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d$t=(t,e)=>{for(var r in e||(e={}))f$t.call(e,r)&&l$t(t,r,e[r]);if(u$t)for(var r of u$t(e))h$t.call(e,r)&&l$t(t,r,e[r]);return t},p$t=(t,e)=>a$t(t,c$t(e));const g$t=t=>{var e;return{event:"connect_error",payload:{code:null!=(e=t.code)?e:0,message:t.message}}};class y$t{constructor(t,e){this.protocolVersion=2,this.isWalletBrowser=!0,this.callbacks=[],this.connectionAttempts=0,this.listen=t=>(this.callbacks.push(t),()=>{this.callbacks=this.callbacks.filter((e=>e!=t))}),t&&(typeof t.isWalletBrowser<"u"&&(this.isWalletBrowser=t.isWalletBrowser),t.walletInfo&&(this.walletInfo=t.walletInfo),t.deviceInfo&&(this.deviceInfo=t.deviceInfo)),this.provider=e}async connect(t,e){try{t>this.protocolVersion&&new o$t("Unsupported protocol version",1);const r=await this.provider.send("tonConnect_connect",e);return this.connectionAttempts+=1,"connect_error"===(null==r?void 0:r.event)?this.emit(p$t(d$t({},r),{id:this.connectionAttempts})):this.emit({id:this.connectionAttempts,event:"connect",payload:{items:r,device:this.deviceInfo}})}catch(t){return this.parseError(t,{id:this.connectionAttempts})}}async disconnect(){return await this.provider.send("tonConnect_disconnect",{}),this.emit({event:"disconnect",payload:{}})}emit(t){return this.callbacks.forEach((e=>e(t))),t}async restoreConnection(){var t;try{const t=await this.provider.send("tonConnect_reconnect",[{name:"ton_addr"}]);return this.connectionAttempts+=1,"connect_error"===(null==t?void 0:t.event)?this.emit(p$t(d$t({},t),{id:this.connectionAttempts})):this.emit({id:this.connectionAttempts,event:"connect",payload:{items:t,device:this.deviceInfo}})}catch(e){return e instanceof o$t?this.emit(g$t(e)):this.emit(g$t(new o$t(null!=(t=e.message)?t:"Unknown error")))}}async send(t){try{return{result:await this.provider.send(`tonConnect_${t.method}`,t.params.map((t=>JSON.parse(t)))),id:t.id.toString()}}catch(e){return this.parseError(e,{id:t.id})}}parseError(t,e){var r,n,i,o;return 4001===(null==t?void 0:t.code)?{error:{message:"User declined the transaction",code:300},id:null!=(r=String(e.id))?r:0}:-32002===(null==t?void 0:t.code)?{error:{message:"Bad request, a transaction is already pending",code:1},id:null!=(n=String(e.id))?n:0}:t&&![0,1,100,300,400].includes(t.code)?{error:{message:"User declined the transaction",code:300},id:null!=(i=String(e.id))?i:0}:{error:t,id:null!=(o=String(e.id))?o:0}}}window.trustwallet={core:(t,e)=>new Syt({strategy:t,handler:e}),solana:t=>new Jxt(t),cosmos:t=>new xHt(t),ethereum:t=>new wHt(t),aptos:t=>new WHt(t),ton:t=>new i$t(t),tonBridge:(t,e)=>new y$t(t,e),randomUUID:()=>Jpt()}}))})); +!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e;e=function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){var t=e.default;if("function"==typeof t){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var r={exports:{}},n=function(e){return e&&e.Math===Math&&e},i=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")(),o={},s=function(e){try{return!!e()}catch(e){return!0}},a=!s((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=!s((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),u=c,l=Function.prototype.call,d=u?l.bind(l):function(){return l.apply(l,arguments)},f={},h={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,g=p&&!h.call({1:2},1);f.f=g?function(e){var t=p(this,e);return!!t&&t.enumerable}:h;var y,m,b=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},v=c,w=Function.prototype,_=w.call,E=v&&w.bind.bind(_,_),S=v?E:function(e){return function(){return _.apply(e,arguments)}},k=S,A=k({}.toString),x=k("".slice),I=function(e){return x(A(e),8,-1)},B=s,T=I,C=Object,O=S("".split),R=B((function(){return!C("z").propertyIsEnumerable(0)}))?function(e){return"String"===T(e)?O(e,""):C(e)}:C,P=function(e){return null==e},M=P,U=TypeError,L=function(e){if(M(e))throw new U("Can't call method on "+e);return e},j=R,N=L,z=function(e){return j(N(e))},D="object"==typeof document&&document.all,F=void 0===D&&void 0!==D?function(e){return"function"==typeof e||e===D}:function(e){return"function"==typeof e},q=F,H=function(e){return"object"==typeof e?null!==e:q(e)},V=i,$=F,K=function(e,t){return arguments.length<2?(r=V[e],$(r)?r:void 0):V[e]&&V[e][t];var r},Z=S({}.isPrototypeOf),W=i.navigator,G=W&&W.userAgent,Y=G?String(G):"",J=i,X=Y,Q=J.process,ee=J.Deno,te=Q&&Q.versions||ee&&ee.version,re=te&&te.v8;re&&(m=(y=re.split("."))[0]>0&&y[0]<4?1:+(y[0]+y[1])),!m&&X&&(!(y=X.match(/Edge\/(\d+)/))||y[1]>=74)&&(y=X.match(/Chrome\/(\d+)/))&&(m=+y[1]);var ne=m,ie=ne,oe=s,se=i.String,ae=!!Object.getOwnPropertySymbols&&!oe((function(){var e=Symbol("symbol detection");return!se(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ie&&ie<41})),ce=ae&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ue=K,le=F,de=Z,fe=Object,he=ce?function(e){return"symbol"==typeof e}:function(e){var t=ue("Symbol");return le(t)&&de(t.prototype,fe(e))},pe=String,ge=function(e){try{return pe(e)}catch(e){return"Object"}},ye=F,me=ge,be=TypeError,ve=function(e){if(ye(e))return e;throw new be(me(e)+" is not a function")},we=ve,_e=P,Ee=function(e,t){var r=e[t];return _e(r)?void 0:we(r)},Se=d,ke=F,Ae=H,xe=TypeError,Ie=function(e,t){var r,n;if("string"===t&&ke(r=e.toString)&&!Ae(n=Se(r,e)))return n;if(ke(r=e.valueOf)&&!Ae(n=Se(r,e)))return n;if("string"!==t&&ke(r=e.toString)&&!Ae(n=Se(r,e)))return n;throw new xe("Can't convert object to primitive value")},Be={exports:{}},Te=i,Ce=Object.defineProperty,Oe=function(e,t){try{Ce(Te,e,{value:t,configurable:!0,writable:!0})}catch(r){Te[e]=t}return t},Re=i,Pe=Oe,Me="__core-js_shared__",Ue=Be.exports=Re[Me]||Pe(Me,{});(Ue.versions||(Ue.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Le=Be.exports,je=function(e,t){return Le[e]||(Le[e]=t||{})},Ne=L,ze=Object,De=function(e){return ze(Ne(e))},Fe=De,qe=S({}.hasOwnProperty),He=Object.hasOwn||function(e,t){return qe(Fe(e),t)},Ve=S,$e=0,Ke=Math.random(),Ze=Ve(1..toString),We=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Ze(++$e+Ke,36)},Ge=je,Ye=He,Je=We,Xe=ae,Qe=ce,et=i.Symbol,tt=Ge("wks"),rt=Qe?et.for||et:et&&et.withoutSetter||Je,nt=function(e){return Ye(tt,e)||(tt[e]=Xe&&Ye(et,e)?et[e]:rt("Symbol."+e)),tt[e]},it=d,ot=H,st=he,at=Ee,ct=Ie,ut=TypeError,lt=nt("toPrimitive"),dt=function(e,t){if(!ot(e)||st(e))return e;var r,n=at(e,lt);if(n){if(void 0===t&&(t="default"),r=it(n,e,t),!ot(r)||st(r))return r;throw new ut("Can't convert object to primitive value")}return void 0===t&&(t="number"),ct(e,t)},ft=dt,ht=he,pt=function(e){var t=ft(e,"string");return ht(t)?t:t+""},gt=H,yt=i.document,mt=gt(yt)&>(yt.createElement),bt=function(e){return mt?yt.createElement(e):{}},vt=bt,wt=!a&&!s((function(){return 7!==Object.defineProperty(vt("div"),"a",{get:function(){return 7}}).a})),_t=a,Et=d,St=f,kt=b,At=z,xt=pt,It=He,Bt=wt,Tt=Object.getOwnPropertyDescriptor;o.f=_t?Tt:function(e,t){if(e=At(e),t=xt(t),Bt)try{return Tt(e,t)}catch(e){}if(It(e,t))return kt(!Et(St.f,e,t),e[t])};var Ct={},Ot=a&&s((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Rt=H,Pt=String,Mt=TypeError,Ut=function(e){if(Rt(e))return e;throw new Mt(Pt(e)+" is not an object")},Lt=a,jt=wt,Nt=Ot,zt=Ut,Dt=pt,Ft=TypeError,qt=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Vt="enumerable",$t="configurable",Kt="writable";Ct.f=Lt?Nt?function(e,t,r){if(zt(e),t=Dt(t),zt(r),"function"==typeof e&&"prototype"===t&&"value"in r&&Kt in r&&!r[Kt]){var n=Ht(e,t);n&&n[Kt]&&(e[t]=r.value,r={configurable:$t in r?r[$t]:n[$t],enumerable:Vt in r?r[Vt]:n[Vt],writable:!1})}return qt(e,t,r)}:qt:function(e,t,r){if(zt(e),t=Dt(t),zt(r),jt)try{return qt(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new Ft("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Zt=Ct,Wt=b,Gt=a?function(e,t,r){return Zt.f(e,t,Wt(1,r))}:function(e,t,r){return e[t]=r,e},Yt={exports:{}},Jt=a,Xt=He,Qt=Function.prototype,er=Jt&&Object.getOwnPropertyDescriptor,tr=Xt(Qt,"name"),rr={EXISTS:tr,PROPER:tr&&"something"===function(){}.name,CONFIGURABLE:tr&&(!Jt||Jt&&er(Qt,"name").configurable)},nr=S,ir=F,or=Be.exports,sr=nr(Function.toString);ir(or.inspectSource)||(or.inspectSource=function(e){return sr(e)});var ar,cr,ur,lr=or.inspectSource,dr=F,fr=i.WeakMap,hr=dr(fr)&&/native code/.test(String(fr)),pr=We,gr=je("keys"),yr=function(e){return gr[e]||(gr[e]=pr(e))},mr={},br=hr,vr=i,wr=H,_r=Gt,Er=He,Sr=Be.exports,kr=yr,Ar=mr,xr="Object already initialized",Ir=vr.TypeError,Br=vr.WeakMap;if(br||Sr.state){var Tr=Sr.state||(Sr.state=new Br);Tr.get=Tr.get,Tr.has=Tr.has,Tr.set=Tr.set,ar=function(e,t){if(Tr.has(e))throw new Ir(xr);return t.facade=e,Tr.set(e,t),t},cr=function(e){return Tr.get(e)||{}},ur=function(e){return Tr.has(e)}}else{var Cr=kr("state");Ar[Cr]=!0,ar=function(e,t){if(Er(e,Cr))throw new Ir(xr);return t.facade=e,_r(e,Cr,t),t},cr=function(e){return Er(e,Cr)?e[Cr]:{}},ur=function(e){return Er(e,Cr)}}var Or={set:ar,get:cr,has:ur,enforce:function(e){return ur(e)?cr(e):ar(e,{})},getterFor:function(e){return function(t){var r;if(!wr(t)||(r=cr(t)).type!==e)throw new Ir("Incompatible receiver, "+e+" required");return r}}},Rr=S,Pr=s,Mr=F,Ur=He,Lr=a,jr=rr.CONFIGURABLE,Nr=lr,zr=Or.enforce,Dr=Or.get,Fr=String,qr=Object.defineProperty,Hr=Rr("".slice),Vr=Rr("".replace),$r=Rr([].join),Kr=Lr&&!Pr((function(){return 8!==qr((function(){}),"length",{value:8}).length})),Zr=String(String).split("String"),Wr=Yt.exports=function(e,t,r){"Symbol("===Hr(Fr(t),0,7)&&(t="["+Vr(Fr(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Ur(e,"name")||jr&&e.name!==t)&&(Lr?qr(e,"name",{value:t,configurable:!0}):e.name=t),Kr&&r&&Ur(r,"arity")&&e.length!==r.arity&&qr(e,"length",{value:r.arity});try{r&&Ur(r,"constructor")&&r.constructor?Lr&&qr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=zr(e);return Ur(n,"source")||(n.source=$r(Zr,"string"==typeof t?t:"")),e};Function.prototype.toString=Wr((function(){return Mr(this)&&Dr(this).source||Nr(this)}),"toString");var Gr=F,Yr=Ct,Jr=Yt.exports,Xr=Oe,Qr=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;if(Gr(r)&&Jr(r,o,n),n.global)i?e[t]=r:Xr(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:Yr.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},en={},tn=Math.ceil,rn=Math.floor,nn=Math.trunc||function(e){var t=+e;return(t>0?rn:tn)(t)},on=nn,sn=function(e){var t=+e;return t!=t||0===t?0:on(t)},an=sn,cn=Math.max,un=Math.min,ln=function(e,t){var r=an(e);return r<0?cn(r+t,0):un(r,t)},dn=sn,fn=Math.min,hn=function(e){var t=dn(e);return t>0?fn(t,9007199254740991):0},pn=hn,gn=function(e){return pn(e.length)},yn=z,mn=ln,bn=gn,vn=function(e){return function(t,r,n){var i=yn(t),o=bn(i);if(0===o)return!e&&-1;var s,a=mn(n,o);if(e&&r!=r){for(;o>a;)if((s=i[a++])!=s)return!0}else for(;o>a;a++)if((e||a in i)&&i[a]===r)return e||a||0;return!e&&-1}},wn={includes:vn(!0),indexOf:vn(!1)},_n=He,En=z,Sn=wn.indexOf,kn=mr,An=S([].push),xn=function(e,t){var r,n=En(e),i=0,o=[];for(r in n)!_n(kn,r)&&_n(n,r)&&An(o,r);for(;t.length>i;)_n(n,r=t[i++])&&(~Sn(o,r)||An(o,r));return o},In=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Bn=xn,Tn=In.concat("length","prototype");en.f=Object.getOwnPropertyNames||function(e){return Bn(e,Tn)};var Cn={};Cn.f=Object.getOwnPropertySymbols;var On=K,Rn=en,Pn=Cn,Mn=Ut,Un=S([].concat),Ln=On("Reflect","ownKeys")||function(e){var t=Rn.f(Mn(e)),r=Pn.f;return r?Un(t,r(e)):t},jn=He,Nn=Ln,zn=o,Dn=Ct,Fn=function(e,t,r){for(var n=Nn(t),i=Dn.f,o=zn.f,s=0;ss;)Si.f(e,r=i[s++],n[r]);return e};var Ii,Bi=K("document","documentElement"),Ti=Ut,Ci=mi,Oi=In,Ri=mr,Pi=Bi,Mi=bt,Ui="prototype",Li="script",ji=yr("IE_PROTO"),Ni=function(){},zi=function(e){return"<"+Li+">"+e+""},Di=function(e){e.write(zi("")),e.close();var t=e.parentWindow.Object;return e=null,t},Fi=function(){try{Ii=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;Fi="undefined"!=typeof document?document.domain&&Ii?Di(Ii):(t=Mi("iframe"),r="java"+Li+":",t.style.display="none",Pi.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(zi("document.F=Object")),e.close(),e.F):Di(Ii);for(var n=Oi.length;n--;)delete Fi[Ui][Oi[n]];return Fi()};Ri[ji]=!0;var qi=Object.create||function(e,t){var r;return null!==e?(Ni[Ui]=Ti(e),r=new Ni,Ni[Ui]=null,r[ji]=e):r=Fi(),void 0===t?r:Ci.f(r,t)},Hi={},Vi=S([].slice),$i=I,Ki=z,Zi=en.f,Wi=Vi,Gi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Hi.f=function(e){return Gi&&"Window"===$i(e)?function(e){try{return Zi(e)}catch(e){return Wi(Gi)}}(e):Zi(Ki(e))};var Yi=Yt.exports,Ji=Ct,Xi=function(e,t,r){return r.get&&Yi(r.get,t,{getter:!0}),r.set&&Yi(r.set,t,{setter:!0}),Ji.f(e,t,r)},Qi={},eo=nt;Qi.f=eo;var to=i,ro=to,no=He,io=Qi,oo=Ct.f,so=function(e){var t=ro.Symbol||(ro.Symbol={});no(t,e)||oo(t,e,{value:io.f(e)})},ao=d,co=K,uo=nt,lo=Qr,fo=function(){var e=co("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=uo("toPrimitive");t&&!t[n]&&lo(t,n,(function(e){return ao(r,this)}),{arity:1})},ho=Ct.f,po=He,go=nt("toStringTag"),yo=function(e,t,r){e&&!r&&(e=e.prototype),e&&!po(e,go)&&ho(e,go,{configurable:!0,value:t})},mo=I,bo=S,vo=function(e){if("Function"===mo(e))return bo(e)},wo=ve,_o=c,Eo=vo(vo.bind),So=function(e,t){return wo(e),void 0===t?e:_o?Eo(e,t):function(){return e.apply(t,arguments)}},ko=I,Ao=Array.isArray||function(e){return"Array"===ko(e)},xo=S,Io=s,Bo=F,To=hi,Co=lr,Oo=function(){},Ro=K("Reflect","construct"),Po=/^\s*(?:class|function)\b/,Mo=xo(Po.exec),Uo=!Po.test(Oo),Lo=function(e){if(!Bo(e))return!1;try{return Ro(Oo,[],e),!0}catch(e){return!1}},jo=function(e){if(!Bo(e))return!1;switch(To(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Uo||!!Mo(Po,Co(e))}catch(e){return!0}};jo.sham=!0;var No=!Ro||Io((function(){var e;return Lo(Lo.call)||!Lo(Object)||!Lo((function(){e=!0}))||e}))?jo:Lo,zo=Ao,Do=No,Fo=H,qo=nt("species"),Ho=Array,Vo=function(e){var t;return zo(e)&&(t=e.constructor,(Do(t)&&(t===Ho||zo(t.prototype))||Fo(t)&&null===(t=t[qo]))&&(t=void 0)),void 0===t?Ho:t},$o=function(e,t){return new(Vo(e))(0===t?0:t)},Ko=So,Zo=R,Wo=De,Go=gn,Yo=$o,Jo=S([].push),Xo=function(e){var t=1===e,r=2===e,n=3===e,i=4===e,o=6===e,s=7===e,a=5===e||o;return function(c,u,l,d){for(var f,h,p=Wo(c),g=Zo(p),y=Go(g),m=Ko(u,l),b=0,v=d||Yo,w=t?v(c,y):r||s?v(c,0):void 0;y>b;b++)if((a||b in g)&&(h=m(f=g[b],b,p),e))if(t)w[b]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return b;case 2:Jo(w,f)}else switch(e){case 4:return!1;case 7:Jo(w,f)}return o?-1:n||i?i:w}},Qo={forEach:Xo(0),map:Xo(1),filter:Xo(2),some:Xo(3),every:Xo(4),find:Xo(5),findIndex:Xo(6),filterReject:Xo(7)},es=ii,ts=i,rs=d,ns=S,is=a,os=ae,ss=s,as=He,cs=Z,us=Ut,ls=z,ds=pt,fs=yi,hs=b,ps=qi,gs=wi,ys=en,ms=Hi,bs=Cn,vs=o,ws=Ct,_s=mi,Es=f,Ss=Qr,ks=Xi,As=je,xs=mr,Is=We,Bs=nt,Ts=Qi,Cs=so,Os=fo,Rs=yo,Ps=Or,Ms=Qo.forEach,Us=yr("hidden"),Ls="Symbol",js="prototype",Ns=Ps.set,zs=Ps.getterFor(Ls),Ds=Object[js],Fs=ts.Symbol,qs=Fs&&Fs[js],Hs=ts.RangeError,Vs=ts.TypeError,$s=ts.QObject,Ks=vs.f,Zs=ws.f,Ws=ms.f,Gs=Es.f,Ys=ns([].push),Js=As("symbols"),Xs=As("op-symbols"),Qs=As("wks"),ea=!$s||!$s[js]||!$s[js].findChild,ta=function(e,t,r){var n=Ks(Ds,t);n&&delete Ds[t],Zs(e,t,r),n&&e!==Ds&&Zs(Ds,t,n)},ra=is&&ss((function(){return 7!==ps(Zs({},"a",{get:function(){return Zs(this,"a",{value:7}).a}})).a}))?ta:Zs,na=function(e,t){var r=Js[e]=ps(qs);return Ns(r,{type:Ls,tag:e,description:t}),is||(r.description=t),r},ia=function(e,t,r){e===Ds&&ia(Xs,t,r),us(e);var n=ds(t);return us(r),as(Js,n)?(r.enumerable?(as(e,Us)&&e[Us][n]&&(e[Us][n]=!1),r=ps(r,{enumerable:hs(0,!1)})):(as(e,Us)||Zs(e,Us,hs(1,ps(null))),e[Us][n]=!0),ra(e,n,r)):Zs(e,n,r)},oa=function(e,t){us(e);var r=ls(t),n=gs(r).concat(ua(r));return Ms(n,(function(t){is&&!rs(sa,r,t)||ia(e,t,r[t])})),e},sa=function(e){var t=ds(e),r=rs(Gs,this,t);return!(this===Ds&&as(Js,t)&&!as(Xs,t))&&(!(r||!as(this,t)||!as(Js,t)||as(this,Us)&&this[Us][t])||r)},aa=function(e,t){var r=ls(e),n=ds(t);if(r!==Ds||!as(Js,n)||as(Xs,n)){var i=Ks(r,n);return!i||!as(Js,n)||as(r,Us)&&r[Us][n]||(i.enumerable=!0),i}},ca=function(e){var t=Ws(ls(e)),r=[];return Ms(t,(function(e){as(Js,e)||as(xs,e)||Ys(r,e)})),r},ua=function(e){var t=e===Ds,r=Ws(t?Xs:ls(e)),n=[];return Ms(r,(function(e){!as(Js,e)||t&&!as(Ds,e)||Ys(n,Js[e])})),n};os||(Fs=function(){if(cs(qs,this))throw new Vs("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?fs(arguments[0]):void 0,t=Is(e),r=function(e){var n=void 0===this?ts:this;n===Ds&&rs(r,Xs,e),as(n,Us)&&as(n[Us],t)&&(n[Us][t]=!1);var i=hs(1,e);try{ra(n,t,i)}catch(e){if(!(e instanceof Hs))throw e;ta(n,t,i)}};return is&&ea&&ra(Ds,t,{configurable:!0,set:r}),na(t,e)},Ss(qs=Fs[js],"toString",(function(){return zs(this).tag})),Ss(Fs,"withoutSetter",(function(e){return na(Is(e),e)})),Es.f=sa,ws.f=ia,_s.f=oa,vs.f=aa,ys.f=ms.f=ca,bs.f=ua,Ts.f=function(e){return na(Bs(e),e)},is&&(ks(qs,"description",{configurable:!0,get:function(){return zs(this).description}}),Ss(Ds,"propertyIsEnumerable",sa,{unsafe:!0}))),es({global:!0,constructor:!0,wrap:!0,forced:!os,sham:!os},{Symbol:Fs}),Ms(gs(Qs),(function(e){Cs(e)})),es({target:Ls,stat:!0,forced:!os},{useSetter:function(){ea=!0},useSimple:function(){ea=!1}}),es({target:"Object",stat:!0,forced:!os,sham:!is},{create:function(e,t){return void 0===t?ps(e):oa(ps(e),t)},defineProperty:ia,defineProperties:oa,getOwnPropertyDescriptor:aa}),es({target:"Object",stat:!0,forced:!os},{getOwnPropertyNames:ca}),Os(),Rs(Fs,Ls),xs[Us]=!0;var la=ae&&!!Symbol.for&&!!Symbol.keyFor,da=ii,fa=K,ha=He,pa=yi,ga=je,ya=la,ma=ga("string-to-symbol-registry"),ba=ga("symbol-to-string-registry");da({target:"Symbol",stat:!0,forced:!ya},{for:function(e){var t=pa(e);if(ha(ma,t))return ma[t];var r=fa("Symbol")(t);return ma[t]=r,ba[r]=t,r}});var va=ii,wa=He,_a=he,Ea=ge,Sa=la,ka=je("symbol-to-string-registry");va({target:"Symbol",stat:!0,forced:!Sa},{keyFor:function(e){if(!_a(e))throw new TypeError(Ea(e)+" is not a symbol");if(wa(ka,e))return ka[e]}});var Aa=c,xa=Function.prototype,Ia=xa.apply,Ba=xa.call,Ta="object"==typeof Reflect&&Reflect.apply||(Aa?Ba.bind(Ia):function(){return Ba.apply(Ia,arguments)}),Ca=Ao,Oa=F,Ra=I,Pa=yi,Ma=S([].push),Ua=function(e){if(Oa(e))return e;if(Ca(e)){for(var t=e.length,r=[],n=0;no&&ku(i,arguments[o]),i}));d.prototype=u,"Error"!==a?vu?vu(d,l):wu(d,l,{name:!0}):xu&&i in c&&(_u(d,c,i),_u(d,c,"prepareStackTrace")),wu(d,c);try{u.name!==a&&mu(u,"name",a),u.constructor=d}catch(e){}return d}},Bu=ii,Tu=Ta,Cu=Iu,Ou="WebAssembly",Ru=i[Ou],Pu=7!==new Error("e",{cause:7}).cause,Mu=function(e,t){var r={};r[e]=Cu(e,t,Pu),Bu({global:!0,constructor:!0,arity:1,forced:Pu},r)},Uu=function(e,t){if(Ru&&Ru[e]){var r={};r[e]=Cu(Ou+"."+e,t,Pu),Bu({target:Ou,stat:!0,constructor:!0,arity:1,forced:Pu},r)}};Mu("Error",(function(e){return function(t){return Tu(e,this,arguments)}})),Mu("EvalError",(function(e){return function(t){return Tu(e,this,arguments)}})),Mu("RangeError",(function(e){return function(t){return Tu(e,this,arguments)}})),Mu("ReferenceError",(function(e){return function(t){return Tu(e,this,arguments)}})),Mu("SyntaxError",(function(e){return function(t){return Tu(e,this,arguments)}})),Mu("TypeError",(function(e){return function(t){return Tu(e,this,arguments)}})),Mu("URIError",(function(e){return function(t){return Tu(e,this,arguments)}})),Uu("CompileError",(function(e){return function(t){return Tu(e,this,arguments)}})),Uu("LinkError",(function(e){return function(t){return Tu(e,this,arguments)}})),Uu("RuntimeError",(function(e){return function(t){return Tu(e,this,arguments)}}));var Lu=a,ju=s,Nu=Ut,zu=Xc,Du=Error.prototype.toString,Fu=ju((function(){if(Lu){var e=Object.create(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==Du.call(e))return!0}return"2: 1"!==Du.call({message:1,name:2})||"Error"!==Du.call({})}))?function(){var e=Nu(this),t=zu(e.name,"Error"),r=zu(e.message);return t?r?t+": "+r:t:r}:Du,qu=Qr,Hu=Fu,Vu=Error.prototype;Vu.toString!==Hu&&qu(Vu,"toString",Hu);var $u=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ku=He,Zu=F,Wu=De,Gu=$u,Yu=yr("IE_PROTO"),Ju=Object,Xu=Ju.prototype,Qu=Gu?Ju.getPrototypeOf:function(e){var t=Wu(e);if(Ku(t,Yu))return t[Yu];var r=t.constructor;return Zu(r)&&t instanceof r?r.prototype:t instanceof Ju?Xu:null},el={},tl=el,rl=nt("iterator"),nl=Array.prototype,il=function(e){return void 0!==e&&(tl.Array===e||nl[rl]===e)},ol=hi,sl=Ee,al=P,cl=el,ul=nt("iterator"),ll=function(e){if(!al(e))return sl(e,ul)||sl(e,"@@iterator")||cl[ol(e)]},dl=d,fl=ve,hl=Ut,pl=ge,gl=ll,yl=TypeError,ml=function(e,t){var r=arguments.length<2?gl(e):t;if(fl(r))return hl(dl(r,e));throw new yl(pl(e)+" is not iterable")},bl=d,vl=Ut,wl=Ee,_l=function(e,t,r){var n,i;vl(e);try{if(!(n=wl(e,"return"))){if("throw"===t)throw r;return r}n=bl(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return vl(n),r},El=So,Sl=d,kl=Ut,Al=ge,xl=il,Il=gn,Bl=Z,Tl=ml,Cl=ll,Ol=_l,Rl=TypeError,Pl=function(e,t){this.stopped=e,this.result=t},Ml=Pl.prototype,Ul=function(e,t,r){var n,i,o,s,a,c,u,l=r&&r.that,d=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_RECORD),h=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),g=El(t,l),y=function(e){return n&&Ol(n,"normal",e),new Pl(!0,e)},m=function(e){return d?(kl(e),p?g(e[0],e[1],y):g(e[0],e[1])):p?g(e,y):g(e)};if(f)n=e.iterator;else if(h)n=e;else{if(!(i=Cl(e)))throw new Rl(Al(e)+" is not iterable");if(xl(i)){for(o=0,s=Il(e);s>o;o++)if((a=m(e[o]))&&Bl(Ml,a))return a;return new Pl(!1)}n=Tl(e,i)}for(c=f?e.next:n.next;!(u=Sl(c,n)).done;){try{a=m(u.value)}catch(e){Ol(n,"throw",e)}if("object"==typeof a&&a&&Bl(Ml,a))return a}return new Pl(!1)},Ll=ii,jl=Z,Nl=Qu,zl=Vc,Dl=Fn,Fl=qi,ql=Gt,Hl=b,Vl=tu,$l=pu,Kl=Ul,Zl=Xc,Wl=nt("toStringTag"),Gl=Error,Yl=[].push,Jl=function(e,t){var r,n=jl(Xl,this);zl?r=zl(new Gl,n?Nl(this):Xl):(r=n?this:Fl(Xl),ql(r,Wl,"Error")),void 0!==t&&ql(r,"message",Zl(t)),$l(r,Jl,r.stack,1),arguments.length>2&&Vl(r,arguments[2]);var i=[];return Kl(e,Yl,{that:i}),ql(r,"errors",i),r};zl?zl(Jl,Gl):Dl(Jl,Gl,{name:!0});var Xl=Jl.prototype=Fl(Gl.prototype,{constructor:Hl(1,Jl),message:Hl(1,""),name:Hl(1,"AggregateError")});Ll({global:!0,constructor:!0,arity:2},{AggregateError:Jl});var Ql=ii,ed=Ta,td=s,rd=Iu,nd="AggregateError",id=K(nd),od=!td((function(){return 1!==id([1]).errors[0]}))&&td((function(){return 7!==id([1],nd,{cause:7}).cause}));Ql({global:!0,constructor:!0,arity:2,forced:od},{AggregateError:rd(nd,(function(e){return function(t,r){return ed(e,this,arguments)}}),od,!0)});var sd=nt,ad=qi,cd=Ct.f,ud=sd("unscopables"),ld=Array.prototype;void 0===ld[ud]&&cd(ld,ud,{configurable:!0,value:ad(null)});var dd=function(e){ld[ud][e]=!0},fd=De,hd=gn,pd=sn,gd=dd;ii({target:"Array",proto:!0},{at:function(e){var t=fd(this),r=hd(t),n=pd(e),i=n>=0?n:r+n;return i<0||i>=r?void 0:t[i]}}),gd("at");var yd=TypeError,md=function(e){if(e>9007199254740991)throw yd("Maximum allowed index exceeded");return e},bd=a,vd=Ct,wd=b,_d=function(e,t,r){bd?vd.f(e,t,wd(0,r)):e[t]=r},Ed=s,Sd=ne,kd=nt("species"),Ad=function(e){return Sd>=51||!Ed((function(){var t=[];return(t.constructor={})[kd]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},xd=ii,Id=s,Bd=Ao,Td=H,Cd=De,Od=gn,Rd=md,Pd=_d,Md=$o,Ud=Ad,Ld=ne,jd=nt("isConcatSpreadable"),Nd=Ld>=51||!Id((function(){var e=[];return e[jd]=!1,e.concat()[0]!==e})),zd=function(e){if(!Td(e))return!1;var t=e[jd];return void 0!==t?!!t:Bd(e)};xd({target:"Array",proto:!0,arity:1,forced:!Nd||!Ud("concat")},{concat:function(e){var t,r,n,i,o,s=Cd(this),a=Md(s,0),c=0;for(t=-1,n=arguments.length;t2?arguments[2]:void 0,a=Zd((void 0===s?n:Vd(s,n))-o,n-i),c=1;for(o0;)o in r?r[i]=r[o]:Kd(r,i),i+=c,o+=c;return r},Gd=dd;ii({target:"Array",proto:!0},{copyWithin:Wd}),Gd("copyWithin");var Yd=s,Jd=function(e,t){var r=[][e];return!!r&&Yd((function(){r.call(null,t||function(){return 1},1)}))},Xd=Qo.every;ii({target:"Array",proto:!0,forced:!Jd("every")},{every:function(e){return Xd(this,e,arguments.length>1?arguments[1]:void 0)}});var Qd=De,ef=ln,tf=gn,rf=function(e){for(var t=Qd(this),r=tf(t),n=arguments.length,i=ef(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,s=void 0===o?r:ef(o,r);s>i;)t[i++]=e;return t},nf=dd;ii({target:"Array",proto:!0},{fill:rf}),nf("fill");var of=Qo.filter;ii({target:"Array",proto:!0,forced:!Ad("filter")},{filter:function(e){return of(this,e,arguments.length>1?arguments[1]:void 0)}});var sf=ii,af=Qo.find,cf=dd,uf="find",lf=!0;uf in[]&&Array(1)[uf]((function(){lf=!1})),sf({target:"Array",proto:!0,forced:lf},{find:function(e){return af(this,e,arguments.length>1?arguments[1]:void 0)}}),cf(uf);var df=ii,ff=Qo.findIndex,hf=dd,pf="findIndex",gf=!0;pf in[]&&Array(1)[pf]((function(){gf=!1})),df({target:"Array",proto:!0,forced:gf},{findIndex:function(e){return ff(this,e,arguments.length>1?arguments[1]:void 0)}}),hf(pf);var yf=So,mf=R,bf=De,vf=gn,wf=function(e){var t=1===e;return function(r,n,i){for(var o,s=bf(r),a=mf(s),c=vf(a),u=yf(n,i);c-- >0;)if(u(o=a[c],c,s))switch(e){case 0:return o;case 1:return c}return t?-1:void 0}},_f={findLast:wf(0),findLastIndex:wf(1)},Ef=_f.findLast,Sf=dd;ii({target:"Array",proto:!0},{findLast:function(e){return Ef(this,e,arguments.length>1?arguments[1]:void 0)}}),Sf("findLast");var kf=_f.findLastIndex,Af=dd;ii({target:"Array",proto:!0},{findLastIndex:function(e){return kf(this,e,arguments.length>1?arguments[1]:void 0)}}),Af("findLastIndex");var xf=Ao,If=gn,Bf=md,Tf=So,Cf=function(e,t,r,n,i,o,s,a){for(var c,u,l=i,d=0,f=!!s&&Tf(s,a);d0&&xf(c)?(u=If(c),l=Cf(e,t,c,u,l,o-1)-1):(Bf(l+1),e[l]=c),l++),d++;return l},Of=Cf,Rf=Of,Pf=De,Mf=gn,Uf=sn,Lf=$o;ii({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=Pf(this),r=Mf(t),n=Lf(t,0);return n.length=Rf(n,t,t,r,0,void 0===e?1:Uf(e)),n}});var jf=Of,Nf=ve,zf=De,Df=gn,Ff=$o;ii({target:"Array",proto:!0},{flatMap:function(e){var t,r=zf(this),n=Df(r);return Nf(e),(t=Ff(r,0)).length=jf(t,r,r,n,0,1,e,arguments.length>1?arguments[1]:void 0),t}});var qf=Qo.forEach,Hf=Jd("forEach")?[].forEach:function(e){return qf(this,e,arguments.length>1?arguments[1]:void 0)};ii({target:"Array",proto:!0,forced:[].forEach!==Hf},{forEach:Hf});var Vf=Ut,$f=_l,Kf=function(e,t,r,n){try{return n?t(Vf(r)[0],r[1]):t(r)}catch(t){$f(e,"throw",t)}},Zf=So,Wf=d,Gf=De,Yf=Kf,Jf=il,Xf=No,Qf=gn,eh=_d,th=ml,rh=ll,nh=Array,ih=function(e){var t=Gf(e),r=Xf(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=void 0!==i;o&&(i=Zf(i,n>2?arguments[2]:void 0));var s,a,c,u,l,d,f=rh(t),h=0;if(!f||this===nh&&Jf(f))for(s=Qf(t),a=r?new this(s):nh(s);s>h;h++)d=o?i(t[h],h):t[h],eh(a,h,d);else for(a=r?new this:[],l=(u=th(t,f)).next;!(c=Wf(l,u)).done;h++)d=o?Yf(u,i,[c.value,h],!0):c.value,eh(a,h,d);return a.length=h,a},oh=nt("iterator"),sh=!1;try{var ah=0,ch={next:function(){return{done:!!ah++}},return:function(){sh=!0}};ch[oh]=function(){return this},Array.from(ch,(function(){throw 2}))}catch($Ue){}var uh=function(e,t){try{if(!t&&!sh)return!1}catch(e){return!1}var r=!1;try{var n={};n[oh]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},lh=ih;ii({target:"Array",stat:!0,forced:!uh((function(e){Array.from(e)}))},{from:lh});var dh=wn.includes,fh=dd;ii({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(e){return dh(this,e,arguments.length>1?arguments[1]:void 0)}}),fh("includes");var hh=ii,ph=wn.indexOf,gh=Jd,yh=vo([].indexOf),mh=!!yh&&1/yh([1],1,-0)<0;hh({target:"Array",proto:!0,forced:mh||!gh("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return mh?yh(this,e,t)||0:ph(this,e,t)}}),ii({target:"Array",stat:!0},{isArray:Ao});var bh,vh,wh,_h=s,Eh=F,Sh=H,kh=Qu,Ah=Qr,xh=nt("iterator"),Ih=!1;[].keys&&("next"in(wh=[].keys())?(vh=kh(kh(wh)))!==Object.prototype&&(bh=vh):Ih=!0);var Bh=!Sh(bh)||_h((function(){var e={};return bh[xh].call(e)!==e}));Bh&&(bh={}),Eh(bh[xh])||Ah(bh,xh,(function(){return this}));var Th={IteratorPrototype:bh,BUGGY_SAFARI_ITERATORS:Ih},Ch=Th.IteratorPrototype,Oh=qi,Rh=b,Ph=yo,Mh=el,Uh=function(){return this},Lh=function(e,t,r,n){var i=t+" Iterator";return e.prototype=Oh(Ch,{next:Rh(+!n,r)}),Ph(e,i,!1),Mh[i]=Uh,e},jh=ii,Nh=d,zh=F,Dh=Lh,Fh=Qu,qh=Vc,Hh=yo,Vh=Gt,$h=Qr,Kh=el,Zh=rr.PROPER,Wh=rr.CONFIGURABLE,Gh=Th.IteratorPrototype,Yh=Th.BUGGY_SAFARI_ITERATORS,Jh=nt("iterator"),Xh="keys",Qh="values",ep="entries",tp=function(){return this},rp=function(e,t,r,n,i,o,s){Dh(r,t,n);var a,c,u,l=function(e){if(e===i&&g)return g;if(!Yh&&e&&e in h)return h[e];switch(e){case Xh:case Qh:case ep:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,h=e.prototype,p=h[Jh]||h["@@iterator"]||i&&h[i],g=!Yh&&p||l(i),y="Array"===t&&h.entries||p;if(y&&(a=Fh(y.call(new e)))!==Object.prototype&&a.next&&(Fh(a)!==Gh&&(qh?qh(a,Gh):zh(a[Jh])||$h(a,Jh,tp)),Hh(a,d,!0)),Zh&&i===Qh&&p&&p.name!==Qh&&(Wh?Vh(h,"name",Qh):(f=!0,g=function(){return Nh(p,this)})),i)if(c={values:l(Qh),keys:o?g:l(Xh),entries:l(ep)},s)for(u in c)(Yh||f||!(u in h))&&$h(h,u,c[u]);else jh({target:t,proto:!0,forced:Yh||f},c);return h[Jh]!==g&&$h(h,Jh,g,{name:i}),Kh[t]=g,c},np=function(e,t){return{value:e,done:t}},ip=z,op=dd,sp=el,ap=Or,cp=Ct.f,up=rp,lp=np,dp=a,fp="Array Iterator",hp=ap.set,pp=ap.getterFor(fp),gp=up(Array,"Array",(function(e,t){hp(this,{type:fp,target:ip(e),index:0,kind:t})}),(function(){var e=pp(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,lp(void 0,!0);switch(e.kind){case"keys":return lp(r,!1);case"values":return lp(t[r],!1)}return lp([r,t[r]],!1)}),"values"),yp=sp.Arguments=sp.Array;if(op("keys"),op("values"),op("entries"),dp&&"values"!==yp.name)try{cp(yp,"name",{value:"values"})}catch($Ue){}var mp=ii,bp=R,vp=z,wp=Jd,_p=S([].join);mp({target:"Array",proto:!0,forced:bp!==Object||!wp("join",",")},{join:function(e){return _p(vp(this),void 0===e?",":e)}});var Ep=Ta,Sp=z,kp=sn,Ap=gn,xp=Jd,Ip=Math.min,Bp=[].lastIndexOf,Tp=!!Bp&&1/[1].lastIndexOf(1,-0)<0,Cp=xp("lastIndexOf"),Op=Tp||!Cp?function(e){if(Tp)return Ep(Bp,this,arguments)||0;var t=Sp(this),r=Ap(t);if(0===r)return-1;var n=r-1;for(arguments.length>1&&(n=Ip(n,kp(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:Bp;ii({target:"Array",proto:!0,forced:Op!==[].lastIndexOf},{lastIndexOf:Op});var Rp=Qo.map;ii({target:"Array",proto:!0,forced:!Ad("map")},{map:function(e){return Rp(this,e,arguments.length>1?arguments[1]:void 0)}});var Pp=ii,Mp=No,Up=_d,Lp=Array,jp=s((function(){function e(){}return!(Lp.of.call(e)instanceof e)}));Pp({target:"Array",stat:!0,forced:jp},{of:function(){for(var e=0,t=arguments.length,r=new(Mp(this)?this:Lp)(t);t>e;)Up(r,e,arguments[e++]);return r.length=t,r}});var Np=a,zp=Ao,Dp=TypeError,Fp=Object.getOwnPropertyDescriptor,qp=Np&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),Hp=qp?function(e,t){if(zp(e)&&!Fp(e,"length").writable)throw new Dp("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},Vp=ii,$p=De,Kp=gn,Zp=Hp,Wp=md,Gp=s((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}();Vp({target:"Array",proto:!0,arity:1,forced:Gp},{push:function(e){var t=$p(this),r=Kp(t),n=arguments.length;Wp(r+n);for(var i=0;i=0:a>c;c+=u)c in s&&(i=r(i,s[c],c,o));return i}},ng={left:rg(!1),right:rg(!0)},ig=i,og=Y,sg=I,ag=function(e){return og.slice(0,e.length)===e},cg=ag("Bun/")?"BUN":ag("Cloudflare-Workers")?"CLOUDFLARE":ag("Deno/")?"DENO":ag("Node.js/")?"NODE":ig.Bun&&"string"==typeof Bun.version?"BUN":ig.Deno&&"object"==typeof Deno.version?"DENO":"process"===sg(ig.process)?"NODE":ig.window&&ig.document?"BROWSER":"REST",ug="NODE"===cg,lg=ng.left;ii({target:"Array",proto:!0,forced:!ug&&ne>79&&ne<83||!Jd("reduce")},{reduce:function(e){var t=arguments.length;return lg(this,e,t,t>1?arguments[1]:void 0)}});var dg=ng.right;ii({target:"Array",proto:!0,forced:!ug&&ne>79&&ne<83||!Jd("reduceRight")},{reduceRight:function(e){return dg(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var fg=ii,hg=Ao,pg=S([].reverse),gg=[1,2];fg({target:"Array",proto:!0,forced:String(gg)===String(gg.reverse())},{reverse:function(){return hg(this)&&(this.length=this.length),pg(this)}});var yg=ii,mg=Ao,bg=No,vg=H,wg=ln,_g=gn,Eg=z,Sg=_d,kg=nt,Ag=Vi,xg=Ad("slice"),Ig=kg("species"),Bg=Array,Tg=Math.max;yg({target:"Array",proto:!0,forced:!xg},{slice:function(e,t){var r,n,i,o=Eg(this),s=_g(o),a=wg(e,s),c=wg(void 0===t?s:t,s);if(mg(o)&&(r=o.constructor,(bg(r)&&(r===Bg||mg(r.prototype))||vg(r)&&null===(r=r[Ig]))&&(r=void 0),r===Bg||void 0===r))return Ag(o,a,c);for(n=new(void 0===r?Bg:r)(Tg(c-a,0)),i=0;a1?arguments[1]:void 0)}});var Og=Vi,Rg=Math.floor,Pg=function(e,t){var r=e.length;if(r<8)for(var n,i,o=1;o0;)e[i]=e[--i];i!==o++&&(e[i]=n)}else for(var s=Rg(r/2),a=Pg(Og(e,0,s),t),c=Pg(Og(e,s),t),u=a.length,l=c.length,d=0,f=0;d3)){if(Jg)return!0;if(Qg)return Qg<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)ey.push({k:t+n,v:r})}for(ey.sort((function(e,t){return t.v-e.v})),n=0;nKg(r)?1:-1}}(e)),r=Vg(i),n=0;nu-n+r;o--)_y(c,o-1)}else if(r>n)for(o=u-n;o>l;o--)a=o+r-1,(s=o+n-1)in c?c[a]=c[s]:_y(c,a);for(o=0;o2?r:Oy(t),o=new e(i);i>n;)o[n]=t[n++];return o},Py=i,My=function(e,t){var r=Py[e],n=r&&r.prototype;return n&&n[t]},Uy=ii,Ly=ve,jy=z,Ny=Ry,zy=dd,Dy=Array,Fy=S(My("Array","sort"));Uy({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&Ly(e);var t=jy(this),r=Ny(Dy,t);return Fy(r,e)}}),zy("toSorted");var qy=ii,Hy=dd,Vy=md,$y=gn,Ky=ln,Zy=z,Wy=sn,Gy=Array,Yy=Math.max,Jy=Math.min;qy({target:"Array",proto:!0},{toSpliced:function(e,t){var r,n,i,o,s=Zy(this),a=$y(s),c=Ky(e,a),u=arguments.length,l=0;for(0===u?r=n=0:1===u?(r=0,n=a-c):(r=u-2,n=Jy(Yy(Wy(t),0),a-c)),i=Vy(a+r-n),o=Gy(i);l=i||s<0)throw new am("Incorrect index");for(var a=new t(i),c=0;cr||c!=c?s*(1/0):s*c},Bm=Im,Tm=Math.fround||function(e){return Bm(e,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)},Cm=Array,Om=Math.abs,Rm=Math.pow,Pm=Math.floor,Mm=Math.log,Um=Math.LN2,Lm={pack:function(e,t,r){var n,i,o,s=Cm(r),a=8*r-t-1,c=(1<>1,l=23===t?Rm(2,-24)-Rm(2,-77):0,d=e<0||0===e&&1/e<0?1:0,f=0;for((e=Om(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(n=Pm(Mm(e)/Um),e*(o=Rm(2,-n))<1&&(n--,o*=2),(e+=n+u>=1?l/o:l*Rm(2,1-u))*o>=2&&(n++,o/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(e*o-1)*Rm(2,t),n+=u):(i=e*Rm(2,u-1)*Rm(2,t),n=0));t>=8;)s[f++]=255&i,i/=256,t-=8;for(n=n<0;)s[f++]=255&n,n/=256,a-=8;return s[f-1]|=128*d,s},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<>1,a=i-7,c=n-1,u=e[c--],l=127&u;for(u>>=7;a>0;)l=256*l+e[c--],a-=8;for(r=l&(1<<-a)-1,l>>=-a,a+=t;a>0;)r=256*r+e[c--],a-=8;if(0===l)l=1-s;else{if(l===o)return r?NaN:u?-1/0:1/0;r+=Rm(2,t),l-=s}return(u?-1:1)*r*Rm(2,l-t)}},jm=i,Nm=S,zm=a,Dm=fm,Fm=Gt,qm=Xi,Hm=pm,Vm=s,$m=mm,Km=sn,Zm=hn,Wm=_m,Gm=Tm,Ym=Lm,Jm=Qu,Xm=Vc,Qm=rf,eb=Vi,tb=Yc,rb=Fn,nb=yo,ib=Or,ob=rr.PROPER,sb=rr.CONFIGURABLE,ab="ArrayBuffer",cb="DataView",ub="prototype",lb="Wrong index",db=ib.getterFor(ab),fb=ib.getterFor(cb),hb=ib.set,pb=jm[ab],gb=pb,yb=gb&&gb[ub],mb=jm[cb],bb=mb&&mb[ub],vb=Object.prototype,wb=jm.Array,_b=jm.RangeError,Eb=Nm(Qm),Sb=Nm([].reverse),kb=Ym.pack,Ab=Ym.unpack,xb=function(e){return[255&e]},Ib=function(e){return[255&e,e>>8&255]},Bb=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Tb=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Cb=function(e){return kb(Gm(e),23,4)},Ob=function(e){return kb(e,52,8)},Rb=function(e,t,r){qm(e[ub],t,{configurable:!0,get:function(){return r(this)[t]}})},Pb=function(e,t,r,n){var i=fb(e),o=Wm(r),s=!!n;if(o+t>i.byteLength)throw new _b(lb);var a=i.bytes,c=o+i.byteOffset,u=eb(a,c,c+t);return s?u:Sb(u)},Mb=function(e,t,r,n,i,o){var s=fb(e),a=Wm(r),c=n(+i),u=!!o;if(a+t>s.byteLength)throw new _b(lb);for(var l=s.bytes,d=a+s.byteOffset,f=0;f>24)},setUint8:function(e,t){jb(this,e,t<<24>>24)}},{unsafe:!0})}else gb=function(e){$m(this,yb);var t=Wm(e);hb(this,{type:ab,bytes:Eb(wb(t),0),byteLength:t}),zm||(this.byteLength=t,this.detached=!1)},yb=gb[ub],mb=function(e,t,r){$m(this,bb),$m(e,yb);var n=db(e),i=n.byteLength,o=Km(t);if(o<0||o>i)throw new _b("Wrong offset");if(o+(r=void 0===r?i-o:Zm(r))>i)throw new _b("Wrong length");hb(this,{type:cb,buffer:e,byteLength:r,byteOffset:o,bytes:n.bytes}),zm||(this.buffer=e,this.byteLength=r,this.byteOffset=o)},bb=mb[ub],zm&&(Rb(gb,"byteLength",db),Rb(mb,"buffer",fb),Rb(mb,"byteLength",fb),Rb(mb,"byteOffset",fb)),Hm(bb,{getInt8:function(e){return Pb(this,1,e)[0]<<24>>24},getUint8:function(e){return Pb(this,1,e)[0]},getInt16:function(e){var t=Pb(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Pb(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return Tb(Pb(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return Tb(Pb(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return Ab(Pb(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return Ab(Pb(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){Mb(this,1,e,xb,t)},setUint8:function(e,t){Mb(this,1,e,xb,t)},setInt16:function(e,t){Mb(this,2,e,Ib,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){Mb(this,2,e,Ib,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){Mb(this,4,e,Bb,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){Mb(this,4,e,Bb,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){Mb(this,4,e,Cb,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){Mb(this,8,e,Ob,t,arguments.length>2&&arguments[2])}});nb(gb,ab),nb(mb,cb);var Nb={ArrayBuffer:gb,DataView:mb},zb=dy,Db="ArrayBuffer",Fb=Nb[Db];ii({global:!0,constructor:!0,forced:i[Db]!==Fb},{ArrayBuffer:Fb}),zb(Db);var qb,Hb,Vb,$b=fm,Kb=a,Zb=i,Wb=F,Gb=H,Yb=He,Jb=hi,Xb=ge,Qb=Gt,ev=Qr,tv=Xi,rv=Z,nv=Qu,iv=Vc,ov=nt,sv=We,av=Or.enforce,cv=Or.get,uv=Zb.Int8Array,lv=uv&&uv.prototype,dv=Zb.Uint8ClampedArray,fv=dv&&dv.prototype,hv=uv&&nv(uv),pv=lv&&nv(lv),gv=Object.prototype,yv=Zb.TypeError,mv=ov("toStringTag"),bv=sv("TYPED_ARRAY_TAG"),vv="TypedArrayConstructor",wv=$b&&!!iv&&"Opera"!==Jb(Zb.opera),_v=!1,Ev={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Sv={BigInt64Array:8,BigUint64Array:8},kv=function(e){var t=nv(e);if(Gb(t)){var r=cv(t);return r&&Yb(r,vv)?r[vv]:kv(t)}},Av=function(e){if(!Gb(e))return!1;var t=Jb(e);return Yb(Ev,t)||Yb(Sv,t)};for(qb in Ev)(Vb=(Hb=Zb[qb])&&Hb.prototype)?av(Vb)[vv]=Hb:wv=!1;for(qb in Sv)(Vb=(Hb=Zb[qb])&&Hb.prototype)&&(av(Vb)[vv]=Hb);if((!wv||!Wb(hv)||hv===Function.prototype)&&(hv=function(){throw new yv("Incorrect invocation")},wv))for(qb in Ev)Zb[qb]&&iv(Zb[qb],hv);if((!wv||!pv||pv===gv)&&(pv=hv.prototype,wv))for(qb in Ev)Zb[qb]&&iv(Zb[qb].prototype,pv);if(wv&&nv(fv)!==pv&&iv(fv,pv),Kb&&!Yb(pv,mv))for(qb in _v=!0,tv(pv,mv,{configurable:!0,get:function(){return Gb(this)?this[bv]:void 0}}),Ev)Zb[qb]&&Qb(Zb[qb],bv,qb);var xv={NATIVE_ARRAY_BUFFER_VIEWS:wv,TYPED_ARRAY_TAG:_v&&bv,aTypedArray:function(e){if(Av(e))return e;throw new yv("Target is not a typed array")},aTypedArrayConstructor:function(e){if(Wb(e)&&(!iv||rv(hv,e)))return e;throw new yv(Xb(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(Kb){if(r)for(var i in Ev){var o=Zb[i];if(o&&Yb(o.prototype,e))try{delete o.prototype[e]}catch(r){try{o.prototype[e]=t}catch(e){}}}pv[e]&&!r||ev(pv,e,r?t:wv&&lv[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(Kb){if(iv){if(r)for(n in Ev)if((i=Zb[n])&&Yb(i,e))try{delete i[e]}catch(e){}if(hv[e]&&!r)return;try{return ev(hv,e,r?t:wv&&hv[e]||t)}catch(e){}}for(n in Ev)!(i=Zb[n])||i[e]&&!r||ev(i,e,t)}},getTypedArrayConstructor:kv,isView:function(e){if(!Gb(e))return!1;var t=Jb(e);return"DataView"===t||Yb(Ev,t)||Yb(Sv,t)},isTypedArray:Av,TypedArray:hv,TypedArrayPrototype:pv};ii({target:"ArrayBuffer",stat:!0,forced:!xv.NATIVE_ARRAY_BUFFER_VIEWS},{isView:xv.isView});var Iv=ii,Bv=vo,Tv=s,Cv=Ut,Ov=ln,Rv=hn,Pv=Nb.ArrayBuffer,Mv=Nb.DataView,Uv=Mv.prototype,Lv=Bv(Pv.prototype.slice),jv=Bv(Uv.getUint8),Nv=Bv(Uv.setUint8);Iv({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Tv((function(){return!new Pv(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(Lv&&void 0===t)return Lv(Cv(this),e);for(var r=Cv(this).byteLength,n=Ov(e,r),i=Ov(void 0===t?r:t,r),o=new Pv(Rv(i-n)),s=new Mv(this),a=new Mv(o),c=0;n92||"NODE"===hw&&fw>94||"BROWSER"===hw&&fw>97)return!1;var e=new ArrayBuffer(8),t=pw(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength})),yw=i,mw=lw,bw=gw,vw=yw.structuredClone,ww=yw.ArrayBuffer,_w=yw.MessageChannel,Ew=!1;if(bw)Ew=function(e){vw(e,{transfer:[e]})};else if(ww)try{_w||(tw=mw("worker_threads"))&&(_w=tw.MessageChannel),_w&&(rw=new _w,nw=new ww(2),iw=function(e){rw.port1.postMessage(null,[e])},2===nw.byteLength&&(iw(nw),0===nw.byteLength&&(Ew=iw)))}catch($Ue){}var Sw=Ew,kw=i,Aw=S,xw=Pc,Iw=_m,Bw=aw,Tw=Vv,Cw=Sw,Ow=gw,Rw=kw.structuredClone,Pw=kw.ArrayBuffer,Mw=kw.DataView,Uw=Math.min,Lw=Pw.prototype,jw=Mw.prototype,Nw=Aw(Lw.slice),zw=xw(Lw,"resizable","get"),Dw=xw(Lw,"maxByteLength","get"),Fw=Aw(jw.getInt8),qw=Aw(jw.setInt8),Hw=(Ow||Cw)&&function(e,t,r){var n,i=Tw(e),o=void 0===t?i:Iw(t),s=!zw||!zw(e);if(Bw(e),Ow&&(e=Rw(e,{transfer:[e]}),i===o&&(r||s)))return e;if(i>=o&&(!r||s))n=Nw(e,0,o);else{var a=r&&!s&&Dw?{maxByteLength:Dw(e)}:void 0;n=new Pw(o,a);for(var c=new Mw(e),u=new Mw(n),l=Uw(o,i),d=0;d=0&&t<=99?t+1900:t)}}),ii({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString});var o_=sn,s_=yi,a_=L,c_=RangeError,u_=function(e){var t=s_(a_(this)),r="",n=o_(e);if(n<0||n===1/0)throw new c_("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},l_=S,d_=hn,f_=yi,h_=L,p_=l_(u_),g_=l_("".slice),y_=Math.ceil,m_=function(e){return function(t,r,n){var i,o,s=f_(h_(t)),a=d_(r),c=s.length,u=void 0===n?" ":f_(n);return a<=c||""===u?s:((o=p_(u,y_((i=a-c)/u.length))).length>i&&(o=g_(o,0,i)),e?s+o:o+s)}},b_={start:m_(!1),end:m_(!0)},v_=S,w_=s,__=b_.start,E_=RangeError,S_=isFinite,k_=Math.abs,A_=Date.prototype,x_=A_.toISOString,I_=v_(A_.getTime),B_=v_(A_.getUTCDate),T_=v_(A_.getUTCFullYear),C_=v_(A_.getUTCHours),O_=v_(A_.getUTCMilliseconds),R_=v_(A_.getUTCMinutes),P_=v_(A_.getUTCMonth),M_=v_(A_.getUTCSeconds),U_=w_((function(){return"0385-07-25T07:06:39.999Z"!==x_.call(new Date(-50000000000001))}))||!w_((function(){x_.call(new Date(NaN))}))?function(){if(!S_(I_(this)))throw new E_("Invalid time value");var e=this,t=T_(e),r=O_(e),n=t<0?"-":t>9999?"+":"";return n+__(k_(t),n?6:4,0)+"-"+__(P_(e)+1,2,0)+"-"+__(B_(e),2,0)+"T"+__(C_(e),2,0)+":"+__(R_(e),2,0)+":"+__(M_(e),2,0)+"."+__(r,3,0)+"Z"}:x_,L_=U_;ii({target:"Date",proto:!0,forced:Date.prototype.toISOString!==L_},{toISOString:L_});var j_=De,N_=dt;ii({target:"Date",proto:!0,arity:1,forced:s((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=j_(this),r=N_(t,"number");return"number"!=typeof r||isFinite(r)?t.toISOString():null}});var z_=Ut,D_=Ie,F_=TypeError,q_=He,H_=Qr,V_=function(e){if(z_(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw new F_("Incorrect hint");return D_(this,e)},$_=nt("toPrimitive"),K_=Date.prototype;q_(K_,$_)||H_(K_,$_,V_);var Z_=S,W_=Qr,G_=Date.prototype,Y_="Invalid Date",J_="toString",X_=Z_(G_[J_]),Q_=Z_(G_.getTime);String(new Date(NaN))!==Y_&&W_(G_,J_,(function(){var e=Q_(this);return e==e?X_(this):Y_}));var eE=ii,tE=S,rE=yi,nE=tE("".charAt),iE=tE("".charCodeAt),oE=tE(/./.exec),sE=tE(1..toString),aE=tE("".toUpperCase),cE=/[\w*+\-./@]/,uE=function(e,t){for(var r=sE(e,16);r.length1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),LA(o,r?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),VA&&UA(o,"size",{configurable:!0,get:function(){return s(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=ZA(t),o=ZA(n);FA(e,t,(function(e,t){KA(this,{type:n,target:e,state:i(e),kind:t,last:null})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?qA("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=null,qA(void 0,!0))}),r?"entries":"values",!r,!0),HA(t)}};PA("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),WA);var GA=S,YA=Map.prototype,JA={Map:Map,set:GA(YA.set),get:GA(YA.get),has:GA(YA.has),remove:GA(YA.delete),proto:YA},XA=ii,QA=ve,ex=L,tx=Ul,rx=s,nx=JA.Map,ix=JA.has,ox=JA.get,sx=JA.set,ax=S([].push),cx=rx((function(){return 1!==nx.groupBy("ab",(function(e){return e})).get("a").length}));XA({target:"Map",stat:!0,forced:cx},{groupBy:function(e,t){ex(e),QA(t);var r=new nx,n=0;return tx(e,(function(e){var i=t(e,n++);ix(r,i)?ax(ox(r,i),e):sx(r,i,[e])})),r}});var ux=Math.log,lx=Math.log1p||function(e){var t=+e;return t>-1e-8&&t<1e-8?t-t*t/2:ux(1+t)},dx=ii,fx=lx,hx=Math.acosh,px=Math.log,gx=Math.sqrt,yx=Math.LN2;dx({target:"Math",stat:!0,forced:!hx||710!==Math.floor(hx(Number.MAX_VALUE))||hx(1/0)!==1/0},{acosh:function(e){var t=+e;return t<1?NaN:t>94906265.62425156?px(t)+yx:fx(t-1+gx(t-1)*gx(t+1))}});var mx=ii,bx=Math.asinh,vx=Math.log,wx=Math.sqrt;mx({target:"Math",stat:!0,forced:!(bx&&1/bx(0)>0)},{asinh:function e(t){var r=+t;return isFinite(r)&&0!==r?r<0?-e(-r):vx(r+wx(r*r+1)):r}});var _x=ii,Ex=Math.atanh,Sx=Math.log;_x({target:"Math",stat:!0,forced:!(Ex&&1/Ex(-0)<0)},{atanh:function(e){var t=+e;return 0===t?t:Sx((1+t)/(1-t))/2}});var kx=ii,Ax=Em,xx=Math.abs,Ix=Math.pow;kx({target:"Math",stat:!0},{cbrt:function(e){var t=+e;return Ax(t)*Ix(xx(t),1/3)}});var Bx=ii,Tx=Math.floor,Cx=Math.log,Ox=Math.LOG2E;Bx({target:"Math",stat:!0},{clz32:function(e){var t=e>>>0;return t?31-Tx(Cx(t+.5)*Ox):32}});var Rx=Math.expm1,Px=Math.exp,Mx=!Rx||Rx(10)>22025.465794806718||Rx(10)<22025.465794806718||-2e-17!==Rx(-2e-17)?function(e){var t=+e;return 0===t?t:t>-1e-6&&t<1e-6?t+t*t/2:Px(t)-1}:Rx,Ux=ii,Lx=Mx,jx=Math.cosh,Nx=Math.abs,zx=Math.E;Ux({target:"Math",stat:!0,forced:!jx||jx(710)===1/0},{cosh:function(e){var t=Lx(Nx(e)-1)+1;return(t+1/(t*zx*zx))*(zx/2)}});var Dx=Mx;ii({target:"Math",stat:!0,forced:Dx!==Math.expm1},{expm1:Dx}),ii({target:"Math",stat:!0},{fround:Tm});var Fx=ii,qx=Math.hypot,Hx=Math.abs,Vx=Math.sqrt;Fx({target:"Math",stat:!0,arity:2,forced:!!qx&&qx(1/0,NaN)!==1/0},{hypot:function(e,t){for(var r,n,i=0,o=0,s=arguments.length,a=0;o0?(n=r/a)*n:r;return a===1/0?1/0:a*Vx(i)}});var $x=ii,Kx=s,Zx=Math.imul;$x({target:"Math",stat:!0,forced:Kx((function(){return-5!==Zx(4294967295,5)||2!==Zx.length}))},{imul:function(e,t){var r=65535,n=+e,i=+t,o=r&n,s=r&i;return 0|o*s+((r&n>>>16)*s+o*(r&i>>>16)<<16>>>0)}});var Wx=Math.log,Gx=Math.LOG10E,Yx=Math.log10||function(e){return Wx(e)*Gx};ii({target:"Math",stat:!0},{log10:Yx}),ii({target:"Math",stat:!0},{log1p:lx});var Jx=ii,Xx=Math.log,Qx=Math.LN2;Jx({target:"Math",stat:!0},{log2:function(e){return Xx(e)/Qx}}),ii({target:"Math",stat:!0},{sign:Em});var eI=ii,tI=s,rI=Mx,nI=Math.abs,iI=Math.exp,oI=Math.E;eI({target:"Math",stat:!0,forced:tI((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(e){var t=+e;return nI(t)<1?(rI(t)-rI(-t))/2:(iI(t-1)-iI(-t-1))*(oI/2)}});var sI=ii,aI=Mx,cI=Math.exp;sI({target:"Math",stat:!0},{tanh:function(e){var t=+e,r=aI(t),n=aI(-t);return r===1/0?1:n===1/0?-1:(r-n)/(cI(t)+cI(-t))}}),yo(Math,"Math",!0),ii({target:"Math",stat:!0},{trunc:nn});var uI=S(1..valueOf),lI="\t\n\v\f\r                 \u2028\u2029\ufeff",dI=L,fI=yi,hI=lI,pI=S("".replace),gI=RegExp("^["+hI+"]+"),yI=RegExp("(^|[^"+hI+"])["+hI+"]+$"),mI=function(e){return function(t){var r=fI(dI(t));return 1&e&&(r=pI(r,gI,"")),2&e&&(r=pI(r,yI,"$1")),r}},bI={start:mI(1),end:mI(2),trim:mI(3)},vI=ii,wI=a,_I=i,EI=to,SI=S,kI=Yn,AI=He,xI=Yc,II=Z,BI=he,TI=dt,CI=s,OI=en.f,RI=o.f,PI=Ct.f,MI=uI,UI=bI.trim,LI="Number",jI=_I[LI];EI[LI];var NI=jI.prototype,zI=_I.TypeError,DI=SI("".slice),FI=SI("".charCodeAt),qI=function(e){var t,r,n,i,o,s,a,c,u=TI(e,"number");if(BI(u))throw new zI("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=UI(u),43===(t=FI(u,0))||45===t){if(88===(r=FI(u,2))||120===r)return NaN}else if(48===t){switch(FI(u,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(s=(o=DI(u,2)).length,a=0;ai)return NaN;return parseInt(o,n)}return+u},HI=kI(LI,!jI(" 0o1")||!jI("0b1")||jI("+0x1")),VI=function(e){var t,r=arguments.length<1?0:jI(function(e){var t=TI(e,"number");return"bigint"==typeof t?t:qI(t)}(e));return II(NI,t=this)&&CI((function(){MI(t)}))?xI(Object(r),this,VI):r};VI.prototype=NI,HI&&(NI.constructor=VI),vI({global:!0,constructor:!0,wrap:!0,forced:HI},{Number:VI}),HI&&function(e,t){for(var r,n=wI?OI(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;n.length>i;i++)AI(t,r=n[i])&&!AI(e,r)&&PI(e,r,RI(t,r))}(EI[LI],jI),ii({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)});var $I=i.isFinite,KI=Number.isFinite||function(e){return"number"==typeof e&&$I(e)};ii({target:"Number",stat:!0},{isFinite:KI});var ZI=H,WI=Math.floor,GI=Number.isInteger||function(e){return!ZI(e)&&isFinite(e)&&WI(e)===e};ii({target:"Number",stat:!0},{isInteger:GI}),ii({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var YI=ii,JI=GI,XI=Math.abs;YI({target:"Number",stat:!0},{isSafeInteger:function(e){return JI(e)&&XI(e)<=9007199254740991}}),ii({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991}),ii({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991});var QI=i,eB=s,tB=yi,rB=bI.trim,nB=lI,iB=S("".charAt),oB=QI.parseFloat,sB=QI.Symbol,aB=sB&&sB.iterator,cB=1/oB(nB+"-0")!=-1/0||aB&&!eB((function(){oB(Object(aB))}))?function(e){var t=rB(tB(e)),r=oB(t);return 0===r&&"-"===iB(t,0)?-0:r}:oB,uB=cB;ii({target:"Number",stat:!0,forced:Number.parseFloat!==uB},{parseFloat:uB});var lB=i,dB=s,fB=S,hB=yi,pB=bI.trim,gB=lI,yB=lB.parseInt,mB=lB.Symbol,bB=mB&&mB.iterator,vB=/^[+-]?0x/i,wB=fB(vB.exec),_B=8!==yB(gB+"08")||22!==yB(gB+"0x16")||bB&&!dB((function(){yB(Object(bB))}))?function(e,t){var r=pB(hB(e));return yB(r,t>>>0||(wB(vB,r)?16:10))}:yB,EB=_B;ii({target:"Number",stat:!0,forced:Number.parseInt!==EB},{parseInt:EB});var SB=ii,kB=S,AB=sn,xB=uI,IB=u_,BB=Yx,TB=s,CB=RangeError,OB=String,RB=isFinite,PB=Math.abs,MB=Math.floor,UB=Math.pow,LB=Math.round,jB=kB(1..toExponential),NB=kB(IB),zB=kB("".slice),DB="-6.9000e-11"===jB(-69e-12,4)&&"1.25e+0"===jB(1.255,2)&&"1.235e+4"===jB(12345,3)&&"3e+1"===jB(25,0);SB({target:"Number",proto:!0,forced:!DB||!(TB((function(){jB(1,1/0)}))&&TB((function(){jB(1,-1/0)})))||!!TB((function(){jB(1/0,1/0),jB(NaN,1/0)}))},{toExponential:function(e){var t=xB(this);if(void 0===e)return jB(t);var r=AB(e);if(!RB(t))return String(t);if(r<0||r>20)throw new CB("Incorrect fraction digits");if(DB)return jB(t,r);var n,i,o,s,a="";if(t<0&&(a="-",t=-t),0===t)i=0,n=NB("0",r+1);else{var c=BB(t);i=MB(c);var u=UB(10,i-r),l=LB(t/u);2*t>=(2*l+1)*u&&(l+=1),l>=UB(10,r+1)&&(l/=10,i+=1),n=OB(l)}return 0!==r&&(n=zB(n,0,1)+"."+zB(n,1)),0===i?(o="+",s="0"):(o=i>0?"+":"-",s=OB(PB(i))),a+(n+="e"+o+s)}});var FB=ii,qB=S,HB=sn,VB=uI,$B=u_,KB=s,ZB=RangeError,WB=String,GB=Math.floor,YB=qB($B),JB=qB("".slice),XB=qB(1..toFixed),QB=function(e,t,r){return 0===t?r:t%2==1?QB(e,t-1,r*e):QB(e*e,t/2,r)},eT=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=GB(i/1e7)},tT=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=GB(n/t),n=n%t*1e7},rT=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=WB(e[t]);r=""===r?n:r+YB("0",7-n.length)+n}return r};FB({target:"Number",proto:!0,forced:KB((function(){return"0.000"!==XB(8e-5,3)||"1"!==XB(.9,0)||"1.25"!==XB(1.255,2)||"1000000000000000128"!==XB(0xde0b6b3a7640080,0)}))||!KB((function(){XB({})}))},{toFixed:function(e){var t,r,n,i,o=VB(this),s=HB(e),a=[0,0,0,0,0,0],c="",u="0";if(s<0||s>20)throw new ZB("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return WB(o);if(o<0&&(c="-",o=-o),o>1e-21)if(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(o*QB(2,69,1))-69,r=t<0?o*QB(2,-t,1):o/QB(2,t,1),r*=4503599627370496,(t=52-t)>0){for(eT(a,0,r),n=s;n>=7;)eT(a,1e7,0),n-=7;for(eT(a,QB(10,n,1),0),n=t-1;n>=23;)tT(a,1<<23),n-=23;tT(a,1<0?c+((i=u.length)<=s?"0."+YB("0",s-i)+u:JB(u,0,i-s)+"."+JB(u,i-s)):c+u}});var nT=ii,iT=s,oT=uI,sT=S(1..toPrecision);nT({target:"Number",proto:!0,forced:iT((function(){return"1"!==sT(1,void 0)}))||!iT((function(){sT({})}))},{toPrecision:function(e){return void 0===e?sT(oT(this)):sT(oT(this),e)}});var aT=a,cT=S,uT=d,lT=s,dT=wi,fT=Cn,hT=f,pT=De,gT=R,yT=Object.assign,mT=Object.defineProperty,bT=cT([].concat),vT=!yT||lT((function(){if(aT&&1!==yT({b:1},yT(mT({},"a",{enumerable:!0,get:function(){mT(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!==yT({},e)[r]||dT(yT({},t)).join("")!==n}))?function(e,t){for(var r=pT(e),n=arguments.length,i=1,o=fT.f,s=hT.f;n>i;)for(var a,c=gT(arguments[i++]),u=o?bT(dT(c),o(c)):dT(c),l=u.length,d=0;l>d;)a=u[d++],aT&&!uT(s,c,a)||(r[a]=c[a]);return r}:yT,wT=vT;ii({target:"Object",stat:!0,arity:2,forced:Object.assign!==wT},{assign:wT}),ii({target:"Object",stat:!0,sham:!a},{create:qi});var _T=i,ET=zg,ST=!s((function(){if(!(ET&&ET<535)){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete _T[e]}})),kT=ve,AT=De,xT=Ct;a&&ii({target:"Object",proto:!0,forced:ST},{__defineGetter__:function(e,t){xT.f(AT(this),e,{get:kT(t),enumerable:!0,configurable:!0})}});var IT=ii,BT=a,TT=mi.f;IT({target:"Object",stat:!0,forced:Object.defineProperties!==TT,sham:!BT},{defineProperties:TT});var CT=ii,OT=a,RT=Ct.f;CT({target:"Object",stat:!0,forced:Object.defineProperty!==RT,sham:!OT},{defineProperty:RT});var PT=ve,MT=De,UT=Ct;a&&ii({target:"Object",proto:!0,forced:ST},{__defineSetter__:function(e,t){UT.f(MT(this),e,{set:PT(t),enumerable:!0,configurable:!0})}});var LT=a,jT=s,NT=S,zT=Qu,DT=wi,FT=z,qT=NT(f.f),HT=NT([].push),VT=LT&&jT((function(){var e=Object.create(null);return e[2]=2,!qT(e,2)})),$T=function(e){return function(t){for(var r,n=FT(t),i=DT(n),o=VT&&null===zT(n),s=i.length,a=0,c=[];s>a;)r=i[a++],LT&&!(o?r in n:qT(n,r))||HT(c,e?[r,n[r]]:n[r]);return c}},KT={entries:$T(!0),values:$T(!1)},ZT=KT.entries;ii({target:"Object",stat:!0},{entries:function(e){return ZT(e)}});var WT=ii,GT=rA,YT=s,JT=H,XT=Wk.exports.onFreeze,QT=Object.freeze;WT({target:"Object",stat:!0,forced:YT((function(){QT(1)})),sham:!GT},{freeze:function(e){return QT&&JT(e)?QT(XT(e)):e}});var eC=Ul,tC=_d;ii({target:"Object",stat:!0},{fromEntries:function(e){var t={};return eC(e,(function(e,r){tC(t,e,r)}),{AS_ENTRIES:!0}),t}});var rC=ii,nC=s,iC=z,oC=o.f,sC=a;rC({target:"Object",stat:!0,forced:!sC||nC((function(){oC(1)})),sham:!sC},{getOwnPropertyDescriptor:function(e,t){return oC(iC(e),t)}});var aC=Ln,cC=z,uC=o,lC=_d;ii({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(e){for(var t,r,n=cC(e),i=uC.f,o=aC(n),s={},a=0;o.length>a;)void 0!==(r=i(n,t=o[a++]))&&lC(s,t,r);return s}});var dC=ii,fC=s,hC=Hi.f;dC({target:"Object",stat:!0,forced:fC((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:hC});var pC=De,gC=Qu,yC=$u;ii({target:"Object",stat:!0,forced:s((function(){gC(1)})),sham:!yC},{getPrototypeOf:function(e){return gC(pC(e))}});var mC=ii,bC=K,vC=S,wC=ve,_C=L,EC=pt,SC=Ul,kC=s,AC=Object.groupBy,xC=bC("Object","create"),IC=vC([].push),BC=!AC||kC((function(){return 1!==AC("ab",(function(e){return e})).a.length}));mC({target:"Object",stat:!0,forced:BC},{groupBy:function(e,t){_C(e),wC(t);var r=xC(null),n=0;return SC(e,(function(e){var i=EC(t(e,n++));i in r?IC(r[i],e):r[i]=[e]})),r}}),ii({target:"Object",stat:!0},{hasOwn:He});var TC=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};ii({target:"Object",stat:!0},{is:TC});var CC=tA;ii({target:"Object",stat:!0,forced:Object.isExtensible!==CC},{isExtensible:CC});var OC=ii,RC=s,PC=H,MC=I,UC=Gk,LC=Object.isFrozen;OC({target:"Object",stat:!0,forced:UC||RC((function(){LC(1)}))},{isFrozen:function(e){return!PC(e)||!(!UC||"ArrayBuffer"!==MC(e))||!!LC&&LC(e)}});var jC=ii,NC=s,zC=H,DC=I,FC=Gk,qC=Object.isSealed;jC({target:"Object",stat:!0,forced:FC||NC((function(){qC(1)}))},{isSealed:function(e){return!zC(e)||!(!FC||"ArrayBuffer"!==DC(e))||!!qC&&qC(e)}});var HC=De,VC=wi;ii({target:"Object",stat:!0,forced:s((function(){VC(1)}))},{keys:function(e){return VC(HC(e))}});var $C=ii,KC=a,ZC=ST,WC=De,GC=pt,YC=Qu,JC=o.f;KC&&$C({target:"Object",proto:!0,forced:ZC},{__lookupGetter__:function(e){var t,r=WC(this),n=GC(e);do{if(t=JC(r,n))return t.get}while(r=YC(r))}});var XC=ii,QC=a,eO=ST,tO=De,rO=pt,nO=Qu,iO=o.f;QC&&XC({target:"Object",proto:!0,forced:eO},{__lookupSetter__:function(e){var t,r=tO(this),n=rO(e);do{if(t=iO(r,n))return t.set}while(r=nO(r))}});var oO=ii,sO=H,aO=Wk.exports.onFreeze,cO=rA,uO=s,lO=Object.preventExtensions;oO({target:"Object",stat:!0,forced:uO((function(){lO(1)})),sham:!cO},{preventExtensions:function(e){return lO&&sO(e)?lO(aO(e)):e}});var dO=a,fO=Xi,hO=H,pO=Uc,gO=De,yO=L,mO=Object.getPrototypeOf,bO=Object.setPrototypeOf,vO=Object.prototype,wO="__proto__";if(dO&&mO&&bO&&!(wO in vO))try{fO(vO,wO,{configurable:!0,get:function(){return mO(gO(this))},set:function(e){var t=yO(this);pO(e)&&hO(t)&&bO(t,e)}})}catch($Ue){}var _O=ii,EO=H,SO=Wk.exports.onFreeze,kO=rA,AO=s,xO=Object.seal;_O({target:"Object",stat:!0,forced:AO((function(){xO(1)})),sham:!kO},{seal:function(e){return xO&&EO(e)?xO(SO(e)):e}}),ii({target:"Object",stat:!0},{setPrototypeOf:Vc});var IO=hi,BO=si?{}.toString:function(){return"[object "+IO(this)+"]"};si||Qr(Object.prototype,"toString",BO,{unsafe:!0});var TO=KT.values;ii({target:"Object",stat:!0},{values:function(e){return TO(e)}}),ii({global:!0,forced:parseFloat!==cB},{parseFloat:cB}),ii({global:!0,forced:parseInt!==_B},{parseInt:_B});var CO,OO,RO,PO,MO=No,UO=ge,LO=TypeError,jO=function(e){if(MO(e))return e;throw new LO(UO(e)+" is not a constructor")},NO=Ut,zO=jO,DO=P,FO=nt("species"),qO=function(e,t){var r,n=NO(e).constructor;return void 0===n||DO(r=NO(n)[FO])?t:zO(r)},HO=TypeError,VO=function(e,t){if(e1?uU(arguments,1):[],r=lU.f(this),n=fU((function(){return cU(dU(e),void 0,t)}));return(n.error?r.reject:r.resolve)(n.value),r.promise}});var gU=dP;ii({target:"Promise",stat:!0},{withResolvers:function(){var e=gU.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var yU=Ta,mU=ve,bU=Ut;ii({target:"Reflect",stat:!0,forced:!s((function(){Reflect.apply((function(){}))}))},{apply:function(e,t,r){return yU(mU(e),t,bU(r))}});var vU=ii,wU=Ta,_U=wE,EU=jO,SU=Ut,kU=H,AU=qi,xU=s,IU=K("Reflect","construct"),BU=Object.prototype,TU=[].push,CU=xU((function(){function e(){}return!(IU((function(){}),[],e)instanceof e)})),OU=!xU((function(){IU((function(){}))})),RU=CU||OU;vU({target:"Reflect",stat:!0,forced:RU,sham:RU},{construct:function(e,t){EU(e),SU(t);var r=arguments.length<3?e:EU(arguments[2]);if(OU&&!CU)return IU(e,t,r);if(e===r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return wU(TU,n,t),new(wU(_U,e,n))}var i=r.prototype,o=AU(kU(i)?i:BU),s=wU(e,o,t);return kU(s)?s:o}});var PU=a,MU=Ut,UU=pt,LU=Ct;ii({target:"Reflect",stat:!0,forced:s((function(){Reflect.defineProperty(LU.f({},1,{value:1}),1,{value:2})})),sham:!PU},{defineProperty:function(e,t,r){MU(e);var n=UU(t);MU(r);try{return LU.f(e,n,r),!0}catch(e){return!1}}});var jU=ii,NU=Ut,zU=o.f;jU({target:"Reflect",stat:!0},{deleteProperty:function(e,t){var r=zU(NU(e),t);return!(r&&!r.configurable)&&delete e[t]}});var DU=He,FU=function(e){return void 0!==e&&(DU(e,"value")||DU(e,"writable"))},qU=d,HU=H,VU=Ut,$U=FU,KU=o,ZU=Qu;ii({target:"Reflect",stat:!0},{get:function e(t,r){var n,i,o=arguments.length<3?t:arguments[2];return VU(t)===o?t[r]:(n=KU.f(t,r))?$U(n)?n.value:void 0===n.get?void 0:qU(n.get,o):HU(i=ZU(t))?e(i,r,o):void 0}});var WU=Ut,GU=o;ii({target:"Reflect",stat:!0,sham:!a},{getOwnPropertyDescriptor:function(e,t){return GU.f(WU(e),t)}});var YU=Ut,JU=Qu;ii({target:"Reflect",stat:!0,sham:!$u},{getPrototypeOf:function(e){return JU(YU(e))}}),ii({target:"Reflect",stat:!0},{has:function(e,t){return t in e}});var XU=Ut,QU=tA;ii({target:"Reflect",stat:!0},{isExtensible:function(e){return XU(e),QU(e)}}),ii({target:"Reflect",stat:!0},{ownKeys:Ln});var eL=K,tL=Ut;ii({target:"Reflect",stat:!0,sham:!rA},{preventExtensions:function(e){tL(e);try{var t=eL("Object","preventExtensions");return t&&t(e),!0}catch(e){return!1}}});var rL=ii,nL=d,iL=Ut,oL=H,sL=FU,aL=Ct,cL=o,uL=Qu,lL=b,dL=s((function(){var e=function(){},t=aL.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)}));rL({target:"Reflect",stat:!0,forced:dL},{set:function e(t,r,n){var i,o,s,a=arguments.length<4?t:arguments[3],c=cL.f(iL(t),r);if(!c){if(oL(o=uL(t)))return e(o,r,n,a);c=lL(0)}if(sL(c)){if(!1===c.writable||!oL(a))return!1;if(i=cL.f(a,r)){if(i.get||i.set||!1===i.writable)return!1;i.value=n,aL.f(a,r,i)}else aL.f(a,r,lL(0,n))}else{if(void 0===(s=c.set))return!1;nL(s,a,n)}return!0}});var fL=Ut,hL=zc,pL=Vc;pL&&ii({target:"Reflect",stat:!0},{setPrototypeOf:function(e,t){fL(e),hL(t);try{return pL(e,t),!0}catch(e){return!1}}});var gL=i,yL=yo;ii({global:!0},{Reflect:{}}),yL(gL.Reflect,"Reflect",!0);var mL=H,bL=I,vL=nt("match"),wL=function(e){var t;return mL(e)&&(void 0!==(t=e[vL])?!!t:"RegExp"===bL(e))},_L=Ut,EL=function(){var e=_L(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},SL=d,kL=He,AL=Z,xL=EL,IL=RegExp.prototype,BL=function(e){var t=e.flags;return void 0!==t||"flags"in IL||kL(e,"flags")||!AL(IL,e)?t:SL(xL,e)},TL=s,CL=i.RegExp,OL=TL((function(){var e=CL("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),RL=OL||TL((function(){return!CL("a","y").sticky})),PL=OL||TL((function(){var e=CL("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),ML={BROKEN_CARET:PL,MISSED_STICKY:RL,UNSUPPORTED_Y:OL},UL=s,LL=i.RegExp,jL=UL((function(){var e=LL(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)})),NL=s,zL=i.RegExp,DL=NL((function(){var e=zL("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})),FL=a,qL=i,HL=S,VL=Yn,$L=Yc,KL=Gt,ZL=qi,WL=en.f,GL=Z,YL=wL,JL=yi,XL=BL,QL=ML,ej=Kc,tj=Qr,rj=s,nj=He,ij=Or.enforce,oj=dy,sj=jL,aj=DL,cj=nt("match"),uj=qL.RegExp,lj=uj.prototype,dj=qL.SyntaxError,fj=HL(lj.exec),hj=HL("".charAt),pj=HL("".replace),gj=HL("".indexOf),yj=HL("".slice),mj=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,bj=/a/g,vj=/a/g,wj=new uj(bj)!==bj,_j=QL.MISSED_STICKY,Ej=QL.UNSUPPORTED_Y,Sj=FL&&(!wj||_j||sj||aj||rj((function(){return vj[cj]=!1,uj(bj)!==bj||uj(vj)===vj||"/a/i"!==String(uj(bj,"i"))})));if(VL("RegExp",Sj)){for(var kj=function(e,t){var r,n,i,o,s,a,c=GL(lj,this),u=YL(e),l=void 0===t,d=[],f=e;if(!c&&u&&l&&e.constructor===kj)return e;if((u||GL(lj,e))&&(e=e.source,l&&(t=XL(f))),e=void 0===e?"":JL(e),t=void 0===t?"":JL(t),f=e,sj&&"dotAll"in bj&&(n=!!t&&gj(t,"s")>-1)&&(t=pj(t,/s/g,"")),r=t,_j&&"sticky"in bj&&(i=!!t&&gj(t,"y")>-1)&&Ej&&(t=pj(t,/y/g,"")),aj&&(o=function(e){for(var t,r=e.length,n=0,i="",o=[],s=ZL(null),a=!1,c=!1,u=0,l="";n<=r;n++){if("\\"===(t=hj(e,n)))t+=hj(e,++n);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:if(i+=t,"?:"===yj(e,n+1,n+3))continue;fj(mj,yj(e,n+1))&&(n+=2,c=!0),u++;continue;case">"===t&&c:if(""===l||nj(s,l))throw new dj("Invalid capture group name");s[l]=!0,o[o.length]=[l,u],c=!1,l="";continue}c?l+=t:i+=t}return[i,o]}(e),e=o[0],d=o[1]),s=$L(uj(e,t),c?this:lj,kj),(n||i||d.length)&&(a=ij(s),n&&(a.dotAll=!0,a.raw=kj(function(e){for(var t,r=e.length,n=0,i="",o=!1;n<=r;n++)"\\"!==(t=hj(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),i+=t):i+="[\\s\\S]":i+=t+hj(e,++n);return i}(e),r)),i&&(a.sticky=!0),d.length&&(a.groups=d)),e!==f)try{KL(s,"source",""===f?"(?:)":f)}catch(e){}return s},Aj=WL(uj),xj=0;Aj.length>xj;)ej(kj,uj,Aj[xj++]);lj.constructor=kj,kj.prototype=lj,tj(qL,"RegExp",kj,{constructor:!0})}oj("RegExp");var Ij=a,Bj=jL,Tj=I,Cj=Xi,Oj=Or.get,Rj=RegExp.prototype,Pj=TypeError;Ij&&Bj&&Cj(Rj,"dotAll",{configurable:!0,get:function(){if(this!==Rj){if("RegExp"===Tj(this))return!!Oj(this).dotAll;throw new Pj("Incompatible receiver, RegExp required")}}});var Mj=d,Uj=S,Lj=yi,jj=EL,Nj=ML,zj=qi,Dj=Or.get,Fj=jL,qj=DL,Hj=je("native-string-replace",String.prototype.replace),Vj=RegExp.prototype.exec,$j=Vj,Kj=Uj("".charAt),Zj=Uj("".indexOf),Wj=Uj("".replace),Gj=Uj("".slice),Yj=function(){var e=/a/,t=/b*/g;return Mj(Vj,e,"a"),Mj(Vj,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Jj=Nj.BROKEN_CARET,Xj=void 0!==/()??/.exec("")[1];(Yj||Xj||Jj||Fj||qj)&&($j=function(e){var t,r,n,i,o,s,a,c=this,u=Dj(c),l=Lj(e),d=u.raw;if(d)return d.lastIndex=c.lastIndex,t=Mj($j,d,l),c.lastIndex=d.lastIndex,t;var f=u.groups,h=Jj&&c.sticky,p=Mj(jj,c),g=c.source,y=0,m=l;if(h&&(p=Wj(p,"y",""),-1===Zj(p,"g")&&(p+="g"),m=Gj(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Kj(l,c.lastIndex-1))&&(g="(?: "+g+")",m=" "+m,y++),r=new RegExp("^(?:"+g+")",p)),Xj&&(r=new RegExp("^"+g+"$(?!\\s)",p)),Yj&&(n=c.lastIndex),i=Mj(Vj,h?r:c,m),h?i?(i.input=Gj(i.input,y),i[0]=Gj(i[0],y),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:Yj&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),Xj&&i&&i.length>1&&Mj(Hj,i[0],r,(function(){for(o=1;or.size?xz(r.getIterator(),(function(e){Tz(t,e)&&Bz(n,e)})):Az(t,(function(e){r.includes(e)&&Bz(n,e)})),n},Oz=s,Rz=Cz;ii({target:"Set",proto:!0,real:!0,forced:!wz("intersection")||Oz((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:Rz});var Pz=LN,Mz=MN.has,Uz=JN,Lz=cz,jz=KN,Nz=NN,zz=_l,Dz=function(e){var t=Pz(this),r=Lz(e);if(Uz(t)<=r.size)return!1!==jz(t,(function(e){if(r.includes(e))return!1}),!0);var n=r.getIterator();return!1!==Nz(n,(function(e){if(Mz(t,e))return zz(n,"normal",!1)}))},Fz=Dz;ii({target:"Set",proto:!0,real:!0,forced:!wz("isDisjointFrom")},{isDisjointFrom:Fz});var qz=LN,Hz=JN,Vz=KN,$z=cz,Kz=function(e){var t=qz(this),r=$z(e);return!(Hz(t)>r.size)&&!1!==Vz(t,(function(e){if(!r.includes(e))return!1}),!0)},Zz=Kz;ii({target:"Set",proto:!0,real:!0,forced:!wz("isSubsetOf")},{isSubsetOf:Zz});var Wz=LN,Gz=MN.has,Yz=JN,Jz=cz,Xz=NN,Qz=_l,eD=function(e){var t=Wz(this),r=Jz(e);if(Yz(t)=0?n:r+n;return i<0||i>=r?void 0:SD(t,i)}});var kD=S,AD=sn,xD=yi,ID=L,BD=kD("".charAt),TD=kD("".charCodeAt),CD=kD("".slice),OD=function(e){return function(t,r){var n,i,o=xD(ID(t)),s=AD(r),a=o.length;return s<0||s>=a?e?"":void 0:(n=TD(o,s))<55296||n>56319||s+1===a||(i=TD(o,s+1))<56320||i>57343?e?BD(o,s):n:e?CD(o,s,s+2):i-56320+(n-55296<<10)+65536}},RD={codeAt:OD(!1),charAt:OD(!0)},PD=RD.codeAt;ii({target:"String",proto:!0},{codePointAt:function(e){return PD(this,e)}});var MD=wL,UD=TypeError,LD=function(e){if(MD(e))throw new UD("The method doesn't accept regular expressions");return e},jD=nt("match"),ND=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[jD]=!1,"/./"[e](t)}catch(e){}}return!1},zD=ii,DD=vo,FD=o.f,qD=hn,HD=yi,VD=LD,$D=L,KD=ND,ZD=DD("".slice),WD=Math.min,GD=KD("endsWith"),YD=!GD&&!!function(){var e=FD(String.prototype,"endsWith");return e&&!e.writable}();zD({target:"String",proto:!0,forced:!YD&&!GD},{endsWith:function(e){var t=HD($D(this));VD(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=void 0===r?n:WD(qD(r),n),o=HD(e);return ZD(t,i-o.length,i)===o}});var JD=ii,XD=S,QD=ln,eF=RangeError,tF=String.fromCharCode,rF=String.fromCodePoint,nF=XD([].join);JD({target:"String",stat:!0,arity:1,forced:!!rF&&1!==rF.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],QD(t,1114111)!==t)throw new eF(t+" is not a valid code point");r[i]=t<65536?tF(t):tF(55296+((t-=65536)>>10),t%1024+56320)}return nF(r,"")}});var iF=ii,oF=LD,sF=L,aF=yi,cF=ND,uF=S("".indexOf);iF({target:"String",proto:!0,forced:!cF("includes")},{includes:function(e){return!!~uF(aF(sF(this)),aF(oF(e)),arguments.length>1?arguments[1]:void 0)}});var lF=ii,dF=L,fF=yi,hF=S("".charCodeAt);lF({target:"String",proto:!0},{isWellFormed:function(){for(var e=fF(dF(this)),t=e.length,r=0;r=56320||++r>=t||56320!=(64512&hF(e,r))))return!1}return!0}});var pF=RD.charAt,gF=yi,yF=Or,mF=rp,bF=np,vF="String Iterator",wF=yF.set,_F=yF.getterFor(vF);mF(String,"String",(function(e){wF(this,{type:vF,string:gF(e),index:0})}),(function(){var e,t=_F(this),r=t.string,n=t.index;return n>=r.length?bF(void 0,!0):(e=pF(r,n),t.index+=e.length,bF(e,!1))}));var EF=d,SF=Qr,kF=Qj,AF=s,xF=nt,IF=Gt,BF=xF("species"),TF=RegExp.prototype,CF=function(e,t,r,n){var i=xF(e),o=!AF((function(){var t={};return t[i]=function(){return 7},7!==""[e](t)})),s=o&&!AF((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[BF]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!o||!s||r){var a=/./[i],c=t(i,""[e],(function(e,t,r,n,i){var s=t.exec;return s===kF||s===TF.exec?o&&!i?{done:!0,value:EF(a,t,r,n)}:{done:!0,value:EF(e,r,t,n)}:{done:!1}}));SF(String.prototype,e,c[0]),SF(TF,i,c[1])}n&&IF(TF[i],"sham",!0)},OF=RD.charAt,RF=function(e,t,r){return t+(r?OF(e,t).length:1)},PF=d,MF=Ut,UF=F,LF=I,jF=Qj,NF=TypeError,zF=function(e,t){var r=e.exec;if(UF(r)){var n=PF(r,e,t);return null!==n&&MF(n),n}if("RegExp"===LF(e))return PF(jF,e,t);throw new NF("RegExp#exec called on incompatible receiver")},DF=d,FF=Ut,qF=P,HF=hn,VF=yi,$F=L,KF=Ee,ZF=RF,WF=zF;CF("match",(function(e,t,r){return[function(t){var r=$F(this),n=qF(t)?void 0:KF(t,e);return n?DF(n,t,r):new RegExp(t)[e](VF(r))},function(e){var n=FF(this),i=VF(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return WF(n,i);var s=n.unicode;n.lastIndex=0;for(var a,c=[],u=0;null!==(a=WF(n,i));){var l=VF(a[0]);c[u]=l,""===l&&(n.lastIndex=ZF(i,HF(n.lastIndex),s)),u++}return 0===u?null:c}]}));var GF=ii,YF=d,JF=vo,XF=Lh,QF=np,eq=L,tq=hn,rq=yi,nq=Ut,iq=P,oq=wL,sq=BL,aq=Ee,cq=Qr,uq=s,lq=qO,dq=RF,fq=zF,hq=Or,pq=nt("matchAll"),gq="RegExp String",yq=gq+" Iterator",mq=hq.set,bq=hq.getterFor(yq),vq=RegExp.prototype,wq=TypeError,_q=JF("".indexOf),Eq=JF("".matchAll),Sq=!!Eq&&!uq((function(){Eq("a",/./)})),kq=XF((function(e,t,r,n){mq(this,{type:yq,regexp:e,string:t,global:r,unicode:n,done:!1})}),gq,(function(){var e=bq(this);if(e.done)return QF(void 0,!0);var t=e.regexp,r=e.string,n=fq(t,r);return null===n?(e.done=!0,QF(void 0,!0)):e.global?(""===rq(n[0])&&(t.lastIndex=dq(r,tq(t.lastIndex),e.unicode)),QF(n,!1)):(e.done=!0,QF(n,!1))})),Aq=function(e){var t,r,n,i=nq(this),o=rq(e),s=lq(i,RegExp),a=rq(sq(i));return t=new s(s===RegExp?i.source:i,a),r=!!~_q(a,"g"),n=!!~_q(a,"u"),t.lastIndex=tq(i.lastIndex),new kq(t,o,r,n)};GF({target:"String",proto:!0,forced:Sq},{matchAll:function(e){var t,r,n,i=eq(this);if(iq(e)){if(Sq)return Eq(i,e)}else{if(oq(e)&&(t=rq(eq(sq(e))),!~_q(t,"g")))throw new wq("`.matchAll` does not allow non-global regexes");if(Sq)return Eq(i,e);if(n=aq(e,pq))return YF(n,e,i)}return r=rq(i),new RegExp(e,"g")[pq](r)}}),pq in vq||cq(vq,pq,Aq);var xq=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(Y),Iq=b_.end;ii({target:"String",proto:!0,forced:xq},{padEnd:function(e){return Iq(this,e,arguments.length>1?arguments[1]:void 0)}});var Bq=b_.start;ii({target:"String",proto:!0,forced:xq},{padStart:function(e){return Bq(this,e,arguments.length>1?arguments[1]:void 0)}});var Tq=ii,Cq=S,Oq=z,Rq=De,Pq=yi,Mq=gn,Uq=Cq([].push),Lq=Cq([].join);Tq({target:"String",stat:!0},{raw:function(e){var t=Oq(Rq(e).raw),r=Mq(t);if(!r)return"";for(var n=arguments.length,i=[],o=0;;){if(Uq(i,Pq(t[o++])),o===r)return Lq(i,"");o]*>)/g,Vq=/\$([$&'`]|\d{1,2})/g,$q=function(e,t,r,n,i,o){var s=r+e.length,a=n.length,c=Vq;return void 0!==i&&(i=Nq(i),c=Hq),Fq(o,c,(function(o,c){var u;switch(Dq(c,0)){case"$":return"$";case"&":return e;case"`":return qq(t,0,r);case"'":return qq(t,s);case"<":u=i[qq(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>a){var d=zq(l/10);return 0===d?o:d<=a?void 0===n[d-1]?Dq(c,1):n[d-1]+Dq(c,1):o}u=n[l-1]}return void 0===u?"":u}))},Kq=Ta,Zq=d,Wq=S,Gq=CF,Yq=s,Jq=Ut,Xq=F,Qq=P,eH=sn,tH=hn,rH=yi,nH=L,iH=RF,oH=Ee,sH=$q,aH=zF,cH=nt("replace"),uH=Math.max,lH=Math.min,dH=Wq([].concat),fH=Wq([].push),hH=Wq("".indexOf),pH=Wq("".slice),gH=function(e){return void 0===e?e:String(e)},yH="$0"==="a".replace(/./,"$0"),mH=!!/./[cH]&&""===/./[cH]("a","$0"),bH=!Yq((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}));Gq("replace",(function(e,t,r){var n=mH?"$":"$0";return[function(e,r){var n=nH(this),i=Qq(e)?void 0:oH(e,cH);return i?Zq(i,e,n,r):Zq(t,rH(n),e,r)},function(e,i){var o=Jq(this),s=rH(e);if("string"==typeof i&&-1===hH(i,n)&&-1===hH(i,"$<")){var a=r(t,o,s,i);if(a.done)return a.value}var c=Xq(i);c||(i=rH(i));var u,l=o.global;l&&(u=o.unicode,o.lastIndex=0);for(var d,f=[];null!==(d=aH(o,s))&&(fH(f,d),l);)""===rH(d[0])&&(o.lastIndex=iH(s,tH(o.lastIndex),u));for(var h="",p=0,g=0;g=p&&(h+=pH(s,p,b)+y,p=b+m.length)}return h+pH(s,p)}]}),!bH||!yH||mH);var vH=ii,wH=d,_H=S,EH=L,SH=F,kH=P,AH=wL,xH=yi,IH=Ee,BH=BL,TH=$q,CH=nt("replace"),OH=TypeError,RH=_H("".indexOf);_H("".replace);var PH=_H("".slice),MH=Math.max;vH({target:"String",proto:!0},{replaceAll:function(e,t){var r,n,i,o,s,a,c,u,l,d=EH(this),f=0,h="";if(!kH(e)){if(AH(e)&&(r=xH(EH(BH(e))),!~RH(r,"g")))throw new OH("`.replaceAll` does not allow non-global regexes");if(n=IH(e,CH))return wH(n,e,d,t)}for(i=xH(d),o=xH(e),(s=SH(t))||(t=xH(t)),a=o.length,c=MH(1,a),u=RH(i,o);-1!==u;)l=s?xH(t(o,u,i)):TH(o,i,u,[],void 0,t),h+=PH(i,f,u)+l,f=u+a,u=u+c>i.length?-1:RH(i,o,u+c);return f1||"".split(/.?/).length;$H("split",(function(e,t,r){var n="0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:HH(t,this,e,r)}:t;return[function(t,r){var i=WH(this),o=ZH(t)?void 0:QH(t,e);return o?HH(o,t,i,r):HH(n,XH(i),t,r)},function(e,i){var o=KH(this),s=XH(e);if(!aV){var a=r(n,o,s,i,n!==t);if(a.done)return a.value}var c=GH(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(rV?"g":"y"),d=new c(rV?"^(?:"+o.source+")":o,l),f=void 0===i?4294967295:i>>>0;if(0===f)return[];if(0===s.length)return null===eV(d,s)?[s]:[];for(var h=0,p=0,g=[];p1?arguments[1]:void 0,t.length)),n=fV(e);return yV(t,r,r+n.length)===n}});var wV=ii,_V=L,EV=sn,SV=yi,kV=S("".slice),AV=Math.max,xV=Math.min;wV({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(e,t){var r,n,i=SV(_V(this)),o=i.length,s=EV(e);return s===1/0&&(s=0),s<0&&(s=AV(o+s,0)),(r=void 0===t?o:EV(t))<=0||r===1/0||s>=(n=xV(s+r,o))?"":kV(i,s,n)}});var IV=ii,BV=d,TV=S,CV=L,OV=yi,RV=s,PV=Array,MV=TV("".charAt),UV=TV("".charCodeAt),LV=TV([].join),jV="".toWellFormed,NV=jV&&RV((function(){return"1"!==BV(jV,1)}));IV({target:"String",proto:!0,forced:NV},{toWellFormed:function(){var e=OV(CV(this));if(NV)return BV(jV,e);for(var t=e.length,r=PV(t),n=0;n=56320||n+1>=t||56320!=(64512&UV(e,n+1))?r[n]="�":(r[n]=MV(e,n),r[++n]=MV(e,n))}return LV(r,"")}});var zV=rr.PROPER,DV=s,FV=lI,qV=function(e){return DV((function(){return!!FV[e]()||"​…᠎"!=="​…᠎"[e]()||zV&&FV[e].name!==e}))},HV=bI.trim;ii({target:"String",proto:!0,forced:qV("trim")},{trim:function(){return HV(this)}});var VV=bI.end,$V=qV("trimEnd")?function(){return VV(this)}:"".trimEnd;ii({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==$V},{trimRight:$V}),ii({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==$V},{trimEnd:$V});var KV=bI.start,ZV=qV("trimStart")?function(){return KV(this)}:"".trimStart;ii({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==ZV},{trimLeft:ZV}),ii({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==ZV},{trimStart:ZV});var WV=L,GV=yi,YV=/"/g,JV=S("".replace),XV=function(e,t,r,n){var i=GV(WV(e)),o="<"+t;return""!==r&&(o+=" "+r+'="'+JV(GV(n),YV,""")+'"'),o+">"+i+""},QV=s,e$=function(e){return QV((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))},t$=XV;ii({target:"String",proto:!0,forced:e$("anchor")},{anchor:function(e){return t$(this,"a","name",e)}});var r$=XV;ii({target:"String",proto:!0,forced:e$("big")},{big:function(){return r$(this,"big","","")}});var n$=XV;ii({target:"String",proto:!0,forced:e$("blink")},{blink:function(){return n$(this,"blink","","")}});var i$=XV;ii({target:"String",proto:!0,forced:e$("bold")},{bold:function(){return i$(this,"b","","")}});var o$=XV;ii({target:"String",proto:!0,forced:e$("fixed")},{fixed:function(){return o$(this,"tt","","")}});var s$=XV;ii({target:"String",proto:!0,forced:e$("fontcolor")},{fontcolor:function(e){return s$(this,"font","color",e)}});var a$=XV;ii({target:"String",proto:!0,forced:e$("fontsize")},{fontsize:function(e){return a$(this,"font","size",e)}});var c$=XV;ii({target:"String",proto:!0,forced:e$("italics")},{italics:function(){return c$(this,"i","","")}});var u$=XV;ii({target:"String",proto:!0,forced:e$("link")},{link:function(e){return u$(this,"a","href",e)}});var l$=XV;ii({target:"String",proto:!0,forced:e$("small")},{small:function(){return l$(this,"small","","")}});var d$=XV;ii({target:"String",proto:!0,forced:e$("strike")},{strike:function(){return d$(this,"strike","","")}});var f$=XV;ii({target:"String",proto:!0,forced:e$("sub")},{sub:function(){return f$(this,"sub","","")}});var h$=XV;ii({target:"String",proto:!0,forced:e$("sup")},{sup:function(){return h$(this,"sup","","")}});var p$={exports:{}},g$=i,y$=s,m$=uh,b$=xv.NATIVE_ARRAY_BUFFER_VIEWS,v$=g$.ArrayBuffer,w$=g$.Int8Array,_$=!b$||!y$((function(){w$(1)}))||!y$((function(){new w$(-1)}))||!m$((function(e){new w$,new w$(null),new w$(1.5),new w$(e)}),!0)||y$((function(){return 1!==new w$(new v$(2),1,void 0).length})),E$=lS,S$=RangeError,k$=function(e,t){var r=E$(e);if(r%t)throw new S$("Wrong offset");return r},A$=Math.round,x$=function(e){var t=A$(e);return t<0?0:t>255?255:255&t},I$=hi,B$=function(e){var t=I$(e);return"BigInt64Array"===t||"BigUint64Array"===t},T$=dt,C$=TypeError,O$=function(e){var t=T$(e,"number");if("number"==typeof t)throw new C$("Can't convert number to bigint");return BigInt(t)},R$=So,P$=d,M$=jO,U$=De,L$=gn,j$=ml,N$=ll,z$=il,D$=B$,F$=xv.aTypedArrayConstructor,q$=O$,H$=function(e){var t,r,n,i,o,s,a,c,u=M$(this),l=U$(e),d=arguments.length,f=d>1?arguments[1]:void 0,h=void 0!==f,p=N$(l);if(p&&!z$(p))for(c=(a=j$(l,p)).next,l=[];!(s=P$(c,a)).done;)l.push(s.value);for(h&&d>2&&(f=R$(f,arguments[2])),r=L$(l),n=new(F$(u))(r),i=D$(n),t=0;r>t;t++)o=h?f(l[t],t):l[t],n[t]=i?q$(o):+o;return n},V$=ii,$$=i,K$=d,Z$=a,W$=_$,G$=xv,Y$=Nb,J$=mm,X$=b,Q$=Gt,eK=GI,tK=hn,rK=_m,nK=k$,iK=x$,oK=pt,sK=He,aK=hi,cK=H,uK=he,lK=qi,dK=Z,fK=Vc,hK=en.f,pK=H$,gK=Qo.forEach,yK=dy,mK=Xi,bK=Ct,vK=o,wK=Ry,_K=Yc,EK=Or.get,SK=Or.set,kK=Or.enforce,AK=bK.f,xK=vK.f,IK=$$.RangeError,BK=Y$.ArrayBuffer,TK=BK.prototype,CK=Y$.DataView,OK=G$.NATIVE_ARRAY_BUFFER_VIEWS,RK=G$.TYPED_ARRAY_TAG,PK=G$.TypedArray,MK=G$.TypedArrayPrototype,UK=G$.isTypedArray,LK="BYTES_PER_ELEMENT",jK="Wrong length",NK=function(e,t){mK(e,t,{configurable:!0,get:function(){return EK(this)[t]}})},zK=function(e){var t;return dK(TK,e)||"ArrayBuffer"===(t=aK(e))||"SharedArrayBuffer"===t},DK=function(e,t){return UK(e)&&!uK(t)&&t in e&&eK(+t)&&t>=0},FK=function(e,t){return t=oK(t),DK(e,t)?X$(2,e[t]):xK(e,t)},qK=function(e,t,r){return t=oK(t),!(DK(e,t)&&cK(r)&&sK(r,"value"))||sK(r,"get")||sK(r,"set")||r.configurable||sK(r,"writable")&&!r.writable||sK(r,"enumerable")&&!r.enumerable?AK(e,t,r):(e[t]=r.value,e)};Z$?(OK||(vK.f=FK,bK.f=qK,NK(MK,"buffer"),NK(MK,"byteOffset"),NK(MK,"byteLength"),NK(MK,"length")),V$({target:"Object",stat:!0,forced:!OK},{getOwnPropertyDescriptor:FK,defineProperty:qK}),p$.exports=function(e,t,r){var n=e.match(/\d+/)[0]/8,i=e+(r?"Clamped":"")+"Array",o="get"+e,s="set"+e,a=$$[i],c=a,u=c&&c.prototype,l={},d=function(e,t){AK(e,t,{get:function(){return function(e,t){var r=EK(e);return r.view[o](t*n+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,i){var o=EK(e);o.view[s](t*n+o.byteOffset,r?iK(i):i,!0)}(this,t,e)},enumerable:!0})};OK?W$&&(c=t((function(e,t,r,i){return J$(e,u),_K(cK(t)?zK(t)?void 0!==i?new a(t,nK(r,n),i):void 0!==r?new a(t,nK(r,n)):new a(t):UK(t)?wK(c,t):K$(pK,c,t):new a(rK(t)),e,c)})),fK&&fK(c,PK),gK(hK(a),(function(e){e in c||Q$(c,e,a[e])})),c.prototype=u):(c=t((function(e,t,r,i){J$(e,u);var o,s,a,l=0,f=0;if(cK(t)){if(!zK(t))return UK(t)?wK(c,t):K$(pK,c,t);o=t,f=nK(r,n);var h=t.byteLength;if(void 0===i){if(h%n)throw new IK(jK);if((s=h-f)<0)throw new IK(jK)}else if((s=tK(i)*n)+f>h)throw new IK(jK);a=s/n}else a=rK(t),o=new BK(s=a*n);for(SK(e,{buffer:o,byteOffset:f,byteLength:s,length:a,view:new CK(o)});l=0?n:r+n;return i<0||i>=r?void 0:t[i]}));var KK=xv,ZK=S(Wd),WK=KK.aTypedArray;(0,KK.exportTypedArrayMethod)("copyWithin",(function(e,t){return ZK(WK(this),e,t,arguments.length>2?arguments[2]:void 0)}));var GK=Qo.every,YK=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("every",(function(e){return GK(YK(this),e,arguments.length>1?arguments[1]:void 0)}));var JK=rf,XK=O$,QK=hi,eZ=d,tZ=s,rZ=xv.aTypedArray,nZ=xv.exportTypedArrayMethod,iZ=S("".slice);nZ("fill",(function(e){var t=arguments.length;rZ(this);var r="Big"===iZ(QK(this),0,3)?XK(e):+e;return eZ(JK,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),tZ((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})));var oZ=Ry,sZ=xv.getTypedArrayConstructor,aZ=function(e,t){return oZ(sZ(e),t)},cZ=Qo.filter,uZ=aZ,lZ=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("filter",(function(e){var t=cZ(lZ(this),e,arguments.length>1?arguments[1]:void 0);return uZ(this,t)}));var dZ=Qo.find,fZ=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("find",(function(e){return dZ(fZ(this),e,arguments.length>1?arguments[1]:void 0)}));var hZ=Qo.findIndex,pZ=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("findIndex",(function(e){return hZ(pZ(this),e,arguments.length>1?arguments[1]:void 0)}));var gZ=_f.findLast,yZ=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("findLast",(function(e){return gZ(yZ(this),e,arguments.length>1?arguments[1]:void 0)}));var mZ=_f.findLastIndex,bZ=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("findLastIndex",(function(e){return mZ(bZ(this),e,arguments.length>1?arguments[1]:void 0)}));var vZ=Qo.forEach,wZ=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("forEach",(function(e){vZ(wZ(this),e,arguments.length>1?arguments[1]:void 0)})),(0,xv.exportTypedArrayStaticMethod)("from",H$,_$);var _Z=wn.includes,EZ=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("includes",(function(e){return _Z(EZ(this),e,arguments.length>1?arguments[1]:void 0)}));var SZ=wn.indexOf,kZ=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("indexOf",(function(e){return SZ(kZ(this),e,arguments.length>1?arguments[1]:void 0)}));var AZ=i,xZ=s,IZ=S,BZ=xv,TZ=gp,CZ=nt("iterator"),OZ=AZ.Uint8Array,RZ=IZ(TZ.values),PZ=IZ(TZ.keys),MZ=IZ(TZ.entries),UZ=BZ.aTypedArray,LZ=BZ.exportTypedArrayMethod,jZ=OZ&&OZ.prototype,NZ=!xZ((function(){jZ[CZ].call([1])})),zZ=!!jZ&&jZ.values&&jZ[CZ]===jZ.values&&"values"===jZ.values.name,DZ=function(){return RZ(UZ(this))};LZ("entries",(function(){return MZ(UZ(this))}),NZ),LZ("keys",(function(){return PZ(UZ(this))}),NZ),LZ("values",DZ,NZ||!zZ,{name:"values"}),LZ(CZ,DZ,NZ||!zZ,{name:"values"});var FZ=xv.aTypedArray,qZ=xv.exportTypedArrayMethod,HZ=S([].join);qZ("join",(function(e){return HZ(FZ(this),e)}));var VZ=Ta,$Z=Op,KZ=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return VZ($Z,KZ(this),t>1?[e,arguments[1]]:[e])}));var ZZ=Qo.map,WZ=xv.aTypedArray,GZ=xv.getTypedArrayConstructor;(0,xv.exportTypedArrayMethod)("map",(function(e){return ZZ(WZ(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(GZ(e))(t)}))}));var YZ=xv.aTypedArrayConstructor;(0,xv.exportTypedArrayStaticMethod)("of",(function(){for(var e=0,t=arguments.length,r=new(YZ(this))(t);t>e;)r[e]=arguments[e++];return r}),_$);var JZ=ng.left,XZ=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return JZ(XZ(this),e,t,t>1?arguments[1]:void 0)}));var QZ=ng.right,eW=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return QZ(eW(this),e,t,t>1?arguments[1]:void 0)}));var tW=xv.aTypedArray,rW=xv.exportTypedArrayMethod,nW=Math.floor;rW("reverse",(function(){for(var e,t=this,r=tW(t).length,n=nW(r/2),i=0;i1?arguments[1]:void 0,1),r=uW(e);if(mW)return oW(pW,this,r,t);var n=this.length,i=aW(r),o=0;if(i+t>n)throw new dW("Wrong length");for(;oi;)s[i]=r[i++];return s}),s((function(){new Int8Array(1).slice()})));var EW=Qo.some,SW=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("some",(function(e){return EW(SW(this),e,arguments.length>1?arguments[1]:void 0)}));var kW=vo,AW=s,xW=ve,IW=Mg,BW=Lg,TW=jg,CW=ne,OW=zg,RW=xv.aTypedArray,PW=xv.exportTypedArrayMethod,MW=i.Uint16Array,UW=MW&&kW(MW.prototype.sort),LW=!(!UW||AW((function(){UW(new MW(2),null)}))&&AW((function(){UW(new MW(2),{})}))),jW=!!UW&&!AW((function(){if(CW)return CW<74;if(BW)return BW<67;if(TW)return!0;if(OW)return OW<602;var e,t,r=new MW(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(UW(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));PW("sort",(function(e){return void 0!==e&&xW(e),jW?UW(this,e):IW(RW(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!jW||LW);var NW=hn,zW=ln,DW=xv.aTypedArray,FW=xv.getTypedArrayConstructor;(0,xv.exportTypedArrayMethod)("subarray",(function(e,t){var r=DW(this),n=r.length,i=zW(e,n);return new(FW(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,NW((void 0===t?n:zW(t,n))-i))}));var qW=Ta,HW=xv,VW=s,$W=Vi,KW=i.Int8Array,ZW=HW.aTypedArray,WW=HW.exportTypedArrayMethod,GW=[].toLocaleString,YW=!!KW&&VW((function(){GW.call(new KW(1))}));WW("toLocaleString",(function(){return qW(GW,YW?$W(ZW(this)):ZW(this),$W(arguments))}),VW((function(){return[1,2].toLocaleString()!==new KW([1,2]).toLocaleString()}))||!VW((function(){KW.prototype.toLocaleString.call([1,2])})));var JW=xy,XW=xv.aTypedArray,QW=xv.getTypedArrayConstructor;(0,xv.exportTypedArrayMethod)("toReversed",(function(){return JW(XW(this),QW(this))}));var eG=ve,tG=Ry,rG=xv.aTypedArray,nG=xv.getTypedArrayConstructor,iG=xv.exportTypedArrayMethod,oG=S(xv.TypedArrayPrototype.sort);iG("toSorted",(function(e){void 0!==e&&eG(e);var t=rG(this),r=tG(nG(t),t);return oG(r,e)}));var sG=xv.exportTypedArrayMethod,aG=s,cG=S,uG=i.Uint8Array,lG=uG&&uG.prototype||{},dG=[].toString,fG=cG([].join);aG((function(){dG.call({})}))&&(dG=function(){return fG(this)});var hG=lG.toString!==dG;sG("toString",dG,hG);var pG=cm,gG=B$,yG=sn,mG=O$,bG=xv.aTypedArray,vG=xv.getTypedArrayConstructor,wG=xv.exportTypedArrayMethod,_G=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}();wG("with",{with:function(e,t){var r=bG(this),n=yG(e),i=gG(r)?mG(t):+t;return pG(r,vG(r),n,i)}}.with,!_G);var EG=ii,SG=S,kG=yi,AG=String.fromCharCode,xG=SG("".charAt),IG=SG(/./.exec),BG=SG("".slice),TG=/^[\da-f]{2}$/i,CG=/^[\da-f]{4}$/i;EG({global:!0},{unescape:function(e){for(var t,r,n=kG(e),i="",o=n.length,s=0;s1?arguments[1]:void 0,i=r>2?arguments[2]:void 0;return new(KJ("Promise"))((function(r){var o=zJ(e);void 0!==n&&(n=jJ(n,i));var s=$J(o,YJ),a=s?void 0:VJ(o)||QJ,c=DJ(t)?new t:[],u=s?FJ(o,s):new WJ(HJ(qJ(o,a)));r(GJ(u,n,c))}))},rX=ii,nX=tX,iX=s,oX=Array.fromAsync,sX=!oX||iX((function(){var e=0;return oX.call((function(){return e++,[]}),{length:0}),1!==e}));rX({target:"Array",stat:!0,forced:sX},{fromAsync:nX});var aX=Qo.filterReject,cX=dd;ii({target:"Array",proto:!0,forced:!0},{filterOut:function(e){return aX(this,e,arguments.length>1?arguments[1]:void 0)}}),cX("filterOut");var uX=Qo.filterReject,lX=dd;ii({target:"Array",proto:!0,forced:!0},{filterReject:function(e){return uX(this,e,arguments.length>1?arguments[1]:void 0)}}),lX("filterReject");var dX=So,fX=R,hX=De,pX=pt,gX=gn,yX=qi,mX=Ry,bX=Array,vX=S([].push),wX=function(e,t,r,n){for(var i,o,s,a=hX(e),c=fX(a),u=dX(t,r),l=yX(null),d=gX(c),f=0;d>f;f++)s=c[f],(o=pX(u(s,f,a)))in l?vX(l[o],s):l[o]=[s];if(n&&(i=n(a))!==bX)for(o in l)l[o]=mX(i,l[o]);return l},_X=wX,EX=dd;ii({target:"Array",proto:!0},{group:function(e){return _X(this,e,arguments.length>1?arguments[1]:void 0)}}),EX("group");var SX=wX,kX=dd;ii({target:"Array",proto:!0,forced:!Jd("groupBy")},{groupBy:function(e){return SX(this,e,arguments.length>1?arguments[1]:void 0)}}),kX("groupBy");var AX=So,xX=R,IX=De,BX=gn,TX=JA.Map,CX=JA.get,OX=JA.has,RX=JA.set,PX=S([].push),MX=function(e){for(var t,r,n=IX(this),i=xX(n),o=AX(e,arguments.length>1?arguments[1]:void 0),s=new TX,a=BX(i),c=0;a>c;c++)t=o(r=i[c],c,n),OX(s,t)?PX(CX(s,t),r):RX(s,t,[r]);return s},UX=dd,LX=MX;ii({target:"Array",proto:!0,name:"groupToMap",forced:!Jd("groupByToMap")},{groupByToMap:LX}),UX("groupByToMap");var jX=dd;ii({target:"Array",proto:!0,forced:!1},{groupToMap:MX}),jX("groupToMap");var NX=ii,zX=Ao,DX=Object.isFrozen,FX=function(e,t){if(!DX||!zX(e)||!DX(e))return!1;for(var r,n=0,i=e.length;ne,c=!1;if(void 0===r)s=void 0;else if(c2(r))s=r.step,c=!!r.inclusive;else{if(typeof r!=n)throw new y2(d2);s=r}if(a2(s)&&(s=a?o:-o),typeof s!=n)throw new y2(d2);if(s===1/0||s===-1/0||s===i&&e!==t)throw new g2(d2);h2(this,{type:f2,start:e,end:t,step:s,inclusive:c,hitsEnd:e!=e||t!=t||s!=s||t>e!=s>i,currentCount:i,zero:i}),l2||(this.start=e,this.end=t,this.step=s,this.inclusive=c)}),f2,(function(){var e=p2(this);if(e.hitsEnd)return s2(void 0,!0);var t=e.start,r=e.end,n=t+e.step*e.currentCount++;n===r&&(e.hitsEnd=!0);var i=e.inclusive;return(r>t?i?n>r:n>=r:i?r>n:r>=n)?(e.hitsEnd=!0,s2(void 0,!0)):s2(n,!1)})),b2=function(e){u2(m2.prototype,e,{get:function(){return p2(this)[e]},set:function(){},configurable:!0,enumerable:!1})};l2&&(b2("start"),b2("end"),b2("inclusive"),b2("step"));var v2=m2,w2=v2;"function"==typeof BigInt&&ii({target:"BigInt",stat:!0,forced:!0},{range:function(e,t,r){return new w2(e,t,r,"bigint",BigInt(0),BigInt(1))}});var _2=K,E2=qi,S2=H,k2=Object,A2=TypeError,x2=_2("Map"),I2=_2("WeakMap"),B2=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=E2(null)};B2.prototype.get=function(e,t){return this[e]||(this[e]=t())},B2.prototype.next=function(e,t,r){var n=r?this.objectsByIndex[e]||(this.objectsByIndex[e]=new I2):this.primitives||(this.primitives=new x2),i=n.get(t);return i||n.set(t,i=new B2),i};var T2=new B2,C2=function(){var e,t,r=T2,n=arguments.length;for(e=0;e1&&arguments[1]);return F2([255&t,t>>8&255],10)}});var H2=ii,V2=S(DataView.prototype.getUint8);H2({target:"DataView",proto:!0,forced:!0},{getUint8Clamped:function(e){return V2(this,e)}});var $2=hi,K2=TypeError,Z2=function(e){if("DataView"===$2(e))return e;throw new K2("Argument is not a DataView")},W2=Im,G2=Math.f16round||function(e){return W2(e,.0009765625,65504,6103515625e-14)},Y2=ii,J2=Z2,X2=_m,Q2=Lm.pack,e5=G2,t5=S(DataView.prototype.setUint16);Y2({target:"DataView",proto:!0},{setFloat16:function(e,t){J2(this);var r=X2(e),n=Q2(e5(t),10,2);return t5(this,r,n[1]<<8|n[0],arguments.length>2&&arguments[2])}});var r5=ii,n5=Z2,i5=_m,o5=x$,s5=S(DataView.prototype.setUint8);r5({target:"DataView",proto:!0,forced:!0},{setUint8Clamped:function(e,t){n5(this);var r=i5(e);return s5(this,r,o5(t))}});var a5=ii,c5=a,u5=ve,l5=mm,d5=Qr,f5=pm,h5=Xi,p5=nt,g5=Or,y5=AQ,m5=K("SuppressedError"),b5=ReferenceError,v5=p5("dispose"),w5=p5("toStringTag"),_5="DisposableStack",E5=g5.set,S5=g5.getterFor(_5),k5="sync-dispose",A5="disposed",x5=function(e){var t=S5(e);if(t.state===A5)throw new b5(_5+" already disposed");return t},I5=function(){E5(l5(this,B5),{type:_5,state:"pending",stack:[]}),c5||(this.disposed=!1)},B5=I5.prototype;f5(B5,{dispose:function(){var e=S5(this);if(e.state!==A5){e.state=A5,c5||(this.disposed=!0);for(var t,r=e.stack,n=r.length,i=!1;n;){var o=r[--n];r[n]=null;try{o()}catch(e){i?t=new m5(e,t):(i=!0,t=e)}}if(e.stack=null,i)throw t}},use:function(e){return y5(x5(this),e,k5),e},adopt:function(e,t){var r=x5(this);return u5(t),y5(r,void 0,k5,(function(){t(e)})),e},defer:function(e){var t=x5(this);u5(e),y5(t,void 0,k5,e)},move:function(){var e=x5(this),t=new I5;return S5(t).stack=e.stack,e.stack=[],e.state=A5,c5||(this.disposed=!0),t}}),c5&&h5(B5,"disposed",{configurable:!0,get:function(){return S5(this).state===A5}}),d5(B5,v5,B5.dispose,{name:"dispose"}),d5(B5,w5,_5,{nonWritable:!0}),a5({global:!0,constructor:!0},{DisposableStack:I5});var T5=S,C5=ve,O5=function(){return T5(C5(this))};ii({target:"Function",proto:!0,forced:!0},{demethodize:O5});var R5=ii,P5=S,M5=F,U5=lr,L5=He,j5=a,N5=Object.getOwnPropertyDescriptor,z5=/^\s*class\b/,D5=P5(z5.exec);R5({target:"Function",stat:!0,sham:!0,forced:!0},{isCallable:function(e){return M5(e)&&!function(e){try{if(!j5||!D5(z5,U5(e)))return!1}catch(e){}var t=N5(e,"prototype");return!!t&&L5(t,"writable")&&!t.writable}(e)}}),ii({target:"Function",stat:!0,forced:!0},{isConstructor:No});var F5=nt,q5=Ct.f,H5=F5("metadata"),V5=Function.prototype;void 0===V5[H5]&&q5(V5,H5,{value:null}),ii({target:"Function",proto:!0,forced:!0,name:"demethodize"},{unThis:O5});var $5=d,K5=xk,Z5=function(e,t){return[t,e]},W5=function(){return $5(K5,this,Z5)};ii({target:"Iterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:W5});var G5=ii,Y5=d,J5=ve,X5=Ut,Q5=ll,e3=Array,t3=IS((function(){for(;;){var e=this.iterator;if(!e){var t=this.nextIterableIndex++,r=this.iterables;if(t>=r.length)return void(this.done=!0);var n=r[t];this.iterables[t]=null,e=this.iterator=Y5(n.method,n.iterable),this.next=e.next}var i=X5(Y5(this.next,e));if(!i.done)return i.value;this.iterator=null,this.next=null}}));G5({target:"Iterator",stat:!0,forced:!0},{concat:function(){for(var e=arguments.length,t=e3(e),r=0;r1?arguments[1]:void 0);return!1!==G6(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}});var Y6=So,J6=D6,X6=tQ,Q6=JA.Map,e8=JA.set;ii({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=J6(this),r=Y6(e,arguments.length>1?arguments[1]:void 0),n=new Q6;return X6(t,(function(e,i){r(e,i,t)&&e8(n,i,e)})),n}});var t8=So,r8=D6,n8=tQ;ii({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=r8(this),r=t8(e,arguments.length>1?arguments[1]:void 0),n=n8(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}});var i8=So,o8=D6,s8=tQ;ii({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=o8(this),r=i8(e,arguments.length>1?arguments[1]:void 0),n=s8(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}});var a8=So,c8=Ut,u8=De,l8=Ul,d8=function(e,t,r){return function(n){var i=u8(n),o=arguments.length,s=o>1?arguments[1]:void 0,a=void 0!==s,c=a?a8(s,o>2?arguments[2]:void 0):void 0,u=new e,l=0;return l8(i,(function(e){var n=a?c(e,l++):e;r?t(u,c8(n)[0],n[1]):t(u,n)})),u}};ii({target:"Map",stat:!0,forced:!0},{from:d8(JA.Map,JA.set,!0)});var f8=D6,h8=JA.get,p8=JA.has,g8=JA.set;ii({target:"Map",proto:!0,real:!0,forced:!0},{getOrInsert:function(e,t){return p8(f8(this),e)?h8(this,e):(g8(this,e,t),t)}});var y8=ve,m8=D6,b8=JA.get,v8=JA.has,w8=JA.set;ii({target:"Map",proto:!0,real:!0,forced:!0},{getOrInsertComputed:function(e,t){if(m8(this),y8(t),v8(this,e))return b8(this,e);0===e&&1/e==-1/0&&(e=0);var r=t(e);return w8(this,e,r),r}});var _8=function(e,t){return e===t||e!=e&&t!=t},E8=D6,S8=tQ;ii({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===S8(E8(this),(function(t){if(_8(t,e))return!0}),!0)}});var k8=d,A8=Ul,x8=F,I8=ve,B8=JA.Map;ii({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(x8(this)?this:B8);I8(t);var n=I8(r.set);return A8(e,(function(e){k8(n,r,t(e),e)})),r}});var T8=D6,C8=tQ;ii({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=C8(T8(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}});var O8=So,R8=D6,P8=tQ,M8=JA.Map,U8=JA.set;ii({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=R8(this),r=O8(e,arguments.length>1?arguments[1]:void 0),n=new M8;return P8(t,(function(e,i){U8(n,r(e,i,t),e)})),n}});var L8=So,j8=D6,N8=tQ,z8=JA.Map,D8=JA.set;ii({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=j8(this),r=L8(e,arguments.length>1?arguments[1]:void 0),n=new z8;return N8(t,(function(e,i){D8(n,i,r(e,i,t))})),n}});var F8=D6,q8=Ul,H8=JA.set;ii({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=F8(this),r=arguments.length,n=0;n1?arguments[1]:void 0);return!0===X8(t,(function(e,n){if(r(e,n,t))return!0}),!0)}});var Q8=ve,e4=D6,t4=TypeError,r4=JA.get,n4=JA.has,i4=JA.set;ii({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=e4(this),n=arguments.length;Q8(t);var i=n4(r,e);if(!i&&n<3)throw new t4("Updating absent value");var o=i?r4(r,e):Q8(n>2?arguments[2]:void 0)(e,r);return i4(r,e,t(o,e,r)),r}});var o4=d,s4=ve,a4=F,c4=Ut,u4=TypeError,l4=function(e,t){var r,n=c4(this),i=s4(n.get),o=s4(n.has),s=s4(n.set),a=arguments.length>2?arguments[2]:void 0;if(!a4(t)&&!a4(a))throw new u4("At least one callback required");return o4(o,n,e)?(r=o4(i,n,e),a4(t)&&(r=t(r),o4(s,n,e,r))):a4(a)&&(r=a(),o4(s,n,e,r)),r};ii({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:l4}),ii({target:"Map",proto:!0,real:!0,forced:!0},{upsert:l4});var d4=ii,f4=Math.min,h4=Math.max;d4({target:"Math",stat:!0,forced:!0},{clamp:function(e,t,r){return f4(r,h4(t,e))}}),ii({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{DEG_PER_RAD:Math.PI/180});var p4=ii,g4=180/Math.PI;p4({target:"Math",stat:!0,forced:!0},{degrees:function(e){return e*g4}});var y4=Math.scale||function(e,t,r,n,i){var o=+e,s=+t,a=+r,c=+n,u=+i;return o!=o||s!=s||a!=a||c!=c||u!=u?NaN:o===1/0||o===-1/0?o:(o-s)*(u-c)/(a-s)+c},m4=y4,b4=Tm;ii({target:"Math",stat:!0,forced:!0},{fscale:function(e,t,r,n,i){return b4(m4(e,t,r,n,i))}}),ii({target:"Math",stat:!0},{f16round:G2}),ii({target:"Math",stat:!0,forced:!0},{iaddh:function(e,t,r,n){var i=e>>>0,o=r>>>0;return(t>>>0)+(n>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}}),ii({target:"Math",stat:!0,forced:!0},{imulh:function(e,t){var r=65535,n=+e,i=+t,o=n&r,s=i&r,a=n>>16,c=i>>16,u=(a*s>>>0)+(o*s>>>16);return a*c+(u>>16)+((o*c>>>0)+(u&r)>>16)}}),ii({target:"Math",stat:!0,forced:!0},{isubh:function(e,t,r,n){var i=e>>>0,o=r>>>0;return(t>>>0)-(n>>>0)-((~i&o|(i^~o)&i-o>>>0)>>>31)|0}}),ii({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI});var v4=ii,w4=Math.PI/180;v4({target:"Math",stat:!0,forced:!0},{radians:function(e){return e*w4}}),ii({target:"Math",stat:!0,forced:!0},{scale:y4});var _4=ii,E4=Ut,S4=KI,k4=Lh,A4=np,x4=Or,I4="Seeded Random",B4=I4+" Generator",T4=x4.set,C4=x4.getterFor(B4),O4=TypeError,R4=k4((function(e){T4(this,{type:B4,seed:e%2147483647})}),I4,(function(){var e=C4(this),t=e.seed=(1103515245*e.seed+12345)%2147483647;return A4((1073741823&t)/1073741823,!1)}));_4({target:"Math",stat:!0,forced:!0},{seededPRNG:function(e){var t=E4(e).seed;if(!S4(t))throw new O4('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new R4(t)}}),ii({target:"Math",stat:!0,forced:!0},{signbit:function(e){var t=+e;return t==t&&0===t?1/t==-1/0:t<0}});var P4=ii,M4=S,U4=Ul,L4=RangeError,j4=TypeError,N4=1/0,z4=Math.abs,D4=Math.pow,F4=M4([].push),q4=D4(2,1023),H4=D4(2,53)-1,V4=Number.MAX_VALUE,$4=D4(2,971),K4={},Z4={},W4={},G4={},Y4={},J4=function(e,t){var r=e+t;return{hi:r,lo:t-(r-e)}};P4({target:"Math",stat:!0},{sumPrecise:function(e){var t=[],r=0,n=G4;switch(U4(e,(function(e){if(++r>=H4)throw new L4("Maximum allowed index exceeded");if("number"!=typeof e)throw new j4("Value is not a number");n!==K4&&(e!=e?n=K4:e===N4?n=n===Z4?K4:W4:e===-1/0?n=n===W4?K4:Z4:0===e&&1/e!==N4||n!==G4&&n!==Y4||(n=Y4,F4(t,e)))})),n){case K4:return NaN;case Z4:return-1/0;case W4:return N4;case G4:return-0}for(var i,o,s,a,c,u,l=[],d=0,f=0;f=0?l[y]:0;if(y--,z4(d)>1||d>0&&m>0||d<0&&m<0)return d>0?N4:-1/0;if(a=(s=J4(d*q4,m/2)).hi,c=s.lo,c*=2,z4(2*a)===N4)return a>0?a===q4&&c===-$4/2&&y>=0&&l[y]<0?V4:N4:a===-q4&&c===$4/2&&y>=0&&l[y]>0?-V4:-1/0;0!==c&&(l[++y]=c,c=0),a*=2}for(;y>=0&&(a=(s=J4(a,l[y--])).hi,0===(c=s.lo)););return y>=0&&(c<0&&l[y]<0||c>0&&l[y]>0)&&(o=2*c)==(i=a+o)-a&&(a=i),a}}),ii({target:"Math",stat:!0,forced:!0},{umulh:function(e,t){var r=65535,n=+e,i=+t,o=n&r,s=i&r,a=n>>>16,c=i>>>16,u=(a*s>>>0)+(o*s>>>16);return a*c+(u>>>16)+((o*c>>>0)+(u&r)>>>16)}});var X4=ii,Q4=S,e9=sn,t9="Invalid number representation",r9=RangeError,n9=SyntaxError,i9=TypeError,o9=parseInt,s9=Math.pow,a9=/^[\d.a-z]+$/,c9=Q4("".charAt),u9=Q4(a9.exec),l9=Q4(1..toString),d9=Q4("".slice),f9=Q4("".split);X4({target:"Number",stat:!0,forced:!0},{fromString:function(e,t){var r=1;if("string"!=typeof e)throw new i9(t9);if(!e.length)throw new n9(t9);if("-"===c9(e,0)&&(r=-1,!(e=d9(e,1)).length))throw new n9(t9);var n=void 0===t?10:e9(t);if(n<2||n>36)throw new r9("Invalid radix");if(!u9(a9,e))throw new n9(t9);var i=f9(e,"."),o=o9(i[0],n);if(i.length>1&&(o+=o9(i[1],n)/s9(n,i[1].length)),10===n&&l9(o,n)!==e)throw new n9(t9);return r*o}});var h9=v2;ii({target:"Number",stat:!0,forced:!0},{range:function(e,t,r){return new h9(e,t,r,"number",0,1)}});var p9=Or,g9=Lh,y9=np,m9=He,b9=wi,v9=De,w9="Object Iterator",_9=p9.set,E9=p9.getterFor(w9),S9=g9((function(e,t){var r=v9(e);_9(this,{type:w9,mode:t,object:r,keys:b9(r),index:0})}),"Object",(function(){for(var e=E9(this),t=e.keys;;){if(null===t||e.index>=t.length)return e.object=e.keys=null,y9(void 0,!0);var r=t[e.index++],n=e.object;if(m9(n,r)){switch(e.mode){case"keys":return y9(r,!1);case"values":return y9(n[r],!1)}return y9([r,n[r]],!1)}}})),k9=S9;ii({target:"Object",stat:!0,forced:!0},{iterateEntries:function(e){return new k9(e,"entries")}});var A9=S9;ii({target:"Object",stat:!0,forced:!0},{iterateKeys:function(e){return new A9(e,"keys")}});var x9=S9;ii({target:"Object",stat:!0,forced:!0},{iterateValues:function(e){return new x9(e,"values")}});var I9=ii,B9=d,T9=a,C9=dy,O9=ve,R9=Ut,P9=mm,M9=F,U9=P,L9=H,j9=Ee,N9=Qr,z9=pm,D9=Xi,F9=GR,q9=Or,H9=nt("observable"),V9="Observable",$9="Subscription",K9="SubscriptionObserver",Z9=q9.getterFor,W9=q9.set,G9=Z9(V9),Y9=Z9($9),J9=Z9(K9),X9=function(e){this.observer=R9(e),this.cleanup=null,this.subscriptionObserver=null};X9.prototype={type:$9,clean:function(){var e=this.cleanup;if(e){this.cleanup=null;try{e()}catch(e){F9(e)}}},close:function(){if(!T9){var e=this.facade,t=this.subscriptionObserver;e.closed=!0,t&&(t.closed=!0)}this.observer=null},isClosed:function(){return null===this.observer}};var Q9=function(e,t){var r,n=W9(this,new X9(e));T9||(this.closed=!1);try{(r=j9(e,"start"))&&B9(r,e,this)}catch(e){F9(e)}if(!n.isClosed()){var i=n.subscriptionObserver=new e7(n);try{var o=t(i),s=o;U9(o)||(n.cleanup=M9(o.unsubscribe)?function(){s.unsubscribe()}:O9(o))}catch(e){return void i.error(e)}n.isClosed()&&n.clean()}};Q9.prototype=z9({},{unsubscribe:function(){var e=Y9(this);e.isClosed()||(e.close(),e.clean())}}),T9&&D9(Q9.prototype,"closed",{configurable:!0,get:function(){return Y9(this).isClosed()}});var e7=function(e){W9(this,{type:K9,subscriptionState:e}),T9||(this.closed=!1)};e7.prototype=z9({},{next:function(e){var t=J9(this).subscriptionState;if(!t.isClosed()){var r=t.observer;try{var n=j9(r,"next");n&&B9(n,r,e)}catch(e){F9(e)}}},error:function(e){var t=J9(this).subscriptionState;if(!t.isClosed()){var r=t.observer;t.close();try{var n=j9(r,"error");n?B9(n,r,e):F9(e)}catch(e){F9(e)}t.clean()}},complete:function(){var e=J9(this).subscriptionState;if(!e.isClosed()){var t=e.observer;e.close();try{var r=j9(t,"complete");r&&B9(r,t)}catch(e){F9(e)}e.clean()}}}),T9&&D9(e7.prototype,"closed",{configurable:!0,get:function(){return J9(this).subscriptionState.isClosed()}});var t7=function(e){P9(this,r7),W9(this,{type:V9,subscriber:O9(e)})},r7=t7.prototype;z9(r7,{subscribe:function(e){var t=arguments.length;return new Q9(M9(e)?{next:e,error:t>1?arguments[1]:void 0,complete:t>2?arguments[2]:void 0}:L9(e)?e:{},G9(this).subscriber)}}),N9(r7,H9,(function(){return this})),I9({global:!0,constructor:!0,forced:!0},{Observable:t7}),C9(V9);var n7=ii,i7=K,o7=d,s7=Ut,a7=No,c7=ml,u7=Ee,l7=Ul,d7=nt("observable");n7({target:"Observable",stat:!0,forced:!0},{from:function(e){var t=a7(this)?this:i7("Observable"),r=u7(s7(e),d7);if(r){var n=s7(o7(r,e));return n.constructor===t?n:new t((function(e){return n.subscribe(e)}))}var i=c7(e);return new t((function(e){l7(i,(function(t,r){if(e.next(t),e.closed)return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}),e.complete()}))}});var f7=ii,h7=K,p7=No,g7=h7("Array");f7({target:"Observable",stat:!0,forced:!0},{of:function(){for(var e=p7(this)?this:h7("Observable"),t=arguments.length,r=g7(t),n=0;n@`~"+vee+"]"),Tee=gee(xee.exec),Cee={"\t":"t","\n":"n","\v":"v","\f":"f","\r":"r"},Oee=function(e){var t=kee(See(e,0),16);return t.length<3?"\\x"+bee(t,2,"0"):"\\u"+bee(t,4,"0")};pee({target:"RegExp",stat:!0,forced:!_ee||"\\x61b"!==_ee("ab")},{escape:function(e){yee(e);for(var t=e.length,r=wee(t),n=0;n=56320||n+1>=t||56320!=(64512&See(e,n+1))?r[n]=Oee(i):(r[n]=i,r[++n]=Eee(e,n))}}return Aee(r,"")}});var Ree=LN,Pee=MN.add;ii({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=Ree(this),t=0,r=arguments.length;t1?arguments[1]:void 0);return!1!==Xee(t,(function(e){if(!r(e,e,t))return!1}),!0)}});var Qee=So,ete=LN,tte=KN,rte=MN.Set,nte=MN.add;ii({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=ete(this),r=Qee(e,arguments.length>1?arguments[1]:void 0),n=new rte;return tte(t,(function(e){r(e,e,t)&&nte(n,e)})),n}});var ite=So,ote=LN,ste=KN;ii({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=ote(this),r=ite(e,arguments.length>1?arguments[1]:void 0),n=ste(t,(function(e){if(r(e,e,t))return{value:e}}),!0);return n&&n.value}}),ii({target:"Set",stat:!0,forced:!0},{from:d8(MN.Set,MN.add,!1)});var ate=d,cte=Kee,ute=Cz;ii({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return ate(ute,this,cte(e))}});var lte=d,dte=Kee,fte=Dz;ii({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return lte(fte,this,dte(e))}});var hte=d,pte=Kee,gte=Kz;ii({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return hte(gte,this,pte(e))}});var yte=d,mte=Kee,bte=eD;ii({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return yte(bte,this,mte(e))}});var vte=ii,wte=S,_te=LN,Ete=KN,Ste=yi,kte=wte([].join),Ate=wte([].push);vte({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=_te(this),r=void 0===e?",":Ste(e),n=[];return Ete(t,(function(e){Ate(n,e)})),kte(n,r)}});var xte=So,Ite=LN,Bte=KN,Tte=MN.Set,Cte=MN.add;ii({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=Ite(this),r=xte(e,arguments.length>1?arguments[1]:void 0),n=new Tte;return Bte(t,(function(e){Cte(n,r(e,e,t))})),n}}),ii({target:"Set",stat:!0,forced:!0},{of:$8(MN.Set,MN.add,!1)});var Ote=ve,Rte=LN,Pte=KN,Mte=TypeError;ii({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=Rte(this),r=arguments.length<2,n=r?void 0:arguments[1];if(Ote(e),Pte(t,(function(i){r?(r=!1,n=i):n=e(n,i,i,t)})),r)throw new Mte("Reduce of empty set with no initial value");return n}});var Ute=So,Lte=LN,jte=KN;ii({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=Lte(this),r=Ute(e,arguments.length>1?arguments[1]:void 0);return!0===jte(t,(function(e){if(r(e,e,t))return!0}),!0)}});var Nte=d,zte=Kee,Dte=uD;ii({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return Nte(Dte,this,zte(e))}});var Fte=d,qte=Kee,Hte=yD;ii({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return Fte(Hte,this,qte(e))}});var Vte=RD.charAt,$te=L,Kte=sn,Zte=yi;ii({target:"String",proto:!0,forced:!0},{at:function(e){var t=Zte($te(this)),r=t.length,n=Kte(e),i=n>=0?n:r+n;return i<0||i>=r?void 0:Vte(t,i)}});var Wte=S,Gte=z,Yte=yi,Jte=gn,Xte=TypeError,Qte=Wte([].push),ere=Wte([].join),tre=function(e){var t=Gte(e),r=Jte(t);if(!r)return"";for(var n=arguments.length,i=[],o=0;;){var s=t[o++];if(void 0===s)throw new Xte("Incorrect template");if(Qte(i,Yte(s)),o===r)return ere(i,"");o=r.length?ire(void 0,!0):(e=ure(r,n),t.index+=e.length,ire({codePoint:cre(e,0),position:n},!1))}));rre({target:"String",proto:!0,forced:!0},{codePoints:function(){return new hre(sre(ore(this)))}});var pre=S,gre=WeakMap.prototype,yre={WeakMap:WeakMap,set:pre(gre.set),get:pre(gre.get),has:pre(gre.has),remove:pre(gre.delete)},mre=K,bre=S,vre=String.fromCharCode,wre=mre("String","fromCodePoint"),_re=bre("".charAt),Ere=bre("".charCodeAt),Sre=bre("".indexOf),kre=bre("".slice),Are=function(e,t){var r=Ere(e,t);return r>=48&&r<=57},xre=function(e,t,r){if(r>=e.length)return-1;for(var n=0;t=48&&e<=57?e-48:e>=97&&e<=102?e-97+10:e>=65&&e<=70?e-65+10:-1},Bre=rA,Tre=ii,Cre=Yt.exports,Ore=S,Rre=Ta,Pre=Ut,Mre=De,Ure=F,Lre=gn,jre=Ct.f,Nre=Vi,zre=yre,Dre=tre,Fre=function(e){for(var t,r="",n=0,i=0;(i=Sre(e,"\\",i))>-1;){if(r+=kre(e,n,i),++i===e.length)return;var o=_re(e,i++);switch(o){case"b":r+="\b";break;case"t":r+="\t";break;case"n":r+="\n";break;case"v":r+="\v";break;case"f":r+="\f";break;case"r":r+="\r";break;case"\r":i1114111)return;r+=wre(t);break;default:if(Are(o,0))return;r+=o}n=i}return r+kre(e,n)},qre=lI,Hre=new zre.WeakMap,Vre=zre.get,$re=zre.has,Kre=zre.set,Zre=Array,Wre=TypeError,Gre=Object.freeze||Object,Yre=Object.isFrozen,Jre=Math.min,Xre=Ore("".charAt),Qre=Ore("".slice),ene=Ore("".split),tne=Ore(/./.exec),rne=/([\n\u2028\u2029]|\r\n?)/g,nne=RegExp("^["+qre+"]*"),ine=RegExp("[^"+qre+"]"),one="Invalid tag",sne=function(e){var t,r,n,i,o=Mre(e),s=Lre(o),a=Zre(s),c=Zre(s),u=0;if(!s)throw new Wre(one);for(;u0)throw new Wre("Invalid opening line");t[1]=""}if(d){if(1===t.length||tne(ine,t[t.length-1]))throw new Wre("Invalid closing line");t[t.length-2]="",t[t.length-1]=""}for(var f=2;f1?arguments[1]:void 0,i=r>2?arguments[2]:void 0;return new(Hne("Promise"))((function(r){Vne(t),r($ne(e,n,i))})).then((function(e){return Kne(Zne(t),e)}))}),!0);var Wne=Qo.filterReject,Gne=aZ,Yne=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("filterOut",(function(e){var t=Wne(Yne(this),e,arguments.length>1?arguments[1]:void 0);return Gne(this,t)}),!0);var Jne=Qo.filterReject,Xne=aZ,Qne=xv.aTypedArray;(0,xv.exportTypedArrayMethod)("filterReject",(function(e){var t=Jne(Qne(this),e,arguments.length>1?arguments[1]:void 0);return Xne(this,t)}),!0);var eie=wX,tie=xv.aTypedArray,rie=xv.getTypedArrayConstructor;(0,xv.exportTypedArrayMethod)("groupBy",(function(e){var t=arguments.length>1?arguments[1]:void 0;return eie(tie(this),e,t,rie)}),!0);var nie=gn,iie=B$,oie=ln,sie=O$,aie=sn,cie=s,uie=xv.aTypedArray,lie=xv.getTypedArrayConstructor,die=xv.exportTypedArrayMethod,fie=Math.max,hie=Math.min,pie=!cie((function(){var e=new Int8Array([1]),t=e.toSpliced(1,0,{valueOf:function(){return e[0]=2,3}});return 2!==t[0]||3!==t[1]}));die("toSpliced",(function(e,t){var r,n,i,o,s,a,c,u=uie(this),l=lie(u),d=nie(u),f=oie(e,d),h=arguments.length,p=0;if(0===h)r=n=0;else if(1===h)r=0,n=d-f;else if(n=hie(fie(aie(t),0),d-f),r=h-2){o=new l(r),i=iie(o);for(var g=2;g>16&255,i>>8&255,255&i];if(2===n){if(r&&0!==o[1])throw new Die("Extra bits");return[o[0]]}if(3===n){if(r&&0!==o[2])throw new Die("Extra bits");return[o[0],o[1]]}return o},$ie=function(e,t,r){for(var n=t.length,i=0;i0){if("stop-before-partial"===o)break;if("loose"!==o)throw new Die("Missing padding");if(1===u.length)throw new Die("Malformed padding: exactly one additional character");a=$ie(s,Vie(u,i,!1),a)}c=e.length;break}var d=qie(e,l);if(++l,"="===d){if(u.length<2)throw new Die("Padding is too early");if(l=Hie(e,l),2===u.length){if(l===e.length){if("stop-before-partial"===o)break;throw new Die("Malformed padding: only one =")}"="===qie(e,l)&&(++l,l=Hie(e,l))}if(l1?arguments[1]:void 0,null,9007199254740991);return Wie(Yie,t.bytes)}});var Jie=i,Xie=S,Qie=Jie.Uint8Array,eoe=Jie.SyntaxError,toe=Jie.parseInt,roe=Math.min,noe=/[^\da-f]/i,ioe=Xie(noe.exec),ooe=Xie("".slice),soe=function(e,t){var r=e.length;if(r%2!=0)throw new eoe("String should be an even number of characters");for(var n=t?roe(t.length,r/2):r/2,i=t||new Qie(n),o=0,s=0;s1?arguments[1]:void 0,this,this.length);return{read:t.read,written:t.written}}});var yoe=ii,moe=hee,boe=foe,voe=aw,woe=soe;i.Uint8Array&&yoe({target:"Uint8Array",proto:!0},{setFromHex:function(e){boe(this),moe(e),voe(this.buffer);var t=woe(e,this).read;return{read:t,written:t/2}}});var _oe=ii,Eoe=i,Soe=Sie,koe=foe,Aoe=aw,xoe=Cie,Ioe=Bie.i2c,Boe=Bie.i2cUrl,Toe=S("".charAt);Eoe.Uint8Array&&_oe({target:"Uint8Array",proto:!0},{toBase64:function(){var e=koe(this),t=arguments.length?Soe(arguments[0]):void 0,r="base64"===xoe(t)?Ioe:Boe,n=!!t&&!!t.omitPadding;Aoe(this.buffer);for(var i,o="",s=0,a=e.length,c=function(e){return Toe(r,i>>6*e&63)};s+2>(-2*a&6)));return o}});var Tse=ii,Cse=i,Ose=K,Rse=S,Pse=d,Mse=s,Use=yi,Lse=VO,jse=Bie.i2c,Nse=Ose("btoa"),zse=Rse("".charAt),Dse=Rse("".charCodeAt),Fse=!!Nse&&!Mse((function(){return"aGk="!==Nse("hi")})),qse=Fse&&!Mse((function(){Nse()})),Hse=Fse&&Mse((function(){return"bnVsbA=="!==Nse(null)})),Vse=Fse&&1!==Nse.length;Tse({global:!0,bind:!0,enumerable:!0,forced:!Fse||qse||Hse||Vse},{btoa:function(e){if(Lse(arguments.length,1),Fse)return Pse(Nse,Cse,Use(e));for(var t,r,n=Use(e),i="",o=0,s=jse;zse(n,o)||(s="=",o%1);){if((r=Dse(n,o+=3/4))>255)throw new(Ose("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");i+=zse(s,63&(t=t<<8|r)>>8-o%1*8)}return i}});var $se={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Kse=bt("span").classList,Zse=Kse&&Kse.constructor&&Kse.constructor.prototype,Wse=Zse===Object.prototype?void 0:Zse,Gse=i,Yse=$se,Jse=Wse,Xse=Hf,Qse=Gt,eae=function(e){if(e&&e.forEach!==Xse)try{Qse(e,"forEach",Xse)}catch(t){e.forEach=Xse}};for(var tae in Yse)Yse[tae]&&eae(Gse[tae]&&Gse[tae].prototype);eae(Jse);var rae=i,nae=$se,iae=Wse,oae=gp,sae=Gt,aae=yo,cae=nt("iterator"),uae=oae.values,lae=function(e,t){if(e){if(e[cae]!==uae)try{sae(e,cae,uae)}catch(t){e[cae]=uae}if(aae(e,t,!0),nae[t])for(var r in oae)if(e[r]!==oae[r])try{sae(e,r,oae[r])}catch(t){e[r]=oae[r]}}};for(var dae in nae)lae(rae[dae]&&rae[dae].prototype,dae);lae(iae,"DOMTokenList");var fae={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}},hae=ii,pae=K,gae=lw,yae=s,mae=qi,bae=b,vae=Ct.f,wae=Qr,_ae=Xi,Eae=He,Sae=mm,kae=Ut,Aae=Fu,xae=Xc,Iae=fae,Bae=au,Tae=Or,Cae=a,Oae="DOMException",Rae="DATA_CLONE_ERR",Pae=pae("Error"),Mae=pae(Oae)||function(){try{(new(pae("MessageChannel")||gae("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name===Rae&&25===e.code)return e.constructor}}(),Uae=Mae&&Mae.prototype,Lae=Pae.prototype,jae=Tae.set,Nae=Tae.getterFor(Oae),zae="stack"in new Pae(Oae),Dae=function(e){return Eae(Iae,e)&&Iae[e].m?Iae[e].c:0},Fae=function(){Sae(this,qae);var e=arguments.length,t=xae(e<1?void 0:arguments[0]),r=xae(e<2?void 0:arguments[1],"Error"),n=Dae(r);if(jae(this,{type:Oae,name:r,message:t,code:n}),Cae||(this.name=r,this.message=t,this.code=n),zae){var i=new Pae(t);i.name=Oae,vae(this,"stack",bae(1,Bae(i.stack,1)))}},qae=Fae.prototype=mae(Lae),Hae=function(e){return{enumerable:!0,configurable:!0,get:e}},Vae=function(e){return Hae((function(){return Nae(this)[e]}))};Cae&&(_ae(qae,"code",Vae("code")),_ae(qae,"message",Vae("message")),_ae(qae,"name",Vae("name"))),vae(qae,"constructor",bae(1,Fae));var $ae=yae((function(){return!(new Mae instanceof Pae)})),Kae=$ae||yae((function(){return Lae.toString!==Aae||"2: 1"!==String(new Mae(1,2))})),Zae=$ae||yae((function(){return 25!==new Mae(1,"DataCloneError").code}));$ae||25!==Mae[Rae]||Uae[Rae],hae({global:!0,constructor:!0,forced:$ae},{DOMException:$ae?Fae:Mae});var Wae=pae(Oae),Gae=Wae.prototype;for(var Yae in Kae&&Mae===Wae&&wae(Gae,"toString",Aae),Zae&&Cae&&Mae===Wae&&_ae(Gae,"code",Hae((function(){return Dae(kae(this).name)}))),Iae)if(Eae(Iae,Yae)){var Jae=Iae[Yae],Xae=Jae.s,Qae=bae(6,Jae.c);Eae(Wae,Xae)||vae(Wae,Xae,Qae),Eae(Gae,Xae)||vae(Gae,Xae,Qae)}var ece=ii,tce=i,rce=K,nce=b,ice=Ct.f,oce=He,sce=mm,ace=Yc,cce=Xc,uce=fae,lce=au,dce=a,fce="DOMException",hce=rce("Error"),pce=rce(fce),gce=function(){sce(this,yce);var e=arguments.length,t=cce(e<1?void 0:arguments[0]),r=cce(e<2?void 0:arguments[1],"Error"),n=new pce(t,r),i=new hce(t);return i.name=fce,ice(n,"stack",nce(1,lce(i.stack,1))),ace(n,this,gce),n},yce=gce.prototype=pce.prototype,mce="stack"in new hce(fce),bce="stack"in new pce(1,2),vce=pce&&dce&&Object.getOwnPropertyDescriptor(tce,fce),wce=!(!vce||vce.writable&&vce.configurable),_ce=mce&&!wce&&!bce;ece({global:!0,constructor:!0,forced:_ce},{DOMException:_ce?gce:pce});var Ece=rce(fce),Sce=Ece.prototype;if(Sce.constructor!==Ece)for(var kce in ice(Sce,"constructor",nce(1,Ece)),uce)if(oce(uce,kce)){var Ace=uce[kce],xce=Ace.s;oce(Ece,xce)||ice(Ece,xce,nce(6,Ace.c))}var Ice="DOMException";yo(K(Ice),Ice);var Bce=bR.clear;ii({global:!0,bind:!0,enumerable:!0,forced:i.clearImmediate!==Bce},{clearImmediate:Bce});var Tce=i,Cce=Ta,Oce=F,Rce=cg,Pce=Y,Mce=Vi,Uce=VO,Lce=Tce.Function,jce=/MSIE .\./.test(Pce)||"BUN"===Rce&&function(){var e=Tce.Bun.version.split(".");return e.length<3||"0"===e[0]&&(e[1]<3||"3"===e[1]&&"0"===e[2])}(),Nce=function(e,t){var r=t?2:1;return jce?function(n,i){var o=Uce(arguments.length,1)>r,s=Oce(n)?n:Lce(n),a=o?Mce(arguments,r):[],c=o?function(){Cce(s,this,a)}:s;return t?e(c,i):e(c)}:e},zce=ii,Dce=i,Fce=bR.set,qce=Nce,Hce=Dce.setImmediate?qce(Fce,!1):Fce;zce({global:!0,bind:!0,enumerable:!0,forced:Dce.setImmediate!==Hce},{setImmediate:Hce});var Vce=i,$ce=WR,Kce=ve,Zce=VO,Wce=a;ii({global:!0,enumerable:!0,dontCallGetSet:!0,forced:s((function(){return Wce&&1!==Object.getOwnPropertyDescriptor(Vce,"queueMicrotask").value.length}))},{queueMicrotask:function(e){Zce(arguments.length,1),$ce(Kce(e))}});var Gce=ii,Yce=i,Jce=Xi,Xce=a,Qce=TypeError,eue=Object.defineProperty,tue=Yce.self!==Yce;try{if(Xce){var rue=Object.getOwnPropertyDescriptor(Yce,"self");!tue&&rue&&rue.get&&rue.enumerable||Jce(Yce,"self",{get:function(){return Yce},set:function(e){if(this!==Yce)throw new Qce("Illegal invocation");eue(Yce,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else Gce({global:!0,simple:!0,forced:tue},{self:Yce})}catch($Ue){}var nue,iue=ii,oue=i,sue=K,aue=S,cue=s,uue=We,lue=F,due=No,fue=P,hue=H,pue=he,gue=Ul,yue=Ut,mue=hi,bue=He,vue=_d,wue=Gt,_ue=gn,Eue=VO,Sue=BL,kue=JA,Aue=MN,xue=KN,Iue=Sw,Bue=uu,Tue=gw,Cue=oue.Object,Oue=oue.Array,Rue=oue.Date,Pue=oue.Error,Mue=oue.TypeError,Uue=oue.PerformanceMark,Lue=sue("DOMException"),jue=kue.Map,Nue=kue.has,zue=kue.get,Due=kue.set,Fue=Aue.Set,que=Aue.add,Hue=Aue.has,Vue=sue("Object","keys"),$ue=aue([].push),Kue=aue((!0).valueOf),Zue=aue(1..valueOf),Wue=aue("".valueOf),Gue=aue(Rue.prototype.getTime),Yue=uue("structuredClone"),Jue="DataCloneError",Xue="Transferring",Que=function(e){return!cue((function(){var t=new oue.Set([7]),r=e(t),n=e(Cue(7));return r===t||!r.has(7)||!hue(n)||7!=+n}))&&e},ele=function(e,t){return!cue((function(){var r=new t,n=e({a:r,b:r});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===r.stack)}))},tle=oue.structuredClone,rle=!ele(tle,Pue)||!ele(tle,Lue)||(nue=tle,!!cue((function(){var e=nue(new oue.AggregateError([1],Yue,{cause:3}));return"AggregateError"!==e.name||1!==e.errors[0]||e.message!==Yue||3!==e.cause}))),nle=!tle&&Que((function(e){return new Uue(Yue,{detail:e}).detail})),ile=Que(tle)||nle,ole=function(e){throw new Lue("Uncloneable type: "+e,Jue)},sle=function(e,t){throw new Lue((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",Jue)},ale=function(e,t){return ile||sle(t),ile(e)},cle=function(e,t,r){if(Nue(t,e))return zue(t,e);var n,i,o,s,a,c;if("SharedArrayBuffer"===(r||mue(e)))n=ile?ile(e):e;else{var u=oue.DataView;u||lue(e.slice)||sle("ArrayBuffer");try{if(lue(e.slice)&&!e.resizable)n=e.slice(0);else{i=e.byteLength,o="maxByteLength"in e?{maxByteLength:e.maxByteLength}:void 0,n=new ArrayBuffer(i,o),s=new u(e),a=new u(n);for(c=0;c1&&!fue(arguments[1])?yue(arguments[1]):void 0,i=n?n.transfer:void 0;void 0!==i&&(r=function(e,t){if(!hue(e))throw new Mue("Transfer option cannot be converted to a sequence");var r=[];gue(e,(function(e){$ue(r,yue(e))}));for(var n,i,o,s,a,c=0,u=_ue(r),l=new Fue;c>1,e+=Ile(e/t);e>455;)e=Ile(e/35),n+=36;return Ile(n+36*e/(e+38))},jle=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r=55296&&i<=56319&&r=o&&nIle((_le-s)/d))throw new Ale(kle);for(s+=(l-o)*d,o=l,r=0;r_le)throw new Ale(kle);if(n===o){for(var f=s,h=36;;){var p=h<=a?1:h>=a+26?26:h-a;if(f0&&e&r;r>>=1)t++;return t},qde=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},Hde=function(e){for(var t=(e=Rde(e,Nde," ")).length,r="",n=0;nt){r+="%",n++;continue}var o=Dde(e,n+1);if(o!=o){r+=i,n++;continue}n+=2;var s=Fde(o);if(0===s)i=xde(o);else{if(1===s||s>4){r+="�",n++;continue}for(var a=[o],c=1;ct||"%"!==Tde(e,n));){var u=Dde(e,n+1);if(u!=u){n+=3;break}if(u>191||u<128)break;Ode(a,u),n+=2,c++}if(a.length!==s){r+="�";continue}var l=qde(a);null===l?r+="�":i=Ide(l)}}r+=i,n++}return r},Vde=/[!'()~]|%20/g,$de={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Kde=function(e){return $de[e]},Zde=function(e){return Rde(Ade(e),Vde,Kde)},Wde=Yle((function(e,t){yde(this,{type:gde,target:mde(e).entries,index:0,kind:t})}),pde,(function(){var e=bde(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,lde(void 0,!0);var n=t[r];switch(e.kind){case"keys":return lde(n.key,!1);case"values":return lde(n.value,!1)}return lde([n.key,n.value],!1)}),!0),Gde=function(e){this.entries=[],this.url=null,void 0!==e&&(ide(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Tde(e,0)?Lde(e,1):e:ode(e)))};Gde.prototype={type:pde,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,o,s,a,c=this.entries,u=ude(e);if(u)for(r=(t=cde(e,u)).next;!(n=qle(r,t)).done;){if(o=(i=cde(nde(n.value))).next,(s=qle(o,i)).done||(a=qle(o,i)).done||!qle(o,i).done)throw new kde("Expected sequence with length 2");Ode(c,{key:ode(s.value),value:ode(a.value)})}else for(var l in e)ede(e,l)&&Ode(c,{key:l,value:ode(e[l])})},parseQuery:function(e){if(e)for(var t,r,n=this.entries,i=Ude(e,"&"),o=0;o0?arguments[0]:void 0));Vle||(this.size=e.entries.length)},Jde=Yde.prototype;if(Wle(Jde,{append:function(e,t){var r=mde(this);dde(arguments.length,2),Ode(r.entries,{key:ode(e),value:ode(t)}),Vle||this.length++,r.updateURL()},delete:function(e){for(var t=mde(this),r=dde(arguments.length,1),n=t.entries,i=ode(e),o=r<2?void 0:arguments[1],s=void 0===o?o:ode(o),a=0;at.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=mde(this).entries,n=tde(e,arguments.length>1?arguments[1]:void 0),i=0;i1?efe(arguments[1]):{})}}),Qle(wde)){var tfe=function(e){return Xle(this,Ede),new wde(e,arguments.length>1?efe(arguments[1]):{})};Ede.constructor=tfe,tfe.prototype=Ede,Nle({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:tfe})}}var rfe,nfe=ii,ife=a,ofe=vle,sfe=i,afe=So,cfe=S,ufe=Qr,lfe=Xi,dfe=mm,ffe=He,hfe=vT,pfe=ih,gfe=Vi,yfe=RD.codeAt,mfe=function(e){var t,r,n=[],i=Ple(Rle(Mle(e),Sle,"."),".");for(t=0;t?@[\\\]^|]/,the=/[\0\t\n\r #/:<>?@[\\\]^|]/,rhe=/^[\u0000-\u0020]+/,nhe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ihe=/[\t\n\r]/g,ohe=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)Hfe(t,e%256),e=Cfe(e/256);return Mfe(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,o=0;o<8;o++)0!==e[o]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return i>r?n:t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=Ufe(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},she={},ahe=hfe({},she,{" ":1,'"':1,"<":1,">":1,"`":1}),che=hfe({},ahe,{"#":1,"?":1,"{":1,"}":1}),uhe=hfe({},che,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),lhe=function(e,t){var r=yfe(e,0);return r>32&&r<127&&!ffe(t,e)?e:encodeURIComponent(e)},dhe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},fhe=function(e,t){var r;return 2===e.length&&Pfe(Zfe,Rfe(e,0))&&(":"===(r=Rfe(e,1))||!t&&"|"===r)},hhe=function(e){var t;return e.length>1&&fhe(Ffe(e,0,2))&&(2===e.length||"/"===(t=Rfe(e,2))||"\\"===t||"?"===t||"#"===t)},phe=function(e){return"."===e||"%2e"===qfe(e)},ghe={},yhe={},mhe={},bhe={},vhe={},whe={},_he={},Ehe={},She={},khe={},Ahe={},xhe={},Ihe={},Bhe={},The={},Che={},Ohe={},Rhe={},Phe={},Mhe={},Uhe={},Lhe=function(e,t,r){var n,i,o,s=bfe(e);if(t){if(i=this.parse(s))throw new Bfe(i);this.searchParams=null}else{if(void 0!==r&&(n=new Lhe(r,!0)),i=this.parse(s,null,n))throw new Bfe(i);(o=xfe(new Afe)).bindURL(this),this.searchParams=o}};Lhe.prototype={type:"URL",parse:function(e,t,r){var n,i,o,s,a,c=this,u=t||ghe,l=0,d="",f=!1,h=!1,p=!1;for(e=bfe(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=Nfe(e,rhe,""),e=Nfe(e,nhe,"$1")),e=Nfe(e,ihe,""),n=pfe(e);l<=n.length;){switch(i=n[l],u){case ghe:if(!i||!Pfe(Zfe,i)){if(t)return Vfe;u=mhe;continue}d+=qfe(i),u=yhe;break;case yhe:if(i&&(Pfe(Wfe,i)||"+"===i||"-"===i||"."===i))d+=qfe(i);else{if(":"!==i){if(t)return Vfe;d="",u=mhe,l=0;continue}if(t&&(c.isSpecial()!==ffe(dhe,d)||"file"===d&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=d,t)return void(c.isSpecial()&&dhe[c.scheme]===c.port&&(c.port=null));d="","file"===c.scheme?u=Bhe:c.isSpecial()&&r&&r.scheme===c.scheme?u=bhe:c.isSpecial()?u=Ehe:"/"===n[l+1]?(u=vhe,l++):(c.cannotBeABaseURL=!0,jfe(c.path,""),u=Phe)}break;case mhe:if(!r||r.cannotBeABaseURL&&"#"!==i)return Vfe;if(r.cannotBeABaseURL&&"#"===i){c.scheme=r.scheme,c.path=gfe(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,u=Uhe;break}u="file"===r.scheme?Bhe:whe;continue;case bhe:if("/"!==i||"/"!==n[l+1]){u=whe;continue}u=She,l++;break;case vhe:if("/"===i){u=khe;break}u=Rhe;continue;case whe:if(c.scheme=r.scheme,i===rfe)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=gfe(r.path),c.query=r.query;else if("/"===i||"\\"===i&&c.isSpecial())u=_he;else if("?"===i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=gfe(r.path),c.query="",u=Mhe;else{if("#"!==i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=gfe(r.path),c.path.length--,u=Rhe;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=gfe(r.path),c.query=r.query,c.fragment="",u=Uhe}break;case _he:if(!c.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,u=Rhe;continue}u=khe}else u=She;break;case Ehe:if(u=She,"/"!==i||"/"!==Rfe(d,l+1))continue;l++;break;case She:if("/"!==i&&"\\"!==i){u=khe;continue}break;case khe:if("@"===i){f&&(d="%40"+d),f=!0,o=pfe(d);for(var g=0;g65535)return Kfe;c.port=c.isSpecial()&&b===dhe[c.scheme]?null:b,d=""}if(t)return;u=Ohe;continue}return Kfe}d+=i;break;case Bhe:if(c.scheme="file","/"===i||"\\"===i)u=The;else{if(!r||"file"!==r.scheme){u=Rhe;continue}switch(i){case rfe:c.host=r.host,c.path=gfe(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=gfe(r.path),c.query="",u=Mhe;break;case"#":c.host=r.host,c.path=gfe(r.path),c.query=r.query,c.fragment="",u=Uhe;break;default:hhe(Mfe(gfe(n,l),""))||(c.host=r.host,c.path=gfe(r.path),c.shortenPath()),u=Rhe;continue}}break;case The:if("/"===i||"\\"===i){u=Che;break}r&&"file"===r.scheme&&!hhe(Mfe(gfe(n,l),""))&&(fhe(r.path[0],!0)?jfe(c.path,r.path[0]):c.host=r.host),u=Rhe;continue;case Che:if(i===rfe||"/"===i||"\\"===i||"?"===i||"#"===i){if(!t&&fhe(d))u=Rhe;else if(""===d){if(c.host="",t)return;u=Ohe}else{if(s=c.parseHost(d))return s;if("localhost"===c.host&&(c.host=""),t)return;d="",u=Ohe}continue}d+=i;break;case Ohe:if(c.isSpecial()){if(u=Rhe,"/"!==i&&"\\"!==i)continue}else if(t||"?"!==i)if(t||"#"!==i){if(i!==rfe&&(u=Rhe,"/"!==i))continue}else c.fragment="",u=Uhe;else c.query="",u=Mhe;break;case Rhe:if(i===rfe||"/"===i||"\\"===i&&c.isSpecial()||!t&&("?"===i||"#"===i)){if(".."===(a=qfe(a=d))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(c.shortenPath(),"/"===i||"\\"===i&&c.isSpecial()||jfe(c.path,"")):phe(d)?"/"===i||"\\"===i&&c.isSpecial()||jfe(c.path,""):("file"===c.scheme&&!c.path.length&&fhe(d)&&(c.host&&(c.host=""),d=Rfe(d,0)+":"),jfe(c.path,d)),d="","file"===c.scheme&&(i===rfe||"?"===i||"#"===i))for(;c.path.length>1&&""===c.path[0];)zfe(c.path);"?"===i?(c.query="",u=Mhe):"#"===i&&(c.fragment="",u=Uhe)}else d+=lhe(i,che);break;case Phe:"?"===i?(c.query="",u=Mhe):"#"===i?(c.fragment="",u=Uhe):i!==rfe&&(c.path[0]+=lhe(i,she));break;case Mhe:t||"#"!==i?i!==rfe&&("'"===i&&c.isSpecial()?c.query+="%27":c.query+="#"===i?"%23":lhe(i,she)):(c.fragment="",u=Uhe);break;case Uhe:i!==rfe&&(c.fragment+=lhe(i,ahe))}l++}},parseHost:function(e){var t,r,n;if("["===Rfe(e,0)){if("]"!==Rfe(e,e.length-1))return $fe;if(t=function(e){var t,r,n,i,o,s,a,c=[0,0,0,0,0,0,0,0],u=0,l=null,d=0,f=function(){return Rfe(e,d)};if(":"===f()){if(":"!==Rfe(e,1))return;d+=2,l=++u}for(;f();){if(8===u)return;if(":"!==f()){for(t=r=0;r<4&&Pfe(Qfe,f());)t=16*t+Tfe(f(),16),d++,r++;if("."===f()){if(0===r)return;if(d-=r,u>6)return;for(n=0;f();){if(i=null,n>0){if(!("."===f()&&n<4))return;d++}if(!Pfe(Gfe,f()))return;for(;Pfe(Gfe,f());){if(o=Tfe(f(),10),null===i)i=o;else{if(0===i)return;i=10*i+o}if(i>255)return;d++}c[u]=256*c[u]+i,2!=++n&&4!==n||u++}if(4!==n)return;break}if(":"===f()){if(d++,!f())return}else if(f())return;c[u++]=t}else{if(null!==l)return;d++,l=++u}}if(null!==l)for(s=u-l,u=7;0!==u&&s>0;)a=c[u],c[u--]=c[l+s-1],c[l+--s]=a;else if(8!==u)return;return c}(Ffe(e,1,-1)),!t)return $fe;this.host=t}else if(this.isSpecial()){if(e=mfe(e),Pfe(ehe,e))return $fe;if(t=function(e){var t,r,n,i,o,s,a,c=Dfe(e,".");if(c.length&&""===c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n1&&"0"===Rfe(i,0)&&(o=Pfe(Yfe,i)?16:8,i=Ffe(i,8===o?1:2)),""===i)s=0;else{if(!Pfe(10===o?Xfe:8===o?Jfe:Qfe,i))return e;s=Tfe(i,o)}jfe(r,s)}for(n=0;n=Ofe(256,5-t))return null}else if(s>255)return null;for(a=Lfe(r),n=0;n1?arguments[1]:void 0,n=Sfe(t,new Lhe(e,!1,r));ife||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},Nhe=jhe.prototype,zhe=function(e,t){return{get:function(){return kfe(this)[e]()},set:t&&function(e){return kfe(this)[t](e)},configurable:!0,enumerable:!0}};if(ife&&(lfe(Nhe,"href",zhe("serialize","setHref")),lfe(Nhe,"origin",zhe("getOrigin")),lfe(Nhe,"protocol",zhe("getProtocol","setProtocol")),lfe(Nhe,"username",zhe("getUsername","setUsername")),lfe(Nhe,"password",zhe("getPassword","setPassword")),lfe(Nhe,"host",zhe("getHost","setHost")),lfe(Nhe,"hostname",zhe("getHostname","setHostname")),lfe(Nhe,"port",zhe("getPort","setPort")),lfe(Nhe,"pathname",zhe("getPathname","setPathname")),lfe(Nhe,"search",zhe("getSearch","setSearch")),lfe(Nhe,"searchParams",zhe("getSearchParams")),lfe(Nhe,"hash",zhe("getHash","setHash"))),ufe(Nhe,"toJSON",(function(){return kfe(this).serialize()}),{enumerable:!0}),ufe(Nhe,"toString",(function(){return kfe(this).serialize()}),{enumerable:!0}),Ife){var Dhe=Ife.createObjectURL,Fhe=Ife.revokeObjectURL;Dhe&&ufe(jhe,"createObjectURL",afe(Dhe,Ife)),Fhe&&ufe(jhe,"revokeObjectURL",afe(Fhe,Ife))}vfe(jhe,"URL"),nfe({global:!0,constructor:!0,forced:!ofe,sham:!ife},{URL:jhe});var qhe=ii,Hhe=s,Vhe=VO,$he=yi,Khe=vle,Zhe=K("URL"),Whe=Khe&&Hhe((function(){Zhe.canParse()})),Ghe=Hhe((function(){return 1!==Zhe.canParse.length}));qhe({target:"URL",stat:!0,forced:!Whe||Ghe},{canParse:function(e){var t=Vhe(arguments.length,1),r=$he(e),n=t<2||void 0===arguments[1]?void 0:$he(arguments[1]);try{return!!new Zhe(r,n)}catch(e){return!1}}});var Yhe=ii,Jhe=VO,Xhe=yi,Qhe=vle,epe=K("URL");Yhe({target:"URL",stat:!0,forced:!Qhe},{parse:function(e){var t=Jhe(arguments.length,1),r=Xhe(e),n=t<2||void 0===arguments[1]?void 0:Xhe(arguments[1]);try{return new epe(r,n)}catch(e){return null}}});var tpe=d;ii({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return tpe(URL.prototype.toString,this)}});var rpe=Qr,npe=S,ipe=yi,ope=VO,spe=URLSearchParams,ape=spe.prototype,cpe=npe(ape.append),upe=npe(ape.delete),lpe=npe(ape.forEach),dpe=npe([].push),fpe=new spe("a=1&a=2&b=3");fpe.delete("a",1),fpe.delete("b",void 0),fpe+""!="a=2"&&rpe(ape,"delete",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return upe(this,e);var n=[];lpe(this,(function(e,t){dpe(n,{key:t,value:e})})),ope(t,1);for(var i,o=ipe(e),s=ipe(r),a=0,c=0,u=!1,l=n.length;a>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}function Mpe(e,t,r){function n(e,n,i,o){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r>>9<<4)+1}function Lpe(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function jpe(e,t,r,n,i,o){return Lpe((s=Lpe(Lpe(t,e),Lpe(n,o)))<<(a=i)|s>>>32-a,r);var s,a}function Npe(e,t,r,n,i,o,s){return jpe(t&r|~t&n,e,t,i,o,s)}function zpe(e,t,r,n,i,o,s){return jpe(t&n|r&~n,e,t,i,o,s)}function Dpe(e,t,r,n,i,o,s){return jpe(t^r^n,e,t,i,o,s)}function Fpe(e,t,r,n,i,o,s){return jpe(r^(t|~n),e,t,i,o,s)}Mpe("v3",48,(function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r>5]>>>i%32&255,o=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[n/8])<>>32-t}Mpe("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r>>0;u=c,c=a,a=$pe(s,30)>>>0,s=i,i=o}r[0]=r[0]+i>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+a>>>0,r[3]=r[3]+c>>>0,r[4]=r[4]+u>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}));var Kpe="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Zpe=[],Wpe=[],Gpe="undefined"!=typeof Uint8Array?Uint8Array:Array,Ype=!1;function Jpe(){Ype=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Zpe[t]=e[t],Wpe[e.charCodeAt(t)]=t;Wpe["-".charCodeAt(0)]=62,Wpe["_".charCodeAt(0)]=63}function Xpe(e,t,r){for(var n,i,o=[],s=t;s>18&63]+Zpe[i>>12&63]+Zpe[i>>6&63]+Zpe[63&i]);return o.join("")}function Qpe(e){var t;Ype||Jpe();for(var r=e.length,n=r%3,i="",o=[],s=16383,a=0,c=r-n;ac?c:a+s));return 1===n?(t=e[r-1],i+=Zpe[t>>2],i+=Zpe[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=Zpe[t>>10],i+=Zpe[t>>4&63],i+=Zpe[t<<2&63],i+="="),o.push(i),o.join("")}function ege(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,d=r?i-1:0,f=r?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=u}return(h?-1:1)*s*Math.pow(2,o-n)}function tge(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(s=s<0;e[r+h]=255&s,h+=p,s/=256,u-=8);e[r+h-p]|=128*g}var rge={}.toString,nge=Array.isArray||function(e){return"[object Array]"==rge.call(e)};age.TYPED_ARRAY_SUPPORT=void 0===Kpe.TYPED_ARRAY_SUPPORT||Kpe.TYPED_ARRAY_SUPPORT;var ige=oge();function oge(){return age.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function sge(e,t){if(oge()=oge())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oge().toString(16)+" bytes");return 0|e}function hge(e){return!(null==e||!e._isBuffer)}function pge(e,t){if(hge(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Fge(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return qge(e).length;default:if(n)return Fge(e).length;t=(""+t).toLowerCase(),n=!0}}function gge(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Cge(this,t,r);case"utf8":case"utf-8":return xge(this,t,r);case"ascii":return Bge(this,t,r);case"latin1":case"binary":return Tge(this,t,r);case"base64":return Age(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oge(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function yge(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function mge(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=age.from(t,n)),hge(t))return 0===t.length?-1:bge(e,t,r,n,i);if("number"==typeof t)return t&=255,age.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):bge(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function bge(e,t,r,n,i){var o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){for(var d=!0,f=0;fi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function Age(e,t,r){return 0===t&&r===e.length?Qpe(e):Qpe(e.slice(t,r))}function xge(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+d<=r)switch(d){case 1:u<128&&(l=u);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=d}return function(e){var t=e.length;if(t<=Ige)return String.fromCharCode.apply(String,e);for(var r="",n=0;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},age.prototype.compare=function(e,t,r,n,i){if(!hge(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(n,i),u=e.slice(t,r),l=0;li)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return vge(this,e,t,r);case"utf8":case"utf-8":return wge(this,e,t,r);case"ascii":return _ge(this,e,t,r);case"latin1":case"binary":return Ege(this,e,t,r);case"base64":return Sge(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kge(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},age.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Ige=4096;function Bge(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function Pge(e,t,r,n,i,o){if(!hge(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Mge(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function Uge(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function Lge(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function jge(e,t,r,n,i){return i||Lge(e,0,r,4),tge(e,t,r,n,23,4),r+4}function Nge(e,t,r,n,i){return i||Lge(e,0,r,8),tge(e,t,r,n,52,8),r+8}age.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},age.prototype.readUInt8=function(e,t){return t||Rge(e,1,this.length),this[e]},age.prototype.readUInt16LE=function(e,t){return t||Rge(e,2,this.length),this[e]|this[e+1]<<8},age.prototype.readUInt16BE=function(e,t){return t||Rge(e,2,this.length),this[e]<<8|this[e+1]},age.prototype.readUInt32LE=function(e,t){return t||Rge(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},age.prototype.readUInt32BE=function(e,t){return t||Rge(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},age.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||Rge(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},age.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||Rge(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},age.prototype.readInt8=function(e,t){return t||Rge(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},age.prototype.readInt16LE=function(e,t){t||Rge(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},age.prototype.readInt16BE=function(e,t){t||Rge(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},age.prototype.readInt32LE=function(e,t){return t||Rge(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},age.prototype.readInt32BE=function(e,t){return t||Rge(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},age.prototype.readFloatLE=function(e,t){return t||Rge(e,4,this.length),ege(this,e,!0,23,4)},age.prototype.readFloatBE=function(e,t){return t||Rge(e,4,this.length),ege(this,e,!1,23,4)},age.prototype.readDoubleLE=function(e,t){return t||Rge(e,8,this.length),ege(this,e,!0,52,8)},age.prototype.readDoubleBE=function(e,t){return t||Rge(e,8,this.length),ege(this,e,!1,52,8)},age.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||Pge(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},age.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Pge(this,e,t,1,255,0),age.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},age.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Pge(this,e,t,2,65535,0),age.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Mge(this,e,t,!0),t+2},age.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Pge(this,e,t,2,65535,0),age.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Mge(this,e,t,!1),t+2},age.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Pge(this,e,t,4,4294967295,0),age.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Uge(this,e,t,!0),t+4},age.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Pge(this,e,t,4,4294967295,0),age.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Uge(this,e,t,!1),t+4},age.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Pge(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},age.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Pge(this,e,t,1,127,-128),age.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},age.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Pge(this,e,t,2,32767,-32768),age.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Mge(this,e,t,!0),t+2},age.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Pge(this,e,t,2,32767,-32768),age.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Mge(this,e,t,!1),t+2},age.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Pge(this,e,t,4,2147483647,-2147483648),age.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Uge(this,e,t,!0),t+4},age.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Pge(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),age.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Uge(this,e,t,!1),t+4},age.prototype.writeFloatLE=function(e,t,r){return jge(this,e,t,!0,r)},age.prototype.writeFloatBE=function(e,t,r){return jge(this,e,t,!1,r)},age.prototype.writeDoubleLE=function(e,t,r){return Nge(this,e,t,!0,r)},age.prototype.writeDoubleBE=function(e,t,r){return Nge(this,e,t,!1,r)},age.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!age.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function qge(e){return function(e){var t,r,n,i,o,s;Ype||Jpe();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[a-2]?2:"="===e[a-1]?1:0,s=new Gpe(3*a/4-o),n=o>0?a-4:a;var c=0;for(t=0,r=0;t>16&255,s[c++]=i>>8&255,s[c++]=255&i;return 2===o?(i=Wpe[e.charCodeAt(t)]<<2|Wpe[e.charCodeAt(t+1)]>>4,s[c++]=255&i):1===o&&(i=Wpe[e.charCodeAt(t)]<<10|Wpe[e.charCodeAt(t+1)]<<4|Wpe[e.charCodeAt(t+2)]>>2,s[c++]=i>>8&255,s[c++]=255&i),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(zge,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Hge(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Vge(e){return null!=e&&(!!e._isBuffer||$ge(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&$ge(e.slice(0,0))}(e))}function $ge(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Kge=Object.freeze({__proto__:null,Buffer:age,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),age.alloc(+e)},isBuffer:Vge,kMaxLength:ige});function Zge(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wge(){}function Gge(){Gge.init.call(this)}function Yge(e){return void 0===e._maxListeners?Gge.defaultMaxListeners:e._maxListeners}function Jge(e,t,r,n){var i,o,s,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]):(o=e._events=new Wge,e._eventsCount=0),s){if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),!s.warned&&(i=Yge(e))&&i>0&&s.length>i){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=o[t]=r,++e._eventsCount;return e}function Xge(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function Qge(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function eye(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}Wge.prototype=Object.create(null),Gge.EventEmitter=Gge,Gge.usingDomains=!1,Gge.prototype.domain=void 0,Gge.prototype._events=void 0,Gge.prototype._maxListeners=void 0,Gge.defaultMaxListeners=10,Gge.init=function(){this.domain=null,Gge.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Wge,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Gge.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Gge.prototype.getMaxListeners=function(){return Yge(this)},Gge.prototype.emit=function(e){var t,r,n,i,o,s,a,c="error"===e;if(s=this._events)c=c&&null==s.error;else if(!c)return!1;if(a=this.domain,c){if(t=arguments[1],!a){if(t instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(r=s[e]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,i=eye(e,n),o=0;o0;)if(r[o]===t||r[o].listener&&r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new Wge,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]};var tye=Object.freeze({__proto__:null,default:Gge,EventEmitter:Gge});const rye="PROMISES",nye="CALLBACK";class iye{static isCallbackAdapterRequest(e){return void 0!==e.id}constructor(e){this.setStrategy(e)}setHandler(e){return this.handler=e,this}request(e,t){if(!this.handler)throw new Error("No handler defined for Adapter");return iye.isCallbackAdapterRequest(e)?this.handler({network:t,id:e.id,name:e.method,params:e.params,object:e.params}):this.handler({name:e.method,network:t,params:e.params,object:e.params})}setStrategy(e){return this.strategy=e,this}getStrategy(){return this.strategy}}class oye extends Error{constructor(e,t){super(),this.code=e,this.message=t}toString(){return`${this.message} (${this.code})`}}var sye=Object.defineProperty,aye=Object.defineProperties,cye=Object.getOwnPropertyDescriptors,uye=Object.getOwnPropertySymbols,lye=Object.prototype.hasOwnProperty,dye=Object.prototype.propertyIsEnumerable,fye=(e,t,r)=>t in e?sye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class hye extends iye{constructor(){super(nye),this.callback=new Map}async request(e,t){return new Promise(((r,n)=>{const i=(new Date).getTime()+Math.floor(1e3*Math.random());this.callback.set(i.toString(),{reject:n,resolve:r}),super.request(((e,t)=>aye(e,cye(t)))(((e,t)=>{for(var r in t||(t={}))lye.call(t,r)&&fye(e,r,t[r]);if(uye)for(var r of uye(t))dye.call(t,r)&&fye(e,r,t[r]);return e})({},e),{id:i}),t)}))}sendResponse(e,t){if(this.callback.has(e.toString())){const r=this.callback.get(e.toString());this.callback.delete(e.toString()),null==r||r.resolve(t)}else console.error(`Unable to find callback for requestId: ${e}`)}sendError(e,t){if(this.callback.has(e.toString())){const r=this.callback.get(e.toString());this.callback.delete(e.toString());let n=t;"string"==typeof n&&!isNaN(parseInt(n,10))&&(n=new oye(parseInt(n,10),n)),null==r||r.reject(n)}else console.error(`Unable to find callback for requestId: ${e}`)}}class pye extends iye{constructor(){super(rye)}request(e,t){return super.request(e,t)}}class gye extends Gge{setAdapter(e){return this.adapter=e,this}async request(e){try{if(!this.adapter)throw new Error("No adapter set, maybe you forgot to register the provider?");const t=await this.adapter.request(e,this.getNetwork());return this.emit("onResponseReady",e,t),t}catch(e){throw e}}sendResponse(e,t){if(!this.adapter)throw new Error("Adapter not found");if(this.adapter.getStrategy()!==nye)throw new Error("Trying to send callback request on promisified adapter");this.adapter.sendResponse(e,t)}sendError(e,t){if(!this.adapter)throw new Error("Adapter not found");if(this.adapter.getStrategy()!==nye)throw new Error("Trying to send callback request on promisified adapter");this.adapter.sendError(e,t)}}class yye{constructor(e){const t=e.strategy===nye?new hye:new pye;e.handler&&t.setHandler(e.handler),this.setAdapter(t)}setHandler(e){this.adapter.setHandler(e)}setAdapter(e){return this.adapter=e,this}registerProvider(e){return e.setAdapter(this.adapter),this}registerProviders(e){return e.forEach((e=>this.registerProvider(e))),this}sendResponse(e,t){"CALLBACK"===this.adapter.getStrategy()&&this.adapter.sendResponse(e,t)}sendError(e,t){"CALLBACK"===this.adapter.getStrategy()&&this.adapter.sendError(e,t)}}function mye(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function bye(e,...t){if(!function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function vye(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")}const wye="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,_ye=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Eye=(e,t)=>e<<32-t|e>>>t;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Sye(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),bye(e),e}class kye{clone(){return this._cloneInto()}}function Aye(e){const t=t=>e().update(Sye(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function xye(e=32){if(wye&&"function"==typeof wye.getRandomValues)return wye.getRandomValues(new Uint8Array(e));if(wye&&"function"==typeof wye.randomBytes)return wye.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}const Iye=(e,t,r)=>e&t^~e&r,Bye=(e,t,r)=>e&t^e&r^t&r;class Tye extends kye{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=_ye(this.buffer)}update(e){vye(this);const{view:t,buffer:r,blockLen:n}=this,i=(e=Sye(e)).length;for(let o=0;on-o&&(this.process(r,0),o=0);for(let e=o;e>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=_ye(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e>Oye&Cye)}:{h:0|Number(e>>Oye&Cye),l:0|Number(e&Cye)}}const Pye={fromBig:Rye,split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<>>32-r,rotlSL:(e,t,r)=>t<>>32-r,rotlBH:(e,t,r)=>t<>>64-r,rotlBL:(e,t,r)=>e<>>64-r,add:function(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},[Mye,Uye]=(()=>Pye.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),Lye=new Uint32Array(80),jye=new Uint32Array(80);class Nye extends Tye{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:g}=this;return[e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,g]}set(e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)Lye[r]=e.getUint32(t),jye[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|Lye[e-15],r=0|jye[e-15],n=Pye.rotrSH(t,r,1)^Pye.rotrSH(t,r,8)^Pye.shrSH(t,r,7),i=Pye.rotrSL(t,r,1)^Pye.rotrSL(t,r,8)^Pye.shrSL(t,r,7),o=0|Lye[e-2],s=0|jye[e-2],a=Pye.rotrSH(o,s,19)^Pye.rotrBH(o,s,61)^Pye.shrSH(o,s,6),c=Pye.rotrSL(o,s,19)^Pye.rotrBL(o,s,61)^Pye.shrSL(o,s,6),u=Pye.add4L(i,c,jye[e-7],jye[e-16]),l=Pye.add4H(u,n,a,Lye[e-7],Lye[e-16]);Lye[e]=0|l,jye[e]=0|u}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:d,Fh:f,Fl:h,Gh:p,Gl:g,Hh:y,Hl:m}=this;for(let e=0;e<80;e++){const t=Pye.rotrSH(l,d,14)^Pye.rotrSH(l,d,18)^Pye.rotrBH(l,d,41),b=Pye.rotrSL(l,d,14)^Pye.rotrSL(l,d,18)^Pye.rotrBL(l,d,41),v=l&f^~l&p,w=d&h^~d&g,_=Pye.add5L(m,b,w,Uye[e],jye[e]),E=Pye.add5H(_,y,t,v,Mye[e],Lye[e]),S=0|_,k=Pye.rotrSH(r,n,28)^Pye.rotrBH(r,n,34)^Pye.rotrBH(r,n,39),A=Pye.rotrSL(r,n,28)^Pye.rotrBL(r,n,34)^Pye.rotrBL(r,n,39),x=r&i^r&s^i&s,I=n&o^n&a^o&a;y=0|p,m=0|g,p=0|f,g=0|h,f=0|l,h=0|d,({h:l,l:d}=Pye.add(0|c,0|u,0|E,0|S)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|r,o=0|n;const B=Pye.add3L(S,A,I);r=Pye.add3H(B,E,k,x),n=0|B}({h:r,l:n}=Pye.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=Pye.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=Pye.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=Pye.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:d}=Pye.add(0|this.Eh,0|this.El,0|l,0|d)),({h:f,l:h}=Pye.add(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:g}=Pye.add(0|this.Gh,0|this.Gl,0|p,0|g)),({h:y,l:m}=Pye.add(0|this.Hh,0|this.Hl,0|y,0|m)),this.set(r,n,i,o,s,a,c,u,l,d,f,h,p,g,y,m)}roundClean(){Lye.fill(0),jye.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const zye=Aye((()=>new Nye)),Dye=BigInt(0),Fye=BigInt(1),qye=BigInt(2);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Hye(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function Vye(e){if(!Hye(e))throw new Error("Uint8Array expected")}function $ye(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)}const Kye=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Zye(e){Vye(e);let t="";for(let r=0;r=Yye&&e<=Jye?e-Yye:e>=Xye&&e<=Qye?e-(Xye-10):e>=eme&&e<=tme?e-(eme-10):void 0}function nme(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t"bigint"==typeof e&&Dye<=e;function dme(e,t,r){return lme(e)&&lme(t)&&lme(r)&&t<=e&&eDye;e>>=Fye,t+=1);return t}const pme=e=>(qye<new Uint8Array(e),yme=e=>Uint8Array.from(e);function mme(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=gme(e),i=gme(e),o=0;const s=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),c=(e=gme())=>{i=a(yme([0]),e),n=a(),0!==e.length&&(i=a(yme([1]),e),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e{let r;for(s(),c(e);!(r=t(u()));)c();return s(),r}}const bme={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||Hye(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function vme(e,t,r={}){const n=(t,r,n)=>{const i=bme[r];if("function"!=typeof i)throw new Error("invalid validator function");const o=e[t];if(!(n&&void 0===o||i(o,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+o)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}function wme(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(void 0!==i)return i;const o=e(r,...n);return t.set(r,o),o}}var _me=Object.freeze({__proto__:null,isBytes:Hye,abytes:Vye,abool:$ye,bytesToHex:Zye,numberToHexUnpadded:Wye,hexToNumber:Gye,hexToBytes:nme,bytesToNumberBE:ime,bytesToNumberLE:ome,numberToBytesBE:sme,numberToBytesLE:ame,numberToVarBytesBE:function(e){return nme(Wye(e))},ensureBytes:cme,concatBytes:ume,equalBytes:function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n>BigInt(t)&Fye},bitSet:function(e,t,r){return e|(r?Fye:Dye)<{throw new Error("not implemented")},memoized:wme});/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Eme=BigInt(0),Sme=BigInt(1),kme=BigInt(2),Ame=BigInt(3),xme=BigInt(4),Ime=BigInt(5),Bme=BigInt(8);function Tme(e,t){const r=e%t;return r>=Eme?r:t+r}function Cme(e,t,r){if(tEme;)t&Sme&&(n=n*e%r),e=e*e%r,t>>=Sme;return n}function Ome(e,t,r){let n=e;for(;t-- >Eme;)n*=n,n%=r;return n}function Rme(e,t){if(e===Eme)throw new Error("invert: expected non-zero number");if(t<=Eme)throw new Error("invert: expected positive modulus, got "+t);let r=Tme(e,t),n=t,i=Eme,o=Sme;for(;r!==Eme;){const e=n%r,t=i-o*(n/r);n=r,r=e,i=o,o=t}if(n!==Sme)throw new Error("invert: does not exist");return Tme(i,t)}function Pme(e){if(e%xme===Ame){const t=(e+Sme)/xme;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%Bme===Ime){const t=(e-Ime)/Bme;return function(e,r){const n=e.mul(r,kme),i=e.pow(n,t),o=e.mul(r,i),s=e.mul(e.mul(o,kme),i),a=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),r))throw new Error("Cannot find square root");return a}}return function(e){const t=(e-Sme)/kme;let r,n,i;for(r=e-Sme,n=0;r%kme===Eme;r/=kme,n++);for(i=kme;i1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===n){const t=(e+Sme)/xme;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const o=(r+Sme)/kme;return function(e,s){if(e.pow(s,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let a=n,c=e.pow(e.mul(e.ONE,i),r),u=e.pow(s,o),l=e.pow(s,r);for(;!e.eql(l,e.ONE);){if(e.eql(l,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(l);t 0, got "+e);const{nBitLength:i,nByteLength:o}=Ume(e,t);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const a=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:pme(i),ZERO:Eme,ONE:Sme,create:t=>Tme(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return Eme<=t&&te===Eme,isOdd:e=>(e&Sme)===Sme,neg:t=>Tme(-t,e),eql:(e,t)=>e===t,sqr:t=>Tme(t*t,e),add:(t,r)=>Tme(t+r,e),sub:(t,r)=>Tme(t-r,e),mul:(t,r)=>Tme(t*r,e),pow:(e,t)=>function(e,t,r){if(rEme;)r&Sme&&(n=e.mul(n,i)),i=e.sqr(i),r>>=Sme;return n}(a,e,t),div:(t,r)=>Tme(t*Rme(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Rme(t,e),sqrt:n.sqrt||(t=>(s||(s=Pme(e)),s(a,t))),invertBatch:e=>function(e,t){const r=new Array(t.length),n=t.reduce(((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n))),e.ONE),i=e.inv(n);return t.reduceRight(((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n))),i),r}(a,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?ame(e,o):sme(e,o),fromBytes:e=>{if(e.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+e.length);return r?ome(e):ime(e)}});return Object.freeze(a)}function jme(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Nme(e){const t=jme(e);return t+Math.ceil(t/2)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zme=BigInt(0),Dme=BigInt(1);function Fme(e,t){const r=t.negate();return e?r:t}function qme(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Hme(e,t){return qme(e,t),{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}const Vme=new WeakMap,$me=new WeakMap;function Kme(e){return $me.get(e)||1}function Zme(e,t){return{constTimeNegate:Fme,hasPrecomputes:e=>1!==Kme(e),unsafeLadder(t,r,n=e.ZERO){let i=t;for(;r>zme;)r&Dme&&(n=n.add(i)),i=i.double(),r>>=Dme;return n},precomputeWindow(e,r){const{windows:n,windowSize:i}=Hme(r,t),o=[];let s=e,a=s;for(let e=0;e>=d,r>s&&(r-=l,i+=Dme);const o=t,f=t+Math.abs(r)-1,h=e%2!=0,p=r<0;0===r?c=c.add(Fme(h,n[o])):a=a.add(Fme(p,n[f]))}return{p:a,f:c}},wNAFUnsafe(r,n,i,o=e.ZERO){const{windows:s,windowSize:a}=Hme(r,t),c=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let e=0;e>=l,r>a&&(r-=u,i+=Dme),0===r)continue;let s=n[t+Math.abs(r)-1];r<0&&(s=s.negate()),o=o.add(s)}return o},getPrecomputes(e,t,r){let n=Vme.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&Vme.set(t,r(n))),n},wNAFCached(e,t,r){const n=Kme(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){const i=Kme(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){qme(r,t),$me.set(e,r),Vme.delete(e)}}}function Wme(e,t,r,n){if(function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach(((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)}))}(r,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach(((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)}))}(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,o=hme(BigInt(r.length)),s=o>12?o-3:o>4?o-2:o?2:1,a=(1<=0;e-=s){c.fill(i);for(let t=0;t>BigInt(e)&BigInt(a));c[o]=c[o].add(r[t])}let t=i;for(let e=c.length-1,r=i;e>0;e--)r=r.add(c[e]),t=t.add(r);if(u=u.add(t),0!==e)for(let e=0;e(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});vme(e,t)}(e.Fp),vme(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ume(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Yme=BigInt(0),Jme=BigInt(1),Xme=BigInt(2),Qme=BigInt(8),ebe={zip215:!0};function tbe(e){const t=function(e){const t=Gme(e);return vme(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:r,n:n,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=t,u=Xme<{try{return{isValid:!0,value:r.sqrt(e*r.inv(t))}}catch(e){return{isValid:!1,value:Yme}}}),h=t.adjustScalarBytes||(e=>e),p=t.domain||((e,t,r)=>{if($ye("phflag",r),t.length||r)throw new Error("Contexts/pre-hash are not supported");return e});function g(e,t){fme("coordinate "+e,t,Yme,u)}function y(e){if(!(e instanceof v))throw new Error("ExtendedPoint expected")}const m=wme(((e,t)=>{const{ex:n,ey:i,ez:o}=e,s=e.is0();null==t&&(t=s?Qme:r.inv(o));const a=l(n*t),c=l(i*t),u=l(o*t);if(s)return{x:Yme,y:Jme};if(u!==Jme)throw new Error("invZ was invalid");return{x:a,y:c}})),b=wme((e=>{const{a:r,d:n}=t;if(e.is0())throw new Error("bad point: ZERO");const{ex:i,ey:o,ez:s,et:a}=e,c=l(i*i),u=l(o*o),d=l(s*s),f=l(d*d),h=l(c*r);if(l(d*l(h+u))!==l(f+l(n*l(c*u))))throw new Error("bad point: equation left != right (1)");if(l(i*o)!==l(s*a))throw new Error("bad point: equation left != right (2)");return!0}));class v{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,g("x",e),g("y",t),g("z",r),g("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof v)throw new Error("extended point not allowed");const{x:t,y:r}=e||{};return g("x",t),g("y",r),new v(t,r,Jme,l(t*r))}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.ez)));return e.map(((e,r)=>e.toAffine(t[r]))).map(v.fromAffine)}static msm(e,t){return Wme(v,d,e,t)}_setWindowSize(e){E.setWindowSize(this,e)}assertValidity(){b(this)}equals(e){y(e);const{ex:t,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=e,a=l(t*s),c=l(i*n),u=l(r*s),d=l(o*n);return a===c&&u===d}is0(){return this.equals(v.ZERO)}negate(){return new v(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:e}=t,{ex:r,ey:n,ez:i}=this,o=l(r*r),s=l(n*n),a=l(Xme*l(i*i)),c=l(e*o),u=r+n,d=l(l(u*u)-o-s),f=c+s,h=f-a,p=c-s,g=l(d*h),y=l(f*p),m=l(d*p),b=l(h*f);return new v(g,y,b,m)}add(e){y(e);const{a:r,d:n}=t,{ex:i,ey:o,ez:s,et:a}=this,{ex:c,ey:u,ez:d,et:f}=e;if(r===BigInt(-1)){const e=l((o-i)*(u+c)),t=l((o+i)*(u-c)),r=l(t-e);if(r===Yme)return this.double();const n=l(s*Xme*f),h=l(a*Xme*d),p=h+n,g=t+e,y=h-n,m=l(p*r),b=l(g*y),w=l(p*y),_=l(r*g);return new v(m,b,_,w)}const h=l(i*c),p=l(o*u),g=l(a*n*f),m=l(s*d),b=l((i+o)*(c+u)-h-p),w=m-g,_=m+g,E=l(p-r*h),S=l(b*w),k=l(_*E),A=l(b*E),x=l(w*_);return new v(S,k,x,A)}subtract(e){return this.add(e.negate())}wNAF(e){return E.wNAFCached(this,e,v.normalizeZ)}multiply(e){const t=e;fme("scalar",t,Jme,n);const{p:r,f:i}=this.wNAF(t);return v.normalizeZ([r,i])[0]}multiplyUnsafe(e,t=v.ZERO){const r=e;return fme("scalar",r,Yme,n),r===Yme?_:this.is0()||r===Jme?this:E.wNAFCachedUnsafe(this,r,v.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return E.unsafeLadder(this,n).is0()}toAffine(e){return m(this,e)}clearCofactor(){const{h:e}=t;return e===Jme?this:this.multiplyUnsafe(e)}static fromHex(e,n=!1){const{d:i,a:o}=t,s=r.BYTES;e=cme("pointHex",e,s),$ye("zip215",n);const a=e.slice(),c=e[s-1];a[s-1]=-129&c;const d=ome(a),h=n?u:r.ORDER;fme("pointHex.y",d,Yme,h);const p=l(d*d),g=l(p-Jme),y=l(i*p-o);let{isValid:m,value:b}=f(g,y);if(!m)throw new Error("Point.fromHex: invalid y coordinate");const w=(b&Jme)===Jme,_=!!(128&c);if(!n&&b===Yme&&_)throw new Error("Point.fromHex: x=0 and x_0=1");return _!==w&&(b=l(-b)),v.fromAffine({x:b,y:d})}static fromPrivateKey(e){return A(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),n=ame(t,r.BYTES);return n[n.length-1]|=e&Jme?128:0,n}toHex(){return Zye(this.toRawBytes())}}v.BASE=new v(t.Gx,t.Gy,Jme,l(t.Gx*t.Gy)),v.ZERO=new v(Yme,Jme,Jme,Yme);const{BASE:w,ZERO:_}=v,E=Zme(v,8*a);function S(e){return Tme(e,n)}function k(e){return S(ome(e))}function A(e){const t=r.BYTES;e=cme("private key",e,t);const n=cme("hashed private key",o(e),2*t),i=h(n.slice(0,t)),s=n.slice(t,2*t),a=k(i),c=w.multiply(a),u=c.toRawBytes();return{head:i,prefix:s,scalar:a,point:c,pointBytes:u}}function x(e=new Uint8Array,...t){const r=ume(...t);return k(o(p(r,cme("context",e),!!i)))}const I=ebe;return w._setWindowSize(8),{CURVE:t,getPublicKey:function(e){return A(e).pointBytes},sign:function(e,t,o={}){e=cme("message",e),i&&(e=i(e));const{prefix:s,scalar:a,pointBytes:c}=A(t),u=x(o.context,s,e),l=w.multiply(u).toRawBytes(),d=S(u+x(o.context,l,c,e)*a);return fme("signature.s",d,Yme,n),cme("result",ume(l,ame(d,r.BYTES)),2*r.BYTES)},verify:function(e,t,n,o=I){const{context:s,zip215:a}=o,c=r.BYTES;e=cme("signature",e,2*c),t=cme("message",t),n=cme("publicKey",n,c),void 0!==a&&$ye("zip215",a),i&&(t=i(t));const u=ome(e.slice(c,2*c));let l,d,f;try{l=v.fromHex(n,a),d=v.fromHex(e.slice(0,c),a),f=w.multiplyUnsafe(u)}catch(e){return!1}if(!a&&l.isSmallOrder())return!1;const h=x(s,d.toRawBytes(),l.toRawBytes(),t);return d.add(l.multiplyUnsafe(h)).subtract(f).clearCofactor().equals(v.ZERO)},ExtendedPoint:v,utils:{getExtendedPublicKey:A,randomPrivateKey:()=>s(r.BYTES),precompute:(e=8,t=v.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0),BigInt(1);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const rbe=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),nbe=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const ibe=BigInt(1),obe=BigInt(2);BigInt(3);const sbe=BigInt(5),abe=BigInt(8);function cbe(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function ube(e,t){const r=rbe,n=Tme(t*t*t,r),i=function(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=rbe,s=e*e%o*e%o,a=Ome(s,obe,o)*s%o,c=Ome(a,ibe,o)*e%o,u=Ome(c,sbe,o)*c%o,l=Ome(u,t,o)*u%o,d=Ome(l,r,o)*l%o,f=Ome(d,n,o)*d%o,h=Ome(f,i,o)*f%o,p=Ome(h,i,o)*f%o,g=Ome(p,t,o)*u%o;return{pow_p_5_8:Ome(g,obe,o)*e%o,b2:s}}(e*Tme(n*n*t,r)).pow_p_5_8;let o=Tme(e*n*i,r);const s=Tme(t*o*o,r),a=o,c=Tme(o*nbe,r),u=s===e,l=s===Tme(-e,r),d=s===Tme(-e*nbe,r);return u&&(o=a),(l||d)&&(o=c),(Tme(o,r)&Sme)===Sme&&(o=Tme(-o,r)),{isValid:u||l,value:o}}const lbe=(()=>Lme(rbe,void 0,!0))(),dbe=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:lbe,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:abe,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:zye,randomBytes:xye,adjustScalarBytes:cbe,uvRatio:ube}))(),fbe=(()=>tbe(dbe))();var hbe={exports:{}},pbe=t(Kge);!function(t){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:pbe.Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,n,i){for(var o=0,s=0,a=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=a(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&s}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=f[e],l=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(l).toString(e);n=(p=p.idivn(l)).isZero()?g+n:d[u-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,h=0|s[1],p=8191&h,g=h>>>13,y=0|s[2],m=8191&y,b=y>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,k=E>>>13,A=0|s[5],x=8191&A,I=A>>>13,B=0|s[6],T=8191&B,C=B>>>13,O=0|s[7],R=8191&O,P=O>>>13,M=0|s[8],U=8191&M,L=M>>>13,j=0|s[9],N=8191&j,z=j>>>13,D=0|a[0],F=8191&D,q=D>>>13,H=0|a[1],V=8191&H,$=H>>>13,K=0|a[2],Z=8191&K,W=K>>>13,G=0|a[3],Y=8191&G,J=G>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,he=0|a[9],pe=8191&he,ge=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(u+(n=Math.imul(d,F))|0)+((8191&(i=(i=Math.imul(d,q))+Math.imul(f,F)|0))<<13)|0;u=((o=Math.imul(f,q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,q))+Math.imul(g,F)|0,o=Math.imul(g,q);var me=(u+(n=n+Math.imul(d,V)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(f,V)|0))<<13)|0;u=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,q))+Math.imul(b,F)|0,o=Math.imul(b,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,$)|0;var be=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(f,Z)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,q))+Math.imul(_,F)|0,o=Math.imul(_,q),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,W)|0;var ve=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,q))+Math.imul(k,F)|0,o=Math.imul(k,q),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,J)|0;var we=(u+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,q))+Math.imul(I,F)|0,o=Math.imul(I,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var _e=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;u=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,q))+Math.imul(C,F)|0,o=Math.imul(C,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0;var Ee=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,q))+Math.imul(P,F)|0,o=Math.imul(P,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,se)|0;var Se=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,q))+Math.imul(L,F)|0,o=Math.imul(L,q),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(g,ce)|0,o=o+Math.imul(g,ue)|0;var ke=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,q))+Math.imul(z,F)|0,o=Math.imul(z,q),n=n+Math.imul(U,V)|0,i=(i=i+Math.imul(U,$)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,$)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(m,ce)|0,i=(i=i+Math.imul(m,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(g,de)|0,o=o+Math.imul(g,fe)|0;var Ae=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ge)|0)+Math.imul(f,pe)|0))<<13)|0;u=((o=o+Math.imul(f,ge)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(N,V),i=(i=Math.imul(N,$))+Math.imul(z,V)|0,o=Math.imul(z,$),n=n+Math.imul(U,Z)|0,i=(i=i+Math.imul(U,W)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,W)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,n=n+Math.imul(m,de)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;u=((o=o+Math.imul(g,ge)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,Z),i=(i=Math.imul(N,W))+Math.imul(z,Z)|0,o=Math.imul(z,W),n=n+Math.imul(U,Y)|0,i=(i=i+Math.imul(U,J)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,se)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var Ie=(u+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ge)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(N,Y),i=(i=Math.imul(N,J))+Math.imul(z,Y)|0,o=Math.imul(z,J),n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,se)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(S,de)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,fe)|0;var Be=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ge)|0)+Math.imul(_,pe)|0))<<13)|0;u=((o=o+Math.imul(_,ge)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(N,Q),i=(i=Math.imul(N,ee))+Math.imul(z,Q)|0,o=Math.imul(z,ee),n=n+Math.imul(U,re)|0,i=(i=i+Math.imul(U,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(C,ce)|0,o=o+Math.imul(C,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,fe)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,fe)|0;var Te=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ge)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(N,re),i=(i=Math.imul(N,ne))+Math.imul(z,re)|0,o=Math.imul(z,ne),n=n+Math.imul(U,oe)|0,i=(i=i+Math.imul(U,se)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,se)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(T,de)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,fe)|0;var Ce=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ge)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,ge)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(N,oe),i=(i=Math.imul(N,se))+Math.imul(z,oe)|0,o=Math.imul(z,se),n=n+Math.imul(U,ce)|0,i=(i=i+Math.imul(U,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(R,de)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Oe=(u+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ge)|0)+Math.imul(C,pe)|0))<<13)|0;u=((o=o+Math.imul(C,ge)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(N,ce),i=(i=Math.imul(N,ue))+Math.imul(z,ce)|0,o=Math.imul(z,ue),n=n+Math.imul(U,de)|0,i=(i=i+Math.imul(U,fe)|0)+Math.imul(L,de)|0,o=o+Math.imul(L,fe)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ge)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(N,de),i=(i=Math.imul(N,fe))+Math.imul(z,de)|0,o=Math.imul(z,fe);var Pe=(u+(n=n+Math.imul(U,pe)|0)|0)+((8191&(i=(i=i+Math.imul(U,ge)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,ge)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Me=(u+(n=Math.imul(N,pe))|0)+((8191&(i=(i=Math.imul(N,ge))+Math.imul(z,pe)|0))<<13)|0;return u=((o=Math.imul(z,ge))+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,c[0]=ye,c[1]=me,c[2]=be,c[3]=ve,c[4]=we,c[5]=_e,c[6]=Ee,c[7]=Se,c[8]=ke,c[9]=Ae,c[10]=xe,c[11]=Ie,c[12]=Be,c[13]=Te,c[14]=Ce,c[15]=Oe,c[16]=Re,c[17]=Pe,c[18]=Me,0!==u&&(c[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(e,t,r){return y(e,t,r)}Math.imul||(g=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?p(this,e,t):r<1024?y(this,e,t):m(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),m(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,i=0;i>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,c=n.length-o.length;if("mod"!==t){(a=new i(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;d--){var f=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=f)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),s=new i(0),a=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;!(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(d)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;!(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(a),s.isub(c)):(n.isub(t),a.isub(o),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new i(1),a=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;!(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;!(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new k(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(w,v),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return b[e]=t,t},k.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=s;0!==h.cmp(a);){for(var g=h,y=0;0!==g.cmp(a);y++)g=g.redSqr();r(y=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var d=u>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===n&&0===l)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}c=26}return o},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},n(A,k),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,e)}(hbe);var gbe=hbe.exports,ybe={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */!function(e,t){var r=pbe,n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(ybe,ybe.exports);var mbe=ybe.exports.Buffer,bbe=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,u=new Uint8Array(o);r>>0,u[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,r++}for(var h=o-i;h!==o&&0===u[h];)h++;var p=mbe.allocUnsafe(n+(o-h));p.fill(0,0,n);for(var g=n;h!==o;)p[g++]=u[h++];return p}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=mbe.from(t)),!mbe.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var c=(o-i)*u+1>>>0,l=new Uint8Array(c);i!==o;){for(var d=t[i],f=0,h=c-1;(0!==d||f>>0,l[h]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");n=f,i++}for(var p=c-n;p!==c&&0===l[p];)p++;for(var g=a.repeat(r);p0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function _be(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")}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const Ebe=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Sbe=(e,t)=>e<<32-t|e>>>t;function kbe(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),wbe(e),e}class Abe{clone(){return this._cloneInto()}}function xbe(e){const t=t=>e().update(kbe(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}const Ibe=(e,t,r)=>e&t^~e&r,Bbe=(e,t,r)=>e&t^e&r^t&r;class Tbe extends Abe{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ebe(this.buffer)}update(e){_be(this);const{view:t,buffer:r,blockLen:n}=this,i=(e=kbe(e)).length;for(let o=0;on-o&&(this.process(r,0),o=0);for(let e=o;e>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=Ebe(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e>>3,i=Sbe(r,17)^Sbe(r,19)^r>>>10;Rbe[e]=i+Rbe[e-7]+n+Rbe[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(Sbe(s,6)^Sbe(s,11)^Sbe(s,25))+Ibe(s,a,c)+Cbe[e]+Rbe[e]|0,l=(Sbe(r,2)^Sbe(r,13)^Sbe(r,22))+Bbe(r,n,i)|0;u=c,c=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){Rbe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Mbe=xbe((()=>new Pbe));var Ube={};function Lbe(e,t,r){return t<=e&&e<=r}function jbe(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function Nbe(e){this.tokens=[].slice.call(e)}Nbe.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};var zbe=-1;function Dbe(e,t){if(e)throw TypeError("Decoder error");return t||65533}var Fbe="utf-8";function qbe(e,t){if(!(this instanceof qbe))return new qbe(e,t);if((e=void 0!==e?String(e).toLowerCase():Fbe)!==Fbe)throw new Error("Encoding not supported. Only utf-8 is supported");t=jbe(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function Hbe(e,t){if(!(this instanceof Hbe))return new Hbe(e,t);if((e=void 0!==e?String(e).toLowerCase():Fbe)!==Fbe)throw new Error("Encoding not supported. Only utf-8 is supported");t=jbe(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function Vbe(e){var t=e.fatal,r=0,n=0,i=0,o=128,s=191;this.handler=function(e,a){if(-1===a&&0!==i)return i=0,Dbe(t);if(-1===a)return zbe;if(0===i){if(Lbe(a,0,127))return a;if(Lbe(a,194,223))i=1,r=a-192;else if(Lbe(a,224,239))224===a&&(o=160),237===a&&(s=159),i=2,r=a-224;else{if(!Lbe(a,240,244))return Dbe(t);240===a&&(o=144),244===a&&(s=143),i=3,r=a-240}return r<<=6*i,null}if(!Lbe(a,o,s))return r=i=n=0,o=128,s=191,e.prepend(a),Dbe(t);if(o=128,s=191,r+=a-128<<6*(i-(n+=1)),n!==i)return null;var c=r;return r=i=n=0,c}}function $be(e){e.fatal,this.handler=function(e,t){if(-1===t)return zbe;if(Lbe(t,0,127))return t;var r,n;Lbe(t,128,2047)?(r=1,n=192):Lbe(t,2048,65535)?(r=2,n=224):Lbe(t,65536,1114111)&&(r=3,n=240);for(var i=[(t>>6*r)+n];r>0;){var o=t>>6*(r-1);i.push(128|63&o),r-=1}return i}}qbe.prototype={decode:function(e,t){var r;r="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=jbe(t),this._streaming||(this._decoder=new Vbe({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var n,i=new Nbe(r),o=[];!i.endOfStream()&&(n=this._decoder.handler(i,i.read()))!==zbe;)null!==n&&(Array.isArray(n)?o.push.apply(o,n):o.push(n));if(!this._streaming){do{if((n=this._decoder.handler(i,i.read()))===zbe)break;null!==n&&(Array.isArray(n)?o.push.apply(o,n):o.push(n))}while(!i.endOfStream());this._decoder=null}return o.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===o[0]?(this._BOMseen=!0,o.shift()):this._BOMseen=!0)),function(e){for(var t="",r=0;r>10),56320+(1023&n)))}return t}(o)}},Hbe.prototype={encode:function(e,t){e=e?String(e):"",t=jbe(t),this._streaming||(this._encoder=new $be(this._options)),this._streaming=Boolean(t.stream);for(var r,n=[],i=new Nbe(function(e){for(var t=String(e),r=t.length,n=0,i=[];n57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=e.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=1023&o,c=1023&s;i.push(65536+(a<<10)+c),n+=1}else i.push(65533)}n+=1}return i}(e));!i.endOfStream()&&(r=this._encoder.handler(i,i.read()))!==zbe;)Array.isArray(r)?n.push.apply(n,r):n.push(r);if(!this._streaming){for(;(r=this._encoder.handler(i,i.read()))!==zbe;)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)}};var Kbe=t(Object.freeze({__proto__:null,TextEncoder:Hbe,TextDecoder:qbe})),Zbe=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),Wbe=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Gbe=e&&e.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Ybe=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&Zbe(t,e,r);return Wbe(t,e),t},Jbe=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ube,"__esModule",{value:!0});var Xbe=Ube.deserializeUnchecked=pve=Ube.deserialize=dve=Ube.serialize=Ube.BinaryReader=Ube.BinaryWriter=Ube.BorshError=Ube.baseDecode=Ube.baseEncode=void 0;const Qbe=Jbe(hbe.exports),eve=Jbe(vbe),tve=Ybe(Kbe),rve=new("function"!=typeof TextDecoder?tve.TextDecoder:TextDecoder)("utf-8",{fatal:!0});Ube.baseEncode=function(e){return"string"==typeof e&&(e=age.from(e,"utf8")),eve.default.encode(age.from(e))},Ube.baseDecode=function(e){return age.from(eve.default.decode(e))};const nve=1024;class ive extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}Ube.BorshError=ive;class ove{constructor(){this.buf=age.alloc(nve),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=age.concat([this.buf,age.alloc(nve)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(age.from(new Qbe.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(age.from(new Qbe.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(age.from(new Qbe.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(age.from(new Qbe.default(e).toArray("le",64)))}writeBuffer(e){this.buf=age.concat([age.from(this.buf.subarray(0,this.length)),e,age.alloc(nve)]),this.length+=e.length}writeString(e){this.maybeResize();const t=age.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(age.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(const r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}}function sve(e,t,r){const n=r.value;r.value=function(...e){try{return n.apply(this,e)}catch(e){if(e instanceof RangeError){const t=e.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t)>=0)throw new ive("Reached the end of buffer when deserializing")}throw e}}}Ube.BinaryWriter=ove;class ave{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new Qbe.default(e,"le")}readU128(){const e=this.readBuffer(16);return new Qbe.default(e,"le")}readU256(){const e=this.readBuffer(32);return new Qbe.default(e,"le")}readU512(){const e=this.readBuffer(64);return new Qbe.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new ive(`Expected buffer length ${e} isn't within bounds`);const t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){const e=this.readU32(),t=this.readBuffer(e);try{return rve.decode(t)}catch(e){throw new ive(`Error decoding UTF-8 string: ${e}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const t=this.readU32(),r=Array();for(let n=0;n{uve(e,t,r,n[0],i)}));else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),uve(e,t,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach(((r,o)=>{uve(e,t,o,n.key,i),uve(e,t,r,n.value,i)}));break;default:throw new ive(`FieldType ${n} unrecognized`)}else lve(e,r,i)}catch(e){throw e instanceof ive&&e.addToFieldPath(t),e}}function lve(e,t,r){if("function"==typeof t.borshSerialize)return void t.borshSerialize(r);const n=e.get(t.constructor);if(!n)throw new ive(`Class ${t.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map((([n,i])=>{uve(e,n,t[n],i,r)}));else{if("enum"!==n.kind)throw new ive(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`);{const i=t[n.field];for(let o=0;ofve(e,t,r[0],n)))}if("option"===r.kind)return n.readU8()?fve(e,t,r.type,n):void 0;if("map"===r.kind){let i=new Map;const o=n.readU32();for(let s=0;s=n.values.length)throw new ive(`Enum index: ${i} is out of range`);const[o,s]=n.values[i],a=fve(e,o,s,r);return new t({[o]:a})}throw new ive(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}var pve=Ube.deserialize=function(e,t,r,n=ave){const i=new n(r),o=hve(e,t,i);if(i.offsetthis.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}function wve(e,t){return t.property?e+"["+t.property+"]":e}gve.Layout=vve,gve.nameWithProperty=wve,gve.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(e,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof vve))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=()=>new e,Object.defineProperty(e.prototype,"encode",{value(e,r){return t.encode(this,e,r)},writable:!0}),Object.defineProperty(e,"decode",{value:(e,r)=>t.decode(e,r),writable:!0})};class _ve extends vve{isCount(){throw new Error("ExternalLayout is abstract")}}gve.ExternalLayout=_ve;class Eve extends _ve{constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){mve(e);const r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,r){return 0}}gve.GreedyCount=Eve;class Sve extends _ve{constructor(e,t=0,r){if(!(e instanceof vve))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof kve||this.layout instanceof Ave}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}}gve.OffsetLayout=Sve;class kve extends vve{constructor(e,t){if(super(e,t),6e+n.encode(i,t,r+e)),0);return this.count instanceof _ve&&this.count.encode(e.length,t,r),i}}gve.Sequence=zve;class Dve extends vve{constructor(e,t,r){if(!Array.isArray(e)||!e.reduce(((e,t)=>e&&t instanceof vve),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof t&&void 0===r&&(r=t,t=void 0);for(const t of e)if(0>t.span&&void 0===t.property)throw new Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=e.reduce(((e,t)=>e+t.getSpan()),0)}catch(e){}super(n,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce(((r,n)=>{const i=n.getSpan(e,t);return t+=i,r+i}),0)}catch(e){throw new RangeError("indeterminate span")}return r}decode(e,t=0){mve(e);const r=this.makeDestinationObject();for(const n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){const n=r;let i=0,o=0;for(const n of this.fields){let s=n.span;if(o=0s&&(s=n.getSpan(t,r)))}i=r,r+=s}return i+o-n}fromArray(e){const t=this.makeDestinationObject();for(const r of this.fields)void 0!==r.property&&0r.span?t=-1:0<=t&&(t+=r.span)}}}gve.Structure=Dve;class Fve{constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,r){throw new Error("UnionDiscriminator is abstract")}}gve.UnionDiscriminator=Fve;class qve extends Fve{constructor(e,t){if(!(e instanceof _ve&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}}gve.UnionLayoutDiscriminator=qve;class Hve extends vve{constructor(e,t,r){let n;if(e instanceof kve||e instanceof Ave)n=new qve(new Sve(e));else if(e instanceof _ve&&e.isCount())n=new qve(e);else{if(!(e instanceof Fve))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");n=e}if(void 0===t&&(t=null),!(null===t||t instanceof vve))throw new TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw new Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}let i=-1;t&&(i=t.span,0<=i&&(e instanceof kve||e instanceof Ave)&&(i+=n.layout.span)),super(i,r),this.discriminator=n,this.usesPrefixDiscriminator=e instanceof kve||e instanceof Ave,this.defaultLayout=t,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return o(e)},this.configGetSourceVariant=function(e){o=e.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;const r=this.getVariant(e,t);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;const t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(const t in this.registry){const r=this.registry[t];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}decode(e,t=0){let r;const n=this.discriminator,i=n.decode(e,t),o=this.registry[i];if(void 0===o){const o=this.defaultLayout;let s=0;this.usesPrefixDiscriminator&&(s=n.layout.span),r=this.makeDestinationObject(),r[n.property]=i,r[o.property]=o.decode(e,t+s)}else r=o.decode(e,t);return r}encode(e,t,r=0){const n=this.getSourceVariant(e);if(void 0===n){const n=this.discriminator,i=this.defaultLayout;let o=0;return this.usesPrefixDiscriminator&&(o=n.layout.span),n.encode(e[n.property],t,r),o+i.encode(e[i.property],t,r+o)}return n.encode(e,t,r)}addVariant(e,t,r){const n=new Vve(this,e,t,r);return this.registry[e]=n,n}getVariant(e,t=0){let r;return r=e instanceof Uint8Array?this.discriminator.decode(e,t):e,this.registry[r]}}gve.Union=Hve;class Vve extends vve{constructor(e,t,r,n){if(!(e instanceof Hve))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof r&&void 0===n&&(n=r,r=null),r){if(!(r instanceof vve))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof n)throw new TypeError("variant must have a String property")}let i=e.span;0>e.span&&(i=r?r.span:0,0<=i&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span)),super(i,n),this.union=e,this.variant=t,this.layout=r||null}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let n=0;return this.layout&&(n=this.layout.getSpan(e,t+r)),r+n}decode(e,t=0){const r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let i=n;if(this.layout&&(this.layout.encode(e[this.property],t,r+n),i+=this.layout.getSpan(t,r+n),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}function $ve(e){return 0>e&&(e+=4294967296),e}gve.VariantLayout=Vve;class Kve extends vve{constructor(e,t,r){if(!(e instanceof kve||e instanceof Ave))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof t&&void 0===r&&(r=t,t=!1),4=t)throw new TypeError("bits must be positive integer");const n=8*e.span,i=e.fields.reduce(((e,t)=>e+t.bits),0);if(t+i>n)throw new Error("bits too long for span remainder ("+(n-i)+" of "+n+" remain)");this.container=e,this.bits=t,this.valueMask=(1<>>this.start}encode(e){if("number"!=typeof e||!Number.isInteger(e)||e!==$ve(e&this.valueMask))throw new TypeError(wve("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const t=this.container._packedGetValue(),r=$ve(e<r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),bve(e).slice(t,t+r)}encode(e,t,r){let n=this.length;if(this.length instanceof _ve&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw new TypeError(wve("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>t.length)throw new RangeError("encoding overruns Uint8Array");const i=bve(e);return bve(t).write(i.toString("hex"),r,n,"hex"),this.length instanceof _ve&&this.length.encode(n,t,r),n}}gve.Blob=Gve;class Yve extends vve{constructor(e){super(-1,e)}getSpan(e,t=0){mve(e);let r=t;for(;rt.length)throw new RangeError("encoding overruns Buffer");const o=bve(t);return n.copy(o,r),o[r+i]=0,i+1}}gve.CString=Yve;class Jve extends vve{constructor(e,t){if("string"==typeof e&&void 0===t&&(t=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t=0){return mve(e),e.length-t}decode(e,t=0){const r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return n.copy(bve(t),r),i}}gve.UTF8=Jve;class Xve extends vve{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,r){return 0}}gve.Constant=Xve,gve.greedy=(e,t)=>new Eve(e,t);var Qve=gve.offset=(e,t,r)=>new Sve(e,t,r),ewe=gve.u8=e=>new kve(1,e),twe=gve.u16=e=>new kve(2,e);gve.u24=e=>new kve(3,e);var rwe=gve.u32=e=>new kve(4,e);gve.u40=e=>new kve(5,e),gve.u48=e=>new kve(6,e);var nwe=gve.nu64=e=>new Ove(e);gve.u16be=e=>new Ave(2,e),gve.u24be=e=>new Ave(3,e),gve.u32be=e=>new Ave(4,e),gve.u40be=e=>new Ave(5,e),gve.u48be=e=>new Ave(6,e),gve.nu64be=e=>new Rve(e),gve.s8=e=>new xve(1,e),gve.s16=e=>new xve(2,e),gve.s24=e=>new xve(3,e),gve.s32=e=>new xve(4,e),gve.s40=e=>new xve(5,e),gve.s48=e=>new xve(6,e);var iwe=gve.ns64=e=>new Pve(e);gve.s16be=e=>new Ive(2,e),gve.s24be=e=>new Ive(3,e),gve.s32be=e=>new Ive(4,e),gve.s40be=e=>new Ive(5,e),gve.s48be=e=>new Ive(6,e),gve.ns64be=e=>new Mve(e),gve.f32=e=>new Uve(e),gve.f32be=e=>new Lve(e),gve.f64=e=>new jve(e),gve.f64be=e=>new Nve(e);var owe=gve.struct=(e,t,r)=>new Dve(e,t,r);gve.bits=(e,t,r)=>new Kve(e,t,r);var swe=gve.seq=(e,t,r)=>new zve(e,t,r);gve.union=(e,t,r)=>new Hve(e,t,r),gve.unionLayoutDiscriminator=(e,t)=>new qve(e,t);var awe=gve.blob=(e,t)=>new Gve(e,t);gve.cstr=e=>new Yve(e),gve.utf8=(e,t)=>new Jve(e,t),gve.constant=(e,t)=>new Xve(e,t);var cwe={};Object.defineProperty(cwe,"__esModule",{value:!0});var uwe=cwe.toBigIntLE=function(e){{const t=age.from(e);t.reverse();const r=t.toString("hex");return 0===r.length?BigInt(0):BigInt(`0x${r}`)}};cwe.toBigIntBE=function(e){{const t=e.toString("hex");return 0===t.length?BigInt(0):BigInt(`0x${t}`)}};var lwe,dwe=cwe.toBufferLE=function(e,t){{const r=e.toString(16),n=age.from(r.padStart(2*t,"0").slice(0,2*t),"hex");return n.reverse(),n}};cwe.toBufferBE=function(e,t){{const r=e.toString(16);return age.from(r.padStart(2*t,"0").slice(0,2*t),"hex")}};class fwe extends TypeError{constructor(e,t){let r;const{message:n,...i}=e,{path:o}=e;super(0===o.length?n:"At path: "+o.join(".")+" -- "+n),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function hwe(e){return"object"==typeof e&&null!=e}function pwe(e){return"string"==typeof e?JSON.stringify(e):""+e}function gwe(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:s}=r,{refinement:a,message:c="Expected a value of type `"+s+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+pwe(n)+"`"}=e;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...e,message:c}}function*ywe(e,t,r,n){(function(e){return hwe(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const i of e){const e=gwe(i,t,r,n);e&&(yield e)}}function*mwe(e,t,r={}){const{path:n=[],branch:i=[e],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i};if(o&&(e=t.coercer(e,a),s&&"type"!==t.type&&hwe(t.schema)&&hwe(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let c=!0;for(const r of t.validator(e,a))c=!1,yield[r,void 0];for(let[r,u,l]of t.entries(e,a)){const t=mwe(u,l,{path:void 0===r?n:[...n,r],branch:void 0===r?i:[...i,u],coerce:o,mask:s});for(const n of t)n[0]?(c=!1,yield[n[0],void 0]):o&&(u=n[1],void 0===r?e=u:e instanceof Map?e.set(r,u):e instanceof Set?e.add(u):hwe(e)&&(e[r]=u))}if(c)for(const r of t.refiner(e,a))c=!1,yield[r,void 0];c&&(yield[void 0,e])}class bwe{constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:o=e=>e,entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(e,t)=>ywe(n(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>ywe(i(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=_we(e,t);if(r[0])throw r[0]}(e,this)}create(e){return vwe(e,this)}is(e){return wwe(e,this)}mask(e){return function(e,t){const r=_we(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return _we(e,this,t)}}function vwe(e,t){const r=_we(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}function wwe(e,t){return!_we(e,t)[0]}function _we(e,t,r={}){const n=mwe(e,t,r),i=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(i[0]){const e=new fwe(i[0],(function*(){for(const e of n)e[0]&&(yield e[0])}));return[e,void 0]}return[void 0,i[1]]}function Ewe(e,t){return new bwe({type:e,schema:null,validator:t})}function Swe(e){return new bwe({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+pwe(e)})}function kwe(){return Ewe("boolean",(e=>"boolean"==typeof e))}function Awe(e){return Ewe("instance",(t=>t instanceof e||"Expected a `"+e.name+"` instance, but received: "+pwe(t)))}function xwe(e){const t=pwe(e),r=typeof e;return new bwe({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||"Expected the literal `"+t+"`, but received: "+pwe(r)})}function Iwe(e){return new bwe({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function Bwe(){return Ewe("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+pwe(e)))}function Twe(e){return new bwe({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function Cwe(e,t){return new bwe({type:"record",schema:null,*entries(r){if(hwe(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator:e=>hwe(e)||"Expected an object, but received: "+pwe(e)})}function Owe(){return Ewe("string",(e=>"string"==typeof e||"Expected a string, but received: "+pwe(e)))}function Rwe(e){const t=Ewe("never",(()=>!1));return new bwe({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;iArray.isArray(e)||"Expected an array, but received: "+pwe(e)})}function Pwe(e){const t=Object.keys(e);return new bwe({type:"type",schema:e,*entries(r){if(hwe(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>hwe(e)||"Expected an object, but received: "+pwe(e)})}function Mwe(e){const t=e.map((e=>e.type)).join(" | ");return new bwe({type:"union",schema:null,validator(r,n){const i=[];for(const t of e){const[...e]=mwe(r,t,n),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return["Expected the value to satisfy a union of `"+t+"`, but received: "+pwe(r),...i]}})}function Uwe(){return Ewe("unknown",(()=>!0))}function Lwe(e,t,r){return new bwe({...e,coercer:(n,i)=>wwe(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}var jwe=new Uint8Array(16);function Nwe(){if(!lwe&&!(lwe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lwe(jwe)}var zwe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Dwe(e){return"string"==typeof e&&zwe.test(e)}for(var Fwe,qwe,Hwe=[],Vwe=0;Vwe<256;++Vwe)Hwe.push((Vwe+256).toString(16).substr(1));function $we(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Hwe[e[t+0]]+Hwe[e[t+1]]+Hwe[e[t+2]]+Hwe[e[t+3]]+"-"+Hwe[e[t+4]]+Hwe[e[t+5]]+"-"+Hwe[e[t+6]]+Hwe[e[t+7]]+"-"+Hwe[e[t+8]]+Hwe[e[t+9]]+"-"+Hwe[e[t+10]]+Hwe[e[t+11]]+Hwe[e[t+12]]+Hwe[e[t+13]]+Hwe[e[t+14]]+Hwe[e[t+15]]).toLowerCase();if(!Dwe(r))throw TypeError("Stringified UUID is invalid");return r}var Kwe=0,Zwe=0;function Wwe(e){if(!Dwe(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}function Gwe(e,t,r){function n(e,n,i,o){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r>>9<<4)+1}function Jwe(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function Xwe(e,t,r,n,i,o){return Jwe((s=Jwe(Jwe(t,e),Jwe(n,o)))<<(a=i)|s>>>32-a,r);var s,a}function Qwe(e,t,r,n,i,o,s){return Xwe(t&r|~t&n,e,t,i,o,s)}function e_e(e,t,r,n,i,o,s){return Xwe(t&n|r&~n,e,t,i,o,s)}function t_e(e,t,r,n,i,o,s){return Xwe(t^r^n,e,t,i,o,s)}function r_e(e,t,r,n,i,o,s){return Xwe(r^(t|~n),e,t,i,o,s)}var n_e=Gwe("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r>5]>>>i%32&255,s=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);t.push(s)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[n/8])<>>32-t}var a_e=Gwe("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i>>0;v=b,b=m,m=s_e(y,30)>>>0,y=g,g=E}r[0]=r[0]+g>>>0,r[1]=r[1]+y>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+v>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),c_e=a_e,u_e=Object.freeze({__proto__:null,v1:function(e,t,r){var n=t&&r||0,i=t||new Array(16),o=(e=e||{}).node||Fwe,s=void 0!==e.clockseq?e.clockseq:qwe;if(null==o||null==s){var a=e.random||(e.rng||Nwe)();null==o&&(o=Fwe=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=qwe=16383&(a[6]<<8|a[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),u=void 0!==e.nsecs?e.nsecs:Zwe+1,l=c-Kwe+(u-Zwe)/1e4;if(l<0&&void 0===e.clockseq&&(s=s+1&16383),(l<0||c>Kwe)&&void 0===e.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Kwe=c,Zwe=u,qwe=s;var d=(1e4*(268435455&(c+=122192928e5))+u)%4294967296;i[n++]=d>>>24&255,i[n++]=d>>>16&255,i[n++]=d>>>8&255,i[n++]=255&d;var f=c/4294967296*1e4&268435455;i[n++]=f>>>8&255,i[n++]=255&f,i[n++]=f>>>24&15|16,i[n++]=f>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var h=0;h<6;++h)i[n+h]=o[h];return t||$we(i)},v3:i_e,v4:function(e,t,r){var n=(e=e||{}).random||(e.rng||Nwe)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return $we(n)},v5:c_e,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!Dwe(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:Dwe,stringify:$we,parse:Wwe}),l_e=t(u_e);const d_e=l_e.v4;var f_e=function(e,t,r,n){if("string"!=typeof e)throw new TypeError(e+" must be a string");const i="number"==typeof(n=n||{}).version?n.version:2;if(1!==i&&2!==i)throw new TypeError(i+" must be 1 or 2");const o={method:e};if(2===i&&(o.jsonrpc="2.0"),t){if("object"!=typeof t&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");o.params=t}if(void 0===r){const e="function"==typeof n.generator?n.generator:function(){return d_e()};o.id=e(o,n)}else 2===i&&null===r?n.notificationIdNull&&(o.id=null):o.id=r;return o};const h_e=l_e.v4,p_e=f_e,g_e=function(e,t){if(!(this instanceof g_e))return new g_e(e,t);t||(t={}),this.options={reviver:void 0!==t.reviver?t.reviver:null,replacer:void 0!==t.replacer?t.replacer:null,generator:void 0!==t.generator?t.generator:function(){return h_e()},version:void 0!==t.version?t.version:2,notificationIdNull:"boolean"==typeof t.notificationIdNull&&t.notificationIdNull},this.callServer=e};var y_e=g_e;g_e.prototype.request=function(e,t,r,n){const i=this;let o=null;const s=Array.isArray(e)&&"function"==typeof t;if(1===this.options.version&&s)throw new TypeError("JSON-RPC 1.0 does not support batching");if(s||!s&&e&&"object"==typeof e&&"function"==typeof t)n=t,o=e;else{"function"==typeof r&&(n=r,r=void 0);const i="function"==typeof n;try{o=p_e(e,t,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(e){if(i)return n(e);throw e}if(!i)return o}let a;try{a=JSON.stringify(o,this.options.replacer)}catch(e){return n(e)}return this.callServer(a,(function(e,t){i._parseResponse(e,t,n)})),o},g_e.prototype._parseResponse=function(e,t,r){if(e)return void r(e);if(!t)return r();let n;try{n=JSON.parse(t,this.options.reviver)}catch(e){return r(e)}if(3===r.length){if(Array.isArray(n)){const e=function(e){return void 0!==e.error},t=function(t){return!e(t)};return r(null,n.filter(e),n.filter(t))}return r(null,n.error,n.result)}r(null,n)};var m_e={},b_e={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||e,s),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i++this.rpc_id),this.dataPack=c||new E_e.DefaultDataPack,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(e,t,r,n){return n||"object"!=typeof r||(n=r,r=null),new Promise(((i,o)=>{if(!this.ready)return o(new Error("socket not ready"));const s=this.generate_request_id(e,t),a={jsonrpc:"2.0",method:e,params:t||void 0,id:s};this.socket.send(this.dataPack.encode(a),n,(e=>{if(e)return o(e);this.queue[s]={promise:[i,o]},r&&(this.queue[s].timeout=setTimeout((()=>{delete this.queue[s],o(new Error("reply timeout"))}),r))}))}))}async login(e){const t=await this.call("rpc.login",e);if(!t)throw new Error("authentication failed");return t}async listMethods(){return await this.call("__listMethods")}notify(e,t){return new Promise(((r,n)=>{if(!this.ready)return n(new Error("socket not ready"));const i={jsonrpc:"2.0",method:e,params:t};this.socket.send(this.dataPack.encode(i),(e=>{if(e)return n(e);r()}))}))}async subscribe(e){"string"==typeof e&&(e=[e]);const t=await this.call("rpc.on",e);if("string"==typeof e&&"ok"!==t[e])throw new Error("Failed subscribing to an event '"+e+"' with: "+t[e]);return t}async unsubscribe(e){"string"==typeof e&&(e=[e]);const t=await this.call("rpc.off",e);if("string"==typeof e&&"ok"!==t[e])throw new Error("Failed unsubscribing from an event with: "+t);return t}close(e,t){this.socket.close(e||1e3,t)}setAutoReconnect(e){this.reconnect=e}setReconnectInterval(e){this.reconnect_interval=e}setMaxReconnects(e){this.max_reconnects=e}_connect(e,t){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",(()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0})),this.socket.addEventListener("message",(({data:e})=>{e instanceof ArrayBuffer&&(e=age.from(e).toString());try{e=this.dataPack.decode(e)}catch(e){return}if(e.notification&&this.listeners(e.notification).length){if(!Object.keys(e.params).length)return this.emit(e.notification);const t=[e.notification];if(e.params.constructor===Object)t.push(e.params);else for(let r=0;r{this.emit.apply(this,t)}))}if(!this.queue[e.id])return e.method?Promise.resolve().then((()=>{var t;this.emit(e.method,null===(t=e)||void 0===t?void 0:t.params)})):void 0;"error"in e=="result"in e&&this.queue[e.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[e.id].timeout&&clearTimeout(this.queue[e.id].timeout),e.error?this.queue[e.id].promise[1](e.error):this.queue[e.id].promise[0](e.result),delete this.queue[e.id]})),this.socket.addEventListener("error",(e=>this.emit("error",e))),this.socket.addEventListener("close",(({code:r,reason:n})=>{this.ready&&setTimeout((()=>this.emit("close",r,n)),0),this.ready=!1,this.socket=void 0,1e3!==r&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||0===this.max_reconnects)&&(this.reconnect_timer_id=setTimeout((()=>this._connect(e,t)),this.reconnect_interval)))}))}}var k_e=m_e.default=S_e,A_e={};Object.defineProperty(A_e,"__esModule",{value:!0});const x_e=b_e.exports;class I_e extends x_e.EventEmitter{constructor(e,t,r){super(),Zge(this,"socket",void 0),this.socket=new window.WebSocket(e,r),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=e=>this.emit("message",e.data),this.socket.onerror=e=>this.emit("error",e),this.socket.onclose=e=>{this.emit("close",e.code,e.reason)}}send(e,t,r){const n=r||t;try{this.socket.send(e),n()}catch(e){n(e)}}close(e,t){this.socket.close(e,t)}addEventListener(e,t,r){this.socket.addEventListener(e,t,r)}}var B_e=A_e.default=function(e,t){return new I_e(e,t)};const T_e=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]),C_e=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),O_e=new Uint32Array(64);class R_e extends Tye{constructor(){super(64,32,8,!1),this.A=0|C_e[0],this.B=0|C_e[1],this.C=0|C_e[2],this.D=0|C_e[3],this.E=0|C_e[4],this.F=0|C_e[5],this.G=0|C_e[6],this.H=0|C_e[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)O_e[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=O_e[e-15],r=O_e[e-2],n=Eye(t,7)^Eye(t,18)^t>>>3,i=Eye(r,17)^Eye(r,19)^r>>>10;O_e[e]=i+O_e[e-7]+n+O_e[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(Eye(s,6)^Eye(s,11)^Eye(s,25))+Iye(s,a,c)+T_e[e]+O_e[e]|0,l=(Eye(r,2)^Eye(r,13)^Eye(r,22))+Bye(r,n,i)|0;u=c,c=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){O_e.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const P_e=Aye((()=>new R_e));class M_e extends kye{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");mye(e.outputLen),mye(e.blockLen)}(e);const r=Sye(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let e=0;enew M_e(e,t).update(r).digest();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function L_e(e){void 0!==e.lowS&&$ye("lowS",e.lowS),void 0!==e.prehash&&$ye("prehash",e.prehash)}U_e.create=(e,t)=>new M_e(e,t);const{bytesToNumberBE:j_e,hexToBytes:N_e}=_me,z_e={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(e,t)=>{const{Err:r}=z_e;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const n=t.length/2,i=Wye(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const o=n>127?Wye(i.length/2|128):"";return Wye(e)+o+i+t},decode(e,t){const{Err:r}=z_e;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const i=t[n++];let o=0;if(128&i){const e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of s)o=o<<8|e;if(n+=e,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;const s=t.subarray(n,n+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+o)}}},_int:{encode(e){const{Err:t}=z_e;if(e{const i=t.toAffine();return ume(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),o=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function s(e){const{a:n,b:i}=t,o=r.sqr(e),s=r.mul(o,e);return r.add(r.add(s,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function a(e){const{allowedPrivateKeyLengths:r,nByteLength:n,wrapPrivateKey:i,n:o}=t;if(r&&"bigint"!=typeof e){if(Hye(e)&&(e=Zye(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("invalid private key");e=e.padStart(2*n,"0")}let s;try{s="bigint"==typeof e?e:ime(cme("private key",e,n))}catch(t){throw new Error("invalid private key, expected hex or "+n+" bytes, got "+typeof e)}return i&&(s=Tme(s,o)),fme("private key",s,F_e,o),s}function c(e){if(!(e instanceof d))throw new Error("ProjectivePoint expected")}const u=wme(((e,t)=>{const{px:n,py:i,pz:o}=e;if(r.eql(o,r.ONE))return{x:n,y:i};const s=e.is0();null==t&&(t=s?r.ONE:r.inv(o));const a=r.mul(n,t),c=r.mul(i,t),u=r.mul(o,t);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error("invZ was invalid");return{x:a,y:c}})),l=wme((e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.py))return;throw new Error("bad point: ZERO")}const{x:n,y:i}=e.toAffine();if(!r.isValid(n)||!r.isValid(i))throw new Error("bad point: x or y not FE");const o=r.sqr(i),a=s(n);if(!r.eql(o,a))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));class d{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required");Object.freeze(this)}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof d)throw new Error("projective point not allowed");const i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?d.ZERO:new d(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(o(cme("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(a(e))}static msm(e,t){return Wme(d,n,e,t)}_setWindowSize(e){h.setWindowSize(this,e)}assertValidity(){l(this)}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){c(e);const{px:t,py:n,pz:i}=this,{px:o,py:s,pz:a}=e,u=r.eql(r.mul(t,a),r.mul(o,i)),l=r.eql(r.mul(n,a),r.mul(s,i));return u&&l}negate(){return new d(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,i=r.mul(n,q_e),{px:o,py:s,pz:a}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,f=r.mul(o,o),h=r.mul(s,s),p=r.mul(a,a),g=r.mul(o,s);return g=r.add(g,g),l=r.mul(o,a),l=r.add(l,l),c=r.mul(e,l),u=r.mul(i,p),u=r.add(c,u),c=r.sub(h,u),u=r.add(h,u),u=r.mul(c,u),c=r.mul(g,c),l=r.mul(i,l),p=r.mul(e,p),g=r.sub(f,p),g=r.mul(e,g),g=r.add(g,l),l=r.add(f,f),f=r.add(l,f),f=r.add(f,p),f=r.mul(f,g),u=r.add(u,f),p=r.mul(s,a),p=r.add(p,p),f=r.mul(p,g),c=r.sub(c,f),l=r.mul(p,h),l=r.add(l,l),l=r.add(l,l),new d(c,u,l)}add(e){c(e);const{px:n,py:i,pz:o}=this,{px:s,py:a,pz:u}=e;let l=r.ZERO,f=r.ZERO,h=r.ZERO;const p=t.a,g=r.mul(t.b,q_e);let y=r.mul(n,s),m=r.mul(i,a),b=r.mul(o,u),v=r.add(n,i),w=r.add(s,a);v=r.mul(v,w),w=r.add(y,m),v=r.sub(v,w),w=r.add(n,o);let _=r.add(s,u);return w=r.mul(w,_),_=r.add(y,b),w=r.sub(w,_),_=r.add(i,o),l=r.add(a,u),_=r.mul(_,l),l=r.add(m,b),_=r.sub(_,l),h=r.mul(p,w),l=r.mul(g,b),h=r.add(l,h),l=r.sub(m,h),h=r.add(m,h),f=r.mul(l,h),m=r.add(y,y),m=r.add(m,y),b=r.mul(p,b),w=r.mul(g,w),m=r.add(m,b),b=r.sub(y,b),b=r.mul(p,b),w=r.add(w,b),y=r.mul(m,w),f=r.add(f,y),y=r.mul(_,w),l=r.mul(v,l),l=r.sub(l,y),y=r.mul(v,m),h=r.mul(_,h),h=r.add(h,y),new d(l,f,h)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return h.wNAFCached(this,e,d.normalizeZ)}multiplyUnsafe(e){const{endo:n,n:i}=t;fme("scalar",e,D_e,i);const o=d.ZERO;if(e===D_e)return o;if(this.is0()||e===F_e)return this;if(!n||h.hasPrecomputes(this))return h.wNAFCachedUnsafe(this,e,d.normalizeZ);let{k1neg:s,k1:a,k2neg:c,k2:u}=n.splitScalar(e),l=o,f=o,p=this;for(;a>D_e||u>D_e;)a&F_e&&(l=l.add(p)),u&F_e&&(f=f.add(p)),p=p.double(),a>>=F_e,u>>=F_e;return s&&(l=l.negate()),c&&(f=f.negate()),f=new d(r.mul(f.px,n.beta),f.py,f.pz),l.add(f)}multiply(e){const{endo:n,n:i}=t;let o,s;if(fme("scalar",e,F_e,i),n){const{k1neg:t,k1:i,k2neg:a,k2:c}=n.splitScalar(e);let{p:u,f:l}=this.wNAF(i),{p:f,f:p}=this.wNAF(c);u=h.constTimeNegate(t,u),f=h.constTimeNegate(a,f),f=new d(r.mul(f.px,n.beta),f.py,f.pz),o=u.add(f),s=l.add(p)}else{const{p:t,f:r}=this.wNAF(e);o=t,s=r}return d.normalizeZ([o,s])[0]}multiplyAndAddUnsafe(e,t,r){const n=d.BASE,i=(e,t)=>t!==D_e&&t!==F_e&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,r));return o.is0()?void 0:o}toAffine(e){return u(this,e)}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===F_e)return!0;if(r)return r(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===F_e?this:r?r(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return $ye("isCompressed",e),this.assertValidity(),i(d,this,e)}toHex(e=!0){return $ye("isCompressed",e),Zye(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,r.ONE),d.ZERO=new d(r.ZERO,r.ONE,r.ZERO);const f=t.nBitLength,h=Zme(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:a,weierstrassEquation:s,isWithinCurveOrder:function(e){return dme(e,F_e,t.n)}}}function V_e(e){const t=function(e){const t=Gme(e);return vme(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:n}=t,i=r.BYTES+1,o=2*r.BYTES+1;function s(e){return Tme(e,n)}function a(e){return Rme(e,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:d}=H_e({...t,toBytes(e,t,n){const i=t.toAffine(),o=r.toBytes(i.x),s=ume;return $ye("isCompressed",n),n?s(Uint8Array.from([t.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,r.toBytes(i.y))},fromBytes(e){const t=e.length,n=e[0],s=e.subarray(1);if(t!==i||2!==n&&3!==n){if(t===o&&4===n)return{x:r.fromBytes(s.subarray(0,r.BYTES)),y:r.fromBytes(s.subarray(r.BYTES,2*r.BYTES))};throw new Error("invalid Point, expected length of "+i+", or uncompressed "+o+", got "+t)}{const e=ime(s);if(!dme(e,F_e,r.ORDER))throw new Error("Point is not on curve");const t=l(e);let i;try{i=r.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("Point is not on curve"+t)}return!(1&~n)!=((i&F_e)===F_e)&&(i=r.neg(i)),{x:e,y:i}}}}),f=e=>Zye(sme(e,t.nByteLength));function h(e){return e>n>>F_e}const p=(e,t,r)=>ime(e.slice(t,r));class g{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const r=t.nByteLength;return e=cme("compactSignature",e,2*r),new g(p(e,0,r),p(e,r,2*r))}static fromDER(e){const{r:t,s:r}=z_e.toSig(cme("DER",e));return new g(t,r)}assertValidity(){fme("r",this.r,F_e,n),fme("s",this.s,F_e,n)}addRecoveryBit(e){return new g(this.r,this.s,e)}recoverPublicKey(e){const{r:n,s:i,recovery:o}=this,u=v(cme("msgHash",e));if(null==o||![0,1,2,3].includes(o))throw new Error("recovery id invalid");const l=2===o||3===o?n+t.n:n;if(l>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=1&o?"03":"02",h=c.fromHex(d+f(l)),p=a(l),g=s(-u*p),y=s(i*p),m=c.BASE.multiplyAndAddUnsafe(h,g,y);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return nme(this.toDERHex())}toDERHex(){return z_e.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return nme(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const y={isValidPrivateKey(e){try{return u(e),!0}catch(e){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const e=Nme(t.n);return function(e,t,r=!1){const n=e.length,i=jme(t),o=Nme(t);if(n<16||n1024)throw new Error("expected "+o+"-1024 bytes of input, got "+n);const s=Tme(r?ime(e):ome(e),t-Sme)+Sme;return r?ame(s,i):sme(s,i)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function m(e){const t=Hye(e),r="string"==typeof e,n=(t||r)&&e.length;return t?n===i||n===o:r?n===2*i||n===2*o:e instanceof c}const b=t.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const r=ime(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},v=t.bits2int_modN||function(e){return s(b(e))},w=pme(t.nBitLength);function _(e){return fme("num < 2^"+t.nBitLength,e,D_e,w),sme(e,t.nByteLength)}function E(e,n,i=S){if(["recovered","canonical"].some((e=>e in i)))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:l}=t;let{lowS:f,prehash:p,extraEntropy:y}=i;null==f&&(f=!0),e=cme("msgHash",e),L_e(i),p&&(e=cme("prehashed msgHash",o(e)));const m=v(e),w=u(n),E=[_(w),_(m)];if(null!=y&&!1!==y){const e=!0===y?l(r.BYTES):y;E.push(cme("extraEntropy",e))}const k=ume(...E),A=m;return{seed:k,k2sig:function(e){const t=b(e);if(!d(t))return;const r=a(t),n=c.BASE.multiply(t).toAffine(),i=s(n.x);if(i===D_e)return;const o=s(r*s(A+i*w));if(o===D_e)return;let u=(n.x===i?0:2)|Number(n.y&F_e),l=o;return f&&h(o)&&(l=function(e){return h(e)?s(-e):e}(o),u^=1),new g(i,l,u)}}}const S={lowS:t.lowS,prehash:!1},k={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(m(e))throw new Error("first arg must be private key");if(!m(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(u(e)).toRawBytes(r)},sign:function(e,r,n=S){const{seed:i,k2sig:o}=E(e,r,n),s=t;return mme(s.hash.outputLen,s.nByteLength,s.hmac)(i,o)},verify:function(e,r,n,i=k){var o;const u=e;r=cme("msgHash",r),n=cme("publicKey",n);const{lowS:l,prehash:d,format:f}=i;if(L_e(i),"strict"in i)throw new Error("options.strict was renamed to lowS");if(void 0!==f&&"compact"!==f&&"der"!==f)throw new Error("format must be compact or der");const h="string"==typeof u||Hye(u),p=!h&&!f&&"object"==typeof u&&null!==u&&"bigint"==typeof u.r&&"bigint"==typeof u.s;if(!h&&!p)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let y,m;try{if(p&&(y=new g(u.r,u.s)),h){try{"compact"!==f&&(y=g.fromDER(u))}catch(e){if(!(e instanceof z_e.Err))throw e}y||"der"===f||(y=g.fromCompact(u))}m=c.fromHex(n)}catch(e){return!1}if(!y)return!1;if(l&&y.hasHighS())return!1;d&&(r=t.hash(r));const{r:b,s:w}=y,_=v(r),E=a(w),S=s(_*E),A=s(b*E),x=null===(o=c.BASE.multiplyAndAddUnsafe(m,S,A))||void 0===o?void 0:o.toAffine();return!!x&&s(x.x)===b},ProjectivePoint:c,Signature:g,utils:y}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $_e(e){return{hash:e,hmac:(t,...r)=>U_e(e,t,function(...e){let t=0;for(let r=0;r(e+t/G_e)/t,J_e=Lme(K_e,void 0,void 0,{sqrt:function(e){const t=K_e,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,d=Ome(l,r,t)*l%t,f=Ome(d,r,t)*l%t,h=Ome(f,G_e,t)*u%t,p=Ome(h,i,t)*h%t,g=Ome(p,o,t)*p%t,y=Ome(g,a,t)*g%t,m=Ome(y,c,t)*y%t,b=Ome(m,a,t)*g%t,v=Ome(b,r,t)*l%t,w=Ome(v,s,t)*p%t,_=Ome(w,n,t)*u%t,E=Ome(_,G_e,t);if(!J_e.eql(J_e.sqr(E),e))throw new Error("Cannot find square root");return E}}),X_e=function(e,t){const r=t=>V_e({...e,...$_e(t)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:J_e,n:Z_e,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Z_e,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-W_e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),a=Y_e(o*e,t),c=Y_e(-n*e,t);let u=Tme(e-a*r-c*i,t),l=Tme(-a*n-c*o,t);const d=u>s,f=l>s;if(d&&(u=t-u),f&&(l=t-l),u>s||l>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:f,k2:l}}}},P_e);function Q_e(e){try{return fbe.ExtendedPoint.fromHex(e),!0}catch{return!1}}BigInt(0),X_e.ProjectivePoint,fbe.utils.randomPrivateKey;const eEe=(e,t)=>fbe.sign(e,t.slice(0,32)),tEe=fbe.verify,rEe=e=>age.isBuffer(e)?e:e instanceof Uint8Array?age.from(e.buffer,e.byteOffset,e.byteLength):age.from(e);class nEe{constructor(e){Object.assign(this,e)}encode(){return age.from(dve(iEe,this))}static decode(e){return pve(iEe,this,e)}static decodeUnchecked(e){return Xbe(iEe,this,e)}}const iEe=new Map;var oEe;const sEe=32;let aEe=1;class cEe extends nEe{constructor(e){if(super({}),this._bn=void 0,function(e){return void 0!==e._bn}(e))this._bn=e._bn;else{if("string"==typeof e){const t=vbe.decode(e);if(t.length!=sEe)throw new Error("Invalid public key input");this._bn=new gbe(t)}else this._bn=new gbe(e);if(this._bn.byteLength()>sEe)throw new Error("Invalid public key input")}}static unique(){const e=new cEe(aEe);return aEe+=1,new cEe(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return vbe.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(age);if(e.length===sEe)return e;const t=age.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,r){const n=age.concat([e.toBuffer(),age.from(t),r.toBuffer()]),i=Mbe(n);return new cEe(i)}static createProgramAddressSync(e,t){let r=age.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");r=age.concat([r,rEe(e)])})),r=age.concat([r,t.toBuffer(),age.from("ProgramDerivedAddress")]);const n=Mbe(r);if(Q_e(n))throw new Error("Invalid seeds, address must fall off the curve");return new cEe(n)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r,n=255;for(;0!=n;){try{const i=e.concat(age.from([n]));r=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;n--;continue}return[r,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return Q_e(new cEe(e).toBytes())}}oEe=cEe,cEe.default=new oEe("11111111111111111111111111111111"),iEe.set(cEe,{kind:"struct",fields:[["_bn","u256"]]}),new cEe("BPFLoader1111111111111111111111111111111111");const uEe=1232;class lEe extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(lEe.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class dEe extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(dEe.prototype,"name",{value:"TransactionExpiredTimeoutError"});class fEe extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(fEe.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class hEe{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e256)throw new Error("Account index overflow encountered during compilation");const t=new Map;this.keySegments().flat().forEach(((e,r)=>{t.set(e.toBase58(),r)}));const r=e=>{const r=t.get(e.toBase58());if(void 0===r)throw new Error("Encountered an unknown instruction account key during compilation");return r};return e.map((e=>({programIdIndex:r(e.programId),accountKeyIndexes:e.keys.map((e=>r(e.pubkey))),data:e.data})))}}const pEe=(e="publicKey")=>awe(32,e),gEe=(e="signature")=>awe(64,e),yEe=(e="string")=>{const t=owe([rwe("length"),rwe("lengthPadding"),awe(Qve(rwe(),-8),"chars")],e),r=t.decode.bind(t),n=t.encode.bind(t),i=t;return i.decode=(e,t)=>r(e,t).chars.toString(),i.encode=(e,t,r)=>{const i={chars:age.from(e,"utf8")};return n(i,t,r)},i.alloc=e=>rwe().span+rwe().span+age.from(e,"utf8").length,i};function mEe(e){let t=0,r=0;for(;;){let n=e.shift();if(t|=(127&n)<<7*r,r+=1,!(128&n))break}return t}function bEe(e,t){let r=t;for(;;){let t=127&r;if(r>>=7,0==r){e.push(t);break}t|=128,e.push(t)}}function vEe(e,t){if(!e)throw new Error(t||"Assertion failed")}class wEe{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const r=new Map,n=e=>{const t=e.toBase58();let n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},i=n(t);i.isSigner=!0,i.isWritable=!0;for(const t of e){n(t.programId).isInvoked=!0;for(const e of t.keys){const t=n(e.pubkey);t.isSigner||(t.isSigner=e.isSigner),t.isWritable||(t.isWritable=e.isWritable)}}return new wEe(t,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];vEe(e.length<=256,"Max static account keys length exceeded");const t=e.filter((([,e])=>e.isSigner&&e.isWritable)),r=e.filter((([,e])=>e.isSigner&&!e.isWritable)),n=e.filter((([,e])=>!e.isSigner&&e.isWritable)),i=e.filter((([,e])=>!e.isSigner&&!e.isWritable)),o={numRequiredSignatures:t.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{vEe(t.length>0,"Expected at least one writable signer key");const[e]=t[0];vEe(e===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const s=[...t.map((([e])=>new cEe(e))),...r.map((([e])=>new cEe(e))),...n.map((([e])=>new cEe(e))),...i.map((([e])=>new cEe(e)))];return[o,s]}extractTableLookup(e){const[t,r]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&e.isWritable)),[n,i]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&!e.isWritable));if(0!==t.length||0!==n.length)return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:n},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(e,t){const r=new Array,n=new Array;for(const[i,o]of this.keyMetaMap.entries())if(t(o)){const t=new cEe(i),o=e.findIndex((e=>e.equals(t)));o>=0&&(vEe(o<256,"Max lookup table index exceeded"),r.push(o),n.push(t),this.keyMetaMap.delete(i))}return[r,n]}}const _Ee="Reached end of buffer unexpectedly";function EEe(e){if(0===e.length)throw new Error(_Ee);return e.shift()}function SEe(e,...t){var r;const[n]=t;if(2===t.length?n+(null!==(r=t[1])&&void 0!==r?r:0)>e.length:n>=e.length)throw new Error(_Ee);return e.splice(...t)}class kEe{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map((e=>new cEe(e))),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach((e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex])))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map((e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:vbe.decode(e.data)})))}get addressTableLookups(){return[]}getAccountKeys(){return new hEe(this.staticAccountKeys)}static compile(e){const t=wEe.compile(e.instructions,e.payerKey),[r,n]=t.getMessageComponents(),i=new hEe(n).compileInstructions(e.instructions).map((e=>({programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:vbe.encode(e.data)})));return new kEe({header:r,accountKeys:n,recentBlockhash:e.recentBlockhash,instructions:i})}isAccountSigner(e){return e=this.header.numRequiredSignatures?e-t!this.isProgramId(t)))}serialize(){const e=this.accountKeys.length;let t=[];bEe(t,e);const r=this.instructions.map((e=>{const{accounts:t,programIdIndex:r}=e,n=Array.from(vbe.decode(e.data));let i=[];bEe(i,t.length);let o=[];return bEe(o,n.length),{programIdIndex:r,keyIndicesCount:age.from(i),keyIndices:t,dataLength:age.from(o),data:n}}));let n=[];bEe(n,r.length);let i=age.alloc(uEe);age.from(n).copy(i);let o=n.length;r.forEach((e=>{const t=owe([ewe("programIdIndex"),awe(e.keyIndicesCount.length,"keyIndicesCount"),swe(ewe("keyIndex"),e.keyIndices.length,"keyIndices"),awe(e.dataLength.length,"dataLength"),swe(ewe("userdatum"),e.data.length,"data")]).encode(e,i,o);o+=t})),i=i.slice(0,o);const s=owe([awe(1,"numRequiredSignatures"),awe(1,"numReadonlySignedAccounts"),awe(1,"numReadonlyUnsignedAccounts"),awe(t.length,"keyCount"),swe(pEe("key"),e,"keys"),pEe("recentBlockhash")]),a={numRequiredSignatures:age.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:age.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:age.from([this.header.numReadonlyUnsignedAccounts]),keyCount:age.from(t),keys:this.accountKeys.map((e=>rEe(e.toBytes()))),recentBlockhash:vbe.decode(this.recentBlockhash)};let c=age.alloc(2048);const u=s.encode(a,c);return i.copy(c,u),c.slice(0,u+i.length)}static from(e){let t=[...e];const r=EEe(t);if(r!==(127&r))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const n=EEe(t),i=EEe(t),o=mEe(t);let s=[];for(let e=0;e0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new hEe(this.staticAccountKeys,t)}isAccountSigner(e){return e=r){const t=e-r,n=this.addressTableLookups.reduce(((e,t)=>e+t.writableIndexes.length),0);return t=this.header.numRequiredSignatures?e-te.key.equals(r.accountKey)));if(!n)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const e of r.writableIndexes){if(!(ee.toBytes())),recentBlockhash:vbe.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:n},s);return s.slice(0,a)}serializeInstructions(){let e=0;const t=new Uint8Array(uEe);for(const r of this.compiledInstructions){const n=Array();bEe(n,r.accountKeyIndexes.length);const i=Array();bEe(i,r.data.length),e+=owe([ewe("programIdIndex"),awe(n.length,"encodedAccountKeyIndexesLength"),swe(ewe(),r.accountKeyIndexes.length,"accountKeyIndexes"),awe(i.length,"encodedDataLength"),awe(r.data.length,"data")]).encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0;const t=new Uint8Array(uEe);for(const r of this.addressTableLookups){const n=Array();bEe(n,r.writableIndexes.length);const i=Array();bEe(i,r.readonlyIndexes.length),e+=owe([pEe("accountKey"),awe(n.length,"encodedWritableIndexesLength"),swe(ewe(),r.writableIndexes.length,"writableIndexes"),awe(i.length,"encodedReadonlyIndexesLength"),swe(ewe(),r.readonlyIndexes.length,"readonlyIndexes")]).encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e];const r=EEe(t),n=127&r;vEe(r!==n,"Expected versioned message but received legacy message"),vEe(0===n,`Expected versioned message with version 0 but found version ${n}`);const i={numRequiredSignatures:EEe(t),numReadonlySignedAccounts:EEe(t),numReadonlyUnsignedAccounts:EEe(t)},o=[],s=mEe(t);for(let e=0;e{const t=xEe.deserializeMessageVersion(e);if("legacy"===t)return kEe.from(e);if(0===t)return AEe.deserialize(e);throw new Error(`Transaction message version ${t} deserialization is not supported`)}};let IEe=function(e){return e[e.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",e[e.PROCESSED=1]="PROCESSED",e[e.TIMED_OUT=2]="TIMED_OUT",e[e.NONCE_INVALID=3]="NONCE_INVALID",e}({});const BEe=age.alloc(64).fill(0);class TEe{constructor(e){this.keys=void 0,this.programId=void 0,this.data=age.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map((({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r}))),programId:this.programId.toJSON(),data:[...this.data]}}}class CEe{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:r}=e;this.minNonceContextSlot=t,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:r}=e;this.recentBlockhash=t,this.lastValidBlockHeight=r}else{const{recentBlockhash:t,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map((e=>e.toJSON())),signers:this.signatures.map((({publicKey:e})=>e.toJSON()))}}add(...e){if(0===e.length)throw new Error("No instructions");return e.forEach((e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new TEe(e))})),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t,r;if(this.nonceInfo?(e=this.nonceInfo.nonce,t=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");if(t.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");r=this.signatures[0].publicKey}for(let e=0;e{e.keys.forEach((e=>{i.push({...e})}));const t=e.programId.toString();n.includes(t)||n.push(t)})),n.forEach((e=>{i.push({pubkey:new cEe(e),isSigner:!1,isWritable:!1})}));const o=[];i.forEach((e=>{const t=e.pubkey.toString(),r=o.findIndex((e=>e.pubkey.toString()===t));r>-1?(o[r].isWritable=o[r].isWritable||e.isWritable,o[r].isSigner=o[r].isSigner||e.isSigner):o.push(e)})),o.sort((function(e,t){return e.isSigner!==t.isSigner?e.isSigner?-1:1:e.isWritable!==t.isWritable?e.isWritable?-1:1:e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})}));const s=o.findIndex((e=>e.pubkey.equals(r)));if(s>-1){const[e]=o.splice(s,1);e.isSigner=!0,e.isWritable=!0,o.unshift(e)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const e of this.signatures){const t=o.findIndex((t=>t.pubkey.equals(e.publicKey)));if(!(t>-1))throw new Error(`unknown signer: ${e.publicKey.toString()}`);o[t].isSigner||(o[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))}let a=0,c=0,u=0;const l=[],d=[];o.forEach((({pubkey:e,isSigner:t,isWritable:r})=>{t?(l.push(e.toString()),a+=1,r||(c+=1)):(d.push(e.toString()),r||(u+=1))}));const f=l.concat(d),h=t.map((e=>{const{data:t,programId:r}=e;return{programIdIndex:f.indexOf(r.toString()),accounts:e.keys.map((e=>f.indexOf(e.pubkey.toString()))),data:vbe.encode(t)}}));return h.forEach((e=>{vEe(e.programIdIndex>=0),e.accounts.forEach((e=>vEe(e>=0)))})),new kEe({header:{numRequiredSignatures:a,numReadonlySignedAccounts:c,numReadonlyUnsignedAccounts:u},accountKeys:f,recentBlockhash:e,instructions:h})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length){const r=this.signatures.every(((e,r)=>t[r].equals(e.publicKey)));if(r)return e}return this.signatures=t.map((e=>({signature:null,publicKey:e}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(0===e.length)throw new Error("No signers");const t=new Set;this.signatures=e.filter((e=>{const r=e.toString();return!t.has(r)&&(t.add(r),!0)})).map((e=>({signature:null,publicKey:e})))}sign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,r=[];for(const n of e){const e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}this.signatures=r.map((e=>({signature:null,publicKey:e.publicKey})));const n=this._compile();this._partialSign(n,...r)}partialSign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,r=[];for(const n of e){const e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}const n=this._compile();this._partialSign(n,...r)}_partialSign(e,...t){const r=e.serialize();t.forEach((e=>{const t=eEe(r,e.secretKey);this._addSignature(e.publicKey,rEe(t))}))}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){vEe(64===t.length);const r=this.signatures.findIndex((t=>e.equals(t.publicKey)));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=age.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const r={};for(const{signature:n,publicKey:i}of this.signatures)null===n?t&&(r.missing||(r.missing=[])).push(i):tEe(n,e,i.toBytes())||(r.invalid||(r.invalid=[])).push(i);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=this.serializeMessage();if(r){const e=this._getMessageSignednessErrors(n,t);if(e){let t="Signature verification failed.";throw e.invalid&&(t+=`\nInvalid signature for public key${1===e.invalid.length?"":"(s)"} [\`${e.invalid.map((e=>e.toBase58())).join("`, `")}\`].`),e.missing&&(t+=`\nMissing signature for public key${1===e.missing.length?"":"(s)"} [\`${e.missing.map((e=>e.toBase58())).join("`, `")}\`].`),new Error(t)}}return this._serialize(n)}_serialize(e){const{signatures:t}=this,r=[];bEe(r,t.length);const n=r.length+64*t.length+e.length,i=age.alloc(n);return vEe(t.length<256),age.from(r).copy(i,0),t.forEach((({signature:e},t)=>{null!==e&&(vEe(64===e.length,"signature has invalid length"),age.from(e).copy(i,r.length+64*t))})),e.copy(i,r.length+64*t.length),vEe(i.length<=uEe,`Transaction too large: ${i.length} > 1232`),i}get keys(){return vEe(1===this.instructions.length),this.instructions[0].keys.map((e=>e.pubkey))}get programId(){return vEe(1===this.instructions.length),this.instructions[0].programId}get data(){return vEe(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e];const r=mEe(t);let n=[];for(let e=0;e0&&(r.feePayer=e.accountKeys[0]),t.forEach(((t,n)=>{const i={signature:t==vbe.encode(BEe)?null:vbe.decode(t),publicKey:e.accountKeys[n]};r.signatures.push(i)})),e.instructions.forEach((t=>{const n=t.accounts.map((t=>{const n=e.accountKeys[t];return{pubkey:n,isSigner:r.signatures.some((e=>e.publicKey.toString()===n.toString()))||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}}));r.instructions.push(new TEe({keys:n,programId:e.accountKeys[t.programIdIndex],data:vbe.decode(t.data)}))})),r._message=e,r._json=r.toJSON(),r}}class OEe{get version(){return this.message.version}constructor(e,t){if(this.signatures=void 0,this.message=void 0,void 0!==t)vEe(t.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=t;else{const t=[];for(let r=0;re.equals(n.publicKey)));vEe(e>=0,`Cannot sign with non signer key ${n.publicKey.toBase58()}`),this.signatures[e]=eEe(t,n.secretKey)}}addSignature(e,t){vEe(64===t.byteLength,"Signature must be 64 bytes long");const r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((t=>t.equals(e)));vEe(r>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=t}}function REe(e){return new Promise((t=>setTimeout(t,e)))}new cEe("SysvarC1ock11111111111111111111111111111111"),new cEe("SysvarEpochSchedu1e111111111111111111111111"),new cEe("Sysvar1nstructions1111111111111111111111111"),new cEe("SysvarRecentB1ockHashes11111111111111111111"),new cEe("SysvarRent111111111111111111111111111111111"),new cEe("SysvarRewards111111111111111111111111111111"),new cEe("SysvarS1otHashes111111111111111111111111111"),new cEe("SysvarS1otHistory11111111111111111111111111"),new cEe("SysvarStakeHistory1111111111111111111111111");const PEe=nwe("lamportsPerSignature"),MEe=owe([rwe("version"),rwe("state"),pEe("authorizedPubkey"),pEe("nonce"),owe([PEe],"feeCalculator")]);MEe.span;class UEe{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const t=MEe.decode(rEe(e),0);return new UEe({authorizedPubkey:new cEe(t.authorizedPubkey),nonce:new cEe(t.nonce).toString(),feeCalculator:t.feeCalculator})}}const LEe=(jEe=8,e=>{const t=awe(jEe,e),{encode:r,decode:n}=(e=>({decode:e.decode.bind(e),encode:e.encode.bind(e)}))(t),i=t;return i.decode=(e,t)=>{const r=n(e,t);return uwe(age.from(r))},i.encode=(e,t,n)=>{const i=dwe(e,jEe);return r(i,t,n)},i});var jEe;function NEe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Object.freeze({Create:{index:0,layout:owe([rwe("instruction"),iwe("lamports"),iwe("space"),pEe("programId")])},Assign:{index:1,layout:owe([rwe("instruction"),pEe("programId")])},Transfer:{index:2,layout:owe([rwe("instruction"),LEe("lamports")])},CreateWithSeed:{index:3,layout:owe([rwe("instruction"),pEe("base"),yEe("seed"),iwe("lamports"),iwe("space"),pEe("programId")])},AdvanceNonceAccount:{index:4,layout:owe([rwe("instruction")])},WithdrawNonceAccount:{index:5,layout:owe([rwe("instruction"),iwe("lamports")])},InitializeNonceAccount:{index:6,layout:owe([rwe("instruction"),pEe("authorized")])},AuthorizeNonceAccount:{index:7,layout:owe([rwe("instruction"),pEe("authorized")])},Allocate:{index:8,layout:owe([rwe("instruction"),iwe("space")])},AllocateWithSeed:{index:9,layout:owe([rwe("instruction"),pEe("base"),yEe("seed"),iwe("space"),pEe("programId")])},AssignWithSeed:{index:10,layout:owe([rwe("instruction"),pEe("base"),yEe("seed"),pEe("programId")])},TransferWithSeed:{index:11,layout:owe([rwe("instruction"),LEe("lamports"),yEe("seed"),pEe("programId")])},UpgradeNonceAccount:{index:12,layout:owe([rwe("instruction")])}}),new cEe("11111111111111111111111111111111"),new cEe("BPFLoader2111111111111111111111111111111111");var zEe=Object.prototype.toString,DEe=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};function FEe(e,t){var r,n,i,o,s,a,c;if(!0===e)return"true";if(!1===e)return"false";switch(typeof e){case"object":if(null===e)return null;if(e.toJSON&&"function"==typeof e.toJSON)return FEe(e.toJSON(),t);if("[object Array]"===(c=zEe.call(e))){for(i="[",n=e.length-1,r=0;r-1&&(i+=FEe(e[r],!0)),i+"]"}if("[object Object]"===c){for(n=(o=DEe(e).sort()).length,i="",r=0;r1;)e/=2,t++;return t}class VEe{constructor(e,t,r,n,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=t,this.warmup=r,this.firstNormalEpoch=n,this.firstNormalSlot=i}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,1+(e|=e>>32))}(e+32+1))-HEe(32)-1;return[t,e-(this.getSlotsInEpoch(t)-32)]}{const t=e-this.firstNormalSlot,r=Math.floor(t/this.slotsPerEpoch);return[this.firstNormalEpoch+r,t%this.slotsPerEpoch]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e{const r=B_e(e,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...t});return this.underlyingSocket="socket"in r?r.socket:r,r}),e,t,r),this.underlyingSocket=void 0}call(...e){var t;const r=null===(t=this.underlyingSocket)||void 0===t?void 0:t.readyState;return 1===r?super.call(...e):Promise.reject(new Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+r+")"))}notify(...e){var t;const r=null===(t=this.underlyingSocket)||void 0===t?void 0:t.readyState;return 1===r?super.notify(...e):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+r+")"))}}class GEe{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const t=function(e,t){let r;try{r=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(r.typeIndex!==e.index)throw new Error(`invalid account data; account type mismatch ${r.typeIndex} != ${e.index}`);return r}(YEe,e),r=e.length-56;vEe(r>=0,"lookup table is invalid"),vEe(r%32==0,"lookup table is invalid");const n=r/32,{addresses:i}=owe([swe(pEe(),n,"addresses")]).decode(e.slice(56));return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:0!==t.authority.length?new cEe(t.authority[0]):void 0,addresses:i.map((e=>new cEe(e)))}}}const YEe={index:1,layout:owe([rwe("typeIndex"),LEe("deactivationSlot"),nwe("lastExtendedSlot"),ewe("lastExtendedStartIndex"),ewe(),swe(pEe(),Qve(ewe(),-1),"authority")])},JEe=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i,XEe=Lwe(Awe(cEe),Owe(),(e=>new cEe(e))),QEe=Rwe([Owe(),xwe("base64")]),eSe=Lwe(Awe(age),QEe,(e=>age.from(e[0],"base64")));function tSe(e){let t,r;if("string"==typeof e)t=e;else if(e){const{commitment:n,...i}=e;t=n,r=i}return{commitment:t,config:r}}function rSe(e){return Mwe([Pwe({jsonrpc:xwe("2.0"),id:Owe(),result:e}),Pwe({jsonrpc:xwe("2.0"),id:Owe(),error:Pwe({code:Uwe(),message:Owe(),data:Twe(Ewe("any",(()=>!0)))})})])}const nSe=rSe(Uwe());function iSe(e){return Lwe(rSe(e),nSe,(t=>"error"in t?t:{...t,result:vwe(t.result,e)}))}function oSe(e){return iSe(Pwe({context:Pwe({slot:Bwe()}),value:e}))}function sSe(e){return Pwe({context:Pwe({slot:Bwe()}),value:e})}function aSe(e,t){return 0===e?new AEe({header:t.header,staticAccountKeys:t.accountKeys.map((e=>new cEe(e))),recentBlockhash:t.recentBlockhash,compiledInstructions:t.instructions.map((e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:vbe.decode(e.data)}))),addressTableLookups:t.addressTableLookups}):new kEe(t)}const cSe=Pwe({foundation:Bwe(),foundationTerm:Bwe(),initial:Bwe(),taper:Bwe(),terminal:Bwe()}),uSe=iSe(Swe(Iwe(Pwe({epoch:Bwe(),effectiveSlot:Bwe(),amount:Bwe(),postBalance:Bwe(),commission:Twe(Iwe(Bwe()))})))),lSe=Swe(Pwe({slot:Bwe(),prioritizationFee:Bwe()})),dSe=Pwe({total:Bwe(),validator:Bwe(),foundation:Bwe(),epoch:Bwe()}),fSe=Pwe({epoch:Bwe(),slotIndex:Bwe(),slotsInEpoch:Bwe(),absoluteSlot:Bwe(),blockHeight:Twe(Bwe()),transactionCount:Twe(Bwe())}),hSe=Pwe({slotsPerEpoch:Bwe(),leaderScheduleSlotOffset:Bwe(),warmup:kwe(),firstNormalEpoch:Bwe(),firstNormalSlot:Bwe()}),pSe=Cwe(Owe(),Swe(Bwe())),gSe=Iwe(Mwe([Pwe({}),Owe()])),ySe=Pwe({err:gSe}),mSe=xwe("receivedSignature"),bSe=Pwe({"solana-core":Owe(),"feature-set":Twe(Bwe())}),vSe=oSe(Pwe({err:Iwe(Mwe([Pwe({}),Owe()])),logs:Iwe(Swe(Owe())),accounts:Twe(Iwe(Swe(Iwe(Pwe({executable:kwe(),owner:Owe(),lamports:Bwe(),data:Swe(Owe()),rentEpoch:Twe(Bwe())}))))),unitsConsumed:Twe(Bwe()),returnData:Twe(Iwe(Pwe({programId:Owe(),data:Rwe([Owe(),xwe("base64")])})))})),wSe=oSe(Pwe({byIdentity:Cwe(Owe(),Swe(Bwe())),range:Pwe({firstSlot:Bwe(),lastSlot:Bwe()})})),_Se=iSe(cSe),ESe=iSe(dSe),SSe=iSe(lSe),kSe=iSe(fSe),ASe=iSe(hSe),xSe=iSe(pSe),ISe=iSe(Bwe()),BSe=oSe(Pwe({total:Bwe(),circulating:Bwe(),nonCirculating:Bwe(),nonCirculatingAccounts:Swe(XEe)})),TSe=Pwe({amount:Owe(),uiAmount:Iwe(Bwe()),decimals:Bwe(),uiAmountString:Twe(Owe())}),CSe=oSe(Swe(Pwe({address:XEe,amount:Owe(),uiAmount:Iwe(Bwe()),decimals:Bwe(),uiAmountString:Twe(Owe())}))),OSe=oSe(Swe(Pwe({pubkey:XEe,account:Pwe({executable:kwe(),owner:XEe,lamports:Bwe(),data:eSe,rentEpoch:Bwe()})}))),RSe=Pwe({program:Owe(),parsed:Uwe(),space:Bwe()}),PSe=oSe(Swe(Pwe({pubkey:XEe,account:Pwe({executable:kwe(),owner:XEe,lamports:Bwe(),data:RSe,rentEpoch:Bwe()})}))),MSe=oSe(Swe(Pwe({lamports:Bwe(),address:XEe}))),USe=Pwe({executable:kwe(),owner:XEe,lamports:Bwe(),data:eSe,rentEpoch:Bwe()}),LSe=Pwe({pubkey:XEe,account:USe}),jSe=Lwe(Mwe([Awe(age),RSe]),Mwe([QEe,RSe]),(e=>Array.isArray(e)?vwe(e,eSe):e)),NSe=Pwe({executable:kwe(),owner:XEe,lamports:Bwe(),data:jSe,rentEpoch:Bwe()}),zSe=Pwe({pubkey:XEe,account:NSe}),DSe=Pwe({state:Mwe([xwe("active"),xwe("inactive"),xwe("activating"),xwe("deactivating")]),active:Bwe(),inactive:Bwe()}),FSe=iSe(Swe(Pwe({signature:Owe(),slot:Bwe(),err:gSe,memo:Iwe(Owe()),blockTime:Twe(Iwe(Bwe()))}))),qSe=iSe(Swe(Pwe({signature:Owe(),slot:Bwe(),err:gSe,memo:Iwe(Owe()),blockTime:Twe(Iwe(Bwe()))}))),HSe=Pwe({subscription:Bwe(),result:sSe(USe)}),VSe=Pwe({pubkey:XEe,account:USe}),$Se=Pwe({subscription:Bwe(),result:sSe(VSe)}),KSe=Pwe({parent:Bwe(),slot:Bwe(),root:Bwe()}),ZSe=Pwe({subscription:Bwe(),result:KSe}),WSe=Mwe([Pwe({type:Mwe([xwe("firstShredReceived"),xwe("completed"),xwe("optimisticConfirmation"),xwe("root")]),slot:Bwe(),timestamp:Bwe()}),Pwe({type:xwe("createdBank"),parent:Bwe(),slot:Bwe(),timestamp:Bwe()}),Pwe({type:xwe("frozen"),slot:Bwe(),timestamp:Bwe(),stats:Pwe({numTransactionEntries:Bwe(),numSuccessfulTransactions:Bwe(),numFailedTransactions:Bwe(),maxTransactionsPerEntry:Bwe()})}),Pwe({type:xwe("dead"),slot:Bwe(),timestamp:Bwe(),err:Owe()})]),GSe=Pwe({subscription:Bwe(),result:WSe}),YSe=Pwe({subscription:Bwe(),result:sSe(Mwe([ySe,mSe]))}),JSe=Pwe({subscription:Bwe(),result:Bwe()}),XSe=Pwe({pubkey:Owe(),gossip:Iwe(Owe()),tpu:Iwe(Owe()),rpc:Iwe(Owe()),version:Iwe(Owe())}),QSe=Pwe({votePubkey:Owe(),nodePubkey:Owe(),activatedStake:Bwe(),epochVoteAccount:kwe(),epochCredits:Swe(Rwe([Bwe(),Bwe(),Bwe()])),commission:Bwe(),lastVote:Bwe(),rootSlot:Iwe(Bwe())}),eke=iSe(Pwe({current:Swe(QSe),delinquent:Swe(QSe)})),tke=Mwe([xwe("processed"),xwe("confirmed"),xwe("finalized")]),rke=Pwe({slot:Bwe(),confirmations:Iwe(Bwe()),err:gSe,confirmationStatus:Twe(tke)}),nke=oSe(Swe(Iwe(rke))),ike=iSe(Bwe()),oke=Pwe({accountKey:XEe,writableIndexes:Swe(Bwe()),readonlyIndexes:Swe(Bwe())}),ske=Pwe({signatures:Swe(Owe()),message:Pwe({accountKeys:Swe(Owe()),header:Pwe({numRequiredSignatures:Bwe(),numReadonlySignedAccounts:Bwe(),numReadonlyUnsignedAccounts:Bwe()}),instructions:Swe(Pwe({accounts:Swe(Bwe()),data:Owe(),programIdIndex:Bwe()})),recentBlockhash:Owe(),addressTableLookups:Twe(Swe(oke))})}),ake=Pwe({pubkey:XEe,signer:kwe(),writable:kwe(),source:Twe(Mwe([xwe("transaction"),xwe("lookupTable")]))}),cke=Pwe({accountKeys:Swe(ake),signatures:Swe(Owe())}),uke=Pwe({parsed:Uwe(),program:Owe(),programId:XEe}),lke=Pwe({accounts:Swe(XEe),data:Owe(),programId:XEe}),dke=Lwe(Mwe([lke,uke]),Mwe([Pwe({parsed:Uwe(),program:Owe(),programId:Owe()}),Pwe({accounts:Swe(Owe()),data:Owe(),programId:Owe()})]),(e=>vwe(e,"accounts"in e?lke:uke))),fke=Pwe({signatures:Swe(Owe()),message:Pwe({accountKeys:Swe(ake),instructions:Swe(dke),recentBlockhash:Owe(),addressTableLookups:Twe(Iwe(Swe(oke)))})}),hke=Pwe({accountIndex:Bwe(),mint:Owe(),owner:Twe(Owe()),uiTokenAmount:TSe}),pke=Pwe({writable:Swe(XEe),readonly:Swe(XEe)}),gke=Pwe({err:gSe,fee:Bwe(),innerInstructions:Twe(Iwe(Swe(Pwe({index:Bwe(),instructions:Swe(Pwe({accounts:Swe(Bwe()),data:Owe(),programIdIndex:Bwe()}))})))),preBalances:Swe(Bwe()),postBalances:Swe(Bwe()),logMessages:Twe(Iwe(Swe(Owe()))),preTokenBalances:Twe(Iwe(Swe(hke))),postTokenBalances:Twe(Iwe(Swe(hke))),loadedAddresses:Twe(pke),computeUnitsConsumed:Twe(Bwe())}),yke=Pwe({err:gSe,fee:Bwe(),innerInstructions:Twe(Iwe(Swe(Pwe({index:Bwe(),instructions:Swe(dke)})))),preBalances:Swe(Bwe()),postBalances:Swe(Bwe()),logMessages:Twe(Iwe(Swe(Owe()))),preTokenBalances:Twe(Iwe(Swe(hke))),postTokenBalances:Twe(Iwe(Swe(hke))),loadedAddresses:Twe(pke),computeUnitsConsumed:Twe(Bwe())}),mke=Mwe([xwe(0),xwe("legacy")]),bke=Pwe({pubkey:Owe(),lamports:Bwe(),postBalance:Iwe(Bwe()),rewardType:Iwe(Owe()),commission:Twe(Iwe(Bwe()))}),vke=iSe(Iwe(Pwe({blockhash:Owe(),previousBlockhash:Owe(),parentSlot:Bwe(),transactions:Swe(Pwe({transaction:ske,meta:Iwe(gke),version:Twe(mke)})),rewards:Twe(Swe(bke)),blockTime:Iwe(Bwe()),blockHeight:Iwe(Bwe())}))),wke=iSe(Iwe(Pwe({blockhash:Owe(),previousBlockhash:Owe(),parentSlot:Bwe(),rewards:Twe(Swe(bke)),blockTime:Iwe(Bwe()),blockHeight:Iwe(Bwe())}))),_ke=iSe(Iwe(Pwe({blockhash:Owe(),previousBlockhash:Owe(),parentSlot:Bwe(),transactions:Swe(Pwe({transaction:cke,meta:Iwe(gke),version:Twe(mke)})),rewards:Twe(Swe(bke)),blockTime:Iwe(Bwe()),blockHeight:Iwe(Bwe())}))),Eke=iSe(Iwe(Pwe({blockhash:Owe(),previousBlockhash:Owe(),parentSlot:Bwe(),transactions:Swe(Pwe({transaction:fke,meta:Iwe(yke),version:Twe(mke)})),rewards:Twe(Swe(bke)),blockTime:Iwe(Bwe()),blockHeight:Iwe(Bwe())}))),Ske=iSe(Iwe(Pwe({blockhash:Owe(),previousBlockhash:Owe(),parentSlot:Bwe(),transactions:Swe(Pwe({transaction:cke,meta:Iwe(yke),version:Twe(mke)})),rewards:Twe(Swe(bke)),blockTime:Iwe(Bwe()),blockHeight:Iwe(Bwe())}))),kke=iSe(Iwe(Pwe({blockhash:Owe(),previousBlockhash:Owe(),parentSlot:Bwe(),rewards:Twe(Swe(bke)),blockTime:Iwe(Bwe()),blockHeight:Iwe(Bwe())}))),Ake=iSe(Iwe(Pwe({blockhash:Owe(),previousBlockhash:Owe(),parentSlot:Bwe(),transactions:Swe(Pwe({transaction:ske,meta:Iwe(gke)})),rewards:Twe(Swe(bke)),blockTime:Iwe(Bwe())}))),xke=iSe(Iwe(Pwe({blockhash:Owe(),previousBlockhash:Owe(),parentSlot:Bwe(),signatures:Swe(Owe()),blockTime:Iwe(Bwe())}))),Ike=iSe(Iwe(Pwe({slot:Bwe(),meta:Iwe(gke),blockTime:Twe(Iwe(Bwe())),transaction:ske,version:Twe(mke)}))),Bke=iSe(Iwe(Pwe({slot:Bwe(),transaction:fke,meta:Iwe(yke),blockTime:Twe(Iwe(Bwe())),version:Twe(mke)}))),Tke=oSe(Pwe({blockhash:Owe(),feeCalculator:Pwe({lamportsPerSignature:Bwe()})})),Cke=oSe(Pwe({blockhash:Owe(),lastValidBlockHeight:Bwe()})),Oke=oSe(kwe()),Rke=iSe(Swe(Pwe({slot:Bwe(),numTransactions:Bwe(),numSlots:Bwe(),samplePeriodSecs:Bwe()}))),Pke=oSe(Iwe(Pwe({feeCalculator:Pwe({lamportsPerSignature:Bwe()})}))),Mke=iSe(Owe()),Uke=iSe(Owe()),Lke=Pwe({err:gSe,logs:Swe(Owe()),signature:Owe()}),jke=Pwe({result:sSe(Lke),subscription:Bwe()}),Nke={"solana-client":"js/0.0.0-development"};class zke{constructor(e,t){let r,n,i,o,s,a;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const e={};return async t=>{var r;const{commitment:n,config:i}=tSe(t),o=this._buildArgs([],n,void 0,i),s=qEe(o);return e[s]=null!==(r=e[s])&&void 0!==r?r:(async()=>{try{const e=vwe(await this._rpcRequest("getBlockHeight",o),iSe(Bwe()));if("error"in e)throw new KEe(e.error,"failed to get block height information");return e.result}finally{delete e[s]}})(),await e[s]}})(),t&&"string"==typeof t?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,r=t.wsEndpoint,n=t.httpHeaders,i=t.fetch,o=t.fetchMiddleware,s=t.disableRetryOnRateLimit,a=t.httpAgent),this._rpcEndpoint=function(e){if(!1===/^https?:/.test(e))throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return e}(e),this._rpcWsEndpoint=r||function(e){const t=e.match(JEe);if(null==t)throw TypeError(`Failed to validate endpoint URL \`${e}\``);const[r,n,i,o]=t,s=e.startsWith("https:")?"wss:":"ws:",a=null==i?null:parseInt(i.slice(1),10);return`${s}//${n}${null==a?"":`:${a+1}`}${o}`}(e),this._rpcClient=function(e,t,r,n,i,o){const s=r||ZEe;let a;null!=o&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),n&&(a=async(e,t)=>{const r=await new Promise(((r,i)=>{try{n(e,t,((e,t)=>r([e,t])))}catch(e){i(e)}}));return await s(...r)});const c=new y_e((async(r,n)=>{const o={method:"POST",body:r,agent:void 0,headers:Object.assign({"Content-Type":"application/json"},t||{},Nke)};try{let t,r=5,c=500;for(;t=a?await a(e,o):await s(e,o),429===t.status&&!0!==i&&(r-=1,0!==r);)console.error(`Server responded with ${t.status} ${t.statusText}. Retrying after ${c}ms delay...`),await REe(c),c*=2;const u=await t.text();t.ok?n(null,u):n(new Error(`${t.status} ${t.statusText}: ${u}`))}catch(e){e instanceof Error&&n(e)}}),{});return c}(e,n,i,o,s,a),this._rpcRequest=function(e){return(t,r)=>new Promise(((n,i)=>{e.request(t,r,((e,t)=>{e?i(e):n(t)}))}))}(this._rpcClient),this._rpcBatchRequest=function(e){return t=>new Promise(((r,n)=>{0===t.length&&r([]);const i=t.map((t=>e.request(t.methodName,t.args)));e.request(i,((e,t)=>{e?n(e):r(t)}))}))}(this._rpcClient),this._rpcWebSocket=new WEe(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,t){const{commitment:r,config:n}=tSe(t),i=this._buildArgs([e.toBase58()],r,void 0,n),o=vwe(await this._rpcRequest("getBalance",i),oSe(Bwe()));if("error"in o)throw new KEe(o.error,`failed to get balance for ${e.toBase58()}`);return o.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then((e=>e.value)).catch((t=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+t)}))}async getBlockTime(e){const t=vwe(await this._rpcRequest("getBlockTime",[e]),iSe(Iwe(Bwe())));if("error"in t)throw new KEe(t.error,`failed to get block time for slot ${e}`);return t.result}async getMinimumLedgerSlot(){const e=vwe(await this._rpcRequest("minimumLedgerSlot",[]),iSe(Bwe()));if("error"in e)throw new KEe(e.error,"failed to get minimum ledger slot");return e.result}async getFirstAvailableBlock(){const e=vwe(await this._rpcRequest("getFirstAvailableBlock",[]),ISe);if("error"in e)throw new KEe(e.error,"failed to get first available block");return e.result}async getSupply(e){let t={};t="string"==typeof e?{commitment:e}:e?{...e,commitment:e&&e.commitment||this.commitment}:{commitment:this.commitment};const r=vwe(await this._rpcRequest("getSupply",[t]),BSe);if("error"in r)throw new KEe(r.error,"failed to get supply");return r.result}async getTokenSupply(e,t){const r=this._buildArgs([e.toBase58()],t),n=vwe(await this._rpcRequest("getTokenSupply",r),oSe(TSe));if("error"in n)throw new KEe(n.error,"failed to get token supply");return n.result}async getTokenAccountBalance(e,t){const r=this._buildArgs([e.toBase58()],t),n=vwe(await this._rpcRequest("getTokenAccountBalance",r),oSe(TSe));if("error"in n)throw new KEe(n.error,"failed to get token account balance");return n.result}async getTokenAccountsByOwner(e,t,r){const{commitment:n,config:i}=tSe(r);let o=[e.toBase58()];"mint"in t?o.push({mint:t.mint.toBase58()}):o.push({programId:t.programId.toBase58()});const s=this._buildArgs(o,n,"base64",i),a=vwe(await this._rpcRequest("getTokenAccountsByOwner",s),OSe);if("error"in a)throw new KEe(a.error,`failed to get token accounts owned by account ${e.toBase58()}`);return a.result}async getParsedTokenAccountsByOwner(e,t,r){let n=[e.toBase58()];"mint"in t?n.push({mint:t.mint.toBase58()}):n.push({programId:t.programId.toBase58()});const i=this._buildArgs(n,r,"jsonParsed"),o=vwe(await this._rpcRequest("getTokenAccountsByOwner",i),PSe);if("error"in o)throw new KEe(o.error,`failed to get token accounts owned by account ${e.toBase58()}`);return o.result}async getLargestAccounts(e){const t={...e,commitment:e&&e.commitment||this.commitment},r=t.filter||t.commitment?[t]:[],n=vwe(await this._rpcRequest("getLargestAccounts",r),MSe);if("error"in n)throw new KEe(n.error,"failed to get largest accounts");return n.result}async getTokenLargestAccounts(e,t){const r=this._buildArgs([e.toBase58()],t),n=vwe(await this._rpcRequest("getTokenLargestAccounts",r),CSe);if("error"in n)throw new KEe(n.error,"failed to get token largest accounts");return n.result}async getAccountInfoAndContext(e,t){const{commitment:r,config:n}=tSe(t),i=this._buildArgs([e.toBase58()],r,"base64",n),o=vwe(await this._rpcRequest("getAccountInfo",i),oSe(Iwe(USe)));if("error"in o)throw new KEe(o.error,`failed to get info about account ${e.toBase58()}`);return o.result}async getParsedAccountInfo(e,t){const{commitment:r,config:n}=tSe(t),i=this._buildArgs([e.toBase58()],r,"jsonParsed",n),o=vwe(await this._rpcRequest("getAccountInfo",i),oSe(Iwe(NSe)));if("error"in o)throw new KEe(o.error,`failed to get info about account ${e.toBase58()}`);return o.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(t){throw new Error("failed to get info about account "+e.toBase58()+": "+t)}}async getMultipleParsedAccounts(e,t){const{commitment:r,config:n}=tSe(t),i=e.map((e=>e.toBase58())),o=this._buildArgs([i],r,"jsonParsed",n),s=vwe(await this._rpcRequest("getMultipleAccounts",o),oSe(Swe(Iwe(NSe))));if("error"in s)throw new KEe(s.error,`failed to get info for accounts ${i}`);return s.result}async getMultipleAccountsInfoAndContext(e,t){const{commitment:r,config:n}=tSe(t),i=e.map((e=>e.toBase58())),o=this._buildArgs([i],r,"base64",n),s=vwe(await this._rpcRequest("getMultipleAccounts",o),oSe(Swe(Iwe(USe))));if("error"in s)throw new KEe(s.error,`failed to get info for accounts ${i}`);return s.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,r){const{commitment:n,config:i}=tSe(t),o=this._buildArgs([e.toBase58()],n,void 0,{...i,epoch:null!=r?r:null==i?void 0:i.epoch}),s=vwe(await this._rpcRequest("getStakeActivation",o),iSe(DSe));if("error"in s)throw new KEe(s.error,`failed to get Stake Activation ${e.toBase58()}`);return s.result}async getProgramAccounts(e,t){const{commitment:r,config:n}=tSe(t),{encoding:i,...o}=n||{},s=this._buildArgs([e.toBase58()],r,i||"base64",o),a=await this._rpcRequest("getProgramAccounts",s),c=Swe(LSe),u=!0===o.withContext?vwe(a,oSe(c)):vwe(a,iSe(c));if("error"in u)throw new KEe(u.error,`failed to get accounts owned by program ${e.toBase58()}`);return u.result}async getParsedProgramAccounts(e,t){const{commitment:r,config:n}=tSe(t),i=this._buildArgs([e.toBase58()],r,"jsonParsed",n),o=vwe(await this._rpcRequest("getProgramAccounts",i),iSe(Swe(zSe)));if("error"in o)throw new KEe(o.error,`failed to get accounts owned by program ${e.toBase58()}`);return o.result}async confirmTransaction(e,t){let r,n;if("string"==typeof e)r=e;else{var i;const t=e;if(null!==(i=t.abortSignal)&&void 0!==i&&i.aborted)return Promise.reject(t.abortSignal.reason);r=t.signature}try{n=vbe.decode(r)}catch(e){throw new Error("signature must be base58 encoded: "+r)}return vEe(64===n.length,"signature has invalid length"),"string"==typeof e?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:t||this.commitment,signature:r}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:t||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise(((t,r)=>{null!=e&&(e.aborted?r(e.reason):e.addEventListener("abort",(()=>{r(e.reason)})))}))}getTransactionConfirmationPromise({commitment:e,signature:t}){let r,n,i=!1;const o=new Promise(((o,s)=>{try{r=this.onSignature(t,((e,t)=>{r=void 0;const n={context:t,value:e};o({__type:IEe.PROCESSED,response:n})}),e);const a=new Promise((e=>{null==r?e():n=this._onSubscriptionStateChange(r,(t=>{"subscribed"===t&&e()}))}));(async()=>{if(await a,i)return;const r=await this.getSignatureStatus(t);if(i)return;if(null==r)return;const{context:n,value:c}=r;if(null!=c)if(null!=c&&c.err)s(c.err);else{switch(e){case"confirmed":case"single":case"singleGossip":if("processed"===c.confirmationStatus)return;break;case"finalized":case"max":case"root":if("processed"===c.confirmationStatus||"confirmed"===c.confirmationStatus)return}i=!0,o({__type:IEe.PROCESSED,response:{context:n,value:c}})}})()}catch(e){s(e)}}));return{abortConfirmation:()=>{n&&(n(),n=void 0),null!=r&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:o}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:t,lastValidBlockHeight:r,signature:n}}){let i=!1;const o=new Promise((t=>{const n=async()=>{try{return await this.getBlockHeight(e)}catch(e){return-1}};(async()=>{let e=await n();if(!i){for(;e<=r;){if(await REe(1e3),i)return;if(e=await n(),i)return}t({__type:IEe.BLOCKHEIGHT_EXCEEDED})}})()})),{abortConfirmation:s,confirmationPromise:a}=this.getTransactionConfirmationPromise({commitment:e,signature:n}),c=this.getCancellationPromise(t);let u;try{const e=await Promise.race([c,a,o]);if(e.__type!==IEe.PROCESSED)throw new lEe(n);u=e.response}finally{i=!0,s()}return u}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:t,minContextSlot:r,nonceAccountPubkey:n,nonceValue:i,signature:o}}){let s=!1;const a=new Promise((t=>{let o=i,a=null;const c=async()=>{try{const{context:t,value:i}=await this.getNonceAndContext(n,{commitment:e,minContextSlot:r});return a=t.slot,null==i?void 0:i.nonce}catch(e){return o}};(async()=>{if(o=await c(),!s)for(;;){if(i!==o)return void t({__type:IEe.NONCE_INVALID,slotInWhichNonceDidAdvance:a});if(await REe(2e3),s)return;if(o=await c(),s)return}})()})),{abortConfirmation:c,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:e,signature:o}),l=this.getCancellationPromise(t);let d;try{const t=await Promise.race([l,u,a]);if(t.__type===IEe.PROCESSED)d=t.response;else{var f;let n;for(;;){var h;const e=await this.getSignatureStatus(o);if(null==e)break;if(!(e.context.slot<(null!==(h=t.slotInWhichNonceDidAdvance)&&void 0!==h?h:r))){n=e;break}await REe(400)}if(null===(f=n)||void 0===f||!f.value)throw new fEe(o);{const t=e||"finalized",{confirmationStatus:r}=n.value;switch(t){case"processed":case"recent":if("processed"!==r&&"confirmed"!==r&&"finalized"!==r)throw new fEe(o);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==r&&"finalized"!==r)throw new fEe(o);break;case"finalized":case"max":case"root":if("finalized"!==r)throw new fEe(o)}d={context:n.context,value:{err:n.value.err}}}}}finally{s=!0,c()}return d}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:t}){let r;const n=new Promise((t=>{let n=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":n=this._confirmTransactionInitialTimeout||3e4}r=setTimeout((()=>t({__type:IEe.TIMED_OUT,timeoutMs:n})),n)})),{abortConfirmation:i,confirmationPromise:o}=this.getTransactionConfirmationPromise({commitment:e,signature:t});let s;try{const e=await Promise.race([o,n]);if(e.__type!==IEe.PROCESSED)throw new dEe(t,e.timeoutMs/1e3);s=e.response}finally{clearTimeout(r),i()}return s}async getClusterNodes(){const e=vwe(await this._rpcRequest("getClusterNodes",[]),iSe(Swe(XSe)));if("error"in e)throw new KEe(e.error,"failed to get cluster nodes");return e.result}async getVoteAccounts(e){const t=this._buildArgs([],e),r=vwe(await this._rpcRequest("getVoteAccounts",t),eke);if("error"in r)throw new KEe(r.error,"failed to get vote accounts");return r.result}async getSlot(e){const{commitment:t,config:r}=tSe(e),n=this._buildArgs([],t,void 0,r),i=vwe(await this._rpcRequest("getSlot",n),iSe(Bwe()));if("error"in i)throw new KEe(i.error,"failed to get slot");return i.result}async getSlotLeader(e){const{commitment:t,config:r}=tSe(e),n=this._buildArgs([],t,void 0,r),i=vwe(await this._rpcRequest("getSlotLeader",n),iSe(Owe()));if("error"in i)throw new KEe(i.error,"failed to get slot leader");return i.result}async getSlotLeaders(e,t){const r=[e,t],n=vwe(await this._rpcRequest("getSlotLeaders",r),iSe(Swe(XEe)));if("error"in n)throw new KEe(n.error,"failed to get slot leaders");return n.result}async getSignatureStatus(e,t){const{context:r,value:n}=await this.getSignatureStatuses([e],t);return vEe(1===n.length),{context:r,value:n[0]}}async getSignatureStatuses(e,t){const r=[e];t&&r.push(t);const n=vwe(await this._rpcRequest("getSignatureStatuses",r),nke);if("error"in n)throw new KEe(n.error,"failed to get signature status");return n.result}async getTransactionCount(e){const{commitment:t,config:r}=tSe(e),n=this._buildArgs([],t,void 0,r),i=vwe(await this._rpcRequest("getTransactionCount",n),iSe(Bwe()));if("error"in i)throw new KEe(i.error,"failed to get transaction count");return i.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const t=this._buildArgs([],e),r=vwe(await this._rpcRequest("getInflationGovernor",t),_Se);if("error"in r)throw new KEe(r.error,"failed to get inflation");return r.result}async getInflationReward(e,t,r){const{commitment:n,config:i}=tSe(r),o=this._buildArgs([e.map((e=>e.toBase58()))],n,void 0,{...i,epoch:null!=t?t:null==i?void 0:i.epoch}),s=vwe(await this._rpcRequest("getInflationReward",o),uSe);if("error"in s)throw new KEe(s.error,"failed to get inflation reward");return s.result}async getInflationRate(){const e=vwe(await this._rpcRequest("getInflationRate",[]),ESe);if("error"in e)throw new KEe(e.error,"failed to get inflation rate");return e.result}async getEpochInfo(e){const{commitment:t,config:r}=tSe(e),n=this._buildArgs([],t,void 0,r),i=vwe(await this._rpcRequest("getEpochInfo",n),kSe);if("error"in i)throw new KEe(i.error,"failed to get epoch info");return i.result}async getEpochSchedule(){const e=vwe(await this._rpcRequest("getEpochSchedule",[]),ASe);if("error"in e)throw new KEe(e.error,"failed to get epoch schedule");const t=e.result;return new VEe(t.slotsPerEpoch,t.leaderScheduleSlotOffset,t.warmup,t.firstNormalEpoch,t.firstNormalSlot)}async getLeaderSchedule(){const e=vwe(await this._rpcRequest("getLeaderSchedule",[]),xSe);if("error"in e)throw new KEe(e.error,"failed to get leader schedule");return e.result}async getMinimumBalanceForRentExemption(e,t){const r=this._buildArgs([e],t),n=vwe(await this._rpcRequest("getMinimumBalanceForRentExemption",r),ike);return"error"in n?(console.warn("Unable to fetch minimum balance for rent exemption"),0):n.result}async getRecentBlockhashAndContext(e){const t=this._buildArgs([],e),r=vwe(await this._rpcRequest("getRecentBlockhash",t),Tke);if("error"in r)throw new KEe(r.error,"failed to get recent blockhash");return r.result}async getRecentPerformanceSamples(e){const t=vwe(await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),Rke);if("error"in t)throw new KEe(t.error,"failed to get recent performance samples");return t.result}async getFeeCalculatorForBlockhash(e,t){const r=this._buildArgs([e],t),n=vwe(await this._rpcRequest("getFeeCalculatorForBlockhash",r),Pke);if("error"in n)throw new KEe(n.error,"failed to get fee calculator");const{context:i,value:o}=n.result;return{context:i,value:null!==o?o.feeCalculator:null}}async getFeeForMessage(e,t){const r=rEe(e.serialize()).toString("base64"),n=this._buildArgs([r],t),i=vwe(await this._rpcRequest("getFeeForMessage",n),oSe(Iwe(Bwe())));if("error"in i)throw new KEe(i.error,"failed to get fee for message");if(null===i.result)throw new Error("invalid blockhash");return i.result}async getRecentPrioritizationFees(e){var t;const r=null==e||null===(t=e.lockedWritableAccounts)||void 0===t?void 0:t.map((e=>e.toBase58())),n=null!=r&&r.length?[r]:[],i=vwe(await this._rpcRequest("getRecentPrioritizationFees",n),SSe);if("error"in i)throw new KEe(i.error,"failed to get recent prioritization fees");return i.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(e){throw new Error("failed to get recent blockhash: "+e)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(e){throw new Error("failed to get recent blockhash: "+e)}}async getLatestBlockhashAndContext(e){const{commitment:t,config:r}=tSe(e),n=this._buildArgs([],t,void 0,r),i=vwe(await this._rpcRequest("getLatestBlockhash",n),Cke);if("error"in i)throw new KEe(i.error,"failed to get latest blockhash");return i.result}async isBlockhashValid(e,t){const{commitment:r,config:n}=tSe(t),i=this._buildArgs([e],r,void 0,n),o=vwe(await this._rpcRequest("isBlockhashValid",i),Oke);if("error"in o)throw new KEe(o.error,"failed to determine if the blockhash `"+e+"`is valid");return o.result}async getVersion(){const e=vwe(await this._rpcRequest("getVersion",[]),iSe(bSe));if("error"in e)throw new KEe(e.error,"failed to get version");return e.result}async getGenesisHash(){const e=vwe(await this._rpcRequest("getGenesisHash",[]),iSe(Owe()));if("error"in e)throw new KEe(e.error,"failed to get genesis hash");return e.result}async getBlock(e,t){const{commitment:r,config:n}=tSe(t),i=this._buildArgsAtLeastConfirmed([e],r,void 0,n),o=await this._rpcRequest("getBlock",i);try{switch(null==n?void 0:n.transactionDetails){case"accounts":{const e=vwe(o,_ke);if("error"in e)throw e.error;return e.result}case"none":{const e=vwe(o,wke);if("error"in e)throw e.error;return e.result}default:{const e=vwe(o,vke);if("error"in e)throw e.error;const{result:t}=e;return t?{...t,transactions:t.transactions.map((({transaction:e,meta:t,version:r})=>({meta:t,transaction:{...e,message:aSe(r,e.message)},version:r})))}:null}}}catch(e){throw new KEe(e,"failed to get confirmed block")}}async getParsedBlock(e,t){const{commitment:r,config:n}=tSe(t),i=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",n),o=await this._rpcRequest("getBlock",i);try{switch(null==n?void 0:n.transactionDetails){case"accounts":{const e=vwe(o,Ske);if("error"in e)throw e.error;return e.result}case"none":{const e=vwe(o,kke);if("error"in e)throw e.error;return e.result}default:{const e=vwe(o,Eke);if("error"in e)throw e.error;return e.result}}}catch(e){throw new KEe(e,"failed to get block")}}async getBlockProduction(e){let t,r;if("string"==typeof e)r=e;else if(e){const{commitment:n,...i}=e;r=n,t=i}const n=this._buildArgs([],r,"base64",t),i=vwe(await this._rpcRequest("getBlockProduction",n),wSe);if("error"in i)throw new KEe(i.error,"failed to get block production information");return i.result}async getTransaction(e,t){const{commitment:r,config:n}=tSe(t),i=this._buildArgsAtLeastConfirmed([e],r,void 0,n),o=vwe(await this._rpcRequest("getTransaction",i),Ike);if("error"in o)throw new KEe(o.error,"failed to get transaction");const s=o.result;return s?{...s,transaction:{...s.transaction,message:aSe(s.version,s.transaction.message)}}:s}async getParsedTransaction(e,t){const{commitment:r,config:n}=tSe(t),i=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",n),o=vwe(await this._rpcRequest("getTransaction",i),Bke);if("error"in o)throw new KEe(o.error,"failed to get transaction");return o.result}async getParsedTransactions(e,t){const{commitment:r,config:n}=tSe(t),i=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",n)})));return(await this._rpcBatchRequest(i)).map((e=>{const t=vwe(e,Bke);if("error"in t)throw new KEe(t.error,"failed to get transactions");return t.result}))}async getTransactions(e,t){const{commitment:r,config:n}=tSe(t),i=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],r,void 0,n)})));return(await this._rpcBatchRequest(i)).map((e=>{const t=vwe(e,Ike);if("error"in t)throw new KEe(t.error,"failed to get transactions");const r=t.result;return r?{...r,transaction:{...r.transaction,message:aSe(r.version,r.transaction.message)}}:r}))}async getConfirmedBlock(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),n=vwe(await this._rpcRequest("getConfirmedBlock",r),Ake);if("error"in n)throw new KEe(n.error,"failed to get confirmed block");const i=n.result;if(!i)throw new Error("Confirmed block "+e+" not found");const o={...i,transactions:i.transactions.map((({transaction:e,meta:t})=>{const r=new kEe(e.message);return{meta:t,transaction:{...e,message:r}}}))};return{...o,transactions:o.transactions.map((({transaction:e,meta:t})=>({meta:t,transaction:CEe.populate(e.message,e.signatures)})))}}async getBlocks(e,t,r){const n=this._buildArgsAtLeastConfirmed(void 0!==t?[e,t]:[e],r),i=vwe(await this._rpcRequest("getBlocks",n),iSe(Swe(Bwe())));if("error"in i)throw new KEe(i.error,"failed to get blocks");return i.result}async getBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),n=vwe(await this._rpcRequest("getBlock",r),xke);if("error"in n)throw new KEe(n.error,"failed to get block");const i=n.result;if(!i)throw new Error("Block "+e+" not found");return i}async getConfirmedBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),n=vwe(await this._rpcRequest("getConfirmedBlock",r),xke);if("error"in n)throw new KEe(n.error,"failed to get confirmed block");const i=n.result;if(!i)throw new Error("Confirmed block "+e+" not found");return i}async getConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),n=vwe(await this._rpcRequest("getConfirmedTransaction",r),Ike);if("error"in n)throw new KEe(n.error,"failed to get transaction");const i=n.result;if(!i)return i;const o=new kEe(i.transaction.message),s=i.transaction.signatures;return{...i,transaction:CEe.populate(o,s)}}async getParsedConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),n=vwe(await this._rpcRequest("getConfirmedTransaction",r),Bke);if("error"in n)throw new KEe(n.error,"failed to get confirmed transaction");return n.result}async getParsedConfirmedTransactions(e,t){const r=e.map((e=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([e],t,"jsonParsed")})));return(await this._rpcBatchRequest(r)).map((e=>{const t=vwe(e,Bke);if("error"in t)throw new KEe(t.error,"failed to get confirmed transactions");return t.result}))}async getConfirmedSignaturesForAddress(e,t,r){let n={},i=await this.getFirstAvailableBlock();for(;!("until"in n)&&!(--t<=0||t0&&(n.until=e.signatures[e.signatures.length-1].toString())}catch(e){if(e instanceof Error&&e.message.includes("skipped"))continue;throw e}let o=await this.getSlot("finalized");for(;!("before"in n||++r>o);)try{const e=await this.getConfirmedBlockSignatures(r);e.signatures.length>0&&(n.before=e.signatures[e.signatures.length-1].toString())}catch(e){if(e instanceof Error&&e.message.includes("skipped"))continue;throw e}return(await this.getConfirmedSignaturesForAddress2(e,n)).map((e=>e.signature))}async getConfirmedSignaturesForAddress2(e,t,r){const n=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),i=vwe(await this._rpcRequest("getConfirmedSignaturesForAddress2",n),FSe);if("error"in i)throw new KEe(i.error,"failed to get confirmed signatures for address");return i.result}async getSignaturesForAddress(e,t,r){const n=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),i=vwe(await this._rpcRequest("getSignaturesForAddress",n),qSe);if("error"in i)throw new KEe(i.error,"failed to get signatures for address");return i.result}async getAddressLookupTable(e,t){const{context:r,value:n}=await this.getAccountInfoAndContext(e,t);let i=null;return null!==n&&(i=new GEe({key:e,state:GEe.deserialize(n.data)})),{context:r,value:i}}async getNonceAndContext(e,t){const{context:r,value:n}=await this.getAccountInfoAndContext(e,t);let i=null;return null!==n&&(i=UEe.fromAccountData(n.data)),{context:r,value:i}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then((e=>e.value)).catch((t=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+t)}))}async requestAirdrop(e,t){const r=vwe(await this._rpcRequest("requestAirdrop",[e.toBase58(),t]),Mke);if("error"in r)throw new KEe(r.error,`airdrop to ${e.toBase58()} failed`);return r.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await REe(100);const e=Date.now()-this._blockhashInfo.lastFetch>=3e4;if(null!==this._blockhashInfo.latestBlockhash&&!e)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),t=this._blockhashInfo.latestBlockhash,r=t?t.blockhash:null;for(let e=0;e<50;e++){const e=await this.getLatestBlockhash("finalized");if(r!==e.blockhash)return this._blockhashInfo={latestBlockhash:e,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e;await REe(200)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:t,config:r}=tSe(e),n=this._buildArgs([],t,"base64",r),i=vwe(await this._rpcRequest("getStakeMinimumDelegation",n),oSe(Bwe()));if("error"in i)throw new KEe(i.error,"failed to get stake minimum delegation");return i.result}async simulateTransaction(e,t,r){if("message"in e){const n=e.serialize(),i=age.from(n).toString("base64");if(Array.isArray(t)||void 0!==r)throw new Error("Invalid arguments");const o=t||{};o.encoding="base64","commitment"in o||(o.commitment=this.commitment);const s=[i,o],a=vwe(await this._rpcRequest("simulateTransaction",s),vSe);if("error"in a)throw new Error("failed to simulate transaction: "+a.error.message);return a.result}let n;if(e instanceof CEe){let t=e;n=new CEe,n.feePayer=t.feePayer,n.instructions=e.instructions,n.nonceInfo=t.nonceInfo,n.signatures=t.signatures}else n=CEe.populate(e),n._message=n._json=void 0;if(void 0!==t&&!Array.isArray(t))throw new Error("Invalid arguments");const i=t;if(n.nonceInfo&&i)n.sign(...i);else{let e=this._disableBlockhashCaching;for(;;){const t=await this._blockhashWithExpiryBlockHeight(e);if(n.lastValidBlockHeight=t.lastValidBlockHeight,n.recentBlockhash=t.blockhash,!i)break;if(n.sign(...i),!n.signature)throw new Error("!signature");const r=n.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(r)&&!this._blockhashInfo.transactionSignatures.includes(r)){this._blockhashInfo.simulatedSignatures.push(r);break}e=!0}}const o=n._compile(),s=o.serialize(),a=n._serialize(s).toString("base64"),c={encoding:"base64",commitment:this.commitment};if(r){const e=(Array.isArray(r)?r:o.nonProgramIds()).map((e=>e.toBase58()));c.accounts={encoding:"base64",addresses:e}}i&&(c.sigVerify=!0);const u=[a,c],l=vwe(await this._rpcRequest("simulateTransaction",u),vSe);if("error"in l){let e;if("data"in l.error&&(e=l.error.data.logs,e&&Array.isArray(e))){const t="\n ",r=t+e.join(t);console.error(l.error.message,r)}throw new $Ee("failed to simulate transaction: "+l.error.message,e)}return l.result}async sendTransaction(e,t,r){if("version"in e){if(t&&Array.isArray(t))throw new Error("Invalid arguments");const r=e.serialize();return await this.sendRawTransaction(r,t)}if(void 0===t||!Array.isArray(t))throw new Error("Invalid arguments");const n=t;if(e.nonceInfo)e.sign(...n);else{let t=this._disableBlockhashCaching;for(;;){const r=await this._blockhashWithExpiryBlockHeight(t);if(e.lastValidBlockHeight=r.lastValidBlockHeight,e.recentBlockhash=r.blockhash,e.sign(...n),!e.signature)throw new Error("!signature");const i=e.signature.toString("base64");if(!this._blockhashInfo.transactionSignatures.includes(i)){this._blockhashInfo.transactionSignatures.push(i);break}t=!0}}const i=e.serialize();return await this.sendRawTransaction(i,r)}async sendRawTransaction(e,t){const r=rEe(e).toString("base64");return await this.sendEncodedTransaction(r,t)}async sendEncodedTransaction(e,t){const r={encoding:"base64"},n=t&&t.skipPreflight,i=!0===n?"processed":t&&t.preflightCommitment||this.commitment;t&&null!=t.maxRetries&&(r.maxRetries=t.maxRetries),t&&null!=t.minContextSlot&&(r.minContextSlot=t.minContextSlot),n&&(r.skipPreflight=n),i&&(r.preflightCommitment=i);const o=[e,r],s=vwe(await this._rpcRequest("sendTransaction",o),Uke);if("error"in s){let e;throw"data"in s.error&&(e=s.error.data.logs),new $Ee("failed to send transaction: "+s.error.message,e)}return s.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()}),5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((([e,t])=>{this._setSubscription(e,{...t,state:"pending"})}))):this._updateSubscriptions()}_setSubscription(e,t){var r;const n=null===(r=this._subscriptionsByHash[e])||void 0===r?void 0:r.state;if(this._subscriptionsByHash[e]=t,n!==t.state){const r=this._subscriptionStateChangeCallbacksByHash[e];r&&r.forEach((e=>{try{e(t.state)}catch{}}))}}_onSubscriptionStateChange(e,t){var r;const n=this._subscriptionHashByClientSubscriptionId[e];if(null==n)return()=>{};const i=(r=this._subscriptionStateChangeCallbacksByHash)[n]||(r[n]=new Set);return i.add(t),()=>{i.delete(t),0===i.size&&delete this._subscriptionStateChangeCallbacksByHash[n]}}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length)return void(this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log(`Error when closing socket connection: ${e.message}`)}}),500)));if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();const e=this._rpcWebSocketGeneration,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map((async e=>{const r=this._subscriptionsByHash[e];if(void 0!==r)switch(r.state){case"pending":case"unsubscribed":if(0===r.callbacks.size)return delete this._subscriptionsByHash[e],"unsubscribed"===r.state&&delete this._subscriptionCallbacksByServerSubscriptionId[r.serverSubscriptionId],void await this._updateSubscriptions();await(async()=>{const{args:n,method:i}=r;try{this._setSubscription(e,{...r,state:"subscribing"});const t=await this._rpcWebSocket.call(i,n);this._setSubscription(e,{...r,serverSubscriptionId:t,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[t]=r.callbacks,await this._updateSubscriptions()}catch(o){if(o instanceof Error&&console.error(`${i} error for argument`,n,o.message),!t())return;this._setSubscription(e,{...r,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":0===r.callbacks.size&&await(async()=>{const{serverSubscriptionId:n,unsubscribeMethod:i}=r;if(this._subscriptionsAutoDisposedByRpc.has(n))this._subscriptionsAutoDisposedByRpc.delete(n);else{this._setSubscription(e,{...r,state:"unsubscribing"}),this._setSubscription(e,{...r,state:"unsubscribing"});try{await this._rpcWebSocket.call(i,[n])}catch(n){if(n instanceof Error&&console.error(`${i} error:`,n.message),!t())return;return this._setSubscription(e,{...r,state:"subscribed"}),void await this._updateSubscriptions()}}this._setSubscription(e,{...r,state:"unsubscribed"}),await this._updateSubscriptions()})()}})))}_handleServerNotification(e,t){const r=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==r&&r.forEach((e=>{try{e(...t)}catch(e){console.error(e)}}))}_wsOnAccountNotification(e){const{result:t,subscription:r}=vwe(e,HSe);this._handleServerNotification(r,[t.value,t.context])}_makeSubscription(e,t){const r=this._nextClientSubscriptionId++,n=qEe([e.method,t]),i=this._subscriptionsByHash[n];return void 0===i?this._subscriptionsByHash[n]={...e,args:t,callbacks:new Set([e.callback]),state:"pending"}:i.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=n,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];const t=this._subscriptionsByHash[n];vEe(void 0!==t,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),t.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(e,t,r){const n=this._buildArgs([e.toBase58()],r||this._commitment||"finalized","base64");return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},n)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:t,subscription:r}=vwe(e,$Se);this._handleServerNotification(r,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,r,n){const i=this._buildArgs([e.toBase58()],r||this._commitment||"finalized","base64",n?{filters:n}:void 0);return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,t,r){const n=this._buildArgs(["object"==typeof e?{mentions:[e.toString()]}:e],r||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},n)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:t,subscription:r}=vwe(e,jke);this._handleServerNotification(r,[t.value,t.context])}_wsOnSlotNotification(e){const{result:t,subscription:r}=vwe(e,ZSe);this._handleServerNotification(r,[t])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:t,subscription:r}=vwe(e,GSe);this._handleServerNotification(r,[t])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,t){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${t}' events could not be found.`)}_buildArgs(e,t,r,n){const i=t||this._commitment;if(i||r||n){let t={};r&&(t.encoding=r),i&&(t.commitment=i),n&&(t=Object.assign(t,n)),e.push(t)}return e}_buildArgsAtLeastConfirmed(e,t,r,n){const i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,r,n)}_wsOnSignatureNotification(e){const{result:t,subscription:r}=vwe(e,YSe);"receivedSignature"!==t.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===t.value?[{type:"received"},t.context]:[{type:"status",result:t.value},t.context])}onSignature(e,t,r){const n=this._buildArgs([e],r||this._commitment||"finalized"),i=this._makeSubscription({callback:(e,r)=>{if("status"===e.type){t(e.result,r);try{this.removeSignatureListener(i)}catch(e){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},n);return i}onSignatureWithOptions(e,t,r){const{commitment:n,...i}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([e],n,void 0,i),s=this._makeSubscription({callback:(e,r)=>{t(e,r);try{this.removeSignatureListener(s)}catch(e){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return s}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:t,subscription:r}=vwe(e,JSe);this._handleServerNotification(r,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}var Dke;Object.freeze({CreateLookupTable:{index:0,layout:owe([rwe("instruction"),LEe("recentSlot"),ewe("bumpSeed")])},FreezeLookupTable:{index:1,layout:owe([rwe("instruction")])},ExtendLookupTable:{index:2,layout:owe([rwe("instruction"),LEe(),swe(pEe(),Qve(rwe(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:owe([rwe("instruction")])},CloseLookupTable:{index:4,layout:owe([rwe("instruction")])}}),new cEe("AddressLookupTab1e1111111111111111111111111"),Object.freeze({RequestUnits:{index:0,layout:owe([ewe("instruction"),rwe("units"),rwe("additionalFee")])},RequestHeapFrame:{index:1,layout:owe([ewe("instruction"),rwe("bytes")])},SetComputeUnitLimit:{index:2,layout:owe([ewe("instruction"),rwe("units")])},SetComputeUnitPrice:{index:3,layout:owe([ewe("instruction"),LEe("microLamports")])}}),new cEe("ComputeBudget111111111111111111111111111111"),owe([ewe("numSignatures"),ewe("padding"),twe("signatureOffset"),twe("signatureInstructionIndex"),twe("publicKeyOffset"),twe("publicKeyInstructionIndex"),twe("messageDataOffset"),twe("messageDataSize"),twe("messageInstructionIndex")]),new cEe("Ed25519SigVerify111111111111111111111111111"),X_e.utils.isValidPrivateKey,X_e.getPublicKey,owe([ewe("numSignatures"),twe("signatureOffset"),ewe("signatureInstructionIndex"),twe("ethAddressOffset"),ewe("ethAddressInstructionIndex"),twe("messageDataOffset"),twe("messageDataSize"),ewe("messageInstructionIndex"),awe(20,"ethAddress"),awe(64,"signature"),ewe("recoveryId")]),new cEe("KeccakSecp256k11111111111111111111111111111"),new cEe("StakeConfig11111111111111111111111111111111");class Fke{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}Dke=Fke,Fke.default=new Dke(0,0,cEe.default),Object.freeze({Initialize:{index:0,layout:owe([rwe("instruction"),((e="authorized")=>owe([pEe("staker"),pEe("withdrawer")],e))(),((e="lockup")=>owe([iwe("unixTimestamp"),iwe("epoch"),pEe("custodian")],e))()])},Authorize:{index:1,layout:owe([rwe("instruction"),pEe("newAuthorized"),rwe("stakeAuthorizationType")])},Delegate:{index:2,layout:owe([rwe("instruction")])},Split:{index:3,layout:owe([rwe("instruction"),iwe("lamports")])},Withdraw:{index:4,layout:owe([rwe("instruction"),iwe("lamports")])},Deactivate:{index:5,layout:owe([rwe("instruction")])},Merge:{index:7,layout:owe([rwe("instruction")])},AuthorizeWithSeed:{index:8,layout:owe([rwe("instruction"),pEe("newAuthorized"),rwe("stakeAuthorizationType"),yEe("authoritySeed"),pEe("authorityOwner")])}}),Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),new cEe("Stake11111111111111111111111111111111111111"),Object.freeze({InitializeAccount:{index:0,layout:owe([rwe("instruction"),((e="voteInit")=>owe([pEe("nodePubkey"),pEe("authorizedVoter"),pEe("authorizedWithdrawer"),ewe("commission")],e))()])},Authorize:{index:1,layout:owe([rwe("instruction"),pEe("newAuthorized"),rwe("voteAuthorizationType")])},Withdraw:{index:3,layout:owe([rwe("instruction"),iwe("lamports")])},UpdateValidatorIdentity:{index:4,layout:owe([rwe("instruction")])},AuthorizeWithSeed:{index:10,layout:owe([rwe("instruction"),((e="voteAuthorizeWithSeedArgs")=>owe([rwe("voteAuthorizationType"),pEe("currentAuthorityDerivedKeyOwnerPubkey"),yEe("currentAuthorityDerivedKeySeed"),pEe("newAuthorized")],e))()])}}),Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),new cEe("Vote111111111111111111111111111111111111111"),new cEe("Va1idator1nfo111111111111111111111111111111"),Pwe({name:Owe(),website:Twe(Owe()),details:Twe(Owe()),keybaseUsername:Twe(Owe())}),new cEe("Vote111111111111111111111111111111111111111"),owe([pEe("nodePubkey"),pEe("authorizedWithdrawer"),ewe("commission"),nwe(),swe(owe([nwe("slot"),rwe("confirmationCount")]),Qve(rwe(),-8),"votes"),ewe("rootSlotValid"),nwe("rootSlot"),nwe(),swe(owe([nwe("epoch"),pEe("authorizedVoter")]),Qve(rwe(),-8),"authorizedVoters"),owe([swe(owe([pEe("authorizedPubkey"),nwe("epochOfLastAuthorizedSwitch"),nwe("targetEpoch")]),32,"buf"),nwe("idx"),ewe("isEmpty")],"priorVoters"),nwe(),swe(owe([nwe("epoch"),nwe("credits"),nwe("prevCredits")]),Qve(rwe(),-8),"epochCredits"),owe([nwe("slot"),nwe("timestamp")],"lastTimestamp")]);const qke="solana:signAndSendTransaction",Hke="solana:signIn",Vke="solana:signMessage",$ke="solana:signTransaction",Kke="standard:connect",Zke="standard:disconnect",Wke="standard:events";var Gke={},Yke={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||e,s),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i++this.rpc_id),this.dataPack=c||new eAe.DefaultDataPack,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(e,t,r,n){return!n&&"object"==typeof r&&(n=r,r=null),new Promise(((i,o)=>{if(!this.ready)return o(new Error("socket not ready"));const s=this.generate_request_id(e,t),a={jsonrpc:"2.0",method:e,params:t||void 0,id:s};this.socket.send(this.dataPack.encode(a),n,(e=>{if(e)return o(e);this.queue[s]={promise:[i,o]},r&&(this.queue[s].timeout=setTimeout((()=>{delete this.queue[s],o(new Error("reply timeout"))}),r))}))}))}async login(e){const t=await this.call("rpc.login",e);if(!t)throw new Error("authentication failed");return t}async listMethods(){return await this.call("__listMethods")}notify(e,t){return new Promise(((r,n)=>{if(!this.ready)return n(new Error("socket not ready"));const i={jsonrpc:"2.0",method:e,params:t};this.socket.send(this.dataPack.encode(i),(e=>{if(e)return n(e);r()}))}))}async subscribe(e){"string"==typeof e&&(e=[e]);const t=await this.call("rpc.on",e);if("string"==typeof e&&"ok"!==t[e])throw new Error("Failed subscribing to an event '"+e+"' with: "+t[e]);return t}async unsubscribe(e){"string"==typeof e&&(e=[e]);const t=await this.call("rpc.off",e);if("string"==typeof e&&"ok"!==t[e])throw new Error("Failed unsubscribing from an event with: "+t);return t}close(e,t){this.socket.close(e||1e3,t)}setAutoReconnect(e){this.reconnect=e}setReconnectInterval(e){this.reconnect_interval=e}setMaxReconnects(e){this.max_reconnects=e}_connect(e,t){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",(()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0})),this.socket.addEventListener("message",(({data:e})=>{e instanceof ArrayBuffer&&(e=age.from(e).toString());try{e=this.dataPack.decode(e)}catch{return}if(e.notification&&this.listeners(e.notification).length){if(!Object.keys(e.params).length)return this.emit(e.notification);const t=[e.notification];if(e.params.constructor===Object)t.push(e.params);else for(let r=0;r{this.emit.apply(this,t)}))}if(!this.queue[e.id])return e.method?Promise.resolve().then((()=>{var t;this.emit(e.method,null===(t=e)||void 0===t?void 0:t.params)})):void 0;"error"in e=="result"in e&&this.queue[e.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[e.id].timeout&&clearTimeout(this.queue[e.id].timeout),e.error?this.queue[e.id].promise[1](e.error):this.queue[e.id].promise[0](e.result),delete this.queue[e.id]})),this.socket.addEventListener("error",(e=>this.emit("error",e))),this.socket.addEventListener("close",(({code:r,reason:n})=>{this.ready&&setTimeout((()=>this.emit("close",r,n)),0),this.ready=!1,this.socket=void 0,1e3!==r&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||0===this.max_reconnects)&&(this.reconnect_timer_id=setTimeout((()=>this._connect(e,t)),this.reconnect_interval)))}))}}Gke.default=tAe;var rAe,nAe=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};class iAe extends Event{constructor(e){super("wallet-standard:register-wallet",{bubbles:!1,cancelable:!1,composed:!1}),((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,rAe,void 0),((e,t,r,n)=>{nAe(e,t,"write to private field"),n?n.call(e,r):t.set(e,r)})(this,rAe,e)}get detail(){return((e,t,r)=>(nAe(e,t,"read from private field"),r?r.call(e):t.get(e)))(this,rAe)}get type(){return"wallet-standard:register-wallet"}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}function oAe(e){!function(e){const t=({register:t})=>t(e);try{window.dispatchEvent(new iAe(t))}catch(e){console.error("wallet-standard:register-wallet event could not be dispatched\n",e)}try{window.addEventListener("wallet-standard:app-ready",(({detail:e})=>t(e)))}catch(e){console.error("wallet-standard:app-ready event listener could not be added\n",e)}}(e.getInstanceWithAdapter())}rAe=new WeakMap;const sAe=["solana:mainnet"];function aAe(e){return sAe.includes(e)}function cAe(e){return"version"in e}var uAe,lAe,dAe,fAe,hAe,pAe,gAe=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},yAe=(e,t,r)=>(gAe(e,t,"read from private field"),r?r.call(e):t.get(e)),mAe=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},bAe=(e,t,r,n)=>(gAe(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);const vAe=sAe,wAe=[qke,$ke,Vke],_Ae=class{constructor({address:e,publicKey:t,label:r,icon:n}){mAe(this,uAe,void 0),mAe(this,lAe,void 0),mAe(this,dAe,void 0),mAe(this,fAe,void 0),mAe(this,hAe,void 0),mAe(this,pAe,void 0),new.target===_Ae&&Object.freeze(this),bAe(this,uAe,e),bAe(this,lAe,t),bAe(this,dAe,vAe),bAe(this,fAe,wAe),bAe(this,hAe,r),bAe(this,pAe,n)}get address(){return yAe(this,uAe)}get publicKey(){return yAe(this,lAe).slice()}get chains(){return yAe(this,dAe).slice()}get features(){return yAe(this,fAe).slice()}get label(){return yAe(this,hAe)}get icon(){return yAe(this,pAe)}};let EAe=_Ae;uAe=new WeakMap,lAe=new WeakMap,dAe=new WeakMap,fAe=new WeakMap,hAe=new WeakMap,pAe=new WeakMap;var SAe,kAe,AAe,xAe,IAe,BAe,TAe,CAe,OAe,RAe,PAe,MAe,UAe,LAe,jAe,NAe,zAe,DAe,FAe,qAe,HAe=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},VAe=(e,t,r)=>(HAe(e,t,"read from private field"),r?r.call(e):t.get(e)),$Ae=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},KAe=(e,t,r,n)=>(HAe(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ZAe=(e,t,r)=>(HAe(e,t,"access private method"),r);const WAe="trust:",GAe=class{constructor(e){$Ae(this,CAe),$Ae(this,RAe),$Ae(this,SAe,{}),$Ae(this,kAe,"1.0.0"),$Ae(this,AAe,"Trust"),$Ae(this,xAe,"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTgiIGhlaWdodD0iNjUiIHZpZXdCb3g9IjAgMCA1OCA2NSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgOS4zODk0OUwyOC44OTA3IDBWNjUuMDA0MkM4LjI1NDUgNTYuMzM2OSAwIDM5LjcyNDggMCAzMC4zMzUzVjkuMzg5NDlaIiBmaWxsPSIjMDUwMEZGIi8+CjxwYXRoIGQ9Ik01Ny43ODIyIDkuMzg5NDlMMjguODkxNSAwVjY1LjAwNDJDNDkuNTI3NyA1Ni4zMzY5IDU3Ljc4MjIgMzkuNzI0OCA1Ny43ODIyIDMwLjMzNTNWOS4zODk0OVoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8yMjAxXzY5NDIpIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMjIwMV82OTQyIiB4MT0iNTEuMzYxNSIgeTE9Ii00LjE1MjkzIiB4Mj0iMjkuNTM4NCIgeTI9IjY0LjUxNDciIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agb2Zmc2V0PSIwLjAyMTEyIiBzdG9wLWNvbG9yPSIjMDAwMEZGIi8+CjxzdG9wIG9mZnNldD0iMC4wNzYyNDIzIiBzdG9wLWNvbG9yPSIjMDA5NEZGIi8+CjxzdG9wIG9mZnNldD0iMC4xNjMwODkiIHN0b3AtY29sb3I9IiM0OEZGOTEiLz4KPHN0b3Agb2Zmc2V0PSIwLjQyMDA0OSIgc3RvcC1jb2xvcj0iIzAwOTRGRiIvPgo8c3RvcCBvZmZzZXQ9IjAuNjgyODg2IiBzdG9wLWNvbG9yPSIjMDAzOEZGIi8+CjxzdG9wIG9mZnNldD0iMC45MDI0NjUiIHN0b3AtY29sb3I9IiMwNTAwRkYiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K"),$Ae(this,IAe,null),$Ae(this,BAe,void 0),$Ae(this,TAe,((e,t)=>{var r;return null!=(r=VAe(this,SAe)[e])&&r.push(t)||(VAe(this,SAe)[e]=[t]),()=>ZAe(this,RAe,PAe).call(this,e,t)})),$Ae(this,MAe,(()=>{var e;const t=null==(e=VAe(this,BAe).publicKey)?void 0:e.toBase58();if(t){const e=VAe(this,BAe).publicKey.toBytes(),r=VAe(this,IAe);(!r||r.address!==t||!function(e,t){return function(e,t){if(e===t)return!0;const r=e.length;if(r!==t.length)return!1;for(let n=0;n{VAe(this,IAe)&&(KAe(this,IAe,null),ZAe(this,CAe,OAe).call(this,"change",{accounts:this.accounts}))})),$Ae(this,LAe,(()=>{VAe(this,BAe).publicKey?VAe(this,MAe).call(this):VAe(this,UAe).call(this)})),$Ae(this,jAe,(async({silent:e}={})=>(VAe(this,IAe)||await VAe(this,BAe).connect(e?{onlyIfTrusted:!0}:void 0),VAe(this,MAe).call(this),{accounts:this.accounts}))),$Ae(this,NAe,(async()=>{await VAe(this,BAe).disconnect()})),$Ae(this,zAe,(async(...e)=>{if(!VAe(this,IAe))throw new Error("not connected");const t=[];if(1===e.length){const{transaction:r,account:n,chain:i,options:o}=e[0],{minContextSlot:s,preflightCommitment:a,skipPreflight:c,maxRetries:u}=o||{};if(n!==VAe(this,IAe))throw new Error("invalid account");if(!aAe(i))throw new Error("invalid chain");const{signature:l}=await VAe(this,BAe).signAndSendTransaction(OEe.deserialize(r),{preflightCommitment:a,minContextSlot:s,maxRetries:u,skipPreflight:c});t.push({signature:new Uint8Array(vbe.decode(l))})}else if(e.length>1)for(const r of e)t.push(...await VAe(this,zAe).call(this,r));return t})),$Ae(this,DAe,(async(...e)=>{if(!VAe(this,IAe))throw new Error("not connected");const t=[];if(1===e.length){const{transaction:r,account:n,chain:i}=e[0];if(n!==VAe(this,IAe))throw new Error("invalid account");if(i&&!aAe(i))throw new Error("invalid chain");const o=await VAe(this,BAe).signTransaction(OEe.deserialize(r)),s=cAe(o)?o.serialize():new Uint8Array(o.serialize({requireAllSignatures:!1,verifySignatures:!1}));t.push({signedTransaction:s})}else if(e.length>1){let r;for(const t of e){if(t.account!==VAe(this,IAe))throw new Error("invalid account");if(t.chain){if(!aAe(t.chain))throw new Error("invalid chain");if(r){if(t.chain!==r)throw new Error("conflicting chain")}else r=t.chain}}const n=e.map((({transaction:e})=>OEe.deserialize(e))),i=await VAe(this,BAe).signAllTransactions(n);t.push(...i.map((e=>({signedTransaction:cAe(e)?e.serialize():new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))}))))}return t})),$Ae(this,FAe,(async(...e)=>{if(!VAe(this,IAe))throw new Error("not connected");const t=[];if(1===e.length){const{message:r,account:n}=e[0];if(n!==VAe(this,IAe))throw new Error("invalid account");const{signature:i}=await VAe(this,BAe).signMessage(r);t.push({signedMessage:r,signature:i})}else if(e.length>1)for(const r of e)t.push(...await VAe(this,FAe).call(this,r));return t})),$Ae(this,qAe,(async(...e)=>{const t=[];if(!(e.length>1))return[await VAe(this,BAe).signIn(e[0])];for(const r of e)t.push(await VAe(this,BAe).signIn(r));return t})),new.target===GAe&&Object.freeze(this),KAe(this,BAe,e),e.on("connect",VAe(this,MAe),this),e.on("disconnect",VAe(this,UAe),this),e.on("accountChanged",VAe(this,LAe),this),VAe(this,MAe).call(this)}get version(){return VAe(this,kAe)}get name(){return VAe(this,AAe)}get icon(){return VAe(this,xAe)}get chains(){return sAe.slice()}get features(){return{[Kke]:{version:"1.0.0",connect:VAe(this,jAe)},[Zke]:{version:"1.0.0",disconnect:VAe(this,NAe)},[Wke]:{version:"1.0.0",on:VAe(this,TAe)},[qke]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:VAe(this,zAe)},[$ke]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:VAe(this,DAe)},[Vke]:{version:"1.0.0",signMessage:VAe(this,FAe)},[Hke]:{version:"1.0.0",signIn:VAe(this,qAe)},[WAe]:{trust:VAe(this,BAe)}}}get accounts(){return VAe(this,IAe)?[VAe(this,IAe)]:[]}};let YAe=GAe;SAe=new WeakMap,kAe=new WeakMap,AAe=new WeakMap,xAe=new WeakMap,IAe=new WeakMap,BAe=new WeakMap,TAe=new WeakMap,CAe=new WeakSet,OAe=function(e,...t){var r;null==(r=VAe(this,SAe)[e])||r.forEach((e=>e.apply(null,t)))},RAe=new WeakSet,PAe=function(e,t){var r;VAe(this,SAe)[e]=null==(r=VAe(this,SAe)[e])?void 0:r.filter((e=>t!==e))},MAe=new WeakMap,UAe=new WeakMap,LAe=new WeakMap,jAe=new WeakMap,NAe=new WeakMap,zAe=new WeakMap,DAe=new WeakMap,FAe=new WeakMap,qAe=new WeakMap;class JAe{constructor(e,t=!1){this.useLegacySign=!1,this.provider=e,this.useLegacySign=t}async connect(e){const t=await this.provider.internalRequest({method:"requestAccounts",params:{options:e}});return this.provider.emit("connect"),{publicKey:new cEe(t[0])}}async signTransaction(e){if(this.useLegacySign)return await this.legacySign(e);const t=JSON.stringify(e);let r,n="legacy";cAe(e)?(n=e.version,r=age.from(e.message.serialize()).toString("base64")):r=age.from(e.serializeMessage()).toString("base64");const i=age.from(e.serialize({requireAllSignatures:!1,verifySignatures:!1})).toString("base64"),o=await this.provider.internalRequest({method:"signRawTransaction",params:{data:t,raw:i,rawMessage:r,version:n}});return this.provider.mapSignedTransaction(e,o)}async legacySign(e){const t=JSON.stringify(e),r="number"!=typeof e.version?"legacy":e.version,n=vbe.encode("legacy"===r?e.serializeMessage():0===r?e.message.serialize():e.serialize());try{const i=await this.provider.internalRequest({method:"signRawTransaction",params:{data:t,raw:n,version:r}});return this.provider.mapSignedTransaction(e,i)}catch(e){console.log(`<== Error: ${e}`)}}async request(e,t){var r;switch(e.method){case"signTransaction":return this.signTransaction(e.params);case"connect":return this.connect(null==(r=null==e?void 0:e.params)?void 0:r.options)}return t()}}var XAe,QAe,exe,txe,rxe,nxe=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ixe=(e,t,r)=>(nxe(e,t,"read from private field"),r?r.call(e):t.get(e)),oxe=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},sxe=(e,t,r,n)=>(nxe(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),axe=(e,t,r)=>(nxe(e,t,"access private method"),r);const cxe=class extends gye{constructor(e){super(),oxe(this,txe),oxe(this,XAe,!1),oxe(this,QAe,!0),this.isTrust=!0,this.isTrustWallet=!0,oxe(this,exe,!1),e&&(typeof e.enableAdapter<"u"&&sxe(this,QAe,e.enableAdapter),typeof e.cluster<"u"&&(this.connection=new zke(e.cluster,"confirmed")),typeof e.disableMobileAdapter<"u"&&sxe(this,XAe,e.disableMobileAdapter),typeof e.useLegacySign<"u"&&sxe(this,exe,e.useLegacySign),typeof e.isTrust<"u"&&(this.isTrust=e.isTrust,this.isTrustWallet=e.isTrust)),ixe(this,QAe)&&oAe(this),ixe(this,XAe)||(this.mobileAdapter=new JAe(this,ixe(this,exe)))}static bufferToHex(e){return"0x"+age.from(e).toString("hex")}static messageToBuffer(e){let t=age.from([]);try{t="string"==typeof e?age.from(e.replace("0x",""),"hex"):age.from(e)}catch(e){console.log(`messageToBuffer error: ${e}`)}return t}getInstanceWithAdapter(){return new YAe(this)}async connect(e){const t=await axe(this,txe,rxe).call(this,{method:"connect",params:{options:e}});return this.publicKey=t.publicKey,t}disconnect(){return new Promise((e=>{this.publicKey=null,this.emit("disconnect"),e()}))}async signAndSendTransaction(e,t){const r=await this.signTransaction(e);return{signature:await this.connection.sendRawTransaction(r.serialize(),t)}}signTransaction(e){return axe(this,txe,rxe).call(this,{method:"signTransaction",params:e})}signAllTransactions(e){return Promise.all(e.map((e=>this.signTransaction(e))))}async signRawTransactionMulti(e){return(await axe(this,txe,rxe).call(this,{method:"signRawTransactionMulti",params:{transactions:e.map((e=>{const t=JSON.stringify(e);let r,n="legacy";return cAe(e)?(n=e.version,r=age.from(e.message.serialize()).toString("base64")):r=age.from(e.serializeMessage()).toString("base64"),{data:t,raw:age.from(e.serialize({requireAllSignatures:!1,verifySignatures:!1})).toString("base64"),rawMessage:r,version:n}}))}})).map(((t,r)=>this.mapSignedTransaction(e[r],t)))}async signMessage(e){var t;const r=cxe.bufferToHex(e),n=await axe(this,txe,rxe).call(this,{method:"signMessage",params:{data:r}});return{signature:new Uint8Array(age.from(cxe.messageToBuffer(n).buffer)),publicKey:null==(t=this.publicKey)?void 0:t.toBase58()}}signIn(e){throw new Error("Method not implemented.")}getNetwork(){return cxe.NETWORK}mapSignedTransaction(e,t){return e.addSignature(this.publicKey,vbe.decode(t)),e}request(e){throw new Error("Not implemented")}internalRequest(e){return super.request(e)}};let uxe=cxe;XAe=new WeakMap,QAe=new WeakMap,exe=new WeakMap,txe=new WeakSet,rxe=function(e){const t=()=>this.internalRequest(e);return this.mobileAdapter?this.mobileAdapter.request(e,t):t()},uxe.NETWORK="solana";var lxe={},dxe={},fxe={},hxe={},pxe={},gxe={},yxe={},mxe={},bxe={};function vxe(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function wxe(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function _xe(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function Exe(e,...t){if(!_xe(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Sxe(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");vxe(e.outputLen),vxe(e.blockLen)}function kxe(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 Axe(e,t){Exe(e);const r=t.outputLen;if(e.lengthnew Uint8Array(e.buffer,e.byteOffset,e.byteLength),e.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),e.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),e.rotr=(e,t)=>e<<32-t|e>>>t,e.rotl=(e,t)=>e<>>32-t>>>0,e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,e.byteSwapIfBE=e.isLE?e=>e:t=>(0,e.byteSwap)(t),e.byteSwap32=function(t){for(let r=0;rt.toString(16).padStart(2,"0")));e.bytesToHex=function(e){(0,r.bytes)(e);let t="";for(let r=0;r=i&&e<=o?e-i:e>=s&&e<=a?e-(s-10):e>=c&&e<=u?e-(c-10):void 0}function d(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function f(e){return"string"==typeof e&&(e=d(e)),(0,r.bytes)(e),e}e.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t{},e.asyncLoop=async function(t,r,n){let i=Date.now();for(let o=0;o=0&&te().update(f(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},e.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(f(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(f(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.randomBytes=function(e=32){if(t.crypto&&"function"==typeof t.crypto.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}}(Ixe),Object.defineProperty(mxe,"__esModule",{value:!0}),mxe.HashMD=mxe.Maj=mxe.Chi=void 0;const Txe=bxe,Cxe=Ixe;mxe.Chi=(e,t,r)=>e&t^~e&r,mxe.Maj=(e,t,r)=>e&t^e&r^t&r,mxe.HashMD=class extends Cxe.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,Cxe.createView)(this.buffer)}update(e){(0,Txe.exists)(this);const{view:t,buffer:r,blockLen:n}=this,i=(e=(0,Cxe.toBytes)(e)).length;for(let o=0;on-o&&(this.process(r,0),o=0);for(let e=o;e>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=(0,Cxe.createView)(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e>>3,i=(0,Rxe.rotr)(r,17)^(0,Rxe.rotr)(r,19)^r>>>10;Uxe[e]=i+Uxe[e-7]+n+Uxe[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+((0,Rxe.rotr)(s,6)^(0,Rxe.rotr)(s,11)^(0,Rxe.rotr)(s,25))+(0,Oxe.Chi)(s,a,c)+Pxe[e]+Uxe[e]|0,l=((0,Rxe.rotr)(r,2)^(0,Rxe.rotr)(r,13)^(0,Rxe.rotr)(r,22))+(0,Oxe.Maj)(r,n,i)|0;u=c,c=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){Uxe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class jxe extends Lxe{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}}yxe.sha256=(0,Rxe.wrapConstructor)((()=>new Lxe)),yxe.sha224=(0,Rxe.wrapConstructor)((()=>new jxe));var Nxe={},zxe={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=bxe,r=Ixe;class n extends r.Hash{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(e);const i=(0,r.toBytes)(n);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)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,s=new Uint8Array(o);s.set(i.length>o?e.create().update(i).digest():i);for(let e=0;enew n(e,t).update(r).digest(),e.hmac.create=(e,t)=>new n(e,t)}(zxe);var Dxe={},Fxe={},qxe={},Hxe={};Object.defineProperty(Hxe,"__esModule",{value:!0}),Hxe.bitMask=void 0,Hxe.isBytes=Zxe,Hxe.abytes=Wxe,Hxe.bytesToHex=Yxe,Hxe.numberToHexUnpadded=Jxe,Hxe.hexToNumber=Xxe,Hxe.hexToBytes=tIe,Hxe.bytesToNumberBE=function(e){return Xxe(Yxe(e))},Hxe.bytesToNumberLE=function(e){return Wxe(e),Xxe(Yxe(Uint8Array.from(e).reverse()))},Hxe.numberToBytesBE=rIe,Hxe.numberToBytesLE=function(e,t){return rIe(e,t).reverse()},Hxe.numberToVarBytesBE=function(e){return tIe(Jxe(e))},Hxe.ensureBytes=function(e,t,r){let n;if("string"==typeof t)try{n=tIe(t)}catch(r){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else{if(!Zxe(t))throw new Error(`${e} must be hex string or Uint8Array`);n=Uint8Array.from(t)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(`${e} expected ${r} bytes, got ${i}`);return n},Hxe.concatBytes=nIe,Hxe.equalBytes=function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;nVxe;e>>=$xe,t+=1);return t},Hxe.bitGet=function(e,t){return e>>BigInt(t)&$xe},Hxe.bitSet=function(e,t,r){return e|(r?$xe:Vxe)<{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),c=(e=iIe())=>{i=a(oIe([0]),e),n=a(),0!==e.length&&(i=a(oIe([1]),e),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e{let r;for(s(),c(e);!(r=t(u()));)c();return s(),r}},Hxe.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const i=sIe[r];if("function"!=typeof i)throw new Error(`Invalid validator "${r}", expected function`);const o=e[t];if(!(n&&void 0===o||i(o,e)))throw new Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${r}`)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const Vxe=BigInt(0),$xe=BigInt(1),Kxe=BigInt(2);function Zxe(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function Wxe(e){if(!Zxe(e))throw new Error("Uint8Array expected")}const Gxe=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Yxe(e){Wxe(e);let t="";for(let r=0;r=Qxe._0&&e<=Qxe._9?e-Qxe._0:e>=Qxe._A&&e<=Qxe._F?e-(Qxe._A-10):e>=Qxe._a&&e<=Qxe._f?e-(Qxe._a-10):void 0}function tIe(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t(Kxe<new Uint8Array(e),oIe=e=>Uint8Array.from(e),sIe={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||Zxe(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};Object.defineProperty(qxe,"__esModule",{value:!0}),qxe.isNegativeLE=void 0,qxe.mod=gIe,qxe.pow=yIe,qxe.pow2=function(e,t,r){let n=e;for(;t-- >cIe;)n*=n,n%=r;return n},qxe.invert=mIe,qxe.tonelliShanks=bIe,qxe.FpSqrt=vIe,qxe.validateField=function(e){const t=wIe.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,aIe.validateObject)(e,t)},qxe.FpPow=_Ie,qxe.FpInvertBatch=EIe,qxe.FpDiv=function(e,t,r){return e.mul(t,"bigint"==typeof r?mIe(r,e.ORDER):e.inv(r))},qxe.FpIsSquare=function(e){const t=(e.ORDER-uIe)/lIe;return r=>{const n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}},qxe.nLength=SIe,qxe.Field=function(e,t,r=!1,n={}){if(e<=cIe)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:o}=SIe(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=vIe(e),a=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:(0,aIe.bitMask)(i),ZERO:cIe,ONE:uIe,create:t=>gIe(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return cIe<=t&&te===cIe,isOdd:e=>(e&uIe)===uIe,neg:t=>gIe(-t,e),eql:(e,t)=>e===t,sqr:t=>gIe(t*t,e),add:(t,r)=>gIe(t+r,e),sub:(t,r)=>gIe(t-r,e),mul:(t,r)=>gIe(t*r,e),pow:(e,t)=>_Ie(a,e,t),div:(t,r)=>gIe(t*mIe(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>mIe(t,e),sqrt:n.sqrt||(e=>s(a,e)),invertBatch:e=>EIe(a,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,aIe.numberToBytesLE)(e,o):(0,aIe.numberToBytesBE)(e,o),fromBytes:e=>{if(e.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${e.length}`);return r?(0,aIe.bytesToNumberLE)(e):(0,aIe.bytesToNumberBE)(e)}});return Object.freeze(a)},qxe.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)},qxe.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r},qxe.hashToPrivateScalar=function(e,t,r=!1){const n=(e=(0,aIe.ensureBytes)("privateHash",e)).length,i=SIe(t).nByteLength+8;if(i<24||n1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);const o=r?(0,aIe.bytesToNumberLE)(e):(0,aIe.bytesToNumberBE)(e);return gIe(o,t-uIe)+uIe},qxe.getFieldBytesLength=kIe,qxe.getMinHashLength=AIe,qxe.mapHashToField=function(e,t,r=!1){const n=e.length,i=kIe(t),o=AIe(t);if(n<16||n1024)throw new Error(`expected ${o}-1024 bytes of input, got ${n}`);const s=r?(0,aIe.bytesToNumberBE)(e):(0,aIe.bytesToNumberLE)(e),a=gIe(s,t-uIe)+uIe;return r?(0,aIe.numberToBytesLE)(a,i):(0,aIe.numberToBytesBE)(a,i)};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const aIe=Hxe,cIe=BigInt(0),uIe=BigInt(1),lIe=BigInt(2),dIe=BigInt(3),fIe=BigInt(4),hIe=BigInt(5),pIe=BigInt(8);function gIe(e,t){const r=e%t;return r>=cIe?r:t+r}function yIe(e,t,r){if(r<=cIe||t 0");if(r===uIe)return cIe;let n=uIe;for(;t>cIe;)t&uIe&&(n=n*e%r),e=e*e%r,t>>=uIe;return n}function mIe(e,t){if(e===cIe||t<=cIe)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=gIe(e,t),n=t,i=cIe,o=uIe;for(;r!==cIe;){const e=n%r,t=i-o*(n/r);n=r,r=e,i=o,o=t}if(n!==uIe)throw new Error("invert: does not exist");return gIe(i,t)}function bIe(e){const t=(e-uIe)/lIe;let r,n,i;for(r=e-uIe,n=0;r%lIe===cIe;r/=lIe,n++);for(i=lIe;i(gIe(e,t)&uIe)===uIe;const wIe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function _Ie(e,t,r){if(r 0");if(r===cIe)return e.ONE;if(r===uIe)return t;let n=e.ONE,i=t;for(;r>cIe;)r&uIe&&(n=e.mul(n,i)),i=e.sqr(i),r>>=uIe;return n}function EIe(e,t){const r=new Array(t.length),n=t.reduce(((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n))),e.ONE),i=e.inv(n);return t.reduceRight(((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n))),i),r}function SIe(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function kIe(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function AIe(e){const t=kIe(e);return t+Math.ceil(t/2)}Object.defineProperty(Fxe,"__esModule",{value:!0}),Fxe.wNAF=function(e,t){const r=(e,t)=>{const r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>BIe;)r&TIe&&(n=n.add(i)),i=i.double(),r>>=TIe;return n},precomputeWindow(e,t){const{windows:r,windowSize:i}=n(t),o=[];let s=e,a=s;for(let e=0;e>=f,n>a&&(n-=d,o+=TIe);const s=t,h=t+Math.abs(n)-1,p=e%2!=0,g=n<0;0===n?u=u.add(r(p,i[s])):c=c.add(r(g,i[h]))}return{p:c,f:u}},wNAFCached(e,t,r,n){const i=e._WINDOW_SIZE||1;let o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,n(o))),this.wNAF(i,o,r)}}},Fxe.validateBasic=function(e){return(0,xIe.validateField)(e.Fp),(0,IIe.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,xIe.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const xIe=qxe,IIe=Hxe,BIe=BigInt(0),TIe=BigInt(1);!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=void 0,e.weierstrassPoints=f,e.weierstrass=function(o){const s=function(e){const r=(0,t.validateBasic)(e);return n.validateObject(r,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...r})}(o),{Fp:u,n:l}=s,d=u.BYTES+1,h=2*u.BYTES+1;function p(e){return r.mod(e,l)}function g(e){return r.invert(e,l)}const{ProjectivePoint:y,normPrivateKeyToScalar:m,weierstrassEquation:b,isWithinCurveOrder:v}=f({...s,toBytes(e,t,r){const i=t.toAffine(),o=u.toBytes(i.x),s=n.concatBytes;return r?s(Uint8Array.from([t.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,u.toBytes(i.y))},fromBytes(e){const t=e.length,r=e[0],i=e.subarray(1);if(t!==d||2!==r&&3!==r){if(t===h&&4===r)return{x:u.fromBytes(i.subarray(0,u.BYTES)),y:u.fromBytes(i.subarray(u.BYTES,2*u.BYTES))};throw new Error(`Point of length ${t} was invalid. Expected ${d} compressed bytes or ${h} uncompressed bytes`)}{const e=n.bytesToNumberBE(i);if(!(a<(o=e)&&on.bytesToHex(n.numberToBytesBE(e,s.nByteLength));function _(e){return e>l>>c}const E=(e,t,r)=>n.bytesToNumberBE(e.slice(t,r));class S{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const t=s.nByteLength;return e=(0,i.ensureBytes)("compactSignature",e,2*t),new S(E(e,0,t),E(e,t,2*t))}static fromDER(t){const{r:r,s:n}=e.DER.toSig((0,i.ensureBytes)("DER",t));return new S(r,n)}assertValidity(){if(!v(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!v(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new S(this.r,this.s,e)}recoverPublicKey(e){const{r:t,s:r,recovery:n}=this,o=I((0,i.ensureBytes)("msgHash",e));if(null==n||![0,1,2,3].includes(n))throw new Error("recovery id invalid");const a=2===n||3===n?t+s.n:t;if(a>=u.ORDER)throw new Error("recovery id 2 or 3 invalid");const c=1&n?"03":"02",l=y.fromHex(c+w(a)),d=g(a),f=p(-o*d),h=p(r*d),m=y.BASE.multiplyAndAddUnsafe(l,f,h);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return _(this.s)}normalizeS(){return this.hasHighS()?new S(this.r,p(-this.s),this.recovery):this}toDERRawBytes(){return n.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return n.hexToBytes(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}const k={isValidPrivateKey(e){try{return m(e),!0}catch(e){return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const e=r.getMinHashLength(s.n);return r.mapHashToField(s.randomBytes(e),s.n)},precompute:(e=8,t=y.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function A(e){const t=n.isBytes(e),r="string"==typeof e,i=(t||r)&&e.length;return t?i===d||i===h:r?i===2*d||i===2*h:e instanceof y}const x=s.bits2int||function(e){const t=n.bytesToNumberBE(e),r=8*e.length-s.nBitLength;return r>0?t>>BigInt(r):t},I=s.bits2int_modN||function(e){return p(x(e))},B=n.bitMask(s.nBitLength);function T(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(a<=e&&ee in r)))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:l}=s;let{lowS:d,prehash:f,extraEntropy:h}=r;null==d&&(d=!0),e=(0,i.ensureBytes)("msgHash",e),f&&(e=(0,i.ensureBytes)("prehashed msgHash",o(e)));const b=I(e),w=m(t),E=[T(w),T(b)];if(null!=h&&!1!==h){const e=!0===h?l(u.BYTES):h;E.push((0,i.ensureBytes)("extraEntropy",e))}const k=n.concatBytes(...E),A=b;return{seed:k,k2sig:function(e){const t=x(e);if(!v(t))return;const r=g(t),n=y.BASE.multiply(t).toAffine(),i=p(n.x);if(i===a)return;const o=p(r*p(A+i*w));if(o===a)return;let s=(n.x===i?0:2)|Number(n.y&c),u=o;return d&&_(o)&&(u=function(e){return _(e)?p(-e):e}(o),s^=1),new S(i,u,s)}}}const O={lowS:s.lowS,prehash:!1},R={lowS:s.lowS,prehash:!1};return y.BASE._setWindowSize(8),{CURVE:s,getPublicKey:function(e,t=!0){return y.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(A(e))throw new Error("first arg must be private key");if(!A(t))throw new Error("second arg must be public key");const n=y.fromHex(t);return n.multiply(m(e)).toRawBytes(r)},sign:function(e,t,r=O){const{seed:i,k2sig:o}=C(e,t,r),a=s,c=n.createHmacDrbg(a.hash.outputLen,a.nByteLength,a.hmac);return c(i,o)},verify:function(t,r,o,a=R){var c;const u=t;if(r=(0,i.ensureBytes)("msgHash",r),o=(0,i.ensureBytes)("publicKey",o),"strict"in a)throw new Error("options.strict was renamed to lowS");const{lowS:l,prehash:d}=a;let f,h;try{if("string"==typeof u||n.isBytes(u))try{f=S.fromDER(u)}catch(t){if(!(t instanceof e.DER.Err))throw t;f=S.fromCompact(u)}else{if("object"!=typeof u||"bigint"!=typeof u.r||"bigint"!=typeof u.s)throw new Error("PARSE");{const{r:e,s:t}=u;f=new S(e,t)}}h=y.fromHex(o)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(l&&f.hasHighS())return!1;d&&(r=s.hash(r));const{r:m,s:b}=f,v=I(r),w=g(b),_=p(v*w),E=p(m*w),k=null===(c=y.BASE.multiplyAndAddUnsafe(h,_,E))||void 0===c?void 0:c.toAffine();if(!k)return!1;const A=p(k.x);return A===m},ProjectivePoint:y,Signature:S,utils:k}},e.SWUFpSqrtRatio=h,e.mapToCurveSimpleSWU=function(e,t){if(r.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const n=h(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return r=>{let i,o,s,a,c,u,l,d;i=e.sqr(r),i=e.mul(i,t.Z),o=e.sqr(i),o=e.add(o,i),s=e.add(o,e.ONE),s=e.mul(s,t.B),a=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),a=e.mul(a,t.A),o=e.sqr(s),u=e.sqr(a),c=e.mul(u,t.A),o=e.add(o,c),o=e.mul(o,s),u=e.mul(u,a),c=e.mul(u,t.B),o=e.add(o,c),l=e.mul(i,s);const{isValid:f,value:h}=n(o,u);d=e.mul(i,r),d=e.mul(d,h),l=e.cmov(l,s,f),d=e.cmov(d,h,f);const p=e.isOdd(r)===e.isOdd(d);return d=e.cmov(e.neg(d),d,p),l=e.div(l,a),{x:l,y:d}}};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +const t=Fxe,r=qxe,n=Hxe,i=Hxe,{bytesToNumberBE:o,hexToBytes:s}=n;e.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:r}=e.DER;if(t.length<2||2!==t[0])throw new r("Invalid signature integer tag");const n=t[1],i=t.subarray(2,n+2);if(!n||i.length!==n)throw new r("Invalid signature integer: wrong length");if(128&i[0])throw new r("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new r("Invalid signature integer: unnecessary leading zero");return{d:o(i),l:t.subarray(n+2)}},toSig(t){const{Err:r}=e.DER,i="string"==typeof t?s(t):t;n.abytes(i);let o=i.length;if(o<2||48!=i[0])throw new r("Invalid signature tag");if(i[1]!==o-2)throw new r("Invalid signature: incorrect length");const{d:a,l:c}=e.DER._parseInt(i.subarray(2)),{d:u,l:l}=e.DER._parseInt(c);if(l.length)throw new r("Invalid signature: left bytes after parsing");return{r:a,s:u}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),o=n.length/2,s=i.length/2,a=r(o),c=r(s);return`30${r(s+o+4)}02${c}${i}02${a}${n}`}};const a=BigInt(0),c=BigInt(1),u=BigInt(2),l=BigInt(3),d=BigInt(4);function f(e){const o=function(e){const r=(0,t.validateBasic)(e);n.validateObject(r,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:i,Fp:o,a:s}=r;if(i){if(!o.eql(s,o.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof i||"bigint"!=typeof i.beta||"function"!=typeof i.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...r})}(e),{Fp:s}=o,u=o.toBytes||((e,t,r)=>{const i=t.toAffine();return n.concatBytes(Uint8Array.from([4]),s.toBytes(i.x),s.toBytes(i.y))}),d=o.fromBytes||(e=>{const t=e.subarray(1);return{x:s.fromBytes(t.subarray(0,s.BYTES)),y:s.fromBytes(t.subarray(s.BYTES,2*s.BYTES))}});function f(e){const{a:t,b:r}=o,n=s.sqr(e),i=s.mul(n,e);return s.add(s.add(i,s.mul(e,t)),r)}if(!s.eql(s.sqr(o.Gy),f(o.Gx)))throw new Error("bad generator point: equation left != right");function h(e){return"bigint"==typeof e&&as.eql(e,s.ZERO);return n(t)&&n(r)?b.ZERO:new b(t,r,s.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=s.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(b.fromAffine)}static fromHex(e){const t=b.fromAffine(d((0,i.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return b.BASE.multiply(g(e))}_setWindowSize(e){this._WINDOW_SIZE=e,y.delete(this)}assertValidity(){if(this.is0()){if(o.allowInfinityPoint&&!s.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:t}=this.toAffine();if(!s.isValid(e)||!s.isValid(t))throw new Error("bad point: x or y not FE");const r=s.sqr(t),n=f(e);if(!s.eql(r,n))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(s.isOdd)return!s.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){m(e);const{px:t,py:r,pz:n}=this,{px:i,py:o,pz:a}=e,c=s.eql(s.mul(t,a),s.mul(i,n)),u=s.eql(s.mul(r,a),s.mul(o,n));return c&&u}negate(){return new b(this.px,s.neg(this.py),this.pz)}double(){const{a:e,b:t}=o,r=s.mul(t,l),{px:n,py:i,pz:a}=this;let c=s.ZERO,u=s.ZERO,d=s.ZERO,f=s.mul(n,n),h=s.mul(i,i),p=s.mul(a,a),g=s.mul(n,i);return g=s.add(g,g),d=s.mul(n,a),d=s.add(d,d),c=s.mul(e,d),u=s.mul(r,p),u=s.add(c,u),c=s.sub(h,u),u=s.add(h,u),u=s.mul(c,u),c=s.mul(g,c),d=s.mul(r,d),p=s.mul(e,p),g=s.sub(f,p),g=s.mul(e,g),g=s.add(g,d),d=s.add(f,f),f=s.add(d,f),f=s.add(f,p),f=s.mul(f,g),u=s.add(u,f),p=s.mul(i,a),p=s.add(p,p),f=s.mul(p,g),c=s.sub(c,f),d=s.mul(p,h),d=s.add(d,d),d=s.add(d,d),new b(c,u,d)}add(e){m(e);const{px:t,py:r,pz:n}=this,{px:i,py:a,pz:c}=e;let u=s.ZERO,d=s.ZERO,f=s.ZERO;const h=o.a,p=s.mul(o.b,l);let g=s.mul(t,i),y=s.mul(r,a),v=s.mul(n,c),w=s.add(t,r),_=s.add(i,a);w=s.mul(w,_),_=s.add(g,y),w=s.sub(w,_),_=s.add(t,n);let E=s.add(i,c);return _=s.mul(_,E),E=s.add(g,v),_=s.sub(_,E),E=s.add(r,n),u=s.add(a,c),E=s.mul(E,u),u=s.add(y,v),E=s.sub(E,u),f=s.mul(h,_),u=s.mul(p,v),f=s.add(u,f),u=s.sub(y,f),f=s.add(y,f),d=s.mul(u,f),y=s.add(g,g),y=s.add(y,g),v=s.mul(h,v),_=s.mul(p,_),y=s.add(y,v),v=s.sub(g,v),v=s.mul(h,v),_=s.add(_,v),g=s.mul(y,_),d=s.add(d,g),g=s.mul(E,_),u=s.mul(w,u),u=s.sub(u,g),g=s.mul(w,y),f=s.mul(E,f),f=s.add(f,g),new b(u,d,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(b.ZERO)}wNAF(e){return w.wNAFCached(this,y,e,(e=>{const t=s.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(b.fromAffine)}))}multiplyUnsafe(e){const t=b.ZERO;if(e===a)return t;if(p(e),e===c)return this;const{endo:r}=o;if(!r)return w.unsafeLadder(this,e);let{k1neg:n,k1:i,k2neg:u,k2:l}=r.splitScalar(e),d=t,f=t,h=this;for(;i>a||l>a;)i&c&&(d=d.add(h)),l&c&&(f=f.add(h)),h=h.double(),i>>=c,l>>=c;return n&&(d=d.negate()),u&&(f=f.negate()),f=new b(s.mul(f.px,r.beta),f.py,f.pz),d.add(f)}multiply(e){p(e);let t,r,n=e;const{endo:i}=o;if(i){const{k1neg:e,k1:o,k2neg:a,k2:c}=i.splitScalar(n);let{p:u,f:l}=this.wNAF(o),{p:d,f:f}=this.wNAF(c);u=w.constTimeNegate(e,u),d=w.constTimeNegate(a,d),d=new b(s.mul(d.px,i.beta),d.py,d.pz),t=u.add(d),r=l.add(f)}else{const{p:e,f:i}=this.wNAF(n);t=e,r=i}return b.normalizeZ([t,r])[0]}multiplyAndAddUnsafe(e,t,r){const n=b.BASE,i=(e,t)=>t!==a&&t!==c&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,r));return o.is0()?void 0:o}toAffine(e){const{px:t,py:r,pz:n}=this,i=this.is0();null==e&&(e=i?s.ONE:s.inv(n));const o=s.mul(t,e),a=s.mul(r,e),c=s.mul(n,e);if(i)return{x:s.ZERO,y:s.ZERO};if(!s.eql(c,s.ONE))throw new Error("invZ was invalid");return{x:o,y:a}}isTorsionFree(){const{h:e,isTorsionFree:t}=o;if(e===c)return!0;if(t)return t(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:t}=o;return e===c?this:t?t(b,this):this.multiplyUnsafe(o.h)}toRawBytes(e=!0){return this.assertValidity(),u(b,this,e)}toHex(e=!0){return n.bytesToHex(this.toRawBytes(e))}}b.BASE=new b(o.Gx,o.Gy,s.ONE),b.ZERO=new b(s.ZERO,s.ONE,s.ZERO);const v=o.nBitLength,w=(0,t.wNAF)(b,o.endo?Math.ceil(v/2):v);return{CURVE:o,ProjectivePoint:b,normPrivateKeyToScalar:g,weierstrassEquation:f,isWithinCurveOrder:h}}function h(e,t){const r=e.ORDER;let n=a;for(let e=r-c;e%u===a;e/=u)n+=c;const i=n,o=u<{let n=y,o=e.pow(r,p),s=e.sqr(o);s=e.mul(s,r);let a=e.mul(t,s);a=e.pow(a,h),a=e.mul(a,o),o=e.mul(a,r),s=e.mul(a,t);let l=e.mul(s,o);a=e.pow(l,g);let d=e.eql(a,e.ONE);o=e.mul(s,m),a=e.mul(l,n),s=e.cmov(o,s,d),l=e.cmov(a,l,d);for(let t=i;t>c;t--){let r=t-u;r=u<{let o=e.sqr(i);const s=e.mul(t,i);o=e.mul(o,s);let a=e.pow(o,r);a=e.mul(a,s);const c=e.mul(a,n),u=e.mul(e.sqr(a),i),l=e.eql(u,t);return{isValid:l,value:e.cmov(c,a,l)}}}return b}}(Dxe),Object.defineProperty(Nxe,"__esModule",{value:!0}),Nxe.getHash=PIe,Nxe.createCurve=function(e,t){const r=t=>(0,RIe.weierstrass)({...e,...PIe(t)});return Object.freeze({...r(t),create:r})};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const CIe=zxe,OIe=Ixe,RIe=Dxe;function PIe(e){return{hash:e,hmac:(t,...r)=>(0,CIe.hmac)(e,t,(0,OIe.concatBytes)(...r)),randomBytes:OIe.randomBytes}}var MIe={};Object.defineProperty(MIe,"__esModule",{value:!0}),MIe.expand_message_xmd=FIe,MIe.expand_message_xof=qIe,MIe.hash_to_field=HIe,MIe.isogenyMap=function(e,t){const r=t.map((e=>Array.from(e).reverse()));return(t,n)=>{const[i,o,s,a]=r.map((r=>r.reduce(((r,n)=>e.add(e.mul(r,t),n)))));return t=e.div(i,o),n=e.mul(n,e.div(s,a)),{x:t,y:n}}},MIe.createHasher=function(e,t,r){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const o=HIe(n,2,{...r,DST:r.DST,...i}),s=e.fromAffine(t(o[0])),a=e.fromAffine(t(o[1])),c=s.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,i){const o=HIe(n,1,{...r,DST:r.encodeDST,...i}),s=e.fromAffine(t(o[0])).clearCofactor();return s.assertValidity(),s},mapToCurve(r){if(!Array.isArray(r))throw new Error("mapToCurve: expected array of bigints");for(const e of r)if("bigint"!=typeof e)throw new Error(`mapToCurve: expected array of bigints, got ${e} in array`);const n=e.fromAffine(t(r)).clearCofactor();return n.assertValidity(),n}}};const UIe=qxe,LIe=Hxe,jIe=LIe.bytesToNumberBE;function NIe(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function zIe(e,t){const r=new Uint8Array(e.length);for(let n=0;n255&&(t=n((0,LIe.concatBytes)((0,LIe.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:i,blockLen:o}=n,s=Math.ceil(r/i);if(s>255)throw new Error("Invalid xmd length");const a=(0,LIe.concatBytes)(t,NIe(t.length,1)),c=NIe(0,o),u=NIe(r,2),l=new Array(s),d=n((0,LIe.concatBytes)(c,e,u,NIe(0,1),a));l[0]=n((0,LIe.concatBytes)(d,NIe(1,1),a));for(let e=1;e<=s;e++){const t=[zIe(d,l[e-1]),NIe(e+1,1),a];l[e]=n((0,LIe.concatBytes)(...t))}return(0,LIe.concatBytes)(...l).slice(0,r)}function qIe(e,t,r,n,i){if((0,LIe.abytes)(e),(0,LIe.abytes)(t),DIe(r),t.length>255){const e=Math.ceil(2*n/8);t=i.create({dkLen:e}).update((0,LIe.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(e).update(NIe(r,2)).update(t).update(NIe(t.length,1)).digest()}function HIe(e,t,r){(0,LIe.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:n,k:i,m:o,hash:s,expand:a,DST:c}=r;(0,LIe.abytes)(e),DIe(t);const u="string"==typeof c?(0,LIe.utf8ToBytes)(c):c,l=n.toString(2).length,d=Math.ceil((l+i)/8),f=t*o*d;let h;if("xmd"===a)h=FIe(e,u,f,s);else if("xof"===a)h=qIe(e,u,f,i,s);else{if("_internal_pass"!==a)throw new Error('expand must be "xmd" or "xof"');h=e}const p=new Array(t);for(let e=0;e(e+t/d)/t;function h(e){const t=c,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),u=BigInt(44),l=BigInt(88),f=e*e*e%t,h=f*f*e%t,g=(0,o.pow2)(h,r,t)*h%t,y=(0,o.pow2)(g,r,t)*h%t,m=(0,o.pow2)(y,d,t)*f%t,b=(0,o.pow2)(m,i,t)*m%t,v=(0,o.pow2)(b,s,t)*b%t,w=(0,o.pow2)(v,u,t)*v%t,_=(0,o.pow2)(w,l,t)*w%t,E=(0,o.pow2)(_,u,t)*v%t,S=(0,o.pow2)(E,r,t)*h%t,k=(0,o.pow2)(S,a,t)*b%t,A=(0,o.pow2)(k,n,t)*f%t,x=(0,o.pow2)(A,d,t);if(!p.eql(p.sqr(x),e))throw new Error("Cannot find square root");return x}const p=(0,o.Field)(c,void 0,void 0,{sqrt:h});e.secp256k1=(0,n.createCurve)({a:BigInt(0),b:BigInt(7),Fp:p,n:u,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=u,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),c=f(s*e,t),d=f(-n*e,t);let h=(0,o.mod)(e-c*r-d*i,t),p=(0,o.mod)(-c*n-d*s,t);const g=h>a,y=p>a;if(g&&(h=t-h),y&&(p=t-p),h>a||p>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:g,k1:h,k2neg:y,k2:p}}}},t.sha256);const g=BigInt(0),y=e=>"bigint"==typeof e&&ge.charCodeAt(0))));n=(0,s.concatBytes)(r,r),m[e]=n}return(0,t.sha256)((0,s.concatBytes)(n,...r))}const v=e=>e.toRawBytes(!0).slice(1),w=e=>(0,s.numberToBytesBE)(e,32),_=e=>(0,o.mod)(e,c),E=e=>(0,o.mod)(e,u),S=e.secp256k1.ProjectivePoint;function k(t){let r=e.secp256k1.utils.normPrivateKeyToScalar(t),n=S.fromPrivateKey(r);return{scalar:n.hasEvenY()?r:E(-r),bytes:v(n)}}function A(e){if(!y(e))throw new Error("bad x: need 0 < x < p");const t=_(e*e);let r=h(_(t*e+BigInt(7)));r%d!==g&&(r=_(-r));const n=new S(e,r,l);return n.assertValidity(),n}function x(...e){return E((0,s.bytesToNumberBE)(b("BIP0340/challenge",...e)))}function I(e){return k(e).bytes}function B(e,t,n=(0,r.randomBytes)(32)){const i=(0,s.ensureBytes)("message",e),{bytes:o,scalar:a}=k(t),c=(0,s.ensureBytes)("auxRand",n,32),u=w(a^(0,s.bytesToNumberBE)(b("BIP0340/aux",c))),l=b("BIP0340/nonce",u,o,i),d=E((0,s.bytesToNumberBE)(l));if(d===g)throw new Error("sign failed: k is zero");const{bytes:f,scalar:h}=k(d),p=x(f,o,i),y=new Uint8Array(64);if(y.set(f,0),y.set(w(E(h+p*a)),32),!T(y,i,o))throw new Error("sign: Invalid signature produced");return y}function T(e,t,r){const n=(0,s.ensureBytes)("signature",e,64),i=(0,s.ensureBytes)("message",t),o=(0,s.ensureBytes)("publicKey",r,32);try{const e=A((0,s.bytesToNumberBE)(o)),t=(0,s.bytesToNumberBE)(n.subarray(0,32));if(!y(t))return!1;const r=(0,s.bytesToNumberBE)(n.subarray(32,64));if(!(e=>"bigint"==typeof e&&gS.BASE.multiplyAndAddUnsafe(e,t,r))(e,r,E(-a));return!(!c||!c.hasEvenY()||c.toAffine().x!==t)}catch(e){return!1}}e.schnorr={getPublicKey:I,sign:B,verify:T,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:A,pointToBytes:v,numberToBytesBE:s.numberToBytesBE,bytesToNumberBE:s.bytesToNumberBE,taggedHash:b,mod:o.mod}};const C=(()=>(0,i.isogenyMap)(p,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((e=>e.map((e=>BigInt(e)))))))(),O=(()=>(0,a.mapToCurveSimpleSWU)(p,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:p.create(BigInt("-11"))}))(),R=(()=>(0,i.createHasher)(e.secp256k1.ProjectivePoint,(e=>{const{x:t,y:r}=O(p.create(e[0]));return C(t,r)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:p.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256}))();e.hashToCurve=R.hashToCurve,e.encodeToCurve=R.encodeToCurve}(gxe),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=gxe;Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})}(pxe),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_WITHDRAWALS_PER_PAYLOAD=e.RLP_EMPTY_STRING=e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.SECP256K1_ORDER_DIV_2=e.SECP256K1_ORDER=e.MAX_INTEGER_BIGINT=e.MAX_INTEGER=e.MAX_UINT64=void 0;const t=pbe,r=pxe;e.MAX_UINT64=BigInt("0xffffffffffffffff"),e.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),e.SECP256K1_ORDER=r.secp256k1.CURVE.n,e.SECP256K1_ORDER_DIV_2=r.secp256k1.CURVE.n/BigInt(2),e.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=t.Buffer.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=t.Buffer.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=t.Buffer.from(e.KECCAK256_RLP_S,"hex"),e.RLP_EMPTY_STRING=t.Buffer.from([128]),e.MAX_WITHDRAWALS_PER_PAYLOAD=16}(hxe);var VIe={};Object.defineProperty(VIe,"__esModule",{value:!0}),VIe.GWEI_TO_WEI=void 0,VIe.GWEI_TO_WEI=BigInt(1e9);var $Ie={},KIe={};function ZIe(e){if(Array.isArray(e)){const t=[];let r=0;for(let n=0;ne.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function GIe(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return tBe(eBe(e))}function YIe(e,t){if(e<56)return Uint8Array.from([e+t]);const r=oBe(e),n=oBe(t+55+r.length/2);return Uint8Array.from(rBe(n+r))}function JIe(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);const r=XIe(aBe(e));if(t)return r;if(0!==r.remainder.length)throw new Error("invalid RLP: remainder must be zero");return r.data}function XIe(e){let t,r,n,i,o;const s=[],a=e[0];if(a<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(a<=183){if(t=a-127,n=128===a?Uint8Array.from([]):WIe(e,1,t),2===t&&n[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:n,remainder:e.slice(t)}}if(a<=191){if(r=a-182,e.length-1e.length)throw new Error("invalid RLP: total length is larger than the data");for(i=WIe(e,r,n);i.length;)o=XIe(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.slice(n)}}}Object.defineProperty(KIe,"__esModule",{value:!0}),KIe.RLP=KIe.utils=KIe.decode=KIe.encode=void 0,KIe.encode=ZIe,KIe.decode=JIe;const QIe=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function eBe(e){let t="";for(let r=0;re+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t=2&&"0"===e[0]&&"x"===e[1]}function aBe(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return sBe(e)?rBe(function(e){return e.length%2?`0${e}`:e}("string"!=typeof(t=e)?t:sBe(t)?t.slice(2):t)):iBe(e);var t;if("number"==typeof e||"bigint"==typeof e)return e?rBe(oBe(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}KIe.utils={bytesToHex:eBe,concatBytes:nBe,hexToBytes:rBe,utf8ToBytes:iBe},KIe.RLP={encode:ZIe,decode:JIe};var cBe={},uBe={},lBe={};Object.defineProperty(lBe,"__esModule",{value:!0}),lBe.add5L=lBe.add5H=lBe.add4H=lBe.add4L=lBe.add3H=lBe.add3L=lBe.add=lBe.rotlBL=lBe.rotlBH=lBe.rotlSL=lBe.rotlSH=lBe.rotr32L=lBe.rotr32H=lBe.rotrBL=lBe.rotrBH=lBe.rotrSL=lBe.rotrSH=lBe.shrSL=lBe.shrSH=lBe.toBig=lBe.split=lBe.fromBig=void 0;const dBe=BigInt(2**32-1),fBe=BigInt(32);function hBe(e,t=!1){return t?{h:Number(e&dBe),l:Number(e>>fBe&dBe)}:{h:0|Number(e>>fBe&dBe),l:0|Number(e&dBe)}}function pBe(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0);lBe.toBig=gBe;const yBe=(e,t,r)=>e>>>r;lBe.shrSH=yBe;const mBe=(e,t,r)=>e<<32-r|t>>>r;lBe.shrSL=mBe;const bBe=(e,t,r)=>e>>>r|t<<32-r;lBe.rotrSH=bBe;const vBe=(e,t,r)=>e<<32-r|t>>>r;lBe.rotrSL=vBe;const wBe=(e,t,r)=>e<<64-r|t>>>r-32;lBe.rotrBH=wBe;const _Be=(e,t,r)=>e>>>r-32|t<<64-r;lBe.rotrBL=_Be;const EBe=(e,t)=>t;lBe.rotr32H=EBe;const SBe=(e,t)=>e;lBe.rotr32L=SBe;const kBe=(e,t,r)=>e<>>32-r;lBe.rotlSH=kBe;const ABe=(e,t,r)=>t<>>32-r;lBe.rotlSL=ABe;const xBe=(e,t,r)=>t<>>64-r;lBe.rotlBH=xBe;const IBe=(e,t,r)=>e<>>64-r;function BBe(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}lBe.rotlBL=IBe,lBe.add=BBe;const TBe=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);lBe.add3L=TBe;const CBe=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;lBe.add3H=CBe;const OBe=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);lBe.add4L=OBe;const RBe=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;lBe.add4H=RBe;const PBe=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);lBe.add5L=PBe;const MBe=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;lBe.add5H=MBe;const UBe={fromBig:hBe,split:pBe,toBig:gBe,shrSH:yBe,shrSL:mBe,rotrSH:bBe,rotrSL:vBe,rotrBH:wBe,rotrBL:_Be,rotr32H:EBe,rotr32L:SBe,rotlSH:kBe,rotlSL:ABe,rotlBH:xBe,rotlBL:IBe,add:BBe,add3L:TBe,add3H:CBe,add4L:OBe,add4H:RBe,add5H:MBe,add5L:PBe};lBe.default=UBe,Object.defineProperty(uBe,"__esModule",{value:!0}),uBe.shake256=uBe.shake128=uBe.keccak_512=uBe.keccak_384=uBe.keccak_256=uBe.keccak_224=uBe.sha3_512=uBe.sha3_384=uBe.sha3_256=uBe.sha3_224=uBe.Keccak=uBe.keccakP=void 0;const LBe=bxe,jBe=lBe,NBe=Ixe,zBe=[],DBe=[],FBe=[],qBe=BigInt(0),HBe=BigInt(1),VBe=BigInt(2),$Be=BigInt(7),KBe=BigInt(256),ZBe=BigInt(113);for(let e=0,t=HBe,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],zBe.push(2*(5*n+r)),DBe.push((e+1)*(e+2)/2%64);let i=qBe;for(let e=0;e<7;e++)t=(t<>$Be)*ZBe)%KBe,t&VBe&&(i^=HBe<<(HBe<r>32?(0,jBe.rotlBH)(e,t,r):(0,jBe.rotlSH)(e,t,r),JBe=(e,t,r)=>r>32?(0,jBe.rotlBL)(e,t,r):(0,jBe.rotlSL)(e,t,r);function XBe(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=YBe(o,s,1)^r[n],c=JBe(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=DBe[r],o=YBe(t,i,n),s=JBe(t,i,n),a=zBe[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=WBe[n],e[1]^=GBe[n]}r.fill(0)}uBe.keccakP=XBe;class QBe extends NBe.Hash{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,LBe.number)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,NBe.u32)(this.state)}keccak(){NBe.isLE||(0,NBe.byteSwap32)(this.state32),XBe(this.state32,this.rounds),NBe.isLE||(0,NBe.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,LBe.exists)(this);const{blockLen:t,state:r}=this,n=(e=(0,NBe.toBytes)(e)).length;for(let i=0;i=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,LBe.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,LBe.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new QBe(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}uBe.Keccak=QBe;const eTe=(e,t,r)=>(0,NBe.wrapConstructor)((()=>new QBe(t,e,r)));uBe.sha3_224=eTe(6,144,28),uBe.sha3_256=eTe(6,136,32),uBe.sha3_384=eTe(6,104,48),uBe.sha3_512=eTe(6,72,64),uBe.keccak_224=eTe(1,144,28),uBe.keccak_256=eTe(1,136,32),uBe.keccak_384=eTe(1,104,48),uBe.keccak_512=eTe(1,72,64);const tTe=(e,t,r)=>(0,NBe.wrapXOFConstructorWithOpts)(((n={})=>new QBe(t,e,void 0===n.dkLen?r:n.dkLen,!0)));function rTe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}uBe.shake128=tTe(31,168,16),uBe.shake256=tTe(31,136,32);var nTe={exports:{}};!function(t,r){var n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.crypto=r.utf8ToBytes=r.createView=r.concatBytes=r.toHex=r.bytesToHex=r.assertBytes=r.assertBool=void 0,r.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},r.hexToBytes=function(e){const t=e.startsWith("0x")?e.substring(2):e;return(0,o.hexToBytes)(t)},r.equalsBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r(i.default.bytes(t),e(t))};const i=n(bxe),o=Ixe,s=i.default.bool;r.assertBool=s;const a=i.default.bytes;r.assertBytes=a;var c=Ixe;Object.defineProperty(r,"bytesToHex",{enumerable:!0,get:function(){return c.bytesToHex}}),Object.defineProperty(r,"toHex",{enumerable:!0,get:function(){return c.bytesToHex}}),Object.defineProperty(r,"concatBytes",{enumerable:!0,get:function(){return c.concatBytes}}),Object.defineProperty(r,"createView",{enumerable:!0,get:function(){return c.createView}}),Object.defineProperty(r,"utf8ToBytes",{enumerable:!0,get:function(){return c.utf8ToBytes}}),r.crypto=(()=>{const e="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,r=rTe.bind(t);return{node:r&&!e?r("crypto"):void 0,web:e}})()}(nTe,nTe.exports),Object.defineProperty(cBe,"__esModule",{value:!0}),cBe.keccak512=cBe.keccak384=cBe.keccak256=cBe.keccak224=void 0;const iTe=uBe,oTe=nTe.exports;cBe.keccak224=(0,oTe.wrapHash)(iTe.keccak_224),cBe.keccak256=(()=>{const e=(0,oTe.wrapHash)(iTe.keccak_256);return e.create=iTe.keccak_256.create,e})(),cBe.keccak384=(0,oTe.wrapHash)(iTe.keccak_384),cBe.keccak512=(0,oTe.wrapHash)(iTe.keccak_512);var sTe={},aTe={},cTe={};function uTe(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}function lTe(e){let t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received "+typeof t);return t.length%2&&(t=`0${t}`),t}Object.defineProperty(cTe,"__esModule",{value:!0}),cTe.isHexString=cTe.getKeys=cTe.fromAscii=cTe.fromUtf8=cTe.toAscii=cTe.arrayContainsArray=cTe.getBinarySize=cTe.padToEven=cTe.stripHexPrefix=cTe.isHexPrefixed=void 0,cTe.isHexPrefixed=uTe,cTe.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return uTe(e)?e.slice(2):e},cTe.padToEven=lTe,cTe.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof e);return age.byteLength(e,"utf8")},cTe.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(t))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[!0===r?"some":"every"]((t=>e.indexOf(t)>=0))},cTe.toAscii=function(e){let t="",r=0;const n=e.length;for("0x"===e.substring(0,2)&&(r=2);r0&&e.length!==2+2*t)},Object.defineProperty(aTe,"__esModule",{value:!0}),aTe.assertIsString=aTe.assertIsArray=aTe.assertIsBuffer=aTe.assertIsHexString=void 0;const dTe=cTe;aTe.assertIsHexString=function(e){if(!(0,dTe.isHexString)(e))throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)},aTe.assertIsBuffer=function(e){if(!age.isBuffer(e))throw new Error(`This method only supports Buffer but input was: ${e}`)},aTe.assertIsArray=function(e){if(!Array.isArray(e))throw new Error(`This method only supports number arrays but input was: ${e}`)},aTe.assertIsString=function(e){if("string"!=typeof e)throw new Error(`This method only supports strings but input was: ${e}`)},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.intToUnpaddedBuffer=e.bigIntToUnpaddedBuffer=e.bigIntToHex=e.bufArrToArr=e.arrToBufArr=e.validateNoLeadingZeroes=e.baToJSON=e.toUtf8=e.short=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToInt=e.bigIntToBuffer=e.bufferToBigInt=e.bufferToHex=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=e.intToBuffer=e.intToHex=void 0;const t=aTe,r=cTe;e.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`},e.intToBuffer=function(t){const n=(0,e.intToHex)(t);return age.from((0,r.padToEven)(n.slice(2)),"hex")},e.zeros=function(e){return age.allocUnsafe(e).fill(0)};const n=function(t,r,n){const i=(0,e.zeros)(r);return n?t.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};function o(t){const r=(0,e.bufferToHex)(t);return"0x"===r?BigInt(0):BigInt(r)}function s(t){return(0,e.toBuffer)("0x"+t.toString(16))}e.unpadBuffer=function(e){return(0,t.assertIsBuffer)(e),i(e)},e.unpadArray=function(e){return(0,t.assertIsArray)(e),i(e)},e.unpadHexString=function(e){return(0,t.assertIsHexString)(e),e=(0,r.stripHexPrefix)(e),"0x"+i(e)},e.toBuffer=function(t){if(null==t)return age.allocUnsafe(0);if(age.isBuffer(t))return age.from(t);if(Array.isArray(t)||t instanceof Uint8Array)return age.from(t);if("string"==typeof t){if(!(0,r.isHexString)(t))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${t}`);return age.from((0,r.padToEven)((0,r.stripHexPrefix)(t)),"hex")}if("number"==typeof t)return(0,e.intToBuffer)(t);if("bigint"==typeof t){if(t0&&0===r[0])throw new Error(`${t} cannot have leading zeroes, received: ${r.toString("hex")}`)},e.arrToBufArr=function e(t){return Array.isArray(t)?t.map((t=>e(t))):age.from(t)},e.bufArrToArr=function e(t){return Array.isArray(t)?t.map((t=>e(t))):Uint8Array.from(null!=t?t:[])},e.bigIntToHex=e=>"0x"+e.toString(16),e.bigIntToUnpaddedBuffer=function(t){return(0,e.unpadBuffer)(s(t))},e.intToUnpaddedBuffer=function(t){return(0,e.unpadBuffer)((0,e.intToBuffer)(t))}}(sTe),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.accountBodyToRLP=e.accountBodyToSlim=e.accountBodyFromSlim=e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;const t=KIe,r=cBe,n=pxe,i=nTe.exports,o=sTe,s=hxe,a=aTe,c=cTe,u=BigInt(0);class l{constructor(e=u,t=u,r=s.KECCAK256_RLP,n=s.KECCAK256_NULL){this.nonce=e,this.balance=t,this.storageRoot=r,this.codeHash=n,this._validate()}static fromAccountData(e){const{nonce:t,balance:r,storageRoot:n,codeHash:i}=e;return new l(void 0!==t?(0,o.bufferToBigInt)((0,o.toBuffer)(t)):void 0,void 0!==r?(0,o.bufferToBigInt)((0,o.toBuffer)(r)):void 0,void 0!==n?(0,o.toBuffer)(n):void 0,void 0!==i?(0,o.toBuffer)(i):void 0)}static fromRlpSerializedAccount(e){const r=(0,o.arrToBufArr)(t.RLP.decode(Uint8Array.from(e)));if(!Array.isArray(r))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(r)}static fromValuesArray(e){const[t,r,n,i]=e;return new l((0,o.bufferToBigInt)(t),(0,o.bufferToBigInt)(r),n,i)}_validate(){if(this.nonce=8?d+=n[e].toUpperCase():d+=n[e];return d},e.isValidChecksumAddress=function(t,r){return(0,e.isValidAddress)(t)&&(0,e.toChecksumAddress)(t,r)===t},e.generateAddress=function(e,n){return(0,a.assertIsBuffer)(e),(0,a.assertIsBuffer)(n),(0,o.bufferToBigInt)(n)===BigInt(0)?age.from((0,r.keccak256)(t.RLP.encode((0,o.bufArrToArr)([e,null])))).slice(-20):age.from((0,r.keccak256)(t.RLP.encode((0,o.bufArrToArr)([e,n])))).slice(-20)},e.generateAddress2=function(e,t,n){if((0,a.assertIsBuffer)(e),(0,a.assertIsBuffer)(t),(0,a.assertIsBuffer)(n),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==t.length)throw new Error("Expected salt to be of length 32");const i=(0,r.keccak256)(age.concat([age.from("ff","hex"),e,t,(0,r.keccak256)(n)]));return(0,o.toBuffer)(i).slice(-20)},e.isValidPrivate=function(e){return n.secp256k1.utils.isValidPrivateKey(e)},e.isValidPublic=function(e,t=!1){if((0,a.assertIsBuffer)(e),64===e.length)try{return n.secp256k1.ProjectivePoint.fromHex(age.concat([age.from([4]),e])),!0}catch(e){return!1}if(!t)return!1;try{return n.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}},e.pubToAddress=function(e,t=!1){if((0,a.assertIsBuffer)(e),t&&64!==e.length&&(e=age.from(n.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),64!==e.length)throw new Error("Expected pubKey to be of length 64");return age.from((0,r.keccak256)(e)).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToPublic=function(e){return(0,a.assertIsBuffer)(e),age.from(n.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1))},e.privateToAddress=function(t){return(0,e.publicToAddress)((0,e.privateToPublic)(t))},e.importPublic=function(e){return(0,a.assertIsBuffer)(e),64!==e.length&&(e=age.from(n.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),e},e.zeroAddress=function(){const e=(0,o.zeros)(20);return(0,o.bufferToHex)(e)},e.isZeroAddress=function(t){try{(0,a.assertIsString)(t)}catch(e){return!1}return(0,e.zeroAddress)()===t},e.accountBodyFromSlim=d;const f=new Uint8Array(0);e.accountBodyToSlim=function(e){const[t,r,n,i]=e;return[t,r,(0,o.arrToBufArr)(n).equals(s.KECCAK256_RLP)?f:n,(0,o.arrToBufArr)(i).equals(s.KECCAK256_NULL)?f:i]},e.accountBodyToRLP=function(e,r=!0){const n=r?d(e):e;return(0,o.arrToBufArr)(t.RLP.encode(n))}}($Ie);var fTe={};Object.defineProperty(fTe,"__esModule",{value:!0}),fTe.Address=void 0;const hTe=$Ie,pTe=sTe;class gTe{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new gTe((0,pTe.zeros)(20))}static fromString(e){if(!(0,hTe.isValidAddress)(e))throw new Error("Invalid address");return new gTe((0,pTe.toBuffer)(e))}static fromPublicKey(e){if(!age.isBuffer(e))throw new Error("Public key should be Buffer");const t=(0,hTe.pubToAddress)(e);return new gTe(t)}static fromPrivateKey(e){if(!age.isBuffer(e))throw new Error("Private key should be Buffer");const t=(0,hTe.privateToAddress)(e);return new gTe(t)}static generate(e,t){if("bigint"!=typeof t)throw new Error("Expected nonce to be a bigint");return new gTe((0,hTe.generateAddress)(e.buf,(0,pTe.bigIntToBuffer)(t)))}static generate2(e,t,r){if(!age.isBuffer(t))throw new Error("Expected salt to be a Buffer");if(!age.isBuffer(r))throw new Error("Expected initCode to be a Buffer");return new gTe((0,hTe.generateAddress2)(e.buf,t,r))}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(gTe.zero())}isPrecompileOrSystemAddress(){const e=(0,pTe.bufferToBigInt)(this.buf),t=BigInt(0),r=BigInt("0xffff");return e>=t&&e<=r}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return age.from(this.buf)}}fTe.Address=gTe;var yTe={},mTe={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=void 0;const t=sTe,r=cTe;var n;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(n=e.TypeOutput||(e.TypeOutput={})),e.toType=function(e,i){if(null===e)return null;if(void 0===e)return;if("string"==typeof e&&!(0,r.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const o=(0,t.toBuffer)(e);switch(i){case n.Buffer:return o;case n.BigInt:return(0,t.bufferToBigInt)(o);case n.Number:{const e=(0,t.bufferToBigInt)(o);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case n.PrefixedHexString:return(0,t.bufferToHex)(o);default:throw new Error("unknown outputType")}}}(mTe),Object.defineProperty(yTe,"__esModule",{value:!0}),yTe.Withdrawal=void 0;const bTe=fTe,vTe=sTe,wTe=mTe;class _Te{constructor(e,t,r,n){this.index=e,this.validatorIndex=t,this.address=r,this.amount=n}static fromWithdrawalData(e){const{index:t,validatorIndex:r,address:n,amount:i}=e,o=(0,wTe.toType)(t,wTe.TypeOutput.BigInt),s=(0,wTe.toType)(r,wTe.TypeOutput.BigInt),a=new bTe.Address((0,wTe.toType)(n,wTe.TypeOutput.Buffer)),c=(0,wTe.toType)(i,wTe.TypeOutput.BigInt);return new _Te(o,s,a,c)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[t,r,n,i]=e;return _Te.fromWithdrawalData({index:t,validatorIndex:r,address:n,amount:i})}static toBufferArray(e){const{index:t,validatorIndex:r,address:n,amount:i}=e,o=(0,wTe.toType)(t,wTe.TypeOutput.BigInt)===BigInt(0)?age.alloc(0):(0,wTe.toType)(t,wTe.TypeOutput.Buffer),s=(0,wTe.toType)(r,wTe.TypeOutput.BigInt)===BigInt(0)?age.alloc(0):(0,wTe.toType)(r,wTe.TypeOutput.Buffer);let a;return a=n instanceof bTe.Address?n.buf:(0,wTe.toType)(n,wTe.TypeOutput.Buffer),[o,s,a,(0,wTe.toType)(i,wTe.TypeOutput.BigInt)===BigInt(0)?age.alloc(0):(0,wTe.toType)(i,wTe.TypeOutput.Buffer)]}raw(){return _Te.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,vTe.bigIntToHex)(this.index),validatorIndex:(0,vTe.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,vTe.bigIntToHex)(this.amount)}}}yTe.Withdrawal=_Te;var ETe={};Object.defineProperty(ETe,"__esModule",{value:!0}),ETe.hashPersonalMessage=ETe.isValidSignature=ETe.fromRpcSig=ETe.toCompactSig=ETe.toRpcSig=ETe.ecrecover=ETe.ecsign=void 0;const STe=cBe,kTe=pxe,ATe=sTe,xTe=hxe,ITe=aTe;function BTe(e,t){return e===BigInt(0)||e===BigInt(1)?e:void 0===t?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function TTe(e){return e===BigInt(0)||e===BigInt(1)}ETe.ecsign=function(e,t,r){const n=kTe.secp256k1.sign(e,t),i=n.toCompactRawBytes();return{r:age.from(i.slice(0,32)),s:age.from(i.slice(32,64)),v:void 0===r?BigInt(n.recovery+27):BigInt(n.recovery+35)+BigInt(r)*BigInt(2)}},ETe.ecrecover=function(e,t,r,n,i){const o=age.concat([(0,ATe.setLengthLeft)(r,32),(0,ATe.setLengthLeft)(n,32)],64),s=BTe(t,i);if(!TTe(s))throw new Error("Invalid signature v value");const a=kTe.secp256k1.Signature.fromCompact(o).addRecoveryBit(Number(s)).recoverPublicKey(e);return age.from(a.toRawBytes(!1).slice(1))},ETe.toRpcSig=function(e,t,r,n){if(!TTe(BTe(e,n)))throw new Error("Invalid signature v value");return(0,ATe.bufferToHex)(age.concat([(0,ATe.setLengthLeft)(t,32),(0,ATe.setLengthLeft)(r,32),(0,ATe.toBuffer)(e)]))},ETe.toCompactSig=function(e,t,r,n){if(!TTe(BTe(e,n)))throw new Error("Invalid signature v value");let i=r;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(i=age.from(r),i[0]|=128),(0,ATe.bufferToHex)(age.concat([(0,ATe.setLengthLeft)(t,32),(0,ATe.setLengthLeft)(i,32)]))},ETe.fromRpcSig=function(e){const t=(0,ATe.toBuffer)(e);let r,n,i;if(t.length>=65)r=t.slice(0,32),n=t.slice(32,64),i=(0,ATe.bufferToBigInt)(t.slice(64));else{if(64!==t.length)throw new Error("Invalid signature length");r=t.slice(0,32),n=t.slice(32,64),i=BigInt((0,ATe.bufferToInt)(t.slice(32,33))>>7),n[0]&=127}return i<27&&(i+=BigInt(27)),{v:i,r:r,s:n}},ETe.isValidSignature=function(e,t,r,n=!0,i){if(32!==t.length||32!==r.length)return!1;if(!TTe(BTe(e,i)))return!1;const o=(0,ATe.bufferToBigInt)(t),s=(0,ATe.bufferToBigInt)(r);return!(o===BigInt(0)||o>=xTe.SECP256K1_ORDER||s===BigInt(0)||s>=xTe.SECP256K1_ORDER||n&&s>=xTe.SECP256K1_ORDER_DIV_2)},ETe.hashPersonalMessage=function(e){(0,ITe.assertIsBuffer)(e);const t=age.from(`Ethereum Signed Message:\n${e.length}`,"utf-8");return age.from((0,STe.keccak256)(age.concat([t,e])))};var CTe,OTe={};CTe=OTe,Object.defineProperty(CTe,"__esModule",{value:!0}),CTe.compactBytesToNibbles=CTe.bytesToNibbles=CTe.nibblesToCompactBytes=CTe.nibblesToBytes=CTe.hasTerminator=void 0,CTe.hasTerminator=e=>e.length>0&&16===e[e.length-1],CTe.nibblesToBytes=(e,t)=>{for(let r=0,n=0;n{let t=0;(0,CTe.hasTerminator)(e)&&(t=1,e=e.subarray(0,e.length-1));const r=new Uint8Array(e.length/2+1);return r[0]=t<<5,1&~e.length||(r[0]|=16,r[0]|=e[0],e=e.subarray(1)),(0,CTe.nibblesToBytes)(e,r.subarray(1)),r},CTe.bytesToNibbles=e=>{const t=2*e.length+1,r=new Uint8Array(t);for(let t=0;t{if(0===e.length)return e;let t=(0,CTe.bytesToNibbles)(e);t[0]<2&&(t=t.subarray(0,t.length-1));const r=2-(1&t[0]);return t.subarray(r)};var RTe={},PTe=t(tye);Object.defineProperty(RTe,"__esModule",{value:!0}),RTe.AsyncEventEmitter=void 0;const MTe=PTe;class UTe extends MTe.EventEmitter{emit(e,...t){var r;let[n,i]=t;const o=this;let s=null!==(r=o._events[e])&&void 0!==r?r:[];return void 0===i&&"function"==typeof n&&(i=n,n=void 0),"newListener"!==e&&"removeListener"!==e||(n={event:n,fn:i},i=void 0),s=Array.isArray(s)?s:[s],async function(e,t,r){let n;for await(const i of t)try{i.length<2?i.call(e,r):await new Promise(((t,n)=>{i.call(e,r,(e=>{e?n(e):t()}))}))}catch(e){n=e}if(n)throw n}(o,s.slice(),n).then(i).catch(i),o.listenerCount(e)>0}once(e,t){const r=this;let n;if("function"!=typeof t)throw new TypeError("listener must be a function");return n=t.length>=2?function(i,o){r.removeListener(e,n),t(i,o)}:function(i){r.removeListener(e,n),t(i,n)},r.on(e,n),r}first(e,t){var r;let n=null!==(r=this._events[e])&&void 0!==r?r:[];if("function"!=typeof t)throw new TypeError("listener must be a function");return Array.isArray(n)||(this._events[e]=n=[n]),n.unshift(t),this}before(e,t,r){return this.beforeOrAfter(e,t,r)}after(e,t,r){return this.beforeOrAfter(e,t,r,"after")}beforeOrAfter(e,t,r,n){var i;let o,s,a=null!==(i=this._events[e])&&void 0!==i?i:[];const c="after"===n?1:0;if("function"!=typeof r)throw new TypeError("listener must be a function");if("function"!=typeof t)throw new TypeError("target must be a function");for(Array.isArray(a)||(this._events[e]=a=[a]),s=a.length,o=a.length;o--;)if(a[o]===t){s=o+c;break}return a.splice(s,0,r),this}on(e,t){return super.on(e,t)}addListener(e,t){return super.addListener(e,t)}prependListener(e,t){return super.prependListener(e,t)}prependOnceListener(e,t){return super.prependOnceListener(e,t)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,t){return super.removeListener(e,t)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}RTe.AsyncEventEmitter=UTe;var LTe={};Object.defineProperty(LTe,"__esModule",{value:!0}),LTe.Lock=void 0,LTe.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}};var jTe={},NTe={};function zTe(){throw new Error("setTimeout has not been defined")}function DTe(){throw new Error("clearTimeout has not been defined")}var FTe=zTe,qTe=DTe;function HTe(e){if(FTe===setTimeout)return setTimeout(e,0);if((FTe===zTe||!FTe)&&setTimeout)return FTe=setTimeout,setTimeout(e,0);try{return FTe(e,0)}catch(t){try{return FTe.call(null,e,0)}catch(t){return FTe.call(this,e,0)}}}"function"==typeof Kpe.setTimeout&&(FTe=setTimeout),"function"==typeof Kpe.clearTimeout&&(qTe=clearTimeout);var VTe,$Te=[],KTe=!1,ZTe=-1;function WTe(){KTe&&VTe&&(KTe=!1,VTe.length?$Te=VTe.concat($Te):ZTe=-1,$Te.length&>e())}function GTe(){if(!KTe){var e=HTe(WTe);KTe=!0;for(var t=$Te.length;t;){for(VTe=$Te,$Te=[];++ZTe1)for(var r=1;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),jCe(t)?r.showHidden=t:t&&tOe(r,t),HCe(r.showHidden)&&(r.showHidden=!1),HCe(r.depth)&&(r.depth=2),HCe(r.colors)&&(r.colors=!1),HCe(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=OCe),PCe(r,e,r.depth)}function OCe(e,t){var r=CCe.styles[t];return r?"["+CCe.colors[r][0]+"m"+e+"["+CCe.colors[r][1]+"m":e}function RCe(e,t){return e}function PCe(e,t,r){if(e.customInspect&&t&&WCe(t.inspect)&&t.inspect!==CCe&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return FCe(n)||(n=PCe(e,n,r)),n}var i=function(e,t){if(HCe(t))return e.stylize("undefined","undefined");if(FCe(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return DCe(t)?e.stylize(""+t,"number"):jCe(t)?e.stylize(""+t,"boolean"):NCe(t)?e.stylize("null","null"):void 0}(e,t);if(i)return i;var o=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),ZCe(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return MCe(t);if(0===o.length){if(WCe(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(VCe(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(KCe(t))return e.stylize(Date.prototype.toString.call(t),"date");if(ZCe(t))return MCe(t)}var c,u="",l=!1,d=["{","}"];return LCe(t)&&(l=!0,d=["[","]"]),WCe(t)&&(u=" [Function"+(t.name?": "+t.name:"")+"]"),VCe(t)&&(u=" "+RegExp.prototype.toString.call(t)),KCe(t)&&(u=" "+Date.prototype.toUTCString.call(t)),ZCe(t)&&(u=" "+MCe(t)),0!==o.length||l&&0!=t.length?r<0?VCe(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=l?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,d)):d[0]+u+d[1]}function MCe(e){return"["+Error.prototype.toString.call(e)+"]"}function UCe(e,t,r,n,i,o){var s,a,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),rOe(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(c.value)<0?(a=NCe(r)?PCe(e,c.value,null):PCe(e,c.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),HCe(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function LCe(e){return Array.isArray(e)}function jCe(e){return"boolean"==typeof e}function NCe(e){return null===e}function zCe(e){return null==e}function DCe(e){return"number"==typeof e}function FCe(e){return"string"==typeof e}function qCe(e){return"symbol"==typeof e}function HCe(e){return void 0===e}function VCe(e){return $Ce(e)&&"[object RegExp]"===JCe(e)}function $Ce(e){return"object"==typeof e&&null!==e}function KCe(e){return $Ce(e)&&"[object Date]"===JCe(e)}function ZCe(e){return $Ce(e)&&("[object Error]"===JCe(e)||e instanceof Error)}function WCe(e){return"function"==typeof e}function GCe(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function YCe(e){return age.isBuffer(e)}function JCe(e){return Object.prototype.toString.call(e)}function XCe(e){return e<10?"0"+e.toString(10):e.toString(10)}CCe.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},CCe.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var QCe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function eOe(){console.log("%s - %s",function(){var e=new Date,t=[XCe(e.getHours()),XCe(e.getMinutes()),XCe(e.getSeconds())].join(":");return[e.getDate(),QCe[e.getMonth()],t].join(" ")}(),ACe.apply(null,arguments))}function tOe(e,t){if(!t||!$Ce(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function rOe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var nOe="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function iOe(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(nOe&&e[nOe]){var t;if("function"!=typeof(t=e[nOe]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,nOe,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o0?this.tail.next=t:this.head=t,this.tail=t,++this.length},uOe.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},uOe.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},uOe.prototype.clear=function(){this.head=this.tail=null,this.length=0},uOe.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},uOe.prototype.concat=function(e){if(0===this.length)return age.alloc(0);if(1===this.length)return this.head.data;for(var t=age.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var lOe=age.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function dOe(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!lOe(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=hOe;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=pOe;break;default:return void(this.write=fOe)}this.charBuffer=new age(6),this.charReceived=0,this.charLength=0}function fOe(e){return e.toString(this.encoding)}function hOe(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function pOe(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}dOe.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n,i=e.length;if(this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),i=(t+=e.toString(this.encoding,0,i)).length-1,(n=t.charCodeAt(i))>=55296&&n<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,i)}return t},dOe.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},dOe.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t},mOe.ReadableState=yOe;var gOe=TCe("stream");function yOe(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof $Oe&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new uOe,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new dOe(e.encoding),this.encoding=e.encoding)}function mOe(e){if(!(this instanceof mOe))return new mOe(e);this._readableState=new yOe(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),Gge.call(this)}function bOe(e,t,r,n,i){var o=function(e,t){var r=null;return age.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,_Oe(e)}}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else{var c;!t.decoder||i||n||(r=t.decoder.write(r),c=!t.objectMode&&0===r.length),i||(t.reading=!1),c||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&_Oe(e))),function(e,t){t.readingMore||(t.readingMore=!0,YTe(SOe,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=vOe?e=vOe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function _Oe(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(gOe("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?YTe(EOe,e):EOe(e))}function EOe(e){gOe("emit readable"),e.emit("readable"),xOe(e)}function SOe(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return eo.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0==(e-=s)){s===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=age.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),0==(e-=s)){s===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(s));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function BOe(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,YTe(TOe,t,e))}function TOe(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function COe(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return gOe("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?BOe(this):_Oe(this),null;if(0===(e=wOe(e,t))&&t.ended)return 0===t.length&&BOe(this),null;var n,i=t.needReadable;return gOe("need readable",i),(0===t.length||t.length-e0?IOe(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&BOe(this)),null!==n&&this.emit("data",n),n},mOe.prototype._read=function(e){this.emit("error",new Error("not implemented"))},mOe.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,gOe("pipe count=%d opts=%j",n.pipesCount,t);var i=t&&!1===t.end?u:s;function o(e){gOe("onunpipe"),e===r&&u()}function s(){gOe("onend"),e.end()}n.endEmitted?YTe(i):r.once("end",i),e.on("unpipe",o);var a=function(e){return function(){var t=e._readableState;gOe("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,xOe(e))}}(r);e.on("drain",a);var c=!1;function u(){gOe("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",u),r.removeListener("data",d),c=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||a()}var l=!1;function d(t){gOe("ondata"),l=!1,!1!==e.write(t)||l||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==COe(n.pipes,e))&&!c&&(gOe("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,l=!0),r.pause())}function f(t){gOe("onerror",t),g(),e.removeListener("error",f),0===function(e,t){return e.listeners(t).length}(e,"error")&&e.emit("error",t)}function h(){e.removeListener("finish",p),g()}function p(){gOe("onfinish"),e.removeListener("close",h),g()}function g(){gOe("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",h),e.once("finish",p),e.emit("pipe",r),n.flowing||(gOe("pipe resume"),r.resume()),e},mOe.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},MOe.prototype._write=function(e,t,r){r(new Error("not implemented"))},MOe.prototype._writev=null,MOe.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,DOe(e,t),r&&(t.finished?YTe(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},ECe($Oe,mOe);for(var qOe=Object.keys(MOe.prototype),HOe=0;HOee._pos){var n=r.substr(e._pos);if("x-user-defined"===e._charset){for(var i=new age(n.length),o=0;oe._pos&&(e.push(new age(new Uint8Array(s.result.slice(e._pos)))),e._pos=s.result.byteLength)},s.onload=function(){e.push(null)},s.readAsArrayBuffer(r)}e._xhr.readyState===eRe&&"ms-stream"!==e._mode&&e.push(null)},ECe(rRe,MOe);var nRe=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];rRe.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===nRe.indexOf(r)&&(this._headers[r]={name:e,value:t})},rRe.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},rRe.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},rRe.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t,r=e._opts,n=e._headers;if("POST"!==r.method&&"PUT"!==r.method&&"PATCH"!==r.method||(t=function(){if(void 0!==QTe)return QTe;try{new Kpe.Blob([new ArrayBuffer(1)]),QTe=!0}catch(e){QTe=!1}return QTe}()?new Kpe.Blob(e._body.map((function(e){return function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(Vge(e)){for(var t=new Uint8Array(e.length),r=e.length,n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},cRe=Math.floor,uRe=String.fromCharCode;function lRe(e){throw new RangeError(aRe[e])}function dRe(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function fRe(e,t,r){var n=0;for(e=r?cRe(e/700):e>>1,e+=cRe(e/t);e>455;n+=36)e=cRe(e/35);return cRe(n+36*e/(e+38))}function hRe(e){return function(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var i=function(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}((e=e.replace(sRe,".")).split("."),t).join(".");return n+i}(e,(function(e){return oRe.test(e)?"xn--"+function(e){var t,r,n,i,o,s,a,c,u,l,d,f,h,p,g,y=[];for(e=function(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i=t&&dcRe((iRe-r)/(h=n+1))&&lRe("overflow"),r+=(a-t)*h,t=a,s=0;siRe&&lRe("overflow"),d==t){for(c=r,u=36;!(c<(l=u<=o?1:u>=o+26?26:u-o));u+=36)g=c-l,p=36-l,y.push(uRe(dRe(l+g%p,0))),c=cRe(g/p);y.push(uRe(dRe(c,0))),o=fRe(r,h,n==i),r=0,++n}++r,++t}return y.join("")}(e):e}))}function pRe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var gRe=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function yRe(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function mRe(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n0&&a>s&&(a=s);for(var c=0;c=0?(u=h.substr(0,p),l=h.substr(p+1)):(u=h,l=""),d=decodeURIComponent(u),f=decodeURIComponent(l),pRe(i,d)?gRe(i[d])?i[d].push(f):i[d]=[i[d],f]:i[d]=f}return i}const wRe=Kpe.URL,_Re=Kpe.URLSearchParams;var ERe={parse:jRe,resolve:qRe,resolveObject:HRe,fileURLToPath:zRe,format:DRe,Url:SRe,URL:wRe,URLSearchParams:_Re};function SRe(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var kRe=/^([a-z0-9.+-]+:)/i,ARe=/:[0-9]*$/,xRe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,IRe=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),BRe=["'"].concat(IRe),TRe=["%","/","?",";","#"].concat(BRe),CRe=["/","?","#"],ORe=255,RRe=/^[+a-z0-9A-Z_-]{0,63}$/,PRe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,MRe={javascript:!0,"javascript:":!0},URe={javascript:!0,"javascript:":!0},LRe={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function jRe(e,t,r){if(e&&$Ce(e)&&e instanceof SRe)return e;var n=new SRe;return n.parse(e,t,r),n}function NRe(e,t,r,n){if(!FCe(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=-1!==i&&i127?E+="x":E+=_[S];if(!E.match(RRe)){var A=w.slice(0,u),x=w.slice(u+1),I=_.match(PRe);I&&(A.push(I[1]),x.unshift(I[2])),x.length&&(a="/"+x.join(".")+a),e.hostname=A.join(".");break}}}}e.hostname.length>ORe?e.hostname="":e.hostname=e.hostname.toLowerCase(),v||(e.hostname=hRe(e.hostname)),f=e.port?":"+e.port:"";var B=e.hostname||"";e.host=B+f,e.href+=e.host,v&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!MRe[p])for(u=0,d=BRe.length;u0)&&n.host.split("@"))&&(n.auth=g.shift(),n.host=n.hostname=g.shift())),n.search=e.search,n.query=e.query,NCe(n.pathname)&&NCe(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=w.slice(-1)[0],S=(n.host||e.host||w.length>1)&&("."===E||".."===E)||""===E,k=0,A=w.length;A>=0;A--)"."===(E=w[A])?w.splice(A,1):".."===E?(w.splice(A,1),k++):k&&(w.splice(A,1),k--);if(!b&&!v)for(;k--;k)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),S&&"/"!==w.join("/").substr(-1)&&w.push("");var x=""===w[0]||w[0]&&"/"===w[0].charAt(0);return _&&(n.hostname=n.host=x?"":w.length?w.shift():"",(g=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=g.shift(),n.host=n.hostname=g.shift())),(b=b||n.host&&w.length)&&!x&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),NCe(n.pathname)&&NCe(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},SRe.prototype.parseHost=function(){return VRe(this)};var $Re=Object.freeze({__proto__:null,parse:jRe,resolve:qRe,resolveObject:HRe,fileURLToPath:zRe,format:DRe,URL:wRe,URLSearchParams:_Re,default:ERe,Url:SRe});function KRe(e,t){"string"==typeof e&&(e=jRe(e));var r=-1===Kpe.location.protocol.search(/^https?:$/)?"http:":"",n=e.protocol||r,i=e.hostname||e.host,o=e.port,s=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?n+"//"+i:"")+(o?":"+o:"")+s,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var a=new rRe(e);return t&&a.on("response",t),a}function ZRe(e,t){var r=KRe(e,t);return r.end(),r}function WRe(){}WRe.defaultMaxSockets=4;var GRe=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],YRe={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},JRe={request:KRe,get:ZRe,Agent:WRe,METHODS:GRe,STATUS_CODES:YRe},XRe=t(Object.freeze({__proto__:null,request:KRe,get:ZRe,Agent:WRe,METHODS:GRe,STATUS_CODES:YRe,default:JRe}));function QRe(e,t){"string"==typeof e&&(e=jRe(e));var r=-1===Kpe.location.protocol.search(/^https?:$/)?"http:":"",n=e.protocol||r,i=e.hostname||e.host,o=e.port,s=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?n+"//"+i:"")+(o?":"+o:"")+s,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var a=new rRe(e);return t&&a.on("response",t),a}function ePe(e,t){var r=QRe(e,t);return r.end(),r}function tPe(){}tPe.defaultMaxSockets=4;var rPe=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],nPe={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},iPe={request:QRe,get:ePe,Agent:tPe,METHODS:rPe,STATUS_CODES:nPe},oPe=t(Object.freeze({__proto__:null,request:QRe,get:ePe,Agent:tPe,METHODS:rPe,STATUS_CODES:nPe,default:iPe})),sPe={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function aPe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function cPe(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o=0;)e[t]=0}var hPe=256,pPe=286,gPe=30,yPe=15,mPe=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],bPe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],vPe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],wPe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],_Pe=new Array(576);fPe(_Pe);var EPe=new Array(60);fPe(EPe);var SPe=new Array(512);fPe(SPe);var kPe=new Array(256);fPe(kPe);var APe=new Array(29);fPe(APe);var xPe,IPe,BPe,TPe=new Array(gPe);function CPe(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function OPe(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function RPe(e){return e<256?SPe[e]:SPe[256+(e>>>7)]}function PPe(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function MPe(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function jPe(e,t,r){var n,i,o=new Array(16),s=0;for(n=1;n<=yPe;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=LPe(o[a]++,a))}}function NPe(e){var t;for(t=0;t8?PPe(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function DPe(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)FPe(e,o,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],FPe(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,FPe(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,s,a,c=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,g=0;for(o=0;o<=yPe;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=c[2*c[2*(n=e.heap[r])+1]+1]+1)>p&&(o=p,g++),c[2*n+1]=o,n>u||(e.bl_count[o]++,s=0,n>=h&&(s=f[n-h]),a=c[2*n],e.opt_len+=a*(o+s),d&&(e.static_len+=a*(l[2*n+1]+s)));if(0!==g){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>u||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}(e,t),jPe(o,u,e.bl_count)}function VPe(e,t,r){var n,i,o=-1,s=t[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a>=7;n=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}function YPe(e,t,r,n){var i,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t=3&&0===e.bl_tree[2*wPe[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?WPe(e,t,r,n):4===e.strategy||o===i?(MPe(e,2+(n?1:0),3),qPe(e,_Pe,EPe)):(MPe(e,4+(n?1:0),3),function(e,t,r,n){var i;for(MPe(e,t-257,5),MPe(e,r-1,5),MPe(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(kPe[r]+hPe+1)]++,e.dyn_dtree[2*RPe(t)]++),e.last_lit===e.lit_bufsize-1}function XPe(e,t,r,n){for(var i=65535&e,o=e>>>16&65535,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16}var QPe=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function eMe(e,t,r,n){var i=QPe,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return~e}var tMe,rMe=-2,nMe=258,iMe=262,oMe=103,sMe=113,aMe=666;function cMe(e,t){return e.msg=sPe[t],t}function uMe(e){return(e<<1)-(e>4?9:0)}function lMe(e){for(var t=e.length;--t>=0;)e[t]=0}function dMe(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(cPe(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function fMe(e,t){YPe(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,dMe(e.strm)}function hMe(e,t){e.pending_buf[e.pending++]=t}function pMe(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function gMe(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,cPe(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=XPe(e.adler,t,i,r):2===e.state.wrap&&(e.adler=eMe(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function yMe(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-iMe?e.strstart-(e.w_size-iMe):0,u=e.window,l=e.w_mask,d=e.prev,f=e.strstart+nMe,h=u[o+s-1],p=u[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(r=t)+s]===p&&u[r+s-1]===h&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&os){if(e.match_start=t,s=n,n>=a)break;h=u[o+s-1],p=u[o+s]}}}while((t=d[t&l])>c&&0!=--i);return s<=e.lookahead?s:e.lookahead}function mMe(e){var t,r,n,i,o,s=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-iMe)){cPe(e.window,e.window,s,s,0),e.match_start-=s,e.strstart-=s,e.block_start-=s,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=s?n-s:0}while(--r);t=r=s;do{n=e.prev[--t],e.prev[t]=n>=s?n-s:0}while(--r);i+=s}if(0===e.strm.avail_in)break;if(r=gMe(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=JPe(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=JPe(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<5||t<0)return e?cMe(e,rMe):rMe;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===aMe&&4!==t)return cMe(e,0===e.avail_out?-5:rMe);if(n.strm=e,r=n.last_flush,n.last_flush=t,42===n.status)if(2===n.wrap)e.adler=0,hMe(n,31),hMe(n,139),hMe(n,8),n.gzhead?(hMe(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),hMe(n,255&n.gzhead.time),hMe(n,n.gzhead.time>>8&255),hMe(n,n.gzhead.time>>16&255),hMe(n,n.gzhead.time>>24&255),hMe(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),hMe(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(hMe(n,255&n.gzhead.extra.length),hMe(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=eMe(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(hMe(n,0),hMe(n,0),hMe(n,0),hMe(n,0),hMe(n,0),hMe(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),hMe(n,3),n.status=sMe);else{var s=8+(n.w_bits-8<<4)<<8;s|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=sMe,pMe(n,s),0!==n.strstart&&(pMe(n,e.adler>>>16),pMe(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=eMe(e.adler,n.pending_buf,n.pending-i,i)),dMe(e),i=n.pending,n.pending!==n.pending_buf_size));)hMe(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=eMe(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=eMe(e.adler,n.pending_buf,n.pending-i,i)),dMe(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=eMe(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=eMe(e.adler,n.pending_buf,n.pending-i,i)),dMe(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=eMe(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=oMe)}else n.status=oMe;if(n.status===oMe&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&dMe(e),n.pending+2<=n.pending_buf_size&&(hMe(n,255&e.adler),hMe(n,e.adler>>8&255),e.adler=0,n.status=sMe)):n.status=sMe),0!==n.pending){if(dMe(e),0===e.avail_out)return n.last_flush=-1,0}else if(0===e.avail_in&&uMe(t)<=uMe(r)&&4!==t)return cMe(e,-5);if(n.status===aMe&&0!==e.avail_in)return cMe(e,-5);if(0!==e.avail_in||0!==n.lookahead||0!==t&&n.status!==aMe){var a=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(mMe(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=JPe(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(fMe(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(fMe(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(fMe(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=nMe){if(mMe(e),e.lookahead<=nMe&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=e.strstart+nMe;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=JPe(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=JPe(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(fMe(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(fMe(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(fMe(e,!1),0===e.strm.avail_out)?1:2}(n,t):tMe[n.level].func(n,t);if(3!==a&&4!==a||(n.status=aMe),1===a||3===a)return 0===e.avail_out&&(n.last_flush=-1),0;if(2===a&&(1===t?GPe(n):5!==t&&(WPe(n,0,0,!1),3===t&&(lMe(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),dMe(e),0===e.avail_out))return n.last_flush=-1,0}return 4!==t?0:n.wrap<=0?1:(2===n.wrap?(hMe(n,255&e.adler),hMe(n,e.adler>>8&255),hMe(n,e.adler>>16&255),hMe(n,e.adler>>24&255),hMe(n,255&e.total_in),hMe(n,e.total_in>>8&255),hMe(n,e.total_in>>16&255),hMe(n,e.total_in>>24&255)):(pMe(n,e.adler>>>16),pMe(n,65535&e.adler)),dMe(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)}function kMe(e,t){var r,n,i,o,s,a,c,u,l,d,f,h,p,g,y,m,b,v,w,_,E,S,k,A,x;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),o=e.next_out,x=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),c=r.dmax,u=r.wsize,l=r.whave,d=r.wnext,f=r.window,h=r.hold,p=r.bits,g=r.lencode,y=r.distcode,m=(1<>>=w=v>>>24,p-=w,0==(w=v>>>16&255))x[o++]=65535&v;else{if(!(16&w)){if(64&w){if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}v=g[(65535&v)+(h&(1<>>=w,p-=w),p<15&&(h+=A[n++]<>>=w=v>>>24,p-=w,16&(w=v>>>16&255)){if(E=65535&v,p<(w&=15)&&(h+=A[n++]<c){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,E>(w=o-s)){if((w=E-w)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,k=f,0===d){if(S+=u-w,w<_){_-=w;do{x[o++]=f[S++]}while(--w);S=o-E,k=x}}else if(d2;)x[o++]=k[S++],x[o++]=k[S++],x[o++]=k[S++],_-=3;_&&(x[o++]=k[S++],_>1&&(x[o++]=k[S++]))}else{S=o-E;do{x[o++]=x[S++],x[o++]=x[S++],x[o++]=x[S++],_-=3}while(_>2);_&&(x[o++]=x[S++],_>1&&(x[o++]=x[S++]))}break}if(64&w){e.msg="invalid distance code",r.mode=30;break e}v=y[(65535&v)+(h&(1<>3,h&=(1<<(p-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=ne.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(mMe(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,fMe(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-iMe&&(fMe(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(fMe(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(fMe(e,!1),e.strm.avail_out),1)})),new wMe(4,4,8,4,bMe),new wMe(4,5,16,8,bMe),new wMe(4,6,32,32,bMe),new wMe(4,4,16,16,vMe),new wMe(8,16,32,32,vMe),new wMe(8,16,128,128,vMe),new wMe(8,32,128,256,vMe),new wMe(32,128,258,1024,vMe),new wMe(32,258,258,4096,vMe)];var AMe=15,xMe=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],IMe=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],BMe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],TMe=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function CMe(e,t,r,n,i,o,s,a){var c,u,l,d,f,h,p,g,y,m=a.bits,b=0,v=0,w=0,_=0,E=0,S=0,k=0,A=0,x=0,I=0,B=null,T=0,C=new lPe(16),O=new lPe(16),R=null,P=0;for(b=0;b<=AMe;b++)C[b]=0;for(v=0;v=1&&0===C[_];_--);if(E>_&&(E=_),0===_)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(w=1;w<_&&0===C[w];w++);for(E0&&(0===e||1!==_))return-1;for(O[1]=0,b=1;b852||2===e&&x>592)return 1;for(;;){p=b-k,s[v]h?(g=R[P+s[v]],y=B[T+s[v]]):(g=96,y=0),c=1<>k)+(u-=c)]=p<<24|g<<16|y}while(0!==u);for(c=1<>=1;if(0!==c?(I&=c-1,I+=c):I=0,v++,0==--C[b]){if(b===_)break;b=t[r+s[v]]}if(b>E&&(I&d)!==l){for(0===k&&(k=E),f+=w,A=1<<(S=b-k);S+k<_&&!((A-=C[S+k])<=0);)S++,A<<=1;if(x+=1<852||2===e&&x>592)return 1;i[l=I&d]=E<<24|S<<16|f-o}}return 0!==I&&(i[f+I]=b-k<<24|64<<16),a.bits=E,0}var OMe=-2,RMe=12,PMe=30;function MMe(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function UMe(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new lPe(320),this.work=new lPe(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function LMe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,function(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new dPe(852),t.distcode=t.distdyn=new dPe(592),t.sane=1,t.back=-1,0):OMe}(e)):OMe}function jMe(e,t){var r,n;return e?(n=new UMe,e.state=n,n.window=null,r=function(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?OMe:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,LMe(e))):OMe}(e,t),0!==r&&(e.state=null),r):OMe}var NMe,zMe,DMe,FMe=!0;function qMe(e){if(FMe){var t;for(NMe=new dPe(512),zMe=new dPe(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(CMe(1,e.lens,0,288,NMe,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;CMe(2,e.lens,0,32,zMe,0,e.work,{bits:5}),FMe=!1}e.lencode=NMe,e.lenbits=9,e.distcode=zMe,e.distbits=5}function HMe(e,t){var r,n,i,o,s,a,c,u,l,d,f,h,p,g,y,m,b,v,w,_,E,S,k,A,x=0,I=new uPe(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return OMe;(r=e.state).mode===RMe&&(r.mode=13),s=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,u=r.hold,l=r.bits,d=a,f=c,S=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;l<16;){if(0===a)break e;a--,u+=n[o++]<>>8&255,r.check=eMe(r.check,I,2,0),u=0,l=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=PMe;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=PMe;break}if(l-=4,E=8+(15&(u>>>=4)),0===r.wbits)r.wbits=E;else if(E>r.wbits){e.msg="invalid window size",r.mode=PMe;break}r.dmax=1<>8&1),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,r.check=eMe(r.check,I,2,0)),u=0,l=0,r.mode=3;case 3:for(;l<32;){if(0===a)break e;a--,u+=n[o++]<>>8&255,I[2]=u>>>16&255,I[3]=u>>>24&255,r.check=eMe(r.check,I,4,0)),u=0,l=0,r.mode=4;case 4:for(;l<16;){if(0===a)break e;a--,u+=n[o++]<>8),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,r.check=eMe(r.check,I,2,0)),u=0,l=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===a)break e;a--,u+=n[o++]<>>8&255,r.check=eMe(r.check,I,2,0)),u=0,l=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((h=r.length)>a&&(h=a),h&&(r.head&&(E=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),cPe(r.head.extra,n,o,h,E)),512&r.flags&&(r.check=eMe(r.check,n,h,o)),a-=h,o+=h,r.length-=h),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===a)break e;h=0;do{E=n[o+h++],r.head&&E&&r.length<65536&&(r.head.name+=String.fromCharCode(E))}while(E&&h>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=RMe;break;case 10:for(;l<32;){if(0===a)break e;a--,u+=n[o++]<>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===a)break e;a--,u+=n[o++]<>>=1)){case 0:r.mode=14;break;case 1:if(qMe(r),r.mode=20,6===t){u>>>=2,l-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=PMe}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===a)break e;a--,u+=n[o++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=PMe;break}if(r.length=65535&u,u=0,l=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(h=r.length){if(h>a&&(h=a),h>c&&(h=c),0===h)break e;cPe(i,n,o,h,s),a-=h,o+=h,c-=h,s+=h,r.length-=h;break}r.mode=RMe;break;case 17:for(;l<14;){if(0===a)break e;a--,u+=n[o++]<>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=PMe;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,l-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,k={bits:r.lenbits},S=CMe(0,r.lens,0,19,r.lencode,0,r.work,k),r.lenbits=k.bits,S){e.msg="invalid code lengths set",r.mode=PMe;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&x,!((y=x>>>24)<=l);){if(0===a)break e;a--,u+=n[o++]<>>=y,l-=y,r.lens[r.have++]=b;else{if(16===b){for(A=y+2;l>>=y,l-=y,0===r.have){e.msg="invalid bit length repeat",r.mode=PMe;break}E=r.lens[r.have-1],h=3+(3&u),u>>>=2,l-=2}else if(17===b){for(A=y+3;l>>=y)),u>>>=3,l-=3}else{for(A=y+7;l>>=y)),u>>>=7,l-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=PMe;break}for(;h--;)r.lens[r.have++]=E}}if(r.mode===PMe)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=PMe;break}if(r.lenbits=9,k={bits:r.lenbits},S=CMe(1,r.lens,0,r.nlen,r.lencode,0,r.work,k),r.lenbits=k.bits,S){e.msg="invalid literal/lengths set",r.mode=PMe;break}if(r.distbits=6,r.distcode=r.distdyn,k={bits:r.distbits},S=CMe(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,k),r.distbits=k.bits,S){e.msg="invalid distances set",r.mode=PMe;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(a>=6&&c>=258){e.next_out=s,e.avail_out=c,e.next_in=o,e.avail_in=a,r.hold=u,r.bits=l,kMe(e,f),s=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,u=r.hold,l=r.bits,r.mode===RMe&&(r.back=-1);break}for(r.back=0;m=(x=r.lencode[u&(1<>>16&255,b=65535&x,!((y=x>>>24)<=l);){if(0===a)break e;a--,u+=n[o++]<>v)])>>>16&255,b=65535&x,!(v+(y=x>>>24)<=l);){if(0===a)break e;a--,u+=n[o++]<>>=v,l-=v,r.back+=v}if(u>>>=y,l-=y,r.back+=y,r.length=b,0===m){r.mode=26;break}if(32&m){r.back=-1,r.mode=RMe;break}if(64&m){e.msg="invalid literal/length code",r.mode=PMe;break}r.extra=15&m,r.mode=22;case 22:if(r.extra){for(A=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;m=(x=r.distcode[u&(1<>>16&255,b=65535&x,!((y=x>>>24)<=l);){if(0===a)break e;a--,u+=n[o++]<>v)])>>>16&255,b=65535&x,!(v+(y=x>>>24)<=l);){if(0===a)break e;a--,u+=n[o++]<>>=v,l-=v,r.back+=v}if(u>>>=y,l-=y,r.back+=y,64&m){e.msg="invalid distance code",r.mode=PMe;break}r.offset=b,r.extra=15&m,r.mode=24;case 24:if(r.extra){for(A=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=PMe;break}r.mode=25;case 25:if(0===c)break e;if(h=f-c,r.offset>h){if((h=r.offset-h)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=PMe;break}h>r.wnext?(h-=r.wnext,p=r.wsize-h):p=r.wnext-h,h>r.length&&(h=r.length),g=r.window}else g=i,p=s-r.offset,h=r.length;h>c&&(h=c),c-=h,r.length-=h;do{i[s++]=g[p++]}while(--h);0===r.length&&(r.mode=21);break;case 26:if(0===c)break e;i[s++]=r.length,c--,r.mode=21;break;case 27:if(r.wrap){for(;l<32;){if(0===a)break e;a--,u|=n[o++]<=o.wsize?(cPe(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),cPe(o.window,t,r-n,i,o.wnext),(n-=i)?(cPe(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave7)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function $Me(e,t){for(var r=0;r15&&(s=2,n-=16),i<1||i>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return cMe(e,rMe);8===n&&(n=9);var a=new _Me;return e.state=a,a.strm=e,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<ZMe.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsZMe.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelZMe.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelZMe.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=ZMe.Z_FILTERED&&e.strategy!=ZMe.Z_HUFFMAN_ONLY&&e.strategy!=ZMe.Z_RLE&&e.strategy!=ZMe.Z_FIXED&&e.strategy!=ZMe.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!age.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new ZMe.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(e,t){r._binding=null,r._hadError=!0;var n=new Error(e);n.errno=t,n.code=WMe[t],r.emit("error",n)};var n=ZMe.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);var i=ZMe.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(i=e.strategy),this._binding.init(e.windowBits||ZMe.Z_DEFAULT_WINDOWBITS,n,e.memLevel||ZMe.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new age(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=i,this.once("end",this.close)}Object.keys(WMe).forEach((function(e){WMe[WMe[e]]=e})),ECe(AUe,GOe),AUe.prototype.params=function(e,t,r){if(eZMe.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=ZMe.Z_FILTERED&&t!=ZMe.Z_HUFFMAN_ONLY&&t!=ZMe.Z_RLE&&t!=ZMe.Z_FIXED&&t!=ZMe.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var n=this;this.flush(ZMe.Z_SYNC_FLUSH,(function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())}))}else dCe.nextTick(r)},AUe.prototype.reset=function(){return this._binding.reset()},AUe.prototype._flush=function(e){this._transform(new age(0),"",e)},AUe.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=ZMe.Z_FULL_FLUSH),r.ended)t&&dCe.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var n=this;this.once("drain",(function(){n.flush(t)}))}else this._flushFlag=e,this.write(new age(0),"",t)},AUe.prototype.close=function(e){if(e&&dCe.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;dCe.nextTick((function(){t.emit("close")}))}},AUe.prototype._transform=function(e,t,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!age.isBuffer(e))return r(new Error("invalid input"));o?n=ZMe.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||ZMe.Z_NO_FLUSH)),this._processChunk(e,n,r)},AUe.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,s=this,a="function"==typeof r;if(!a){var c,u=[],l=0;this.on("error",(function(e){c=e}));do{var d=this._binding.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&p(d[0],d[1]));if(this._hadError)throw c;var f=age.concat(u,l);return this.close(),f}var h=this._binding.write(t,e,o,n,this._buffer,this._offset,i);function p(c,d){if(!s._hadError){var f=i-d;if(function(e,t){if(!e)throw new Error(t)}(f>=0,"have should not go down"),f>0){var h=s._buffer.slice(s._offset,s._offset+f);s._offset+=f,a?s.push(h):(u.push(h),l+=h.length)}if((0===d||s._offset>=s._chunkSize)&&(i=s._chunkSize,s._offset=0,s._buffer=new age(s._chunkSize)),0===d){if(o+=n-c,n=c,!a)return!0;var g=s._binding.write(t,e,o,n,s._buffer,s._offset,s._chunkSize);return g.callback=p,void(g.buffer=e)}if(!a)return!1;r()}}h.buffer=e,h.callback=p},ECe(bUe,AUe),ECe(vUe,AUe),ECe(wUe,AUe),ECe(_Ue,AUe),ECe(EUe,AUe),ECe(SUe,AUe),ECe(kUe,AUe);var xUe={codes:WMe,createDeflate:GMe,createInflate:YMe,createDeflateRaw:JMe,createInflateRaw:XMe,createGzip:QMe,createGunzip:eUe,createUnzip:tUe,deflate:rUe,deflateSync:nUe,gzip:iUe,gzipSync:oUe,deflateRaw:sUe,deflateRawSync:aUe,unzip:cUe,unzipSync:uUe,inflate:lUe,inflateSync:dUe,gunzip:fUe,gunzipSync:hUe,inflateRaw:pUe,inflateRawSync:gUe,Deflate:bUe,Inflate:vUe,Gzip:wUe,Gunzip:_Ue,DeflateRaw:EUe,InflateRaw:SUe,Unzip:kUe,Zlib:AUe},IUe=t(Object.freeze({__proto__:null,codes:WMe,createDeflate:GMe,createInflate:YMe,createDeflateRaw:JMe,createInflateRaw:XMe,createGzip:QMe,createGunzip:eUe,createUnzip:tUe,deflate:rUe,deflateSync:nUe,gzip:iUe,gzipSync:oUe,deflateRaw:sUe,deflateRawSync:aUe,unzip:cUe,unzipSync:uUe,inflate:lUe,inflateSync:dUe,gunzip:fUe,gunzipSync:hUe,inflateRaw:pUe,inflateRawSync:gUe,Deflate:bUe,Inflate:vUe,Gzip:wUe,Gunzip:_Ue,DeflateRaw:EUe,InflateRaw:SUe,Unzip:kUe,Zlib:AUe,default:xUe})),BUe=t(cOe),TUe=t($Re);Object.defineProperty(NTe,"__esModule",{value:!0}),NTe.InvalidStatusCodeError=NTe.InvalidCertError=void 0;const CUe=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class OUe extends Error{constructor(e,t){super(e),this.fingerprint256=t}}NTe.InvalidCertError=OUe;class RUe extends Error{constructor(e){super(`Request Failed. Status Code: ${e}`),this.statusCode=e}}function PUe(e,t){if(!t||"text"===t||"json"===t)try{let r=new TextDecoder("utf8",{fatal:!0}).decode(e);if("text"===t)return r;try{return JSON.parse(r)}catch(e){if("json"===t)throw e;return r}}catch(e){if("text"===t||"json"===t)throw e}return e}NTe.InvalidStatusCodeError=RUe;let MUe={};function UUe(e,t){let r={...CUe,...t};const n=XRe,i=oPe,o=IUe,{promisify:s}=BUe,{resolve:a}=TUe,c=!!/^https/.test(e);let u={method:r.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const l=e=>e.replace(/:| /g,"").toLowerCase();if(r.keepAlive){var d;const e={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},t=[c,c&&(null===(d=r.sslPinnedCertificates)||void 0===d?void 0:d.map((e=>l(e))).sort())].join();u.agent=MUe[t]||(MUe[t]=new(c?i:n).Agent(e))}return"json"===r.type&&(u.headers["Content-Type"]="application/json"),r.data&&(r.method||(u.method="POST"),u.body="json"===r.type?JSON.stringify(r.data):r.data),u.headers={...u.headers,...r.headers},r.sslAllowSelfSigned&&(u.rejectUnauthorized=!1),new Promise(((t,d)=>{var f;const h=async t=>{if(t&&"DEPTH_ZERO_SELF_SIGNED_CERT"===t.code)try{await UUe(e,{...r,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(e){e&&e.fingerprint256&&(t=new OUe(`Self-signed SSL certificate: ${e.fingerprint256}`,e.fingerprint256))}d(t)},p=(c?i:n).request(e,u,(n=>{n.on("error",h),(async()=>{try{t(await(async t=>{const n=t.statusCode;if(r.redirect&&300<=n&&n<400&&t.headers.location){if(10==r._redirectCount)throw new Error("Request failed. Too much redirects.");return r._redirectCount+=1,await UUe(a(e,t.headers.location),r)}if(r.expectStatusCode&&n!==r.expectStatusCode)throw t.resume(),new RUe(n);let i=[];for await(const e of t)i.push(e);let c=age.concat(i);const u=t.headers["content-encoding"];"br"===u&&(c=await s(o.brotliDecompress)(c)),"gzip"!==u&&"deflate"!==u||(c=await s(o.unzip)(c));const l=PUe(c,r.type);return r.full?{headers:t.headers,status:n,body:l}:l})(n))}catch(e){d(e)}})()}));p.on("error",h);const g=null===(f=r.sslPinnedCertificates)||void 0===f?void 0:f.map((e=>l(e))),y=e=>{var t;const r=l((null===(t=e.getPeerCertificate())||void 0===t?void 0:t.fingerprint256)||"");if((r||!e.isSessionReused())&&!g.includes(r))return p.emit("error",new OUe(`Invalid SSL certificate: ${r} Expected: ${g}`,r)),p.abort()};r.sslPinnedCertificates&&p.on("socket",(e=>{const t=e.listeners("secureConnect").map((e=>(e.name||"").replace("bound ",""))).includes("mfetchSecureConnect");t||e.on("secureConnect",y.bind(null,e))})),r.keepAlive&&p.setNoDelay(!0),u.body&&p.write(u.body),p.end()}))}const LUe=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map((e=>e.toLowerCase()))),jUe=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map((e=>e.toLowerCase())));async function NUe(e,t){let r={...CUe,...t};const n=new Headers;"json"===r.type&&n.set("Content-Type","application/json");let i=new URL(e);if(i.username){const e=btoa(`${i.username}:${i.password}`);n.set("Authorization",`Basic ${e}`),i.username="",i.password=""}e=""+i;for(let e in r.headers){const t=e.toLowerCase();(LUe.has(t)||r.cors&&!jUe.has(t))&&n.set(e,r.headers[e])}let o={headers:n,redirect:r.redirect?"follow":"manual"};r.referrer||(o.referrerPolicy="no-referrer"),r.cors&&(o.mode="cors"),r.data&&(r.method||(o.method="POST"),o.body="json"===r.type?JSON.stringify(r.data):r.data);const s=await fetch(e,o);if(r.expectStatusCode&&s.status!==r.expectStatusCode)throw new RUe(s.status);const a=PUe(new Uint8Array(await s.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(s.headers.entries()),status:s.status,body:a}:a}const zUe=!!("object"==typeof process&&process.versions&&process.versions.node&&process.versions.v8);NTe.default=function(e,t){return(zUe?UUe:NUe)(e,t)},Object.defineProperty(jTe,"__esModule",{value:!0}),jTe.getProvider=jTe.fetchFromProvider=void 0;const DUe=NTe;jTe.fetchFromProvider=async(e,t)=>(await(0,DUe.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result,jTe.getProvider=e=>{var t;if("string"==typeof e)return e;if(void 0!==(null==e||null===(t=e.connection)||void 0===t?void 0:t.url))return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.toAscii=t.stripHexPrefix=t.padToEven=t.isHexString=t.isHexPrefixed=t.getKeys=t.getBinarySize=t.fromUtf8=t.fromAscii=t.arrayContainsArray=void 0,n(hxe,t),n(VIe,t),n($Ie,t),n(fTe,t),n(yTe,t),n(ETe,t),n(sTe,t),n(mTe,t),n(OTe,t),n(RTe,t);var i=cTe;Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),n(LTe,t),n(jTe,t)}(fxe);var FUe={},qUe={},HUe={},VUe={},$Ue={};Object.defineProperty($Ue,"__esModule",{value:!0}),$Ue.StructError=void 0;class KUe extends TypeError{constructor(e,t){let r;const{message:n,explanation:i,...o}=e,{path:s}=e,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(null!=i?i:a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!==(n=r)&&void 0!==n?n:r=[e,...t()]}}}$Ue.StructError=KUe;var ZUe={},WUe={};function GUe(e){return"object"==typeof e&&null!==e}function YUe(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function JUe(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:s}=r,{refinement:a,message:c=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${YUe(n)}\``}=e;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...e,message:c}}Object.defineProperty(WUe,"__esModule",{value:!0}),WUe.run=WUe.toFailures=WUe.toFailure=WUe.shiftIterator=WUe.print=WUe.isPlainObject=WUe.isObject=void 0,WUe.isObject=GUe,WUe.isPlainObject=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},WUe.print=YUe,WUe.shiftIterator=function(e){const{done:t,value:r}=e.next();return t?void 0:r},WUe.toFailure=JUe,WUe.toFailures=function*(e,t,r,n){(function(e){return GUe(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const i of e){const e=JUe(i,t,r,n);e&&(yield e)}},WUe.run=function*e(t,r,n={}){const{path:i=[],branch:o=[t],coerce:s=!1,mask:a=!1}=n,c={path:i,branch:o};if(s&&(t=r.coercer(t,c),a&&"type"!==r.type&&GUe(r.schema)&&GUe(t)&&!Array.isArray(t)))for(const e in t)void 0===r.schema[e]&&delete t[e];let u="valid";for(const e of r.validator(t,c))e.explanation=n.message,u="not_valid",yield[e,void 0];for(let[l,d,f]of r.entries(t,c)){const r=e(d,f,{path:void 0===l?i:[...i,l],branch:void 0===l?o:[...o,d],coerce:s,mask:a,message:n.message});for(const e of r)e[0]?(u=null===e[0].refinement||void 0===e[0].refinement?"not_valid":"not_refined",yield[e[0],void 0]):s&&(d=e[1],void 0===l?t=d:t instanceof Map?t.set(l,d):t instanceof Set?t.add(d):GUe(t)&&(void 0!==d||l in t)&&(t[l]=d))}if("not_valid"!==u)for(const e of r.refiner(t,c))e.explanation=n.message,u="not_refined",yield[e,void 0];"valid"===u&&(yield[void 0,t])},Object.defineProperty(ZUe,"__esModule",{value:!0}),ZUe.validate=ZUe.is=ZUe.mask=ZUe.create=ZUe.assert=ZUe.Struct=void 0;const XUe=$Ue,QUe=WUe;function eLe(e,t,r){const n=iLe(e,t,{message:r});if(n[0])throw n[0]}function tLe(e,t,r){const n=iLe(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function rLe(e,t,r){const n=iLe(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function nLe(e,t){return!iLe(e,t)[0]}function iLe(e,t,r={}){const n=(0,QUe.run)(e,t,r),i=(0,QUe.shiftIterator)(n);return i[0]?[new XUe.StructError(i[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,i[1]]}ZUe.Struct=class{constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:o=e=>e,entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(e,t)=>{const r=n(e,t);return(0,QUe.toFailures)(r,t,this,e)}:()=>[],this.refiner=i?(e,t)=>{const r=i(e,t);return(0,QUe.toFailures)(r,t,this,e)}:()=>[]}assert(e,t){return eLe(e,this,t)}create(e,t){return tLe(e,this,t)}is(e){return nLe(e,this)}mask(e,t){return rLe(e,this,t)}validate(e,t={}){return iLe(e,this,t)}},ZUe.assert=eLe,ZUe.create=tLe,ZUe.mask=rLe,ZUe.is=nLe,ZUe.validate=iLe;var oLe,sLe,aLe={},cLe={},uLe={};function lLe(){if(oLe)return uLe;oLe=1,Object.defineProperty(uLe,"__esModule",{value:!0}),uLe.pick=uLe.partial=uLe.omit=uLe.lazy=uLe.dynamic=uLe.deprecated=uLe.define=uLe.assign=void 0;const e=ZUe,t=dLe();return uLe.assign=function(...e){var r;const n="type"===(null===(r=e[0])||void 0===r?void 0:r.type),i=e.map((({schema:e})=>e)),o=Object.assign({},...i);return n?(0,t.type)(o):(0,t.object)(o)},uLe.define=function(t,r){return new e.Struct({type:t,schema:null,validator:r})},uLe.deprecated=function(t,r){return new e.Struct({...t,refiner:(e,r)=>void 0===e||t.refiner(e,r),validator:(e,n)=>void 0===e||(r(e,n),t.validator(e,n))})},uLe.dynamic=function(t){return new e.Struct({type:"dynamic",schema:null,*entries(e,r){const n=t(e,r);yield*n.entries(e,r)},validator:(e,r)=>t(e,r).validator(e,r),coercer:(e,r)=>t(e,r).coercer(e,r),refiner:(e,r)=>t(e,r).refiner(e,r)})},uLe.lazy=function(t){let r;return new e.Struct({type:"lazy",schema:null,*entries(e,n){var i;null!==(i=r)&&void 0!==i||(r=t()),yield*r.entries(e,n)},validator(e,n){var i;return null!==(i=r)&&void 0!==i||(r=t()),r.validator(e,n)},coercer(e,n){var i;return null!==(i=r)&&void 0!==i||(r=t()),r.coercer(e,n)},refiner(e,n){var i;return null!==(i=r)&&void 0!==i||(r=t()),r.refiner(e,n)}})},uLe.omit=function(e,r){const{schema:n}=e,i={...n};for(const e of r)delete i[e];return"type"===e.type?(0,t.type)(i):(0,t.object)(i)},uLe.partial=function(r){const n=r instanceof e.Struct,i=n?{...r.schema}:{...r};for(const e in i)i[e]=(0,t.optional)(i[e]);return n&&"type"===r.type?(0,t.type)(i):(0,t.object)(i)},uLe.pick=function(e,r){const{schema:n}=e,i={};for(const e of r)i[e]=n[e];return"type"===e.type?(0,t.type)(i):(0,t.object)(i)},uLe}function dLe(){if(sLe)return cLe;sLe=1,Object.defineProperty(cLe,"__esModule",{value:!0}),cLe.unknown=cLe.union=cLe.type=cLe.tuple=cLe.string=cLe.set=cLe.regexp=cLe.record=cLe.optional=cLe.object=cLe.number=cLe.nullable=cLe.never=cLe.map=cLe.literal=cLe.intersection=cLe.integer=cLe.instance=cLe.func=cLe.enums=cLe.date=cLe.boolean=cLe.bigint=cLe.array=cLe.any=void 0;const e=ZUe,t=WUe,r=lLe();function n(){return(0,r.define)("never",(()=>!1))}return cLe.any=function(){return(0,r.define)("any",(()=>!0))},cLe.array=function(r){return new e.Struct({type:"array",schema:r,*entries(e){if(r&&Array.isArray(e))for(const[t,n]of e.entries())yield[t,n,r]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${(0,t.print)(e)}`})},cLe.bigint=function(){return(0,r.define)("bigint",(e=>"bigint"==typeof e))},cLe.boolean=function(){return(0,r.define)("boolean",(e=>"boolean"==typeof e))},cLe.date=function(){return(0,r.define)("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${(0,t.print)(e)}`))},cLe.enums=function(r){const n={},i=r.map((e=>(0,t.print)(e))).join();for(const e of r)n[e]=e;return new e.Struct({type:"enums",schema:n,validator:e=>r.includes(e)||`Expected one of \`${i}\`, but received: ${(0,t.print)(e)}`})},cLe.func=function(){return(0,r.define)("func",(e=>"function"==typeof e||`Expected a function, but received: ${(0,t.print)(e)}`))},cLe.instance=function(e){return(0,r.define)("instance",(r=>r instanceof e||`Expected a \`${e.name}\` instance, but received: ${(0,t.print)(r)}`))},cLe.integer=function(){return(0,r.define)("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${(0,t.print)(e)}`))},cLe.intersection=function(t){return new e.Struct({type:"intersection",schema:null,*entries(e,r){for(const{entries:n}of t)yield*n(e,r)},*validator(e,r){for(const{validator:n}of t)yield*n(e,r)},*refiner(e,r){for(const{refiner:n}of t)yield*n(e,r)}})},cLe.literal=function(r){const n=(0,t.print)(r),i=typeof r;return new e.Struct({type:"literal",schema:"string"===i||"number"===i||"boolean"===i?r:null,validator:e=>e===r||`Expected the literal \`${n}\`, but received: ${(0,t.print)(e)}`})},cLe.map=function(r,n){return new e.Struct({type:"map",schema:null,*entries(e){if(r&&n&&e instanceof Map)for(const[t,i]of e.entries())yield[t,t,r],yield[t,i,n]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${(0,t.print)(e)}`})},cLe.never=n,cLe.nullable=function(t){return new e.Struct({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})},cLe.number=function(){return(0,r.define)("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${(0,t.print)(e)}`))},cLe.object=function(r){const i=r?Object.keys(r):[],o=n();return new e.Struct({type:"object",schema:null!=r?r:null,*entries(e){if(r&&(0,t.isObject)(e)){const t=new Set(Object.keys(e));for(const n of i)t.delete(n),yield[n,e[n],r[n]];for(const r of t)yield[r,e[r],o]}},validator:e=>(0,t.isObject)(e)||`Expected an object, but received: ${(0,t.print)(e)}`,coercer:e=>(0,t.isObject)(e)?{...e}:e})},cLe.optional=function(t){return new e.Struct({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})},cLe.record=function(r,n){return new e.Struct({type:"record",schema:null,*entries(e){if((0,t.isObject)(e))for(const t in e){const i=e[t];yield[t,t,r],yield[t,i,n]}},validator:e=>(0,t.isObject)(e)||`Expected an object, but received: ${(0,t.print)(e)}`})},cLe.regexp=function(){return(0,r.define)("regexp",(e=>e instanceof RegExp))},cLe.set=function(r){return new e.Struct({type:"set",schema:null,*entries(e){if(r&&e instanceof Set)for(const t of e)yield[t,t,r]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${(0,t.print)(e)}`})},cLe.string=function(){return(0,r.define)("string",(e=>"string"==typeof e||`Expected a string, but received: ${(0,t.print)(e)}`))},cLe.tuple=function(r){const i=n();return new e.Struct({type:"tuple",schema:null,*entries(e){if(Array.isArray(e)){const t=Math.max(r.length,e.length);for(let n=0;nArray.isArray(e)||`Expected an array, but received: ${(0,t.print)(e)}`})},cLe.type=function(r){const n=Object.keys(r);return new e.Struct({type:"type",schema:r,*entries(e){if((0,t.isObject)(e))for(const t of n)yield[t,e[t],r[t]]},validator:e=>(0,t.isObject)(e)||`Expected an object, but received: ${(0,t.print)(e)}`,coercer:e=>(0,t.isObject)(e)?{...e}:e})},cLe.union=function(r){const n=r.map((e=>e.type)).join(" | ");return new e.Struct({type:"union",schema:null,coercer(e){for(const t of r){const[r,n]=t.validate(e,{coerce:!0});if(!r)return n}return e},validator(e,i){const o=[];for(const n of r){const[...r]=(0,t.run)(e,n,i),[s]=r;if(null==s||!s[0])return[];for(const[e]of r)e&&o.push(e)}return[`Expected the value to satisfy a union of \`${n}\`, but received: ${(0,t.print)(e)}`,...o]}})},cLe.unknown=function(){return(0,r.define)("unknown",(()=>!0))},cLe}Object.defineProperty(aLe,"__esModule",{value:!0}),aLe.trimmed=aLe.defaulted=aLe.coerce=void 0;const fLe=ZUe,hLe=WUe,pLe=dLe();function gLe(e,t,r){return new fLe.Struct({...e,coercer:(n,i)=>(0,fLe.is)(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}aLe.coerce=gLe,aLe.defaulted=function(e,t,r={}){return gLe(e,(0,pLe.unknown)(),(e=>{const n="function"==typeof t?t():t;if(void 0===e)return n;if(!r.strict&&(0,hLe.isPlainObject)(e)&&(0,hLe.isPlainObject)(n)){const t={...e};let r=!1;for(const e in n)void 0===t[e]&&(t[e]=n[e],r=!0);if(r)return t}return e}))},aLe.trimmed=function(e){return gLe(e,(0,pLe.string)(),(e=>e.trim()))};var yLe={};Object.defineProperty(yLe,"__esModule",{value:!0}),yLe.refine=yLe.size=yLe.pattern=yLe.nonempty=yLe.min=yLe.max=yLe.empty=void 0;const mLe=ZUe,bLe=WUe;function vLe(e){return e instanceof Map||e instanceof Set?e.size:e.length}function wLe(e,t,r){return new mLe.Struct({...e,*refiner(n,i){yield*e.refiner(n,i);const o=r(n,i),s=(0,bLe.toFailures)(o,i,e,n);for(const e of s)yield{...e,refinement:t}}})}yLe.empty=function(e){return wLe(e,"empty",(t=>{const r=vLe(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``}))},yLe.max=function(e,t,r={}){const{exclusive:n}=r;return wLe(e,"max",(r=>n?rn?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``))},yLe.nonempty=function(e){return wLe(e,"nonempty",(t=>vLe(t)>0||`Expected a nonempty ${e.type} but received an empty one`))},yLe.pattern=function(e,t){return wLe(e,"pattern",(r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`))},yLe.size=function(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return wLe(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${i} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:o}=e;return t<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}const{length:o}=e;return t<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}))},yLe.refine=wLe,function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n($Ue,t),n(ZUe,t),n(aLe,t),n(yLe,t),n(dLe(),t),n(lLe(),t)}(VUe);var _Le={};class ELe extends Error{constructor(e,{cause:t}={}){super(e),this.name=ELe.name,t&&(this.cause=t),this.message=e}}var SLe=t(Object.freeze({__proto__:null,ErrorWithCause:ELe}));const kLe=e=>{if(e&&"object"==typeof e&&"cause"in e){if("function"==typeof e.cause){const t=e.cause();return t instanceof Error?t:void 0}return e.cause instanceof Error?e.cause:void 0}},ALe=(e,t)=>{if(!(e instanceof Error))return"";const r=e.stack||"";if(t.has(e))return r+"\ncauses have become circular...";const n=kLe(e);return n?(t.add(e),r+"\ncaused by: "+ALe(n,t)):r},xLe=(e,t,r)=>{if(!(e instanceof Error))return"";const n=r?"":e.message||"";if(t.has(e))return n+": ...";const i=kLe(e);if(i){t.add(e);const r="cause"in e&&"function"==typeof e.cause;return n+(r?"":": ")+xLe(i,t,r)}return n};var ILe=Object.freeze({__proto__:null,findCauseByReference:(e,t)=>{if(!e||!t)return;if(!(e instanceof Error))return;if(!(t.prototype instanceof Error)&&t!==Error)return;const r=new Set;let n=e;for(;n&&!r.has(n);){if(r.add(n),n instanceof t)return n;n=kLe(n)}},getErrorCause:kLe,stackWithCauses:e=>ALe(e,new Set),messageWithCauses:e=>xLe(e,new Set)}),BLe=t(ILe);const{ErrorWithCause:TLe}=SLe,{findCauseByReference:CLe,getErrorCause:OLe,messageWithCauses:RLe,stackWithCauses:PLe}=BLe;var MLe={ErrorWithCause:TLe,findCauseByReference:CLe,getErrorCause:OLe,stackWithCauses:PLe,messageWithCauses:RLe},ULe={};!function(e){var t;function r(e){return e.charCodeAt(0)<=127}Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.getKnownPropertyNames=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0,e.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},e.isNullOrUndefined=function(e){return null==e},e.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)},e.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),e.getKnownPropertyNames=function(e){return Object.getOwnPropertyNames(e)},(t=e.JsonSize||(e.JsonSize={}))[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date",e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,e.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},e.isASCII=r,e.calculateStringSize=function(t){var n;return t.split("").reduce(((e,t)=>r(t)?e+1:e+2),0)+(null!==(n=t.match(e.ESCAPE_CHARACTERS_REGEXP))&&void 0!==n?n:[]).length},e.calculateNumberSize=function(e){return e.toString().length}}(ULe),Object.defineProperty(_Le,"__esModule",{value:!0}),_Le.wrapError=_Le.getErrorMessage=_Le.isErrorWithStack=_Le.isErrorWithMessage=_Le.isErrorWithCode=void 0;const LLe=MLe,jLe=ULe;function NLe(e){return"object"==typeof e&&null!==e&&"code"in e}function zLe(e){return"object"==typeof e&&null!==e&&"message"in e}_Le.isErrorWithCode=NLe,_Le.isErrorWithMessage=zLe,_Le.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},_Le.getErrorMessage=function(e){return zLe(e)&&"string"==typeof e.message?e.message:(0,jLe.isNullOrUndefined)(e)?"":String(e)},_Le.wrapError=function(e,t){if(function(e){return e instanceof Error||(0,jLe.isObject)(e)&&"Error"===e.constructor.name}(e)){let r;return r=2===Error.length?new Error(t,{cause:e}):new LLe.ErrorWithCause(t,{cause:e}),NLe(e)&&(r.code=e.code),r}return t.length>0?new Error(`${String(e)}: ${t}`):new Error(String(e))},Object.defineProperty(HUe,"__esModule",{value:!0}),HUe.assertExhaustive=HUe.assertStruct=HUe.assert=HUe.AssertionError=void 0;const DLe=VUe,FLe=_Le;function qLe(e,t){return r=e,Boolean("string"==typeof(null==r||null===(n=r.prototype)||void 0===n||null===(n=n.constructor)||void 0===n?void 0:n.name))?new e({message:t}):e({message:t});var r,n}class HLe extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}HUe.AssertionError=HLe,HUe.assert=function(e,t="Assertion failed.",r=HLe){if(!e){if(t instanceof Error)throw t;throw qLe(r,t)}},HUe.assertStruct=function(e,t,r="Assertion failed",n=HLe){try{(0,DLe.assert)(e,t)}catch(e){throw qLe(n,`${r}: ${function(e){return(0,FLe.getErrorMessage)(e).replace(/\.$/u,"")}(e)}.`)}},HUe.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")};var VLe={};Object.defineProperty(VLe,"__esModule",{value:!0}),VLe.base64=void 0;const $Le=VUe,KLe=HUe;VLe.base64=(e,t={})=>{var r,n;const i=null!==(r=t.paddingRequired)&&void 0!==r&&r,o=null!==(n=t.characterSet)&&void 0!==n?n:"base64";let s,a;return"base64"===o?s=String.raw`[A-Za-z0-9+\/]`:((0,KLe.assert)("base64url"===o),s=String.raw`[-_A-Za-z0-9]`),a=i?new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,$Le.pattern)(e,a)};var ZLe={},WLe={};!function(e){function t(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function r(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function n(...e){const t=e=>e,r=(e,t)=>r=>e(t(r)),n=e.map((e=>e.encode)).reduceRight(r,t),i=e.map((e=>e.decode)).reduce(r,t);return{encode:n,decode:i}}function i(e){return{encode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("alphabet.encode input should be an array of numbers");return r.map((r=>{if(t(r),r<0||r>=e.length)throw new Error(`Digit index outside alphabet: ${r} (alphabet: ${e.length})`);return e[r]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const r=e.indexOf(t);if(-1===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}}function o(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function s(e,r="="){if(t(e),"string"!=typeof r)throw new Error("padding chr should be string");return{encode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;t.length*e%8;)t.push(r);return t},decode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let n=t.length;if(n*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&t[n-1]===r;n--)if(!((n-1)*e%8))throw new Error("Invalid padding: string has too much padding");return t.slice(0,n)}}}function a(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function c(e,r,n){if(r<2)throw new Error(`convertRadix: wrong from=${r}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const o=[],s=Array.from(e);for(s.forEach((e=>{if(t(e),e<0||e>=r)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,t=!0;for(let o=i;ot?u(t,e%t):e,l=(e,t)=>e+(t-u(e,t));function d(e,r,n,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(r<=0||r>32)throw new Error(`convertRadix2: wrong from=${r}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(l(r,n)>32)throw new Error(`convertRadix2: carry overflow from=${r} to=${n} carryBits=${l(r,n)}`);let o=0,s=0;const a=2**n-1,c=[];for(const i of e){if(t(i),i>=2**r)throw new Error(`convertRadix2: invalid data word=${i} from=${r}`);if(o=o<32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${r}`);for(s+=r;s>=n;s-=n)c.push((o>>s-n&a)>>>0);o&=2**s-1}if(o=o<=r)throw new Error("Excess padding");if(!i&&o)throw new Error(`Non-zero padding: ${o}`);return i&&s>0&&c.push(o>>>0),c}function f(e){return t(e),{encode:t=>{if(!r(t))throw new Error("radix.encode input should be Uint8Array");return c(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(c(t,e,256))}}}function h(e,n=!1){if(t(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(l(8,e)>32||l(e,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!r(t))throw new Error("radix2.encode input should be Uint8Array");return d(Array.from(t),8,e,!n)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(d(t,e,8,n))}}}function p(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch(e){}}}function g(e,n){if(t(e),"function"!=typeof n)throw new Error("checksum fn should be function");return{encode(t){if(!r(t))throw new Error("checksum.encode: input should be Uint8Array");const i=n(t).slice(0,e),o=new Uint8Array(t.length+e);return o.set(t),o.set(i,t.length),o},decode(t){if(!r(t))throw new Error("checksum.decode: input should be Uint8Array");const i=t.slice(0,-e),o=n(i).slice(0,e),s=t.slice(-e);for(let t=0;te.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),e.base64=n(h(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s(6),o("")),e.base64nopad=n(h(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),o("")),e.base64url=n(h(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(6),o("")),e.base64urlnopad=n(h(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),o(""));const y=e=>n(f(58),i(e),o(""));e.base58=y("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=y("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=y("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const m=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(t){let r="";for(let n=0;nn(g(4,(e=>t(t(e)))),e.base58),e.base58check=e.createBase58check;const b=n(i("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),v=[996825010,642813549,513874426,1027748829,705979059];function w(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e>e&1)&&(r^=v[e]);return r}function _(e,t,r=1){const n=e.length;let i=1;for(let t=0;t126)throw new Error(`Invalid prefix (${e})`);i=w(i)^r>>5}i=w(i);for(let t=0;tn)throw new TypeError(`Length ${i} exceeds limit ${n}`);const o=e.toLowerCase(),s=_(o,r,t);return`${o}1${b.encode(r)}${s}`}function a(e,r=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==r&&e.length>r)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${r})`);const n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=n.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const o=n.slice(0,i),s=n.slice(i+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const a=b.decode(s).slice(0,-6),c=_(o,a,t);if(!s.endsWith(c))throw new Error(`Invalid checksum in ${e}: expected "${c}"`);return{prefix:o,words:a}}return{encode:s,decode:a,encodeFromBytes:function(e,t){return s(e,i(t))},decodeToBytes:function(e){const{prefix:t,words:r}=a(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:p(a),fromWords:n,fromWordsUnsafe:o,toWords:i}}e.bech32=E("bech32"),e.bech32m=E("bech32m"),e.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},e.hex=n(h(4),i("0123456789abcdef"),o(""),a((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const S={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},k="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";e.bytesToString=(e,t)=>{if("string"!=typeof e||!S.hasOwnProperty(e))throw new TypeError(k);if(!r(t))throw new TypeError("bytesToString() expects Uint8Array");return S[e].encode(t)},e.str=e.bytesToString,e.stringToBytes=(e,t)=>{if(!S.hasOwnProperty(e))throw new TypeError(k);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return S[e].decode(t)},e.bytes=e.stringToBytes}(WLe);var GLe={},YLe={},JLe={};function XLe(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function QLe(e,...t){if(!function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function eje(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");XLe(e.outputLen),XLe(e.blockLen)}function tje(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 rje(e,t){QLe(e);const r=t.outputLen;if(e.length>sje&oje)}:{h:0|Number(e>>sje&oje),l:0|Number(e&oje)}}function cje(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0);ije.toBig=uje;const lje=(e,t,r)=>e>>>r;ije.shrSH=lje;const dje=(e,t,r)=>e<<32-r|t>>>r;ije.shrSL=dje;const fje=(e,t,r)=>e>>>r|t<<32-r;ije.rotrSH=fje;const hje=(e,t,r)=>e<<32-r|t>>>r;ije.rotrSL=hje;const pje=(e,t,r)=>e<<64-r|t>>>r-32;ije.rotrBH=pje;const gje=(e,t,r)=>e>>>r-32|t<<64-r;ije.rotrBL=gje;const yje=(e,t)=>t;ije.rotr32H=yje;const mje=(e,t)=>e;ije.rotr32L=mje;const bje=(e,t,r)=>e<>>32-r;ije.rotlSH=bje;const vje=(e,t,r)=>t<>>32-r;ije.rotlSL=vje;const wje=(e,t,r)=>t<>>64-r;ije.rotlBH=wje;const _je=(e,t,r)=>e<>>64-r;function Eje(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}ije.rotlBL=_je;const Sje=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);ije.add3L=Sje;const kje=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;ije.add3H=kje;const Aje=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);ije.add4L=Aje;const xje=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;ije.add4H=xje;const Ije=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);ije.add5L=Ije;const Bje=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;ije.add5H=Bje;const Tje={fromBig:aje,split:cje,toBig:uje,shrSH:lje,shrSL:dje,rotrSH:fje,rotrSL:hje,rotrBH:pje,rotrBL:gje,rotr32H:yje,rotr32L:mje,rotlSH:bje,rotlSL:vje,rotlBH:wje,rotlBL:_je,add:Eje,add3L:Sje,add3H:kje,add4L:Aje,add4H:xje,add5H:Bje,add5L:Ije};ije.default=Tje;var Cje={},Oje={};Object.defineProperty(Oje,"__esModule",{value:!0}),Oje.crypto=void 0,Oje.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=void 0,e.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},e.byteSwap32=function(t){for(let r=0;r=0&&te().update(a(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},e.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.randomBytes=function(e=32){if(t.crypto&&"function"==typeof t.crypto.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&"function"==typeof t.crypto.randomBytes)return t.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const t=Oje,r=JLe;e.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),e.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),e.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),e.rotr=(e,t)=>e<<32-t|e>>>t,e.rotl=(e,t)=>e<>>32-t>>>0,e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,e.byteSwapIfBE=e.isLE?e=>e:t=>(0,e.byteSwap)(t);const n=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0"))),i={_0:48,_9:57,A:65,F:70,a:97,f:102};function o(e){return e>=i._0&&e<=i._9?e-i._0:e>=i.A&&e<=i.F?e-(i.A-10):e>=i.a&&e<=i.f?e-(i.a-10):void 0}function s(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function a(e){return"string"==typeof e&&(e=s(e)),(0,r.abytes)(e),e}e.nextTick=async()=>{},e.Hash=class{clone(){return this._cloneInto()}}}(Cje),Object.defineProperty(YLe,"__esModule",{value:!0}),YLe.shake256=YLe.shake128=YLe.keccak_512=YLe.keccak_384=YLe.keccak_256=YLe.keccak_224=YLe.sha3_512=YLe.sha3_384=YLe.sha3_256=YLe.sha3_224=YLe.Keccak=void 0,YLe.keccakP=Wje;const Rje=JLe,Pje=ije,Mje=Cje,Uje=[],Lje=[],jje=[],Nje=BigInt(0),zje=BigInt(1),Dje=BigInt(2),Fje=BigInt(7),qje=BigInt(256),Hje=BigInt(113);for(let e=0,t=zje,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Uje.push(2*(5*n+r)),Lje.push((e+1)*(e+2)/2%64);let i=Nje;for(let e=0;e<7;e++)t=(t<>Fje)*Hje)%qje,t&Dje&&(i^=zje<<(zje<r>32?(0,Pje.rotlBH)(e,t,r):(0,Pje.rotlSH)(e,t,r),Zje=(e,t,r)=>r>32?(0,Pje.rotlBL)(e,t,r):(0,Pje.rotlSL)(e,t,r);function Wje(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=Kje(o,s,1)^r[n],c=Zje(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=Lje[r],o=Kje(t,i,n),s=Zje(t,i,n),a=Uje[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=Vje[n],e[1]^=$je[n]}r.fill(0)}class Gje extends Mje.Hash{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Rje.anumber)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Mje.u32)(this.state)}keccak(){Mje.isLE||(0,Mje.byteSwap32)(this.state32),Wje(this.state32,this.rounds),Mje.isLE||(0,Mje.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,Rje.aexists)(this);const{blockLen:t,state:r}=this,n=(e=(0,Mje.toBytes)(e)).length;for(let i=0;i=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,Rje.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,Rje.aoutput)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new Gje(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}YLe.Keccak=Gje;const Yje=(e,t,r)=>(0,Mje.wrapConstructor)((()=>new Gje(t,e,r)));YLe.sha3_224=Yje(6,144,28),YLe.sha3_256=Yje(6,136,32),YLe.sha3_384=Yje(6,104,48),YLe.sha3_512=Yje(6,72,64),YLe.keccak_224=Yje(1,144,28),YLe.keccak_256=Yje(1,136,32),YLe.keccak_384=Yje(1,104,48),YLe.keccak_512=Yje(1,72,64);const Jje=(e,t,r)=>(0,Mje.wrapXOFConstructorWithOpts)(((n={})=>new Gje(t,e,void 0===n.dkLen?r:n.dkLen,!0)));var Xje,Qje;function eNe(){return Xje||(Xje=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.isValidChecksumAddress=e.getChecksumAddress=e.isValidHexAddress=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.HexChecksumAddressStruct=e.HexAddressStruct=e.StrictHexStruct=e.HexStruct=void 0;const t=VUe,r=YLe,n=HUe,i=tNe();function o(r){return(0,t.is)(r,e.HexStruct)}function s(r){return(0,t.is)(r,e.StrictHexStruct)}function a(o){(0,n.assert)((0,t.is)(o,e.HexChecksumAddressStruct),"Invalid hex address.");const s=u(o.toLowerCase()),a=u((0,i.bytesToHex)((0,r.keccak_256)(s)));return`0x${s.split("").map(((e,r)=>{const i=a[r];return(0,n.assert)((0,t.is)(i,(0,t.string)()),"Hash shorter than address."),parseInt(i,16)>7?e.toUpperCase():e})).join("")}`}function c(r){return!!(0,t.is)(r,e.HexChecksumAddressStruct)&&a(r)===r}function u(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu),e.HexAddressStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]{40}$/u),e.HexChecksumAddressStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-fA-F]{40}$/u),e.isHexString=o,e.isStrictHexString=s,e.assertIsHexString=function(e){(0,n.assert)(o(e),"Value must be a hexadecimal string.")},e.assertIsStrictHexString=function(e){(0,n.assert)(s(e),'Value must be a hexadecimal string, starting with "0x".')},e.isValidHexAddress=function(r){return(0,t.is)(r,e.HexAddressStruct)||c(r)},e.getChecksumAddress=a,e.isValidChecksumAddress=c,e.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},e.remove0x=u}(GLe)),GLe}function tNe(){if(Qje)return ZLe;Qje=1,Object.defineProperty(ZLe,"__esModule",{value:!0}),ZLe.createDataView=ZLe.concatBytes=ZLe.valueToBytes=ZLe.base64ToBytes=ZLe.stringToBytes=ZLe.numberToBytes=ZLe.signedBigIntToBytes=ZLe.bigIntToBytes=ZLe.hexToBytes=ZLe.bytesToBase64=ZLe.bytesToString=ZLe.bytesToNumber=ZLe.bytesToSignedBigInt=ZLe.bytesToBigInt=ZLe.bytesToHex=ZLe.assertIsBytes=ZLe.isBytes=void 0;const e=WLe,t=HUe,r=eNe(),n=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function i(e){return e instanceof Uint8Array}function o(e){(0,t.assert)(i(e),"Value must be a Uint8Array.")}function s(e){if(o(e),0===e.length)return"0x";const t=n(),i=new Array(e.length);for(let r=0;r=BigInt(0),"Value must be a non-negative bigint."),c(e.toString(16))}function l(e){return(0,t.assert)("number"==typeof e,"Value must be a number."),(0,t.assert)(e>=0,"Value must be a non-negative number."),(0,t.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),c(e.toString(16))}function d(e){return(0,t.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function f(e){if("bigint"==typeof e)return u(e);if("number"==typeof e)return l(e);if("string"==typeof e)return e.startsWith("0x")?c(e):d(e);if(i(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}return ZLe.isBytes=i,ZLe.assertIsBytes=o,ZLe.bytesToHex=s,ZLe.bytesToBigInt=a,ZLe.bytesToSignedBigInt=function(e){o(e);let t=BigInt(0);for(const r of e)t=(t<0,"Byte length must be greater than 0."),(0,t.assert)(function(e,r){(0,t.assert)(r>0);const n=e>>BigInt(31);return!((~e&n)+(e&~n)>>BigInt(8*r-1))}(e,r),"Byte length is too small to represent the given value.");let n=e;const i=new Uint8Array(r);for(let e=0;e>=BigInt(8);return i.reverse()},ZLe.numberToBytes=l,ZLe.stringToBytes=d,ZLe.base64ToBytes=function(r){return(0,t.assert)("string"==typeof r,"Value must be a string."),e.base64.decode(r)},ZLe.valueToBytes=f,ZLe.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})$/u,e.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,e.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,e.CAIP_ACCOUNT_ID_REGEX=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})):(?[-.%a-zA-Z0-9]{1,128})$/u,e.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,e.CAIP_ASSET_TYPE_REGEX=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32}))\/(?[-a-z0-9]{3,8}):(?[-.%a-zA-Z0-9]{1,128})$/u,e.CAIP_ASSET_ID_REGEX=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32}))\/(?[-a-z0-9]{3,8}):(?[-.%a-zA-Z0-9]{1,128})\/(?[-.%a-zA-Z0-9]{1,78})$/u,e.CaipChainIdStruct=(0,t.pattern)((0,t.string)(),e.CAIP_CHAIN_ID_REGEX),e.CaipNamespaceStruct=(0,t.pattern)((0,t.string)(),e.CAIP_NAMESPACE_REGEX),e.CaipReferenceStruct=(0,t.pattern)((0,t.string)(),e.CAIP_REFERENCE_REGEX),e.CaipAccountIdStruct=(0,t.pattern)((0,t.string)(),e.CAIP_ACCOUNT_ID_REGEX),e.CaipAccountAddressStruct=(0,t.pattern)((0,t.string)(),e.CAIP_ACCOUNT_ADDRESS_REGEX),e.CaipAssetTypeStruct=(0,t.pattern)((0,t.string)(),e.CAIP_ASSET_TYPE_REGEX),e.CaipAssetIdStruct=(0,t.pattern)((0,t.string)(),e.CAIP_ASSET_ID_REGEX),(r=e.KnownCaipNamespace||(e.KnownCaipNamespace={})).Bip122="bip122",r.Eip155="eip155",r.Wallet="wallet",e.isCaipChainId=function(r){return(0,t.is)(r,e.CaipChainIdStruct)},e.isCaipNamespace=n,e.isCaipReference=i,e.isCaipAccountId=function(r){return(0,t.is)(r,e.CaipAccountIdStruct)},e.isCaipAccountAddress=function(r){return(0,t.is)(r,e.CaipAccountAddressStruct)},e.isCaipAssetType=function(r){return(0,t.is)(r,e.CaipAssetTypeStruct)},e.isCaipAssetId=function(r){return(0,t.is)(r,e.CaipAssetIdStruct)},e.parseCaipChainId=function(t){const r=e.CAIP_CHAIN_ID_REGEX.exec(t);if(null==r||!r.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:r.groups.namespace,reference:r.groups.reference}},e.parseCaipAccountId=function(t){const r=e.CAIP_ACCOUNT_ID_REGEX.exec(t);if(null==r||!r.groups)throw new Error("Invalid CAIP account ID.");return{address:r.groups.accountAddress,chainId:r.groups.chainId,chain:{namespace:r.groups.namespace,reference:r.groups.reference}}},e.toCaipChainId=function(t,r){if(!n(t))throw new Error(`Invalid "namespace", must match: ${e.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(r))throw new Error(`Invalid "reference", must match: ${e.CAIP_REFERENCE_REGEX.toString()}`);return`${t}:${r}`}}(rNe);var nNe={};Object.defineProperty(nNe,"__esModule",{value:!0}),nNe.ChecksumStruct=void 0;const iNe=VUe,oNe=VLe;nNe.ChecksumStruct=(0,iNe.size)((0,oNe.base64)((0,iNe.string)(),{paddingRequired:!0}),44,44);var sNe={};Object.defineProperty(sNe,"__esModule",{value:!0}),sNe.createHex=sNe.createBytes=sNe.createBigInt=sNe.createNumber=void 0;const aNe=VUe,cNe=HUe,uNe=tNe(),lNe=eNe(),dNe=(0,aNe.union)([(0,aNe.number)(),(0,aNe.bigint)(),(0,aNe.string)(),lNe.StrictHexStruct]),fNe=(0,aNe.coerce)((0,aNe.number)(),dNe,Number),hNe=(0,aNe.coerce)((0,aNe.bigint)(),dNe,BigInt);(0,aNe.union)([lNe.StrictHexStruct,(0,aNe.instance)(Uint8Array)]);const pNe=(0,aNe.coerce)((0,aNe.instance)(Uint8Array),(0,aNe.union)([lNe.StrictHexStruct]),uNe.hexToBytes),gNe=(0,aNe.coerce)(lNe.StrictHexStruct,(0,aNe.instance)(Uint8Array),uNe.bytesToHex);sNe.createNumber=function(e){try{const t=(0,aNe.create)(e,fNe);return(0,cNe.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof aNe.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},sNe.createBigInt=function(e){try{return(0,aNe.create)(e,hNe)}catch(e){if(e instanceof aNe.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},sNe.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,aNe.create)(e,pNe)}catch(e){if(e instanceof aNe.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},sNe.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,aNe.create)(e,gNe)}catch(e){if(e instanceof aNe.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}};var yNe,mNe,bNe={},vNe=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},wNe=e&&e.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};Object.defineProperty(bNe,"__esModule",{value:!0}),bNe.FrozenSet=bNe.FrozenMap=void 0;class _Ne{get size(){return vNe(this,yNe,"f").size}[(yNe=new WeakMap,Symbol.iterator)](){return vNe(this,yNe,"f")[Symbol.iterator]()}constructor(e){yNe.set(this,void 0),wNe(this,yNe,new Map(e),"f"),Object.freeze(this)}entries(){return vNe(this,yNe,"f").entries()}forEach(e,t){return vNe(this,yNe,"f").forEach(((r,n,i)=>e.call(t,r,n,this)))}get(e){return vNe(this,yNe,"f").get(e)}has(e){return vNe(this,yNe,"f").has(e)}keys(){return vNe(this,yNe,"f").keys()}values(){return vNe(this,yNe,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}bNe.FrozenMap=_Ne;class ENe{get size(){return vNe(this,mNe,"f").size}[(mNe=new WeakMap,Symbol.iterator)](){return vNe(this,mNe,"f")[Symbol.iterator]()}constructor(e){mNe.set(this,void 0),wNe(this,mNe,new Set(e),"f"),Object.freeze(this)}entries(){return vNe(this,mNe,"f").entries()}forEach(e,t){return vNe(this,mNe,"f").forEach(((r,n,i)=>e.call(t,r,n,this)))}has(e){return vNe(this,mNe,"f").has(e)}keys(){return vNe(this,mNe,"f").keys()}values(){return vNe(this,mNe,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}bNe.FrozenSet=ENe,Object.freeze(_Ne),Object.freeze(_Ne.prototype),Object.freeze(ENe),Object.freeze(ENe.prototype);var SNe={};Object.defineProperty(SNe,"__esModule",{value:!0});var kNe={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.getSafeJson=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=e.exactOptional=e.object=void 0;const t=VUe,r=HUe,n=ULe;function i({path:e,branch:t}){const r=e[e.length-1];return(0,n.hasProperty)(t[t.length-2],r)}function o(e){return new t.Struct({...e,type:`optional ${e.type}`,validator:(t,r)=>!i(r)||e.validator(t,r),refiner:(t,r)=>!i(r)||e.refiner(t,r)})}function s(r){return(0,t.create)(r,e.JsonStruct)}e.object=e=>(0,t.object)(e),e.exactOptional=o,e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),(0,t.define)("finite number",(e=>(0,t.is)(e,(0,t.number)())&&Number.isFinite(e))),(0,t.string)(),(0,t.array)((0,t.lazy)((()=>e.UnsafeJsonStruct))),(0,t.record)((0,t.string)(),(0,t.lazy)((()=>e.UnsafeJsonStruct)))]),e.JsonStruct=(0,t.coerce)(e.UnsafeJsonStruct,(0,t.any)(),(t=>((0,r.assertStruct)(t,e.UnsafeJsonStruct),JSON.parse(JSON.stringify(t,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t})))))),e.isValidJson=function(e){try{return s(e),!0}catch{return!1}},e.getSafeJson=s,e.getJsonSize=function(t){(0,r.assertStruct)(t,e.JsonStruct,"Invalid JSON value");const n=JSON.stringify(t);return(new TextEncoder).encode(n).byteLength},e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,e.object)({code:(0,t.integer)(),message:(0,t.string)(),data:o(e.JsonStruct),stack:o((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)]),e.JsonRpcRequestStruct=(0,e.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:o(e.JsonRpcParamsStruct)}),e.JsonRpcNotificationStruct=(0,e.object)({jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:o(e.JsonRpcParamsStruct)}),e.isJsonRpcNotification=function(r){return(0,t.is)(r,e.JsonRpcNotificationStruct)},e.assertIsJsonRpcNotification=function(t,n){(0,r.assertStruct)(t,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",n)},e.isJsonRpcRequest=function(r){return(0,t.is)(r,e.JsonRpcRequestStruct)},e.assertIsJsonRpcRequest=function(t,n){(0,r.assertStruct)(t,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",n)},e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,e.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,e.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]),e.isPendingJsonRpcResponse=function(r){return(0,t.is)(r,e.PendingJsonRpcResponseStruct)},e.assertIsPendingJsonRpcResponse=function(t,n){(0,r.assertStruct)(t,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",n)},e.isJsonRpcResponse=function(r){return(0,t.is)(r,e.JsonRpcResponseStruct)},e.assertIsJsonRpcResponse=function(t,n){(0,r.assertStruct)(t,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",n)},e.isJsonRpcSuccess=function(r){return(0,t.is)(r,e.JsonRpcSuccessStruct)},e.assertIsJsonRpcSuccess=function(t,n){(0,r.assertStruct)(t,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",n)},e.isJsonRpcFailure=function(r){return(0,t.is)(r,e.JsonRpcFailureStruct)},e.assertIsJsonRpcFailure=function(t,n){(0,r.assertStruct)(t,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",n)},e.isJsonRpcError=function(r){return(0,t.is)(r,e.JsonRpcErrorStruct)},e.assertIsJsonRpcError=function(t,n){(0,r.assertStruct)(t,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",n)},e.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}}(kNe);var ANe={};Object.defineProperty(ANe,"__esModule",{value:!0});var xNe,INe,BNe={},TNe={exports:{}};function CNe(){if(INe)return xNe;INe=1;var e=1e3,t=60*e,r=60*t,n=24*r,i=7*n,o=365.25*n;function s(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}return xNe=function(a,c){c=c||{};var u=typeof a;if("string"===u&&a.length>0)return function(s){if(!((s=String(s)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(a){var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*n;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}(a);if("number"===u&&isFinite(a))return c.long?function(i){var o=Math.abs(i);return o>=n?s(i,o,n,"day"):o>=r?s(i,o,r,"hour"):o>=t?s(i,o,t,"minute"):o>=e?s(i,o,e,"second"):i+" ms"}(a):function(i){var o=Math.abs(i);return o>=n?Math.round(i/n)+"d":o>=r?Math.round(i/r)+"h":o>=t?Math.round(i/t)+"m":o>=e?Math.round(i/e)+"s":i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},xNe}var ONe=function(e){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,i=-1,o=0;for(;r"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(n(e,r))return!1;for(const r of t.names)if(n(e,r))return!0;return!1},t.humanize=CNe(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=ONe(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(TNe,TNe.exports);var RNe=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(BNe,"__esModule",{value:!0}),BNe.createModuleLogger=BNe.createProjectLogger=void 0;const PNe=(0,RNe(TNe.exports).default)("metamask");BNe.createProjectLogger=function(e){return PNe.extend(e)},BNe.createModuleLogger=function(e,t){return e.extend(t)};var MNe={};Object.defineProperty(MNe,"__esModule",{value:!0}),MNe.hexToBigInt=MNe.hexToNumber=MNe.bigIntToHex=MNe.numberToHex=void 0;const UNe=HUe,LNe=eNe();MNe.numberToHex=e=>((0,UNe.assert)("number"==typeof e,"Value must be a number."),(0,UNe.assert)(e>=0,"Value must be a non-negative number."),(0,UNe.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,LNe.add0x)(e.toString(16))),MNe.bigIntToHex=e=>((0,UNe.assert)("bigint"==typeof e,"Value must be a bigint."),(0,UNe.assert)(e>=0,"Value must be a non-negative bigint."),(0,LNe.add0x)(e.toString(16))),MNe.hexToNumber=e=>{(0,LNe.assertIsHexString)(e);const t=parseInt(e,16);return(0,UNe.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t},MNe.hexToBigInt=e=>((0,LNe.assertIsHexString)(e),BigInt((0,LNe.add0x)(e)));var jNe={};Object.defineProperty(jNe,"__esModule",{value:!0});var NNe={};Object.defineProperty(NNe,"__esModule",{value:!0}),NNe.createDeferredPromise=void 0,NNe.createDeferredPromise=function({suppressUnhandledRejection:e=!1}={}){let t,r;const n=new Promise(((e,n)=>{t=e,r=n}));return e&&n.catch((e=>{})),{promise:n,resolve:t,reject:r}};var zNe={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,(t=e.Duration||(e.Duration={}))[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year";const r=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};e.inMilliseconds=function(e,t){return r(e,"count"),e*t},e.timeSince=function(e){return r(e,"timestamp"),Date.now()-e}}(zNe);var DNe={};Object.defineProperty(DNe,"__esModule",{value:!0});var FNe={},qNe={exports:{}},HNe={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},VNe="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=HNe,o=VNe,s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],u=t.t={};let l=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[d,n]],h=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=l++;o(e,i,t),u[e]=i,c[i]=t,s[i]=new RegExp(t,r?"g":void 0),a[i]=new RegExp(n,r?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),h("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${d}+`),h("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h("FULL",`^${c[u.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h("LOOSE",`^${c[u.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),h("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?`+`(?:${c[u.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",c[u.COERCE],!0),h("COERCERTLFULL",c[u.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(qNe,qNe.exports);const $Ne=Object.freeze({loose:!0}),KNe=Object.freeze({});var ZNe=e=>e?"object"!=typeof e?$Ne:e:KNe;const WNe=/^[0-9]+$/,GNe=(e,t)=>{const r=WNe.test(e),n=WNe.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:eGNe(t,e)};const JNe=VNe,{MAX_LENGTH:XNe,MAX_SAFE_INTEGER:QNe}=HNe,{safeRe:eze,t:tze}=qNe.exports,rze=ZNe,{compareIdentifiers:nze}=YNe;class ize{constructor(e,t){if(t=rze(t),e instanceof ize){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>XNe)throw new TypeError(`version is longer than ${XNe} characters`);JNe("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?eze[tze.LOOSE]:eze[tze.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>QNe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>QNe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>QNe||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===nze(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}var oze=ize;const sze=oze;var aze=(e,t,r=!1)=>{if(e instanceof sze)return e;try{return new sze(e,t)}catch(e){if(!r)return null;throw e}};const cze=aze;var uze=(e,t)=>{const r=cze(e,t);return r?r.version:null};const lze=aze;var dze=(e,t)=>{const r=lze(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};const fze=oze;var hze=(e,t,r,n,i)=>{"string"==typeof r&&(i=n,n=r,r=void 0);try{return new fze(e instanceof fze?e.version:e,r).inc(t,n,i).version}catch(e){return null}};const pze=aze;var gze=(e,t)=>{const r=pze(e,null,!0),n=pze(t,null,!0),i=r.compare(n);if(0===i)return null;const o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(a.prerelease.length&&!c)return a.patch||a.minor?s.patch?"patch":s.minor?"minor":"major":"major";const u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};const yze=oze;var mze=(e,t)=>new yze(e,t).major;const bze=oze;var vze=(e,t)=>new bze(e,t).minor;const wze=oze;var _ze=(e,t)=>new wze(e,t).patch;const Eze=aze;var Sze=(e,t)=>{const r=Eze(e,t);return r&&r.prerelease.length?r.prerelease:null};const kze=oze;var Aze=(e,t,r)=>new kze(e,r).compare(new kze(t,r));const xze=Aze;var Ize=(e,t,r)=>xze(t,e,r);const Bze=Aze;var Tze=(e,t)=>Bze(e,t,!0);const Cze=oze;var Oze=(e,t,r)=>{const n=new Cze(e,r),i=new Cze(t,r);return n.compare(i)||n.compareBuild(i)};const Rze=Oze;var Pze=(e,t)=>e.sort(((e,r)=>Rze(e,r,t)));const Mze=Oze;var Uze=(e,t)=>e.sort(((e,r)=>Mze(r,e,t)));const Lze=Aze;var jze=(e,t,r)=>Lze(e,t,r)>0;const Nze=Aze;var zze=(e,t,r)=>Nze(e,t,r)<0;const Dze=Aze;var Fze=(e,t,r)=>0===Dze(e,t,r);const qze=Aze;var Hze=(e,t,r)=>0!==qze(e,t,r);const Vze=Aze;var $ze=(e,t,r)=>Vze(e,t,r)>=0;const Kze=Aze;var Zze=(e,t,r)=>Kze(e,t,r)<=0;const Wze=Fze,Gze=Hze,Yze=jze,Jze=$ze,Xze=zze,Qze=Zze;var eDe=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return Wze(e,r,n);case"!=":return Gze(e,r,n);case">":return Yze(e,r,n);case">=":return Jze(e,r,n);case"<":return Xze(e,r,n);case"<=":return Qze(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};const tDe=oze,rDe=aze,{safeRe:nDe,t:iDe}=qNe.exports;var oDe,sDe,aDe,cDe,uDe=(e,t)=>{if(e instanceof tDe)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?nDe[iDe.COERCERTLFULL]:nDe[iDe.COERCERTL];let i;for(;(i=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),n.lastIndex=i.index+i[1].length+i[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?nDe[iDe.COERCEFULL]:nDe[iDe.COERCE]);if(null===r)return null;const n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return rDe(`${n}.${i}.${o}${s}${a}`,t)},lDe=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};function dDe(){if(sDe)return oDe;sDe=1;const e=/\s+/g;class t{constructor(r,o){if(o=n(o),r instanceof t)return r.loose===!!o.loose&&r.includePrerelease===!!o.includePrerelease?r:new t(r.raw,o);if(r instanceof i)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=r.trim().replace(e," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!p(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&h))+":"+e,n=r.get(t);if(n)return n;const s=this.options.loose,g=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(g,I(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],u),o("comparator trim",e),e=e.replace(a[c.TILDETRIM],l),o("tilde trim",e),e=e.replace(a[c.CARETTRIM],d),o("caret trim",e);let y=e.split(" ").map((e=>m(e,this.options))).join(" ").split(/\s+/).map((e=>x(e,this.options)));s&&(y=y.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),o("range list",y);const b=new Map,v=y.map((e=>new i(e,this.options)));for(const e of v){if(p(e))return[e];b.set(e.value,e)}b.size>1&&b.has("")&&b.delete("");const w=[...b.values()];return r.set(t,w),w}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>y(t,r)&&e.set.some((e=>y(e,r)&&t.every((t=>e.every((e=>t.intersects(e,r)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,g=e=>""===e.value,y=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},m=(e,t)=>(o("comp",e,t),e=_(e,t),o("caret",e),e=v(e,t),o("tildes",e),e=S(e,t),o("xrange",e),e=A(e,t),o("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{const r=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(r,((t,r,n,i,s)=>{let a;return o("tilde",e,t,r,n,i,s),b(r)?a="":b(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:b(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${r}.${n}.${i}-${s} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,o("tilde return",a),a}))},_=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{o("caret",e,t);const r=t.loose?a[c.CARETLOOSE]:a[c.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,s,a)=>{let c;return o("caret",e,t,r,i,s,a),b(r)?c="":b(i)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:b(s)?c="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===r?"0"===i?`>=${r}.${i}.${s}-${a} <${r}.${i}.${+s+1}-0`:`>=${r}.${i}.${s}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${s}-${a} <${+r+1}.0.0-0`):(o("no pr"),c="0"===r?"0"===i?`>=${r}.${i}.${s}${n} <${r}.${i}.${+s+1}-0`:`>=${r}.${i}.${s}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${s} <${+r+1}.0.0-0`),o("caret return",c),c}))},S=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>k(e,t))).join(" ")),k=(e,t)=>{e=e.trim();const r=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(r,((r,n,i,s,a,c)=>{o("xRange",e,r,n,i,s,a,c);const u=b(i),l=u||b(s),d=l||b(a),f=d;return"="===n&&f&&(n=""),c=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(l&&(s=0),a=0,">"===n?(n=">=",l?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===n&&(n="<",l?i=+i+1:s=+s+1),"<"===n&&(c="-0"),r=`${n+i}.${s}.${a}${c}`):l?r=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",r),r}))},A=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),x=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),I=e=>(t,r,n,i,o,s,a,c,u,l,d,f)=>`${r=b(n)?"":b(i)?`>=${n}.0.0${e?"-0":""}`:b(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=b(u)?"":b(l)?`<${+u+1}.0.0-0`:b(d)?`<${u}.${+l+1}.0-0`:f?`<=${u}.${l}.${d}-${f}`:e?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim(),B=(e,t,r)=>{for(let r=0;r0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return oDe}function fDe(){if(cDe)return aDe;cDe=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(n,i){if(i=r(i),n instanceof t){if(n.loose===!!i.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),s("comparator",n,i),this.options=i,this.loose=!!i.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const r=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],o=t.match(r);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,n).test(e.semver):!((n=r(n)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(o(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(o(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}aDe=t;const r=ZNe,{safeRe:n,t:i}=qNe.exports,o=eDe,s=VNe,a=oze,c=dDe();return aDe}const hDe=dDe();var pDe=(e,t,r)=>{try{t=new hDe(t,r)}catch(e){return!1}return t.test(e)};const gDe=dDe();var yDe=(e,t)=>new gDe(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const mDe=oze,bDe=dDe();var vDe=(e,t,r)=>{let n=null,i=null,o=null;try{o=new bDe(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(n&&-1!==i.compare(e)||(n=e,i=new mDe(n,r)))})),n};const wDe=oze,_De=dDe();var EDe=(e,t,r)=>{let n=null,i=null,o=null;try{o=new _De(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(n&&1!==i.compare(e)||(n=e,i=new wDe(n,r)))})),n};const SDe=oze,kDe=dDe(),ADe=jze;var xDe=(e,t)=>{e=new kDe(e,t);let r=new SDe("0.0.0");if(e.test(r))return r;if(r=new SDe("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t{const t=new SDe(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!ADe(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||r&&!ADe(r,i)||(r=i)}return r&&e.test(r)?r:null};const IDe=dDe();var BDe=(e,t)=>{try{return new IDe(e,t).range||"*"}catch(e){return null}};const TDe=oze,CDe=fDe(),{ANY:ODe}=CDe,RDe=dDe(),PDe=pDe,MDe=jze,UDe=zze,LDe=Zze,jDe=$ze;var NDe=(e,t,r,n)=>{let i,o,s,a,c;switch(e=new TDe(e,n),t=new RDe(t,n),r){case">":i=MDe,o=LDe,s=UDe,a=">",c=">=";break;case"<":i=UDe,o=jDe,s=MDe,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(PDe(e,t,n))return!1;for(let r=0;r{e.semver===ODe&&(e=new CDe(">=0.0.0")),l=l||e,d=d||e,i(e.semver,l.semver,n)?l=e:s(e.semver,d.semver,n)&&(d=e)})),l.operator===a||l.operator===c)return!1;if((!d.operator||d.operator===a)&&o(e,d.semver))return!1;if(d.operator===c&&s(e,d.semver))return!1}return!0};const zDe=NDe;var DDe=(e,t,r)=>zDe(e,t,">",r);const FDe=NDe;var qDe=(e,t,r)=>FDe(e,t,"<",r);const HDe=dDe();var VDe=(e,t,r)=>(e=new HDe(e,r),t=new HDe(t,r),e.intersects(t,r));const $De=pDe,KDe=Aze,ZDe=dDe(),WDe=fDe(),{ANY:GDe}=WDe,YDe=pDe,JDe=Aze,XDe=[new WDe(">=0.0.0-0")],QDe=[new WDe(">=0.0.0")],eFe=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===GDe){if(1===t.length&&t[0].semver===GDe)return!0;e=r.includePrerelease?XDe:QDe}if(1===t.length&&t[0].semver===GDe){if(r.includePrerelease)return!0;t=QDe}const n=new Set;let i,o,s,a,c,u,l;for(const t of e)">"===t.operator||">="===t.operator?i=tFe(i,t,r):"<"===t.operator||"<="===t.operator?o=rFe(o,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&o){if(s=JDe(i.semver,o.semver,r),s>0)return null;if(0===s&&(">="!==i.operator||"<="!==o.operator))return null}for(const e of n){if(i&&!YDe(e,String(i),r))return null;if(o&&!YDe(e,String(o),r))return null;for(const n of t)if(!YDe(e,String(n),r))return!1;return!0}let d=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver,f=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;d&&1===d.prerelease.length&&"<"===o.operator&&0===d.prerelease[0]&&(d=!1);for(const e of t){if(l=l||">"===e.operator||">="===e.operator,u=u||"<"===e.operator||"<="===e.operator,i)if(f&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===f.major&&e.semver.minor===f.minor&&e.semver.patch===f.patch&&(f=!1),">"===e.operator||">="===e.operator){if(a=tFe(i,e,r),a===e&&a!==i)return!1}else if(">="===i.operator&&!YDe(i.semver,String(e),r))return!1;if(o)if(d&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===d.major&&e.semver.minor===d.minor&&e.semver.patch===d.patch&&(d=!1),"<"===e.operator||"<="===e.operator){if(c=rFe(o,e,r),c===e&&c!==o)return!1}else if("<="===o.operator&&!YDe(o.semver,String(e),r))return!1;if(!e.operator&&(o||i)&&0!==s)return!1}return!(i&&u&&!o&&0!==s||o&&l&&!i&&0!==s||f||d)},tFe=(e,t,r)=>{if(!e)return t;const n=JDe(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},rFe=(e,t,r)=>{if(!e)return t;const n=JDe(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};var nFe=(e,t,r={})=>{if(e===t)return!0;e=new ZDe(e,r),t=new ZDe(t,r);let n=!1;e:for(const i of e.set){for(const e of t.set){const t=eFe(i,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0};const iFe=qNe.exports,oFe=HNe,sFe=oze,aFe=YNe,cFe=(e,t,r)=>{const n=[];let i=null,o=null;const s=e.sort(((e,t)=>KDe(e,t,r)));for(const e of s)$De(e,t,r)?(o=e,i||(i=e)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);const a=[];for(const[e,t]of n)e===t?a.push(e):t||e!==s[0]?t?e===s[0]?a.push(`<=${t}`):a.push(`${e} - ${t}`):a.push(`>=${e}`):a.push("*");const c=a.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return c.lengthnull!==(0,r.valid)(e)||`Expected SemVer version, got "${e}"`)),e.VersionRangeStruct=(0,t.refine)((0,t.string)(),"Version range",(e=>null!==(0,r.validRange)(e)||`Expected SemVer range, got "${e}"`)),e.isValidSemVerVersion=function(r){return(0,t.is)(r,e.VersionStruct)},e.isValidSemVerRange=function(r){return(0,t.is)(r,e.VersionRangeStruct)},e.assertIsSemVerVersion=function(t){(0,n.assertStruct)(t,e.VersionStruct)},e.assertIsSemVerRange=function(t){(0,n.assertStruct)(t,e.VersionRangeStruct)},e.gtVersion=function(e,t){return(0,r.gt)(e,t)},e.gtRange=function(e,t){return(0,r.gtr)(e,t)},e.satisfiesVersionRange=function(e,t){return(0,r.satisfies)(e,t,{includePrerelease:!0})}}(FNe),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(HUe,t),n(VLe,t),n(tNe(),t),n(rNe,t),n(nNe,t),n(sNe,t),n(bNe,t),n(SNe,t),n(_Le,t),n(eNe(),t),n(kNe,t),n(ANe,t),n(BNe,t),n(ULe,t),n(MNe,t),n(jNe,t),n(NNe,t),n(zNe,t),n(DNe,t),n(FNe,t)}(qUe),Object.defineProperty(FUe,"__esModule",{value:!0}),FUe.normalize=FUe.recoverPublicKey=FUe.concatSig=FUe.legacyToBuffer=FUe.isNullish=FUe.padWithZeroes=void 0;const lFe=fxe,dFe=qUe;function fFe(e,t){if(""!==e&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(t<0)throw new Error(`Expected a non-negative integer target length. Received: ${t}`);return String.prototype.padStart.call(e,t,"0")}function hFe(e){return null==e}FUe.padWithZeroes=fFe,FUe.isNullish=hFe,FUe.legacyToBuffer=function(e){return"string"!=typeof e||(0,lFe.isHexString)(e)?(0,lFe.toBuffer)(e):age.from(e)},FUe.concatSig=function(e,t,r){const n=(0,lFe.fromSigned)(t),i=(0,lFe.fromSigned)(r),o=(0,lFe.bufferToInt)(e),s=fFe((0,lFe.toUnsigned)(n).toString("hex"),64),a=fFe((0,lFe.toUnsigned)(i).toString("hex"),64),c=(0,dFe.remove0x)((0,dFe.numberToHex)(o));return(0,dFe.add0x)(s.concat(a,c))},FUe.recoverPublicKey=function(e,t){const r=(0,lFe.fromRpcSig)(t);return(0,lFe.ecrecover)(e,r.v,r.r,r.s)},FUe.normalize=function(e){if(!hFe(e)){if("number"==typeof e){if(e<0)return"0x";const t=(0,dFe.numberToBytes)(e);e=(0,dFe.bytesToHex)(t)}if("string"!=typeof e){let t="eth-sig-util.normalize() requires hex string or integer input.";throw t+=` received ${typeof e}: ${e}`,new Error(t)}return(0,dFe.add0x)(e.toLowerCase())}},Object.defineProperty(dxe,"__esModule",{value:!0}),dxe.extractPublicKey=dxe.recoverPersonalSignature=dxe.personalSign=void 0;const pFe=fxe,gFe=FUe;function yFe(e,t){const r=(0,pFe.hashPersonalMessage)((0,gFe.legacyToBuffer)(e));return(0,gFe.recoverPublicKey)(r,t)}dxe.personalSign=function({privateKey:e,data:t}){if((0,gFe.isNullish)(t))throw new Error("Missing data parameter");if((0,gFe.isNullish)(e))throw new Error("Missing privateKey parameter");const r=(0,gFe.legacyToBuffer)(t),n=(0,pFe.hashPersonalMessage)(r),i=(0,pFe.ecsign)(n,e);return(0,gFe.concatSig)((0,pFe.toBuffer)(i.v),i.r,i.s)},dxe.recoverPersonalSignature=function({data:e,signature:t}){if((0,gFe.isNullish)(e))throw new Error("Missing data parameter");if((0,gFe.isNullish)(t))throw new Error("Missing signature parameter");const r=yFe(e,t),n=(0,pFe.publicToAddress)(r);return(0,pFe.bufferToHex)(n)},dxe.extractPublicKey=function({data:e,signature:t}){if((0,gFe.isNullish)(e))throw new Error("Missing data parameter");if((0,gFe.isNullish)(t))throw new Error("Missing signature parameter");return`0x${yFe(e,t).toString("hex")}`};var mFe={},bFe={},vFe={},wFe={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ParserError=e.getErrorStack=e.getErrorMessage=void 0;const t=qUe;e.getErrorMessage=e=>"string"==typeof e?e:e instanceof Error||(0,t.isObject)(e)&&(0,t.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:"Unknown error.",e.getErrorStack=e=>{if(e instanceof Error)return e.stack};class r extends Error{constructor(t,r){super(t),this.name="ParserError";const n=(0,e.getErrorStack)(r);n&&(this.stack=n)}}e.ParserError=r}(wFe);var _Fe={},EFe={};Object.defineProperty(EFe,"__esModule",{value:!0}),EFe.iterate=void 0;const SFe=qUe;EFe.iterate=function*(e,t=32){for(let r=0;r{(0,SFe.assert)(e>=0,"Cannot skip a negative number of bytes."),(0,SFe.assert)(e%t==0,"Length must be a multiple of the size."),r+=e},i=e.subarray(r);yield{skip:n,value:i}}return{skip:()=>{},value:new Uint8Array}};var kFe={},AFe={},xFe={},IFe={};Object.defineProperty(IFe,"__esModule",{value:!0}),IFe.padEnd=IFe.padStart=IFe.set=void 0;const BFe=qUe;IFe.set=(e,t,r)=>(0,BFe.concatBytes)([e.subarray(0,r),t,e.subarray(r+t.length)]),IFe.padStart=(e,t=32)=>{const r=new Uint8Array(Math.max(t-e.length,0)).fill(0);return(0,BFe.concatBytes)([r,e])},IFe.padEnd=(e,t=32)=>{const r=new Uint8Array(Math.max(t-e.length,0)).fill(0);return(0,BFe.concatBytes)([e,r])},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(IFe,t)}(xFe),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.address=e.getAddress=void 0;const t=qUe,r=wFe,n=xFe;e.getAddress=e=>{const i=(0,t.createBytes)(e);return(0,t.assert)(i.length<=20,new r.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${i.length} bytes.`)),(0,n.padStart)(i,20)},e.address={isDynamic:!1,isType:e=>"address"===e,getByteLength:()=>32,encode({buffer:r,value:i,packed:o}){const s=(0,e.getAddress)(i);if(o)return(0,t.concatBytes)([r,s]);const a=(0,n.padStart)(s);return(0,t.concatBytes)([r,a])},decode:({value:e})=>(0,t.add0x)((0,t.bytesToHex)(e.slice(12,32)))}}(AFe);var TFe={},CFe={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fixedBytes=e.getByteLength=void 0;const t=qUe,r=wFe,n=xFe,i=/^bytes([0-9]{1,2})$/u;e.getByteLength=e=>{var n;const o=null===(n=e.match(i))||void 0===n?void 0:n[1];(0,t.assert)(o,`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`);const s=Number(o);return(0,t.assert)(s>0&&s<=32,new r.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`)),s},e.fixedBytes={isDynamic:!1,isType:e=>i.test(e),getByteLength:()=>32,encode({type:i,buffer:o,value:s,packed:a}){const c=(0,e.getByteLength)(i),u=(0,t.createBytes)(s);return(0,t.assert)(u.length<=c,new r.ParserError(`Expected a value of length ${c}, but received a value of length ${u.length}.`)),(0,t.concatBytes)(a?[o,(0,n.padEnd)(u,c)]:[o,(0,n.padEnd)(u)])},decode({type:t,value:r}){const n=(0,e.getByteLength)(t);return r.slice(0,n)}}}(CFe);var OFe,RFe,PFe={};function MFe(){return OFe||(OFe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.tuple=e.getTupleElements=void 0;const t=qUe,r=wFe,n=WFe(),i=/^\((.+)\)$/u;e.getTupleElements=e=>{(0,t.assert)(e.startsWith("(")&&e.endsWith(")"),new r.ParserError(`Invalid tuple type. Expected tuple type, but received "${e}".`));const n=[];let i="",o=0;for(let t=1;t(0,e.getTupleElements)(t).some((e=>{const t=(0,n.getParser)(e);return(0,n.isDynamicParser)(t,e)})),isType:e=>(e=>i.test(e))(e),getByteLength(t){return(0,n.isDynamicParser)(this,t)?32:(0,e.getTupleElements)(t).reduce(((e,t)=>e+(0,n.getParser)(t).getByteLength(t)),0)},encode({type:t,buffer:r,value:i,packed:o,tight:s}){const a=(0,e.getTupleElements)(t);return(0,n.pack)({types:a,values:i,byteArray:r,packed:o,tight:s})},decode({type:t,value:r,skip:i}){const o=(0,e.getTupleElements)(t);return i(this.getByteLength(t)-32),(0,n.unpack)(o,r)}}}(PFe)),PFe}var UFe={},LFe={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.number=e.getBigInt=e.assertNumberLength=e.getLength=e.isSigned=void 0;const t=qUe,r=wFe,n=xFe,i=/^u?int(?[0-9]*)?$/u;e.isSigned=e=>!e.startsWith("u"),e.getLength=e=>{var n;if("int"===e||"uint"===e)return 256;const o=e.match(i);(0,t.assert)(null==o||null===(n=o.groups)||void 0===n?void 0:n.length,new r.ParserError(`Invalid number type. Expected a number type, but received "${e}".`));const s=parseInt(o.groups.length,10);return(0,t.assert)(s>=8&&s<=256,new r.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${e}".`)),(0,t.assert)(s%8==0,new r.ParserError(`Invalid number length. Expected a multiple of 8, but received "${e}".`)),s},e.assertNumberLength=(n,i)=>{const o=(0,e.getLength)(i),s=BigInt(2)**BigInt(o-((0,e.isSigned)(i)?1:0))-BigInt(1);(0,e.isSigned)(i)?(0,t.assert)(n>=-(s+BigInt(1))&&n<=s,new r.ParserError(`Number "${n}" is out of range for type "${i}".`)):(0,t.assert)(n<=s,new r.ParserError(`Number "${n}" is out of range for type "${i}".`))},e.getBigInt=e=>{try{return(0,t.createBigInt)(e)}catch{throw new r.ParserError(`Invalid number. Expected a valid number value, but received "${e}".`)}},e.number={isDynamic:!1,isType:e=>i.test(e),getByteLength:()=>32,encode({type:r,buffer:i,value:o,packed:s}){const a=(0,e.getBigInt)(o);if((0,e.assertNumberLength)(a,r),(0,e.isSigned)(r)){if(s){const n=(0,e.getLength)(r)/8;return(0,t.concatBytes)([i,(0,t.signedBigIntToBytes)(a,n)])}return(0,t.concatBytes)([i,(0,n.padStart)((0,t.signedBigIntToBytes)(a,32))])}if(s){const o=(0,e.getLength)(r)/8;return(0,t.concatBytes)([i,(0,n.padStart)((0,t.bigIntToBytes)(a),o)])}return(0,t.concatBytes)([i,(0,n.padStart)((0,t.bigIntToBytes)(a))])},decode({type:r,value:n}){const i=n.subarray(0,32);if((0,e.isSigned)(r)){const n=(0,t.bytesToSignedBigInt)(i);return(0,e.assertNumberLength)(n,r),n}const o=(0,t.bytesToBigInt)(i);return(0,e.assertNumberLength)(o,r),o}}}(LFe),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bool=e.getBooleanValue=void 0;const t=VUe,r=qUe,n=wFe,i=LFe,o=(0,t.coerce)((0,t.boolean)(),(0,t.union)([(0,t.literal)("true"),(0,t.literal)("false")]),(e=>"true"===e));e.getBooleanValue=e=>{try{return(0,t.create)(e,o)?BigInt(1):BigInt(0)}catch{throw new n.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${e}".`)}},e.bool={isDynamic:!1,isType:e=>"bool"===e,getByteLength:()=>32,encode({buffer:t,value:n,packed:o,tight:s}){const a=(0,e.getBooleanValue)(n);return o?(0,r.concatBytes)([t,(0,r.bigIntToBytes)(a)]):i.number.encode({type:"uint256",buffer:t,value:a,packed:o,tight:s})},decode:e=>i.number.decode({...e,type:"uint256"})===BigInt(1)}}(UFe);var jFe={};Object.defineProperty(jFe,"__esModule",{value:!0}),jFe.bytes=void 0;const NFe=qUe,zFe=xFe;jFe.bytes={isDynamic:!0,isType:e=>"bytes"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:r}){const n=(0,NFe.createBytes)(t);if(r)return(0,NFe.concatBytes)([e,n]);const i=32*Math.ceil(n.byteLength/32);return(0,NFe.concatBytes)([e,(0,zFe.padStart)((0,NFe.numberToBytes)(n.byteLength)),(0,zFe.padEnd)(n,i)])},decode({value:e}){const t=e.subarray(0,32),r=(0,NFe.bytesToNumber)(t);return e.slice(32,32+r)}};var DFe={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fn=e.getFunction=void 0;const t=VUe,r=qUe,n=wFe,i=CFe,o=(0,t.coerce)((0,t.object)({address:r.StrictHexStruct,selector:r.StrictHexStruct}),(0,t.union)([r.StrictHexStruct,(0,t.instance)(Uint8Array)]),(e=>{const t=(0,r.createBytes)(e);return(0,r.assert)(24===t.length,new n.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${t.length} bytes.`)),{address:(0,r.bytesToHex)(t.subarray(0,20)),selector:(0,r.bytesToHex)(t.subarray(20,24))}}));e.getFunction=e=>{const n=(0,t.create)(e,o);return(0,r.concatBytes)([(0,r.hexToBytes)(n.address),(0,r.hexToBytes)(n.selector)])},e.fn={isDynamic:!1,isType:e=>"function"===e,getByteLength:()=>32,encode({buffer:t,value:r,packed:n,tight:o}){const s=(0,e.getFunction)(r);return i.fixedBytes.encode({type:"bytes24",buffer:t,value:s,packed:n,tight:o})},decode:({value:e})=>({address:(0,r.bytesToHex)(e.slice(0,20)),selector:(0,r.bytesToHex)(e.slice(20,24))})}}(DFe);var FFe={};Object.defineProperty(FFe,"__esModule",{value:!0});var qFe={};Object.defineProperty(qFe,"__esModule",{value:!0}),qFe.string=void 0;const HFe=qUe,VFe=jFe;var $Fe,KFe;function ZFe(){return $Fe||($Fe=1,function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(AFe,t),n((RFe||(RFe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.array=e.getTupleType=e.getArrayType=e.isArrayType=void 0;const t=qUe,r=wFe,n=WFe(),i=xFe,o=CFe,s=MFe(),a=/^(?.*)\[(?\d*?)\]$/u;e.isArrayType=e=>a.test(e),e.getArrayType=e=>{var n;const i=e.match(a);return(0,t.assert)(null==i||null===(n=i.groups)||void 0===n?void 0:n.type,new r.ParserError(`Invalid array type. Expected an array type, but received "${e}".`)),[i.groups.type,i.groups.length?parseInt(i.groups.length,10):void 0]},e.getTupleType=(e,t)=>`(${new Array(t).fill(e).join(",")})`,e.array={isDynamic(t){const[r,i]=(0,e.getArrayType)(t);return void 0===i||(0,n.isDynamicParser)((0,n.getParser)(r),r)},isType:t=>(0,e.isArrayType)(t),getByteLength(i){(0,t.assert)((0,e.isArrayType)(i),new r.ParserError(`Expected an array type, but received "${i}".`));const[o,a]=(0,e.getArrayType)(i);return(0,n.isDynamicParser)(this,i)||void 0===a?32:s.tuple.getByteLength((0,e.getTupleType)(o,a))},encode({type:a,buffer:c,value:u,packed:l,tight:d}){const[f,h]=(0,e.getArrayType)(a);if((0,t.assert)(!l||!(0,e.isArrayType)(f),new r.ParserError("Cannot pack nested arrays.")),l&&(0,n.isDynamicParser)((0,n.getParser)(f),f))return(0,n.pack)({types:new Array(u.length).fill(f),values:u,byteArray:c,packed:l,arrayPacked:!0,tight:d});if(h)return(0,t.assert)(h===u.length,new r.ParserError(`Array length does not match type length. Expected a length of ${h}, but received ${u.length}.`)),s.tuple.encode({type:(0,e.getTupleType)(f,h),buffer:c,value:u,packed:o.fixedBytes.isType(f)&&d,tight:d});if(l)return(0,n.pack)({types:new Array(u.length).fill(f),values:u,byteArray:c,packed:o.fixedBytes.isType(f)&&d,arrayPacked:!0,tight:d});const p=(0,i.padStart)((0,t.numberToBytes)(u.length));return(0,n.pack)({types:new Array(u.length).fill(f),values:u,byteArray:(0,t.concatBytes)([c,p]),packed:l,tight:d})},decode({type:i,value:o,...a}){const[c,u]=(0,e.getArrayType)(i);if(u){const n=s.tuple.decode({type:(0,e.getTupleType)(c,u),value:o,...a});return(0,t.assert)(n.length===u,new r.ParserError(`Array length does not match type length. Expected a length of ${u}, but received ${n.length}.`)),n}const l=(0,t.bytesToNumber)(o.subarray(0,32));return(0,n.unpack)(new Array(l).fill(c),o.subarray(32))}}}(TFe)),TFe),t),n(UFe,t),n(jFe,t),n(CFe,t),n(DFe,t),n(LFe,t),n(FFe,t),n(qFe,t),n(MFe(),t)}(kFe)),kFe}function WFe(){return KFe||(KFe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unpack=e.pack=e.isDynamicParser=e.getParser=void 0;const t=qUe,r=wFe,n=EFe,i=ZFe(),o=xFe;e.getParser=e=>{const t={address:i.address,array:i.array,bool:i.bool,bytes:i.bytes,fixedBytes:i.fixedBytes,function:i.fn,number:i.number,string:i.string,tuple:i.tuple},n=t[e];if(n)return n;const o=Object.values(t).find((t=>t.isType(e)));if(o)return o;throw new r.ParserError(`The type "${e}" is not supported.`)},e.isDynamicParser=(e,t)=>{const{isDynamic:r}=e;return"function"==typeof r?r(t):r},e.pack=({types:n,values:i,packed:s=!1,tight:a=!1,arrayPacked:c=!1,byteArray:u=new Uint8Array})=>{(0,t.assert)(n.length===i.length,new r.ParserError(`The number of types (${n.length}) does not match the number of values (${i.length}).`));const{staticBuffer:l,dynamicBuffer:d,pointers:f}=n.reduce((({staticBuffer:r,dynamicBuffer:n,pointers:o},u,l)=>{const d=(0,e.getParser)(u),f=i[l];return s||c||!(0,e.isDynamicParser)(d,u)?{staticBuffer:d.encode({buffer:r,value:f,type:u,packed:s,tight:a}),dynamicBuffer:n,pointers:o}:{staticBuffer:(0,t.concatBytes)([r,new Uint8Array(32)]),dynamicBuffer:d.encode({buffer:n,value:f,type:u,packed:s,tight:a}),pointers:[...o,{position:r.length,pointer:n.length}]}}),{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,t.assert)(!s&&!c||0===d.length,new r.ParserError("Invalid pack state."));const h=l.length,p=f.reduce(((e,{pointer:r,position:n})=>{const i=(0,o.padStart)((0,t.numberToBytes)(h+r));return(0,o.set)(e,i,n)}),l);return(0,t.concatBytes)([u,p,d])},e.unpack=(i,o)=>{const s=(0,n.iterate)(o);return i.map((n=>{const{value:{value:i,skip:a},done:c}=s.next();(0,t.assert)(!c,new r.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${n}".`));const u=(0,e.getParser)(n);if((0,e.isDynamicParser)(u,n)){const e=(0,t.bytesToNumber)(i.subarray(0,32)),r=o.subarray(e);return u.decode({type:n,value:r,skip:a})}return u.decode({type:n,value:i,skip:a})}))}}(_Fe)),_Fe}qFe.string={isDynamic:!0,isType:e=>"string"===e,getByteLength:()=>32,encode:({buffer:e,value:t,packed:r,tight:n})=>VFe.bytes.encode({type:"bytes",buffer:e,value:(0,HFe.stringToBytes)(t),packed:r,tight:n}),decode:e=>(0,HFe.bytesToString)(VFe.bytes.decode(e))},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodeSingle=e.decode=e.encodePacked=e.encodeSingle=e.encode=void 0;const t=qUe,r=wFe,n=WFe();e.encode=(e,t,i,o)=>{try{return(0,n.pack)({types:e,values:t,packed:i,tight:o})}catch(e){if(e instanceof r.ParserError)throw new r.ParserError(`Unable to encode value: ${e.message}`,e);throw new r.ParserError(`An unexpected error occurred: ${(0,r.getErrorMessage)(e)}`,e)}},e.encodeSingle=(t,r)=>(0,e.encode)([t],[r]),e.encodePacked=(t,r,n)=>(0,e.encode)(t,r,!0,n),e.decode=(e,i)=>{const o=(0,t.createBytes)(i);try{return(0,n.unpack)(e,o)}catch(e){if(e instanceof r.ParserError)throw new r.ParserError(`Unable to decode value: ${e.message}`,e);throw new r.ParserError(`An unexpected error occurred: ${(0,r.getErrorMessage)(e)}`,e)}},e.decodeSingle=(n,i)=>{const o=(0,e.decode)([n],i);return(0,t.assert)(1===o.length,new r.ParserError("Decoded value array has unexpected length.")),o[0]}}(vFe);var GFe={},YFe={};Object.defineProperty(YFe,"__esModule",{value:!0}),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(YFe,t)}(GFe),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(vFe,t),n(wFe,t),n(GFe,t)}(bFe),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.recoverTypedSignature=e.signTypedData=e.typedSignatureHash=e.TypedDataUtils=e.TYPED_MESSAGE_SCHEMA=e.SignTypedDataVersion=void 0;const t=fxe,r=bFe,n=ZFe(),i=xFe,o=qUe,s=cBe,a=FUe;var c;function u(e,t){if(!Object.keys(c).includes(e))throw new Error(`Invalid version: '${e}'`);if(t&&!t.includes(e))throw new Error(`SignTypedDataVersion not allowed: '${e}'. Allowed versions are: ${t.join(", ")}`)}function l(e,t){(0,o.assert)(null!==t,`Unable to encode value: Invalid number. Expected a valid number value, but received "${t}".`);const r=BigInt(t),i=(0,n.getLength)(e),s=BigInt(2)**BigInt(i)-BigInt(1);return(0,o.assert)(r>=-s&&r<=s,`Unable to encode value: Number "${t}" is out of range for type "${e}".`),r}function d(e){let t=BigInt(0);for(let r=0;r=49?n-BigInt(49)+BigInt(10):n>=17?n-BigInt(17)+BigInt(10):n}return(0,i.padStart)((0,o.bigIntToBytes)(t),20)}function f(e,n,a,p,g){if(u(g,[c.V3,c.V4]),void 0!==e[a])return["bytes32",g===c.V4&&null==p?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,t.arrToBufArr)((0,s.keccak256)(h(a,p,e,g)))];if("function"===a)throw new Error('Unsupported or invalid type: "function"');if(void 0===p)throw new Error(`missing value for field ${n} of type ${a}`);if("address"===a){if("number"==typeof p)return["address",(0,i.padStart)((0,o.numberToBytes)(p),20)];if((0,o.isStrictHexString)(p))return["address",(0,o.add0x)(p)];if("string"==typeof p)return["address",d(p).subarray(0,20)]}if("bool"===a)return["bool",Boolean(p)];if("bytes"===a)return"number"==typeof p?p=(0,o.numberToBytes)(p):(0,o.isStrictHexString)(p)||"0x"===p?p=(0,o.hexToBytes)(p):"string"==typeof p&&(p=(0,o.stringToBytes)(p)),["bytes32",(0,t.arrToBufArr)((0,s.keccak256)(p))];if(a.startsWith("bytes")&&"bytes"!==a&&!a.includes("["))return"number"==typeof p?p<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,o.bigIntToBytes)(BigInt(p))]:(0,o.isStrictHexString)(p)?["bytes32",(0,o.hexToBytes)(p)]:["bytes32",p];if(a.startsWith("int")&&!a.includes("[")){const e=l(a,p);return e>=BigInt(0)?["uint256",e]:["int256",e]}if("string"===a)return p="number"==typeof p?(0,o.numberToBytes)(p):(0,o.stringToBytes)(null!=p?p:""),["bytes32",(0,t.arrToBufArr)((0,s.keccak256)(p))];if(a.endsWith("]")){if(g===c.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const i=a.slice(0,a.lastIndexOf("[")),o=p.map((t=>f(e,n,i,t,g)));return["bytes32",(0,t.arrToBufArr)((0,s.keccak256)((0,r.encode)(o.map((([e])=>e)),o.map((([,e])=>e)))))]}return[a,p]}function h(e,n,i,o){u(o,[c.V3,c.V4]);const s=["bytes32"],a=[m(e,i)];for(const t of i[e]){if(o===c.V3&&void 0===n[t.name])continue;const[e,r]=f(i,t.name,t.type,n[t.name],o);s.push(e),a.push(r)}return(0,t.arrToBufArr)((0,r.encode)(s,a))}function p(e,t){let r="";const n=g(e,t);n.delete(e);const i=[e,...Array.from(n).sort()];for(const e of i){if(!t[e])throw new Error(`No type definition specified: ${e}`);r+=`${e}(${t[e].map((({name:e,type:t})=>`${t} ${e}`)).join(",")})`}return r}function g(e,t,r=new Set){if("string"!=typeof e)throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(e)}`);const n=e.match(/^\w*/u);if([e]=n,r.has(e)||void 0===t[e])return r;r.add(e);for(const n of t[e])g(n.type,t,r);return r}function y(e,r,n,i){u(i,[c.V3,c.V4]);const o=h(e,r,n,i),a=(0,s.keccak256)(o);return(0,t.arrToBufArr)(a)}function m(e,r){const n=(0,o.stringToBytes)(p(e,r));return(0,t.arrToBufArr)((0,s.keccak256)(n))}function b(t){const r={};for(const n in e.TYPED_MESSAGE_SCHEMA.properties)t[n]&&(r[n]=t[n]);return"types"in r&&(r.types=Object.assign({EIP712Domain:[]},r.types)),r}function v(e,t){u(t,[c.V3,c.V4]);const r=b(e),{domain:n}=r;return y("EIP712Domain",n,{EIP712Domain:r.types.EIP712Domain},t)}function w(e,t){if((0,n.isArrayType)(e)&&Array.isArray(t)){const[r]=(0,n.getArrayType)(e);return t.map((e=>w(r,e)))}if("address"===e){if("number"==typeof t)return(0,i.padStart)((0,o.numberToBytes)(t),20);if((0,o.isStrictHexString)(t))return(0,i.padStart)((0,o.hexToBytes)(t).subarray(0,20),20);if(t instanceof Uint8Array)return(0,i.padStart)(t.subarray(0,20),20)}if("bool"===e)return Boolean(t);if(e.startsWith("bytes")&&"bytes"!==e){const r=(0,n.getByteLength)(e);if("number"==typeof t)return t<0?new Uint8Array:(0,o.numberToBytes)(t).subarray(0,r);if((0,o.isStrictHexString)(t))return(0,o.hexToBytes)(t).subarray(0,r);if(t instanceof Uint8Array)return t.subarray(0,r)}if(e.startsWith("uint")&&"number"==typeof t)return Math.abs(t);if(e.startsWith("int")&&"number"==typeof t){const r=(0,n.getLength)(e);return BigInt.asIntN(r,BigInt(t))}return t}function _(e){return e.map((e=>"number"==typeof e?(0,i.padStart)((0,o.numberToBytes)(e),32):(0,o.isStrictHexString)(e)?(0,i.padStart)((0,o.hexToBytes)(e).subarray(0,32),32):e instanceof Uint8Array?(0,i.padStart)(e.subarray(0,32),32):e))}function E(e,t){return t.map((t=>{if("string"==typeof t||"number"==typeof t||"bigint"==typeof t){const r=l(e,t);if(r>=BigInt(0))return(0,i.padStart)((0,o.bigIntToBytes)(r),32);const s=(0,n.getLength)(e),a=BigInt.asIntN(s,r);return(0,o.signedBigIntToBytes)(a,32)}return t}))}function S(e){const i=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!("length"in e)||!e.length)throw i;const o=e.map((({name:e,type:t,value:r})=>{if("address[]"===t)return{name:e,type:"bytes32[]",value:_(r)};if(t.startsWith("int")&&(0,n.isArrayType)(t)){const[i,o]=(0,n.getArrayType)(t);return{name:e,type:`bytes32[${null!=o?o:""}]`,value:E(i,r)}}return{name:e,type:t,value:w(t,r)}})),c=o.map((e=>"bytes"!==e.type?e.value:(0,a.legacyToBuffer)(e.value))),u=o.map((e=>{if("function"===e.type)throw new Error('Unsupported or invalid type: "function"');return e.type})),l=e.map((e=>{if(!e.name)throw i;return`${e.type} ${e.name}`}));return(0,t.arrToBufArr)((0,s.keccak256)((0,r.encodePacked)(["bytes32","bytes32"],[(0,s.keccak256)((0,r.encodePacked)(["string[]"],[l],!0)),(0,s.keccak256)((0,r.encodePacked)(u,c,!0))])))}!function(e){e.V1="V1",e.V3="V3",e.V4="V4"}(c=e.SignTypedDataVersion||(e.SignTypedDataVersion={})),e.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},e.TypedDataUtils={encodeData:h,encodeType:p,findTypeDependencies:g,hashStruct:y,hashType:m,sanitizeData:b,eip712Hash:function(e,r){u(r,[c.V3,c.V4]);const n=b(e),i=[(0,o.hexToBytes)("1901")];return i.push(v(e,r)),"EIP712Domain"!==n.primaryType&&i.push(y(n.primaryType,n.message,n.types,r)),(0,t.arrToBufArr)((0,s.keccak256)((0,o.concatBytes)(i)))},eip712DomainHash:v},e.typedSignatureHash=function(e){const t=S(e);return(0,o.bytesToHex)(t)},e.signTypedData=function({privateKey:r,data:n,version:i}){if(u(i),(0,a.isNullish)(n))throw new Error("Missing data parameter");if((0,a.isNullish)(r))throw new Error("Missing private key parameter");const s=i===c.V1?S(n):e.TypedDataUtils.eip712Hash(n,i),l=(0,t.ecsign)(s,r);return(0,a.concatSig)((0,t.arrToBufArr)((0,o.bigIntToBytes)(l.v)),l.r,l.s)},e.recoverTypedSignature=function({data:r,signature:n,version:i}){if(u(i),(0,a.isNullish)(r))throw new Error("Missing data parameter");if((0,a.isNullish)(n))throw new Error("Missing signature parameter");const s=i===c.V1?S(r):e.TypedDataUtils.eip712Hash(r,i),l=(0,a.recoverPublicKey)(s,n),d=(0,t.publicToAddress)(l);return(0,o.bytesToHex)(d)}}(mFe);var JFe={},XFe={exports:{}},QFe=t(Object.freeze({__proto__:null,default:{}}));!function(e){!function(e){var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function p(e,t,r,n,i){var o,s=0;for(o=0;o>>8)-1}function g(e,t,r,n){return p(e,t,r,n,16)}function y(e,t,r,n){return p(e,t,r,n,32)}function m(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,d=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,y=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,m=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=o,E=s,S=a,k=c,A=u,x=l,I=d,B=f,T=h,C=p,O=g,R=y,P=m,M=b,U=v,L=w,j=0;j<20;j+=2)_^=(i=(P^=(i=(T^=(i=(A^=(i=_+P|0)<<7|i>>>25)+_|0)<<9|i>>>23)+A|0)<<13|i>>>19)+T|0)<<18|i>>>14,x^=(i=(E^=(i=(M^=(i=(C^=(i=x+E|0)<<7|i>>>25)+x|0)<<9|i>>>23)+C|0)<<13|i>>>19)+M|0)<<18|i>>>14,O^=(i=(I^=(i=(S^=(i=(U^=(i=O+I|0)<<7|i>>>25)+O|0)<<9|i>>>23)+U|0)<<13|i>>>19)+S|0)<<18|i>>>14,L^=(i=(R^=(i=(B^=(i=(k^=(i=L+R|0)<<7|i>>>25)+L|0)<<9|i>>>23)+k|0)<<13|i>>>19)+B|0)<<18|i>>>14,_^=(i=(k^=(i=(S^=(i=(E^=(i=_+k|0)<<7|i>>>25)+_|0)<<9|i>>>23)+E|0)<<13|i>>>19)+S|0)<<18|i>>>14,x^=(i=(A^=(i=(B^=(i=(I^=(i=x+A|0)<<7|i>>>25)+x|0)<<9|i>>>23)+I|0)<<13|i>>>19)+B|0)<<18|i>>>14,O^=(i=(C^=(i=(T^=(i=(R^=(i=O+C|0)<<7|i>>>25)+O|0)<<9|i>>>23)+R|0)<<13|i>>>19)+T|0)<<18|i>>>14,L^=(i=(U^=(i=(M^=(i=(P^=(i=L+U|0)<<7|i>>>25)+L|0)<<9|i>>>23)+P|0)<<13|i>>>19)+M|0)<<18|i>>>14;_=_+o|0,E=E+s|0,S=S+a|0,k=k+c|0,A=A+u|0,x=x+l|0,I=I+d|0,B=B+f|0,T=T+h|0,C=C+p|0,O=O+g|0,R=R+y|0,P=P+m|0,M=M+b|0,U=U+v|0,L=L+w|0,e[0]=_>>>0&255,e[1]=_>>>8&255,e[2]=_>>>16&255,e[3]=_>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=k>>>0&255,e[13]=k>>>8&255,e[14]=k>>>16&255,e[15]=k>>>24&255,e[16]=A>>>0&255,e[17]=A>>>8&255,e[18]=A>>>16&255,e[19]=A>>>24&255,e[20]=x>>>0&255,e[21]=x>>>8&255,e[22]=x>>>16&255,e[23]=x>>>24&255,e[24]=I>>>0&255,e[25]=I>>>8&255,e[26]=I>>>16&255,e[27]=I>>>24&255,e[28]=B>>>0&255,e[29]=B>>>8&255,e[30]=B>>>16&255,e[31]=B>>>24&255,e[32]=T>>>0&255,e[33]=T>>>8&255,e[34]=T>>>16&255,e[35]=T>>>24&255,e[36]=C>>>0&255,e[37]=C>>>8&255,e[38]=C>>>16&255,e[39]=C>>>24&255,e[40]=O>>>0&255,e[41]=O>>>8&255,e[42]=O>>>16&255,e[43]=O>>>24&255,e[44]=R>>>0&255,e[45]=R>>>8&255,e[46]=R>>>16&255,e[47]=R>>>24&255,e[48]=P>>>0&255,e[49]=P>>>8&255,e[50]=P>>>16&255,e[51]=P>>>24&255,e[52]=M>>>0&255,e[53]=M>>>8&255,e[54]=M>>>16&255,e[55]=M>>>24&255,e[56]=U>>>0&255,e[57]=U>>>8&255,e[58]=U>>>16&255,e[59]=U>>>24&255,e[60]=L>>>0&255,e[61]=L>>>8&255,e[62]=L>>>16&255,e[63]=L>>>24&255}(e,t,r,n)}function b(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,d=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,y=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,m=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=0;_<20;_+=2)o^=(i=(m^=(i=(h^=(i=(u^=(i=o+m|0)<<7|i>>>25)+o|0)<<9|i>>>23)+u|0)<<13|i>>>19)+h|0)<<18|i>>>14,l^=(i=(s^=(i=(b^=(i=(p^=(i=l+s|0)<<7|i>>>25)+l|0)<<9|i>>>23)+p|0)<<13|i>>>19)+b|0)<<18|i>>>14,g^=(i=(d^=(i=(a^=(i=(v^=(i=g+d|0)<<7|i>>>25)+g|0)<<9|i>>>23)+v|0)<<13|i>>>19)+a|0)<<18|i>>>14,w^=(i=(y^=(i=(f^=(i=(c^=(i=w+y|0)<<7|i>>>25)+w|0)<<9|i>>>23)+c|0)<<13|i>>>19)+f|0)<<18|i>>>14,o^=(i=(c^=(i=(a^=(i=(s^=(i=o+c|0)<<7|i>>>25)+o|0)<<9|i>>>23)+s|0)<<13|i>>>19)+a|0)<<18|i>>>14,l^=(i=(u^=(i=(f^=(i=(d^=(i=l+u|0)<<7|i>>>25)+l|0)<<9|i>>>23)+d|0)<<13|i>>>19)+f|0)<<18|i>>>14,g^=(i=(p^=(i=(h^=(i=(y^=(i=g+p|0)<<7|i>>>25)+g|0)<<9|i>>>23)+y|0)<<13|i>>>19)+h|0)<<18|i>>>14,w^=(i=(v^=(i=(b^=(i=(m^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+m|0)<<13|i>>>19)+b|0)<<18|i>>>14;e[0]=o>>>0&255,e[1]=o>>>8&255,e[2]=o>>>16&255,e[3]=o>>>24&255,e[4]=l>>>0&255,e[5]=l>>>8&255,e[6]=l>>>16&255,e[7]=l>>>24&255,e[8]=g>>>0&255,e[9]=g>>>8&255,e[10]=g>>>16&255,e[11]=g>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=d>>>0&255,e[17]=d>>>8&255,e[18]=d>>>16&255,e[19]=d>>>24&255,e[20]=f>>>0&255,e[21]=f>>>8&255,e[22]=f>>>16&255,e[23]=f>>>24&255,e[24]=h>>>0&255,e[25]=h>>>8&255,e[26]=h>>>16&255,e[27]=h>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var v=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function w(e,t,r,n,i,o,s){var a,c,u=new Uint8Array(16),l=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=o[c];for(;i>=64;){for(m(l,u,s,v),c=0;c<64;c++)e[t+c]=r[n+c]^l[c];for(a=1,c=8;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;i-=64,t+=64,n+=64}if(i>0)for(m(l,u,s,v),c=0;c=64;){for(m(c,a,i,v),s=0;s<64;s++)e[t+s]=c[s];for(o=1,s=8;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,t+=64}if(r>0)for(m(c,a,i,v),s=0;s>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,s=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(o>>>14|s<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(s>>>11|a<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,n,i,o){var s=new k(o);return s.update(r,n,i),s.finish(e,t),0}function x(e,t,r,n,i,o){var s=new Uint8Array(16);return A(s,0,r,n,i,o),g(e,t,s,0)}function I(e,t,r,n,i){var o;if(r<32)return-1;for(S(e,0,t,0,r,n,i),A(e,16,e,32,r-32,e),o=0;o<16;o++)e[o]=0;return 0}function B(e,t,r,n,i){var o,s=new Uint8Array(32);if(r<32)return-1;if(E(s,0,32,n,i),0!==x(t,16,t,32,r-32,s))return-1;for(S(e,0,t,0,r,n,i),o=0;o<32;o++)e[o]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function C(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function O(e,t,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function R(e,r){var n,i,o,s=t(),a=t();for(n=0;n<16;n++)a[n]=r[n];for(C(a),C(a),C(a),i=0;i<2;i++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,O(a,s,1-o)}for(n=0;n<16;n++)e[2*n]=255&a[n],e[2*n+1]=a[n]>>8}function P(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return R(r,e),R(n,t),y(r,0,n,0)}function M(e){var t=new Uint8Array(32);return R(t,e),1&t[0]}function U(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function L(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function j(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function N(e,t,r){var n,i,o=0,s=0,a=0,c=0,u=0,l=0,d=0,f=0,h=0,p=0,g=0,y=0,m=0,b=0,v=0,w=0,_=0,E=0,S=0,k=0,A=0,x=0,I=0,B=0,T=0,C=0,O=0,R=0,P=0,M=0,U=0,L=r[0],j=r[1],N=r[2],z=r[3],D=r[4],F=r[5],q=r[6],H=r[7],V=r[8],$=r[9],K=r[10],Z=r[11],W=r[12],G=r[13],Y=r[14],J=r[15];o+=(n=t[0])*L,s+=n*j,a+=n*N,c+=n*z,u+=n*D,l+=n*F,d+=n*q,f+=n*H,h+=n*V,p+=n*$,g+=n*K,y+=n*Z,m+=n*W,b+=n*G,v+=n*Y,w+=n*J,s+=(n=t[1])*L,a+=n*j,c+=n*N,u+=n*z,l+=n*D,d+=n*F,f+=n*q,h+=n*H,p+=n*V,g+=n*$,y+=n*K,m+=n*Z,b+=n*W,v+=n*G,w+=n*Y,_+=n*J,a+=(n=t[2])*L,c+=n*j,u+=n*N,l+=n*z,d+=n*D,f+=n*F,h+=n*q,p+=n*H,g+=n*V,y+=n*$,m+=n*K,b+=n*Z,v+=n*W,w+=n*G,_+=n*Y,E+=n*J,c+=(n=t[3])*L,u+=n*j,l+=n*N,d+=n*z,f+=n*D,h+=n*F,p+=n*q,g+=n*H,y+=n*V,m+=n*$,b+=n*K,v+=n*Z,w+=n*W,_+=n*G,E+=n*Y,S+=n*J,u+=(n=t[4])*L,l+=n*j,d+=n*N,f+=n*z,h+=n*D,p+=n*F,g+=n*q,y+=n*H,m+=n*V,b+=n*$,v+=n*K,w+=n*Z,_+=n*W,E+=n*G,S+=n*Y,k+=n*J,l+=(n=t[5])*L,d+=n*j,f+=n*N,h+=n*z,p+=n*D,g+=n*F,y+=n*q,m+=n*H,b+=n*V,v+=n*$,w+=n*K,_+=n*Z,E+=n*W,S+=n*G,k+=n*Y,A+=n*J,d+=(n=t[6])*L,f+=n*j,h+=n*N,p+=n*z,g+=n*D,y+=n*F,m+=n*q,b+=n*H,v+=n*V,w+=n*$,_+=n*K,E+=n*Z,S+=n*W,k+=n*G,A+=n*Y,x+=n*J,f+=(n=t[7])*L,h+=n*j,p+=n*N,g+=n*z,y+=n*D,m+=n*F,b+=n*q,v+=n*H,w+=n*V,_+=n*$,E+=n*K,S+=n*Z,k+=n*W,A+=n*G,x+=n*Y,I+=n*J,h+=(n=t[8])*L,p+=n*j,g+=n*N,y+=n*z,m+=n*D,b+=n*F,v+=n*q,w+=n*H,_+=n*V,E+=n*$,S+=n*K,k+=n*Z,A+=n*W,x+=n*G,I+=n*Y,B+=n*J,p+=(n=t[9])*L,g+=n*j,y+=n*N,m+=n*z,b+=n*D,v+=n*F,w+=n*q,_+=n*H,E+=n*V,S+=n*$,k+=n*K,A+=n*Z,x+=n*W,I+=n*G,B+=n*Y,T+=n*J,g+=(n=t[10])*L,y+=n*j,m+=n*N,b+=n*z,v+=n*D,w+=n*F,_+=n*q,E+=n*H,S+=n*V,k+=n*$,A+=n*K,x+=n*Z,I+=n*W,B+=n*G,T+=n*Y,C+=n*J,y+=(n=t[11])*L,m+=n*j,b+=n*N,v+=n*z,w+=n*D,_+=n*F,E+=n*q,S+=n*H,k+=n*V,A+=n*$,x+=n*K,I+=n*Z,B+=n*W,T+=n*G,C+=n*Y,O+=n*J,m+=(n=t[12])*L,b+=n*j,v+=n*N,w+=n*z,_+=n*D,E+=n*F,S+=n*q,k+=n*H,A+=n*V,x+=n*$,I+=n*K,B+=n*Z,T+=n*W,C+=n*G,O+=n*Y,R+=n*J,b+=(n=t[13])*L,v+=n*j,w+=n*N,_+=n*z,E+=n*D,S+=n*F,k+=n*q,A+=n*H,x+=n*V,I+=n*$,B+=n*K,T+=n*Z,C+=n*W,O+=n*G,R+=n*Y,P+=n*J,v+=(n=t[14])*L,w+=n*j,_+=n*N,E+=n*z,S+=n*D,k+=n*F,A+=n*q,x+=n*H,I+=n*V,B+=n*$,T+=n*K,C+=n*Z,O+=n*W,R+=n*G,P+=n*Y,M+=n*J,w+=(n=t[15])*L,s+=38*(E+=n*N),a+=38*(S+=n*z),c+=38*(k+=n*D),u+=38*(A+=n*F),l+=38*(x+=n*q),d+=38*(I+=n*H),f+=38*(B+=n*V),h+=38*(T+=n*$),p+=38*(C+=n*K),g+=38*(O+=n*Z),y+=38*(R+=n*W),m+=38*(P+=n*G),b+=38*(M+=n*Y),v+=38*(U+=n*J),o=(n=(o+=38*(_+=n*j))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=d,e[7]=f,e[8]=h,e[9]=p,e[10]=g,e[11]=y,e[12]=m,e[13]=b,e[14]=v,e[15]=w}function z(e,t){N(e,t,t)}function D(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)z(i,i),2!==n&&4!==n&&N(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function F(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)z(i,i),1!==n&&N(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function q(e,r,n){var i,o,s=new Uint8Array(32),c=new Float64Array(80),u=t(),l=t(),d=t(),f=t(),h=t(),p=t();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,U(c,n),o=0;o<16;o++)l[o]=c[o],f[o]=u[o]=d[o]=0;for(u[0]=f[0]=1,o=254;o>=0;--o)O(u,l,i=s[o>>>3]>>>(7&o)&1),O(d,f,i),L(h,u,d),j(u,u,d),L(d,l,f),j(l,l,f),z(f,h),z(p,u),N(u,d,u),N(d,l,h),L(h,u,d),j(u,u,d),z(l,u),j(d,f,p),N(u,d,a),L(u,u,f),N(d,d,u),N(u,f,p),N(f,l,c),z(l,h),O(u,l,i),O(d,f,i);for(o=0;o<16;o++)c[o+16]=u[o],c[o+32]=d[o],c[o+48]=l[o],c[o+64]=f[o];var g=c.subarray(32),y=c.subarray(16);return D(g,g),N(y,y,g),R(e,y),0}function H(e,t){return q(e,t,i)}function V(e,t){return r(t,32),H(e,t)}function $(e,t,r){var i=new Uint8Array(32);return q(i,r,t),b(e,n,i,v)}k.prototype.blocks=function(e,t,r){for(var n,i,o,s,a,c,u,l,d,f,h,p,g,y,m,b,v,w,_,E=this.fin?0:2048,S=this.h[0],k=this.h[1],A=this.h[2],x=this.h[3],I=this.h[4],B=this.h[5],T=this.h[6],C=this.h[7],O=this.h[8],R=this.h[9],P=this.r[0],M=this.r[1],U=this.r[2],L=this.r[3],j=this.r[4],N=this.r[5],z=this.r[6],D=this.r[7],F=this.r[8],q=this.r[9];r>=16;)f=d=0,f+=(S+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*P,f+=(k+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*q),f+=(A+=8191&(i>>>10|(o=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*F),f+=(x+=8191&(o>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*D),d=(f+=(I+=8191&(s>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*z))>>>13,f&=8191,f+=(B+=a>>>1&8191)*(5*N),f+=(T+=8191&(a>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*j),f+=(C+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*L),f+=(O+=8191&(u>>>8|(l=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*U),h=d+=(f+=(R+=l>>>5|E)*(5*M))>>>13,h+=S*M,h+=k*P,h+=A*(5*q),h+=x*(5*F),d=(h+=I*(5*D))>>>13,h&=8191,h+=B*(5*z),h+=T*(5*N),h+=C*(5*j),h+=O*(5*L),d+=(h+=R*(5*U))>>>13,h&=8191,p=d,p+=S*U,p+=k*M,p+=A*P,p+=x*(5*q),d=(p+=I*(5*F))>>>13,p&=8191,p+=B*(5*D),p+=T*(5*z),p+=C*(5*N),p+=O*(5*j),g=d+=(p+=R*(5*L))>>>13,g+=S*L,g+=k*U,g+=A*M,g+=x*P,d=(g+=I*(5*q))>>>13,g&=8191,g+=B*(5*F),g+=T*(5*D),g+=C*(5*z),g+=O*(5*N),y=d+=(g+=R*(5*j))>>>13,y+=S*j,y+=k*L,y+=A*U,y+=x*M,d=(y+=I*P)>>>13,y&=8191,y+=B*(5*q),y+=T*(5*F),y+=C*(5*D),y+=O*(5*z),m=d+=(y+=R*(5*N))>>>13,m+=S*N,m+=k*j,m+=A*L,m+=x*U,d=(m+=I*M)>>>13,m&=8191,m+=B*P,m+=T*(5*q),m+=C*(5*F),m+=O*(5*D),b=d+=(m+=R*(5*z))>>>13,b+=S*z,b+=k*N,b+=A*j,b+=x*L,d=(b+=I*U)>>>13,b&=8191,b+=B*M,b+=T*P,b+=C*(5*q),b+=O*(5*F),v=d+=(b+=R*(5*D))>>>13,v+=S*D,v+=k*z,v+=A*N,v+=x*j,d=(v+=I*L)>>>13,v&=8191,v+=B*U,v+=T*M,v+=C*P,v+=O*(5*q),w=d+=(v+=R*(5*F))>>>13,w+=S*F,w+=k*D,w+=A*z,w+=x*N,d=(w+=I*j)>>>13,w&=8191,w+=B*L,w+=T*U,w+=C*M,w+=O*P,_=d+=(w+=R*(5*q))>>>13,_+=S*q,_+=k*F,_+=A*D,_+=x*z,d=(_+=I*N)>>>13,_&=8191,_+=B*j,_+=T*L,_+=C*U,_+=O*M,S=f=8191&(d=(d=((d+=(_+=R*P)>>>13)<<2)+d|0)+(f&=8191)|0),k=h+=d>>>=13,A=p&=8191,x=g&=8191,I=y&=8191,B=m&=8191,T=b&=8191,C=v&=8191,O=w&=8191,R=_&=8191,t+=16,r-=16;this.h[0]=S,this.h[1]=k,this.h[2]=A,this.h[3]=x,this.h[4]=I,this.h[5]=B,this.h[6]=T,this.h[7]=C,this.h[8]=O,this.h[9]=R},k.prototype.finish=function(e,t){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},k.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n=128;){for(E=0;E<16;E++)S=8*E+G,C[E]=r[S+0]<<24|r[S+1]<<16|r[S+2]<<8|r[S+3],O[E]=r[S+4]<<24|r[S+5]<<16|r[S+6]<<8|r[S+7];for(E=0;E<80;E++)if(i=R,o=P,s=M,a=U,c=L,u=j,l=N,f=D,h=F,p=q,g=H,y=V,m=$,b=K,x=65535&(A=Z),I=A>>>16,B=65535&(k=z),T=k>>>16,x+=65535&(A=(V>>>14|L<<18)^(V>>>18|L<<14)^(L>>>9|V<<23)),I+=A>>>16,B+=65535&(k=(L>>>14|V<<18)^(L>>>18|V<<14)^(V>>>9|L<<23)),T+=k>>>16,x+=65535&(A=V&$^~V&K),I+=A>>>16,B+=65535&(k=L&j^~L&N),T+=k>>>16,x+=65535&(A=W[2*E+1]),I+=A>>>16,B+=65535&(k=W[2*E]),T+=k>>>16,k=C[E%16],I+=(A=O[E%16])>>>16,B+=65535&k,T+=k>>>16,B+=(I+=(x+=65535&A)>>>16)>>>16,x=65535&(A=_=65535&x|I<<16),I=A>>>16,B=65535&(k=w=65535&B|(T+=B>>>16)<<16),T=k>>>16,x+=65535&(A=(D>>>28|R<<4)^(R>>>2|D<<30)^(R>>>7|D<<25)),I+=A>>>16,B+=65535&(k=(R>>>28|D<<4)^(D>>>2|R<<30)^(D>>>7|R<<25)),T+=k>>>16,I+=(A=D&F^D&q^F&q)>>>16,B+=65535&(k=R&P^R&M^P&M),T+=k>>>16,d=65535&(B+=(I+=(x+=65535&A)>>>16)>>>16)|(T+=B>>>16)<<16,v=65535&x|I<<16,x=65535&(A=g),I=A>>>16,B=65535&(k=a),T=k>>>16,I+=(A=_)>>>16,B+=65535&(k=w),T+=k>>>16,P=i,M=o,U=s,L=a=65535&(B+=(I+=(x+=65535&A)>>>16)>>>16)|(T+=B>>>16)<<16,j=c,N=u,z=l,R=d,F=f,q=h,H=p,V=g=65535&x|I<<16,$=y,K=m,Z=b,D=v,E%16==15)for(S=0;S<16;S++)k=C[S],x=65535&(A=O[S]),I=A>>>16,B=65535&k,T=k>>>16,k=C[(S+9)%16],x+=65535&(A=O[(S+9)%16]),I+=A>>>16,B+=65535&k,T+=k>>>16,w=C[(S+1)%16],x+=65535&(A=((_=O[(S+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),I+=A>>>16,B+=65535&(k=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),T+=k>>>16,w=C[(S+14)%16],I+=(A=((_=O[(S+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,B+=65535&(k=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),T+=k>>>16,T+=(B+=(I+=(x+=65535&A)>>>16)>>>16)>>>16,C[S]=65535&B|T<<16,O[S]=65535&x|I<<16;x=65535&(A=D),I=A>>>16,B=65535&(k=R),T=k>>>16,k=e[0],I+=(A=t[0])>>>16,B+=65535&k,T+=k>>>16,T+=(B+=(I+=(x+=65535&A)>>>16)>>>16)>>>16,e[0]=R=65535&B|T<<16,t[0]=D=65535&x|I<<16,x=65535&(A=F),I=A>>>16,B=65535&(k=P),T=k>>>16,k=e[1],I+=(A=t[1])>>>16,B+=65535&k,T+=k>>>16,T+=(B+=(I+=(x+=65535&A)>>>16)>>>16)>>>16,e[1]=P=65535&B|T<<16,t[1]=F=65535&x|I<<16,x=65535&(A=q),I=A>>>16,B=65535&(k=M),T=k>>>16,k=e[2],I+=(A=t[2])>>>16,B+=65535&k,T+=k>>>16,T+=(B+=(I+=(x+=65535&A)>>>16)>>>16)>>>16,e[2]=M=65535&B|T<<16,t[2]=q=65535&x|I<<16,x=65535&(A=H),I=A>>>16,B=65535&(k=U),T=k>>>16,k=e[3],I+=(A=t[3])>>>16,B+=65535&k,T+=k>>>16,T+=(B+=(I+=(x+=65535&A)>>>16)>>>16)>>>16,e[3]=U=65535&B|T<<16,t[3]=H=65535&x|I<<16,x=65535&(A=V),I=A>>>16,B=65535&(k=L),T=k>>>16,k=e[4],I+=(A=t[4])>>>16,B+=65535&k,T+=k>>>16,T+=(B+=(I+=(x+=65535&A)>>>16)>>>16)>>>16,e[4]=L=65535&B|T<<16,t[4]=V=65535&x|I<<16,x=65535&(A=$),I=A>>>16,B=65535&(k=j),T=k>>>16,k=e[5],I+=(A=t[5])>>>16,B+=65535&k,T+=k>>>16,T+=(B+=(I+=(x+=65535&A)>>>16)>>>16)>>>16,e[5]=j=65535&B|T<<16,t[5]=$=65535&x|I<<16,x=65535&(A=K),I=A>>>16,B=65535&(k=N),T=k>>>16,k=e[6],I+=(A=t[6])>>>16,B+=65535&k,T+=k>>>16,T+=(B+=(I+=(x+=65535&A)>>>16)>>>16)>>>16,e[6]=N=65535&B|T<<16,t[6]=K=65535&x|I<<16,x=65535&(A=Z),I=A>>>16,B=65535&(k=z),T=k>>>16,k=e[7],I+=(A=t[7])>>>16,B+=65535&k,T+=k>>>16,T+=(B+=(I+=(x+=65535&A)>>>16)>>>16)>>>16,e[7]=z=65535&B|T<<16,t[7]=Z=65535&x|I<<16,G+=128,n-=128}return n}function Y(e,t,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,G(i,o,t,r),r%=128,n=0;n=0;--i)X(e,t,n=r[i/8|0]>>(7&i)&1),J(t,e),J(e,e),X(e,t,n)}function te(e,r){var n=[t(),t(),t(),t()];T(n[0],l),T(n[1],d),T(n[2],s),N(n[3],l,d),ee(e,n,r)}function re(e,n,i){var o,s=new Uint8Array(64),a=[t(),t(),t(),t()];for(i||r(n,32),Y(s,n,32),s[0]&=248,s[31]&=127,s[31]|=64,te(a,s),Q(e,a),o=0;o<32;o++)n[o+32]=e[o];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ie(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>4)*ne[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ne[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ie(e,r)}function se(e,r,n,i){var o,s,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),l=new Float64Array(64),d=[t(),t(),t(),t()];Y(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var f=n+64;for(o=0;o>7&&j(e[0],o,e[0]),N(e[3],e[0],e[1]),0)}(h,i))return-1;for(a=0;a=0},e.sign.keyPair=function(){var e=new Uint8Array(le),t=new Uint8Array(de);return re(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(he(e),e.length!==de)throw new Error("bad secret key size");for(var t=new Uint8Array(le),r=0;r0&&(o=2048-i-16),n.padding="0".repeat(o),sqe({publicKey:e,data:JSON.stringify(n),version:r})},JFe.decrypt=aqe,JFe.decryptSafely=function({encryptedData:e,privateKey:t}){if((0,oqe.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,oqe.isNullish)(t))throw new Error("Missing privateKey parameter");return JSON.parse(aqe({encryptedData:e,privateKey:t})).data},JFe.getEncryptionPublicKey=function(e){const t=age.from(e,"hex"),r=iqe.box.keyPair.fromSecretKey(t).publicKey;return nqe.base64.encode(r)},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.normalize=t.concatSig=void 0,n(dxe,t),n(mFe,t),n(JFe,t);var i=FUe;Object.defineProperty(t,"concatSig",{enumerable:!0,get:function(){return i.concatSig}}),Object.defineProperty(t,"normalize",{enumerable:!0,get:function(){return i.normalize}})}(lxe);class cqe extends Error{constructor(e,t){super(),this.code=e,this.message=t}toString(){return`${this.message} (${this.code})`}}var uqe,lqe=(e,t,r)=>(((e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)})(e,t,"read from private field"),r?r.call(e):t.get(e));const dqe=class{constructor(e){((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,uqe,["eth_newFilter","eth_newBlockFilter","eth_newPendingTransactionFilter","eth_uninstallFilter","eth_subscribe"]),this.provider=e}static isUTF8(e){try{return new TextDecoder("utf8",{fatal:!0}).decode(e),!0}catch{return!1}}static bufferToHex(e){return"0x"+age.from(e).toString("hex")}static messageToBuffer(e){let t=age.from([]);try{t="string"==typeof e?age.from(e.replace("0x",""),"hex"):age.from(e)}catch(e){console.log(`messageToBuffer error: ${e}`)}return t}async request(e){if(lqe(this,uqe).includes(e.method))return Promise.reject(new cqe(4200,`EthereumProvider does not support calling ${e.method}`));switch(e.method){case"wallet_requestPermissions":return this.provider.internalRequest({method:"wallet_requestPermissions",params:e.params});case"eth_requestAccounts":return this.provider.internalRequest({method:"requestAccounts",params:{}});case"eth_sign":return this.ethSign(e.params);case"personal_sign":return this.personalSign(e.params);case"personal_ecRecover":return this.personalECRecover(e.params);case"eth_signTypedData_v3":return this.ethSignTypedData(e.params,lxe.SignTypedDataVersion.V3);case"eth_signTypedData_v4":return this.ethSignTypedData(e.params,lxe.SignTypedDataVersion.V4);case"eth_signTypedData":return this.ethSignTypedData(e.params,lxe.SignTypedDataVersion.V1);case"eth_sendTransaction":return this.provider.internalRequest({method:"signTransaction",params:e.params[0]});case"wallet_watchAsset":{const{options:t,type:r}=e.params,{address:n,symbol:i,decimals:o}=t;return this.provider.internalRequest({method:"watchAsset",params:{type:r,contract:n,symbol:i,decimals:o||0}})}case"wallet_addEthereumChain":return this.provider.internalRequest({method:"addEthereumChain",params:e.params[0]});case"wallet_switchEthereumChain":return this.provider.internalRequest({method:"switchEthereumChain",params:e.params[0]});default:return await this.provider.getRPC().call({method:e.method,jsonrpc:"2.0",params:e.params})}}personalECRecover(e){return this.provider.internalRequest({method:"ecRecover",params:{signature:e[1],message:e[0]}})}async personalSign(e){const[t]=await this.provider.request({method:"eth_accounts"});if(!t)throw new Error("Unable to execute personal_sign");let[r,n]=e;"string"==typeof r&&t.toLowerCase()===r.toLowerCase()&&(r=e[1],n=e[0]);const i=dqe.messageToBuffer(r);return this.provider.internalRequest({method:"signPersonalMessage",params:{data:0===i.length?dqe.bufferToHex(r):r,address:n}})}ethSign(e){if(!e)throw new Error("Missing params");const[t,r]=e,n=dqe.messageToBuffer(r),i=dqe.bufferToHex(n);return this.provider.internalRequest({method:dqe.isUTF8(n)?"signPersonalMessage":"signMessage",params:{data:i,address:t,isEthSign:!0}})}async ethSignTypedData(e,t){const[r]=await this.provider.request({method:"eth_accounts"});if(!r)throw new Error("Unable to execute ethSignTypedData, address is not present");let[n,i]=e;"string"==typeof n&&r.toLowerCase()===n.toLowerCase()&&(n=e[1],i=e[0]);const o="string"==typeof n?JSON.parse(n):n,{chainId:s}=o.domain||{};if(typeof s<"u"&&Number(s)!==Number(this.provider.getChainId()))throw new Error("Provided chainId does not match the currently active chain");const a=t!==lxe.SignTypedDataVersion.V1?lxe.TypedDataUtils.eip712Hash(o,t):"";return this.provider.internalRequest({method:"signTypedMessage",params:{data:"0x"+a.toString("hex"),raw:"string"==typeof n?n:JSON.stringify(n),address:i,version:t}})}};let fqe=dqe;uqe=new WeakMap;var hqe,pqe=Object.defineProperty,gqe=Object.getOwnPropertySymbols,yqe=Object.prototype.hasOwnProperty,mqe=Object.prototype.propertyIsEnumerable,bqe=(e,t,r)=>t in e?pqe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vqe=(e,t)=>{for(var r in t||(t={}))yqe.call(t,r)&&bqe(e,r,t[r]);if(gqe)for(var r of gqe(t))mqe.call(t,r)&&bqe(e,r,t[r]);return e},wqe=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};class _qe{constructor(e){((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,hqe,void 0),((e,t,r,n)=>{wqe(e,t,"write to private field"),n?n.call(e,r):t.set(e,r)})(this,hqe,e)}async getBlockNumber(){return(await this.call({jsonrpc:"2.0",method:"eth_blockNumber",params:[]})).result}async getBlockByNumber(e){return(await this.call({jsonrpc:"2.0",method:"eth_getBlockByNumber",params:[e,!1]})).result}getFilterLogs(e){return this.call({jsonrpc:"2.0",method:"eth_getLogs",params:[e]})}async call(e){const t=await(await fetch(((e,t,r)=>(wqe(e,t,"read from private field"),r?r.call(e):t.get(e)))(this,hqe),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(vqe({id:(new Date).getTime()+Math.floor(1e3*Math.random())},e))})).json();if(!t.result&&t.error)throw new Error(t.error.message||"rpc error");return t.result}}hqe=new WeakMap;var Eqe,Sqe,kqe,Aqe,xqe,Iqe,Bqe=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Tqe=(e,t,r)=>(Bqe(e,t,"read from private field"),r?r.call(e):t.get(e)),Cqe=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Oqe=(e,t,r,n)=>(Bqe(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);const Rqe=class extends gye{constructor(e){super(),Cqe(this,Eqe,void 0),Cqe(this,Sqe,void 0),Cqe(this,kqe,!1),Cqe(this,Aqe,!1),Cqe(this,xqe,void 0),Cqe(this,Iqe,void 0),this.isTrust=!0,this.isTrustWallet=!0,this.request=this.request.bind(this),e&&(e.chainId&&Oqe(this,Eqe,e.chainId),(e.rpc||e.rpcUrl)&&Oqe(this,Sqe,e.rpc||e.rpcUrl),typeof e.overwriteMetamask<"u"&&Oqe(this,Aqe,e.overwriteMetamask),typeof e.disableMobileAdapter<"u"&&Oqe(this,kqe,e.disableMobileAdapter),typeof e.isTrust<"u"&&(this.isTrust=e.isTrust,this.isTrustWallet=e.isTrust),Oqe(this,Iqe,new _qe(Tqe(this,Sqe)))),Tqe(this,kqe)||(this.mobileAdapter=new fqe(this)),super.on("onResponseReady",this.onResponseReady.bind(this)),this.connect()}connect(){this.emit("connect",{chainId:Tqe(this,Eqe)})}enable(){return this.request({method:"eth_requestAccounts"})}sendAsync(e,t){Array.isArray(e)?Promise.all(e.map((e=>this.request(e)))).then((e=>t(null,e))).catch((e=>t(e,null))):this.request(e).then((e=>t(null,e))).catch((e=>t(e,null)))}_send(e){const t={jsonrpc:"2.0",result:null};switch(e.method){case"eth_accounts":case"eth_coinbase":case"net_version":case"eth_chainId":t.result=this.handleStaticRequests({method:"eth_accounts"});break;default:throw new cqe(4200,`Trust does not support calling ${e.method} synchronously without a callback. Please provide a callback parameter to call ${e.method} asynchronously.`)}return t}send(e,t){if("string"==typeof e&&(!t||Array.isArray(t))){const r=this;return new Promise(((n,i)=>{try{const o=r.request({method:e,params:t});o instanceof Promise?o.then(n).catch(i):n(o)}catch(e){i(e)}}))}return e&&"object"==typeof e&&"function"==typeof t?this.request(e).then(t):this._send(e)}internalRequest(e){return super.request(e)}request(e){if(this.mobileAdapter){const t=this.handleStaticRequests(e,(()=>this.mobileAdapter.request(e)));return t instanceof Promise?t:Promise.resolve(t)}return this.handleStaticRequests(e,(()=>this.internalRequest(e)))}handleStaticRequests(e,t){switch(e.method){case"net_version":return Tqe(this,Eqe)?parseInt(Tqe(this,Eqe)):void 0;case"eth_chainId":return Tqe(this,Eqe);case"eth_accounts":case"eth_coinbase":return Tqe(this,xqe)?[Tqe(this,xqe)]:[]}if(t)return t()}onResponseReady(e,t){var r,n,i,o;if(t)switch(e.method){case"eth_requestAccounts":case"requestAccounts":Oqe(this,xqe,t[0]);break;case"wallet_requestPermissions":Oqe(this,xqe,null==(o=null==(i=null==(n=null==(r=t[0])?void 0:r.caveats)?void 0:n[0])?void 0:i.value)?void 0:o[0])}}getNetwork(){return Rqe.NETWORK}get connected(){return!0}get isMetaMask(){return Tqe(this,Aqe)}getChainId(){return Tqe(this,Eqe)}getNetworkVersion(){return this.handleStaticRequests({method:"net_version "})}setChainId(e){Oqe(this,Eqe,e)}setRPCUrl(e){Oqe(this,Sqe,e),Oqe(this,Iqe,new _qe(Tqe(this,Sqe)))}getRPC(){return Tqe(this,Iqe)}setOverwriteMetamask(e){Oqe(this,Aqe,e)}getAddress(){return Tqe(this,xqe)}setAddress(e){Oqe(this,xqe,e)}setRPC(e){Oqe(this,Iqe,e)}};let Pqe=Rqe;Eqe=new WeakMap,Sqe=new WeakMap,kqe=new WeakMap,Aqe=new WeakMap,xqe=new WeakMap,Iqe=new WeakMap,Pqe.NETWORK="ethereum";class Mqe{constructor(e){this.provider=e}async request(e,t){if("getKey"===e.method){const t=await this.provider.internalRequest({method:"requestAccounts",params:e.params}),r=JSON.parse(t);return{algo:"secp256k1",address:r.address,bech32Address:r.address,pubKey:age.from(r.pubKey,"hex")}}const r={signAmino:"signTransaction",signDirect:"signTransaction",signArbitrary:"signMessage",sendTx:"sendTransaction"};return r[e.method]?this.provider.internalRequest({method:r[e.method],params:e.params}):t()}}var Uqe,Lqe=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},jqe=(e,t,r)=>(Lqe(e,t,"read from private field"),r?r.call(e):t.get(e));const Nqe=class extends gye{constructor(e){super(),((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,Uqe,!1),this.isKeplr=!0,this.isTrust=!0,this.isTrustWallet=!0,e&&(typeof e.disableMobileAdapter<"u"&&((e,t,r,n)=>{Lqe(e,t,"write to private field"),n?n.call(e,r):t.set(e,r)})(this,Uqe,e.disableMobileAdapter),typeof e.isKeplr<"u"&&(this.isKeplr=e.isKeplr),typeof e.isTrust<"u"&&(this.isTrust=e.isTrust,this.isTrustWallet=e.isTrust)),jqe(this,Uqe)||(this.mobileAdapter=new Mqe(this))}static bufferToHex(e){return"0x"+age.from(e).toString("hex")}getNetwork(){return Nqe.NETWORK}isMobileAdapterEnabled(){return!jqe(this,Uqe)}enable(e){return this.request({method:"enable",params:{chainIds:e}})}internalRequest(e){return super.request(e)}request(e){const t=()=>this.internalRequest(e);return this.mobileAdapter?this.mobileAdapter.request(e,t):t()}getKey(e){return this.request({method:"getKey",params:{chainId:e}})}async sendTx(e,t,r){const n=age.from(t).toString("base64"),i=await this.request({method:"sendTx",params:{raw:n,chainId:e,mode:r}});return new Uint8Array(age.from(i,"hex"))}async signArbitrary(e,t,r){const n=age.from(r),i=Nqe.bufferToHex(n);return await this.request({method:"signArbitrary",params:{chainId:e,data:i,signerAddress:t}})}async signAmino(e,t,r){const n=await this.request({method:"signAmino",params:{chainId:e,sign_doc:r}}),{signed:i,signature:o}=JSON.parse(n);return{signed:i,signature:o}}async signDirect(e,t,r){const n={bodyBytes:Nqe.bufferToHex(r.bodyBytes),authInfoBytes:Nqe.bufferToHex(r.authInfoBytes)},i=await this.request({method:"signDirect",params:{signerAddress:t,chainId:e,sign_doc:n}}),{signature:o}=JSON.parse(i);return{signed:r,signature:o}}experimentalSuggestChain(){}getOfflineSignerDirect(e){return{getAccounts:async()=>[await this.getKey(e)],signDirect:async(t,r)=>{if(e!==r.chainId)throw new Error("Unmatched chain id with the offline signer");if((await this.getKey(r.chainId)).address!==t)throw new Error("Unknown signer address");return await this.signDirect(e,t,r)}}}getOfflineSigner(e){return this.getOfflineSignerAmino(e)}getOfflineSignerAuto(e){return this.getOfflineSignerAmino(e)}getOfflineSignerAmino(e){return{getAccounts:async()=>{const t=await this.getKey(e);return[{address:t.bech32Address,algo:"secp256k1",pubkey:t.pubKey}]},sign:(t,r)=>this.signAmino(e,t,r),signAmino:(t,r)=>this.signAmino(e,t,r)}}};let zqe=Nqe;Uqe=new WeakMap,zqe.NETWORK="cosmos";var Dqe,Fqe={exports:{}},qqe="object"==typeof Reflect?Reflect:null,Hqe=qqe&&"function"==typeof qqe.apply?qqe.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};Dqe=qqe&&"function"==typeof qqe.ownKeys?qqe.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Vqe=Number.isNaN||function(e){return e!=e};function $qe(){$qe.init.call(this)}Fqe.exports=$qe,Fqe.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}tHe(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&tHe(e,"error",t,r)}(e,i,{once:!0})}))},$qe.EventEmitter=$qe,$qe.prototype._events=void 0,$qe.prototype._eventsCount=0,$qe.prototype._maxListeners=void 0;var Kqe=10;function Zqe(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Wqe(e){return void 0===e._maxListeners?$qe.defaultMaxListeners:e._maxListeners}function Gqe(e,t,r,n){var i,o,s;if(Zqe(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=Wqe(e))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,function(e){console&&console.warn&&console.warn(e)}(a)}return e}function Yqe(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Jqe(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=Yqe.bind(n);return i.listener=r,n.wrapFn=i,i}function Xqe(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)Hqe(a,this,t);else{var c=a.length,u=eHe(a,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},$qe.prototype.listeners=function(e){return Xqe(this,e,!0)},$qe.prototype.rawListeners=function(e){return Xqe(this,e,!1)},$qe.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Qqe.call(e,t)},$qe.prototype.listenerCount=Qqe,$qe.prototype.eventNames=function(){return this._eventsCount>0?Dqe(this._events):[]};const rHe="CALLBACK";class nHe extends Fqe.exports.EventEmitter{setAdapter(e){return this.adapter=e,this}async request(e){try{if(!this.adapter)throw new Error("No adapter set, maybe you forgot to register the provider?");const t=await this.adapter.request(e,this.getNetwork());return this.emit("onResponseReady",e,t),t}catch(e){throw e}}sendResponse(e,t){if(!this.adapter)throw new Error("Adapter not found");if(this.adapter.getStrategy()!==rHe)throw new Error("Trying to send callback request on promisified adapter");this.adapter.sendResponse(e,t)}sendError(e,t){if(!this.adapter)throw new Error("Adapter not found");if(this.adapter.getStrategy()!==rHe)throw new Error("Trying to send callback request on promisified adapter");this.adapter.sendError(e,t)}}const iHe=class extends nHe{constructor(e){super(),this._isConnected=!1,this.chainId=null,this.address=null,e&&e.network&&(this._network=e.network,e.chainId&&(this.chainId=e.chainId))}static bufferToHex(e){return"0x"+age.from(e).toString("hex")}static messageToBuffer(e){let t=age.from([]);try{t="string"==typeof e?age.from(e.replace("0x",""),"hex"):age.from(e)}catch(e){console.log(`messageToBuffer error: ${e}`)}return t}setConfig(e){this._network=e.network,this.address=e.address,this.chainId=e.chainId}async connect(){const e=await this.account();return this._isConnected=!0,this.emit("connect"),e}disconnect(){this._isConnected=!1,this.emit("disconnect")}isConnected(){return this._isConnected}async account(){const e=await this.request({method:"requestAccounts",params:{}});return JSON.parse(e)}network(){return this._network}getNetwork(){return iHe.NETWORK}async signMessage(e){const t="APTOS",r=(await this.account()).address;let n=t;const i=window.location.protocol+"//"+window.location.hostname;e.address&&(n+="\naddress: "+r),e.application&&(n+="\napplication: "+i),e.chainId&&(n+="\nchainId: "+this.chainId),n+="\nmessage: "+e.message,n+="\nnonce: "+e.nonce;const o=age.from(n),s=iHe.bufferToHex(o);return this.request({method:"signMessage",params:{data:s}}).then((o=>({address:r,application:i,chainId:this.chainId,fullMessage:n,message:e.message,nonce:e.nonce,prefix:t,signature:o})))}async signAndSubmitTransaction(e){const t=await this.signTransaction(e),r=await this.request({method:"sendTransaction",params:{tx:t}});return{hash:iHe.messageToBuffer(r).toString()}}async signTransaction(e){const t=await this.request({method:"signTransaction",params:{data:e}});return JSON.parse(iHe.messageToBuffer(t).toString())}};let oHe=iHe;oHe.NETWORK="aptos";var sHe={},aHe={},cHe={},uHe=Symbol.for("nodejs.util.inspect.custom"),lHe={};Object.defineProperty(lHe,"__esModule",{value:!0}),lHe.crc16=void 0,lHe.crc16=function(e){let t=0;const r=age.alloc(e.length+2);r.set(e);for(let e of r){let r=128;for(;r>0;)t<<=1,e&r&&(t+=1),r>>=1,t>65535&&(t&=65535,t^=4129)}return age.from([Math.floor(t/256),t%256])};var dHe,fHe=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cHe,"__esModule",{value:!0}),cHe.address=cHe.Address=void 0;const hHe=fHe(uHe),pHe=lHe;function gHe(e){if("string"==typeof e&&!yHe.isFriendly(e))throw new Error("Unknown address type");const t=age.isBuffer(e)?e:age.from(e,"base64");if(36!==t.length)throw new Error("Unknown address type: byte length is not equal to 36");const r=t.subarray(0,34),n=t.subarray(34,36),i=(0,pHe.crc16)(r);if(i[0]!==n[0]||i[1]!==n[1])throw new Error("Invalid checksum: "+e);let o=r[0],s=!1,a=!1;if(128&o&&(s=!0,o^=128),17!==o&&81!==o)throw"Unknown address tag";a=17===o;let c=null;return c=255===r[1]?-1:r[1],{isTestOnly:s,isBounceable:a,workchain:c,hashPart:r.subarray(2,34)}}class yHe{static isAddress(e){return e instanceof yHe}static isFriendly(e){return 48===e.length&&!!/[A-Za-z0-9+/_-]+/.test(e)}static isRaw(e){if(-1===e.indexOf(":"))return!1;let[t,r]=e.split(":");return!!Number.isInteger(parseFloat(t))&&!!/[a-f0-9]+/.test(r.toLowerCase())&&64===r.length}static normalize(e){return"string"==typeof e?yHe.parse(e).toString():e.toString()}static parse(e){if(yHe.isFriendly(e))return this.parseFriendly(e).address;if(yHe.isRaw(e))return this.parseRaw(e);throw new Error("Unknown address type: "+e)}static parseRaw(e){let t=parseInt(e.split(":")[0]),r=age.from(e.split(":")[1],"hex");return new yHe(t,r)}static parseFriendly(e){if(age.isBuffer(e)){let t=gHe(e);return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new yHe(t.workchain,t.hashPart)}}{let t=gHe(e.replace(/\-/g,"+").replace(/_/g,"/"));return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new yHe(t.workchain,t.hashPart)}}}constructor(e,t){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const e=age.alloc(36);return e.set(this.hash),e.set([this.workChain,this.workChain,this.workChain,this.workChain],32),e},this.toStringBuffer=e=>{let t=!(!e||void 0===e.testOnly)&&e.testOnly,r=!e||void 0===e.bounceable||e.bounceable?17:81;t&&(r|=128);const n=age.alloc(34);n[0]=r,n[1]=this.workChain,n.set(this.hash,2);const i=age.alloc(36);return i.set(n),i.set((0,pHe.crc16)(n),34),i},this.toString=e=>{let t=!e||void 0===e.urlSafe||e.urlSafe,r=this.toStringBuffer(e);return t?r.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):r.toString("base64")},this[dHe]=()=>this.toString(),32!==t.length)throw new Error("Invalid address hash length: "+t.length);this.workChain=e,this.hash=t,Object.freeze(this)}equals(e){return e.workChain===this.workChain&&e.hash.equals(this.hash)}}cHe.Address=yHe,dHe=hHe.default,cHe.address=function(e){return yHe.parse(e)};var mHe,bHe={},vHe=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bHe,"__esModule",{value:!0}),bHe.ExternalAddress=void 0;const wHe=vHe(uHe);class _He{static isAddress(e){return e instanceof _He}constructor(e,t){this[mHe]=()=>this.toString(),this.value=e,this.bits=t}toString(){return`External<${this.bits}:${this.value}>`}}bHe.ExternalAddress=_He,mHe=wHe.default;var EHe={},SHe={};Object.defineProperty(SHe,"__esModule",{value:!0}),SHe.base32Decode=SHe.base32Encode=void 0;const kHe="abcdefghijklmnopqrstuvwxyz234567";function AHe(e,t){const r=e.indexOf(t);if(-1===r)throw new Error("Invalid character found: "+t);return r}SHe.base32Encode=function(e){const t=e.byteLength;let r=0,n=0,i="";for(let o=0;o=5;)i+=kHe[n>>>r-5&31],r-=5;return r>0&&(i+=kHe[n<<5-r&31]),i},SHe.base32Decode=function(e){let t;t=e.toLowerCase();const{length:r}=t;let n=0,i=0,o=0;const s=age.alloc(5*r/8|0);for(let e=0;e=8&&(s[o++]=i>>>n-8&255,n-=8);return s};var xHe,IHe=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(EHe,"__esModule",{value:!0}),EHe.ADNLAddress=void 0;const BHe=IHe(uHe),THe=SHe,CHe=lHe;class OHe{static parseFriendly(e){if(55!==e.length)throw Error("Invalid address");e="f"+e;let t=(0,THe.base32Decode)(e);if(45!==t[0])throw Error("Invalid address");let r=t.slice(33);if(!(0,CHe.crc16)(t.slice(0,33)).equals(r))throw Error("Invalid address");return new OHe(t.slice(1,33))}static parseRaw(e){const t=age.from(e,"base64");return new OHe(t)}constructor(e){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>{let e=age.concat([age.from([45]),this.address]),t=(0,CHe.crc16)(e);return e=age.concat([e,t]),(0,THe.base32Encode)(e).slice(1)},this[xHe]=()=>this.toString(),32!==e.length)throw Error("Invalid address");this.address=e}equals(e){return this.address.equals(e.address)}}EHe.ADNLAddress=OHe,xHe=BHe.default;var RHe,PHe,MHe,UHe={},LHe={},jHe={},NHe={},zHe={};function DHe(){if(RHe)return zHe;RHe=1,Object.defineProperty(zHe,"__esModule",{value:!0}),zHe.paddedBufferToBits=zHe.bitsToPaddedBuffer=void 0;const e=qHe(),t=FHe();return zHe.bitsToPaddedBuffer=function(t){let r=new e.BitBuilder(8*Math.ceil(t.length/8));r.writeBits(t);let n=8*Math.ceil(t.length/8)-t.length;for(let e=0;e=0;t--)if(0!==e[t]){const n=e[t];let i=n&-n;1&i||(i=Math.log2(i)+1),t>0&&(r=t<<3),r+=8-i;break}return new t.BitString(e,0,r)},zHe}function FHe(){if(PHe)return NHe;PHe=1;var t,r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(NHe,"__esModule",{value:!0}),NHe.BitString=void 0;const n=DHe(),i=r(uHe);class o{static isBitString(e){return e instanceof o}constructor(e,r,n){if(this[t]=()=>this.toString(),n<0)throw new Error(`Length ${n} is out of bounds`);this._length=n,this._data=e,this._offset=r}get length(){return this._length}at(e){if(e>=this._length)throw new Error(`Index ${e} > ${this._length} is out of bounds`);if(e<0)throw new Error(`Index ${e} < 0 is out of bounds`);let t=this._offset+e>>3,r=7-(this._offset+e)%8;return!!(this._data[t]&1<this._length)throw new Error(`Offset(${e}) > ${this._length} is out of bounds`);if(e<0)throw new Error(`Offset(${e}) < 0 is out of bounds`);if(0===t)return o.EMPTY;if(e+t>this._length)throw new Error(`Offset ${e} + Length ${t} > ${this._length} is out of bounds`);return new o(this._data,this._offset+e,t)}subbuffer(e,t){if(e>this._length)throw new Error(`Offset ${e} is out of bounds`);if(e<0)throw new Error(`Offset ${e} is out of bounds`);if(e+t>this._length)throw new Error(`Offset + Lenght = ${e+t} is out of bounds`);if(t%8!=0)return null;if((this._offset+e)%8!=0)return null;let r=this._offset+e>>3,n=r+(t>>3);return this._data.subarray(r,n)}equals(e){if(this._length!==e._length)return!1;for(let t=0;t8*this._buffer.length)throw new Error("BitBuilder overflow");("boolean"==typeof e&&!0===e||"number"==typeof e&&e>0)&&(this._buffer[t/8|0]|=1<<7-t%8),this._length++}writeBits(e){for(let t=0;t8*this._buffer.length)throw new Error("BitBuilder overflow");e.copy(this._buffer,this._length/8),this._length+=8*e.length}else for(let t=0;t=n)throw Error(`bitLength is too small for a value ${e}. Got ${t}`);if(this._length+t>8*this._buffer.length)throw new Error("BitBuilder overflow");const i=8-this._length%8;if(i>0){const e=Math.floor(this._length/8);if(t>BigInt(t-i));this._buffer[e]|=n,this._length+=i}}for(t-=i;t>0;)t>=8?(this._buffer[this._length/8]=Number(r>>BigInt(t-8)&0xffn),this._length+=8,t-=8):(this._buffer[this._length/8]=Number(r<=n)throw Error(`value is out of range for ${t} bits. Got ${e}`);r<0?(this.writeBit(!0),r=n+r):this.writeBit(!1),this.writeUint(r,t-1)}writeVarUint(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(r<0)throw Error(`value is negative. Got ${e}`);if(0n===r)return void this.writeUint(0,t);const n=Math.ceil(r.toString(2).length/8),i=8*n;this.writeUint(n,t),this.writeUint(r,i)}writeVarInt(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(0n===r)return void this.writeUint(0,t);let n=r>0?r:-r;const i=1+Math.ceil(n.toString(2).length/8),o=8*i;this.writeUint(i,t),this.writeInt(r,o)}writeCoins(e){this.writeVarUint(e,4)}writeAddress(r){if(null!=r){if(e.Address.isAddress(r))return this.writeUint(2,2),this.writeUint(0,1),this.writeInt(r.workChain,8),void this.writeBuffer(r.hash);if(t.ExternalAddress.isAddress(r))return this.writeUint(1,2),this.writeUint(r.bits,9),void this.writeUint(r.value,r.bits);throw Error(`Invalid address. Got ${r}`)}this.writeUint(0,2)}build(){return new r.BitString(this._buffer,0,this._length)}buffer(){if(this._length%8!=0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}},jHe}var HHe,VHe={},$He={};Object.defineProperty($He,"__esModule",{value:!0}),$He.CellType=void 0,function(e){e[e.Ordinary=-1]="Ordinary",e[e.PrunedBranch=1]="PrunedBranch",e[e.Library=2]="Library",e[e.MerkleProof=3]="MerkleProof",e[e.MerkleUpdate=4]="MerkleUpdate"}(HHe||($He.CellType=HHe={}));var KHe={},ZHe={},WHe={},GHe={};Object.defineProperty(GHe,"__esModule",{value:!0}),GHe.readUnaryLength=void 0,GHe.readUnaryLength=function(e){let t=0;for(;e.loadBit();)t++;return t};var YHe={},JHe={};Object.defineProperty(JHe,"__esModule",{value:!0}),JHe.BitReader=void 0;const XHe=cHe,QHe=bHe;class eVe{constructor(e,t=0){this._checkpoints=[],this._bits=e,this._offset=t}get offset(){return this._offset}get remaining(){return this._bits.length-this._offset}skip(e){if(e<0||this._offset+e>this._bits.length)throw new Error(`Index ${this._offset+e} is out of bounds`);this._offset+=e}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let e=this._bits.at(this._offset);return this._offset++,e}preloadBit(){return this._bits.at(this._offset)}loadBits(e){let t=this._bits.substring(this._offset,e);return this._offset+=e,t}preloadBits(e){return this._bits.substring(this._offset,e)}loadBuffer(e){let t=this._preloadBuffer(e,this._offset);return this._offset+=8*e,t}preloadBuffer(e){return this._preloadBuffer(e,this._offset)}loadUint(e){return this._toSafeInteger(this.loadUintBig(e),"loadUintBig")}loadUintBig(e){let t=this.preloadUintBig(e);return this._offset+=e,t}preloadUint(e){return this._toSafeInteger(this._preloadUint(e,this._offset),"preloadUintBig")}preloadUintBig(e){return this._preloadUint(e,this._offset)}loadInt(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,this._toSafeInteger(t,"loadUintBig")}loadIntBig(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,t}preloadInt(e){return this._toSafeInteger(this._preloadInt(e,this._offset),"preloadIntBig")}preloadIntBig(e){return this._preloadInt(e,this._offset)}loadVarUint(e){let t=Number(this.loadUint(e));return this._toSafeInteger(this.loadUintBig(8*t),"loadVarUintBig")}loadVarUintBig(e){let t=Number(this.loadUint(e));return this.loadUintBig(8*t)}preloadVarUint(e){let t=Number(this._preloadUint(e,this._offset));return this._toSafeInteger(this._preloadUint(8*t,this._offset+e),"preloadVarUintBig")}preloadVarUintBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadUint(8*t,this._offset+e)}loadVarInt(e){let t=Number(this.loadUint(e));return this._toSafeInteger(this.loadIntBig(8*t),"loadVarIntBig")}loadVarIntBig(e){let t=Number(this.loadUint(e));return this.loadIntBig(8*t)}preloadVarInt(e){let t=Number(this._preloadUint(e,this._offset));return this._toSafeInteger(this._preloadInt(8*t,this._offset+e),"preloadVarIntBig")}preloadVarIntBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadInt(8*t,this._offset+e)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let e=Number(this._preloadUint(2,this._offset));if(2===e)return this._loadInternalAddress();throw new Error("Invalid address: "+e)}loadMaybeAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(1===Number(this._preloadUint(2,this._offset)))return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(1===e)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();if(1===e)return this._loadExternalAddress();throw 3===e?Error("Unsupported"):Error("Unreachable")}loadPaddedBits(e){if(e%8!=0)throw new Error("Invalid number of bits");let t=e;for(;;){if(this._bits.at(this._offset+t-1)){t--;break}t--}let r=this._bits.substring(this._offset,t);return this._offset+=e,r}clone(){return new eVe(this._bits,this._offset)}_preloadInt(e,t){if(0==e)return 0n;let r=this._bits.at(t),n=0n;for(let r=0;rl+"0"===e.slice(0,l.length+1)));r=n(l+"0",r.beginParse(),o-u-1,e)}if(!i.isExotic){const e=s.filter((e=>l+"1"===e.slice(0,l.length+1)));i=n(l+"1",i.beginParse(),o-u-1,e)}return(0,e.beginCell)().storeSlice(t).storeRef(r).storeRef(i).endCell()}}function i(t,r,i){return r.forEach((e=>{if(!t.has(e))throw new Error(`Trying to generate merkle proof for a missing key "${e}"`)})),n("",(0,e.beginCell)().storeDictDirect(t).asSlice(),i.bits,r.map((e=>i.serialize(e).toString(2).padStart(i.bits,"0"))))}return WHe.generateMerkleProofDirect=i,WHe.generateMerkleProof=function(e,t,n){return(0,r.convertToMerkleProof)(i(e,t,n))},WHe}JHe.BitReader=eVe;var oVe,sVe={};function aVe(){if(oVe)return sVe;oVe=1,Object.defineProperty(sVe,"__esModule",{value:!0}),sVe.generateMerkleUpdate=void 0;const e=vKe(),t=iVe();return sVe.generateMerkleUpdate=function(r,n,i,o){const s=(0,t.generateMerkleProof)(r,[n],i).refs[0];r.set(n,o);const a=(0,t.generateMerkleProof)(r,[n],i).refs[0];return c=s,u=a,(0,e.beginCell)().storeUint(4,8).storeBuffer(c.hash(0)).storeBuffer(u.hash(0)).storeUint(c.depth(0),16).storeUint(u.depth(0),16).storeRef(c).storeRef(u).endCell({exotic:!0});var c,u},sVe}var cVe={};function uVe(e,t,r,n,i){let o=0,s=e;if(0==(t.loadBit()?1:0)){o=function(e){let t=0;for(;e.loadBit();)t++;return t}(t);for(let e=0;e0&&t.storeUint(BigInt("0b"+e),e.length),t}function a(e,t,r){r.storeBit(1),r.storeBit(0);let n=Math.ceil(Math.log2(t+1));return r.storeUint(e.length,n),e.length>0&&r.storeUint(BigInt("0b"+e),e.length),r}function c(e,t,r,n){n.storeBit(1),n.storeBit(1),n.storeBit(e);let i=Math.ceil(Math.log2(r+1));n.storeUint(t,i)}function u(e,t){let r="short",n=function(e){return 1+e.length+1+e.length}(e),i=function(e,t){return 2+Math.ceil(Math.log2(t+1))+e.length}(e,t);if(i(0,c.deserializeInternalKey)(e)))}values(){return Array.from(this._map.values())}store(e,r,n){if(0===this._map.size)e.storeBit(0);else{let i=this._key;null!=r&&(i=r);let o=this._value;if(null!=n&&(o=n),!i)throw Error("Key serializer is not defined");if(!o)throw Error("Value serializer is not defined");let s=new Map;for(const[e,t]of this._map)s.set(i.serialize((0,c.deserializeInternalKey)(e)),t);e.storeBit(1);let u=(0,t.beginCell)();(0,a.serializeDict)(s,i.bits,o.serialize,u),e.storeRef(u.endCell())}}storeDirect(e,t,r){if(0===this._map.size)throw Error("Cannot store empty dictionary directly");let n=this._key;null!=t&&(n=t);let i=this._value;if(null!=r&&(i=r),!n)throw Error("Key serializer is not defined");if(!i)throw Error("Value serializer is not defined");let o=new Map;for(const[e,t]of this._map)o.set(n.serialize((0,c.deserializeInternalKey)(e)),t);(0,a.serializeDict)(o,n.bits,i.serialize,e)}generateMerkleProof(e){return(0,i.generateMerkleProof)(this,e,this._key)}generateMerkleProofDirect(e){return(0,i.generateMerkleProofDirect)(this,e,this._key)}generateMerkleUpdate(e,t){return(0,o.generateMerkleUpdate)(this,e,this._key,t)}}return ZHe.Dictionary=u,u.Keys={Address:()=>({bits:267,serialize:r=>{if(!e.Address.isAddress(r))throw Error("Key is not an address");return(0,t.beginCell)().storeAddress(r).endCell().beginParse().preloadUintBig(267)},parse:e=>(0,t.beginCell)().storeUint(e,267).endCell().beginParse().loadAddress()}),BigInt:e=>function(e){return{bits:e,serialize:r=>{if("bigint"!=typeof r)throw Error("Key is not a bigint");return(0,t.beginCell)().storeInt(r,e).endCell().beginParse().loadUintBig(e)},parse:r=>(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadIntBig(e)}}(e),Int:e=>function(e){return{bits:e,serialize:r=>{if("number"!=typeof r)throw Error("Key is not a number");if(!Number.isSafeInteger(r))throw Error("Key is not a safe integer: "+r);return(0,t.beginCell)().storeInt(r,e).endCell().beginParse().loadUintBig(e)},parse:r=>(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadInt(e)}}(e),BigUint:e=>function(e){return{bits:e,serialize:r=>{if("bigint"!=typeof r)throw Error("Key is not a bigint");if(r<0)throw Error("Key is negative: "+r);return(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadUintBig(e)},parse:r=>(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadUintBig(e)}}(e),Uint:e=>function(e){return{bits:e,serialize:r=>{if("number"!=typeof r)throw Error("Key is not a number");if(!Number.isSafeInteger(r))throw Error("Key is not a safe integer: "+r);if(r<0)throw Error("Key is negative: "+r);return(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadUintBig(e)},parse:r=>Number((0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadUint(e))}}(e),Buffer:e=>function(e){return{bits:8*e,serialize:r=>{if(!age.isBuffer(r))throw Error("Key is not a buffer");return(0,t.beginCell)().storeBuffer(r).endCell().beginParse().loadUintBig(8*e)},parse:r=>(0,t.beginCell)().storeUint(r,8*e).endCell().beginParse().loadBuffer(e)}}(e),BitString:e=>function(e){return{bits:e,serialize:r=>{if(!n.BitString.isBitString(r))throw Error("Key is not a BitString");return(0,t.beginCell)().storeBits(r).endCell().beginParse().loadUintBig(e)},parse:r=>(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadBits(e)}}(e)},u.Values={BigInt:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadIntBig(e)}}(e),Int:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadInt(e)}}(e),BigVarInt:e=>function(e){return{serialize:(t,r)=>{r.storeVarInt(t,e)},parse:t=>t.loadVarIntBig(e)}}(e),BigUint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUintBig(e)}}(e),Uint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUint(e)}}(e),BigVarUint:e=>function(e){return{serialize:(t,r)=>{r.storeVarUint(t,e)},parse:t=>t.loadVarUintBig(e)}}(e),Bool:()=>({serialize:(e,t)=>{t.storeBit(e)},parse:e=>e.loadBit()}),Address:()=>({serialize:(e,t)=>{t.storeAddress(e)},parse:e=>e.loadAddress()}),Cell:()=>({serialize:(e,t)=>{t.storeRef(e)},parse:e=>e.loadRef()}),Buffer:e=>function(e){return{serialize:(t,r)=>{if(t.length!==e)throw Error("Invalid buffer size");r.storeBuffer(t)},parse:t=>t.loadBuffer(e)}}(e),BitString:e=>function(e){return{serialize:(t,r)=>{if(t.length!==e)throw Error("Invalid BitString size");r.storeBits(t)},parse:t=>t.loadBits(e)}}(e),Dictionary:(e,t)=>function(e,t){return{serialize:(e,t)=>{e.store(t)},parse:r=>u.load(e,t,r)}}(e,t)},ZHe}pVe.serializeInternalKey=function(e){if("number"==typeof e){if(!Number.isSafeInteger(e))throw Error("Invalid key type: not a safe integer: "+e);return"n:"+e.toString(10)}if("bigint"==typeof e)return"b:"+e.toString(10);if(gVe.Address.isAddress(e))return"a:"+e.toString();if(age.isBuffer(e))return"f:"+e.toString("hex");if(yVe.BitString.isBitString(e))return"B:"+e.toString();throw Error("Invalid key type")},pVe.deserializeInternalKey=function(e){let t=e.slice(0,2),r=e.slice(2);if("n:"===t)return parseInt(r,10);if("b:"===t)return BigInt(r);if("a:"===t)return gVe.Address.parse(r);if("f:"===t)return age.from(r,"hex");if("B:"===t){const e="_"==r.slice(-1);if(e||r.length%2!=0){let t=e?r.length-1:r.length;const n=r.substr(0,t)+"0";return!e&&1&t?new yVe.BitString(age.from(n,"hex"),0,t<<2):(0,mVe.paddedBufferToBits)(age.from(n,"hex"))}return new yVe.BitString(age.from(r,"hex"),0,r.length<<2)}throw Error("Invalid key type: "+t)};var wVe,_Ve,EVe={};function SVe(){if(wVe)return EVe;wVe=1,Object.defineProperty(EVe,"__esModule",{value:!0}),EVe.writeString=EVe.stringToCell=EVe.readString=void 0;const e=vKe();function t(e){if(e.remainingBits%8!=0)throw new Error(`Invalid string length: ${e.remainingBits}`);if(0!==e.remainingRefs&&1!==e.remainingRefs)throw new Error(`invalid number of refs: ${e.remainingRefs}`);let r;return r=0===e.remainingBits?age.alloc(0):e.loadBuffer(e.remainingBits/8),1===e.remainingRefs&&(r=age.concat([r,t(e.loadRef().beginParse())])),r}function r(t,n){if(t.length>0){let i=Math.floor(n.availableBits/8);if(t.length>i){let o=t.subarray(0,i),s=t.subarray(i);n=n.storeBuffer(o);let a=(0,e.beginCell)();r(s,a),n=n.storeRef(a.endCell())}else n=n.storeBuffer(t)}}return EVe.readString=function(e){return t(e).toString()},EVe.stringToCell=function(t){let n=(0,e.beginCell)();return r(age.from(t),n),n.endCell()},EVe.writeString=function(e,t){r(age.from(e),t)},EVe}function kVe(){if(_Ve)return KHe;_Ve=1;var t,r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(KHe,"__esModule",{value:!0}),KHe.Slice=void 0;const n=r(uHe),i=vVe(),o=vKe(),s=SVe();class a{constructor(e,r){this[t]=()=>this.toString(),this._reader=e.clone(),this._refs=[...r],this._refsOffset=0}get remainingBits(){return this._reader.remaining}get offsetBits(){return this._reader.offset}get remainingRefs(){return this._refs.length-this._refsOffset}get offsetRefs(){return this._refsOffset}skip(e){return this._reader.skip(e),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(e){return this._reader.loadBits(e)}preloadBits(e){return this._reader.preloadBits(e)}loadUint(e){return this._reader.loadUint(e)}loadUintBig(e){return this._reader.loadUintBig(e)}preloadUint(e){return this._reader.preloadUint(e)}preloadUintBig(e){return this._reader.preloadUintBig(e)}loadMaybeUint(e){return this.loadBit()?this.loadUint(e):null}loadMaybeUintBig(e){return this.loadBit()?this.loadUintBig(e):null}loadInt(e){return this._reader.loadInt(e)}loadIntBig(e){return this._reader.loadIntBig(e)}preloadInt(e){return this._reader.preloadInt(e)}preloadIntBig(e){return this._reader.preloadIntBig(e)}loadMaybeInt(e){return this.loadBit()?this.loadInt(e):null}loadMaybeIntBig(e){return this.loadBit()?this.loadIntBig(e):null}loadVarUint(e){return this._reader.loadVarUint(e)}loadVarUintBig(e){return this._reader.loadVarUintBig(e)}preloadVarUint(e){return this._reader.preloadVarUint(e)}preloadVarUintBig(e){return this._reader.preloadVarUintBig(e)}loadVarInt(e){return this._reader.loadVarInt(e)}loadVarIntBig(e){return this._reader.loadVarIntBig(e)}preloadVarInt(e){return this._reader.preloadVarInt(e)}preloadVarIntBig(e){return this._reader.preloadVarIntBig(e)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset++]}preloadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(e){return this._reader.loadBuffer(e)}preloadBuffer(e){return this._reader.preloadBuffer(e)}loadStringTail(){return(0,s.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,s.readString)(this):null}loadStringRefTail(){return(0,s.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){const e=this.loadMaybeRef();return e?(0,s.readString)(e.beginParse()):null}loadDict(e,t){return i.Dictionary.load(e,t,this)}loadDictDirect(e,t){return i.Dictionary.loadDirect(e,t,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,o.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,o.beginCell)().storeSlice(this)}clone(e=!1){if(e){let e=this._reader.clone();return e.reset(),new a(e,this._refs)}{let e=new a(this._reader,this._refs);return e._refsOffset=this._refsOffset,e}}toString(){return this.asCell().toString()}}return KHe.Slice=a,t=n.default,KHe}var AVe={},xVe={};Object.defineProperty(xVe,"__esModule",{value:!0}),xVe.exoticLibrary=void 0;const IVe=JHe;xVe.exoticLibrary=function(e,t){const r=new IVe.BitReader(e);if(264!==e.length)throw new Error(`Library cell must have exactly (8 + 256) bits, got "${e.length}"`);let n=r.loadUint(8);if(2!==n)throw new Error(`Library cell must have type 2, got "${n}"`);return{}};var BVe={};Object.defineProperty(BVe,"__esModule",{value:!0}),BVe.exoticMerkleUpdate=void 0;const TVe=JHe;BVe.exoticMerkleUpdate=function(e,t){const r=new TVe.BitReader(e);if(552!==e.length)throw new Error(`Merkle Update cell must have exactly (8 + (2 * (256 + 16))) bits, got "${e.length}"`);if(2!==t.length)throw new Error(`Merkle Update cell must have exactly 2 refs, got "${t.length}"`);let n=r.loadUint(8);if(4!==n)throw new Error(`Merkle Update cell type must be exactly 4, got "${n}"`);const i=r.loadBuffer(32),o=r.loadBuffer(32),s=r.loadUint(16),a=r.loadUint(16);if(s!==t[0].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${s}", got "${t[0].depth(0)}"`);if(!i.equals(t[0].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${i.toString("hex")}", got "${t[0].hash(0).toString("hex")}"`);if(a!==t[1].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${a}", got "${t[1].depth(0)}"`);if(!o.equals(t[1].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${o.toString("hex")}", got "${t[1].hash(0).toString("hex")}"`);return{proofDepth1:s,proofDepth2:a,proofHash1:i,proofHash2:o}};var CVe={},OVe={};Object.defineProperty(OVe,"__esModule",{value:!0}),OVe.LevelMask=void 0;class RVe{constructor(e=0){this._mask=0,this._mask=e,this._hashIndex=function(e){return 16843009*((e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135)>>24}(this._mask),this._hashCount=this._hashIndex+1}get value(){return this._mask}get level(){return 32-Math.clz32(this._mask)}get hashIndex(){return this._hashIndex}get hashCount(){return this._hashCount}apply(e){return new RVe(this._mask&(1<>e-1)%2!=0}}OVe.LevelMask=RVe,Object.defineProperty(CVe,"__esModule",{value:!0}),CVe.exoticPruned=void 0;const PVe=JHe,MVe=OVe;var UVe;function LVe(){if(UVe)return AVe;UVe=1,Object.defineProperty(AVe,"__esModule",{value:!0}),AVe.resolveExotic=void 0;const e=JHe,t=$He,r=xVe,n=nVe(),i=BVe,o=CVe,s=OVe;return AVe.resolveExotic=function(a,c){let u=new e.BitReader(a).preloadUint(8);if(1===u)return function(e,r){let n=(0,o.exoticPruned)(e,r),i=[],a=[],c=new s.LevelMask(n.mask);for(let e=0;e>1);return{type:t.CellType.MerkleProof,depths:[],hashes:[],mask:i}}(a,c);if(4===u)return function(e,r){(0,i.exoticMerkleUpdate)(e,r);let n=new s.LevelMask((r[0].level()|r[1].level())>>1);return{type:t.CellType.MerkleUpdate,depths:[],hashes:[],mask:n}}(a,c);throw Error("Invalid exotic cell type: "+u)},AVe}CVe.exoticPruned=function(e,t){let r,n=new PVe.BitReader(e),i=n.loadUint(8);if(1!==i)throw new Error(`Pruned branch cell must have type 1, got "${i}"`);if(0!==t.length)throw new Error(`Pruned Branch cell can't has refs, got "${t.length}"`);if(280===e.length)r=new MVe.LevelMask(1);else{if(r=new MVe.LevelMask(n.loadUint(8)),r.level<1||r.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${r.level}/${r.value}"`);const t=16+272*r.apply(r.level-1).hashCount;if(e.length!==t)throw new Error(`Pruned branch cell must have exactly ${t} bits, got "${e.length}"`)}let o=[],s=[],a=[];for(let e=0;e>>3,u=-1===n?3:0;for(i=0;i>>2,a.length<=o&&a.push(0),a[o]|=e[i]<<8*(u+n*(s%4));return{value:a,binLen:8*e.length+r}}function r(r,n,i){switch(n){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(e,t,r){return function(e,t,r,n){var i,o,s,a;if(0!=e.length%2)throw new Error("String of HEX type must be in byte increments");var c=t||[0],u=(r=r||0)>>>3,l=-1===n?3:0;for(i=0;i>>1)+u)>>>2;c.length<=s;)c.push(0);c[s]|=o<<8*(l+n*(a%4))}return{value:c,binLen:4*e.length+r}}(e,t,r,i)};case"TEXT":return function(e,t,r){return function(e,t,r,n,i){var o,s,a,c,u,l,d,f,h=0,p=r||[0],g=(n=n||0)>>>3;if("UTF8"===t)for(d=-1===i?3:0,a=0;a(o=e.charCodeAt(a))?s.push(o):2048>o?(s.push(192|o>>>6),s.push(128|63&o)):55296>o||57344<=o?s.push(224|o>>>12,128|o>>>6&63,128|63&o):(a+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(a)),s.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),c=0;c>>2;p.length<=u;)p.push(0);p[u]|=s[c]<<8*(d+i*(l%4)),h+=1}else for(d=-1===i?2:0,f="UTF16LE"===t&&1!==i||"UTF16LE"!==t&&1===i,a=0;a>>8),u=(l=h+g)>>>2;p.length<=u;)p.push(0);p[u]|=o<<8*(d+i*(l%4)),h+=2}return{value:p,binLen:8*h+n}}(e,n,t,r,i)};case"B64":return function(t,r,n){return function(t,r,n,i){var o,s,a,c,u,l,d=0,f=r||[0],h=(n=n||0)>>>3,p=-1===i?3:0,g=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==g&&g{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return YWe(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:pGe,global:gGe,isContextDefined:yGe,ALPHABET:kGe,generateString:(e=16,t=kGe.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&eGe(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(rGe(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=YWe(e)?[]:{};return hGe(e,((e,t)=>{const o=r(e,n+1);!JWe(o)&&(i[t]=o)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:AGe,isThenable:e=>e&&(rGe(e)||eGe(e))&&eGe(e.then)&&eGe(e.catch),setImmediate:xGe,asap:OGe};function PGe(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}RGe.inherits(PGe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:RGe.toJSONObject(this.config),code:this.code,status:this.status}}});const MGe=PGe.prototype,UGe={};function LGe(e){return RGe.isPlainObject(e)||RGe.isArray(e)}function jGe(e){return RGe.endsWith(e,"[]")?e.slice(0,-2):e}function NGe(e,t,r){return e?e.concat(t).map((function(e,t){return e=jGe(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{UGe[e]={value:e}})),Object.defineProperties(PGe,UGe),Object.defineProperty(MGe,"isAxiosError",{value:!0}),PGe.from=(e,t,r,n,i,o)=>{const s=Object.create(MGe);return RGe.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),PGe.call(s,e.message,t,r,n,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const zGe=RGe.toFlatObject(RGe,{},null,(function(e){return/^is[A-Z]/.test(e)}));function DGe(e,t,r){if(!RGe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=RGe.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!RGe.isUndefined(t[e])}))).metaTokens,i=r.visitor||u,o=r.dots,s=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&RGe.isSpecCompliantForm(t);if(!RGe.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(RGe.isDate(e))return e.toISOString();if(!a&&RGe.isBlob(e))throw new PGe("Blob is not supported. Use a Buffer instead.");return RGe.isArrayBuffer(e)||RGe.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):age.from(e):e}function u(e,r,i){let a=e;if(e&&!i&&"object"==typeof e)if(RGe.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(RGe.isArray(e)&&function(e){return RGe.isArray(e)&&!e.some(LGe)}(e)||(RGe.isFileList(e)||RGe.endsWith(r,"[]"))&&(a=RGe.toArray(e)))return r=jGe(r),a.forEach((function(e,n){!RGe.isUndefined(e)&&null!==e&&t.append(!0===s?NGe([r],n,o):null===s?r:r+"[]",c(e))})),!1;return!!LGe(e)||(t.append(NGe(i,r,o),c(e)),!1)}const l=[],d=Object.assign(zGe,{defaultVisitor:u,convertValue:c,isVisitable:LGe});if(!RGe.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!RGe.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),RGe.forEach(r,(function(r,o){!0===(!(RGe.isUndefined(r)||null===r)&&i.call(t,r,RGe.isString(o)?o.trim():o,n,d))&&e(r,n?n.concat(o):[o])})),l.pop()}}(e),t}function FGe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function qGe(e,t){this._pairs=[],e&&DGe(e,this,t)}const HGe=qGe.prototype;function VGe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $Ge(e,t,r){if(!t)return e;const n=r&&r.encode||VGe;RGe.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let o;if(o=i?i(t,r):RGe.isURLSearchParams(t)?t.toString():new qGe(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}HGe.append=function(e,t){this._pairs.push([e,t])},HGe.toString=function(e){const t=e?function(t){return e.call(this,t,FGe)}:FGe;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var KGe=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){RGe.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ZGe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},WGe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:qGe,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const GGe="undefined"!=typeof window&&"undefined"!=typeof document,YGe="object"==typeof navigator&&navigator||void 0,JGe=GGe&&(!YGe||["ReactNative","NativeScript","NS"].indexOf(YGe.product)<0),XGe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,QGe=GGe&&window.location.href||"http://localhost";var eYe={...Object.freeze({__proto__:null,hasBrowserEnv:GGe,hasStandardBrowserWebWorkerEnv:XGe,hasStandardBrowserEnv:JGe,navigator:YGe,origin:QGe}),...WGe};function tYe(e){function t(e,r,n,i){let o=e[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=e.length;return o=!o&&RGe.isArray(n)?n.length:o,a?(RGe.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!s):(n[o]&&RGe.isObject(n[o])||(n[o]=[]),t(e,r,n[o],i)&&RGe.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n{t(function(e){return RGe.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const rYe={transitional:ZGe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=RGe.isObject(e);if(i&&RGe.isHTMLForm(e)&&(e=new FormData(e)),RGe.isFormData(e))return n?JSON.stringify(tYe(e)):e;if(RGe.isArrayBuffer(e)||RGe.isBuffer(e)||RGe.isStream(e)||RGe.isFile(e)||RGe.isBlob(e)||RGe.isReadableStream(e))return e;if(RGe.isArrayBufferView(e))return e.buffer;if(RGe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return DGe(e,new eYe.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return eYe.isNode&&RGe.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=RGe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return DGe(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(RGe.isString(e))try{return(t||JSON.parse)(e),RGe.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||rYe.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(RGe.isResponse(e)||RGe.isReadableStream(e))return e;if(e&&RGe.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw PGe.from(e,PGe.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:eYe.classes.FormData,Blob:eYe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};RGe.forEach(["delete","get","head","post","put","patch"],(e=>{rYe.headers[e]={}}));var nYe=rYe;const iYe=RGe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oYe=Symbol("internals");function sYe(e){return e&&String(e).trim().toLowerCase()}function aYe(e){return!1===e||null==e?e:RGe.isArray(e)?e.map(aYe):String(e)}function cYe(e,t,r,n,i){return RGe.isFunction(n)?n.call(this,t,r):(i&&(t=r),RGe.isString(t)?RGe.isString(n)?-1!==t.indexOf(n):RGe.isRegExp(n)?n.test(t):void 0:void 0)}class uYe{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=sYe(t);if(!i)throw new Error("header name must be a non-empty string");const o=RGe.findKey(n,i);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=aYe(e))}const o=(e,t)=>RGe.forEach(e,((e,r)=>i(e,r,t)));if(RGe.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(RGe.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&iYe[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t);else if(RGe.isHeaders(e))for(const[t,n]of e.entries())i(n,t,r);else null!=e&&i(t,e,r);return this}get(e,t){if(e=sYe(e)){const r=RGe.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(RGe.isFunction(t))return t.call(this,e,r);if(RGe.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=sYe(e)){const r=RGe.findKey(this,e);return!(!r||void 0===this[r]||t&&!cYe(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=sYe(e)){const i=RGe.findKey(r,e);!i||t&&!cYe(0,r[i],i,t)||(delete r[i],n=!0)}}return RGe.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!cYe(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return RGe.forEach(this,((n,i)=>{const o=RGe.findKey(r,i);if(o)return t[o]=aYe(n),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();s!==i&&delete t[i],t[s]=aYe(n),r[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return RGe.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&RGe.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[oYe]=this[oYe]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=sYe(e);t[n]||(function(e,t){const r=RGe.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return RGe.isArray(e)?e.forEach(n):n(e),this}}uYe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),RGe.reduceDescriptors(uYe.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),RGe.freezeMethods(uYe);var lYe=uYe;function dYe(e,t){const r=this||nYe,n=t||r,i=lYe.from(n.headers);let o=n.data;return RGe.forEach(e,(function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function fYe(e){return!(!e||!e.__CANCEL__)}function hYe(e,t,r){PGe.call(this,null==e?"canceled":e,PGe.ERR_CANCELED,t,r),this.name="CanceledError"}function pYe(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new PGe("Request failed with status code "+r.status,[PGe.ERR_BAD_REQUEST,PGe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}RGe.inherits(hYe,PGe,{__CANCEL__:!0});const gYe=(e,t,r=3)=>{let n=0;const i=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=n[s];i||(i=c),r[o]=a,n[o]=c;let l=s,d=0;for(;l!==o;)d+=r[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i{i=o,r=null,n&&(clearTimeout(n),n=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=o?s(e,t):(r=e,n||(n=setTimeout((()=>{n=null,s(r)}),o-a)))},()=>r&&s(r)]}((r=>{const o=r.loaded,s=r.lengthComputable?r.total:void 0,a=o-n,c=i(a);n=o,e({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:r,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),r)},yYe=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},mYe=e=>(...t)=>RGe.asap((()=>e(...t)));var bYe=eYe.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,eYe.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(eYe.origin),eYe.navigator&&/(msie|trident)/i.test(eYe.navigator.userAgent)):()=>!0,vYe=eYe.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const s=[e+"="+encodeURIComponent(t)];RGe.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),RGe.isString(n)&&s.push("path="+n),RGe.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function wYe(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const _Ye=e=>e instanceof lYe?{...e}:e;function EYe(e,t){t=t||{};const r={};function n(e,t,r,n){return RGe.isPlainObject(e)&&RGe.isPlainObject(t)?RGe.merge.call({caseless:n},e,t):RGe.isPlainObject(t)?RGe.merge({},t):RGe.isArray(t)?t.slice():t}function i(e,t,r,i){return RGe.isUndefined(t)?RGe.isUndefined(e)?void 0:n(void 0,e,0,i):n(e,t,0,i)}function o(e,t){if(!RGe.isUndefined(t))return n(void 0,t)}function s(e,t){return RGe.isUndefined(t)?RGe.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,i,o){return o in t?n(r,i):o in e?n(void 0,r):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,r)=>i(_Ye(e),_Ye(t),0,!0)};return RGe.forEach(Object.keys(Object.assign({},e,t)),(function(n){const o=c[n]||i,s=o(e[n],t[n],n);RGe.isUndefined(s)&&o!==a||(r[n]=s)})),r}var SYe=e=>{const t=EYe({},e);let r,{data:n,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:c}=t;if(t.headers=a=lYe.from(a),t.url=$Ge(wYe(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),RGe.isFormData(n))if(eYe.hasStandardBrowserEnv||eYe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(r=a.getContentType())){const[e,...t]=r?r.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(eYe.hasStandardBrowserEnv&&(i&&RGe.isFunction(i)&&(i=i(t)),i||!1!==i&&bYe(t.url))){const e=o&&s&&vYe.read(s);e&&a.set(o,e)}return t},kYe="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const n=SYe(e);let i=n.data;const o=lYe.from(n.headers).normalize();let s,a,c,u,l,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=n;function p(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function y(){if(!g)return;const n=lYe.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());pYe((function(e){t(e),p()}),(function(e){r(e),p()}),{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:n,config:e,request:g}),g=null}g.open(n.method.toUpperCase(),n.url,!0),g.timeout=n.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(y)},g.onabort=function(){g&&(r(new PGe("Request aborted",PGe.ECONNABORTED,e,g)),g=null)},g.onerror=function(){r(new PGe("Network Error",PGe.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const i=n.transitional||ZGe;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new PGe(t,i.clarifyTimeoutError?PGe.ETIMEDOUT:PGe.ECONNABORTED,e,g)),g=null},void 0===i&&o.setContentType(null),"setRequestHeader"in g&&RGe.forEach(o.toJSON(),(function(e,t){g.setRequestHeader(t,e)})),RGe.isUndefined(n.withCredentials)||(g.withCredentials=!!n.withCredentials),d&&"json"!==d&&(g.responseType=n.responseType),h&&([c,l]=gYe(h,!0),g.addEventListener("progress",c)),f&&g.upload&&([a,u]=gYe(f),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(s=t=>{g&&(r(!t||t.type?new hYe(null,e,g):t),g.abort(),g=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);m&&-1===eYe.protocols.indexOf(m)?r(new PGe("Unsupported protocol "+m+":",PGe.ERR_BAD_REQUEST,e)):g.send(i||null)}))},AYe=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const i=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof PGe?t:new hYe(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new PGe(`timeout ${t} of ms exceeded`,PGe.ETIMEDOUT))}),t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)})),e=null)};e.forEach((e=>e.addEventListener("abort",i)));const{signal:a}=n;return a.unsubscribe=()=>RGe.asap(s),a}};const xYe=function*(e,t){let r=e.byteLength;if(!t||r{const i=async function*(e,t){for await(const r of IYe(e))yield*xYe(r,t)}(e,t);let o,s=0,a=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await i.next();if(t)return a(),void e.close();let o=n.byteLength;if(r){let e=s+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},TYe="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,CYe=TYe&&"function"==typeof ReadableStream,OYe=TYe&&("function"==typeof TextEncoder?(RYe=new TextEncoder,e=>RYe.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var RYe;const PYe=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},MYe=CYe&&PYe((()=>{let e=!1;const t=new Request(eYe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),UYe=CYe&&PYe((()=>RGe.isReadableStream(new Response("").body))),LYe={stream:UYe&&(e=>e.body)};var jYe;TYe&&(jYe=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!LYe[e]&&(LYe[e]=RGe.isFunction(jYe[e])?t=>t[e]():(t,r)=>{throw new PGe(`Response type '${e}' is not supported`,PGe.ERR_NOT_SUPPORT,r)})})));const NYe=async(e,t)=>{const r=RGe.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(RGe.isBlob(e))return e.size;if(RGe.isSpecCompliantForm(e)){const t=new Request(eYe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return RGe.isArrayBufferView(e)||RGe.isArrayBuffer(e)?e.byteLength:(RGe.isURLSearchParams(e)&&(e+=""),RGe.isString(e)?(await OYe(e)).byteLength:void 0)})(t):r};var zYe=TYe&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:f}=SYe(e);u=u?(u+"").toLowerCase():"text";let h,p=AYe([i,o&&o.toAbortSignal()],s);const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(c&&MYe&&"get"!==r&&"head"!==r&&0!==(y=await NYe(l,n))){let e,r=new Request(t,{method:"POST",body:n,duplex:"half"});if(RGe.isFormData(n)&&(e=r.headers.get("content-type"))&&l.setContentType(e),r.body){const[e,t]=yYe(y,gYe(mYe(c)));n=BYe(r.body,65536,e,t)}}RGe.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;h=new Request(t,{...f,signal:p,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:i?d:void 0});let o=await fetch(h);const s=UYe&&("stream"===u||"response"===u);if(UYe&&(a||s&&g)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=o[t]}));const t=RGe.toFiniteNumber(o.headers.get("content-length")),[r,n]=a&&yYe(t,gYe(mYe(a),!0))||[];o=new Response(BYe(o.body,65536,r,(()=>{n&&n(),g&&g()})),e)}u=u||"text";let m=await LYe[RGe.findKey(LYe,u)||"text"](o,e);return!s&&g&&g(),await new Promise(((t,r)=>{pYe(t,r,{data:m,headers:lYe.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:h})}))}catch(t){if(g&&g(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new PGe("Network Error",PGe.ERR_NETWORK,e,h),{cause:t.cause||t});throw PGe.from(t,t&&t.code,e,h)}});const DYe={http:null,xhr:kYe,fetch:zYe};RGe.forEach(DYe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const FYe=e=>`- ${e}`,qYe=e=>RGe.isFunction(e)||null===e||!1===e;var HYe=e=>{e=RGe.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new PGe("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(FYe).join("\n"):" "+FYe(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function VYe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new hYe(null,e)}function $Ye(e){return VYe(e),e.headers=lYe.from(e.headers),e.data=dYe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),HYe(e.adapter||nYe.adapter)(e).then((function(t){return VYe(e),t.data=dYe.call(e,e.transformResponse,t),t.headers=lYe.from(t.headers),t}),(function(t){return fYe(t)||(VYe(e),t&&t.response&&(t.response.data=dYe.call(e,e.transformResponse,t.response),t.response.headers=lYe.from(t.response.headers))),Promise.reject(t)}))}const KYe="1.7.9",ZYe={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ZYe[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const WYe={};ZYe.transitional=function(e,t,r){function n(e,t){return"[Axios v1.7.9] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,o)=>{if(!1===e)throw new PGe(n(i," has been removed"+(t?" in "+t:"")),PGe.ERR_DEPRECATED);return t&&!WYe[i]&&(WYe[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,o)}},ZYe.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var GYe={assertOptions:function(e,t,r){if("object"!=typeof e)throw new PGe("options must be an object",PGe.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],s=t[o];if(s){const t=e[o],r=void 0===t||s(t,o,e);if(!0!==r)throw new PGe("option "+o+" must be "+r,PGe.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new PGe("Unknown option "+o,PGe.ERR_BAD_OPTION)}},validators:ZYe};const YYe=GYe.validators;class JYe{constructor(e){this.defaults=e,this.interceptors={request:new KGe,response:new KGe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=EYe(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&GYe.assertOptions(r,{silentJSONParsing:YYe.transitional(YYe.boolean),forcedJSONParsing:YYe.transitional(YYe.boolean),clarifyTimeoutError:YYe.transitional(YYe.boolean)},!1),null!=n&&(RGe.isFunction(n)?t.paramsSerializer={serialize:n}:GYe.assertOptions(n,{encode:YYe.function,serialize:YYe.function},!0)),GYe.assertOptions(t,{baseUrl:YYe.spelling("baseURL"),withXsrfToken:YYe.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&RGe.merge(i.common,i[t.method]);i&&RGe.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=lYe.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[$Ye.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);d{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new hYe(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new QYe((function(t){e=t}));return{token:t,cancel:e}}}var eJe=QYe;const tJe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(tJe).forEach((([e,t])=>{tJe[t]=e}));var rJe=tJe;const nJe=function e(t){const r=new XYe(t),n=HWe(XYe.prototype.request,r);return RGe.extend(n,XYe.prototype,r,{allOwnKeys:!0}),RGe.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(EYe(t,r))},n}(nYe);nJe.Axios=XYe,nJe.CanceledError=hYe,nJe.CancelToken=eJe,nJe.isCancel=fYe,nJe.VERSION=KYe,nJe.toFormData=DGe,nJe.AxiosError=PGe,nJe.Cancel=nJe.CanceledError,nJe.all=function(e){return Promise.all(e)},nJe.spread=function(e){return function(t){return e.apply(null,t)}},nJe.isAxiosError=function(e){return RGe.isObject(e)&&!0===e.isAxiosError},nJe.mergeConfig=EYe,nJe.AxiosHeaders=lYe,nJe.formToJSON=e=>tYe(RGe.isHTMLForm(e)?new FormData(e):e),nJe.getAdapter=HYe,nJe.HttpStatusCode=rJe,nJe.default=nJe;var iJe=nJe,oJe={},sJe={},aJe={},cJe={},uJe={};!function(e){var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0,function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(t||(e.util=t={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(r||(e.objectUtil=r={})),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),e.getParsedType=t=>{switch(typeof t){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(t)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(t)?e.ZodParsedType.array:null===t?e.ZodParsedType.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?e.ZodParsedType.promise:"undefined"!=typeof Map&&t instanceof Map?e.ZodParsedType.map:"undefined"!=typeof Set&&t instanceof Set?e.ZodParsedType.set:"undefined"!=typeof Date&&t instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}}}(uJe);var lJe={};Object.defineProperty(lJe,"__esModule",{value:!0}),lJe.ZodError=lJe.quotelessJson=lJe.ZodIssueCode=void 0;const dJe=uJe;lJe.ZodIssueCode=dJe.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),lJe.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class fJe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;ne.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}lJe.ZodError=fJe,fJe.create=e=>new fJe(e),Object.defineProperty(cJe,"__esModule",{value:!0});const hJe=uJe,pJe=lJe;cJe.default=(e,t)=>{let r;switch(e.code){case pJe.ZodIssueCode.invalid_type:r=e.received===hJe.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case pJe.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,hJe.util.jsonStringifyReplacer)}`;break;case pJe.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${hJe.util.joinValues(e.keys,", ")}`;break;case pJe.ZodIssueCode.invalid_union:r="Invalid input";break;case pJe.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${hJe.util.joinValues(e.options)}`;break;case pJe.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${hJe.util.joinValues(e.options)}, received '${e.received}'`;break;case pJe.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case pJe.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case pJe.ZodIssueCode.invalid_date:r="Invalid date";break;case pJe.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:hJe.util.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case pJe.ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case pJe.ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case pJe.ZodIssueCode.custom:r="Invalid input";break;case pJe.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case pJe.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case pJe.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,hJe.util.assertNever(e)}return{message:r}};var gJe=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(aJe,"__esModule",{value:!0}),aJe.getErrorMap=aJe.setErrorMap=aJe.defaultErrorMap=void 0;const yJe=gJe(cJe);aJe.defaultErrorMap=yJe.default;let mJe=yJe.default;aJe.setErrorMap=function(e){mJe=e},aJe.getErrorMap=function(){return mJe};var bJe={};!function(t){var r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const n=aJe,i=r(cJe);t.makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],s={...i,path:o};if(void 0!==i.message)return{...i,path:o,message:i.message};let a="";const c=n.filter((e=>!!e)).slice().reverse();for(const e of c)a=e(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}},t.EMPTY_PATH=[],t.addIssueToContext=function(e,r){const o=(0,n.getErrorMap)(),s=(0,t.makeIssue)({issueData:r,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,o,o===i.default?void 0:i.default].filter((e=>!!e))});e.common.issues.push(s)};class o{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if("aborted"===i.status)return t.INVALID;"dirty"===i.status&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return o.mergeObjectSync(e,r)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:r,value:o}=i;if("aborted"===r.status)return t.INVALID;if("aborted"===o.status)return t.INVALID;"dirty"===r.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"===r.value||void 0===o.value&&!i.alwaysSet||(n[r.value]=o.value)}return{status:e.value,value:n}}}t.ParseStatus=o,t.INVALID=Object.freeze({status:"aborted"}),t.DIRTY=e=>({status:"dirty",value:e}),t.OK=e=>({status:"valid",value:e}),t.isAborted=e=>"aborted"===e.status,t.isDirty=e=>"dirty"===e.status,t.isValid=e=>"valid"===e.status,t.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise}(bJe);var vJe={};Object.defineProperty(vJe,"__esModule",{value:!0});var wJe,_Je={},EJe={};Object.defineProperty(EJe,"__esModule",{value:!0}),EJe.errorUtil=void 0,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(wJe||(EJe.errorUtil=wJe={}));var SJe,kJe,AJe=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},xJe=e&&e.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};Object.defineProperty(_Je,"__esModule",{value:!0}),_Je.boolean=_Je.bigint=_Je.array=_Je.any=_Je.coerce=_Je.ZodFirstPartyTypeKind=_Je.late=_Je.ZodSchema=_Je.Schema=_Je.custom=_Je.ZodReadonly=_Je.ZodPipeline=_Je.ZodBranded=_Je.BRAND=_Je.ZodNaN=_Je.ZodCatch=_Je.ZodDefault=_Je.ZodNullable=_Je.ZodOptional=_Je.ZodTransformer=_Je.ZodEffects=_Je.ZodPromise=_Je.ZodNativeEnum=_Je.ZodEnum=_Je.ZodLiteral=_Je.ZodLazy=_Je.ZodFunction=_Je.ZodSet=_Je.ZodMap=_Je.ZodRecord=_Je.ZodTuple=_Je.ZodIntersection=_Je.ZodDiscriminatedUnion=_Je.ZodUnion=_Je.ZodObject=_Je.ZodArray=_Je.ZodVoid=_Je.ZodNever=_Je.ZodUnknown=_Je.ZodAny=_Je.ZodNull=_Je.ZodUndefined=_Je.ZodSymbol=_Je.ZodDate=_Je.ZodBoolean=_Je.ZodBigInt=_Je.ZodNumber=_Je.ZodString=_Je.datetimeRegex=_Je.ZodType=void 0,_Je.NEVER=_Je.void=_Je.unknown=_Je.union=_Je.undefined=_Je.tuple=_Je.transformer=_Je.symbol=_Je.string=_Je.strictObject=_Je.set=_Je.record=_Je.promise=_Je.preprocess=_Je.pipeline=_Je.ostring=_Je.optional=_Je.onumber=_Je.oboolean=_Je.object=_Je.number=_Je.nullable=_Je.null=_Je.never=_Je.nativeEnum=_Je.nan=_Je.map=_Je.literal=_Je.lazy=_Je.intersection=_Je.instanceof=_Je.function=_Je.enum=_Je.effect=_Je.discriminatedUnion=_Je.date=void 0;const IJe=aJe,BJe=EJe,TJe=bJe,CJe=uJe,OJe=lJe;class RJe{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const PJe=(e,t)=>{if((0,TJe.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new OJe.ZodError(e.common.issues);return this._error=t,this._error}}};function MJe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{var o,s;const{message:a}=e;return"invalid_enum_value"===t.code?{message:null!=a?a:i.defaultError}:void 0===i.data?{message:null!==(o=null!=a?a:n)&&void 0!==o?o:i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:null!==(s=null!=a?a:r)&&void 0!==s?s:i.defaultError}},description:i}}class UJe{get description(){return this._def.description}_getType(e){return(0,CJe.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,CJe.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new TJe.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,CJe.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,TJe.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,CJe.getParsedType)(e)},i=this._parseSync({data:e,path:n.path,parent:n});return PJe(n,i)}"~validate"(e){var t,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,CJe.getParsedType)(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return(0,TJe.isValid)(t)?{value:t.value}:{issues:n.common.issues}}catch(e){(null===(r=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===r?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then((e=>(0,TJe.isValid)(e)?{value:e.value}:{issues:n.common.issues}))}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,CJe.getParsedType)(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await((0,TJe.isAsync)(n)?n:Promise.resolve(n));return PJe(r,i)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const i=e(t),o=()=>n.addIssue({code:OJe.ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new LXe({schema:this,typeName:KXe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return jXe.create(this,this._def)}nullable(){return NXe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mXe.create(this)}promise(){return UXe.create(this,this._def)}or(e){return wXe.create([this,e],this._def)}and(e){return kXe.create(this,e,this._def)}transform(e){return new LXe({...MJe(this._def),schema:this,typeName:KXe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new zXe({...MJe(this._def),innerType:this,defaultValue:t,typeName:KXe.ZodDefault})}brand(){return new qXe({typeName:KXe.ZodBranded,type:this,...MJe(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new DXe({...MJe(this._def),innerType:this,catchValue:t,typeName:KXe.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return HXe.create(this,e)}readonly(){return VXe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}_Je.ZodType=UJe,_Je.Schema=UJe,_Je.ZodSchema=UJe;const LJe=/^c[^\s-]{8,}$/i,jJe=/^[0-9a-z]+$/,NJe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zJe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,DJe=/^[a-z0-9_-]{21}$/i,FJe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,qJe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,HJe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let VJe;const $Je=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,KJe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ZJe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,WJe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GJe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,YJe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,JJe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",XJe=new RegExp(`^${JJe}$`);function QJe(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function eXe(e){let t=`${JJe}T${QJe(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function tXe(e,t){return!("v4"!==t&&t||!$Je.test(e))||!("v6"!==t&&t||!ZJe.test(e))}function rXe(e,t){if(!FJe.test(e))return!1;try{const[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!("object"!=typeof i||null===i||!i.typ||!i.alg||t&&i.alg!==t)}catch(e){return!1}}function nXe(e,t){return!("v4"!==t&&t||!KJe.test(e))||!("v6"!==t&&t||!WJe.test(e))}_Je.datetimeRegex=eXe;class iXe extends UJe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==CJe.ZodParsedType.string){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.string,received:t.parsedType}),TJe.INVALID}const t=new TJe.ParseStatus;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.lengthn.value&&(r=this._getOrReturnCtx(e,r),(0,TJe.addIssueToContext)(r,{code:OJe.ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const i=e.data.length>n.value,o=e.data.lengthe.test(t)),{validation:t,code:OJe.ZodIssueCode.invalid_string,...BJe.errorUtil.errToObj(r)})}_addCheck(e){return new iXe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...BJe.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...BJe.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...BJe.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...BJe.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...BJe.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...BJe.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...BJe.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...BJe.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...BJe.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...BJe.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...BJe.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...BJe.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...BJe.errorUtil.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...BJe.errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...BJe.errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...BJe.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...BJe.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...BJe.errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...BJe.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...BJe.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...BJe.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...BJe.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...BJe.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,BJe.errorUtil.errToObj(e))}trim(){return new iXe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new iXe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new iXe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?r:n;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}_Je.ZodString=iXe,iXe.create=e=>{var t;return new iXe({checks:[],typeName:KXe.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...MJe(e)})};class sXe extends UJe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==CJe.ZodParsedType.number){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.number,received:t.parsedType}),TJe.INVALID}let t;const r=new TJe.ParseStatus;for(const n of this._def.checks)"int"===n.kind?CJe.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==oXe(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.not_finite,message:n.message}),r.dirty()):CJe.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,BJe.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,BJe.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,BJe.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,BJe.errorUtil.toString(t))}setLimit(e,t,r,n){return new sXe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:BJe.errorUtil.toString(n)}]})}_addCheck(e){return new sXe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:BJe.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:BJe.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:BJe.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:BJe.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:BJe.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:BJe.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:BJe.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:BJe.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:BJe.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&CJe.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew sXe({checks:[],typeName:KXe.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...MJe(e)});class aXe extends UJe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==CJe.ZodParsedType.bigint)return this._getInvalidInput(e);let t;const r=new TJe.ParseStatus;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):CJe.util.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.bigint,received:t.parsedType}),TJe.INVALID}gte(e,t){return this.setLimit("min",e,!0,BJe.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,BJe.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,BJe.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,BJe.errorUtil.toString(t))}setLimit(e,t,r,n){return new aXe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:BJe.errorUtil.toString(n)}]})}_addCheck(e){return new aXe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:BJe.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:BJe.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:BJe.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:BJe.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:BJe.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new aXe({checks:[],typeName:KXe.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...MJe(e)})};class cXe extends UJe{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==CJe.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.boolean,received:t.parsedType}),TJe.INVALID}return(0,TJe.OK)(e.data)}}_Je.ZodBoolean=cXe,cXe.create=e=>new cXe({typeName:KXe.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...MJe(e)});class uXe extends UJe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==CJe.ZodParsedType.date){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.date,received:t.parsedType}),TJe.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_date}),TJe.INVALID}const t=new TJe.ParseStatus;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(r=this._getOrReturnCtx(e,r),(0,TJe.addIssueToContext)(r,{code:OJe.ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):CJe.util.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new uXe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:BJe.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:BJe.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew uXe({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:KXe.ZodDate,...MJe(e)});class lXe extends UJe{_parse(e){if(this._getType(e)!==CJe.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.symbol,received:t.parsedType}),TJe.INVALID}return(0,TJe.OK)(e.data)}}_Je.ZodSymbol=lXe,lXe.create=e=>new lXe({typeName:KXe.ZodSymbol,...MJe(e)});class dXe extends UJe{_parse(e){if(this._getType(e)!==CJe.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.undefined,received:t.parsedType}),TJe.INVALID}return(0,TJe.OK)(e.data)}}_Je.ZodUndefined=dXe,dXe.create=e=>new dXe({typeName:KXe.ZodUndefined,...MJe(e)});class fXe extends UJe{_parse(e){if(this._getType(e)!==CJe.ZodParsedType.null){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.null,received:t.parsedType}),TJe.INVALID}return(0,TJe.OK)(e.data)}}_Je.ZodNull=fXe,fXe.create=e=>new fXe({typeName:KXe.ZodNull,...MJe(e)});class hXe extends UJe{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,TJe.OK)(e.data)}}_Je.ZodAny=hXe,hXe.create=e=>new hXe({typeName:KXe.ZodAny,...MJe(e)});class pXe extends UJe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,TJe.OK)(e.data)}}_Je.ZodUnknown=pXe,pXe.create=e=>new pXe({typeName:KXe.ZodUnknown,...MJe(e)});class gXe extends UJe{_parse(e){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.never,received:t.parsedType}),TJe.INVALID}}_Je.ZodNever=gXe,gXe.create=e=>new gXe({typeName:KXe.ZodNever,...MJe(e)});class yXe extends UJe{_parse(e){if(this._getType(e)!==CJe.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.void,received:t.parsedType}),TJe.INVALID}return(0,TJe.OK)(e.data)}}_Je.ZodVoid=yXe,yXe.create=e=>new yXe({typeName:KXe.ZodVoid,...MJe(e)});class mXe extends UJe{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==CJe.ZodParsedType.array)return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.array,received:t.parsedType}),TJe.INVALID;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,i=t.data.lengthn.maxLength.value&&((0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new RJe(t,e,t.path,r))))).then((e=>TJe.ParseStatus.mergeArray(r,e)));const i=[...t.data].map(((e,r)=>n.type._parseSync(new RJe(t,e,t.path,r))));return TJe.ParseStatus.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new mXe({...this._def,minLength:{value:e,message:BJe.errorUtil.toString(t)}})}max(e,t){return new mXe({...this._def,maxLength:{value:e,message:BJe.errorUtil.toString(t)}})}length(e,t){return new mXe({...this._def,exactLength:{value:e,message:BJe.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function bXe(e){if(e instanceof vXe){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=jXe.create(bXe(n))}return new vXe({...e._def,shape:()=>t})}return e instanceof mXe?new mXe({...e._def,type:bXe(e.element)}):e instanceof jXe?jXe.create(bXe(e.unwrap())):e instanceof NXe?NXe.create(bXe(e.unwrap())):e instanceof AXe?AXe.create(e.items.map((e=>bXe(e)))):e}_Je.ZodArray=mXe,mXe.create=(e,t)=>new mXe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:KXe.ZodArray,...MJe(t)});class vXe extends UJe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=CJe.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==CJe.ZodParsedType.object){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.object,received:t.parsedType}),TJe.INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof gXe&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||o.push(e);const s=[];for(const e of i){const t=n[e],i=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new RJe(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof gXe){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)o.length>0&&((0,TJe.addIssueToContext)(r,{code:OJe.ZodIssueCode.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const n=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new RJe(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of s){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>TJe.ParseStatus.mergeObjectSync(t,e))):TJe.ParseStatus.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return BJe.errorUtil.errToObj,new vXe({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,i,o,s;const a=null!==(o=null===(i=(n=this._def).errorMap)||void 0===i?void 0:i.call(n,t,r).message)&&void 0!==o?o:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(s=BJe.errorUtil.errToObj(e).message)&&void 0!==s?s:a}:{message:a}}}:{}})}strip(){return new vXe({...this._def,unknownKeys:"strip"})}passthrough(){return new vXe({...this._def,unknownKeys:"passthrough"})}extend(e){return new vXe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new vXe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:KXe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new vXe({...this._def,catchall:e})}pick(e){const t={};return CJe.util.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new vXe({...this._def,shape:()=>t})}omit(e){const t={};return CJe.util.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new vXe({...this._def,shape:()=>t})}deepPartial(){return bXe(this)}partial(e){const t={};return CJe.util.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new vXe({...this._def,shape:()=>t})}required(e){const t={};return CJe.util.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof jXe;)e=e._def.innerType;t[r]=e}})),new vXe({...this._def,shape:()=>t})}keyof(){return RXe(CJe.util.objectKeys(this.shape))}}_Je.ZodObject=vXe,vXe.create=(e,t)=>new vXe({shape:()=>e,unknownKeys:"strip",catchall:gXe.create(),typeName:KXe.ZodObject,...MJe(t)}),vXe.strictCreate=(e,t)=>new vXe({shape:()=>e,unknownKeys:"strict",catchall:gXe.create(),typeName:KXe.ZodObject,...MJe(t)}),vXe.lazycreate=(e,t)=>new vXe({shape:e,unknownKeys:"strip",catchall:gXe.create(),typeName:KXe.ZodObject,...MJe(t)});class wXe extends UJe{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new OJe.ZodError(e.ctx.common.issues)));return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_union,unionErrors:r}),TJe.INVALID}));{let e;const n=[];for(const i of r){const r={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map((e=>new OJe.ZodError(e)));return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_union,unionErrors:i}),TJe.INVALID}}get options(){return this._def.options}}_Je.ZodUnion=wXe,wXe.create=(e,t)=>new wXe({options:e,typeName:KXe.ZodUnion,...MJe(t)});const _Xe=e=>e instanceof CXe?_Xe(e.schema):e instanceof LXe?_Xe(e.innerType()):e instanceof OXe?[e.value]:e instanceof PXe?e.options:e instanceof MXe?CJe.util.objectValues(e.enum):e instanceof zXe?_Xe(e._def.innerType):e instanceof dXe?[void 0]:e instanceof fXe?[null]:e instanceof jXe?[void 0,..._Xe(e.unwrap())]:e instanceof NXe?[null,..._Xe(e.unwrap())]:e instanceof qXe||e instanceof VXe?_Xe(e.unwrap()):e instanceof DXe?_Xe(e._def.innerType):[];class EXe extends UJe{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==CJe.ZodParsedType.object)return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.object,received:t.parsedType}),TJe.INVALID;const r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):((0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),TJe.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=_Xe(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new EXe({typeName:KXe.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...MJe(r)})}}function SXe(e,t){const r=(0,CJe.getParsedType)(e),n=(0,CJe.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(r===CJe.ZodParsedType.object&&n===CJe.ZodParsedType.object){const r=CJe.util.objectKeys(t),n=CJe.util.objectKeys(e).filter((e=>-1!==r.indexOf(e))),i={...e,...t};for(const r of n){const n=SXe(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(r===CJe.ZodParsedType.array&&n===CJe.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n{if((0,TJe.isAborted)(e)||(0,TJe.isAborted)(n))return TJe.INVALID;const i=SXe(e.value,n.value);return i.valid?(((0,TJe.isDirty)(e)||(0,TJe.isDirty)(n))&&t.dirty(),{status:t.value,value:i.data}):((0,TJe.addIssueToContext)(r,{code:OJe.ZodIssueCode.invalid_intersection_types}),TJe.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_Je.ZodIntersection=kXe,kXe.create=(e,t,r)=>new kXe({left:e,right:t,typeName:KXe.ZodIntersection,...MJe(r)});class AXe extends UJe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==CJe.ZodParsedType.array)return(0,TJe.addIssueToContext)(r,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.array,received:r.parsedType}),TJe.INVALID;if(r.data.lengththis._def.items.length&&((0,TJe.addIssueToContext)(r,{code:OJe.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new RJe(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>TJe.ParseStatus.mergeArray(t,e))):TJe.ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new AXe({...this._def,rest:e})}}_Je.ZodTuple=AXe,AXe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new AXe({items:e,typeName:KXe.ZodTuple,rest:null,...MJe(t)})};class xXe extends UJe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==CJe.ZodParsedType.object)return(0,TJe.addIssueToContext)(r,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.object,received:r.parsedType}),TJe.INVALID;const n=[],i=this._def.keyType,o=this._def.valueType;for(const e in r.data)n.push({key:i._parse(new RJe(r,e,r.path,e)),value:o._parse(new RJe(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?TJe.ParseStatus.mergeObjectAsync(t,n):TJe.ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new xXe(t instanceof UJe?{keyType:e,valueType:t,typeName:KXe.ZodRecord,...MJe(r)}:{keyType:iXe.create(),valueType:e,typeName:KXe.ZodRecord,...MJe(t)})}}_Je.ZodRecord=xXe;class IXe extends UJe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==CJe.ZodParsedType.map)return(0,TJe.addIssueToContext)(r,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.map,received:r.parsedType}),TJe.INVALID;const n=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map((([e,t],o)=>({key:n._parse(new RJe(r,e,r.path,[o,"key"])),value:i._parse(new RJe(r,t,r.path,[o,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of o){const n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return TJe.INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of o){const n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return TJe.INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}_Je.ZodMap=IXe,IXe.create=(e,t,r)=>new IXe({valueType:t,keyType:e,typeName:KXe.ZodMap,...MJe(r)});class BXe extends UJe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==CJe.ZodParsedType.set)return(0,TJe.addIssueToContext)(r,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.set,received:r.parsedType}),TJe.INVALID;const n=this._def;null!==n.minSize&&r.data.sizen.maxSize.value&&((0,TJe.addIssueToContext)(r,{code:OJe.ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const r=new Set;for(const n of e){if("aborted"===n.status)return TJe.INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const s=[...r.data.values()].map(((e,t)=>i._parse(new RJe(r,e,r.path,t))));return r.common.async?Promise.all(s).then((e=>o(e))):o(s)}min(e,t){return new BXe({...this._def,minSize:{value:e,message:BJe.errorUtil.toString(t)}})}max(e,t){return new BXe({...this._def,maxSize:{value:e,message:BJe.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}_Je.ZodSet=BXe,BXe.create=(e,t)=>new BXe({valueType:e,minSize:null,maxSize:null,typeName:KXe.ZodSet,...MJe(t)});class TXe extends UJe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==CJe.ZodParsedType.function)return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.function,received:t.parsedType}),TJe.INVALID;function r(e,r){return(0,TJe.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,IJe.getErrorMap)(),IJe.defaultErrorMap].filter((e=>!!e)),issueData:{code:OJe.ZodIssueCode.invalid_arguments,argumentsError:r}})}function n(e,r){return(0,TJe.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,IJe.getErrorMap)(),IJe.defaultErrorMap].filter((e=>!!e)),issueData:{code:OJe.ZodIssueCode.invalid_return_type,returnTypeError:r}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof UXe){const e=this;return(0,TJe.OK)((async function(...t){const s=new OJe.ZodError([]),a=await e._def.args.parseAsync(t,i).catch((e=>{throw s.addIssue(r(t,e)),s})),c=await Reflect.apply(o,this,a);return await e._def.returns._def.type.parseAsync(c,i).catch((e=>{throw s.addIssue(n(c,e)),s}))}))}{const e=this;return(0,TJe.OK)((function(...t){const s=e._def.args.safeParse(t,i);if(!s.success)throw new OJe.ZodError([r(t,s.error)]);const a=Reflect.apply(o,this,s.data),c=e._def.returns.safeParse(a,i);if(!c.success)throw new OJe.ZodError([n(a,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new TXe({...this._def,args:AXe.create(e).rest(pXe.create())})}returns(e){return new TXe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new TXe({args:e||AXe.create([]).rest(pXe.create()),returns:t||pXe.create(),typeName:KXe.ZodFunction,...MJe(r)})}}_Je.ZodFunction=TXe;class CXe extends UJe{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_Je.ZodLazy=CXe,CXe.create=(e,t)=>new CXe({getter:e,typeName:KXe.ZodLazy,...MJe(t)});class OXe extends UJe{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{received:t.data,code:OJe.ZodIssueCode.invalid_literal,expected:this._def.value}),TJe.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function RXe(e,t){return new PXe({values:e,typeName:KXe.ZodEnum,...MJe(t)})}_Je.ZodLiteral=OXe,OXe.create=(e,t)=>new OXe({value:e,typeName:KXe.ZodLiteral,...MJe(t)});class PXe extends UJe{constructor(){super(...arguments),SJe.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,TJe.addIssueToContext)(t,{expected:CJe.util.joinValues(r),received:t.parsedType,code:OJe.ZodIssueCode.invalid_type}),TJe.INVALID}if(AJe(this,SJe,"f")||xJe(this,SJe,new Set(this._def.values),"f"),!AJe(this,SJe,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,TJe.addIssueToContext)(t,{received:t.data,code:OJe.ZodIssueCode.invalid_enum_value,options:r}),TJe.INVALID}return(0,TJe.OK)(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return PXe.create(e,{...this._def,...t})}exclude(e,t=this._def){return PXe.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}_Je.ZodEnum=PXe,SJe=new WeakMap,PXe.create=RXe;class MXe extends UJe{constructor(){super(...arguments),kJe.set(this,void 0)}_parse(e){const t=CJe.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==CJe.ZodParsedType.string&&r.parsedType!==CJe.ZodParsedType.number){const e=CJe.util.objectValues(t);return(0,TJe.addIssueToContext)(r,{expected:CJe.util.joinValues(e),received:r.parsedType,code:OJe.ZodIssueCode.invalid_type}),TJe.INVALID}if(AJe(this,kJe,"f")||xJe(this,kJe,new Set(CJe.util.getValidEnumValues(this._def.values)),"f"),!AJe(this,kJe,"f").has(e.data)){const e=CJe.util.objectValues(t);return(0,TJe.addIssueToContext)(r,{received:r.data,code:OJe.ZodIssueCode.invalid_enum_value,options:e}),TJe.INVALID}return(0,TJe.OK)(e.data)}get enum(){return this._def.values}}_Je.ZodNativeEnum=MXe,kJe=new WeakMap,MXe.create=(e,t)=>new MXe({values:e,typeName:KXe.ZodNativeEnum,...MJe(t)});class UXe extends UJe{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==CJe.ZodParsedType.promise&&!1===t.common.async)return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.promise,received:t.parsedType}),TJe.INVALID;const r=t.parsedType===CJe.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,TJe.OK)(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}_Je.ZodPromise=UXe,UXe.create=(e,t)=>new UXe({type:e,typeName:KXe.ZodPromise,...MJe(t)});class LXe extends UJe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===KXe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{(0,TJe.addIssueToContext)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){const e=n.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return TJe.INVALID;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?TJe.INVALID:"dirty"===n.status||"dirty"===t.value?(0,TJe.DIRTY)(n.value):n}));{if("aborted"===t.value)return TJe.INVALID;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?TJe.INVALID:"dirty"===n.status||"dirty"===t.value?(0,TJe.DIRTY)(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?TJe.INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?TJe.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,TJe.isValid)(e))return e;const o=n.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>(0,TJe.isValid)(e)?Promise.resolve(n.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}CJe.util.assertNever(n)}}_Je.ZodEffects=LXe,_Je.ZodTransformer=LXe,LXe.create=(e,t,r)=>new LXe({schema:e,typeName:KXe.ZodEffects,effect:t,...MJe(r)}),LXe.createWithPreprocess=(e,t,r)=>new LXe({schema:t,effect:{type:"preprocess",transform:e},typeName:KXe.ZodEffects,...MJe(r)});class jXe extends UJe{_parse(e){return this._getType(e)===CJe.ZodParsedType.undefined?(0,TJe.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_Je.ZodOptional=jXe,jXe.create=(e,t)=>new jXe({innerType:e,typeName:KXe.ZodOptional,...MJe(t)});class NXe extends UJe{_parse(e){return this._getType(e)===CJe.ZodParsedType.null?(0,TJe.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_Je.ZodNullable=NXe,NXe.create=(e,t)=>new NXe({innerType:e,typeName:KXe.ZodNullable,...MJe(t)});class zXe extends UJe{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===CJe.ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}_Je.ZodDefault=zXe,zXe.create=(e,t)=>new zXe({innerType:e,typeName:KXe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...MJe(t)});class DXe extends UJe{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,TJe.isAsync)(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new OJe.ZodError(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new OJe.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}_Je.ZodCatch=DXe,DXe.create=(e,t)=>new DXe({innerType:e,typeName:KXe.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...MJe(t)});class FXe extends UJe{_parse(e){if(this._getType(e)!==CJe.ZodParsedType.nan){const t=this._getOrReturnCtx(e);return(0,TJe.addIssueToContext)(t,{code:OJe.ZodIssueCode.invalid_type,expected:CJe.ZodParsedType.nan,received:t.parsedType}),TJe.INVALID}return{status:"valid",value:e.data}}}_Je.ZodNaN=FXe,FXe.create=e=>new FXe({typeName:KXe.ZodNaN,...MJe(e)}),_Je.BRAND=Symbol("zod_brand");class qXe extends UJe{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}_Je.ZodBranded=qXe;class HXe extends UJe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?TJe.INVALID:"dirty"===e.status?(t.dirty(),(0,TJe.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?TJe.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new HXe({in:e,out:t,typeName:KXe.ZodPipeline})}}_Je.ZodPipeline=HXe;class VXe extends UJe{_parse(e){const t=this._def.innerType._parse(e),r=e=>((0,TJe.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,TJe.isAsync)(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function $Xe(e,t={},r){return e?hXe.create().superRefine(((n,i)=>{var o,s;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,a=null===(s=null!==(o=e.fatal)&&void 0!==o?o:r)||void 0===s||s,c="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...c,fatal:a})}})):hXe.create()}var KXe;_Je.ZodReadonly=VXe,VXe.create=(e,t)=>new VXe({innerType:e,typeName:KXe.ZodReadonly,...MJe(t)}),_Je.custom=$Xe,_Je.late={object:vXe.lazycreate},function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(KXe||(_Je.ZodFirstPartyTypeKind=KXe={})),_Je.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>$Xe((t=>t instanceof e),t);const ZXe=iXe.create;_Je.string=ZXe;const WXe=sXe.create;_Je.number=WXe;const GXe=FXe.create;_Je.nan=GXe;const YXe=aXe.create;_Je.bigint=YXe;const JXe=cXe.create;_Je.boolean=JXe;const XXe=uXe.create;_Je.date=XXe;const QXe=lXe.create;_Je.symbol=QXe;const eQe=dXe.create;_Je.undefined=eQe;const tQe=fXe.create;_Je.null=tQe;const rQe=hXe.create;_Je.any=rQe;const nQe=pXe.create;_Je.unknown=nQe;const iQe=gXe.create;_Je.never=iQe;const oQe=yXe.create;_Je.void=oQe;const sQe=mXe.create;_Je.array=sQe;const aQe=vXe.create;_Je.object=aQe;const cQe=vXe.strictCreate;_Je.strictObject=cQe;const uQe=wXe.create;_Je.union=uQe;const lQe=EXe.create;_Je.discriminatedUnion=lQe;const dQe=kXe.create;_Je.intersection=dQe;const fQe=AXe.create;_Je.tuple=fQe;const hQe=xXe.create;_Je.record=hQe;const pQe=IXe.create;_Je.map=pQe;const gQe=BXe.create;_Je.set=gQe;const yQe=TXe.create;_Je.function=yQe;const mQe=CXe.create;_Je.lazy=mQe;const bQe=OXe.create;_Je.literal=bQe;const vQe=PXe.create;_Je.enum=vQe;const wQe=MXe.create;_Je.nativeEnum=wQe;const _Qe=UXe.create;_Je.promise=_Qe;const EQe=LXe.create;_Je.effect=EQe,_Je.transformer=EQe;const SQe=jXe.create;_Je.optional=SQe;const kQe=NXe.create;_Je.nullable=kQe;const AQe=LXe.createWithPreprocess;_Je.preprocess=AQe;const xQe=HXe.create;_Je.pipeline=xQe,_Je.ostring=()=>ZXe().optional(),_Je.onumber=()=>WXe().optional(),_Je.oboolean=()=>JXe().optional(),_Je.coerce={string:e=>iXe.create({...e,coerce:!0}),number:e=>sXe.create({...e,coerce:!0}),boolean:e=>cXe.create({...e,coerce:!0}),bigint:e=>aXe.create({...e,coerce:!0}),date:e=>uXe.create({...e,coerce:!0})},_Je.NEVER=TJe.INVALID,function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(aJe,t),n(bJe,t),n(vJe,t),n(uJe,t),n(_Je,t),n(lJe,t)}(sJe),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t},o=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const s=i(sJe);t.z=s,o(sJe,t),t.default=s}(oJe);var IQe="15.1.0",BQe=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(MWe,"__esModule",{value:!0}),MWe.HttpApi=void 0;const TQe=UWe,CQe=BQe(qWe),OQe=BQe(iJe),RQe=oJe,PQe=IQe,MQe=RQe.z.object({"@type":RQe.z.literal("ton.blockIdExt"),workchain:RQe.z.number(),shard:RQe.z.string(),seqno:RQe.z.number(),root_hash:RQe.z.string(),file_hash:RQe.z.string()}),UQe=RQe.z.object({balance:RQe.z.union([RQe.z.number(),RQe.z.string()]),state:RQe.z.union([RQe.z.literal("active"),RQe.z.literal("uninitialized"),RQe.z.literal("frozen")]),data:RQe.z.string(),code:RQe.z.string(),last_transaction_id:RQe.z.object({"@type":RQe.z.literal("internal.transactionId"),lt:RQe.z.string(),hash:RQe.z.string()}),block_id:MQe,sync_utime:RQe.z.number()}),LQe=RQe.z.object({"@type":RQe.z.literal("ok")}),jQe=RQe.z.object({"@type":RQe.z.literal("query.fees"),source_fees:RQe.z.object({"@type":RQe.z.literal("fees"),in_fwd_fee:RQe.z.number(),storage_fee:RQe.z.number(),gas_fee:RQe.z.number(),fwd_fee:RQe.z.number()})}),NQe=RQe.z.object({gas_used:RQe.z.number(),exit_code:RQe.z.number(),stack:RQe.z.array(RQe.z.unknown())}),zQe=RQe.z.union([RQe.z.object({"@type":RQe.z.literal("msg.dataRaw"),body:RQe.z.string()}),RQe.z.object({"@type":RQe.z.literal("msg.dataText"),text:RQe.z.string()}),RQe.z.object({"@type":RQe.z.literal("msg.dataDecryptedText"),text:RQe.z.string()}),RQe.z.object({"@type":RQe.z.literal("msg.dataEncryptedText"),text:RQe.z.string()})]),DQe=RQe.z.object({source:RQe.z.string(),destination:RQe.z.string(),value:RQe.z.string(),fwd_fee:RQe.z.string(),ihr_fee:RQe.z.string(),created_lt:RQe.z.string(),body_hash:RQe.z.string(),msg_data:zQe,message:RQe.z.string().optional()}),FQe=RQe.z.object({data:RQe.z.string(),utime:RQe.z.number(),transaction_id:RQe.z.object({lt:RQe.z.string(),hash:RQe.z.string()}),fee:RQe.z.string(),storage_fee:RQe.z.string(),other_fee:RQe.z.string(),in_msg:RQe.z.union([RQe.z.undefined(),DQe]),out_msgs:RQe.z.array(DQe)}),qQe=RQe.z.array(FQe),HQe=RQe.z.object({state_root_hash:RQe.z.string(),last:MQe,init:MQe}),VQe=RQe.z.object({shards:RQe.z.array(MQe)}),$Qe=RQe.z.object({"@type":RQe.z.literal("blocks.shortTxId"),mode:RQe.z.number(),account:RQe.z.string(),lt:RQe.z.string(),hash:RQe.z.string()}),KQe=RQe.z.object({id:MQe,req_count:RQe.z.number(),incomplete:RQe.z.boolean(),transactions:RQe.z.array($Qe)});class ZQe{constructor(e,t,r,n){this.namespace=e,this.cache=t,this.codec=r,this.keyEncoder=n}async get(e){let t=await this.cache.get(this.namespace,this.keyEncoder(e));if(t){let e=this.codec.safeParse(JSON.parse(t));if(e.success)return e.data}return null}async set(e,t){null!==t?await this.cache.set(this.namespace,this.keyEncoder(e),JSON.stringify(t)):await this.cache.set(this.namespace,this.keyEncoder(e),null)}}function WQe(e){let t=[];for(let r of e)if("int"===r.type)t.push(["num",r.value.toString()]);else if("cell"===r.type)t.push(["tvm.Cell",r.cell.toBoc().toString("base64")]);else if("slice"===r.type)t.push(["tvm.Slice",r.cell.toBoc().toString("base64")]);else{if("builder"!==r.type)throw Error("Unsupported stack item type: "+r.type);t.push(["tvm.Builder",r.cell.toBoc().toString("base64")])}return t}MWe.HttpApi=class{constructor(e,t){this.endpoint=e,this.cache=new TQe.InMemoryCache,this.parameters={timeout:(null==t?void 0:t.timeout)||3e4,apiKey:null==t?void 0:t.apiKey,adapter:null==t?void 0:t.adapter},this.shardCache=new ZQe("ton-shard",this.cache,RQe.z.array(MQe),(e=>e+"")),this.shardLoader=new CQe.default((async e=>await Promise.all(e.map((async e=>{const t=await this.shardCache.get(e);if(t)return t;let r=(await this.doCall("shards",{seqno:e},VQe)).shards;return await this.shardCache.set(e,r),r}))))),this.shardTransactionsCache=new ZQe("ton-shard-tx",this.cache,KQe,(e=>e.workchain+":"+e.shard+":"+e.seqno)),this.shardTransactionsLoader=new CQe.default((async e=>await Promise.all(e.map((async e=>{const t=await this.shardTransactionsCache.get(e);if(t)return t;let r=await this.doCall("getBlockTransactions",{workchain:e.workchain,seqno:e.seqno,shard:e.shard},KQe);return await this.shardTransactionsCache.set(e,r),r})))),{cacheKeyFn:e=>e.workchain+":"+e.shard+":"+e.seqno})}getAddressInformation(e){return this.doCall("getAddressInformation",{address:e.toString()},UQe)}async getTransactions(e,t){const r=t.inclusive;let n;delete t.inclusive,t.hash&&(n=age.from(t.hash,"base64").toString("hex"));let i=t.limit;t.hash&&t.lt&&!0!==r&&i++;let o=await this.doCall("getTransactions",{address:e.toString(),...t,limit:i,hash:n},qQe);return o.length>i&&(o=o.slice(0,i)),t.hash&&t.lt&&!0!==r?(o.shift(),o):o}async getMasterchainInfo(){return await this.doCall("getMasterchainInfo",{},HQe)}async getShards(e){return await this.shardLoader.load(e)}async getBlockTransactions(e,t,r){return await this.shardTransactionsLoader.load({workchain:e,seqno:t,shard:r})}async getTransaction(e,t,r){let n=age.from(r,"base64").toString("hex"),i=(await this.doCall("getTransactions",{address:e.toString(),lt:t,hash:n,limit:1},qQe)).find((e=>e.transaction_id.lt===t&&e.transaction_id.hash===r));return i||null}async callGetMethod(e,t,r){return await this.doCall("runGetMethod",{address:e.toString(),method:t,stack:WQe(r)},NQe)}async sendBoc(e){await this.doCall("sendBoc",{boc:e.toString("base64")},LQe)}async estimateFee(e,t){return await this.doCall("estimateFee",{address:e.toString(),body:t.body.toBoc().toString("base64"),init_data:t.initData?t.initData.toBoc().toString("base64"):"",init_code:t.initCode?t.initCode.toBoc().toString("base64"):"",ignore_chksig:t.ignoreSignature},jQe)}async tryLocateResultTx(e,t,r){return await this.doCall("tryLocateResultTx",{source:e.toString(),destination:t.toString(),created_lt:r},FQe)}async tryLocateSourceTx(e,t,r){return await this.doCall("tryLocateSourceTx",{source:e.toString(),destination:t.toString(),created_lt:r},FQe)}async doCall(e,t,r){let n={"Content-Type":"application/json","X-Ton-Client-Version":PQe};this.parameters.apiKey&&(n["X-API-Key"]=this.parameters.apiKey);let i=await OQe.default.post(this.endpoint,JSON.stringify({id:"1",jsonrpc:"2.0",method:e,params:t}),{headers:n,timeout:this.parameters.timeout,adapter:this.parameters.adapter});if(200!==i.status||!i.data.ok)throw Error("Received error: "+JSON.stringify(i.data));let o=r.safeParse(i.data.result);if(o.success)return o.data;throw Error("Malformed response: "+o.error.format()._errors.join(", "))}};var GQe={};Object.defineProperty(GQe,"__esModule",{value:!0}),GQe.TonClient=void 0;const YQe=MWe,JQe=aHe;function XQe(e){const t=e["@type"];switch(t){case"tvm.list":case"tvm.tuple":return e.elements.map(XQe);case"tvm.cell":case"tvm.slice":return JQe.Cell.fromBoc(age.from(e.bytes,"base64"))[0];case"tvm.stackEntryCell":return XQe(e.cell);case"tvm.stackEntrySlice":return XQe(e.slice);case"tvm.stackEntryTuple":return XQe(e.tuple);case"tvm.stackEntryList":return XQe(e.list);case"tvm.stackEntryNumber":return XQe(e.number);case"tvm.numberDecimal":return BigInt(e.number);default:throw Error("Unsupported item type: "+t)}}function QQe(e){if("num"===e[0]){let t=e[1];return t.startsWith("-")?{type:"int",value:-BigInt(t.slice(1))}:{type:"int",value:BigInt(t)}}if("null"===e[0])return{type:"null"};if("cell"===e[0])return{type:"cell",cell:JQe.Cell.fromBoc(age.from(e[1].bytes,"base64"))[0]};if("slice"===e[0])return{type:"slice",cell:JQe.Cell.fromBoc(age.from(e[1].bytes,"base64"))[0]};if("builder"===e[0])return{type:"builder",cell:JQe.Cell.fromBoc(age.from(e[1].bytes,"base64"))[0]};if("tuple"===e[0]||"list"===e[0])return 0===e[1].elements.length?{type:"null"}:{type:"tuple",items:e[1].elements.map(XQe)};throw Error("Unsupported stack item type: "+e[0])}function e0e(e){let t=[];for(let r of e)t.push(QQe(r));return new JQe.TupleReader(t)}function t0e(e,t,r){return{async getState(){let r,n=await e.getContractState(t),i=n.balance,o=n.lastTransaction?{lt:BigInt(n.lastTransaction.lt),hash:age.from(n.lastTransaction.hash,"base64")}:null;if("active"===n.state)r={type:"active",code:n.code?n.code:null,data:n.data?n.data:null};else if("uninitialized"===n.state)r={type:"uninit"};else{if("frozen"!==n.state)throw Error("Unsupported state");r={type:"frozen",stateHash:age.alloc(0)}}return{balance:i,last:o,state:r}},async get(r,n){if("string"!=typeof r)throw new Error("Method name must be a string for TonClient provider");return{stack:(await e.runMethod(t,r,n)).stack}},async external(n){let i=null;r&&!await e.isContractDeployed(t)&&(i=r);const o=(0,JQe.external)({to:t,init:i,body:n});let s=(0,JQe.beginCell)().store((0,JQe.storeMessage)(o)).endCell().toBoc();await e.sendFile(s)},async internal(n,i){let o=null;r&&!await e.isContractDeployed(t)&&(o=r);let s,a=!0;null!==i.bounce&&void 0!==i.bounce&&(a=i.bounce),s="string"==typeof i.value?(0,JQe.toNano)(i.value):i.value;let c=null;"string"==typeof i.body?c=(0,JQe.comment)(i.body):i.body&&(c=i.body),await n.send({to:t,value:s,bounce:a,sendMode:i.sendMode,init:o,body:c})},open:t=>(0,JQe.openContract)(t,(t=>{var r;return t0e(e,t.address,null!==(r=t.init)&&void 0!==r?r:null)})),getTransactions:(t,r,n,i)=>e.getTransactions(t,{limit:null!=i?i:100,lt:r.toString(),hash:n.toString("base64"),inclusive:!0})}}GQe.TonClient=class{constructor(e){this.parameters={endpoint:e.endpoint},this.api=new YQe.HttpApi(this.parameters.endpoint,{timeout:e.timeout,apiKey:e.apiKey,adapter:e.httpAdapter})}async getBalance(e){return(await this.getContractState(e)).balance}async runMethod(e,t,r=[]){let n=await this.api.callGetMethod(e,t,r);if(0!==n.exit_code)throw Error("Unable to execute get method. Got exit_code: "+n.exit_code);return{gas_used:n.gas_used,stack:e0e(n.stack)}}async callGetMethod(e,t,r=[]){return this.runMethod(e,t,r)}async runMethodWithError(e,t,r=[]){let n=await this.api.callGetMethod(e,t,r);return{gas_used:n.gas_used,stack:e0e(n.stack),exit_code:n.exit_code}}async callGetMethodWithError(e,t,r=[]){return this.runMethodWithError(e,t,r)}async getTransactions(e,t){let r=await this.api.getTransactions(e,t),n=[];for(let e of r)n.push((0,JQe.loadTransaction)(JQe.Cell.fromBoc(age.from(e.data,"base64"))[0].beginParse()));return n}async getTransaction(e,t,r){let n=await this.api.getTransaction(e,t,r);return n?(0,JQe.loadTransaction)(JQe.Cell.fromBoc(age.from(n.data,"base64"))[0].beginParse()):null}async tryLocateResultTx(e,t,r){let n=await this.api.tryLocateResultTx(e,t,r);return(0,JQe.loadTransaction)(JQe.Cell.fromBase64(n.data).beginParse())}async tryLocateSourceTx(e,t,r){let n=await this.api.tryLocateSourceTx(e,t,r);return(0,JQe.loadTransaction)(JQe.Cell.fromBase64(n.data).beginParse())}async getMasterchainInfo(){let e=await this.api.getMasterchainInfo();return{workchain:e.init.workchain,shard:e.last.shard,initSeqno:e.init.seqno,latestSeqno:e.last.seqno}}async getWorkchainShards(e){return(await this.api.getShards(e)).map((e=>({workchain:e.workchain,shard:e.shard,seqno:e.seqno})))}async getShardTransactions(e,t,r){let n=await this.api.getBlockTransactions(e,t,r);if(n.incomplete)throw Error("Unsupported");return n.transactions.map((e=>({account:JQe.Address.parseRaw(e.account),lt:e.lt,hash:e.hash})))}async sendMessage(e){const t=(0,JQe.beginCell)().store((0,JQe.storeMessage)(e)).endCell().toBoc();await this.api.sendBoc(t)}async sendFile(e){await this.api.sendBoc(e)}async estimateExternalMessageFee(e,t){return await this.api.estimateFee(e,{body:t.body,initCode:t.initCode,initData:t.initData,ignoreSignature:t.ignoreSignature})}async sendExternalMessage(e,t){if(await this.isContractDeployed(e.address)||!e.init){const r=(0,JQe.external)({to:e.address,body:t});await this.sendMessage(r)}else{const r=(0,JQe.external)({to:e.address,init:e.init,body:t});await this.sendMessage(r)}}async isContractDeployed(e){return"active"===(await this.getContractState(e)).state}async getContractState(e){let t=await this.api.getAddressInformation(e);return{balance:BigInt(t.balance),state:t.state,code:""!==t.code?age.from(t.code,"base64"):null,data:""!==t.data?age.from(t.data,"base64"):null,lastTransaction:"0"!==t.last_transaction_id.lt?{lt:t.last_transaction_id.lt,hash:t.last_transaction_id.hash}:null,blockId:{workchain:t.block_id.workchain,shard:t.block_id.shard,seqno:t.block_id.seqno},timestampt:t.sync_utime}}open(e){return(0,JQe.openContract)(e,(e=>t0e(this,e.address,e.init)))}provider(e,t){return t0e(this,e,null!=t?t:null)}};var r0e={},n0e={};Object.defineProperty(n0e,"__esModule",{value:!0}),n0e.toUrlSafe=function(e){for(;e.indexOf("/")>=0;)e=e.replace("/","_");for(;e.indexOf("+")>=0;)e=e.replace("+","-");for(;e.indexOf("=")>=0;)e=e.replace("=","");return e};var i0e,o0e,s0e,a0e,c0e=e&&e.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},u0e=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},l0e=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r0e,"__esModule",{value:!0}),r0e.TonClient4=void 0;const d0e=l0e(iJe),f0e=aHe,h0e=n0e,p0e=oJe;function g0e(e,t,r,n){return{async getState(){let n=t;null===n&&(n=(await e.getLastBlock()).last.seqno);let i,o=await e.getAccount(n,r),s=o.account.last?{lt:BigInt(o.account.last.lt),hash:age.from(o.account.last.hash,"base64")}:null;if("active"===o.account.state.type)i={type:"active",code:o.account.state.code?age.from(o.account.state.code,"base64"):null,data:o.account.state.data?age.from(o.account.state.data,"base64"):null};else if("uninit"===o.account.state.type)i={type:"uninit"};else{if("frozen"!==o.account.state.type)throw Error("Unsupported state");i={type:"frozen",stateHash:age.from(o.account.state.stateHash,"base64")}}return{balance:BigInt(o.account.balance.coins),last:s,state:i}},async get(n,i){if("string"!=typeof n)throw new Error("Method name must be a string for TonClient4 provider");let o=t;null===o&&(o=(await e.getLastBlock()).last.seqno);let s=await e.runMethod(o,r,n,i);if(0!==s.exitCode&&1!==s.exitCode)throw Error("Exit code: "+s.exitCode);return{stack:new f0e.TupleReader(s.result)}},async external(t){let i=await e.getLastBlock(),o=null;n&&"active"!==(await e.getAccountLite(i.last.seqno,r)).account.state.type&&(o=n);const s=(0,f0e.external)({to:r,init:o,body:t});let a=(0,f0e.beginCell)().store((0,f0e.storeMessage)(s)).endCell().toBoc();await e.sendMessage(a)},async internal(t,i){let o=await e.getLastBlock(),s=null;n&&"active"!==(await e.getAccountLite(o.last.seqno,r)).account.state.type&&(s=n);let a,c=!0;null!==i.bounce&&void 0!==i.bounce&&(c=i.bounce),a="string"==typeof i.value?(0,f0e.toNano)(i.value):i.value;let u=null;"string"==typeof i.body?u=(0,f0e.comment)(i.body):i.body&&(u=i.body),await t.send({to:r,value:a,bounce:c,sendMode:i.sendMode,init:s,body:u})},open:r=>(0,f0e.openContract)(r,(r=>{var n;return g0e(e,t,r.address,null!==(n=r.init)&&void 0!==n?n:null)})),async getTransactions(t,r,n,i){const o="number"==typeof i;if(o&&i<=0)return[];let s=[];do{const i=await e.getAccountTransactions(t,r,n),o=i[0].tx,[a,c]=[o.lt,o.hash()];if(s.length>0&&a===r&&c.equals(n)&&i.shift(),0===i.length)break;const u=i[i.length-1].tx,[l,d]=[u.lt,u.hash()];if(l===r&&d.equals(n))break;s.push(...i.map((e=>e.tx))),r=l,n=d}while(o&&s.length0&&(r="/"+[...t].sort().join(","));let n=await u0e(this,a0e,"f").get(u0e(this,i0e,"f")+"/block/"+e+"/config"+r,{adapter:u0e(this,s0e,"f"),timeout:u0e(this,o0e,"f")}),i=S0e.safeParse(n.data);if(!i.success)throw Error("Mailformed response");return i.data}async runMethod(e,t,r,n){let i=n&&n.length>0?"/"+(0,h0e.toUrlSafe)((0,f0e.serializeTuple)(n).toBoc({idx:!1,crc32:!1}).toString("base64")):"",o=u0e(this,i0e,"f")+"/block/"+e+"/"+t.toString({urlSafe:!0})+"/run/"+encodeURIComponent(r)+i,s=await u0e(this,a0e,"f").get(o,{adapter:u0e(this,s0e,"f"),timeout:u0e(this,o0e,"f")}),a=E0e.safeParse(s.data);if(!a.success)throw Error("Mailformed response");let c=a.data.resultRaw?(0,f0e.parseTuple)(f0e.Cell.fromBoc(age.from(a.data.resultRaw,"base64"))[0]):[];return{exitCode:a.data.exitCode,result:c,resultRaw:a.data.resultRaw,block:a.data.block,shardBlock:a.data.shardBlock,reader:new f0e.TupleReader(c)}}async sendMessage(e){let t=await u0e(this,a0e,"f").post(u0e(this,i0e,"f")+"/send",{boc:e.toString("base64")},{adapter:u0e(this,s0e,"f"),timeout:u0e(this,o0e,"f")});if(!k0e.safeParse(t.data).success)throw Error("Mailformed response");return{status:t.data.status}}open(e){return(0,f0e.openContract)(e,(e=>g0e(this,null,e.address,e.init)))}openAt(e,t){return(0,f0e.openContract)(t,(t=>g0e(this,e,t.address,t.init)))}provider(e,t){return g0e(this,null,e,null!=t?t:null)}providerAt(e,t,r){return g0e(this,e,t,null!=r?r:null)}},i0e=new WeakMap,o0e=new WeakMap,s0e=new WeakMap,a0e=new WeakMap;const y0e=p0e.z.object({last:p0e.z.object({seqno:p0e.z.number(),shard:p0e.z.string(),workchain:p0e.z.number(),fileHash:p0e.z.string(),rootHash:p0e.z.string()}),init:p0e.z.object({fileHash:p0e.z.string(),rootHash:p0e.z.string()}),stateRootHash:p0e.z.string(),now:p0e.z.number()}),m0e=p0e.z.union([p0e.z.object({exist:p0e.z.literal(!1)}),p0e.z.object({exist:p0e.z.literal(!0),block:p0e.z.object({shards:p0e.z.array(p0e.z.object({workchain:p0e.z.number(),seqno:p0e.z.number(),shard:p0e.z.string(),rootHash:p0e.z.string(),fileHash:p0e.z.string(),transactions:p0e.z.array(p0e.z.object({account:p0e.z.string(),hash:p0e.z.string(),lt:p0e.z.string()}))}))})})]),b0e=p0e.z.object({lastPaid:p0e.z.number(),duePayment:p0e.z.union([p0e.z.null(),p0e.z.string()]),used:p0e.z.object({bits:p0e.z.number(),cells:p0e.z.number(),publicCells:p0e.z.number()})}),v0e=p0e.z.object({account:p0e.z.object({state:p0e.z.union([p0e.z.object({type:p0e.z.literal("uninit")}),p0e.z.object({type:p0e.z.literal("active"),code:p0e.z.union([p0e.z.string(),p0e.z.null()]),data:p0e.z.union([p0e.z.string(),p0e.z.null()])}),p0e.z.object({type:p0e.z.literal("frozen"),stateHash:p0e.z.string()})]),balance:p0e.z.object({coins:p0e.z.string()}),last:p0e.z.union([p0e.z.null(),p0e.z.object({lt:p0e.z.string(),hash:p0e.z.string()})]),storageStat:p0e.z.union([p0e.z.null(),b0e])}),block:p0e.z.object({workchain:p0e.z.number(),seqno:p0e.z.number(),shard:p0e.z.string(),rootHash:p0e.z.string(),fileHash:p0e.z.string()})}),w0e=p0e.z.object({account:p0e.z.object({state:p0e.z.union([p0e.z.object({type:p0e.z.literal("uninit")}),p0e.z.object({type:p0e.z.literal("active"),codeHash:p0e.z.string(),dataHash:p0e.z.string()}),p0e.z.object({type:p0e.z.literal("frozen"),stateHash:p0e.z.string()})]),balance:p0e.z.object({coins:p0e.z.string()}),last:p0e.z.union([p0e.z.null(),p0e.z.object({lt:p0e.z.string(),hash:p0e.z.string()})]),storageStat:p0e.z.union([p0e.z.null(),b0e])})}),_0e=p0e.z.object({changed:p0e.z.boolean(),block:p0e.z.object({workchain:p0e.z.number(),seqno:p0e.z.number(),shard:p0e.z.string(),rootHash:p0e.z.string(),fileHash:p0e.z.string()})}),E0e=p0e.z.object({exitCode:p0e.z.number(),resultRaw:p0e.z.union([p0e.z.string(),p0e.z.null()]),block:p0e.z.object({workchain:p0e.z.number(),seqno:p0e.z.number(),shard:p0e.z.string(),rootHash:p0e.z.string(),fileHash:p0e.z.string()}),shardBlock:p0e.z.object({workchain:p0e.z.number(),seqno:p0e.z.number(),shard:p0e.z.string(),rootHash:p0e.z.string(),fileHash:p0e.z.string()})}),S0e=p0e.z.object({config:p0e.z.object({cell:p0e.z.string(),address:p0e.z.string(),globalBalance:p0e.z.object({coins:p0e.z.string()})})}),k0e=p0e.z.object({status:p0e.z.number()}),A0e=p0e.z.array(p0e.z.object({workchain:p0e.z.number(),seqno:p0e.z.number(),shard:p0e.z.string(),rootHash:p0e.z.string(),fileHash:p0e.z.string()})),x0e=p0e.z.object({blocks:A0e,boc:p0e.z.string()}),I0e=p0e.z.object({bits:p0e.z.number(),data:p0e.z.string()}),B0e=p0e.z.union([p0e.z.object({type:p0e.z.literal("internal"),value:p0e.z.string(),dest:p0e.z.string(),src:p0e.z.string(),bounced:p0e.z.boolean(),bounce:p0e.z.boolean(),ihrDisabled:p0e.z.boolean(),createdAt:p0e.z.number(),createdLt:p0e.z.string(),fwdFee:p0e.z.string(),ihrFee:p0e.z.string()}),p0e.z.object({type:p0e.z.literal("external-in"),dest:p0e.z.string(),src:p0e.z.union([I0e,p0e.z.null()]),importFee:p0e.z.string()}),p0e.z.object({type:p0e.z.literal("external-out"),dest:p0e.z.union([I0e,p0e.z.null()])})]),T0e=p0e.z.object({splitDepth:p0e.z.union([p0e.z.number(),p0e.z.null()]),code:p0e.z.union([p0e.z.string(),p0e.z.null()]),data:p0e.z.union([p0e.z.string(),p0e.z.null()]),special:p0e.z.union([p0e.z.object({tick:p0e.z.boolean(),tock:p0e.z.boolean()}),p0e.z.null()])}),C0e=p0e.z.object({body:p0e.z.string(),info:B0e,init:p0e.z.union([T0e,p0e.z.null()])}),O0e=p0e.z.union([p0e.z.literal("uninitialized"),p0e.z.literal("frozen"),p0e.z.literal("active"),p0e.z.literal("non-existing")]),R0e=p0e.z.union([p0e.z.object({type:p0e.z.literal("comment"),comment:p0e.z.string()}),p0e.z.object({type:p0e.z.literal("payload"),cell:p0e.z.string()})]),P0e=p0e.z.union([p0e.z.object({kind:p0e.z.literal("ton"),amount:p0e.z.string()}),p0e.z.object({kind:p0e.z.literal("token"),amount:p0e.z.string()})]),M0e=p0e.z.union([p0e.z.literal("jetton::excesses"),p0e.z.literal("jetton::transfer"),p0e.z.literal("jetton::transfer_notification"),p0e.z.literal("deposit"),p0e.z.literal("deposit::ok"),p0e.z.literal("withdraw"),p0e.z.literal("withdraw::all"),p0e.z.literal("withdraw::delayed"),p0e.z.literal("withdraw::ok"),p0e.z.literal("airdrop")]),U0e=p0e.z.object({type:M0e,options:p0e.z.optional(p0e.z.record(p0e.z.string()))}),L0e=p0e.z.object({address:p0e.z.string(),comment:p0e.z.optional(p0e.z.string()),items:p0e.z.array(P0e),op:p0e.z.optional(U0e)}),j0e=p0e.z.object({address:p0e.z.string(),lt:p0e.z.string(),hash:p0e.z.string(),prevTransaction:p0e.z.object({lt:p0e.z.string(),hash:p0e.z.string()}),time:p0e.z.number(),outMessagesCount:p0e.z.number(),oldStatus:O0e,newStatus:O0e,fees:p0e.z.string(),update:p0e.z.object({oldHash:p0e.z.string(),newHash:p0e.z.string()}),inMessage:p0e.z.union([C0e,p0e.z.null()]),outMessages:p0e.z.array(C0e),parsed:p0e.z.object({seqno:p0e.z.union([p0e.z.number(),p0e.z.null()]),body:p0e.z.union([R0e,p0e.z.null()]),status:p0e.z.union([p0e.z.literal("success"),p0e.z.literal("failed"),p0e.z.literal("pending")]),dest:p0e.z.union([p0e.z.string(),p0e.z.null()]),kind:p0e.z.union([p0e.z.literal("out"),p0e.z.literal("in")]),amount:p0e.z.string(),resolvedAddress:p0e.z.string(),bounced:p0e.z.boolean(),mentioned:p0e.z.array(p0e.z.string())}),operation:L0e}),N0e=p0e.z.object({blocks:A0e,transactions:p0e.z.array(j0e)});var z0e={},D0e={},F0e={},q0e={};Object.defineProperty(q0e,"__esModule",{value:!0}),q0e.loadWalletIdV5Beta=function(e){var t;const r=new H0e.BitReader(new H0e.BitString("bigint"==typeof e?age.from(e.toString(16),"hex"):e instanceof H0e.Slice?e.loadBuffer(10):e,0,80)),n=r.loadInt(32),i=r.loadInt(8),o=r.loadUint(8),s=r.loadUint(32),a=null===(t=Object.entries(V0e).find((([e,t])=>t===o)))||void 0===t?void 0:t[0];if(void 0===a)throw new Error(`Can't deserialize walletId: unknown wallet version ${o}`);return{networkGlobalId:n,workchain:i,walletVersion:a,subwalletNumber:s}},q0e.storeWalletIdV5Beta=function(e){return t=>{t.storeInt(e.networkGlobalId,32),t.storeInt(e.workchain,8),t.storeUint(V0e[e.walletVersion],8),t.storeUint(e.subwalletNumber,32)}};const H0e=aHe,V0e={v5:0};var $0e;function K0e(){if($0e)return F0e;$0e=1,Object.defineProperty(F0e,"__esModule",{value:!0}),F0e.WalletContractV5Beta=void 0;const e=aHe,t=S1e(),r=q0e;class n{static create(e){var t,r,i,o,s,a,c,u;const l={networkGlobalId:null!==(t=null===(r=e.walletId)||void 0===r?void 0:r.networkGlobalId)&&void 0!==t?t:-239,workchain:null!==(i=null==e||null===(o=e.walletId)||void 0===o?void 0:o.workchain)&&void 0!==i?i:0,subwalletNumber:null!==(s=null==e||null===(a=e.walletId)||void 0===a?void 0:a.subwalletNumber)&&void 0!==s?s:0,walletVersion:null!==(c=null==e||null===(u=e.walletId)||void 0===u?void 0:u.walletVersion)&&void 0!==c?c:"v5"};return new n(l,e.publicKey)}constructor(t,n){this.walletId=t,this.publicKey=n,this.walletId=t;let i=e.Cell.fromBoc(age.from("te6cckEBAQEAIwAIQgLkzzsvTG1qYeoPK1RH0mZ4WyavNjfbLe7mvNGqgm80Eg3NjhE=","base64"))[0],o=(0,e.beginCell)().storeInt(0,33).store((0,r.storeWalletIdV5Beta)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:i,data:o},this.address=(0,e.contractAddress)(this.walletId.workchain,{code:i,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async getExtensions(e){return"active"===(await e.getState()).state.type?(await e.get("get_extensions",[])).stack.readCellOpt():null}async getExtensionsArray(t){const r=await this.getExtensions(t);if(!r)return[];const n=e.Dictionary.loadDirect(e.Dictionary.Keys.BigUint(256),e.Dictionary.Values.BigInt(8),r);return n.keys().map((t=>{const r=n.get(t),i=t^r+1n;return e.Address.parseRaw(`${r}:${i.toString(16).padStart(64,"0")}`)}))}async getIsSecretKeyAuthEnabled(e){return 0!==(await e.get("get_is_signature_auth_allowed",[])).stack.readNumber()}async send(e,t){await e.external(t)}async sendTransfer(e,t){const r=await this.createTransfer(t);await this.send(e,r)}async sendAddExtension(e,t){const r=await this.createAddExtension(t);await this.send(e,r)}async sendRemoveExtension(e,t){const r=await this.createRemoveExtension(t);await this.send(e,r)}async sendActionsBatch(e,t){const r=await this.createRequest(t);await this.send(e,r)}createActions(e){const t=e.messages.map((t=>({type:"sendMsg",mode:e.sendMode,outMsg:t})));return t}createTransfer(e){return this.createRequest({...e,actions:this.createActions({messages:e.messages,sendMode:e.sendMode})})}createAddExtension(e){return this.createRequest({...e,actions:[{type:"addExtension",address:e.extensionAddress}]})}createRemoveExtension(e){return this.createRequest({...e,actions:[{type:"removeExtension",address:e.extensionAddress}]})}createRequest(e){return"extension"===e.authType?(0,t.createWalletTransferV5Beta)(e):(0,t.createWalletTransferV5Beta)({...e,walletId:(0,r.storeWalletIdV5Beta)(this.walletId)})}sender(t,r){return{send:async n=>{var i;let o=await this.getSeqno(t),s=this.createTransfer({seqno:o,secretKey:r,sendMode:null!==(i=n.sendMode)&&void 0!==i?i:e.SendMode.PAY_GAS_SEPARATELY+e.SendMode.IGNORE_ERRORS,messages:[(0,e.internal)({to:n.to,value:n.value,init:n.init,body:n.body,bounce:n.bounce})]});await this.send(t,s)}}}}return F0e.WalletContractV5Beta=n,n.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396},F0e}var Z0e={},W0e={};function G0e(e){return"setIsPublicKeyEnabled"===e.type||"addExtension"===e.type||"removeExtension"===e.type}Object.defineProperty(W0e,"__esModule",{value:!0}),W0e.isOutActionExtended=G0e,W0e.isOutActionBasic=function(e){return!G0e(e)},Object.defineProperty(Z0e,"__esModule",{value:!0}),Z0e.storeOutActionExtendedV5Beta=t1e,Z0e.loadOutActionV5BetaExtended=r1e,Z0e.storeOutListExtendedV5Beta=function e(t){const[r,...n]=t;if(!r||!(0,J0e.isOutActionExtended)(r)){if(t.some(J0e.isOutActionExtended))throw new Error("Can't serialize actions list: all extended actions must be placed before out actions");return e=>{e.storeUint(0,1).storeRef((0,Y0e.beginCell)().store((0,Y0e.storeOutList)(t)).endCell())}}return t=>{t.storeUint(1,1).store(t1e(r)).storeRef((0,Y0e.beginCell)().store(e(n)).endCell())}},Z0e.loadOutListExtendedV5Beta=function(e){const t=[];for(;e.loadUint(1);){const r=r1e(e);t.push(r),e=e.loadRef().beginParse()}const r=(0,Y0e.loadOutList)(e.loadRef().beginParse());if(r.some((e=>"setCode"===e.type)))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5");return t.concat(r)};const Y0e=aHe,J0e=W0e,X0e=550222170,Q0e=474012575,e1e=1588524196;function t1e(e){switch(e.type){case"setIsPublicKeyEnabled":return function(e){return t=>{t.storeUint(X0e,32).storeUint(e.isEnabled?1:0,1)}}(e);case"addExtension":return function(e){return t=>{t.storeUint(Q0e,32).storeAddress(e.address)}}(e);case"removeExtension":return function(e){return t=>{t.storeUint(e1e,32).storeAddress(e.address)}}(e);default:throw new Error("Unknown action type"+(null==e?void 0:e.type))}}function r1e(e){const t=e.loadUint(32);switch(t){case X0e:return{type:"setIsPublicKeyEnabled",isEnabled:!!e.loadUint(1)};case Q0e:return{type:"addExtension",address:e.loadAddress()};case e1e:return{type:"removeExtension",address:e.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${t.toString(16)}`)}}var n1e={};Object.defineProperty(n1e,"__esModule",{value:!0}),n1e.signPayload=function(e,t,r){return"secretKey"in e?r((0,i1e.sign)(t.endCell().hash(),e.secretKey),t):e.signer(t.endCell()).then((e=>r(e,t)))};const i1e=uKe();var o1e={},s1e={};Object.defineProperty(s1e,"__esModule",{value:!0}),s1e.isWalletIdV5R1ClientContext=c1e,s1e.loadWalletIdV5R1=function(e,t){const r=new a1e.BitReader(new a1e.BitString("bigint"==typeof e?age.from(e.toString(16),"hex"):e instanceof a1e.Slice?e.loadBuffer(4):e,0,32)).loadInt(32),n=BigInt(r)^BigInt(t),i=(0,a1e.beginCell)().storeInt(n,32).endCell().beginParse();if(i.loadUint(1)){var o;const e=i.loadInt(8),r=i.loadUint(8),n=i.loadUint(15),s=null===(o=Object.entries(u1e).find((([e,t])=>t===r)))||void 0===o?void 0:o[0];if(void 0===s)throw new Error(`Can't deserialize walletId: unknown wallet version ${r}`);return{networkGlobalId:t,context:{walletVersion:s,workchain:e,subwalletNumber:n}}}return{networkGlobalId:t,context:i.loadUint(31)}},s1e.storeWalletIdV5R1=function(e){return t=>{let r;return r=c1e(e.context)?(0,a1e.beginCell)().storeUint(1,1).storeInt(e.context.workchain,8).storeUint(u1e[e.context.walletVersion],8).storeUint(e.context.subwalletNumber,15).endCell().beginParse().loadInt(32):(0,a1e.beginCell)().storeUint(0,1).storeUint(e.context,31).endCell().beginParse().loadInt(32),t.storeInt(BigInt(e.networkGlobalId)^BigInt(r),32)}};const a1e=aHe;function c1e(e){return"number"!=typeof e}const u1e={v5r1:0};var l1e;function d1e(){if(l1e)return o1e;l1e=1,Object.defineProperty(o1e,"__esModule",{value:!0}),o1e.WalletContractV5R1=void 0;const e=aHe,t=S1e(),r=s1e;class n{static create(e){var t,i,o,s,a;let c=0;return"workchain"in e&&null!=e.workchain&&(c=e.workchain),null!==(t=e.walletId)&&void 0!==t&&t.context&&(0,r.isWalletIdV5R1ClientContext)(e.walletId.context)&&null!=e.walletId.context.workchain&&(c=e.walletId.context.workchain),new n(c,e.publicKey,{networkGlobalId:null!==(i=null===(o=e.walletId)||void 0===o?void 0:o.networkGlobalId)&&void 0!==i?i:-239,context:null!==(s=null===(a=e.walletId)||void 0===a?void 0:a.context)&&void 0!==s?s:{workchain:0,walletVersion:"v5r1",subwalletNumber:0}})}constructor(t,n,i){this.publicKey=n,this.walletId=i,this.walletId=i;let o=e.Cell.fromBoc(age.from("b5ee9c7241021401000281000114ff00f4a413f4bcf2c80b01020120020d020148030402dcd020d749c120915b8f6320d70b1f2082106578746ebd21821073696e74bdb0925f03e082106578746eba8eb48020d72101d074d721fa4030fa44f828fa443058bd915be0ed44d0810141d721f4058307f40e6fa1319130e18040d721707fdb3ce03120d749810280b99130e070e2100f020120050c020120060902016e07080019adce76a2684020eb90eb85ffc00019af1df6a2684010eb90eb858fc00201480a0b0017b325fb51341c75c875c2c7e00011b262fb513435c280200019be5f0f6a2684080a0eb90fa02c0102f20e011e20d70b1f82107369676ebaf2e08a7f0f01e68ef0eda2edfb218308d722028308d723208020d721d31fd31fd31fed44d0d200d31f20d31fd3ffd70a000af90140ccf9109a28945f0adb31e1f2c087df02b35007b0f2d0845125baf2e0855036baf2e086f823bbf2d0882292f800de01a47fc8ca00cb1f01cf16c9ed542092f80fde70db3cd81003f6eda2edfb02f404216e926c218e4c0221d73930709421c700b38e2d01d72820761e436c20d749c008f2e09320d74ac002f2e09320d71d06c712c2005230b0f2d089d74cd7393001a4e86c128407bbf2e093d74ac000f2e093ed55e2d20001c000915be0ebd72c08142091709601d72c081c12e25210b1e30f20d74a111213009601fa4001fa44f828fa443058baf2e091ed44d0810141d718f405049d7fc8ca0040048307f453f2e08b8e14038307f45bf2e08c22d70a00216e01b3b0f2d090e2c85003cf1612f400c9ed54007230d72c08248e2d21f2e092d200ed44d0d2005113baf2d08f54503091319c01810140d721d70a00f2e08ee2c8ca0058cf16c9ed5493f2c08de20010935bdb31e1d74cd0b4d6c35e","hex"))[0],s=(0,e.beginCell)().storeUint(1,1).storeUint(0,32).store((0,r.storeWalletIdV5R1)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:o,data:s},this.address=(0,e.contractAddress)(t,{code:o,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async getExtensions(e){return"active"===(await e.getState()).state.type?(await e.get("get_extensions",[])).stack.readCellOpt():null}async getExtensionsArray(t){const r=await this.getExtensions(t);return r?e.Dictionary.loadDirect(e.Dictionary.Keys.BigUint(256),e.Dictionary.Values.BigInt(1),r).keys().map((t=>{const r=this.address.workChain;return e.Address.parseRaw(`${r}:${t.toString(16).padStart(64,"0")}`)})):[]}async getIsSecretKeyAuthEnabled(e){return(await e.get("is_signature_allowed",[])).stack.readBoolean()}async send(e,t){await e.external(t)}async sendTransfer(e,t){const r=await this.createTransfer(t);await this.send(e,r)}async sendAddExtension(e,t){const r=await this.createAddExtension(t);await this.send(e,r)}async sendRemoveExtension(e,t){const r=await this.createRemoveExtension(t);await this.send(e,r)}createActions(e){const t=e.messages.map((t=>({type:"sendMsg",mode:e.sendMode,outMsg:t})));return t}createTransfer(e){return this.createRequest({actions:this.createActions({messages:e.messages,sendMode:e.sendMode}),...e})}createAddExtension(e){return this.createRequest({actions:[{type:"addExtension",address:e.extensionAddress}],...e})}createRemoveExtension(e){return this.createRequest({actions:[{type:"removeExtension",address:e.extensionAddress}],...e})}createRequest(e){return"extension"===e.authType?(0,t.createWalletTransferV5R1)(e):(0,t.createWalletTransferV5R1)({...e,walletId:(0,r.storeWalletIdV5R1)(this.walletId)})}sender(t,r){return{send:async n=>{var i;let o=await this.getSeqno(t),s=this.createTransfer({seqno:o,secretKey:r,sendMode:null!==(i=n.sendMode)&&void 0!==i?i:e.SendMode.PAY_GAS_SEPARATELY+e.SendMode.IGNORE_ERRORS,messages:[(0,e.internal)({to:n.to,value:n.value,init:n.init,body:n.body,bounce:n.bounce})]});await this.send(t,s)}}}}return o1e.WalletContractV5R1=n,n.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396},o1e}var f1e={};Object.defineProperty(f1e,"__esModule",{value:!0}),f1e.storeOutActionExtendedV5R1=b1e,f1e.loadOutActionExtendedV5R1=v1e,f1e.storeOutListExtendedV5R1=function(e){const t=e.filter(p1e.isOutActionExtended),r=e.filter(p1e.isOutActionBasic);return e=>{const n=r.length?(0,h1e.beginCell)().store((0,h1e.storeOutList)(r.slice().reverse())):null;if(e.storeMaybeRef(n),0===t.length)e.storeUint(0,1);else{const[r,...n]=t;e.storeUint(1,1).store(b1e(r)),n.length>0&&e.storeRef(w1e(n))}}},f1e.loadOutListExtendedV5R1=function(e){const t=[],r=e.loadMaybeRef();if(r){const e=(0,h1e.loadOutList)(r.beginParse());if(e.some((e=>"sendMsg"!==e.type)))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5r1");t.push(...e)}if(e.loadBoolean()){const r=v1e(e);t.push(r)}for(;e.remainingRefs>0;){const r=v1e(e=e.loadRef().beginParse());t.push(r)}return t},f1e.toSafeV5R1SendMode=_1e,f1e.patchV5R1ActionsSendMode=function(e,t){return e.map((e=>"sendMsg"===e.type?{...e,mode:_1e(e.mode,t)}:e))};const h1e=aHe,p1e=W0e,g1e=4,y1e=2,m1e=3;function b1e(e){switch(e.type){case"setIsPublicKeyEnabled":return function(e){return t=>{t.storeUint(g1e,8).storeUint(e.isEnabled?1:0,1)}}(e);case"addExtension":return function(e){return t=>{t.storeUint(y1e,8).storeAddress(e.address)}}(e);case"removeExtension":return function(e){return t=>{t.storeUint(m1e,8).storeAddress(e.address)}}(e);default:throw new Error("Unknown action type"+(null==e?void 0:e.type))}}function v1e(e){const t=e.loadUint(8);switch(t){case g1e:return{type:"setIsPublicKeyEnabled",isEnabled:!!e.loadUint(1)};case y1e:return{type:"addExtension",address:e.loadAddress()};case m1e:return{type:"removeExtension",address:e.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${t.toString(16)}`)}}function w1e(e){const[t,...r]=e;let n=(0,h1e.beginCell)().store(b1e(t));return r.length>0&&(n=n.storeRef(w1e(r))),n.endCell()}function _1e(e,t){return"internal"===t||"extension"===t?e:e|h1e.SendMode.IGNORE_ERRORS}var E1e;function S1e(){if(E1e)return D0e;E1e=1,Object.defineProperty(D0e,"__esModule",{value:!0}),D0e.createWalletTransferV1=function(r){let n=(0,e.beginCell)().storeUint(r.seqno,32);r.message&&(n.storeUint(r.sendMode,8),n.storeRef((0,e.beginCell)().store((0,e.storeMessageRelaxed)(r.message))));let i=(0,t.sign)(n.endCell().hash(),r.secretKey);const o=(0,e.beginCell)().storeBuffer(i).storeBuilder(n).endCell();return o},D0e.createWalletTransferV2=function(r){if(r.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let n=(0,e.beginCell)().storeUint(r.seqno,32);if(0===r.seqno)for(let e=0;e<32;e++)n.storeBit(1);else n.storeUint(r.timeout||Math.floor(Date.now()/1e3)+60,32);for(let t of r.messages)n.storeUint(r.sendMode,8),n.storeRef((0,e.beginCell)().store((0,e.storeMessageRelaxed)(t)));let i=(0,t.sign)(n.endCell().hash(),r.secretKey);const o=(0,e.beginCell)().storeBuffer(i).storeBuilder(n).endCell();return o},D0e.createWalletTransferV3=function(t){if(t.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let r=(0,e.beginCell)().storeUint(t.walletId,32);if(0===t.seqno)for(let e=0;e<32;e++)r.storeBit(1);else r.storeUint(t.timeout||Math.floor(Date.now()/1e3)+60,32);r.storeUint(t.seqno,32);for(let n of t.messages)r.storeUint(t.sendMode,8),r.storeRef((0,e.beginCell)().store((0,e.storeMessageRelaxed)(n)));return(0,i.signPayload)(t,r,a)},D0e.createWalletTransferV4=function(t){if(t.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let r=(0,e.beginCell)().storeUint(t.walletId,32);if(0===t.seqno)for(let e=0;e<32;e++)r.storeBit(1);else r.storeUint(t.timeout||Math.floor(Date.now()/1e3)+60,32);r.storeUint(t.seqno,32),r.storeUint(0,8);for(let n of t.messages)r.storeUint(t.sendMode,8),r.storeRef((0,e.beginCell)().store((0,e.storeMessageRelaxed)(n)));return(0,i.signPayload)(t,r,a)},D0e.createWalletTransferV5Beta=function(t){if(t.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");if("extension"===t.authType)return(0,e.beginCell)().storeUint(r.WalletContractV5Beta.OpCodes.auth_extension,32).store((0,n.storeOutListExtendedV5Beta)(t.actions)).endCell();const o=(0,e.beginCell)().storeUint("internal"===t.authType?r.WalletContractV5Beta.OpCodes.auth_signed_internal:r.WalletContractV5Beta.OpCodes.auth_signed_external,32).store(t.walletId);if(0===t.seqno)for(let e=0;e<32;e++)o.storeBit(1);else o.storeUint(t.timeout||Math.floor(Date.now()/1e3)+60,32);return o.storeUint(t.seqno,32).store((0,n.storeOutListExtendedV5Beta)(t.actions)),(0,i.signPayload)(t,o,c)},D0e.createWalletTransferV5R1=function(t){if(t.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");var r;if("extension"===(t={...t}).authType)return(0,e.beginCell)().storeUint(o.WalletContractV5R1.OpCodes.auth_extension,32).storeUint(null!==(r=t.queryId)&&void 0!==r?r:0,64).store((0,s.storeOutListExtendedV5R1)(t.actions)).endCell();t.actions=(0,s.patchV5R1ActionsSendMode)(t.actions,t.authType);const n=(0,e.beginCell)().storeUint("internal"===t.authType?o.WalletContractV5R1.OpCodes.auth_signed_internal:o.WalletContractV5R1.OpCodes.auth_signed_external,32).store(t.walletId);if(0===t.seqno)for(let e=0;e<32;e++)n.storeBit(1);else n.storeUint(t.timeout||Math.floor(Date.now()/1e3)+60,32);return n.storeUint(t.seqno,32).store((0,s.storeOutListExtendedV5R1)(t.actions)),(0,i.signPayload)(t,n,c)};const e=aHe,t=uKe(),r=K0e(),n=Z0e,i=n1e,o=d1e(),s=f1e;function a(t,r){return(0,e.beginCell)().storeBuffer(t).storeBuilder(r).endCell()}function c(t,r){return(0,e.beginCell)().storeBuilder(r).storeBuffer(t).endCell()}return D0e}Object.defineProperty(z0e,"__esModule",{value:!0}),z0e.WalletContractV1R1=void 0;const k1e=aHe,A1e=S1e();class x1e{static create(e){return new x1e(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=k1e.Cell.fromBoc(age.from("te6cckEBAQEARAAAhP8AIN2k8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVEH98Ik=","base64"))[0],n=(0,k1e.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:n},this.address=(0,k1e.contractAddress)(e,{code:r,data:n})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){let t=await e.getState();return"active"===t.state.type?k1e.Cell.fromBoc(t.state.data)[0].beginParse().loadUint(32):0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=k1e.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,A1e.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),i=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,k1e.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,i)}}}}z0e.WalletContractV1R1=x1e;var I1e={};Object.defineProperty(I1e,"__esModule",{value:!0}),I1e.WalletContractV1R2=void 0;const B1e=aHe,T1e=S1e();class C1e{static create(e){return new C1e(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=B1e.Cell.fromBoc(age.from("te6cckEBAQEAUwAAov8AIN0gggFMl7qXMO1E0NcLH+Ck8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVNDieG8=","base64"))[0],n=(0,B1e.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:n},this.address=(0,B1e.contractAddress)(e,{code:r,data:n})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=B1e.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,T1e.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),i=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,B1e.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,i)}}}}I1e.WalletContractV1R2=C1e;var O1e={};Object.defineProperty(O1e,"__esModule",{value:!0}),O1e.WalletContractV1R3=void 0;const R1e=aHe,P1e=S1e();class M1e{static create(e){return new M1e(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=R1e.Cell.fromBoc(age.from("te6cckEBAQEAXwAAuv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVLW4bkI=","base64"))[0],n=(0,R1e.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:n},this.address=(0,R1e.contractAddress)(e,{code:r,data:n})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=R1e.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,P1e.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),i=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,R1e.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,i)}}}}O1e.WalletContractV1R3=M1e;var U1e={};Object.defineProperty(U1e,"__esModule",{value:!0}),U1e.WalletContractV2R1=void 0;const L1e=aHe,j1e=S1e();class N1e{static create(e){return new N1e(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=L1e.Cell.fromBoc(age.from("te6cckEBAQEAVwAAqv8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VShNwu2","base64"))[0],n=(0,L1e.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:n},this.address=(0,L1e.contractAddress)(e,{code:r,data:n})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=L1e.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,j1e.createWalletTransferV2)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),i=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,L1e.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,i)}}}}U1e.WalletContractV2R1=N1e;var z1e={};Object.defineProperty(z1e,"__esModule",{value:!0}),z1e.WalletContractV2R2=void 0;const D1e=aHe,F1e=S1e();class q1e{static create(e){return new q1e(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=D1e.Cell.fromBoc(age.from("te6cckEBAQEAYwAAwv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VQETNeh","base64"))[0],n=(0,D1e.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:n},this.address=(0,D1e.contractAddress)(e,{code:r,data:n})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=D1e.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,F1e.createWalletTransferV2)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),i=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,D1e.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,i)}}}}z1e.WalletContractV2R2=q1e;var H1e={};Object.defineProperty(H1e,"__esModule",{value:!0}),H1e.WalletContractV3R1=void 0;const V1e=aHe,$1e=S1e();class K1e{static create(e){return new K1e(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let n=V1e.Cell.fromBoc(age.from("te6cckEBAQEAYgAAwP8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVD++buA=","base64"))[0],i=(0,V1e.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(t).endCell();this.init={code:n,data:i},this.address=(0,V1e.contractAddress)(e,{code:n,data:i})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){var t;return(0,$1e.createWalletTransferV3)({...e,sendMode:null!==(t=e.sendMode)&&void 0!==t?t:V1e.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),i=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,V1e.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,i)}}}}H1e.WalletContractV3R1=K1e;var Z1e={};Object.defineProperty(Z1e,"__esModule",{value:!0}),Z1e.WalletContractV3R2=void 0;const W1e=aHe,G1e=S1e();class Y1e{static create(e){return new Y1e(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let n=W1e.Cell.fromBoc(age.from("te6cckEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVBC9ba0=","base64"))[0],i=(0,W1e.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(t).endCell();this.init={code:n,data:i},this.address=(0,W1e.contractAddress)(e,{code:n,data:i})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){var t;return(0,G1e.createWalletTransferV3)({...e,sendMode:null!==(t=e.sendMode)&&void 0!==t?t:W1e.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),i=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,W1e.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,i)}}}}Z1e.WalletContractV3R2=Y1e;var J1e={};Object.defineProperty(J1e,"__esModule",{value:!0}),J1e.WalletContractV4=void 0;const X1e=aHe,Q1e=S1e();class e2e{static create(e){return new e2e(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let n=X1e.Cell.fromBoc(age.from("te6ccgECFAEAAtQAART/APSkE/S88sgLAQIBIAIDAgFIBAUE+PKDCNcYINMf0x/THwL4I7vyZO1E0NMf0x/T//QE0VFDuvKhUVG68qIF+QFUEGT5EPKj+AAkpMjLH1JAyx9SMMv/UhD0AMntVPgPAdMHIcAAn2xRkyDXSpbTB9QC+wDoMOAhwAHjACHAAuMAAcADkTDjDQOkyMsfEssfy/8QERITAubQAdDTAyFxsJJfBOAi10nBIJJfBOAC0x8hghBwbHVnvSKCEGRzdHK9sJJfBeAD+kAwIPpEAcjKB8v/ydDtRNCBAUDXIfQEMFyBAQj0Cm+hMbOSXwfgBdM/yCWCEHBsdWe6kjgw4w0DghBkc3RyupJfBuMNBgcCASAICQB4AfoA9AQw+CdvIjBQCqEhvvLgUIIQcGx1Z4MesXCAGFAEywUmzxZY+gIZ9ADLaRfLH1Jgyz8gyYBA+wAGAIpQBIEBCPRZMO1E0IEBQNcgyAHPFvQAye1UAXKwjiOCEGRzdHKDHrFwgBhQBcsFUAPPFiP6AhPLassfyz/JgED7AJJfA+ICASAKCwBZvSQrb2omhAgKBrkPoCGEcNQICEekk30pkQzmkD6f+YN4EoAbeBAUiYcVnzGEAgFYDA0AEbjJftRNDXCx+AA9sp37UTQgQFA1yH0BDACyMoHy//J0AGBAQj0Cm+hMYAIBIA4PABmtznaiaEAga5Drhf/AABmvHfaiaEAQa5DrhY/AAG7SB/oA1NQi+QAFyMoHFcv/ydB3dIAYyMsFywIizxZQBfoCFMtrEszMyXP7AMhAFIEBCPRR8qcCAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAAr0AMntVA==","base64"))[0],i=(0,X1e.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(this.publicKey).storeBit(0).endCell();this.init={code:n,data:i},this.address=(0,X1e.contractAddress)(e,{code:n,data:i})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return"active"===(await e.getState()).state.type?(await e.get("seqno",[])).stack.readNumber():0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){var t;return(0,Q1e.createWalletTransferV4)({...e,sendMode:null!==(t=e.sendMode)&&void 0!==t?t:X1e.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(e,t){return{send:async r=>{let n=await this.getSeqno(e),i=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,X1e.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,i)}}}}J1e.WalletContractV4=e2e;var t2e={};!function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(K0e(),t),n(Z0e,t),n(q0e,t)}(t2e);var r2e={};!function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(d1e(),t),n(f1e,t),n(s1e,t)}(r2e);var n2e={};Object.defineProperty(n2e,"__esModule",{value:!0}),n2e.JettonMaster=void 0;const i2e=aHe;class o2e{static create(e){return new o2e(e)}constructor(e){this.address=e}async getWalletAddress(e,t){return(await e.get("get_wallet_address",[{type:"slice",cell:(0,i2e.beginCell)().storeAddress(t).endCell()}])).stack.readAddress()}async getJettonData(e){let t=await e.get("get_jetton_data",[]);return{totalSupply:t.stack.readBigNumber(),mintable:t.stack.readBoolean(),adminAddress:t.stack.readAddress(),content:t.stack.readCell(),walletCode:t.stack.readCell()}}}n2e.JettonMaster=o2e;var s2e={};Object.defineProperty(s2e,"__esModule",{value:!0}),s2e.JettonWallet=void 0;class a2e{static create(e){return new a2e(e)}constructor(e){this.address=e}async getBalance(e){return"active"!==(await e.getState()).state.type?0n:(await e.get("get_wallet_data",[])).stack.readBigNumber()}}s2e.JettonWallet=a2e;var c2e={};Object.defineProperty(c2e,"__esModule",{value:!0}),c2e.MultisigOrder=void 0;const u2e=uKe(),l2e=aHe;class d2e{constructor(e){this.signatures={},this.payload=e}static fromCell(e){var t;let r=e.beginParse(),n=null===(t=r.loadMaybeRef())||void 0===t?void 0:t.beginParse();const i=r.asCell();let o=new d2e(i);if(n){for(;n.remainingBits>0;){const e=n.loadBuffer(64),t=n.loadUint(8);o.signatures[t]=e,n.remainingRefs>0?n=n.loadRef().asSlice():n.skip(1)}n.endParse()}return o}static fromPayload(e){return new d2e(e)}addSignature(e,t,r){const n=this.payload.hash();if(!(0,u2e.signVerify)(n,t,r.owners.get(e).slice(0,-1)))throw Error("invalid signature");this.signatures[e]=t}sign(e,t){const r=this.payload.hash();return this.signatures[e]=(0,u2e.sign)(r,t),r}unionSignatures(e){this.signatures=Object.assign({},this.signatures,e.signatures)}clearSignatures(){this.signatures={}}toCell(e){let t=(0,l2e.beginCell)().storeBit(0);for(const e in this.signatures){const r=this.signatures[e];t=(0,l2e.beginCell)().storeBit(1).storeRef((0,l2e.beginCell)().storeBuffer(r).storeUint(parseInt(e),8).storeBuilder(t).endCell())}return(0,l2e.beginCell)().storeUint(e,8).storeBuilder(t).storeBuilder(this.payload.asBuilder()).endCell()}}c2e.MultisigOrder=d2e;var f2e={};Object.defineProperty(f2e,"__esModule",{value:!0}),f2e.MultisigOrderBuilder=void 0;const h2e=aHe,p2e=c2e;f2e.MultisigOrderBuilder=class{constructor(e,t){this.messages=(0,h2e.beginCell)(),this.queryId=0n,this.walletId=e,this.queryOffset=t||7200}addMessage(e,t){if(this.messages.refs>=4)throw Error("only 4 refs are allowed");this.updateQueryId(),this.messages.storeUint(t,8),this.messages.storeRef((0,h2e.beginCell)().store((0,h2e.storeMessageRelaxed)(e)).endCell())}clearMessages(){this.messages=(0,h2e.beginCell)()}build(){return p2e.MultisigOrder.fromPayload((0,h2e.beginCell)().storeUint(this.walletId,32).storeUint(this.queryId,64).storeBuilder(this.messages).endCell())}updateQueryId(){const e=BigInt(Math.floor(Date.now()/1e3+this.queryOffset));this.queryId=e<<32n}};var g2e={};Object.defineProperty(g2e,"__esModule",{value:!0}),g2e.MultisigWallet=void 0;const y2e=uKe(),m2e=aHe,b2e=m2e.Cell.fromBase64("te6ccgECKwEABBgAART/APSkE/S88sgLAQIBIAIDAgFIBAUE2vIgxwCOgzDbPOCDCNcYIPkBAdMH2zwiwAAToVNxePQOb6Hyn9s8VBq6+RDyoAb0BCD5AQHTH1EYuvKq0z9wUwHwCgHCCAGDCryx8mhTFYBA9A5voSCYDqQgwgryZw7f+COqH1NAufJhVCOjU04gIyEiAgLMBgcCASAMDQIBIAgJAgFmCgsAA9GEAiPymAvHoHN9CYbZ5S7Z4BPHohwhJQAtAKkItdJEqCTItdKlwLUAdAT8ArobBKAATwhbpEx4CBukTDgAdAg10rDAJrUAvALyFjPFszJ4HHXI8gBzxb0AMmACASAODwIBIBQVARW77ZbVA0cFUg2zyCoCAUgQEQIBIBITAXOxHXQgwjXGCD5AQHTB4IB1MTtQ9hTIHj0Dm+h8p/XC/9eMfkQ8qCuAfQEIW6TW3Ey4PkBWNs8AaQBgJwA9rtqA6ADoAPoCAXoCEfyAgPyA3XlP+AXkegAA54tkwAAXrhlXP8EA1WZ2oexAAgEgFhcCASAYGQFRtyVbZ4YmRmpGEAgegc30McJNhFpAADMaYeYuAFrgJhwLb+4cC3d0bhAjAYm1WZtnhqvgb+2xxsoicAgej430pBHEoFpAADHDhBACGuQkuuBk9kUWE5kAOeLKhACQCB6IYFImHFImHFImXEA2YlzNijAjAgEgGhsAF7UGtc4QQDVZnah7EAIBIBwdAgOZOB4fARGsGm2eL4G2CUAjABWt+UEAzJV2oewYQAENqTbPBVfBYCMAFa3f3CCAarM7UPYgAiDbPALyZfgAUENxQxPbPO1UIyoACtP/0wcwBKDbPC+uUyCw8mISsQKkJbNTHLmwJYEA4aojoCi8sPJpggGGoPgBBZcCERACPj4wjo0REB/bPEDXePRDEL0F4lQWW1Rz51YQU9zbPFRxClR6vCQlKCYAIO1E0NMf0wfTB9M/9AT0BNEAXgGOGjDSAAHyo9MH0wdQA9cBIPkBBfkBFbrypFAD4GwhIddKqgIi10m68qtwVCATAAwByMv/ywcE1ts87VT4D3AlblOJvrGYEG4QLVDHXwePGzBUJANQTds8UFWgRlAQSRA6SwlTuds8UFQWf+L4AAeDJaGOLCaAQPSWb6UglDBTA7neII4WODk5CNIAAZfTBzAW8AcFkTDifwgHBZJsMeKz5jAGKicoKQBgcI4pA9CDCNcY0wf0BDBTFnj0Dm+h8qXXC/9URUT5EPKmrlIgsVIDvRShI27mbCIyAH5SML6OIF8D+ACTItdKmALTB9QC+wAC6DJwyMoAQBSAQPRDAvAHjhdxyMsAFMsHEssHWM8BWM8WQBOAQPRDAeIBII6KEEUQNEMA2zztVJJfBuIqABzIyx/LB8sHyz/0APQAyQ==");class v2e{constructor(e,t,r,n,i){this.provider=null,this.owners=m2e.Dictionary.empty(),this.workchain=t,this.walletId=r,this.k=n;for(let t=0;t({address:new _2e.Address(-1,e.loadBuffer(32)),weight:e.loadUintBig(64),stake:e.loadCoins()})},S2e={serialize(e,t){throw Error("not implemented")},parse(e){const t=e.loadCoins();return e.skip(64),{stake:t,address:new _2e.Address(-1,e.loadBuffer(32)),adnl:e.loadBuffer(32)}}};class k2e{static create(){return new k2e}constructor(){this.address=_2e.Address.parseRaw("-1:3333333333333333333333333333333333333333333333333333333333333333")}async getReturnedStake(e,t){if(-1!==t.workChain)throw Error("Only masterchain addresses could have stake");return(await e.get("compute_returned_stake",[{type:"int",value:BigInt("0x"+t.hash.toString("hex"))}])).stack.readBigNumber()}async getPastElectionsList(e){const t=await e.get("past_elections_list",[]),r=new _2e.TupleReader(t.stack.readLispList()),n=[];for(;r.remaining>0;){const e=r.readTuple(),t=e.readNumber(),i=e.readNumber();e.pop();const o=e.readNumber();n.push({id:t,unfreezeAt:i,stakeHeld:o})}return n}async getPastElections(e){const t=await e.get("past_elections",[]),r=new _2e.TupleReader(t.stack.readLispList()),n=[];for(;r.remaining>0;){const e=r.readTuple(),t=e.readNumber(),i=e.readNumber(),o=e.readNumber();e.pop();const s=e.readCell(),a=e.readBigNumber(),c=e.readBigNumber();let u=new Map;const l=s.beginParse().loadDictDirect(_2e.Dictionary.Keys.Buffer(32),E2e);for(const[e,t]of l)u.set(BigInt("0x"+e.toString("hex")).toString(10),{address:t.address,weight:t.weight,stake:t.stake});n.push({id:t,unfreezeAt:i,stakeHeld:o,totalStake:a,bonuses:c,frozen:u})}return n}async getElectionEntities(e){const t=await e.getState();if("active"!==t.state.type)throw Error("Unexpected error");const r=_2e.Cell.fromBoc(t.state.data)[0].beginParse();if(!r.loadBit())return null;const n=r.loadRef().beginParse(),i=n.loadUint(32),o=n.loadUint(32),s=n.loadCoins(),a=n.loadCoins(),c=n.loadDict(_2e.Dictionary.Keys.Buffer(32),S2e);let u=[];if(c)for(const[e,t]of c)u.push({pubkey:e,stake:t.stake,address:t.address,adnl:t.adnl});return{minStake:s,allStakes:a,endElectionsTime:o,startWorkTime:i,entities:u}}async getActiveElectionId(e){const t=(await e.get("active_election_id",[])).stack.readNumber();return t>0?t:null}async getComplaints(e,t){const r=new _2e.TupleBuilder;r.writeNumber(t);const n=await e.get("list_complaints",r.build());if("null"===n.stack.peek().type)return[];const i=new _2e.TupleReader(n.stack.readLispList()),o=[];for(;i.remaining>0;){const e=i.readTuple(),t=e.readBigNumber(),r=e.readTuple(),n=r.readTuple(),s=age.from(n.readBigNumber().toString(16),"hex");n.readCell();const a=n.readNumber(),c=n.readNumber(),u=new _2e.Address(-1,age.from(n.readBigNumber().toString(16),"hex")),l=n.readBigNumber(),d=n.readBigNumber(),f=n.readBigNumber(),h=[],p=new _2e.TupleReader(r.readLispList());for(;p.remaining>0;)h.push(p.readNumber());const g=r.readBigNumber(),y=r.readBigNumber();o.push({id:t,publicKey:s,createdAt:a,severity:c,paid:l,suggestedFine:d,suggestedFinePart:f,rewardAddress:u,votes:h,remainingWeight:y,vsetId:g})}return o}}w2e.ElectorContract=k2e;var A2e={};Object.defineProperty(A2e,"__esModule",{value:!0}),A2e.configParseMasterAddress=I2e,A2e.parseValidatorSet=C2e,A2e.parseBridge=O2e,A2e.configParseMasterAddressRequired=R2e,A2e.configParse5=P2e,A2e.configParse13=function(e){if(!e)throw Error("Invalid config");const t=e.loadUint(8);if(26===t)return{deposit:e.loadCoins(),bitPrice:e.loadCoins(),cellPrice:e.loadCoins()};throw new Error("Invalid config")},A2e.configParse15=M2e,A2e.configParse16=U2e,A2e.configParse17=L2e,A2e.configParse18=N2e,A2e.configParse8=z2e,A2e.configParse40=D2e,A2e.configParseWorkchainDescriptor=function(e){if(166!==e.loadUint(8))throw Error("Invalid config");const t=e.loadUint(32),r=e.loadUint(8),n=e.loadUint(8),i=e.loadUint(8),o=e.loadBit(),s=e.loadBit(),a=e.loadBit(),c=e.loadUint(13),u=e.loadBuffer(32),l=e.loadBuffer(32),d=e.loadUint(32);if(e.loadBit())throw Error("Invalid config");const f=e.loadUint(32),h=e.loadUintBig(64);return{enabledSince:t,actialMinSplit:r,min_split:n,max_split:i,basic:o,active:s,accept_msgs:a,flags:c,zerostateRootHash:u,zerostateFileHash:l,version:d,format:{vmVersion:f,vmMode:h}}},A2e.configParse12=q2e,A2e.configParseValidatorSet=H2e,A2e.configParseBridge=V2e,A2e.configParseGasLimitsPrices=$2e,A2e.configParseMsgPrices=K2e,A2e.configParse28=Z2e,A2e.configParse29=W2e,A2e.parseProposalSetup=G2e,A2e.parseVotingSetup=Y2e,A2e.loadConfigParamById=function(e,t){return J2e(e).get(t)},A2e.loadConfigParamsAsSlice=function(e){const t=J2e(e),r=new Map;for(const[e,n]of t)r.set(e,n.beginParse());return r},A2e.parseFullConfig=function(e){return{configAddress:R2e(e.get(0)),electorAddress:R2e(e.get(1)),minterAddress:I2e(e.get(2)),feeCollectorAddress:I2e(e.get(3)),dnsRootAddress:I2e(e.get(4)),burningConfig:P2e(e.get(5)),globalVersion:z2e(e.get(8)),workchains:q2e(e.get(12)),voting:Y2e(e.get(11)),validators:{...M2e(e.get(15)),...U2e(e.get(16)),...L2e(e.get(17))},storagePrices:N2e(e.get(18)),gasPrices:{masterchain:$2e(e.get(20)),workchain:$2e(e.get(21))},msgPrices:{masterchain:K2e(e.get(24)),workchain:K2e(e.get(25))},validatorSets:{prevValidators:H2e(e.get(32)),prevTempValidators:H2e(e.get(33)),currentValidators:H2e(e.get(34)),currentTempValidators:H2e(e.get(35)),nextValidators:H2e(e.get(36)),nextTempValidators:H2e(e.get(37))},validatorsPunish:D2e(e.get(40)),bridges:{ethereum:V2e(e.get(71)),binance:V2e(e.get(72)),polygon:V2e(e.get(73))},catchain:Z2e(e.get(28)),consensus:W2e(e.get(29))}};const x2e=aHe;function I2e(e){return e?new x2e.Address(-1,e.loadBuffer(32)):null}function B2e(e){if(2390828938!==e.loadUint(32))throw Error("Invalid config");return e.loadBuffer(32)}const T2e={serialize(e,t){throw Error("not implemented")},parse(e){const t=e.loadUint(8);if(83===t)return{publicKey:B2e(e),weight:e.loadUintBig(64),adnlAddress:null};if(115===t)return{publicKey:B2e(e),weight:e.loadUintBig(64),adnlAddress:e.loadBuffer(32)};throw Error("Invalid config")}};function C2e(e){const t=e.loadUint(8);return 17===t?{timeSince:e.loadUint(32),timeUntil:e.loadUint(32),total:e.loadUint(16),main:e.loadUint(16),totalWeight:null,list:e.loadDictDirect(x2e.Dictionary.Keys.Uint(16),T2e)}:18===t?{timeSince:e.loadUint(32),timeUntil:e.loadUint(32),total:e.loadUint(16),main:e.loadUint(16),totalWeight:e.loadUintBig(64),list:e.loadDict(x2e.Dictionary.Keys.Uint(16),T2e)}:void 0}function O2e(e){const t=new x2e.Address(-1,e.loadBuffer(32)),r=new x2e.Address(-1,e.loadBuffer(32)),n=e.loadDict(x2e.Dictionary.Keys.Buffer(32),x2e.Dictionary.Values.Buffer(32)),i=new Map;for(const[e,t]of n)i.set(new x2e.Address(-1,e).toString(),t);return{bridgeAddress:t,oracleMultisigAddress:r,oracles:i,externalChainAddress:e.loadBuffer(32)}}function R2e(e){if(!e)throw Error("Invalid config");return I2e(e)}function P2e(e){if(!e)throw Error("Invalid config");if(1===e.loadUint(8))return{blackholeAddr:e.loadBit()?new x2e.Address(-1,e.loadBuffer(32)):null,feeBurnNominator:e.loadUint(32),feeBurnDenominator:e.loadUint(32)};throw new Error("Invalid config")}function M2e(e){if(!e)throw Error("Invalid config");return{validatorsElectedFor:e.loadUint(32),electorsStartBefore:e.loadUint(32),electorsEndBefore:e.loadUint(32),stakeHeldFor:e.loadUint(32)}}function U2e(e){if(!e)throw Error("Invalid config");return{maxValidators:e.loadUint(16),maxMainValidators:e.loadUint(16),minValidators:e.loadUint(16)}}function L2e(e){if(!e)throw Error("Invalid config");return{minStake:e.loadCoins(),maxStake:e.loadCoins(),minTotalStake:e.loadCoins(),maxStakeFactor:e.loadUint(32)}}const j2e={serialize(e,t){throw Error("not implemented")},parse(e){if(204!==e.loadUint(8))throw Error("Invalid config");return{utime_since:e.loadUint(32),bit_price_ps:e.loadUintBig(64),cell_price_ps:e.loadUintBig(64),mc_bit_price_ps:e.loadUintBig(64),mc_cell_price_ps:e.loadUintBig(64)}}};function N2e(e){if(!e)throw Error("Invalid config");return e.loadDictDirect(x2e.Dictionary.Keys.Buffer(4),j2e).values()}function z2e(e){return e?{version:e.loadUint(32),capabilities:e.loadUintBig(64)}:{version:0,capabilities:0n}}function D2e(e){if(!e)return null;if(1!==e.loadUint(8))throw Error("Invalid config");return{defaultFlatFine:e.loadCoins(),defaultProportionaFine:e.loadCoins(),severityFlatMult:e.loadUint(16),severityProportionalMult:e.loadUint(16),unfunishableInterval:e.loadUint(16),longInterval:e.loadUint(16),longFlatMult:e.loadUint(16),longProportionalMult:e.loadUint(16),mediumInterval:e.loadUint(16),mediumFlatMult:e.loadUint(16),mediumProportionalMult:e.loadUint(16)}}const F2e={serialize(e,t){throw Error("not implemented")},parse(e){if(166!==e.loadUint(8))throw Error("Invalid config");const t=e.loadUint(32),r=e.loadUint(8),n=e.loadUint(8),i=e.loadUint(8),o=e.loadBit(),s=e.loadBit(),a=e.loadBit(),c=e.loadUint(13),u=e.loadBuffer(32),l=e.loadBuffer(32),d=e.loadUint(32);if(e.loadBit())throw Error("Invalid config");return{enabledSince:t,actialMinSplit:r,min_split:n,max_split:i,basic:o,active:s,accept_msgs:a,flags:c,zerostateRootHash:u,zerostateFileHash:l,version:d,format:{vmVersion:e.loadUint(32),vmMode:e.loadUintBig(64)}}}};function q2e(e){if(!e)throw Error("Invalid config");const t=e.loadDict(x2e.Dictionary.Keys.Uint(32),F2e);if(t)return t;throw Error("No workchains exist")}function H2e(e){return e?C2e(e):null}function V2e(e){return e?O2e(e):null}function $2e(e){if(!e)throw Error("Invalid config");if(209===e.loadUint(8)){const t=e.loadUintBig(64),r=e.loadUintBig(64),n=function(e){const t=e.loadUint(8);if(222===t)return{gasPrice:e.loadUintBig(64),gasLimit:e.loadUintBig(64),specialGasLimit:e.loadUintBig(64),gasCredit:e.loadUintBig(64),blockGasLimit:e.loadUintBig(64),freezeDueLimit:e.loadUintBig(64),deleteDueLimit:e.loadUintBig(64)};if(221===t)return{gasPrice:e.loadUintBig(64),gasLimit:e.loadUintBig(64),gasCredit:e.loadUintBig(64),blockGasLimit:e.loadUintBig(64),freezeDueLimit:e.loadUintBig(64),deleteDueLimit:e.loadUintBig(64)};throw Error("Invalid config")}(e);return{flatLimit:t,flatGasPrice:r,other:n}}throw Error("Invalid config")}function K2e(e){if(!e)throw new Error("Invalid config");if(234!==e.loadUint(8))throw new Error("Invalid msg prices param");return{lumpPrice:e.loadUintBig(64),bitPrice:e.loadUintBig(64),cellPrice:e.loadUintBig(64),ihrPriceFactor:e.loadUint(32),firstFrac:e.loadUint(16),nextFrac:e.loadUint(16)}}function Z2e(e){if(!e)throw new Error("Invalid config");const t=e.loadUint(8);if(193===t)return{masterCatchainLifetime:e.loadUint(32),shardCatchainLifetime:e.loadUint(32),shardValidatorsLifetime:e.loadUint(32),shardValidatorsCount:e.loadUint(32)};if(194===t)return{flags:e.loadUint(7),suffleMasterValidators:e.loadBit(),masterCatchainLifetime:e.loadUint(32),shardCatchainLifetime:e.loadUint(32),shardValidatorsLifetime:e.loadUint(32),shardValidatorsCount:e.loadUint(32)};throw new Error("Invalid config")}function W2e(e){if(!e)throw new Error("Invalid config");const t=e.loadUint(8);if(214===t)return{roundCandidates:e.loadUint(32),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32)};if(215===t)return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32)};if(216===t)return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32),protoVersion:e.loadUint(16)};if(217===t)return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32),protoVersion:e.loadUint(16),catchainMaxBlocksCoeff:e.loadUint(32)};throw new Error("Invalid config")}function G2e(e){if(54!==e.loadUint(8))throw new Error("Invalid config");return{minTotalRounds:e.loadUint(8),maxTotalRounds:e.loadUint(8),minWins:e.loadUint(8),maxLoses:e.loadUint(8),minStoreSec:e.loadUint(32),maxStoreSec:e.loadUint(32),bitPrice:e.loadUint(32),cellPrice:e.loadUint(32)}}function Y2e(e){if(!e)throw new Error("Invalid config");if(145!==e.loadUint(8))throw new Error("Invalid config");return{normalParams:G2e(e.loadRef().beginParse()),criticalParams:G2e(e.loadRef().beginParse())}}function J2e(e){return x2e.Cell.fromBase64(e).beginParse().loadDictDirect(x2e.Dictionary.Keys.Int(32),x2e.Dictionary.Values.Cell())}var X2e={};Object.defineProperty(X2e,"__esModule",{value:!0}),X2e.computeStorageFees=function(e){const{lastPaid:t,now:r,storagePrices:n,storageStat:i,special:o,masterchain:s}=e;if(r<=t||0===n.length||r>16n)},X2e.computeExternalMessageFees=function(e,t){let r=t5e(t);return r.bits-=t.bits.length,r.cells-=1,e5e(e,BigInt(r.cells),BigInt(r.bits))},X2e.computeMessageForwardFees=function(e,t){let r=(0,Q2e.loadMessageRelaxed)(t.beginParse()),n={bits:0,cells:0};if(r.init){const e=(new Q2e.Cell).asBuilder();(0,Q2e.storeStateInit)(r.init)(e);const t=e.endCell();let i=t5e(t);i.bits-=t.bits.length,i.cells-=1,n.bits+=i.bits,n.cells+=i.cells}let i=t5e(r.body);i.bits-=r.body.bits.length,i.cells-=1,n.bits+=i.bits,n.cells+=i.cells;let o=e5e(e,BigInt(n.cells),BigInt(n.bits)),s=o*BigInt(e.firstFrac)>>16n,a=o-s;return{fees:s,remaining:a}};const Q2e=aHe;function e5e(e,t,r){return e.lumpPrice+r5e(e.bitPrice*r+e.cellPrice*t)}function t5e(e){let t=e.bits.length,r=1;for(let n of e.refs){let e=t5e(n);r+=e.cells,t+=e.bits}return{bits:t,cells:r}}function r5e(e){let t=e>>16n;return 0n!==e%65536n&&(t+=1n),t}!function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.computeStorageFees=t.computeMessageForwardFees=t.computeGasPrices=t.computeFwdFees=t.computeExternalMessageFees=t.loadConfigParamsAsSlice=t.loadConfigParamById=t.parseFullConfig=t.parseVotingSetup=t.parseValidatorSet=t.parseProposalSetup=t.parseBridge=t.configParseWorkchainDescriptor=t.configParseValidatorSet=t.configParseMsgPrices=t.configParseMasterAddressRequired=t.configParseMasterAddress=t.configParseGasLimitsPrices=t.configParseBridge=t.configParse40=t.configParse29=t.configParse28=t.configParse18=t.configParse17=t.configParse16=t.configParse15=t.configParse13=t.configParse12=t.configParse8=t.configParse5=t.ElectorContract=t.MultisigWallet=t.MultisigOrderBuilder=t.MultisigOrder=t.JettonWallet=t.JettonMaster=t.WalletContractV5R1=t.WalletContractV5Beta=t.WalletContractV4=t.WalletContractV3R2=t.WalletContractV3R1=t.WalletContractV2R2=t.WalletContractV2R1=t.WalletContractV1R3=t.WalletContractV1R2=t.WalletContractV1R1=t.TonClient4=t.TonClient=t.HttpApi=void 0,n(aHe,t);var i=MWe;Object.defineProperty(t,"HttpApi",{enumerable:!0,get:function(){return i.HttpApi}});var o=GQe;Object.defineProperty(t,"TonClient",{enumerable:!0,get:function(){return o.TonClient}});var s=r0e;Object.defineProperty(t,"TonClient4",{enumerable:!0,get:function(){return s.TonClient4}});var a=z0e;Object.defineProperty(t,"WalletContractV1R1",{enumerable:!0,get:function(){return a.WalletContractV1R1}});var c=I1e;Object.defineProperty(t,"WalletContractV1R2",{enumerable:!0,get:function(){return c.WalletContractV1R2}});var u=O1e;Object.defineProperty(t,"WalletContractV1R3",{enumerable:!0,get:function(){return u.WalletContractV1R3}});var l=U1e;Object.defineProperty(t,"WalletContractV2R1",{enumerable:!0,get:function(){return l.WalletContractV2R1}});var d=z1e;Object.defineProperty(t,"WalletContractV2R2",{enumerable:!0,get:function(){return d.WalletContractV2R2}});var f=H1e;Object.defineProperty(t,"WalletContractV3R1",{enumerable:!0,get:function(){return f.WalletContractV3R1}});var h=Z1e;Object.defineProperty(t,"WalletContractV3R2",{enumerable:!0,get:function(){return h.WalletContractV3R2}});var p=J1e;Object.defineProperty(t,"WalletContractV4",{enumerable:!0,get:function(){return p.WalletContractV4}});var g=t2e;Object.defineProperty(t,"WalletContractV5Beta",{enumerable:!0,get:function(){return g.WalletContractV5Beta}});var y=r2e;Object.defineProperty(t,"WalletContractV5R1",{enumerable:!0,get:function(){return y.WalletContractV5R1}});var m=n2e;Object.defineProperty(t,"JettonMaster",{enumerable:!0,get:function(){return m.JettonMaster}});var b=s2e;Object.defineProperty(t,"JettonWallet",{enumerable:!0,get:function(){return b.JettonWallet}});var v=c2e;Object.defineProperty(t,"MultisigOrder",{enumerable:!0,get:function(){return v.MultisigOrder}});var w=f2e;Object.defineProperty(t,"MultisigOrderBuilder",{enumerable:!0,get:function(){return w.MultisigOrderBuilder}});var _=g2e;Object.defineProperty(t,"MultisigWallet",{enumerable:!0,get:function(){return _.MultisigWallet}});var E=w2e;Object.defineProperty(t,"ElectorContract",{enumerable:!0,get:function(){return E.ElectorContract}});var S=A2e;Object.defineProperty(t,"configParse5",{enumerable:!0,get:function(){return S.configParse5}}),Object.defineProperty(t,"configParse8",{enumerable:!0,get:function(){return S.configParse8}}),Object.defineProperty(t,"configParse12",{enumerable:!0,get:function(){return S.configParse12}}),Object.defineProperty(t,"configParse13",{enumerable:!0,get:function(){return S.configParse13}}),Object.defineProperty(t,"configParse15",{enumerable:!0,get:function(){return S.configParse15}}),Object.defineProperty(t,"configParse16",{enumerable:!0,get:function(){return S.configParse16}}),Object.defineProperty(t,"configParse17",{enumerable:!0,get:function(){return S.configParse17}}),Object.defineProperty(t,"configParse18",{enumerable:!0,get:function(){return S.configParse18}}),Object.defineProperty(t,"configParse28",{enumerable:!0,get:function(){return S.configParse28}}),Object.defineProperty(t,"configParse29",{enumerable:!0,get:function(){return S.configParse29}}),Object.defineProperty(t,"configParse40",{enumerable:!0,get:function(){return S.configParse40}}),Object.defineProperty(t,"configParseBridge",{enumerable:!0,get:function(){return S.configParseBridge}}),Object.defineProperty(t,"configParseGasLimitsPrices",{enumerable:!0,get:function(){return S.configParseGasLimitsPrices}}),Object.defineProperty(t,"configParseMasterAddress",{enumerable:!0,get:function(){return S.configParseMasterAddress}}),Object.defineProperty(t,"configParseMasterAddressRequired",{enumerable:!0,get:function(){return S.configParseMasterAddressRequired}}),Object.defineProperty(t,"configParseMsgPrices",{enumerable:!0,get:function(){return S.configParseMsgPrices}}),Object.defineProperty(t,"configParseValidatorSet",{enumerable:!0,get:function(){return S.configParseValidatorSet}}),Object.defineProperty(t,"configParseWorkchainDescriptor",{enumerable:!0,get:function(){return S.configParseWorkchainDescriptor}}),Object.defineProperty(t,"parseBridge",{enumerable:!0,get:function(){return S.parseBridge}}),Object.defineProperty(t,"parseProposalSetup",{enumerable:!0,get:function(){return S.parseProposalSetup}}),Object.defineProperty(t,"parseValidatorSet",{enumerable:!0,get:function(){return S.parseValidatorSet}}),Object.defineProperty(t,"parseVotingSetup",{enumerable:!0,get:function(){return S.parseVotingSetup}}),Object.defineProperty(t,"parseFullConfig",{enumerable:!0,get:function(){return S.parseFullConfig}}),Object.defineProperty(t,"loadConfigParamById",{enumerable:!0,get:function(){return S.loadConfigParamById}}),Object.defineProperty(t,"loadConfigParamsAsSlice",{enumerable:!0,get:function(){return S.loadConfigParamsAsSlice}});var k=X2e;Object.defineProperty(t,"computeExternalMessageFees",{enumerable:!0,get:function(){return k.computeExternalMessageFees}}),Object.defineProperty(t,"computeFwdFees",{enumerable:!0,get:function(){return k.computeFwdFees}}),Object.defineProperty(t,"computeGasPrices",{enumerable:!0,get:function(){return k.computeGasPrices}}),Object.defineProperty(t,"computeMessageForwardFees",{enumerable:!0,get:function(){return k.computeMessageForwardFees}}),Object.defineProperty(t,"computeStorageFees",{enumerable:!0,get:function(){return k.computeStorageFees}})}(sHe);class n5e extends Error{constructor(e,t){super(e),this.code=t}}var i5e=Object.defineProperty,o5e=Object.defineProperties,s5e=Object.getOwnPropertyDescriptors,a5e=Object.getOwnPropertySymbols,c5e=Object.prototype.hasOwnProperty,u5e=Object.prototype.propertyIsEnumerable,l5e=(e,t,r)=>t in e?i5e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d5e=(e,t)=>{for(var r in t||(t={}))c5e.call(t,r)&&l5e(e,r,t[r]);if(a5e)for(var r of a5e(t))u5e.call(t,r)&&l5e(e,r,t[r]);return e},f5e=(e,t)=>o5e(e,s5e(t)),h5e=(e,t)=>{var r={};for(var n in e)c5e.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&a5e)for(var n of a5e(e))t.indexOf(n)<0&&u5e.call(e,n)&&(r[n]=e[n]);return r};class p5e{constructor(e){this.rawAddress=null,this.provider=e}static mapToCamelCase(e){return d5e(d5e({},e),null!=e&&e.messages?{messages:((null==e?void 0:e.messages)||[]).map((e=>d5e(d5e({},e),"state_init"in e||"stateInit"in e?{stateInit:e.state_init||e.stateInit}:{})))}:{})}async request(e,t){switch(e){case"tonConnect_connect":{const e=await this.provider.internalRequest("requestAccounts",t);return JSON.parse(e).map((e=>{if("ton_addr"===e.name){const t=e,{nonBounceable:r,type:n}=t,i=h5e(t,["nonBounceable","type"]);return n&&console.warn("type parameter removed from request"),this.rawAddress=i.address,i}if("ton_proof"===e.name){const t=h5e(e,["type"]);return f5e(d5e({},t),{proof:f5e(d5e({},t.proof),{timestamp:parseInt(t.proof.timestamp)})})}return e}))}case"tonConnect_reconnect":{const e=await this.provider.internalRequest("tonConnect_reconnect",t),r=JSON.parse(e)[0],n=h5e(r,["nonBounceable","type"]);return this.rawAddress=n.address,[n]}case"ton_rawSign":return this.provider.internalRequest("signMessage",t);case"ton_sendTransaction":case"tonConnect_sendTransaction":{const r=t[0];this.validateNetwork(r),this.validateMessagesAddresses(r),this.validateFromAddress(r),this.validateTransaction(p5e.mapToCamelCase(r));const n=await this.provider.internalRequest("signTransaction",p5e.mapToCamelCase(r)),{nonce:i,hash:o}=JSON.parse(n);return"ton_sendTransaction"===e?i:o}case"ton_requestAccounts":{const e=await this.provider.internalRequest("requestAccounts",t),[{nonBounceable:r}]=JSON.parse(e);return[r]}case"ton_requestWallets":{const e=await this.provider.internalRequest("requestAccounts",t),[{nonBounceable:r,publicKey:n}]=JSON.parse(e);return[{address:r,publicKey:n,version:this.provider.version}]}default:return this.provider.internalRequest(e,t)}}validateTransaction(e){if(e.messages.some((e=>"stateInit"in e&&0===e.stateInit.length)))throw console.error("Empty state init in message"),new n5e("Bad request",1);if(e.messages.some((e=>"string"!=typeof e.amount)))throw console.error("Invalid amount type"),new n5e("Bad request",1);if("number"!=typeof e.valid_until)throw console.error("Invalid valid_until type"),new n5e("Bad request",1)}validateFromAddress(e){if(!this.rawAddress)throw console.error("Trying to execute transaction with invalid address"),new n5e("Bad request",1);const t=sHe.Address.parseRaw(this.rawAddress);if(![t.toRawString(),t.toString({bounceable:!0}),t.toString({bounceable:!1})].includes(e.from))throw console.error("from field does not match any user address"),new n5e("Bad request",1)}validateMessagesAddresses(e){if(e.messages.some((e=>e.address.includes(":"))))throw console.error("Bad request, message address is invalid"),new n5e("Bad request",1)}validateNetwork(e){if("-239"!==e.network)throw console.error("Bad request, network id is invalid"),new n5e("Bad request",1)}}const g5e=class extends gye{constructor(e){super(),this.version="v4R2",e&&e.version&&(this.version=e.version),null!=e&&e.disableMobileAdapter||(this.mobileAdapter=new p5e(this))}disconnect(){return this.send("tonConnect_disconnect",{})}isConnected(){return Promise.resolve(!0)}async send(e,t){return this.mobileAdapter?await this.mobileAdapter.request(e,t):await(()=>this.internalRequest(e,t))()}internalRequest(e,t){return super.request({method:e,params:t})}getNetwork(){return g5e.NETWORK}};let y5e=g5e;y5e.NETWORK="ton";var m5e=Object.defineProperty,b5e=Object.defineProperties,v5e=Object.getOwnPropertyDescriptors,w5e=Object.getOwnPropertySymbols,_5e=Object.prototype.hasOwnProperty,E5e=Object.prototype.propertyIsEnumerable,S5e=(e,t,r)=>t in e?m5e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k5e=(e,t)=>{for(var r in t||(t={}))_5e.call(t,r)&&S5e(e,r,t[r]);if(w5e)for(var r of w5e(t))E5e.call(t,r)&&S5e(e,r,t[r]);return e},A5e=(e,t)=>b5e(e,v5e(t));const x5e=e=>{var t;return{event:"connect_error",payload:{code:null!=(t=e.code)?t:0,message:e.message}}};class I5e{constructor(e,t){this.protocolVersion=2,this.isWalletBrowser=!0,this.callbacks=[],this.connectionAttempts=0,this.listen=e=>(this.callbacks.push(e),()=>{this.callbacks=this.callbacks.filter((t=>t!=e))}),e&&(typeof e.isWalletBrowser<"u"&&(this.isWalletBrowser=e.isWalletBrowser),e.walletInfo&&(this.walletInfo=e.walletInfo),e.deviceInfo&&(this.deviceInfo=e.deviceInfo)),this.provider=t}async connect(e,t){try{e>this.protocolVersion&&new n5e("Unsupported protocol version",1);const r=await this.provider.send("tonConnect_connect",t);return this.connectionAttempts+=1,"connect_error"===(null==r?void 0:r.event)?this.emit(A5e(k5e({},r),{id:this.connectionAttempts.toString()})):this.emit({id:this.connectionAttempts.toString(),event:"connect",payload:{items:r,device:this.deviceInfo}})}catch(e){return this.parseError(e,{id:this.connectionAttempts.toString()})}}async disconnect(){return await this.provider.send("tonConnect_disconnect",{}),this.emit({event:"disconnect",payload:{}})}emit(e){return this.callbacks.forEach((t=>t(e))),e}async restoreConnection(){var e;try{const e=await this.provider.send("tonConnect_reconnect",[{name:"ton_addr"}]);return this.connectionAttempts+=1,"connect_error"===(null==e?void 0:e.event)?this.emit(A5e(k5e({},e),{id:this.connectionAttempts.toString()})):this.emit({id:this.connectionAttempts.toString(),event:"connect",payload:{items:e,device:this.deviceInfo}})}catch(t){return t instanceof n5e?this.emit(x5e(t)):this.emit(x5e(new n5e(null!=(e=t.message)?e:"Unknown error")))}}async send(e){try{return{result:await this.provider.send(`tonConnect_${e.method}`,e.params.map((e=>JSON.parse(e)))),id:e.id.toString()}}catch(t){return this.parseError(t,{id:e.id.toString()})}}parseError(e,t){var r,n,i,o;return 4001===(null==e?void 0:e.code)?{error:{message:"User declined the transaction",code:300},id:null!=(r=String(t.id))?r:"0"}:-32002===(null==e?void 0:e.code)?{error:{message:"Bad request, a transaction is already pending",code:1},id:null!=(n=String(t.id))?n:"0"}:e&&![0,1,100,300,400].includes(e.code)?{error:{message:"User declined the transaction",code:300},id:null!=(i=String(t.id))?i:"0"}:{error:x5e(e),id:null!=(o=String(t.id))?o:"0"}}}window.trustwallet={core:(e,t)=>new yye({strategy:e,handler:t}),solana:e=>new uxe(e),cosmos:e=>new zqe(e),ethereum:e=>new Pqe(e),aptos:e=>new oHe(e),ton:e=>new y5e(e),tonBridge:(e,t)=>new I5e(e,t),randomUUID:()=>Hpe()}},"function"==typeof define&&define.amd?define(e):e()})); diff --git a/bun.lockb b/bun.lockb index 8319eac4daa5a815288aae16f9d1e1556f84cce0..24ce16ebecd0ba7362f889a68c1aee4087abc549 100755 GIT binary patch delta 63389 zcmeFacT^PF-u_$N(9)%14qyZ$22@N8{lDNUw+iR>K)p&{g8Pid_<(NW92ISE4&H&n4$$(@_E0h1NnJr}HaR3Tg3^2Y_=NdQ6@;o|1)(~UNL4Ddi}Uvu zgbFaZu7XendXVcgA0@wezDoRW@O2R%>g^j6;U@?q#|uJ5_-#mz zk1ezk)QbBaP&4?!$lnwi5jnwnVz^)~yqchZj{bsB6A@$hh0?|HHH>3|0)3?W<;~&_ zqWIc~T@S4V{TW&V8U>}cOn{=r@x!5%{fmi8df)JHzi>3c6P&7hvOBs3>IzTl5u~K| z4IXbD9uOED8W!U3A1w&_W^P4wD+_`&w&Hws+7#(U#Re9e!;~Hl47CpP^Y@F=cWbD1 zuy-iBS!!3#OtLVwPWb~g9%lSmE5m4&T@qT`x z)`10gJzKTM7bQ{^ipL6_dp`msaYFpB-ISWryz@qjsvv@D_Q5?pftDIBSX5dCzI@}_K0h|UTHuTDD~|3bxQqSK&fHZxIYD@_tTN3Awg69 zgl%a`&##5jP%nX2f(CephfG679&A?%b_Ex~J3wg-9@wE&uqEg9pmd#F;n4`_YpkDp z=TI=UMBk!8=ugV<062B++TBVIyns^6mvJv|aaasldz3}DXOA?ZdINRhZYidEvpAc5 zO1ry8giLOWvl;h^`<2`$hKC1u%rNkUaN2L0LFHw{eSaub+$~SJ&IX_g%qh)a~Ib)AGBH z0CkLSn6Gt*_JUA^3#fq0XO))Sg{Sy$sI?_D@SIYB@SBqEBRuugGbmkm9ZChL3iwF* z`36wF`QTKM9PrxEw&&sF5bz5M3Ji@1^t}c^Q|J_wT9O5&uEqKepic7%3kma{JYLXu z;V53PUiLS2Q&mz3*$LZ*e&lv@u^w-n74r2(U%akLXh;3kb{E+I5oiN-BSj_H!LJP9E*4%JmsE*Y^YkX zJiEZ~&K-RMBZRIGmGQts+_dl@LAc6&=SRwQfk;oy&f$Ip&nM%FvVX6F)<^sdXakz^ zqY-Eb-~_dR)`QZ_`tew4_B|-Y=R)g1w?pefmqBTQL_+I9NAh@2XeIb=Q0hM4fRIUn z8P<1Hf`x~@c90GqL0d-l-d!-BK zA_JO9)1Z~0bv`Is9!dpH1gAAt|D#e+rB6zRCGb?ir%_1x z4C4?W4dFT-N?jKeGTEP6;ER@0SBH8}lBZl>cq+(_Yx`oQ0c)VtvWemNh~nKrDCIn{ zL`g5f)7)CXb?{egIaCl*%Nt?pS0#Z3wiikmJie36*Md_zpTN)#cBl|(d#LAkKGsl* zpX@!E>MQ76;2B0nv{Zr{GFQ^&388{7%23j4e z-{^xwe4;4FkEKd_N0mw*5*sL0MBhV=(L=}#A3Zw9XjF1V+m=(wb0z^=74eqb*M!n; zlVqZjE0hSOITROx0JSgxN(uas5fvEW7bfqMJ4KZ|c`B4wTCftHT9gh?Jy*AaO5Wbq zz|%JOD?D8vjxItS1#6_I{5Muqt{=cFI?hz~aq+z?spR$k5K1k-2&LJYgxnky~(6WSd9E|hjkn-(hhVWAw9(p>?kNvLlzKKxG%M{5p&)7HBaN*mNFqd$mh1$R`w^3T$ti96p zKXYyeZHxE{&^FLJmZ~^8u*XsXv!K?97z&lU4oWRjL8(ixqoSmC^^`8(#r zxZZ21G%N#3L$-vgKi94e}J?Bci%=h}g*Dc7Rqx@~g$>UtEq1HSp7xJ1@*I+q5kBAj$AK+PW)!6^sC?~O zxzO~eMp~`e;qo)xTAuU1t~>u?_J@@%U*GQ>cQj+Q*B!~dRbIPP`;-ZzyIqoAzGf>X zeF;*pd1HG-HROd=c)6vqzRC7c$G=U;ntE*gjxM>^r*t*4{za(keU zoSfe4klUK<)7`w*rMTFi{PUMSmMeOTQ@SVRPLsOYyKC={zMrfNP}jDD(-ZC68Cg{B-s4tfr`NW%sz2>xmFS++ zG7os_w#ilp^#ClxQcD7p7+Cl-#uE`~xXP$6R5 zv4YSJPD@TZ7LL|9OBk$f$M$Mfq86kth>={u2XI~C4>TsisLN!+oj2h{DT zs+xmDq|!x>CJ4|LqGbE79P@u1a$0r_&a3r?e#W zyQmFRx=kflD-3Qh5-VN$D_np1Qgo@N)dkRrbP_ORw}952yZ~nKc%_g` zIJze*YxXmblh>VSGsUnK!Q9FDidk^9LNOg&b)qpIoZ7)@B-JomEev(Il5jE{H6Gn7 z$x&2OV|mTLKos@0-1FK-;s4&(LqXchscAn+gzEu^8G%-whofFpW>J+0{ZvH{X#2v^ zbu8fK-~ zQn;RQ7!&LVX;TfFBR=3x8T7`}^t%#Ph&Tw2Mix6Yu6qWjG$p}HC$@-EnrSS@;RCh2 zJkVkOI`KGMU!`=cLDOhu2v8R+kzsJ15LZcFFzeu`3p8@AFTzoal__36M(Jn`?INNx z9K~U=z-{7jDk*1zPP`6B(+t<4yqeSX(>P(EPBR3~Q7UzD&@4l!i&Prspnf!6%G&8H zcATL!54RpyTP+L?8*=QX)8xZ-k(|0YsI{?D)-Gq!Ay&y$-a5o7aQ%^3nN>M()b)Hj zgQJQnUEg7*APj;NRtS%TmJ zh-Lnhtrlhk3?|A?I`J6Xa5&V#L#L@d8|{*uW;lpp2+?#x>ygjl*^+&_v!)c#iTYWz zpQDVMAkT%#aMWb^{;t^%*GY=)?Vx@(M~XS%tX?`-%7V0+Cw)EOEV6mZO;1giYVN_c zld>l`h?NtS-Vo$nt2cKTs-8OayhO?Vkh7QrNb6UST-+is9eS_ZRZsj4dRY?Wz*XOM-^1o*h@I&TC4!I zMTM{v7Iy>Eo`5~d1^rA(q-<9Q(PpWB2f$=eCoGk|W;=^_ z0Y@RRd~4R&FGCV}JQpC;Q7#9|S91)`R&pBXp#Ec-WPjXQbX=}H5n#?>8cc(8kuS?c zXb3LD@C~z7Ns|2uXZ2u7iaFsdE|!o8Q5gP#I`IOWtKx!m>gp?Kj*0Fol$v9iqH&3E z)KulM?i!p9u9EzmV49?i88VC3Y24sEq}US3GV#gHyeuV4A2)Itj zyMnwm9)P3SC-BT+w)yzOWdC`pX%gMM%zAQ)RV0N>~lO5TY4^rHd!C zrEoMu%AVy+e+6j^VkF>;9~9h5UKXE0X%3^WhU!G?HTp)o^wy~h)=2hw&T92qDF))U zR?5nA)^u8rokq&ebI`;f)Kd=SAmky3%5Tue_CrWv$p|Uw?v=$h*{F{VM#xjXHmi&o z{UQkcWHt~XC3ZbRN-j?kQgUv)Nnct7LJG@9NV%f?X8DSIM`Hwf%h|0#NJ;htAthP+ zEu4wd5$Y=U1x>Uga5RyXS@af;dKdEs>#x&R#VPl_M7VBg%yQI z)OI_R1+P4i(1th>q!;3i7A z60nJ?&2~xlSDnSdyObpSVTC*FGw8NI;p|ZevPA{$c4L&`YLQc?;r|+5b5@t^ma?un zi(U5U*Ne+!TP+Md+Tm#qpCix0(LRdXb)c=uUcSxB4^n%*MJ)i$XJvm$gzG3d^>ol2 zMF=+>HwX2ry;4@;G0|h6k}2-3xC2DPDT7VT-vvio2IBA}{g}s9mRGCYer42@j#>ss zEy8^SQ|25TtzBgsDutu=$?Mv*Pr9-oG1!8G^uDXI{APi=D%UTu)xs!sPw1r+f56dZ zF5ikx?GGqft8h6UDo(aiKEQ%1m%EI&)xs#fOT*FfAp2^na#s5vWcHO*&f>a*%DAAW zZaVD;IJ)q!>CpL*eq+R^2leDb%)YX!v()aUyJ(%EJX_!~B37qi-?%965fIcx2XD4W(_ZTT65rnZvxRX7^ka`G5eJF1L> z{DdL8!}0O+)v0G4mF&@?Gl0}NxE$k9D_g0He1Up!wiI*ES-mA&%DU$)enK2yV>@lN z#|(x~I}?tk>0h<_6~qAq%?Q(ps^eu2kKB%B4%@JL+Hoo7fwSfipraJ)E97i38zihRbp4Ij1E1C(i2Qr=%Fjhf`7( zr1fd(>l0^j;%Ox%J`sB9G<)Fisk*0wSjxFFv~6<*VI1;9pSbAMOLC={XEVjyfHZvg zY=T7<^{XQz%&R0eeU4kucBwSZHCArmblu|421P|cK)|*)OtP-a@rHqH8 zIfr)5)TxutN?%_(t8bl^>|Z%+Dxagr>Fl8$q<62})icjY_OG2a6@NoPlG8~CO&^3D zB&XL7nt2G>$)OVnVa~sH&{ir?MogJj*zk-2u*JDKXyzc~M2Xae1(N++XN}W&TB=TO z9mH7((awS;fT{NuZiG@f%mI%J%8Wo&;TW8mTB>(kl(ODCtDjz!zP@)B(=Q3~7v#8cW$84p;qVL@<*2=^EN?vh$LhpUa5U`{ zSLcfI1q5!NGi;4vJS3+=M=b&!2>9+9!z9h8w5uK zt4xm#aC{2j_Vy8uCJTBJ^R`2w{$5ERIHKXG$+#~Kz_SG$&2Z)G63q=|iQ%?^61u|; zQBvY=_d6U-Ieg;4O|r^O>1(mGsJo?nNro*cODFolDRYgUR8!z6YgA&XPJ9GM>s9`s zAU3(J-}_un>NH2-+DO@+4&omOQ7Tji&9J(oIQhXr90AuEak$^%6XDW3Qp`7J@#J6d zlTIv#qdMY_jCOattL#U(e7H^whEwJf>aW=bhne))L43_qVO68j_3!C>2g^kq3rF_} zW~PhJn7K)4(H*hh4PHhmVc;RSN3eJ9R$*sDp&StZzBlR zfVLQ06MeM)>mF^FM@nITea#yULVFTMs+Uf4mg4Edv}pWTnH(|~FF#QxqvEWdDhpY0 zv*1SQa}e*sjVW`E&y;;uNx25jr!4LV++Wv?C^Eb*6K-%>%8JhoOZS2MYf&A5^ZG00 z3&ZQi!BMwk^Mr6DKVQd=Q_XBHy&M~j(8{8_rzyu zz&^?a_(r$od-|AH`omF+0AD+nQz z6I5QLg4}V){(aZxQmCh>DrQ+oARZ`Ih7!*(cyy{-qF=>1*o%6?xgbj=ZY>-QuHx>) zQGY6Xcb%__!w!TMJ{FEoN<4_{`^vIvp`@o}X%ar#YQHHL$WIL#UpU-%A32B&A>~r~ zg7hj}dlaHPTbO)Tobs*LNH|w1`<;VkJwo_M_0BGRr_a8ODf_h@q}R=RDSF(&6ysP)~=dFA>rYId1xY<)wBoVlfR= z$HbLJDq$>@M)w4g;wg73=UlwANBYOcb$u~-Y0gSw6h%d*6<>@ZQu8=?GN zr>Rz}Bv(_Bl4`2_VXkU#PznF7CaRB#ET%DPQ47C|Poey9 z!$z7J+#&ZdI`I}9U;o&PEb$8~wEWN^c$cW)gmV z#8!&E=b#C~FO-aD*$(L3$}0JGBmbXY(=l*VjtN>(2anathuzJfwEpBTsl~f+o#B-4 zS87yIegOj|;2Q^bxN%g1n2OK{%8CAuvZ=Z%CgorGy0v2OY*b=JP#XV#Da|wmls2S) zrB^|z4*xrDIL7i+@)y*A=8(4j=-HrK!}(M-5gF2ri1;zl?hjejA5I4WB-6KWt{D)D?G5{ExCVa1#+%)_3Ay z{EiRRSDASy;bzJXi&oRCr3$xg`k$Ti5#r;7nS2C}MhCkC?g1a+eBtOzHJv!Ll`;?T zbc$KN9ImXsns%*KLIlh1i19^e4X%;{E7Z=l3 zB_!(OH0pL39~RqL~OV>N|;lYA`@;hbE3J0Un26-bE|`J8_A&$YvR-&Dd6?M z8?3%D^?qg7t&)X{nd#6DDzw_L!?E>g0jbZFwhZoQ=q~?@>)%Nw%+ROQ{00}pV!NP5 zo%uM*zsGS5?yuR^QD^A3!^yLgQfjK$B2L~JexeX_(jhN|BJ^d5p>~Guv7ys=*<&@x zbL=dI^w(${9pG3t)eE7}GTs0;t5D`d<3b@lSO0Ki_71p(O?HxdxHaM_q>mSSIU6`l zCONsz&ARAAD-a4&_O-4Em0cNR=ro1oShhX#cQH)07mnt%-2a+7-QZYhE6fBX)B))! zq)#Dw;WwcI^iFdX4v$Bl95hz0;4HR1(o;yELM(vM68o01oH_&z$(q=!lfMoPua zhU)=`Cmwu8%7^pO=b~xV6RVx}ye^tCdMG{zEOY9f?(C}zo=vv9Gy85TXDbU2eiO!= zq+3}zJ~vIlt0Rx;o4fR}m&VV;eXB;sfo`g$B6IAc(#ENg&ICV5Mf&k?O8HalVy1!G3s>kC=X{j`Z(sfO^Hs$fqIAGjO0UATyp%m8(Kj?zqP`caphgOApbMC{{ z7fKZjgc?DEpmdPZ^}*beQZNKRC|wx$5o)D;Ap(Fhis2d$r3?~y!r4$d{*zLYxjfz9 zDdqPQ&o7auOO*Q`5oG`o)Z#@v!QUzM#5x{ts9Nx?oRd;MJD|kVp;UnbQ2Zwx;u@F9 z16f3IkW%m{_oT+~CpbR|rHoENX-*VCser3cIt-Q2b^M_8gQ?F z6Z|(yV|kCKC#B#6?n$YqK5$P;<$UCxR73Nxn1laDX^#Bh>Hkit%Z;d3T&X}~cv21L zq?CmTDa}8TCn(Po7%E*@fpbG8UXgQB3RcDsT5h#CH&jYrn{!g~X3#hq+j@4Myff#dl%Ks3`oA#(qXDREeR%>>s*oR) zE}X#me^N^4&#w#Q>HkhC-9(-)$cV51AOMO8<~o^c2$T*|iVuZS#lkozB_7WG-zmjM z@OV-RPUC)B90HUeiUU$AAcphloRdW@R5jaIH{reWl@>z*k3Y}jNo#>W=KepZGB^H10%Y@FW%PfTj?c~irUKOC zPkDzcjuHEVM;Izy_ywG_n8zC`@eDU#xA8q-f4q%>zLLRBm~LRH(2rcwW3_rw}Pp=_7!B8k=p7M{=FU(-|ri5XCtu`DpI{ zUE>H)f*78Fl>Brkjp0nr4V5Yw4^BFZ>l`S}#|2RQCoHBPTq(aL@RWWT=cLF#PFTSs zR`Li^+H==K32nj;x^N4WDwIm_|3;~xG#+oLgm&QvRWO~$E6OT)sVd3$kqpial@`Y_ zaLV^Mk0&MmEBA&<^~(pR`kv$QhDzuHevn?lk4n%7vo}e zj+AaH#hjOLPD<&%a{vFVjgphnCy8aE?y#;_Ev<bds518IrpR#pTs>W<+~n=baBE4 z1ZeVYhEm2`xu!x*;SWOT_}?hylfke1&x-M<1XQCOeu1G<#d5)^iwmHX@dcialv;X` zdqbrbUje76Lj0iXZgRa1rTBZKRtP-g5s#si;S(tBN3WpxPk4_XtHbRE6zit_8p)x8{sj56v2Kn3@M z((!jn=>{R5bQqK}9M02|k{`)+H0Pw0?>O!al`7&LhX@MzK&h+!q11w@+)sznVW^aT z2Iq!K6^jR_ip+vikIjctzKfxB-4Y(Z3`$3wK0rz}UBM$rDWjF#laf#7-cSjx!w(Zb!@%M3`4n>9Hgab-II0&T{9Oem*aLtDH05?K&C?gG&3erL;eMKme z2-To;kW#uD+#4$OKuyjS#rRWzB5LsnQp&gvlnScP)dETxH{!l2S1Zn2a%~Nz>)UbP zp8L*R?V*&f6BPft7PA!r%D5|!=+3fKq`&c>FNVM{qud^Ko2# zxQ>U)&o=%D&?E_hQpO=X!4&QzxSz^>H22fF#&V@k3)GMVuCt+(-%s2pLaCw)xnFF8 z@uv%xapRa%a`TF<2`Pvt&M*f)(IA{{83cU%oB;&u@9@@d?NOjQF3N_7lUeeJKTb+IRl> z`j;MhaMXtW^Yt$};h(R6X*&G#_3uAl{~9+|p2hz8`j=LO@^vxYGyeM8SH|$T8PSdE zpRa%a`TE!JYhRikhlJ9qjJjD|2T;M!`juS%t0vj=nWN zUcH^U_mXeIh*2r6PfR?RS$DSQ%j8LCDy}@#_tv)q3x8aTk52Pn^KiAg;?PkO+KzlO zt;fpi04BQ{kD zDhcR1w=m+p(D8oK^Tt`XOm2SqSn@ceRryWLvUguR?KV5PUB;avRg|i0{i1Hw&RW;n zdST=(@x7my$(Fjwv)jILt6^77Q+VU{j=BAh)-Ev4Ts`udc~9myuE~mdCPptqTJ#t` z;Z59}k~trnXC%E)T~x&_su7)Yd&`a!o9*6gjIoY2o8W)?{0`$F4GSH2X_mE_?bc&9 zyVPHXOS9h;wTL=0%Obsk?WAFMu8zooXbt~HAfnLD6=!KJbN;y&!QKkx9N z+Be+%r!SgXGkm1~_vV*Y_+DKW_vYa_>mI|>_D_Bg$40+Vne{0!KKAMKm8ixR zzAn?I_#A-k$FL%iQ=jv(7IX7=1j%C3vr{1}l7Vs&C7mFDJfU zI?APcpR~pXt+Zq28uc({_7)T0^b01w1Iu}%8piSn_z`eo`@R4~y#uIO4A6yn7Xw(m z2goJh!m5@46cUIm0qD+h2qb<0X!;evjZOIqVEYl^DuJHN@*6-Afw|uRJlG`y$)5l^ zeFx~x621ete+GC$z?0dO0u&QSDh24r9uP?V1HkPEzyP-F2Y}ZXfX@U5F_%99w8a2h z{sb7pQa%A>5-9xyFpTBD#gBjzfFYj&hO>>I0nEMvX#M~g$=*{Qc>qa6)V)=slQyEi zqP|hQ3VtjbpaQV^4seiwH&dwr3JLhB0esm$0*R#nHH`rLn70vt?GJ!l0{*P3F+dT4 zNMnFNmO~)krz$BKBVM=mWn=J1a?&b zh-D=NqRIh`t_Tpv(kcR2nE;rY0wl2ErT~QmvI)#)4?dtj6SV+tAJM^c*|LuSwj#i1 z0`r(y36~TR2(E-n=Ci{DlFI|suMF@r3#<&_UICzhz#?W|1)!KfY!!edET2GXMF8un z0Lxf(RRAwjfI9>v)}k7Kwi3XiY5+;>27ychPSpVzn_nFupfbQ~0x8U{27p-=fVDLM zR@(6g=1X#;bY63)61t=x3o_W*)u&M^Is}{gURzjeV!06fln^;2c$op*A&|~m)CbU-11zc!aFE>~kV(L)0YC4!~;yhnZbN z0JFLPYa0R_Vb2NV5%9DC$Yv=P08#Y-N(mfi9+m)B^#OKS0_3m~0)+%dHv%}t(i#CI zHUKbf43Nu)HwLh62#`(S3=^9G6cGq+0+7!R6G*lIsNWRe91Cm;;BE;}K%jt`Hv=dp z5Zesk0?Q|m+6ch9Ilv_r-5kKHF~A)HS6B-x0BsY1MOFY;*$o1j1e{s`TxauJ00cAz zcun92vug=p)(l{6OMqMKIe|O^o~;1xu#{E+QOyBL3EX2ItpTj80Cu$oc)&^s6cQM1 z4e*GiSpy`t05EL>@PrL-17O<{Ae+E5Cbk7AA`sjb;5j=?Ah{Jl{dNE^SztQ=_tpRf z1YR?98-QX0u{Hp2Sw4YOYXIx^0Pk6JdjPLC0Cxa9KN{W+3tE)lRB7JhZ4)jfRq0=U z^RVUaW44#O@^apjc%!)+P141zm$PF{kJleE4p1Px$#RK*V$`U z9Ac$y)Mji^2X$}tXBE5IK|PdZwna%!9YMaR*n*BA0qxYLadn>5-`;0`f!faXWUZx9 zA)Y=b^RhZEyqs~|u3G*^n}#VSjyAV5vy<$XJxc!7`CQzh3VS9Bn~Tb&jqYP+7Ik39 zXM_sOuJI@9k;n^7-QL19AI)g;D2Pq};r;7E`fmn3_*`>ocsaS~)<5Wmsv@L)UOS1(? z>@b}^t@A_pY{%aBn~Mbd_VefidR;I zL-Q>kPL_);N`E$Ickz=!#q2fSz{X-7QBY-;?}&m@ZBdZ56F^lK?F8Uu2XKc#b=JaJ zJxo=DC6Lr)H%MwRn=X*rY(9w@dq85&?7Bkguw^85*>jS5%*6##pQVsAVDCv9GLLQ$ z3$~HOl9iA&VgtHE8nZN#CQRiDY08F^G-LZnnlsT2V#T~kTCl?;Em_qbkX9^^q&3SS zv1aByA#KEUmere^t$t+Oqq$GZ7_U2Q8LNoPI- z3?@}4b_3b7OgHqWQ!n(Vj?M1{5YPkQH32(j*BijBC&1d?01oUqfjk19eE^(TN*{nI zdiW?M(1m$;0$6zf?D7O~VI>3#35@Ow(4D3A1xV}#VA>DBjScSyVA~rYn?O${_6H~; z5ZoWYgB>Q2+y|ik0D#^sZ~%b2CqMxKPi8(4pqN1HK!AQMpFnC~0P8^j16cGR0Iz-k zcL)rkf2)m6yuZ34TR2$V2M>TZ2xRt03MYD;8^-1j0SFj?y=LO@bqCK}Ig)v9(Wy~Y zy63zV>V0exd(rh^hd*E0XZNrEyzT2+Ppf@w67Xrw8<#2P3nI2><~i>4+j!Aq#p#t@ zmcJQd(C@pnP@3CL)*1H6E{wZevu7Zitmox2OFP(RDR^wrVM(wOMtJSq> z=8wXiE7V?l^!%B?(tF=~W>>2h7HuD4wyDNuW;zfnW^@Qv;z+}cyS;dmSJl+i-}B+M z(544kzWoy4>b%?b{k9uAUtiM3y<9D$ZxaVKw-`K}9Sys>s(i1jmn&wewrz=jI^6io z&J#V3KWEvmff*AAW9Qo^W~p>WnkFXFn7@Y*;j+L9NQuSFDe@c<(YUru#OllG$xmrg@c#4o(%0KR=vYcV=S6 zxa6JHIwb~XE&loXvio`FyPli-`z=p1`?&m7=VNzV(@M-Yj_I)_s%6{L;!sw9u)21f z@wvcO2aFRtU&-w~;&P?VYj%1yzk0n!)*RO%Ti>mCuz32MwYkqPRomJ4q)k)R?Y2R_ z4$I4hf8KR=X!BYn5l(?85Mim(svbujhhxTtbt zmX*J|(_(p=YlGSchkZ(PuhSqW_U4hV9@|5foExrIwW#}jK(8e=>a@A-aUB1&2eZa+ z4elGhYPNq3?i-0iFz;)w1@TiepS2*iLqT$h_^Vm9bs$AVBG-Wg;x&6jl85o-<2lK& zf{nTrF50=|_%BxP+FprhR5DxJVValQg-K5}s~&ZzeA&^h=-Ghk_U0cG+Eh8WY~{~B z{dN1!*594gJnqn{(uVPcac`NE7u9bBR$(yPHv+4$*o&$+5+H1coiHf1zGA%Uv|W;4q%0Ey!O=8gfF%PtYH z^#3cpaK$YA>j1cU+9 zoC0u|c~1c_3kS$0aD-J21IQx~83vHeatK6405lB;IL@Yo16V}@TqTghEF%C43CxWE zIK?gzNSq4LDH0%;B}4+)P6K#C;0&{w3Q$BKX(~WIdq5yL3czg|z&W;T8i0E=z-Iyl z%q0q-n821OfD7zBfz%j)A<+Pr*v4o8ujv4q7=SBmKn#F(2EaiASD9)$Kqdjd=>XT+ zJ^}%;05xX-++f}_0L*3rTB35r~WhxWjS?M8yHb&IGu}@@E2A#RFK!0X$&Q zaR7w`?htsyTEqh+CIBpo2YAA65U`yE;FJLHjLlB~C?fEhz;k9d3m|zmz}i^=FWGYf z?sEV_ z8Nhl0_EbEd$1K2}T1ey$2tbRUktA^;z@nc4H0%a|svNUf2r*&vNwn+%iOB30LCUjb zBo)|ml8Ve_F~pRmkW^ytNh&jsC6Fp?BS}?OLQ;(lSPH4m(nxAB)iOv;HXOn-m!ksN z%TR&ZOk55SAOQp~2QX)c37D+_s4oH3Wq}ev9)SV^^_lq!fT$#Z*cAW`Sv~=)l>pXB z0G2E|380X`9RiJ6iF$O-ZMwUCr|<~B3Qv~}XyaOU_=>*!hYX!Gy8eJx^JfVk$6kA=^6l`T z+0^2}d+%n<+OzF*;5d`?7gp8}v%2_a4|c4#DuKoRf-V`o6$QDmw5=$}b`uIR-3HK; z4c`V(L?D}h2NP2Pk~aecrvmh5hY7fE0jQq_;K>5h0E!6|5a`Fuw*#bZ1&G}aFo5L~ z@Y)7oy#rtni{1gCO$E3^U!X#h^U0EV;qy8z6#1H2|MlG*JB z$Rn_JH^6B2oIunL0M9)DV_C``0IQt7mExP4A z8|3c0FiX>=PJ{P5`gEKvrr#<)X7JqTZ#aC7CRk1kFHK!${ZY{T^vHUp<*{>*FQ|KN z@Ui`)ZVz3Q-w>gVs*c%yb0fRfrc!D4SN3t1^`lNTFaMdcb%JHF=6VNk_YS6)Xkv`_ zqN559px_W@eh?sa9||s*w#wVg{Kc?=SF3ppOmF35$EV_WaNxtz*Tr?+br?-ruTZ{MNU_=#|l~<*Uveo8P~3{#D7lJq_NR967aOlc3zC({s&CwryT@+V<(Lia#!Q-#Z~C zW$!U|xa76lj0R(Z8&=OgVovPZc5$vQ{&OIvW-F` zw|-2zP(C?yg7A4of|dEtJEjeG9g#mF^|j@6q1>QT+XYvjF+**>w`AD|)nd3n*;?&;?e_z(HL+8T-?m0(!{5k5huqMu8?|`8}U$)s4>-OGA%jj`gGi&9E zSy!Y@mwn=X*DMS&s9r34ei*HeI)v^v`K@XXj~&w!svbW1+m9#j@1II~^6NAEAzjmY zTYnq-OY2Q}m#%E6@%m`o`4)%fSbv(LeKzw#2VLQ$FEh=$pY^Qybeuu9aV#YZ*;-|w zyGygs-3iR&2tXl$T}J?Bvl0S{nJ9R{xVpxHbxWRJJXdYQ`5!%x1U_|r6;ScXnRx{b zj@J$tb!Ep<@#>kQ4_E6t*)R6~Y(93_&lg5-?3{Q$(01rsTZ=7T1_jS$X-AQ*?O~K- znvHVivEkVOMFg@5%xB^;faENI;9~$kv%>`3j{wv^j=h)O9HKvr*M!*|-Slj}=6Q%xraN?x2vT1VU$=ISM#re|3*4eub-2bMUI?njR*YFwB*Y-P+bNP(f z@wO8$v)4zkb_ zx^aGZxlg527x${r>*1QK&;5Lz8uVyASmnC-`OLY03=3HJ=+v<6Scgu1rmP+k`sLTg zX}TKESZOvstQQT4%Q_TNxp(!bH;-Swi+n0os1QGIU}@B?wD3LQ5mz_n_Z@Bf;(q+R z%hyMK`4}Df$noO*7Z$3KNjJS-YR5O67HH77NrtuaT7UA`1V@{vM-w|0J>Pw)RZ!jJ z<<fDtEccXQVPrXM4?)uREYufZdSKKT=%qrKz_}TKpgKbwHC>b&C zReJu-vyD%UDY&=F?^W=wdvo!6ys|xvu^T7Rn*ql$qkf#yMZBKt(CJYNtw+|PD%Z2$ z#rZ7WbS|p#xija|-2PZqW80y#{rVNu>(|gJHlvHlgY_*MZVx?_Td(ihQFdbq#9>F<{bI=qPGUxB&LCfUSB?HKe)-0G%gwLJuJ7DapEm93b;?D%)c9dH z^V8OWu6Mh+nHX>QUNv!;X2g(#KjNR{h}Rw3#10s}Cd|u!jb+r}nbFfXu-H?`_aO4c zCqz{q8en@G4e-kY*v9q|C?ZfZA0Ul+=L00?0^}0d!K$7GaQ_t`@+`nEmP4SJK+|)m z>>k6));%;JWKo-eCcW&+FKMGYb$!AFvr182>}S{P{fF@{&DON-Z~1@EQ05m380X`u1f%?SP6l|^8lkS1LU%_%K)|)08Fm{oMFSS02BfAd1YZT zrP7QG{+5TsuT38Q?DyR}THBo((R{<)#&cF}ZoRYiwuaqH8-=bo@X)LBg}`G`O&3q_ zYx>)l*!&GXxw#!D9P~4oviZ#WcVwG<5#{9mj&jbis#gKrF9Aee1t?%S1d0hXy#{cB zO}Pe;dKusPR`ouB`)z>8`v9+5 z4uN6gx6CLhy&l(irIC?VBcqH5U(`KSZ0VnBt!8@w zULQbdHc^`LzTwK>cpf&1%~TsLFgMJ0tE>FaF5>O*{ztP6T=Gp#*RVAfMq0J`w2U_z zqsvB`*>mwG2a27o#P+F(V#Ai8Rs<^>$(ICGHVV=l!~0MxQ_;1FnfitMLXjj9fKkw1bj*qIWd@0yW3RopE1tLXq-~mi8@B@G{esFOhaUtF{8fGZJvE-L&QJ7&9jmFjP*hL zHFxgf55QB_U8pe`=o4d=`PGMl{N766pg{SLu+!jleuS=I4_XT_Hde`P@AeqY z!{}{(fqxfIZEvW~Kyv~#we){=+%StI6LzMVNI?m`#PWY$1bc_+!b11*5M1jHv&Z;1V3upAmMj6sOfleY!_!rLTO-c1} z(m{`4ln$@36)f=!acE;B;yAYOD0&fdYnk9B37pXz{yK8D4UF1@*C7ZedDo@!bY@^@ zINQ#dIaoet{4Iq-9WXWZGriSA|E9vaaK1=L<3w*Qq;I6e$E<#UFR&FGYhaAoE?xE{w0nj;Cv1b0#YH=E4?_&0Ha`IoSvM~`xB{x zO>hnbqnUA(v!)0aAxxv2%~>;q6A`B47-!89o=0!hp;0@|A-$M~63}r1N|kAWlV$=P zG`du9OPtRs62~c?t`))-6p14jjC!4h(vq`tJe@UIBhKRJjgFL08=QFGxqMvUtSwxz zf`m(86x|Nz8_q6sW&@AAjy$cdfYA`*mF2<(oOBfO{OAuJ%#sOSOQc-eO`cdDfHcW& z0pdUTZz=TR?5>iK-k?u^FjhY9ai)XYm!vYT9+#|4C*c8)u|rH4XAe2U+wkT00nw~_ z#F+!a=6rh6zYV4)I^sOa2l@$T_zM&A8|fhOlBF(l#`&|7E>0eCy0{C@K)^;&{W~JN zBD{q6Exjj_%5%ZF8DSdmcf62p2-Er^_MWru2$xW4I6iRZiZI?AE*~Gk=*6$}$6N%w z99%x=-I5gSffKLj7HDSZ-!It{VZ4-EX7r9pO6QIfugsPYdcP!&rG`^ql%3DwIbV@u>b_5uDLxO2Gj* zBRSJ>HjuriECwNJ0#2ITS{^kR;iouheu|t8LHIaMI?8i4l)0!ehlT;I#7WbXUXDq< zfVb5PBXQF9SBWPdj_@eXDszUvEkJ)6L7t^mIHT*R(R5VhjIN_$rlT5XqY?fgzdRX% z>Ku+inEnkI9rQ|0YV}y0DV){hY#i7!M0SPhU(xA}@N&-R-)YmeJ~&r!X2zK>SQ2OE z^ae{xI3DLp4(lKx^@1PHnH0cLk2C6QdZ(-_v;i1h>yMM(KuzIM2BLKBo;C`y+E-2>-U~x2lZ8@BRuqz-P`nQkbJ^ex>&h&2}4F|i7D51jRdFR%tC;sdS{+63gKB`1ED(3q7la5 zVUQ17&SK!`OC~z#nS_GVapEsQ$cH^=GvJOWNO0gRmi7>uU^L?$Ih=_wEf|{JPGHn{ z8m7v8XYIn%#e==%6SFI431A{;E}YE*dxtO`-8h?#Fzv41lyP?s=O9dzXgp3=&gLS# z3oW4u<;K}h2d+IBA^e=*`(egz0y0=;*`QB82lfqXz{FF2+ffp|S4E*%E|@;-uc~$JtWqSa;rC z{W)BQ1Wh>`z}a%JuL#pYPaaf=gp*$4PrWgSvlR%3gHeM9bC!hgC0sz2*T1NiHoUW7 zi)dhn@`MbK-V;d2FwT+@rhmyymGT0k=oFmPI?6=`tV~r^Q zj`EI?9ojovbhHQ$jPVPZ&>A7{AZD#KuD~3%#)F5`vwJ(7^t|34X9t}0oZbniBTgrr zb&*vX&h0qqL46iZT7k6UXob<@p~XUrgBAmAgl5b`G;SF98nt-g0m}57o6R2cE{<8(+y`2oIP>6Rw*_j>L{5V0bXD`M|R zA|h0knne{wt!jj*5s49dB&faTLG7)SnAav&trB~$n6;`^Tlv2~_jw*km2dyA*H2&X zp7WgZIiIu7`J8iao?9F0z?V=LzJhvC9~!{d&=49yWB3M|KvQT2%|T4N{b}6%+z#M5 z2#FxZ;vNWvvJj?nxNAM*w$q|JU?(JknD)D25A20~Ag29(5Oe+@9D>8}D;$BNkOarz zIGli!a0*Vt88{2);5=M_i*U*AR@m(_o-1$_u0b+fhZ}GcZozH48tJY@$H^N7e}oA5 z3hF_9ke4`q29-fx0C|EgKMAMc42bD}9xlK|xCB?=C?vr#I1WF+5Eu%>U^t9`co?W* zsmih<%ZMx+vP#IRP)Fs?sO5~4`6u&D)>>IcW!bC)mRTcT`%FX;<0 zFvOtngshMa#1Ii1?=N@)VzS+aF(4<35ikk{!N4@!mh{Eb9|rKZG@5TvFTA~>JH$W- z=m;9Lg>RuHd5uw!u1B4;x@Q{0OsPHY|e0FcL9p*4iV zcknG#f?`k{N`M!Lz5j%D^)HCSUjtXRw@YvlIuq6fqTqXIr;cUTa`GjgZ!>8*E9M|1 zFJu5YYP^QOL4L?ae%IqKcmhx18OU#c$nS|%uW6h)LZ-@ud;g!@@qJKK@4g6?VgDshVc}b3bWuA>BI)U z5As_to*=&ga|BMnemD%BAR3B52?!R2q3{V*fY0D_r~+cg`awSRMK-OcH6)Gl$)Nef z$s1>z!!jCXIjn%6VI{1B1XvAgU@feJ9LRe?W{`LO+94gJhnvLThTq^Wh(UM+_pR zw?k{{+y>f0JNSt>F&0rUktzDFbak!OAf7YTvmo`HjuX}pMukH zALRYh<6u0*LKH+pS@;YpL1m}{RiPTx05S38J?8nLAQXk-Py$Lq0F;722$n`FjYsS~ zcPf+)x>7dz-6OHZk5XS!7h-u@wSG~;WWyAh6W%9j#tEs zNod7?2X{OSg?JEqQmop`IEU0;FD-N2E;>M7$l3!{J)u2FQhB*^36R%>$a_=dmD&Sg zG;w2~9khoo&=n$}Df~t@Pfc+4(j#(p&S%G7#B85D)U}PZ!jBZ!N#t zT47cDm+yRmM4R?Pg67la&36(XSmM>0UH1!RsA=$|fY0ZTW@HH$)R%T~4 zkY%kDWQASm3&53iF*9TUkxe8Vuj@19!v^??filcTyO}1J#7c;q zkw)T|6XOWn;cAGV)-g{0BIhna{B)mdDCEMG%0?0<6?=s%$MW`20>2+_Cy;~WL!RYQ z>;>)sTxpOtxW%9^^a1(GS1;%Za;qh`UEQE4IOM9JE1oVOS7Y@c2BJZ}6U8qTx^
  • 0u|v?=e9iBch)Sy_~pcFx)oGVKFrqj1j(?M`jWRRxztrP|k?^oG{TL?Ivv`UsN&MN%YFM06xQ|ZQ|ZF zPHO_gLF#ALO|CVi9%VrT5BLsRLVA#lQn7K9QeH{`m+5Qd9@HYi9CYr!E&{%#j)eDax5mGm)Pb-Lk?mT~wD`BEYZejUN zNVosLy5*9(*+BYDnn%X7sA;V#7t{);Hy>-OE(NvXaXpBY&XC@f5g-FlI>`)|XBj0D z{|{|Erg*J*D~20KB1wDK+P8`uS};T61q=kNsng2(U(euszf0Pe$W zXhWUl_D3384B8uT4X(mvxFkJy5ziSo21y_dnHQw7j=~W*1P5U^yyf37xCdZA?1R0q z2P9mc#XStNiVG@O;5JCElaT!1TZ9g;yxD*l@w;lf>z0{;eg;2!)5 ze}EK1YAv;u8a@N5%xa!jfmGrtNb9@=kvkNJ=WmcE7GZaqT?{Fyt#rXF+;q5Nc*!wL zBp{PL&Xav%{M#c_*4QIO4BHf^zNidfxLwqjb|xI8?_!6Y|0 zz!!W#Od>IT#02t!9FQHdK{XVY#0`Yf5Cp*x0%hQHs0@{$B76#EK{787sa?E#W)J1mA+lw}9r*%y30U!rMb@h=6t=#~wNUM8fwl2WCT0 zkoMPz$j6Bp+!sESu@p}32L|E}h96)Uj0EYH(YT{v226)(pkOLYhDk6HCcrq5ij4)c zBIBk1%g`^9`4k8-kQzzNW`fjGT1aXw@$;Y|NYgKdpWtU$3iDwJEP{owAQd8OhMDP> z$OU*aq8SFYJNcunS~FC*tlj!c4yz{(h!r=4QCuK*{}goLq!U zDJ$Vhsq^FJgTwd_ft0o}900SWq(2XWTv+9S+;ENOUqNJ(;0PRrlW-NTz&SVzXW%p( zm;OJ6=L8(n16&C%;6D$SL27gf_oCtN!Lt}x^?AMy$sn1@fOJq0x$=3y^KEznci=PR zZ{gmA8z8d!KQ$_VMewaCkpM{~f+8d*eYwIAWpZG=kNY<~hqoZg|ANQx2!4lq@DL>Z zUHAf1rqoM%uJ*(ui+KE1QC7#PeBw(L7ssWSkg+|JSi)M zwSX1midpVr(t>PCVhiO=<(JE`93qfCjhbId3y7-~(H`y}E8KDm+G))2#$XQ`Q47%7OiFM{bT~ z-q*tY0;)j`s17wjR>j)5vAFecWp;dpE1yxxXI1hnadi#9`7ATY43l^>Tx#9~S;_Ak zh-=LMBm?uYEPviQjQF9nlu$yj7WiDWDaC38{o8EoNMY9meB8p7c_kQ%pu<{%%C ziLA)91gRvIHioaJ$a}OC80CVvNp)&{R)^1BcMNgLwqc5G<-~HH{xU#$h_}` zzbAAD(JT3gq0$4txV_@=^n9UEqQc2Mx|3>m0Cp+OBJmXk!UPxvl4dMO zLFKct(J&4qjbv7aG?IzvlrYI_hVd+Upr4-*#Usk6rHU|XBMB9VBC}v3n>tyQlB;3`~!%Ww%U!UZ@F z=Rg|ZES!PUumw)RNjL$=AxRAhnH5QY1|EV*>(?nu7o3nwgtv%|b{G|0}IbGi3DsH-$}w4^kB< zo+V2%keZotsr?f6rx7O^i>$0Pk8#VA)=VR=tUhKT^?BY@pLeE^Iq*b@>6b}tW+0PU z{4(0jG%{YeUvWKqm(<9bo#>gSZkN*vIz7v4UKv!SYMPhtCt104V9D+_qUM`*iwg9! zT3QAL1O^1M5vnnFv|MUexaQ*=Sxxiv;=Kcv+i7{6`PSn?KD8%83y1Q*jo)ZF)Y~eWO+D<$1q_V&q9|gl&JID8- z7S`r%RA4`HG{Tp(Q9k_xq5pbR13tCIshnn_#rJXYJFk~+{d(Ovmp)xP|1Ya9yhc2H;Iv>DbfqMWhu zn)UtCtFBG8tm;i0EuES?NNZ=dp3`fvwlt0L)YdwOmKdh3vo7nRE)Sy$dd-#RaQc5? zS5t`<&^aPZpjkvQ>tk zKK`P6sK5~@AKXLL8bR~U>Y;o_lIf(LDruzV9lDS&NM<9YZ`|$-&BxXrpEJyqB!N;A5*iV}B9Z#8!m&DyJvdPuxuI7X!> z8g`WU@%$%^ylY9R0)hidV-WOF`9^EJ)2Oc+IhvG7ebx5Sl%|)FVpN;StGAv%aK&l~ zX7tFKSEQfIc#0pEw&?6H7pz(0(iId?4)dp<$~Z>Pz0w#;HFSXT9E&@7fa*66mo^$p zc<33vA1F1Qx2E#1SBf9VjfOJ%(7a2Gl+&|Um(`1_<*7zYm>%;D?r|z%oR-7J zm9(MW;m_`pg+v{4#EtK|!EYvsN|T6&3yM=$$0E$+_l;LAr7UKmv;*}-`-&VXoaLLr z8>JSk608&d$|1X*4m5PVQ()C~dt1$dnUzhIr&(_^O4saahc{9eJv_TTl(JUs;Uvsz zanv8or5LrTS+z;!x?0V%Qm_F2!=N9m922xUp%0PBjKtoNri=^HA!bD!?==!K953h1mDT-I4=WPnQ4SH$q59CsW&fst zZ;>98T`>~j<`}A?C2a{LWOeqkHO*Z&_uvCoOSyocP>~2FhNU~cTb+)L!mA7#;!5ip zqBV!At)z7{LPAPbKB#s>pMh6aAR#l0+I1VM9wA{JhI^I%W@bztstQbEU06I+?VLo^ znxV>Xn&z$koTSxt>_wBbV6OcW(q9^qupCXLX=A3t$)T#nWQH))V*F&St>Xrg1(9s* zQ}bA!Kh{!SGtczHRMsi9SB_!2t{k4LxAYkoJ-_|$i(VDOeKrLVMur)(QDI_vbOSHNa3V=sgt3|(H{wE#IUI) zC+FRrl|l^&3~*&>X4P*hOVsueYRy!dAp2-lSJ4EEMyqy8tK+E8N1Pc*-l?cx#7~nW zzOq_my3mYnb;hbBMG<}(s~2+GaR^+9!Rc%e5Hn-5QqBB>KGd&aAW(Ry8I$D@@lMmf*>V$QauHTgZy;37799QdX)~#%=5rZe)n5 zeQ{v^Pt(5mf|y`>yo~BRLkpF`v2=!3%sPCkIypo0chpdNt@bnxeC9rS!#Jda^aie{ zl;@9(#gF&8G1IL2Y{~8~6SD>SWK)>n+`YSfzM$bLv#z&N0W)c(X-cj5k+D*1h`K7S z+cXtFi|~KOdt1GysfKgdjV90323d{5yf5rnLo>+wdV6K>3Ew1lc}DR|Q+$TEu6Bm( z6OP$bW7%|lC>*)5t@E_8Pgvz$%|iFRR{+(pHk+-Pp;X-FM}E!42?{Y*g}l-`E1|7%_n|q-7F<0 zX_jh1TE}%HypYJ0v+8fNSN8ZNMdHOQHD0u5nyrth_M0j!4Y7B+l_HUc7#WTi2Dhyq zH1&L9N=)h5>awJ*j)Z7mUcLRdT|X;4Gex2WF*%7jHqSHno+7_}l@il!wkk27k_|J` zMupFRdwRmA$|(}FW~*={LRTXpWBvBj*gxle_H;{%#BO4w`-f{Q+I^R$e6N(4)3en| zNqg5wn|O1=(rh_vJWG*yO^noP|I_$9{T4QwloI1PN4+MkHUAvtwLl9F?Ymgtr*_5F zy%uw2OH0?#aV;ZZOZ3^(_x|_44$pcopVcB8Sn0Cd!7Nb&7LflCBxD7eP^#IOLhC;* z#{w2i(%^uwgT!z%6Q4e&!oIupXJEAsC=(DI8W7?(WQhu2Maz6Zg8frwS=`L23sLS^ z#)o&PD7_)?lmzRdSFY?CGF)~NBa2nl)4QkN*x|j3BFomsFe|-G)g`U9>N3@CAxq>q zL&t&+J-YXP(_AbRmJ3;IW-U`mBDrLly1S5}eC;PS_b|m;#|MzIrR+ZURZtd>u185x zT3-l_f~yXTSpJ7GHD!0N*wVW7$NMa0BTuUvlD+xd0!x=Qcb z0Q$tpC$?NHhF-r{qiS3tF{~ae*=~VolP+&@rthqnU43hLS}J}ThaHPi@_tn$id6J* zR}#s@ZRZ{NvcdKrg2ncw5M>-CZJ zRnKB`${btu#?@Yd0bzWkuwGq7BJ>6l($?8~4e%{6_bQh204X&!b#Bo6`7__uJ8DL4 zESgT&&Pds{L0w(Sh)CX`UM^(<{INj=EaTbkR5h1r!QOeCy3W0~3WTJ+6Zo@huS2Vv zv0MvvbR|~C|B?|8A`7)DQo|@UBO=bJ?k}faBaHM(WwJMHdhxHcntnJ4=K9U4{8x~Z z;X2}w6f>w@x0P>SW?tSt`@1rZaH?n|RX~E4Q%zW=<(5(=EW;LZZdP@EBA3L?di~Vr zLv6W(ygsEI3^G;&x5JxNJQAVjkdTsw?%LtFkoKh<#|#_bmJ!pW{gocpR+V%+6kCGJ zkj?4{X?-pH4VtuT;EZv{`%SM^$W=>@ILu^aS+3=>X5OM4RMuKxiwa#%Bc|V~IxNTB z{J%6$hHYy23Up1}rnZV3yJC6{uv$rUa)f{>cfvEeJ2uDzeIKZXL2o^s619O_(F)6<}3HAS=G;`eih|v z0@pmQoTyr?Bt^qS)ng^O|Ico`yb`nQmqg{hN-OV3zgzFL#;ezrNq4A=IpmpS#u{ri z*V>7zv=GP4J^DVlu&;e=@V&eNt{!xq3-!_98ndt2Q)Ha@m}#y1_Nq1s)ZpJU+O?dL zTcLd_X*I_Tyg~ca;RGsEX`kx67PsEMsjC@0t@r7sM~O2#Pr7w1*@vuU31JW)Bu19t z?gv{u&%LylyQ~u~)7|a#K2?{rj>E?A`gz-T5BgV|vq+a9soS~DY9X4R_gR~4w5>aa$u8+v)aKIdLO3d=n^f6jQLVnKm4irzVA z$`>m!;BZC#9OODv-Px}muKC!E;@ri(JX&SG)Y@7#-N9EQcpI#F<}@<5mOr2}u1jfW z#}^0mA^XL)TXl;Sz9y$dVNcfUlRJCYx!s!RswZYokXxxEs^12#cs3tVH#RV^cOTK` z#nI^&USz4OFvgR#0GRTb$q-otckjr_kop||>*r3;JnS&{y(QI{Y-xI8y?I~T6C&#R>E zC~t9I`R$-tV$bUZp4|BCFY_<8pyCs7Nd5t(c+7oATNwNQ(-&1Ds^8~cCs6_v1?Em%)b-a6%q^4`Oz4rVSsd%1_Gl&og&rP!yE z_32Y>LYpnUyOrfO)3vZLeL}D6z1Qo`g2{Q_JT6U)VPPa*SNHdl^XE5I`F&h&etAQ$ zy7!$o0ky|<--o1J;h>{AG15rIzx*wEK*Grb8dkZ>rgH0kLv7thr%XUXrn>*0M`_Lm zRjZ#O@zV|U2#L_WhK@lVkC$FbKE63c;tDZx%(_y(ZfL_ls>Gzkyt$z&{z6*EO}>wV zM5%_C${oA#IY)9c|4)hWC#LC|yCc5Kyk$sA%(pkyXwo|RAtCeK*LUmSc|~G3rbx`V zsdge^b>39xf1$y-cx*w&)(;^S?y2$n=`%j8*t4I7zk(sz z&;IR?pN?J>ozk|G?yC|9kTljM>sJp{p95?JdbqcGd4Og9{T)n>LH@Eu2D3f}vPn5Q zJk;mOw#6B8KX=-`Bm=G^ zWj8iwIlB6oo3WB&suD?rm{K8$Dk6!2tUm{Tz&JA}L+;1wO%h9co5#Avbc)wzdq4lY z1htc8nFR|ow$3r?AA^J^^zXg@(rHe!7DkL(-xGT%00 zq}@aKR@`Idz>smgKti?y?^T;UzpT)%d`eo6zf`^dAwlg79sg+*rHmqdhyMQ_MZt~_ z8U|$;IU#<})mBU_Yw&aR@Eqge;R$V~b>wq3`XsfQ^ju%20;9$x6xclD9CUaJ9T=&64nzc4H_Z!`?xPPl??C#=^CyDh- zv4X?gjOHy{0tuP-TV9vnH6?1oYH};1pFTe)Mi%Ru9n=54>8DowRg9UoIqE+>uLYSI zJDR-JclOqW8Xc@XVzYeWSSEm7fiHFH-C?DBwo^o-N4y=KNg+df->pA}y}2+l>E9{z zzI)f9M#@~O+Xe0WcNKg$N<1!VK4pU}7T2xiU(4NhC+FJw*41)cO@{GyDvQhX=~JWf z_2$j~2qK0PhU{8qQ-yqdL^iVWCP~UVsMy#UU+%MKbg3;P`@Q;!Y#kkl&p`aZPtu;< z96G12u3WAgxXieEkzxCB-KEl~?3dWC`=(KEF3~=`9M$_Wmx}J1#r3fkmyC5Tqv0c$ zxhynX491h9fO!qcJ+qrHrFoGhvg4bOU&WT>>O=aXh)o?qS7pqFI=JvN*niC>+ax89k+{Pk?rlzcl#9-qqc#_~EH&hY_neOLT6cfDA>s{5q3K zwUnyd%B1Gr!hMoSwYy2yHV-vZQs(53|D@n|sxI4ApxLYE`^$K_b&dr zux|&k{9SXtobjcrcg1&=GP`c~BY!89+6 z>r~M3*@lpce||1kB}ToRUh0kHea%Zb?x)iHem@Pkm(tsg%-(u$*G!-AVBpS01yaLOCx6ItUPZ!){d*G=g z;`Gc^GtlX)Ml%B)r;+d{ZT?=#m9y+nty9t(lRES%5^~lXm%hfA>givyq05nnbt|Vs zA7hEv{pPN$-S<>V+Hwx%@jJUwb0qSUcIbt&2a9AmC8n`avH?cSsyDG-jkC0uo!*F< z=TI$3>)3-t0n)||&v0$9*7LU%i8~H8UbJV-txLRiEBVul`!(eIBZiJZBj!w|v^j1~ zU-~>HreSV%SeZ!GGa-|o3P&Qew4Xk7JEZ%x{ertT%ofoui)~XQW=Z1%3HO%teUzd-&QGnB zw2KT0Ta`nB1LyoYE=A%HF@-7fT3hCZb4yiB-Kaltyi6ZFOIk@wvy;rWvE@af(To=aWQ3H?+bsCZhb2feLwr0dKT~g|B zg_xq~7<0&D<67IL{V6)q`K!Z{OOU@VabjPbTd(aoZl_2z^Pl=B$_FEWc@W<=qs<4-TWz0LXS_&zDx>*rTM?J zqL!}tMwSSpHSgzF4<&7Z0v35=Lwv<@!^3O;7IrB`;#*=qC8pyip0l@hDqA=uW<~*3 z;V(*d7Kw^Tgdg>p_U7lk6H+9+3aZXX{A(+DfA!o}NL75L%ejn|#cj20`PnOF5eYA> z8-*SZ?gymLQZEDA`3{3v7sfvDZrfi`SdD#xmJNl~(kIv_Ckm^JJUcF${8)Zwd!(w@Ka7t5O82pNGk;V6`*NxBb6EzaoUy4{jScEUBljQWOVytA ze|EbJOhcFB;9|ovgJon%Fb^IrZ!}N8;wFRN@A1(cU2LIRRRBiFW0>0liW>5bg^Zg%o>VIi| zuf&d>Rdgfp(swtXU){GhC#w+GJe(@c5oL}>$K%cVg}2w6eARZWIw4+EbuawRkB^_d(bMv1@FT|D9Fb7y3DIqrBygf8H-N^>;d36;(04 zZBX1r6UwT5dNu_)CWi>3c@;BR-MQ-1HRQ+v$YI%C$Kz z>YsitUeqW4%)Z~VJrsdzLLtQ88V+sc#*2Z*?`d&0Sdv+KZ}=4!gTN)>RF1+j^)x4QzqVmVUOC z9+nVwEw3$~vs6i2ep)FY_WM435@_>vb}eH|pUV>L>{r(on^6r8wD~(do7=+NRkv_k z5ohN}TLX*w+LO@awzkF=wQi!#U&Tk*G}WS=t&plZSAVprCGBjN_`9Sb?QLJ%Mv7-L-e;*ckPEyKSxdWtq*ljQKsoQYGcvh9&hc8A>CzX%*Wl zDyCJN$gbUbcZ!IK3TRLFM7EBV1S;=5Tiy!t4MklaiFHp&*Vh*%xl6AR*tu)_PVHmc z_lWEk+cPpUHo8^oD3#aO=1}cV+Wb_naGS4(>sx)Oak(YcA60DyN_<#FN?s{yO9rby z8r$;c&{M>8jT9lAlJeC=86J84{#gm){}G^CHMAAVVSXc$SkqfFNFDpbmOp1oYY>_8 zpaxE`70lMESNoW5guC35LENR6b2j|j_LWsF-(hQ)scYxfC3{9jbc<=-F)~(l$w9@t z?Y0%P1Ujehwmr9~gtT_e8NAcB$l|=2XxnH}VSxY8&e7TIWvps#0%f?C!yafUtAc{? z2YcBIt7F;l#rxPZtKYNQ?P{!-y`QD5Geb^0*9c+GPjlHXrBT*($gK3Yc{%IlwzsvY zfgNr6rWUrRRagA%zLfHM9(z3z%Bwo(M@Nf1_H2Z9&SUSX-ul@?)DH!8d1o_!`&p|c zR9V(hEoAwfwEXtbY2~0HC66v__j3*{U{CZ+Ly)sp8GFq%Dt{h(uybOV{Y5%6VR$ur z9+fMQMrj*j&#uOOZufE?{oLLvhr53jyKAKmucFE~u@_L`P3)C2EHwg)RI|(S?c?0r l#J<4d-b7wK%)e>XL^eRpZDtS4aMcL(udd6gznj?~|36M&*$4mt delta 65618 zcmeFad0b8V-~YY$uARL~$XLicWQYtY4O=BN$UI~&m5S1wid4oprYw94A!8vkB|?ZY z&kC7`95N3TalhVcthnD41*P2I_iB< z7g?=W2J|XDp{d)^`q_|ApKmP-it9Bu+-S{`$ey*`#%amuRYNnuwV7htkNpw*Y%kkM`fcoNhYfY^wM4?(}Nx#E|b-Q`uk4zjq>xI>^@2+(}iCF zr6RJCo{9(z4)8Gc3-IOxIsG~p`-+i)#{TYssGK*^($^0O3HGIygt`Zl$l9R>9pvO~ zboBLS`1pGG08S4G45di-$&-VLrtfpuU>$C!rJ{;_Dp}8W8L?Z>m_%5GeJ{M)DJ(`tT!AKJ_s)Y>M&J5Lt{& z(@z8gp$!lbE@ixo3LC*^KpR50KwAWE$FGPE}QQ7H9i zJCypf8cK`8+b>}9WaJ6)a}S|eW3$9|`+85u@XBP%B=7GP?CsTECR-aVP5|0OS!FJ> z#WpPl$AmVCy#YWKbc_)j5)P#XL`CyEb=$>MmOmeLHU{nwrSa)8M{Hj!D77m-PMlD~ zx#E1(1gClV2~G=#n7KqGSXCe3shy!=)2Dl3aSVs2hNUeOJKP@ms9|0qe!kPOu-h#bD_R7l2Kjk~V@aR} ziTgE#t@?AtR$)(AkD5ovbYIf(w$60txX#M2DETqKjVg|3a}6}7v>G+ZvW z;|?&@w*y`qI>paDG}OyeHq9#%%LDCRA*MTzbX1L3NLZ+^Ux>^rBq+=)I8rt!LCohB z5*X}-2|k2$G;sOg926Tam^zXQPR;nRQs6PMt{4qkLGDw9dSvH#aRv`SiH8OI(iW2i zhE0$32=Me;g92#BEP~QNhCwOaXlOI2lf)g@{MUGMaLU&ON*!zlt%IE#d(KX5DXlwq z^r$W(sD;1c#e!EPic|gq-T?eOlq#z1p%;7$_<>S<<8?Aw8~B-PWwPc_1w5S@!{Djh z%B`_$Jw}vfqH>R{MFJ{lB9zuvPZUTQ9oOhzCkyIJf&T_}z0uN1L;Z=uw&0?Fq> zDgL0uH%fdFl$Ls!)E0Fzo-z=ubNzsP-1P6q9`^Z|r)9BZOQZ-(YUP8;XBwu_=EY8!*&mDs) zt2iO{_dl1>OK|G<#)9-w$X_XdIL}5PnX~HyNHLuI+iTK~YfJfkEKHQ8f*K5~%XT zk?;uiFz(SEvky)MYUGPOtPM{CI0zYOJ^ny1Xt~@%Jgtyv7sT`vp)_*CByR^5E;<*b ziSzRCq4Ilz*NQ>H&X>f6y%tJC=H=(-8yM>AVS8Czf?c50qqb107(32~261w5K(PCC zPg&)Vo<~Ed;!4ecr;4WscuYfEWrMGY`6ma=2%#mb4Ie{iOyG5~2YFC^_)uInCnH0k z@ALr5XmV35SP7*OX$RGYF1;aoJ$M>{_wWs&kD)Z8m!MSsVJPj~kU&4*(C#wXmD^%N zhTV~k77DzD38xGT+K402?~YjER%FxzPlD1M4?_d#Dlw!$Y`_30jY!xOp`EgTDPEy; zKU-eFA86FSquYHknZKVOEmc{)A~87*&MA`vB4ks2Lw$)4zt6YQSI5{t6l?bg4hRXs zezb(A((O?UwXU;NoNq|4o|An;W$z!0^Mc!}86kc$*}NyBe*vX@`baMf?^DrpQaMwe zizllilrBk~py*XhY)u531H64EUb8MjX@#XjsoTq-6dww03>^b)0=0n}K-)l@Lbav% zpQxA?)JG@{pNCJtG+$5m;5V;DULR<634g)UkhX@`gKqvP7St0J(aLj=@C^t-MJb=e9wtJm0;|u` zO7QjfGWMJ-Gls7XF8d;;a}SA}9^*01H#8m@s3+}EU@fSFRFJvE4ZwB5^S+7&9{naZ zbSsobBmqhtm@TOvv@ZNOC^gtgQVS^6(^1mK-*7D^P#b`T#xG#HHx1d9tKt*{x=#xr ze-xf7+A3*Lxi}&Neuxd38iKbj?mc9w@HA3Aev0YU@H7&plKuv#dXQK+kcU@b{3*f3 z3Q_$%O@#;tcuF|gH?T)+0H>jSr6CulxkhGR+% zk((o3D{$O=d(mBVTb0<*dr(?4ojJKM*Ow%J3Q85(Xp24V0i`w697-Lm2St2LY#k(| z3PZhug#&tYO|geZpwu&4DD`Nft~hk(pmeSdkTj^4m_GzVgf_|wbi@h<))w>sL6|G-J~{>x;A=xSL1~Rn72ih7#=%p^w$>L1 z#v7hGHb+Wdc@KITp8B;9N;4J;rGfJHnvQ+vA)6W!Fx?dGeUA2F=3`>7Hj>MXkib`8 zESQI<11}v)Bmdh#F2fp(y$$UM4QL{lb%r`Z+d&h-X(o-~sRKvgsY5f7pO)55R7AV6 zr;%Ld0{zxrE>lDAcaY0E2{*+Z#hw{BmDxD4!%sO;C8L$vJUVw;jN)|P;91HZ77yg?45RUSx@L@QaT6&5a40N(}vM;lQuOS%ba3?2#XKW^ zV}!sA2@I9AlcZWudV}|*g{a3RWs(LNjeKkYhjY4PR$MuYq3YJAF{~d z*P(4~W)-I{u6^f@R^ZDaQ5r5IlQItKw^FIx9`}klp0Uog=tu`k$9m;f7glFw4?NP8 z8?^qN`7!y(zl{`X*H#uT`s!fiw3o#;D@vOTy*H%z@9ph+?OfI7(bnSwC(e=`7?sZlc5dM?vG1DGXH7C3Q!SFFOt8DozbRp> zrhWHQglMgZ_DHmdIQe5rR``jHyZYqb4YJWN-h9b_+4n7jKlMMVJ-c7Wi|%*LuKYds z)0&PYym`kw-lS86sxpF4?UZ+LMdx@e)#C||(^d`1vgM0=xbc}iOb$BqRLNECM!k$# zx9aJ0eu!zRDu0lw)u{`0^beMr4w0*l-FP`UHRRC3gAQgx6mD<#TBp=MJkqGf`h-iZ z=f2!**t8-hVdty-J`+EMm-pSc`$I;f{`%c^~Udd>!=) z)e4UzllhFcO%85SKd7a&!ZgcyTU#@33(hwSI89#eXvP)6;p!J#gO9smcF=rKOA84aG7%^^04c_6A$-&aeD;n?)Crl1zM$}R9Do2pmIvgM0-{heA;yQ9Zevrw* zh`)x&c?Vk)zH~_)J|1em^ctUMXTlXsl!+$^A2-yDYcokE8-xlqgvJEJIm7AlId{!f zF!n-J9NMYvCKC=G1uu6oOI^)E)8Q=;<2b&n@3`co2_&6Ig zE&-oxOwMvD z31A8IH&ZpjYM@sAsd_L7RVEasS`0^B_!FN8;!s&U*A(}JRJBT|%+d$9)Rekv#CL-H z8S!GcQ9^2(I<>D%hO2CBePLSm+A%xEg7Mu zEKn)uYD|;TROaHGKxj2$A))Vya6;e3_)Ja(AT9`Mo}QmfW{JeuAa+Hm+3OuKya+H{$^Yh+@H;Q z5su2kM7o%%It56JL~LyZrvjh>6Wg~D?oVrIu@_1N3l2NKMWDEZMK>9ax-JgyS~%+W zpJ}@SLQ_*u*kc+&;*t<1S?LTnfX|MxgA;mG zwWGqNc%cv60XVwt(GkYxy%ZePUvMUHNP;Tm?f@Ca%iga0A3_NVqGqTC=!kk`pJe zZB*r{fRmLQ2}e^_L#W_295qf8R}wR>(@gQ?ghQD@a6^PRIv#W2X#b&h9P+hiiGvA; z!*UFqDdK7gJ7E(X4S|y7Xvxi0aMWRO@z#tM2MoiGJ!1n$ao7fM+oU)-FGqcaaI|2M z5A`*gUAZK4hMFly!&&jxww6jBp+3BIuqF2bp?*k@fqQJOiV-`B?Tj&<57!@2DA>+S zc@eG;A8l)?(2nJ^($t)FtXQ^ipmQN`)N65>oPnbW5H>3J1CH7&&VXs0Og0>j6I#Cs zj;2xA@!WtpVkyE&%`rGydg4j(1kMUhmzM{daXsdWr$|FS=Pz>=44qV3d`_wvcLA;s z94c@!;~LKsrwUgqti$ne6sHp0IymaQlAPl4JU%O3%^A*@$s7T(s4;?5;KssXnawxj zPQi_VLmM2;lm-jXFFtyvB^Qbitt#~1&P;J^0dKKat^5sWO~cJuEfl9uCR{NC;i${P z-HP%MoGG8}WT|+)kdNA@R;-NYvmhpm`SN{gE@`oN?NLxxR)WJwNYC5ux!q~ylAmeg@ zrL477To0Hy40(Sz99-1yiRLO8HH?<9cE7=iTb~Zz&daJFT2mz_9yO_Ov@*nX{TPn& ziT4~Wmy7w(U@X5$aCFrbkFWi3)G%?6mB5MlumcpWSMXU!)ZD}sVs;H)KGR$ULyH$H z5R2d`9Hqx9#~qq}g6PnZk!GAL9F>d~;ecBOM|)CRa5vxv!J$^PsKrWg;DlYMh+fH; zXR5h2Ku ztuMFIM97?v9%`v5UBz1*Q*-Lo;x!qK#R7UKKf{gUqxV@Vv({o} zg^+rkOg2#ntw(5t5c+^ne+qHE)>j@!$j^ntnWAhRVRamVqxC0@r0NS?cetv{xw2hy zWo@$%8X}Z@2_d0mW!(+JG+{FgM2OZ2b}nu-SHjUcsk-;m%>(HQq9Mccb6);cc;CQ% z2c=bv0mBOFy0Nm?aZYB6s~dTXvucIrCO!%>U=yEpR;@JKjFX1XK5MC*g%Iu~5ITd9 zqY$dOg<`Gqtuzr3(OQJWWKV=h%Fu3WWo!UKE<)DhRZO`Jzg`g72!zDg6okZ5iV+e^ z?zX+MDd7l->?A^Bj+#3va|}nwStxGrb>*9Mu;{5_ApjkHe63}WN_Sm zgrm{LO2jTSOB0=V^;-;Qhd9h2_VA@NKIARD+xP+r{Cm#hV*vV%>40iG5 zm(;p0yTs$OA!bAyYeAS1#e!XY)MYhy9+9I_C=O_>%CWoo^2=&f-frDX+kS9rK0D2ln~RW`3j3ZbfD>!LA**P-kGHt4=0@!klZf{$lEH;(iMeWjRiU`t zTfz-Sg$;#a+qIvMx}jG5*w1I(P;<5isx}Oo76)g7l(>-LEWZTjAao0rs_GvUx6hw$ z4FjPiEuJ%r;d=7fpRF_zz!k^dQt|E}pLOd5XLCp_6<1f38VDy&H+6q29Gx79v+v69 zyXV05JuIdckL?gR+QQg2^USzZI5iv&UbOZl9GxyW&oFddkKhPn*0tqU@*{kCky_O! zL)>FhgHt&b08N8f@_jgJ2krpqfX}Qv;OTNWD3iB%q*lad@==e}%1?;HUYlpBSa_6= zy07Lg9<92vpbIs!#JRx?UNPew;b;hPxMS!e;fw_rx6h2*4rebm0N1>)aMT&`3f$uu zZ}C{In0JhidaUMd9;=#f+@3TzUOCV?xD}oNN7M3WBDR583MJ(PnQ@Q*xY1_HCfSJN zvooyZ*}TP5wQ@DQ6`wuYlDkhKgX9|h4l&1bz-bB?FQlxQ3}xC{<&6Z>0o4iNk}E-oP6q5PEXc8!#T#O} z?=a&I!O=3ovY%(Jx>D6RtP-m$eEA2pG8nKI&6P40p&oq22}|XDgoIWq8eZkgKdKc& zukse3)LgS`;*%vjEIWc5GdSuiZrY}st6=Epz{Ot{YqpDn(&^laKnM=3;M(GlqGvF;kqn$(MgotA0vQ94eDj zoa$EPqQbW2mcflcK{zJx*zGAC9q)fOvC-{ncYj<2+$h9jjU(?}xSm2@+iB*SchE^b z`k9pq0a`c0`NwU5qY`mh!ESmEXD`IjdNaCPd7RkdwrDCGor5SF>+KL6?Lyqwp{7r8 zBZYkQ-e+!sxZZFhj#Keu0bgFK=3W+xkMB?|hP?j0%0-C#H-*DJKC4X4tpx0jQZU%h z%vCVGgd%fF%#>5_BR5|$(30DR5G6u0aHYR1IpG@0aSy~i=nU3Hp9g%@4>cF`2Yxl< zcEHhIz?(^I;Ae0qf|HLi!nEUN^Aa2_31RyZp5~QK)1hMMiY2!X zp+RB;aOLRufsg91R?Yb!-U0k+{}m8%apDkBsy+(uif~nQMTpuW+_`Y+aN^)%sFiQv zT40tDGq+el(n!(09Cp;g-SC=^|`!9X&9b1}N5oiC_j$UN?kp33GcM%U z7%P)AOFg-@vV~kO8^WyhpduGS6Llnc{^*^+hVZ6D)J zrvq0LkS@|Rho&OLFCkhe#Sb#zYWKoSIS~%ebNXBAu0g1B#(M~<@e35Wl9e}>pWtk@ ziG8V2Mt7wY1R~)lwh6x#^Ef)@4y!}I!2jM8Sg6hN+ z3GcD>zJU$}rT!}MpFOQvW}=pJb@3^e0a6TQX?P)@8q!wy734BRQg86wXo#6^O?-gH z6pjjLg9602@4huzd2=))2eINRqYd^O&OykDhp&nmx-6>&(iGvNHdG!47-`z$12zDS!f%hcU2qdCosz4Ix_E0BOKvbiw1I@@$lM}0+NxMVxLTcr>j{UF@xJym zoSRVc@OpCL+AEfv4rfzUatWNBP_j8b)+6n+{n>xt(D`-QN)kuBv+;J|E=DvdwT~gb-cb#U6FX=Y6JBxo(Z+vISKx11`MEt-~jT zqN-ejrgGWzDmNFdYQ(uGaAT|DEDbT1Rc;;Juu7*afwLD{8;8#q9k1k^H9lRmp~`7> zl*=Nj++sKyJG{@qim>k_wh@TV+Nma4A%qO!zn>eu}U8;7!4stt$+FT-$y-?`EUV+2O-av6W5Z%HgUS$}KSy z2TSOZQrjGkWt*UK3RUIN>MfVes&vXZa8azHCsHBwXVO9~sxPI#|BG|8thNM|=itJH zC1GV%JnyBaT({ zLOB$wOrL)H_aXDS9?vxh&5hpAIO)*6M#z(V!ShTggj~ur%Uo5$Y1gZ+| z?;u2@LQRCGuxuk#fe&fXUcq_qj0eJS{#CBGlXwQcTt7TpdPD`#e*#$ANlKo$ixx-(F^YGNVMMM+Cskg_x2^-%82t$hYs@Sd}AnW>-g zMJ->!#R$n1G8z8KRFZ0w!K=DbQFXwzp^c?@(wgw?pqkK*P>Sk|A9OkEM&`d!%4e;> z=NhR2Y9u7>BdLv~wov?&^`#&Gp_JYpoEqi?CGRYy`zNLNfl@jbDV>WV1{5y>#0Ee?FdGr=h;T1qz?N+U2Ass~*q@zs*9fl|ZQ#~`4Az(y#&NU6e2 zk|(9$X8fRZ+a$k(AYPDfJ*jivK62p5-B)3e1<% zRaX`Gb%~Qwd3T`1A3~8YM)n8+{F6PA^qHhD2;xOb!B>(erN#C};w4aOz&j`{&Qd5< zAPm=kD57Kv3?rr25ES#TN#lyw|3oQi4Jkb-705}Rlt!en?FmLQiYu*HI_IjHMFaw-K6;LP+|R3fL^3jKo7}RSK>V-PD(*D z{GeT;mUwlg^z=8g^dcp11Es06hf;(3YoLBg<48aLLn)z)lyESVgLjquSV_l2so)7v zdR15A6D3YcJ^%O6BjA(pOiMQ%kl>iXi1!$#i)m_H(*iMFS(tkm9N<6?RnOq&o0t zp){WtptSdIKq=iVD7{Fj(YK+L?!LsUE2S?2rycc_7A6H=NeM~GzlBmkB@(Z$v=hEa z@n5BQ(uUwVG?f1m+oBu>o-HxjP$bzo^=^rUR0^^Pim%id3ea6(w3MK-L2**T>Pi*NkvJ*&xsv}UrTBSLJSqA4P@1B6 zk;ha91f>=(mJ!)hl)oJ0V?PglzMkZN>E)1-NO&khxkzo`W8z0-V^)}rG|e6r}Dl-sUf9OI#N2z zHI(e>NO@i1cu>-c#_NBgRAvn+Jt-BdBY9G4Q!OafSzFRNQhar#eD#&mARs`0%_i$4 zB_ySSx=6md)&;kbI4Py;EBWe54X~GZb)||OqHK$=5>{8b%N+?$QDdd}|BX@u z#!30AD>Zl`IK@wjkrGUjfSaW55+|h$o{}e}yWcR$|KDoN|Ca*jh>w;UKuSHCEh%+~ z)<~SBbD{JirH(9sQu>8re2i?76tM(KL%v3gkR?LtMM?#(g;K_KP>R|_KO`ldBJu4| z+5o$u#M33+1Em)!HDte_nEyjk1SvJ(gp?ph;-r+}ER+h&l{hK+bCUljrTFuRr$u)W zN*%c@=~bvMt-l8d(CdGrRM0~y-~U9ZW5rVX>e`Z8_7)K|r(d8{@HZ(TshlN`kv9@< z6U$*K<~M#&GC78sR0B!_q$MdQaUCcPKusu}ef6M}UmuEpvS#$-zfsE99PxBib<~oM z2?T@+J430UZj$c-r3UnpxFwVdu!7R7x>CA668|Tq@#rh%x0lk{Yhjuw;{XYeQUwlB z>e*l@jl@tW6);kY9|ffsDcxmwNuHE~)9{1x`9rC^>5>LOshkif)f*mz0KLNhK`CLB zlwmfM3XGM~k&>Sy={$*(Qo#!)UtOso@!+J3pfu7k%MhR*Buij3lwQ@9GHj7}b)^RG z0H=neL21PHL8;)wQhHK~&yYMRm6r)cLt|veqzF<9lajX~PsaoWs6cxtRWLwOCnyy-Q1XK%9VYP+l8%B>{;`rDFL^gf zJ)u;tHtQu50s9Fe;+IV`&jwk$IAacR{sCqZ>4Ss z+P6UOOwVP%ikcMMzcT(^r$zOL%w9b>wO$YXUvjPXm#wyFFFKI*)8cMey`Q1))|z(d zCr`T8^u_(D~cywxT*XF2aQ-+N0PzG+6P^V;p^Hb)oOdCjXBKX$|}ZJn0K z8m!J6s@W;TY~H>@W?DC=Iy$>7ezIx7j>#97_F28EV}{EmxxS8#SGS(?kJkCs`|&mHT# zFe9lnW7}PML`|Ek3-#U37#hv`@c7+`gvky`M}m`w8QmDMz-5MIfJxZQ@;9~8S{U>V z-nX~-$)Ptt2Ji3q<6?@{g0$GohMdR6dmCsV22HT2$*^8=Q~kLmPH z)9uAROY5M9Q#B1E8>E*4` z=b89y9^*fuRj)xSFD)F?w%whhdrsDVvZc1WfoAxOPeZhpuhe+F$U?8M)|rD-Tz_VD zuGyGnL>J3j$Zd9AJCqr9zqr}@bx~}@F*>^eTi?1f@}r^wCYdQE9R>FJ9u#vPYVYO|wtR&KRk z_GTadmXBtMf6H}a0=M33aP^JfHpAbA8!SpYZB1UY`@yHR54S|uDLP$igmzfS$-Be1 zI#jgnGUbs@$f7X2W#i%}wfed3+@6HR8!jy=w5e7s{s5%vrCIQ(*{Yth!yR%*+dO}# z6ZSmit+Q?L)lKW%lgn=yHguUEHn@w$8sj$x@~}a6*29~gaSoq)=Igk~t@TRA-uB!f zkK4(t-^le@@)xZNIsp=&+E*J;v-NmT|Ppqswri{%@?=g&%Z znmW&Ykv7!z|trRzNh{TRnpqhv0<=XO!ecKU1lyhU0YD^^bLo4(@&Gk>NibM19=((wiDj9nt% zeE3|g+xSbAs+Z=~eM{K(uMpzHS40t8w7tZ0E;&GOs@JEcd9ZNt~ux9^m zr#5Ep=UUBaaMEXsVU38p*T4KoX%#CU-`ez{$)cvM`r2+ay!g{Jr|9er+G&+L4u4-$ z_0k-hAuFyqZ}z6UFAi^xdtYi=R9zjj7Fd zZVGZ6=lnFbo7G}}kL=&q<4ko~1)4W-*R_PP76VkLTfWQeacepoY!Sj(t*%r zdi`1*f9|}z&a$72Umh))yM2GX_yWzH&V7|@mfX@mvFymM^COG2t2M75+pnP*%`)HN z8qq*g;Vd7(+%*Aw-UH+UxZv+^s$QBVQ*)c&iRk&;;X>mbcXw$VYCP2b2L5LQF4H!Z zzijsX_19rO9~SP7z4SD9Rj;pOogSaK_PGB-olg0;OxD(T{QT&HG^YCji@xMDE=JC* z_ZMu^ybq}8D|Uh0h1q@ui1-Mw?JKs$;OaFu9+jBa|I6DRAKhA|bh7Z`+#HYm923NM z>iVw!%0oBW1YONvZJxBC-pQ!7z2E(4zQ0z@Ln}A0s9(Q^#kgGa3%lM1Gs909xx-s} zJ#pQ<*z@*0L{*D0TT?{~G48_JUCkSX|t=8k-W_77(%Zvf&y11R4DjATRK0+@dRI80zP zlb7H}F#)d4c-BaWA5(&9KHeM5}3gB-UE~p2zw7OiRBPT{SMIf1AsdV z`T*cs3UHf%2W$BeKvf1X|094GyG|gJfaxayZx;6nz^5GG1p!~y?K6P>4}jG)In&rj znu|OFBfkOovy^WD5kCQx-vI*H(C+|76#$0`1TlFjKmh@-Qh*S)pFsRCfCgm%Va&Y@ z!2CBrE`b?LuNfHRGI+RzX0a5MZW+t36v06$a?<<@KFLJ{{~pZUK7yQ zQs}OB!JhbQbrQBj9@z@mrOZ(dA5jD8)8zomSs4K%6~F`qKmtos02C0=)d1kx7}{p> z9Dtz`U^Vkq0+?$9TqeMnffhh9foLs&B$iJgQ3t@d2EaNNSp&eKCO{E^WY$3iP)cB_ z3Sc8EB#^2LV9f!futgkzYb}5h0$W&bZ2(nmfMjieZR|CHOad-C06SQc4uDS`fC>U> z%&{hbz8*k&O@Ljjj6fcN3AzC3EKL_6qAq}LEr7jjOf3MTdH~r3_A{_C0L&WzTqcmg4D-*9ADnBI^P;Gy*6hkj*;O z11Kf1v>w1oR!AUKAHcdkKn`0}AHdZBpoG8~*1G|Ksxd%v1Atuinm{H2mxci6SyDp) zpC$km1oD|jAhk7sb#s6xY*BLn*ERqp1fH?pEdW$)0g_t)ykM^hWD;;` z3Gj*~wFK~K2T(!aHFInQpx+)Ky%oS4Rz@I?z=YNSB`mEqK!g#1ZX1C2Y)l&fqYePs z1U@pZEkFSQ|F!_1*---V9RUp60eoe??EuU>0bC~Vof)(TC?*iy9-xfn6G-d~U~B~N zgGCwvI2Z#I5vX7tIslXsSlR*LH!CEN+C`!3Qh4(5%lcEc9r?N?Zima7{a+qUxi<3i z)tjrIO$lke_)N`H?+l$b$EsGS`pucwV2%g=?>JsVm(Azz-v5%9zy8&yvK7^?3~~iq z+)*)#xpqZGB^?#c3JnFb=merN0ZHzJtE!TIdndg#-)dg}GNIX%fZnw$OiFTlIu!ia zY18a%&Iv#HSyHbD=heTlJS^wVk=Db@yD3%S4Ym(yWZ!#8?T!a-cH93eJ#FgomL*x|+8Xh> z27O#wxAD9B`^uw7&s#puw^~cr`O2G?8r55;mAkq5`1y@Z?>hVKP534y-KLgXB^)bDe&YM?Tx#t*FN?Nb+wIoB z_POJ?oAxpMyV}4tVUayhOH+28#E^C932DaSNSd=kk`}C+DWoM^MAC{qA!*He_ky%x z2_$XVYm#;h-zq#>-kv3q7_pBe9hjpzq$5iq>BP!NI zNjJt>Lb@||k{;|RNl&I{1u@ib!w)&Ru>qOAdXvwQ-Hb^yj|0819B z25{&LP(;9*b?5_7N?>UpfIh5{K&m}}wGEa${dIEXOEWdK^Y9wyy(X;TCZ9?k{w25p{cTuq^Ho9Y*?aqLS&n``M>%`Y;8DA8=r%8XyT^b3)cL>Ih#Q>~AF5jEwJ=~V z{jjD=P_Dc$>urmQRQ*v=vMoSA_L@K@0T(-f0W8T5z-ItJ1p!Cq*cU+G0U*6EfHNy2 zkVjyGJ%9^Kvj>Q91kmjVFqn<$2Vmp`kWFAH5b*C0Fq|DF5bvz0$(jyO48;AP z?*IVvfk<(A08)%*1`Ytl1fm@P#;|+>i7o)fjsW9Wq$7aCAb=tQ6Icf)fKmcWod71W zLISCSQHzx`YH_FUl)xE21Sv|Kk-~%Z9tfZs3XnVyz)MV#N#Mmu0B_c96jJyM16Vx@ zz?VHCpg$ai+K)z|(^$f2fV|;I@pUv(_%mBqfQS(Q+gt$x*hd0JBLPN^0SIC#V*m;W z+#U`P!di|1h#v(oe*{1nyH3D-G=M3!V+M;G2~bQxITj$24IK-R=n8O{z)U6|2jDOU zz-t^pG}}+0lt6>=05QycJV5GLfLsD`Om6~!>o|b02>^3h4guA8fVL9>=Ch!Q0GR}C z6IjSvP6F_m05E?Nz#?{?fc``PQ#XLWSezR`9)TAGma=Z{01=Y_R=Wc%XHN(ixdHT> z43NMQCIb`@_)36hwjKcS?f~0709Lb)1k5J`jPwLxEX5O`n1Ip?TPCUcmRZoURklY+ zMzik+-#zWxq)Y8_wb}=CJFLI|RqnBgvq~pfo%)p!T9&##*{5~yYo^!lHK=J*80MU$ zn$xk#!`P~u#Fk`0%Q`1_669%@(K9(02ogNNMn&x0rY(ViU{mt z9i{=~5m-76Ae|Kwh?ojs?FX=zCAk0?O{-k)``HsefP!gA(a#?#4zdJ)fOtQo_~MV2 z9%i=F0nGi8V%v12$Y37{6cZR30C1G01OOyX2T%qA9AiTR0UQDV4im^`@*sdx0$xD? zC)s`iseu3uf&p@vdoX}&5I`=0GfXc8KotxS76OpVatLG+Xd4P}o&|*h_=Eu5CXmls zh5_h@0?ZEsxX7*($Rl7H4se;pg#$!{0lXk^m35l|U=$9pdIrFC_JlwIfqoGHH(5di zK>Q4VuLN#0+eiTO2!L&o0C(9(0>uPIMgbJElqi72NQLge1@@yqx{O+qFyX^7jrM*k zek<4H?(9(alzjNeM=P$%%B|I(SK2gQ>wkAgr`tYm#haT1EN(M=OGmb8(DFBXcKpH=KC(q~0160{5cte`&jpB|1CTry;46DgzRK6kkkbr*&uQ`O%Jb(r}NBH>s*i8gEb7et3elGJ3^Npx9< zC6HPyj-)m#B&ox?ErsZ@MI?3E6OwwY_cBO*mO#>gy@oLJWoUrQax|b3OIi+4OrU~* z0drgdkhmNmeFZ=hRz|>K1;B&^07I6R08mOmcO^h`HfAM2Y63tuftHNp0bExC`11g* z*--*2UZES)K)Zom)cWv2Ek|78%tr6pJY~@%ySlR-+ikb;$q>)9679I1R?UMH*RyQE;JcWdJM zv2-4H;v%dVfRYk;31H)-yZ(aBOm>QMRGjCS{tGlX=Vu;npd0rK4!YVXR zKlFxaI~7;!ZQ$&;-p_jN9^0Y+oF|`())}|WQf78Kbgc2br}CGbV@I%x#-@vl&ehZ1 z()!5^+pU+!YwUDzw%dEZTJt(oZ{Bvz@lWeU{5s>|+Ggb!Zin;IZbb(N>h^BmOi?y; zi+tdvMahFh>nc+WZa4j9(sg3Pck;|fw{j9M*uCs?r{YbI{g-Al-PMXfo8=7;bl#e> z+iB;eUS>ITz|Oc@#Al6 z<;3rqq}y=Sw>Xx)8rM1FHCQvoEPplDOvD;2qOer}U0Kd503!x4A1Peu%RMSzn!`#= z0uC%qO;3NmH?eP9yUth2x9=<4ujgSDp6}NBYx@KJ^zALyKRiD+X7HgXRQc3=oLa(p6cYA_VURD(?(3SyoFl1s!)gVh}d zQcNUl7)WmocA7}yT96{@fhFs}&|rsk081HwH7g`gO29f1pbuM=2#~rSpoD-e>zxGP znhcPf1kjhgCZO5?;IbB=A4^&bkV&9|zyRjB4!~z4K>9iWM^;8ae-prj^#IN+Z9PC9 z0o`N(7d9ptAR-0VjFs226nE;hj@Hl~5uCwq&$N4bO7^Hlh+lAgpKpKJz1832d(b#` z-n!x;9VV2VxZ9;pA8!56=ks^R`X#hs) z0RCxMutC)q?Bb!`mKpEG28-T>ftf*H(Thpmi=peh z8$%b#A_*k!L(N6IQS;2|HNUtT-Dl)tmser8R~%}3deHJsb6dU2YIJGkv6uN>-}l}% zKBvwCt5%NF+K=9BWV}>Ye};BZZgAP6K5c3Q+}$<)Y`z(@-jAA>rlaO)vF6hKsK|N` zDiZ#vw(=74;M$ZXcg@$loSpA>>d8r;3k~Nio>Q{Gx?X^D%lHw#R`rusX@w1R`#ep) zeQsfFw~TscX2^vLxfDoWl9Fqge1pgIKL zvJW-W7xPrUG-uqNI6+;v{gH_lDeQGK`yMVwPOtnG=~2Atfck~gsEt0S2aihKZ?8FD zTZ>H6%amRZN#X{_UjK zuQl&)tp4v>eQoD4Aa2#JGoGK#%ioT_EpPne8Ph$2 zawi3ERlYP^cmFvhPNPNrQT2M;1?dm+ z>6GTtIx_Btc3G{BexnE1s&0P#lwE)!VI42}SpX8}YX0bnejKrz5T?|z#u zw`^Rtt!a3x>8iz>vP^a_;2Xv{xmh+SK60eCL#-L}bpPJWk4-!6dm+2!$n1WR-rlK0 z%wB!JbvQ!a>0&2*H(=EbM-q$7K(UF(P)|_?>RHD+WCA!G2Uwa3kjx4Rlmf(fcG?@G zv5)n+KTYRU*7w$*vYsBP_wDDy$iY_MpSiUeRGyi(ZJj~c9R7#XygRE4FS;-8zROBx zQVY_DhuG#g5&J)ev{U3fn4C9-55(8dAUZ?l$^q8LN4$Of z74?IKMN3c3g9ryAz+>h&^8Akg9YUP z6ce~j;3#W(8X)l;!2Hu_?6K;N?OpG(cSMwzL9INkla493%4X_J$*$kGXJBT}orfJggk(YEG-WpkAQAIz-2ZjA0Xl~KsJG^jJp6}bOpfw0>E{4lt2Li z!;2V_o7IP;gZ_jCBR%hhtkYPbKkZP>xE}RJuu09IW~HWcq$ny9XT&tyuI`h5kUDWiNCN$;ojeEr=1>!~>{?#-NRQ_xQFL0wC0*1fjJZ69p^RBhSb zW;qwpT=Q#aZre*}|6LYz380w3Z32a?j3jF1KelV2{_yUFuej$#Nw_1loEJB z;1TO~6(IE{!0M|2PuLRzuD1aCT?2T=60QNLZUcNJ@PgT12goF_?K;3K_K|?k9e|NH z0A90{8vy!u0hBiZ-msxJ0rChOCQ!oUw*Vpv0K9Giyl49f7!?9ExDD`;x!(pTAdpMo zGt;{R5PuIK><++JmP5e&K0w>M0N+{AU4UW&w+WQ7mIVNb4*=#D0Q_Lr0pvefheAjN zizE5P3Q2ymZub=UhEGkl_?}{vLaxc4k}5Qr#eJxTCR<6WsmcB(RcbQ32T(1|jI|FG zr}Z=16e(87@y*_v?D2PnO8L?QU)RD~7AYDDtm$ioimmvdQ0dXL&*=ey_-gD{G`cNK~z1?2;%8b|^LHNoODrc8MDBR{J3U7jMp4QIj)?VX`20?AF z5I^7PX!88{!_72SDwLu4+G36})fVDeo>Ie4d1@m{q*e-DMxM!GzJ8uEt4$dbwKSe8 zl!JGpx0GpsSknp}4VALTA^f=?!M<|lr>o&00o(VA0dn@CHd1UmffQB6DtesEXk15Q zih{SXsV_8mUR@0nMSLC_wpfwTxq-$5IYlv5BaNPl#QRL$NaKKV3H~=Ib*PL!RefYO z`Wio*&U=C{e!+-%`1y938X|tp!3!{aLsu-NC}kg>Dm*EZ?#HKSKJf6@_-ZI>v6)83 z^QIa;%BH7Oa{3Ol|5AtzK8}R%{1XasrTp5VUcn(=_=;pj&5SFpG){m;!xFk0sH%|dO#D1M!kj=r@=_!HCrr?mHgulf2P|L?td-yl*6f{-gB zc1R=<5sKQQwMWe&hzKEwJ(8eW)JlzG3$?0B%-Gc4d(|qc_A0GX>-T)!_xs(XTAzOZ zkN6({YswvA{!R%u(inO)LQ5$_w$PAy@f@bh5-p1mN{09` zo#nn!KuZioxm@yBLnc>oO2l$u*;7OIt>M=jSt%(^K62Bh=;ej6=t=o6H)M=C&P#(Z zEV5d%$;%#nc#!MeStfe878$YEi3V{bQsZd$ZNRkSJB!y3+Ws4y!!qb6-V6P$DVdxb{mfev3VCa=V<|nc7*@aBXIRFY8vI9;%u4O5S(BBXq zGCWH)7cpc<3|Szu=OCYB$iz7a9*Tg^aYIHuSgwFHs}sni)`H;}$mgsPUI_LP#P9r^ zH#~>(R2QUO{fLZz@)j_8QG`==$5o~vL#YRDcLvZ}}mVwcZjLsktt zm+3n{zakUo>cD0B&X0NXYYm>NS}A{ND02O)xYq>PlZxz_A*+R*TjiafKaff8YQx8d z>;*EZ<2q2^@cYK_D^=OZ(0gmhq$;}@GK+)a5WCc6H$!MOWcBzdq)X09^>ONDIJp>3 z4UqLUWSSvsh^(I>vm3HTs_HX>XpB=Akfxs5aB716CP;J5V#u0e-wyI|Gi1$FGC?FZ zM>Gwj)w<&(rSK`V0co_^4D}Y++Zr)Yf~S_x1hkSpip<7LP`!=8+zw5ME#tR42R4OwnO)*hMsid*#Z7_tu7ry4SE zLl%i_njy<8m%vJnJ3<|?@bN)Wtev1PmTH*!4bPpiS3y<-)7Q|8!oF2J@bNSBq*8t+ z5@};{ksek{G~5ykAAdvEmG~|948=kS`Dcj%S*uE8lzVi=PdCV6$ch`X?#OZ)vJ!?Y z7MZsp3qU4?*#ll8lSW(G(Cdjk5?P|O+F(N%hkXD-`GgoUUKC+zZpcCnS#MrH#n_zT%}X%)=rrJzTCj6=6TvghiTqIYY5O_7TV$VMZ9T z0oZx_i1Sn4kPYOCw~jbJ6%5%Ro_Ifs^CK4ti*+z;)|M*lfJSSk!Wi-~RhD@sSC3gA9RS^<#637TCjaHUTA{!3UHX_AC z4MR8r`}ep?gQ{uBMq-zD7s#iUA^RM=%&5}HY8$dq*smg!Mpnm=ePQTHd#Y>5zQpcB zc+yTjM&>+e9?gTi-#|X~4aG6orT*m8z>tl_ewaw))6kH8h5djbleL6c$AKhJ>bkKZ z8;@N|SxUEwA)6rUgl0w&%A!L&PlOOd*36JiLS|k;+uV>PBa^o|NC|yv$iBuNhD>tV z!jMhIUcr#bB1Ynv0*jH2miljH2&W=Efve=QwIQ2^{U9>QrFj9g!Y&tD%BQWNHyyj& z^1P`+UylRc~Ip6jgq&Tv{f|`o0CUgjUcRWMSVHIzeZUR=gJ0!Fm`E(qg5BN`sWf zCXGuPlPv5@K_CQy3?edS$QU8Rv<%BK49l>~;=Y1&+LdWmrq$;lQ|X@|yOCG$8e}S! zsZ)kLnHg>1qE5VWDUc|eflkmFqM!>zLsyW^KsV?PvCsp0LLBr0`8KN$#6w?@Z;SfF z02l~^U@#1Up)d>*KsrJa40mDiHv-E@kTr#@Nn{NoYYth*+=YA44%$NpmF11g09E|0 zORT?3Cb9!|aD_~e8M1&IWX+^5WYY2_=D?m4ydW3khCJX6c_AP8fCKV_FBAYjC1OLrMpfiL)$(gUkvt;>!pxQ%*kc0a<4i09mH2r8ZJw704Dx-gF?_uWvxMaEoCH z4Q}bw6I#xY6rSe89FU#u*Dx7MfxLBM6np{lozrL-t8!Vjl9ldbl{K@hhh+=17dCtxej(H3l255$68 zP%C?bs!$E?FoNBM8*mHcGUjBMYF867Yq=92Q1B07AMA(iumgU8g|HZw!ncqLt6(Zj z1DSwwz?UGSW^d>R{b2wMguyTrdO$abfoSLeks9YbGPKInogaRuc7KB<>IWAsXX11U zbp}jN;g)$)9k-|^}cL2)PnvT%L?zrquE3hU(_^$l1ygWR93KrYxG4WENtyq+C$!0(jcAvg?2 z;20c-1F!~`!w5)(B#47v&>cF1EQtRg(XwHhNoJ?QIeEd$1uPt(S$IvK^A$9ec`gdY zK;9r#6J+(x5wK+o$ZC2!?0|i66MwRDz7ID1UAv>_LOtk!tC%IsJJL~|t-Fyakfh;p~Lmu#kyx;>4 z$Pdpc`4{jf$nx_QyoNXM7GynQ1skm3c^a9WLt%PDAod`a>If+e1@aT&S+ER8S$eL- zOobuXA7MTK7d-j$EUQMjVRRj=RN1p=#S-Nf<4PcRg1>^-kdsWxW$8O%7p#KSumRGkV5|n6)UJ+8{f0c?DV(Sb>}Dx@AKx8)(@u z%LX|Yuqn>r^!$(Yhu;{d97Yakhk1bg=%WP zyH==(yv$BsbSHoM;{yf25Bx!rDI}L_(7-X$!(=1G2RcSrznnkDt>n;mA%xb`ICjy$&})jr%~$?C*{bXYvhg zdA@^dW?4+}xm4b{he#Yo@yb$p07ywmXORIxhSLu49lFgin}EC+up&s_r89kqnI9Y= z=MbWM6ggH4hGm~&--|gDX2CJ!n_xXGqvh7lrv2iQS6oFR+cBvO*~LmDn5t^#(7MZu z8ZCDb4aRH%yxi5+F)Pr1Fp1<nA zB!cQt5G1j+FzY~V5PuCYN!>J2^9eFBPDGFep5xR5Q@TzpW_QR0 zpTW<_u0tE_ZNbH$9cISpMMsKDk|#-$EK9N?vHyuF#nm39PDq9-=B?#Qlt4Rxq`5O@ zCy0V>AZ@Ip@to03+@ql@#NtodRt&rwhR7uW5}_nc65bp7KtG-b$h(zAC`$b?o5FwQ zK;`$=3gnk`OMTfv>O=}60aJpCSIxb(Vp+_`NHxk^E1CEuuGv6pPHI7VM>#O%@+`G1 z?tcr7=ZyMNJ(9=?Ai9!k(|tV8k}@;QWb9wV3~A2NXQuODnj5k2f!(kHW`YbqQl#s# zF9M@4IL|L-IGT%W4$KA_;EG``gl}L0%!d?M2j9X{SOSaX>j^n4|GgDtQNB+)zJ2iOkVK-@ONCfI5`@4z(OM7~8js9404co4e;D0Wel zfW^L1Mdo8ocNpt_I0OgaARK|*{|XP`0o;STQd@Vh+<+@^8Kfj-aFD{f1Q+2voP*==md|O-vv3AZ!AUp) zB9~_|e*~EVFJMYoSK%kP2G`+d_(f{#7M7cE8}7qncm$GCu|ENk3x9wl_!;~T&*3e+ z0ZD}9T5>Bnlr^4YW);sXK{DZjEE9;1Ji8_GAjK<+d9cfCfF-9={8HSqzR3n&AbL_I z;#tn#P5B3go5*EtR0>maEFDI|Gj-hzyG-1&c9J*~rEN+lkVY(vDpOek6VH+mGXimw zb|8r{Wm3noLXru47sv)qR!!wW!id0>bx%0RN4{$nSN4pJKy;geG&O0@5??d@Iq|JT&>lqC3R=RaU`EmcyLf7c*%su>390Hf*jt0h zKQoXeSZC-29bqO+hwdP5-5>_KKs0o<(OyL;0tK?l>2O_}L$Au_1~X|vLSR$v#m8d zPS^nJU@feH)gZZ)>PUn2kkMTt7Wd7t5jIKv|A1u&Y=>@KVms=JY2w(^-WjIc5oGb0*O!>W?mAL z3-0oK1D?Py@DYA~#=H*KKxOx5-SSqviZ@XeXK|AAJ~vLA&A~1saXj?gfGF2L=y7?p2Hs?%Fo~_NI;U1-#`*9 ze#LD*`LmGdH`w2T6}ud+$pNNJ46+vS%3#llo%^ibD)B6Kv$cz?g1i}6j&aPcAqTT^ z;@}TKU>?%SIeuL{$RVQ~HrBx|2L~m=bd$r}5+G+_8D$bi0En*Wn0`baC?}fYSQ^ak zA*aRCWj@3th0esuF^}|BNuZo8%PF#)LCHyTID|o2kke<;5q~lQjyC+rv&f}4$%*O5 zAg9q)MNkJzZKwq`p$1fkYETubz(0^uh*zjtfLLkIW)rC}f`YtOSpEQydnBw`6rB9}m<2xSPB+(?o3gznG{ zB*)Rv1)@N7MJEO%lag7DATlZ5e$W@kpF1NS+56W-9hs5Ct7z5c0v0Uy7wERDdA}WH=g%xdFa|DKHv3Gtv3~`7 z(Vd7n9wvY!e3J1j_Q@bsHV0EODdEUxD$g?QE|dD7#lyESAHIR5un^|LJP1Q^3Fcy$ z4bwpU%m7K~bWku8#E(Q)4nGo!gefwKY?1LSaY*=j*wnuWMA6Ji3ibscfr#8pm?Xs1 z5t#&%1}i`kuo9MoL@cuJK@yxXAtGN3>tPk7N}Xm@keo@1*MTUmfz^--8THJBiLR+5 z?h-*pQ^J#WAf@E0>F#z+4J6UcU9i|dzP7i36z^+z1()F^{0YzD4|oQ@!*B2up1`m0 z7#_hx;Lj3DXoU(&VcdY9;X3SvYj72Qf-9J=RcLsDdxtUQ}`DOH{m{}!ns{7Ysg zKs>&iI7y7uZ$`Q4|F|KS=M!Ki+-y@K*Zt8rPa6;7Xa?}VBF-40G|-HR%ji$4S*kaq zzUXF5^c-oNW@dh|rZlI>$j1h@U!gx21#CHY%_H0IOx|xZP9Ga26 z&s_H}I%aq;r2fr72Qzw!-R#fr+9iTFMqm=LxXYmP7PAI^GbTU=A~TVa0IC0si8UMH z3YV(sEmHch8G-a=vCjfCU}+zmt~j4PD@b3aYi72qr=_$aI9by21ZsJ*s*Vv_Zfi4D zGD6Gi^;r&%BbXuL$JBYVc2VJ>Hfy^O)u5B+rv|sua;7bc(6Z)s2@VQX))*~++VKY3 zBbzlOZAW9RtQB#Hde}?LtFkxM!ni$bYzxhi*0HHJ;{zU&M&OVuQX8d4jL`CMjaY{c z7{MwvQd=t*jy2EE3C5+fR#??+ zsd>7D5#`K|ny=EzYPpoPla{wYnV{gHU`zJ)oNkbhtKo@T(q^^1jAz0O3bClhF@aNO`LZjPv7Z;WMqsv*|q)+vd>0|GH^LCX< z&v6M33J)s7oQ}%}__0-P>0hC~cV%2cRfArdpZAugoX_Agb<@^*>m6AdI8z}pk87ue zt4(dS5Fh;ai0K(KI5wu^?1vGXt=f5Irf2l$xI+n-z$!A(l7s^FBdQpZG+G+VhOYs$y2TA^{-N#u2_YE6sCYg;LE}ppDEL85w zH(QQ<<4mU1x!-4+!)rLMS#fQ)c<>6}p~V;C8m20@r{O#aCno;^lDNNOAKF7(uf|r_ za@w7>l9oaXv)U57sGXg)qqeru>gy;i$q^OpTz(|=*dMB;)#Xl0sYGXG^o~|RU9{Vd z1T<)|Nkz+FEi!fb;P2BlCPk~zXsw>@n`o63t%W+$(9DfyYE<)?$IBhxEa`K$6w8rl zbrcQTjc8@-ijTL^s!>@i?jql7|{a!~9C2dSvnW_2jA>_4oQ>9{wK#Nr!Vo6cG zShYf)|6Sc%1@)kC`?R2#lX`0TY-@X}**&$Hww%4vBH}dLKQf?h*4J`!t)FjiZL}>a zI&EohZHEgM)vce_#g-PWPWIE*I=*2~ot*;fJZ}A`F_-2(bf%u-XZ+F&NNwt`h1urz zSC9K^p{mya9?A_=iw9_-;pGPE75D1g$F`cyj*d>xd96WuUvXL4#cM#3DQ>ug>t)h( zkjget^LF$?BNy?OC|PF1lyYYlp;1oP7&S;$8%RCO8>Dg!($ziMz74nefR7rwcubMZ;kAY7ns;K|`8(i5aOSN=H~fbZR)8)}_HJ zcrb-MVW{dXrW&fI57z2A1`pF~^Q+ENR&BX(;3s@YZ4&0#Vbg|C?K6j|d_yR}`Uz^p z5UT$qzaN%F9C5FIy7jt8C2Usd)v}ZxJWL(Oha-TwoaJ@Wmzhe;t^dvHB?L*w4l2)f zAyH{V2}2FlhocpjHs3E8Un-xGOe$gYaMf!Vu}&MVVuupey9Mj{SHb=`T&189et)>0 z0ndTGS1qntpeA8O=mq=AaOso%qd9q2b7_LLU3uNbeS~_5Uz-t|!+(TcM0cp`p&P)eIxc=Xw}>iytkPy~W54XoNV& zW6R%T^Kxb6m2lk?(oF|Z}N}|y`Mnjs} zrpw(DeAo7#Dy5;9?6+U4p-Gfi7{AT-Mk7;$Ap?4qcv#J5Ef*9*y>KQyTBV|4iyEyC zCeaZ0jaF~u`IphE*I3QVPg?pLe0$;hO2NE2+$v?W5k8HW%CqDcqv{POeBUv8tw$x? z8PKQIHECmI^rpPc3LsMPP!km-VyogJf^jigNI zbE8Mn=WdQsk4I8AS;s23&ynXDt15rabJ4M?r98)uRpZ3$KUVD!dE!`gL7vBqRoO=I zth;+V636P3e8jZCDFt`sIAF6T1P3usuy7lz+Kyr@-Z4%s8%64KPt@nT(n~7uxH+oh zFlWxC!CIC~R2{xRv*{$Y;tRrVkgWE9L0kut)hl@>ce%gR0t&bOnuAhu_ZTw^X5`L- zdumV5`#T|p1vv*=d?tLUhkzOSzVe{7S5H=lMRV_DbyGC|wO*WI)}59XHd=F7y(dlA z$JtLV4KGwF(~G)9E8|m`zEYbtM$0cL-84oE$UJri$9kktrHs^a6{HF{r<$oJdUvbf zKitNxpNMb#O7@$~RH@@hictmsqk-!U+1t^Mu<{dpa@ww4G5#UU7G@V1GE-Igim+zR zRNKZIC^7iujvzh*QW(%JNVB;swv}{ zt<6Nee;_dO5dQuE_c09klHB+$&A(e=^Z3=-gq*dZmz-G+M{UFBsql%Ev_l;0#W{H>wk{pX({O%8@f zrE6@(MP}}~KEaz#-Raai-Q{G8>M4GIK|_Y#5AxKwGj~P*ed!u6jZk-59@Z{;$5tiX z#bdtOf?r3$`FhGOj_gt^WZH!v(lyG?SC1w1I%r7f-_?rwtj|ZqW~Xbk!zB+cC+2(R z-(CDp!*rK^^Ht?!{EjjF#&%fn_H6RTs_7c@jCecdewD?efY-Bhmo@X%IQ%;HpdpQA zw6?r!`|K44rfZy^uXaf2_tB6c_J?1Rm*&h<`;T;uH%93DpCuI-y0H1=be9|pRJN~a z`$ZP0;$Kr!!@gB*d3ID-ruV!d_oI)D&T-G5{g;f1Y^@WPsYz&re~E@H#gj|79$$1_ zrSc47q10k%P{d(eWXR1DS8?y%#xq$2CzK5e4G#*le7Q_r5x@VU5gvr^V9W4%dMtR)WUXF! zGMch4`leg|euLh$$&V&ukBm?AaB;(BWNOs0fbtDD;v&-qx%+mxdNrAH`1yMkJcZcS zuh1ulT|YJq$)2sxF=u+5L!6NpHFS!W&+*TBNY)xfNzi7s;QnRO$aij9o(WxY9@+!R+4%~hA)01)YPdoD{ zv$E2XnfNAot=uqUNuCd!8eu^ZGOeoEXb)D)slYunXI=##O(eC#T z?{#>5Pj5_Q(GsvurJ|v3&SG7kYn^h;)@FvUT(8&8q-Tp#HsyDbb#-VEt8>=XxJa8* z)xNOj56N8#7n&T)am()Y>i%pJa{>)nOoZ>;?zougPw{Ka7+2OSzd4$B*?VY6tH}Mv zzvlLprzW6LE+{mNCG!izC3xnBkt3O~BG<%WYIi zXxI$XaRE(fnqA{py#3STyBIHh2T2?^HmIYbd3TcT-X#zOE*NH@B%tX#Pv5{tZ8} zZb+b0i}}r=>4WBVI~n6FwlMm%<@GjoWgh8q-L7(^ke-~|^(rX;vUQD*rZtRBFD1Y2 zszVCtDYIP-P9Z)2Gq2ZEv;f=U?JC=Rt%BqB4!z<(UA4As=0m+p8(}h28r{%_nJ}ML zIb^3gJfAr9#^h}aST}6}8T)4wq+K}2m5!0|QGo;b^3TT+IrmZ2XGWofrw9FTmuj$p zj5XM;7r}uBnf-Sh^z=qkN}5Ep*sW$0i=!hN(xZ}xHmkcOX9YQlF}66pcdO%)j^Sv? zC|+@BsR8%Yh8<|gQk`O)f{V;+rOxd*ZRs93*y-ZjO}^Z%e80hOragL(PPqMJoyPn6 z=a!0g4n?$ny~w}c+Wx_?n)BGrN~5QBNfU_0uPuX_B4M>4Ht9*{Dg=~DI9z!;W3-e9 zx&CKZxHxBd!uSur@6Uh#y{h6u7TX^C^ydBNo2Da(t7%pMP` zN1n^ocl&%aSnA8z{I7l6xlSyyPq{B5mwGJTw(k2>6?ryF-7%OjWoE3q^=5;BV%KEz zVQf#P>{gzOHE*?e5hI(SZp*x1T@vqRFosgN%K^Os)a=u&z~Yu4GPnd##PUhQ#ghoy zJw4uh&h1(UGdrgm>4p0asCGnPJAFV6Tud+FIrRsg!w#y7+c2vgR9D5l$wB3}Ov|l> zS=t>`$G0Hqeo!UtBx$vlkTeFCj!W%8*p# zh&sBI5Q2`VM&EKc$%s<*h;n@Um&n_uKYOd2OSL?9nso-%|4y!+0nVqK$u^iYEI7BgR{VCKXiX z%~PM}(bb-%yZmuXRsN39+>Wc3-%%K5u`m2i>uNJbEJwrRdd)xb?3KFdlMemxZtSqL zoKV4=@$P#W6-3Kt`47@z8z`4#u#B~azaf)!`ADBTDF`D+J8blUrvPM zPpVSi<8#JIy-OaOxa7Cf$G6=l4tlptKMPN)4rqk0Ln9BFSoKZ8rfFe$FWId9gY^mO zFfOt~F7vQi7uOoyXW*AED}Jw@R4c^qBQ$cO@%g-KMLo6;ZfR&x%l1=xhs!y*%bpUU z#WL(Mv!7D0BxOa>kU1%^MT-yGOs%lpnS19_BKVXFUV+B@!!UAZJ9+|aPN>1R~F`FZ826LQeVg{JsU327Kq7 zR-K0^!MNlgEXNO1Q$L>KwF?*4h_axp_M@t}ir5;XA;n%i_Ho_X0lB+4{W{ar^+(kU zjqo98Na2?3z2L(iS9q;LLk@dF`63+`S#79xU&R$_ba;xFH5rL)$T$9|wu#@PhQ^`1 z5kAk)2Njn1gUZM*@DeUk?9l^~YGf(z9_@5-=8|%7Urp}xTzadMsSFWWE~*KuXX}BeKfk6=WHpmJZypq1j)N+a?QC(s;36x9 zfw#YzQsB+gGPoG+xYu>HC5@PWy{_Cgut0xxT`wH(+i!wCnb>bHn#Lil+s}F-m8^f~ zdP3^y0~)8A&Xt&@@Xu=81}dcr8hMGuZ}(%D^C2}Gr)#wOS?xe0ysr_)h-^=nUcP>E zQ@X|kTx9M2Q-ucM&3>&Om+tcY&nnwS{2oH1AR48cT`qs(Vl_5uX8iYY@x!In>bqmw zdu$$+?&5w!wZ*Ta7LSy`d(dVe4{3E!#+ebFNfs6Fx5A(aWKR zN9vNkXW#TwQ#P?;x@Tw(b^UBsrE$DO;;*u;c2B($O>;bY zb5DJ|nPFd-d#i(+*%Rzze3aF3`Fz#i>_4_b8rRW2-P3E|;2dW-3nK3n_&uoRa(`-jPP`+D< znm1QD&)Hk{=p1qLR>+@3Eki5=RH28e$yUz$J3rJDcYkH2`CjXq%QslE(_rni1{Y~^ zMd}w!+5OR_oK6?#(#Y7yb=zWS!n)%}zdCXynZWh70j_ zjf{^Q(32lYee_k9F&|$&j*Btq*LkGJ_ffki{r{{!Z@J-zHOg0y)I-V5f2ZjExtT-g zIZ4suw9%7hWd0?>8M<@0eS?b(^Jg48E;U`dd!f^X)!F}{1iarDpYq+tL0t|tZ>yHu z&WL5^;C=dkY1r00RGGJFp+5hbD(5)m3^lJ~!LND|7xLORXWqFJGPB8Ilfr*zS;5z& zaoe=K=35{&@h%Nx z;*8o|pZF{@_YL%{`A^i>Gg#CIKGm1(4F?3wD|=$)8)w>rrNvi#s;;7uQ~ne@8)0}2 zOz)=}T0xuHymM|>eYZ2L8PDnh&HCRrqR#Pg|L@9k2Qhm*(@W)ys=w0v zd9_l+EOR!c!d|A`4o0DTXm}Fyk^>FO&9O{dW0V_}6kxd2n>n^Zl@8Bj&Xy7-UlpFI z<@j}cj7E0+-uSKj=r0C57?`fn=9#)Gp~s?;1C1gj>Rcb#^Nc+`^aNa_0s8D8J0$o| z|E;(fo0Q~dDu~r<_(C*fq2;}DlV|;kT`Q#f-H3}!%`>|UIyJ*%$G7S6E_|kj%F5RW zIb9DHDKh;qgoi6`5?SSSz zZI?FNR`#WuyNhgA=Fk76`2@#~Pc6J@CI=VhvZ^*NlFj&*^#ghq-7XbSR-d7kzEr*k zS+;AtX^&-IDZkx}%5Pt(75fmzim=XW?){~`G<~hk?q-NS^jhuMBVTUr(Ha;JNwQ(9 zwwG2?)<{B^ukti6txA7FL^3zfN^ZPSllGFxe;&l~MHlCAArWt1=`AeZso>6z_!E)% zHI8N;yir&1YkU4iJ>SbrWIQ|S@Mm2z81BmBy67I zE$Loec{NSL16oM__b1K8W>s?zXnAZ#W!Y-KRL7}&qrSWyJ~ln=dvE^w<(rFRW#})f zA3>Qu^qTelD+K*HuNrkwi*_+HXtXKicZh1g_|6#iC?;M8JfZ_4m5EuZ5 z^_h8RVuNdOKW%PDtTJFQP;u6H^ccS#S$ahC`s*aKOD3!Ho1Pchqq@HdJ0iOkk|?!$ zDwDcOfZ;dLknWW$+Ve`IfREGIPjg5|6tpqb9`86A7g=gE1$t&yK}SiX zem?2#D3V#%ta9!2FDYJ44xwqRP|42FquLw3`7LAFky#}j)4VFkYT+}gwr3xC*qP#TvN+K*n5SHDpSalAe!bYE#9pl9v8ZY?UyYaX z8#>glUD$h$c&U?8S(M{AN!HI>y={78yu)+4>DSSg`MT5KALgVmy0{{dm0JN!$^N|$ zBO?!lHppTWU08^vjGLM(VO4Qc8;)zCygB6Fan3Bwn{DH!AM;2UT~B#hml1>vYUi^m zzY|(JxBFT3K33ITjXuFxrJv{J_T@;%UGD|cJd>)H`D{f^WKyQ|0OI%
    R;Odhdp7I z-r3Z+lVnB@#oO^d&0tGC4|U-rslM!?vYo<*(IjmzJXEz)G*$DQJ*(%mvkbr!PH7$7 z8hGl3*~U|OUf?@!8Bn4PnMd_n7dlPh#FQ#{r2 zvo!5Vr!|Ky)l;oN=-5dx(myR-w(Wi}sW)46dIEic-y4GL1!2p^s3LT1zUz>S4o#NFW0jCL}Pq*m2igKnQ@ZK!)G*aepb_--_hChOxg5& z{FO3Q?<}Y3rZC!5Jv^u78UfqaFs&*dusl>;dmSA_j39+irz6Kk3KB?QE%d-kQ;@%>Xjq~H93!JbeGcA3(PzG zdo=y2hg+@Qj8_w>3tPiXFq#EBOn{l4Wt5!TD zq_=t1)eG+rF}<~zO~Dc9W0k);PO6h7^}+BRi{zU!BOgYrwz@uQxr7<#qf#&aEe`1l ze>D&@(Pk!0)0Dp(jM3=KJepM30*<)m~HZ-;uP<~ek{W=u==^A}-k?A=i(}aza z%lZ#bcTs+73w|A242`Kv^QCO`^DmjMam`OXme5@b>S5HLHNHv1mzOg%*^;;vCG-{# zl1IBVT`IFTxsp!axS*>16MhF68cRMska};)kjLqv&oNxOKAbhO>d3%y=`Onps&V*r z+(Dxlp|7!fG)pO6nUxx$^HZg8i>JTZA)%M^*ELo=Z8iB)kie;`jZX|9kw(urRz_V3l^Esp08<&-kmh_;tKSqXZh`4`ti1#(sH!x<=7L zYLbNBu#m2CYA;vgZOe5lU1Ol(vTab8wQH7DKcDV0zmU2jeh;C+w+Ts`+f@Dfhe_YO z)HS43e>Ysdzp_!|mQgtfH(F7F!m89YQdYOHRqpOhs(HO<=(x-7-=%BxEv!1A5uSoZ zAR5!G!@O>e+mm6?JAz9PE(LF7xqUONQ-)lryF0O?-U1LMBX+IPA zGZZSL(BW9V>2JQ@lbo&)R@^GL6({|AU|pvgLAx^);y*`6=h$nGZ5K-@KNbTrksSY- z^;ANDzVOTT;C@h+?2WP#1xs|25Edn0CI4d zzwPiQ*Dd{b5`b}LmA|CkZE9COu*Y^_bycT}a~W2+lzNC?Tf(e!QA z-ZCe3THkSUS`oIMW}7uN-<^@oVoWcQzh~L>XX^c5pUsrM&tH0cf2#pw%5=PcLj11; z7E2Cez)_=>Ny(|FNw7 zuaMqNasS$C+Y<`v-IUy0uiRzvZpzS3%NJpcDy7~aI{mIT-g)dZ)t+?^0I{zFX z7osa`+Gh-%GCYS39Y6ia(A8J;z8=czMvv7?wfs%&vi0@7TNSzAj!%l4U3IVSnoo`YLo1;+{K1(g zzqqRKT=NaBxl#Xmcfq-Jo~uqd658@C(_8YzjWZpy$9P5aET`cQzRR4WcaL9Q4&JE7 z;?K7Gf?8&n2cK&V+>XnojC}lBruo0nTINvWv)cXLyTu3gjq4uOGrm_$C)J>^-CqT} z+xx4l*V8&x4fXvEySp0iVRusr9`<}`XWi{9vRTWhYroqIrY-id7tU-A zNjp@?UOX@6Zx!u*-BnacyIk-1t4-~#t!iz5yPxuGZnvkkZ*FgFRfSve zeEd^;09*9P^Y+53Knwe2{!Z?73wu+CoYaH_^^G1JHLzD)�b#V91o>}>|!eK>I zdp5N%)_zyLZfO6&8m!*-#&<}hy_fQ6X!lfiBJI=Ei{kcdS)4zVkYZ4=E$yM!aw^j9 zT1btGMd@TqLXzC1)oW${B~w~rM>}s58g`Hf1B2Q*2t#?e?N}wYVgy|Lr?_ zfwU>R?R7p-jcW2DwEDhwU$x8I?w@w)ggsv#FF7csM53em2J+UhJ~2JxX}#IsYChHf zCZgK@_8jQ^KGxZ!;sc}l^oi>e&zGoyz52xUjT1}!pdKCLVwJVK-H|u_Ii6rLJgL+N z_9BJ;@@F_Y!ytSkWt}2pV^zpPyPuEP0z1a^?2O`Hb`<$JukyTW&z(J3@j(b|r*=kvcOKs;b|y2P<253h&$eM%|d(ESkTWgKd5a~DU0h+t7`7yT0$*% zbM+xnd$YPms8@wt{gt1)Yi3m?t7{H=wREEKSzUe9n(P#UF~+%;R)^hO>nZ<1QsPhF8BDD9=&3t0wX(hii+0@NPHE_D0ViFsMuaneF8IzRU;4AAayK< zYbI6N!*!h6mJ{2B0M~43$30w6c&bL(T{ERE^>eM^lIC03^+jeCUD7pI3Fiy#2#E$0 z*=JB-WPCgY*n^QOFpdZ!`^NPN>>m>!(>G4_&gvS_?*FXbN1Cag$p5<^)!4(evP$uG z&79UM&~-*Gw+`~E1wJV))vIc*g_Uo0*J^IJ4Pn>TY2B*3ZnL^gmlrYcIp12>`m`om Te#R@;I ({ - ...message, - stateInit: state_init, - }), - ), + messages: (transaction?.messages || []).map((message) => ({ + ...message, + ...('state_init' in message || 'stateInit' in message + ? { stateInit: message.state_init || message.stateInit } + : {}), + })), } : {}), }; @@ -60,11 +78,16 @@ export class MobileAdapter { console.warn('type parameter removed from request'); } + this.rawAddress = rest.address; + return rest; } if (item.name === 'ton_proof') { - const response = item as TonProofItemReplySuccess; + const { type, ...response } = item as TonProofItemReplySuccess & { + type?: string; + }; + return { ...response, proof: { @@ -83,7 +106,18 @@ export class MobileAdapter { 'tonConnect_reconnect', params, ); - return JSON.parse(res); + + const parsedResponse = JSON.parse(res); + + const { nonBounceable, type, ...rest } = + parsedResponse[0] as TonAddressItemReply & { + nonBounceable: string; + type?: string; + }; + + this.rawAddress = rest.address; + + return [rest] as T; } case 'ton_rawSign': @@ -91,9 +125,16 @@ export class MobileAdapter { case 'ton_sendTransaction': case 'tonConnect_sendTransaction': { + const tx = (params as object[])[0] as ITransaction; + + this.validateNetwork(tx); + this.validateMessagesAddresses(tx); + this.validateFromAddress(tx); + this.validateTransaction(MobileAdapter.mapToCamelCase(tx)); + const res = await this.provider.internalRequest( 'signTransaction', - MobileAdapter.mapToCamelCase((params as object[])[0] as ITransaction), + MobileAdapter.mapToCamelCase(tx), ); const { nonce, hash } = JSON.parse(res); @@ -132,4 +173,71 @@ export class MobileAdapter { return this.provider.internalRequest(method, params); } } + + validateTransaction(tx: TransformedTransaction) { + // throw error if there is a message with empty state init + if ( + tx.messages.some( + (message) => 'stateInit' in message && message.stateInit.length === 0, + ) + ) { + console.error('Empty state init in message'); + throw new TonConnectError('Bad request', 1); + } + + // throw error if there is a message with amount not being a string + if (tx.messages.some((message) => typeof message.amount !== 'string')) { + console.error('Invalid amount type'); + throw new TonConnectError('Bad request', 1); + } + + // throw error if valid until is not a number + if (typeof tx.valid_until !== 'number') { + console.error('Invalid valid_until type'); + throw new TonConnectError('Bad request', 1); + } + } + + validateFromAddress(tx: ITransaction) { + if (!this.rawAddress) { + console.error('Trying to execute transaction with invalid address'); + throw new TonConnectError('Bad request', 1); + } + + const address = Address.parseRaw(this.rawAddress); + + const collection = [ + address.toRawString(), + address.toString({ bounceable: true }), + address.toString({ bounceable: false }), + ]; + + if (!collection.includes(tx.from)) { + console.error('from field does not match any user address'); + throw new TonConnectError('Bad request', 1); + } + } + + /** + * Validation on messages + * @param tx + */ + validateMessagesAddresses(tx: ITransaction) { + // Message addresses can not be raw + if (tx.messages.some((e) => e.address.includes(':'))) { + console.error('Bad request, message address is invalid'); + throw new TonConnectError('Bad request', 1); + } + } + + /** + * Enforce mainnet + * @param tx + */ + validateNetwork(tx: ITransaction) { + if (tx.network !== '-239') { + console.error('Bad request, network id is invalid'); + throw new TonConnectError('Bad request', 1); + } + } } diff --git a/packages/ton/TonBridge.ts b/packages/ton/TonBridge.ts index 9c5b6606..98a44ce0 100644 --- a/packages/ton/TonBridge.ts +++ b/packages/ton/TonBridge.ts @@ -83,16 +83,21 @@ export class TonBridge implements TonConnectBridge { this.connectionAttempts += 1; if ((items as any)?.event === 'connect_error') { - return this.emit({ ...(items as any), id: this.connectionAttempts }); + return this.emit({ + ...(items as any), + id: this.connectionAttempts.toString(), + }); } else { return this.emit({ - id: this.connectionAttempts, + id: this.connectionAttempts.toString(), event: 'connect', payload: { items, device: this.deviceInfo }, }); } } catch (e) { - return this.parseError(e, { id: this.connectionAttempts }); + return this.parseError(e, { + id: this.connectionAttempts.toString(), + }) as WalletResponseError; } } @@ -129,11 +134,14 @@ export class TonBridge implements TonConnectBridge { this.connectionAttempts += 1; if ((items as any)?.event === 'connect_error') { - return this.emit({ ...(items as any), id: this.connectionAttempts }); + return this.emit({ + ...(items as any), + id: this.connectionAttempts.toString(), + }); } return this.emit({ - id: this.connectionAttempts, + id: this.connectionAttempts.toString(), event: 'connect', payload: { items, @@ -169,7 +177,9 @@ export class TonBridge implements TonConnectBridge { return { result, id: message.id.toString() }; } catch (e) { - return this.parseError(e, { id: message.id }); + return this.parseError(e, { + id: message.id.toString(), + }) as WalletResponseError; } } @@ -193,7 +203,7 @@ export class TonBridge implements TonConnectBridge { message: 'User declined the transaction', code: 300, }, - id: String(message.id) ?? 0, + id: String(message.id) ?? '0', }; } @@ -204,7 +214,7 @@ export class TonBridge implements TonConnectBridge { message: 'Bad request, a transaction is already pending', code: 1, }, - id: String(message.id) ?? 0, + id: String(message.id) ?? '0', }; } @@ -218,13 +228,13 @@ export class TonBridge implements TonConnectBridge { message: 'User declined the transaction', code: 300, }, - id: String(message.id) ?? 0, + id: String(message.id) ?? '0', }; } return { - error: e as WalletResponseError['error'], - id: String(message.id) ?? 0, + error: formatConnectEventError(e as TonConnectError), + id: String(message.id) ?? '0', }; } } diff --git a/packages/ton/package.json b/packages/ton/package.json index a7913c8e..3fed65cd 100644 --- a/packages/ton/package.json +++ b/packages/ton/package.json @@ -20,6 +20,8 @@ }, "peerDependencies": {}, "dependencies": { + "@ton/crypto": "3.3.0", + "@ton/ton": "15.1.0", "@trustwallet/web3-provider-core": "workspace:*" } } diff --git a/packages/ton/tests/TonProvider.spec.ts b/packages/ton/tests/TonProvider.spec.ts index 952fbf93..1ae33323 100644 --- a/packages/ton/tests/TonProvider.spec.ts +++ b/packages/ton/tests/TonProvider.spec.ts @@ -5,7 +5,8 @@ import { AdapterStrategy } from '@trustwallet/web3-provider-core/adapter/Adapter import { IHandlerParams } from '@trustwallet/web3-provider-core/adapter/CallbackAdapter'; let Ton = new TonProvider(); -const account = '0:123'; +const account = + '0:d4d9dc4b9024a4be47b8b35b02d24c679faf2d3d139c16462f9a6c34b8694cc0'; afterEach(() => { Ton = new TonProvider(); @@ -60,7 +61,7 @@ test('Ton Connect → ton_rawSign', async () => { test('Ton Connect → ton_sendTransaction', async () => { const handler = jest.fn((_params: IHandlerParams) => - Promise.resolve(JSON.stringify([{ address: account }])), + Promise.resolve(JSON.stringify([{ name: 'ton_addr', address: account }])), ); new Web3Provider({ @@ -68,19 +69,27 @@ test('Ton Connect → ton_sendTransaction', async () => { handler, }).registerProvider(Ton); - await Ton.send('ton_sendTransaction', [{ data: '123' }]); + await Ton.send('tonConnect_connect'); + await Ton.send('ton_sendTransaction', [ + { network: '-239', messages: [], from: account, valid_until: 124 }, + ]); expect(handler).toHaveBeenCalledWith( expect.objectContaining({ name: 'signTransaction', - object: { data: '123' }, + object: { + network: '-239', + messages: [], + from: account, + valid_until: 124, + }, }), ); }); test('Ton Connect → tonConnect_sendTransaction', async () => { const handler = jest.fn((_params: IHandlerParams) => - Promise.resolve(JSON.stringify([{ address: account }])), + Promise.resolve(JSON.stringify([{ name: 'ton_addr', address: account }])), ); new Web3Provider({ @@ -88,12 +97,20 @@ test('Ton Connect → tonConnect_sendTransaction', async () => { handler, }).registerProvider(Ton); - await Ton.send('tonConnect_sendTransaction', [{ data: '123' }]); + await Ton.send('tonConnect_connect'); + await Ton.send('tonConnect_sendTransaction', [ + { network: '-239', messages: [], from: account, valid_until: 124 }, + ]); expect(handler).toHaveBeenCalledWith( expect.objectContaining({ name: 'signTransaction', - object: { data: '123' }, + object: { + network: '-239', + messages: [], + from: account, + valid_until: 124, + }, }), ); }); diff --git a/packages/ton/types/TonBridge.ts b/packages/ton/types/TonBridge.ts index 53453baf..43ffa547 100644 --- a/packages/ton/types/TonBridge.ts +++ b/packages/ton/types/TonBridge.ts @@ -76,7 +76,7 @@ export type ConnectItemReply = TonAddressItemReply | TonProofItemReply; type ConnectEventSuccess = { event: 'connect'; - id?: number; + id?: string; payload: { items: ConnectItemReply[]; device: DeviceInfo; @@ -85,7 +85,7 @@ type ConnectEventSuccess = { export type ConnectEventError = { event: 'connect_error'; - id?: number; + id?: string; payload: { code: number; message: string; @@ -108,7 +108,7 @@ export interface WalletResponseError { export interface WalletEvent { event: WalletEventName; - id?: number; + id?: string; payload: any; }