@ar.io/sdk 2.1.0-alpha.5 → 2.1.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -18
- package/bundles/web.bundle.min.js +2 -2
- package/lib/cjs/common/ant.js +0 -7
- package/lib/cjs/common/contracts/ao-process.js +1 -1
- package/lib/cjs/common/io.js +0 -4
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant.js +0 -7
- package/lib/esm/common/contracts/ao-process.js +1 -1
- package/lib/esm/common/io.js +0 -4
- package/lib/esm/version.js +1 -1
- package/lib/types/common/contracts/ao-process.d.ts +2 -2
- package/lib/types/io.d.ts +11 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +5 -1
|
@@ -135,7 +135,7 @@ use chrome, FireFox or Internet Explorer 11`)}var n=Pi(),f=v1(),a=n.Buffer,d=n.k
|
|
|
135
135
|
`))},ui.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},ui}var Yv,YH,ab,JH,XH,Jv,QH,$_,eK,U_,tK,q_,rK,j_,iK,Sn,F_,nK,Yi,z_,aK,Ji,H_,oK,Jr,K_,sK,ma,Z_,fK,mr,W_,uK,qi,h9e,hK,V_,ob,lK,G_,cK,Y_,dK,J_,pK,X_,vK,Q_,mK,eM,gK,tM,rM,yK,d9e,iM,bK,nM,wK,aM,_K,oM,MK,sM,SK,m9e,fM,EK,uM,AK,hM,xK,lM,RK,cM,Df,dM,kK,On,pM,TK,vM,IK,mM,BK,gM,OK,gX,yM,PK,bM,NK,wM,CK,sb,_M,LK,MM,DK,Ef,SM,$K,Do,fb,UK,$o,qK,EM,jK,AM,FK,xM,zK,RM,HK,kM,KK,N0,ZK,TM,WK,ub,hb,VK,IM,GK,lb,YK,BM,JK,OM,XK,PM,QK,NM,eZ,CM,tZ,LM,rZ,xX,DM,nZ,$M,aZ,Ms,UM,oZ,Ca,qM,sZ,Xr,jM,fZ,Af,FM,uZ,cb,hZ,pn,db,lZ,ji,Ss,cZ,vu,dZ,Es,pZ,TX,vZ,zM,Fe,BX,mZ,HM,ze,bo,gZ,Xv,yZ,pb,bZ,wZ,KM,_Z,ZM,MZ,WM,SZ,VM,EZ,En,GM,AZ,Xi,YM,xZ,Qi,JM,RZ,Qr,XM,kZ,ga,QM,TZ,gr,eS,IZ,Fi,j9e,BZ,tS,N3,Uf,LX,DX,Bx,$X,vb,Ox,H9e,K9e,C0,UX,Z9e,qX,CZ,iS,V9e,jX,G9e,Ml,V0,A2,y3,rc,Nx,ic,X9e,Q9e,e_e,nS,LZ,t_e,aS,DZ,r_e,oS,$Z,n_e,UZ,gR,mb,Cx,f_e,u_e,L0,zX,h_e,sS,HX,KX,l_e,El,G0,x2,b3,nc,Dx,ac,p_e,v_e,m_e,fS,FZ,g_e,uS,zZ,b_e,hS,HZ,w_e,WX,VX,C3,__e,M_e,S_e,E_e,e3,GX,YX,JX,R_e,lS,XX,k_e,T_e,P_e,QX,$x,Ux,qs,cS,VZ,Pn,dS,GZ,pS,YZ,vS,JZ,mS,XZ,rQ,gS,QZ,yS,eW,bS,tW,gb,wS,rW,_S,iW,xf,MS,nW,Uo,yb,aW,qo,oW,SS,sW,ES,fW,AS,uW,xS,hW,RS,lW,D0,cW,kS,dW,bb,wb,pW,TS,vW,_b,mW,IS,gW,BS,yW,OS,bW,PS,wW,NS,_W,CS,MW,lQ,LS,EW,DS,AW,xs,$S,xW,La,US,RW,ei,qS,kW,Rf,jS,TW,Mb,IW,vn,Sb,BW,zi,Rs,OW,mu,PW,ks,NW,pQ,CW,FS,He,mQ,LW,zS,Ke,_3,So,Q_e,Jd,$0,eMe,DW,wu,$W,tMe,rMe,Eb,w1,r3,gQ,yQ,iMe,bQ,nMe,aMe,_R,HS,oMe,wQ,sMe,Qv,e2,t2,r2,i2,n2,MR,An,_Q,_1,ti,fMe,MQ,uMe,hMe,lMe,SQ,en,gMe,EQ,yMe,bMe,wMe,SMe,tn,EMe,AQ,AMe,xMe,RMe,BMe,Ma,OMe,PMe,NMe,CMe,LMe,DMe,yr,$Me,xQ,UMe,HW,qMe,RQ,Hi,KMe,ZMe,WMe,VMe,GMe,gl,YMe,kQ,SR,Dn,GW,TQ,JMe,Pl,XMe,QMe,eSe,IQ,F2,tSe,BQ,rSe,oc,OQ,iSe,nSe,aSe,PQ,g2,oSe,qx,jx,sSe,NQ,CQ,fSe,uSe,Fx,LQ,JW,DQ,Nf,hSe,lSe,cSe,dSe,XW,Lf,pSe,h3,KS,UQ,k2,ZS,vSe,QW,eV,i1,T2,mSe,WS,gSe,M3,qQ,js,cc,Ab,iV,nV,jQ,ySe,FQ,ER,aV,ra,zQ,wSe,HQ,KQ,_Se,MSe,xb,ZQ,ESe,WQ,Al,xSe,n1,VQ,S3,GQ,ch,RSe,ec,y2,kSe,TSe,z2,YQ,ISe,zx,oV,JQ,b2,BSe,XQ,Hx,QQ,l3,eee,CSe,LSe,Kx,$Se,fV,USe,tee,jSe,c3,VS,AR,Ds,H2,E3,FSe,Gn,Fa,d1,zSe,HSe,ri,KSe,_o,ree,lV,ZSe,WSe,iee,Cf,VSe,YS,nee,aee,q0,GSe,U3,Ki,Wx,YSe,p1,oee,JSe,see,XSe,QSe,mn,Vx,fee,eEe,wh,tEe,uee,rEe,iEe,nEe,zo,pV,vV,aEe,yl,Of,hee,xR,xl,ph,mV,oEe,et,lee,cee,Yn,dee,JS,sEe,m3,XS,RR,pee,vee,j0,fEe,mee,gee,uEe,Ha,hEe,bV,lEe,Gx,cEe,dEe,pEe,vEe,wV,QS,yee,bee,ki,xu,Us,_V,gEe,yEe,bEe,wEe,_Ee,MV,MEe,kb,AEe,a1,sl,xEe,SV,tE,REe,wee,kEe,Rl,EV,kR,TR,Ib,Ho,kf,TEe,IEe,Bb,See,A3,Xx,BEe,PEe,Ei,NEe,CEe,M1,BV,DEe,Eee,Eo,$Ee,UEe,Ru,ku,Aee,xee,fl,nE,aE,qEe,jEe,FEe,zEe,Ree,HEe,kee,_u,gu,Tee,h1,iAe,S1,nAe,Tf,aAe,oAe,sAe,fAe,uAe,hAe,lAe,cAe,Iee,dAe,Bee,Oee,l1,pAe,vAe,oE,a2,mAe,gAe,Pee,yAe,Nee,bAe,sE,Cee,Lee,wAe,fE,Dee,_Ae,o1,$ee,uc,MAe,Pb,CV,o2,LV,Uee,qee,AAe,xAe,RAe,kAe,TAe,IAe,BAe,q3,Ra,jee,OAe,sc,Fee,PAe,zee,z0,N2,Nb,NAe,Cb,Hee,j3,Ln,uE,c1,CAe,Kee,LAe,f1,$V,x3,DAe,Zee,$Ae,bh,UV,R3,UAe,qAe,IR,Lb,Qx,jAe,F3,eR,bl,hE,qV,Vee,FAe,jV,Gee,zAe,H0,FV,lE,HAe,Yee,cE,Db,KAe,C2,zV,HV,Qd,ZAe,WAe,z3,VAe,$b,GAe,Jee,YAe,JAe,XAe,u1,QAe,KV,ZV,WV,exe,H3,K0,dE,VV,jo,oa,Xee,txe,Ub,GV,Fr,pE,JV,Nr,vE,XV,hl,QV,mE,eG,gE,tG,ll,yE,iG,bE,wE,nG,_E,aG,ia,ME,sG,SE,EE,fG,AE,uG,ete,qf,hG,nxe,BR,axe,oxe,sxe,lG,fxe,uxe,hxe,lxe,$f,jf,cxe,dxe,pxe,tte,vxe,mxe,gxe,yxe,bxe,rte,wxe,_xe,Mxe,Sxe,Exe,qb,wo,Axe,xxe,Rxe,kxe,xE,Z3,ite,tR,za,fc,Txe,Ixe,k3,Bxe,Oxe,Nxe,RE,s2,Cxe,vG,Lxe,Dxe,$n,jb,nte,T3,gG,$xe,Uxe,tc,qxe,ate,sa,yh,jxe,Fxe,Fo,zxe,Hxe,rR,ote,ste,wG,Zxe,fte,Wxe,TE,Vxe,_G,MG,IE,Gxe,Yxe,If,Jxe,Xxe,SG,EG,AG,Qxe,eRe,tRe,f2,rRe,Q0,I3,E2,iR,ute,RG,kG,hte,nR,lte,di,iRe,nRe,aRe,OG,bu,u2,Fb,zb,PG,Hb,NG,Kb,BE,CG,LG,OE,DG,oRe,PE,$G,xi,Z0,UG,pte,qG,NE,$e,CE,jG,uRe,vte,FG,LE,Ze,DE,zG,$E,HG,UE,KG,qE,ZG,jE,WG,FE,VG,zE,GG,un,YG,HE,JG,XG,QG,KE,eY,ZE,tY,WE,rY,VE,iY,GE,nY,YE,aY,JE,oY,XE,sY,QE,fY,eA,uY,tA,hY,rA,lY,iA,cY,bte,dY,nA,We,aA,pY,oA,vY,Zb,mY,sA,gY,cl,yY,fA,bY,uA,wY,hA,_Y,lA,MY,cA,SY,dA,EY,pA,AY,vA,xY,mA,RY,gA,kY,yA,TY,Ns,IY,BRe,bA,BY,wA,OY,xte,h2,PY,_A,NY,MA,CY,Nn,Rte,LY,SA,Ve,EA,DY,na,AA,$Y,xA,UY,Ite,qY,RA,Ge,kA,jY,TA,FY,IA,zY,dl,HY,t1,KY,Wb,fi,ZY,pi,Vb,WY,Gb,BA,VY,GY,OA,YY,zRe,PA,JY,Ri,W0,XY,l2,QY,Nte,eJ,NA,Ue,CA,tJ,ZRe,Cte,rJ,LA,Ye,DA,iJ,$A,nJ,UA,aJ,qA,oJ,jA,sJ,FA,fJ,zA,uJ,hn,hJ,HA,lJ,cJ,dJ,KA,pJ,ZA,vJ,WA,mJ,VA,gJ,GA,yJ,YA,bJ,JA,wJ,XA,_J,QA,MJ,ex,SJ,tx,EJ,rx,AJ,ix,xJ,Ute,RJ,nx,Je,ax,kJ,ox,TJ,Yb,IJ,sx,BJ,pl,OJ,fx,PJ,ux,NJ,hx,CJ,lx,LJ,cx,DJ,dx,$J,px,UJ,vx,qJ,mx,jJ,gx,FJ,yx,zJ,Cs,HJ,pke,bx,KJ,wx,ZJ,Zte,c2,WJ,_x,VJ,Mx,GJ,Cn,Wte,YJ,Sx,Xe,Ex,JJ,aa,Ax,XJ,xx,QJ,Yte,eX,Rx,Qe,kx,tX,Tx,rX,Ix,iX,vl,nX,r1,aX,Jb,ui,oX,_r,xke,Rke,kke,Tke,Ike,Bke,Oke,Pke,Nke,Cke,Lke,Dke,$ke,Uke,qke,jke,Fke,zke,Hke,Kke,Zke,Wke,Vke,Gke,Yke,Jke,Xke,Qke,eTe,tTe,rTe,iTe,nTe,aTe,oTe,sTe,fTe,uTe,hTe,lTe,Qte=Vi(()=>{"use strict";Be();Pe();Oe();Vu();sf();V6();of();ru();Hu();ns();rs();Yv={},YH=!1;ab={},JH=!1,XH=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Jv={},QH=!1;$_={},eK=!1;U_={},tK=!1;q_={},rK=!1;j_={},iK=!1,Sn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;F_={},nK=!1,Yi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;z_={},aK=!1,Ji=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;H_={},oK=!1,Jr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;K_={},sK=!1,ma=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Z_={},fK=!1,mr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;W_={},uK=!1,qi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;h9e={},hK=!1,V_={exports:h9e};ob={},lK=!1;G_={},cK=!1;Y_={},dK=!1;J_={},pK=!1;X_={},vK=!1;Q_={},mK=!1;eM={},gK=!1,tM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;rM={},yK=!1,d9e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;iM={},bK=!1;nM={},wK=!1;aM={},_K=!1;oM={},MK=!1;sM={},SK=!1,m9e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;fM={},EK=!1;uM={},AK=!1;hM={},xK=!1;lM={},RK=!1,cM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Df=g9e();Df.Readable;Df.Writable;Df.Duplex;Df.Transform;Df.PassThrough;Df.finished;Df.pipeline;Df.Stream;o5(Df.finished),o5(Df.pipeline);dM={},kK=!1,On=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;pM={},TK=!1;vM={},IK=!1;mM={},BK=!1;gM={},OK=!1;gX={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}},yM={},PK=!1;bM={},NK=!1;wM={},CK=!1,sb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;_M={},LK=!1;MM={},DK=!1,Ef=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;SM={},$K=!1,Do=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;fb={},UK=!1;$o={},qK=!1;EM={},jK=!1;AM={},FK=!1;xM={},zK=!1;RM={},HK=!1;kM={},KK=!1;N0={},ZK=!1;TM={},WK=!1,ub=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;hb={},VK=!1;IM={},GK=!1;lb={},YK=!1;BM={},JK=!1;OM={},XK=!1;PM={},QK=!1;NM={},eZ=!1;CM={},tZ=!1;LM={},rZ=!1;xX={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},DM={},nZ=!1;$M={},aZ=!1,Ms=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;UM={},oZ=!1,Ca=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;qM={},sZ=!1,Xr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;jM={},fZ=!1,Af=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;FM={},uZ=!1;cb={},hZ=!1,pn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;db={},lZ=!1,ji=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ss={},cZ=!1;vu={},dZ=!1;Es={},pZ=!1;TX={},vZ=!1,zM={exports:TX},Fe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;BX={},mZ=!1,HM={exports:BX},ze=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;bo={},gZ=!1;Xv={},yZ=!1;pb={},bZ=!1,wZ=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;KM={},_Z=!1;ZM={},MZ=!1;WM={},SZ=!1;VM={},EZ=!1,En=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;GM={},AZ=!1,Xi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;YM={},xZ=!1,Qi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;JM={},RZ=!1,Qr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;XM={},kZ=!1,ga=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;QM={},TZ=!1,gr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;eS={},IZ=!1,Fi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;j9e={},BZ=!1,tS={exports:j9e};N3=Gi.EventEmitter,Uf={},LX={};As("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),As("ERR_INVALID_ARG_TYPE",function(e,t,n){let f;var a;let d;return typeof t=="string"&&(a="not ",t.substr(0,a.length)===a)?(f="must not be",t=t.replace(/^not /,"")):f="must be",function(l,v,w){return(w===void 0||w>l.length)&&(w=l.length),l.substring(w-v.length,w)===v}(e," argument")?d=`The ${e} ${f} ${OZ(t,"type")}`:d=`The "${e}" ${function(l,v,w){return typeof w!="number"&&(w=0),!(w+v.length>l.length)&&l.indexOf(v,w)!==-1}(e,".")?"property":"argument"} ${f} ${OZ(t,"type")}`,d+=`. Received type ${typeof n}`,d},TypeError),As("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),As("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),As("ERR_STREAM_PREMATURE_CLOSE","Premature close"),As("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),As("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),As("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),As("ERR_STREAM_WRITE_AFTER_END","write after end"),As("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),As("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),As("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Uf.codes=LX;DX=function(){throw new Error("Readable.from is not available in the browser")},Bx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;$X=function(e,t){if(rS("noDeprecation"))return e;var n=!1;return function(){if(!n){if(rS("throwDeprecation"))throw new Error(t);rS("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this||Bx,arguments)}};vb=Dr.Buffer,Ox=Yt.inspect,H9e=Ox&&Ox.custom||"inspect",K9e=function(){function e(){(function(f,a){if(!(f instanceof a))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,(n=[{key:"push",value:function(f){var a={data:f,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(f){var a={data:f,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(this.length===0)return"";for(var a=this.head,d=""+a.data;a=a.next;)d+=f+a.data;return d}},{key:"concat",value:function(f){if(this.length===0)return vb.alloc(0);for(var a,d,l,v=vb.allocUnsafe(f>>>0),w=this.head,m=0;w;)a=w.data,d=v,l=m,vb.prototype.copy.call(a,d,l),m+=w.data.length,w=w.next;return v}},{key:"consume",value:function(f,a){var d;return f<this.head.data.length?(d=this.head.data.slice(0,f),this.head.data=this.head.data.slice(f)):d=f===this.head.data.length?this.shift():a?this._getString(f):this._getBuffer(f),d}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(f){var a=this.head,d=1,l=a.data;for(f-=l.length;a=a.next;){var v=a.data,w=f>v.length?v.length:f;if(w===v.length?l+=v:l+=v.slice(0,f),(f-=w)==0){w===v.length?(++d,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=v.slice(w));break}++d}return this.length-=d,l}},{key:"_getBuffer",value:function(f){var a=vb.allocUnsafe(f),d=this.head,l=1;for(d.data.copy(a),f-=d.data.length;d=d.next;){var v=d.data,w=f>v.length?v.length:f;if(v.copy(a,a.length-f,0,w),(f-=w)==0){w===v.length?(++l,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=v.slice(w));break}++l}return this.length-=l,a}},{key:H9e,value:function(f,a){return Ox(this,function(d){for(var l=1;l<arguments.length;l++){var v=arguments[l]!=null?arguments[l]:{};l%2?PZ(Object(v),!0).forEach(function(w){F9e(d,w,v[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(v)):PZ(Object(v)).forEach(function(w){Object.defineProperty(d,w,Object.getOwnPropertyDescriptor(v,w))})}return d}({},a,{depth:0,customInspect:!1}))}}])&&z9e(t.prototype,n),e}(),C0=Cr;UX={destroy:function(e,t){var n=this,f=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return f||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,C0.nextTick(Px,this,e)):C0.nextTick(Px,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(d){!t&&d?n._writableState?n._writableState.errorEmitted?C0.nextTick(Xb,n):(n._writableState.errorEmitted=!0,C0.nextTick(NZ,n,d)):C0.nextTick(NZ,n,d):t?(C0.nextTick(Xb,n),t(d)):C0.nextTick(Xb,n)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,f=e._writableState;n&&n.autoDestroy||f&&f.autoDestroy?e.destroy(t):e.emit("error",t)}},Z9e=Uf.codes.ERR_INVALID_OPT_VALUE,qX={getHighWaterMark:function(e,t,n,f){var a=function(d,l,v){return d.highWaterMark!=null?d.highWaterMark:l?d[v]:null}(t,f,n);if(a!=null){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new Z9e(f?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}},CZ=Uf.codes.ERR_STREAM_PREMATURE_CLOSE;V9e=function e(t,n,f){if(typeof n=="function")return e(t,null,n);n||(n={}),f=function(A){var T=!1;return function(){if(!T){T=!0;for(var I=arguments.length,B=new Array(I),P=0;P<I;P++)B[P]=arguments[P];A.apply(this,B)}}}(f||W9e);var a=n.readable||n.readable!==!1&&t.readable,d=n.writable||n.writable!==!1&&t.writable,l=function(){t.writable||w()},v=t._writableState&&t._writableState.finished,w=function(){d=!1,v=!0,a||f.call(t)},m=t._readableState&&t._readableState.endEmitted,y=function(){a=!1,m=!0,d||f.call(t)},g=function(A){f.call(t,A)},S=function(){var A;return a&&!m?(t._readableState&&t._readableState.ended||(A=new CZ),f.call(t,A)):d&&!v?(t._writableState&&t._writableState.ended||(A=new CZ),f.call(t,A)):void 0},x=function(){t.req.on("finish",w)};return function(A){return A.setHeader&&typeof A.abort=="function"}(t)?(t.on("complete",w),t.on("abort",S),t.req?x():t.on("request",x)):d&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",y),t.on("finish",w),n.error!==!1&&t.on("error",g),t.on("close",S),function(){t.removeListener("complete",w),t.removeListener("abort",S),t.removeListener("request",x),t.req&&t.req.removeListener("finish",w),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",w),t.removeListener("end",y),t.removeListener("error",g),t.removeListener("close",S)}},jX=Cr;G9e=V9e,Ml=Symbol("lastResolve"),V0=Symbol("lastReject"),A2=Symbol("error"),y3=Symbol("ended"),rc=Symbol("lastPromise"),Nx=Symbol("handlePromise"),ic=Symbol("stream");X9e=Object.getPrototypeOf(function(){}),Q9e=Object.setPrototypeOf((_l(iS={get stream(){return this[ic]},next:function(){var e=this,t=this[A2];if(t!==null)return Promise.reject(t);if(this[y3])return Promise.resolve(Tl(void 0,!0));if(this[ic].destroyed)return new Promise(function(d,l){jX.nextTick(function(){e[A2]?l(e[A2]):d(Tl(void 0,!0))})});var n,f=this[rc];if(f)n=new Promise(function(d,l){return function(v,w){d.then(function(){if(l[y3])return v(Tl(void 0,!0)),void 0;l[Nx](v,w)},w)}}(f,this));else{var a=this[ic].read();if(a!==null)return Promise.resolve(Tl(a,!1));n=new Promise(this[Nx])}return this[rc]=n,n}},Symbol.asyncIterator,function(){return this}),_l(iS,"return",function(){var e=this;return new Promise(function(t,n){e[ic].destroy(null,function(f){if(f)return n(f),void 0;t(Tl(void 0,!0))})})}),iS),X9e),e_e=function(e){var t,n=Object.create(Q9e,(_l(t={},ic,{value:e,writable:!0}),_l(t,Ml,{value:null,writable:!0}),_l(t,V0,{value:null,writable:!0}),_l(t,A2,{value:null,writable:!0}),_l(t,y3,{value:e._readableState.endEmitted,writable:!0}),_l(t,Nx,{value:function(f,a){var d=n[ic].read();d?(n[rc]=null,n[Ml]=null,n[V0]=null,f(Tl(d,!1))):(n[Ml]=f,n[V0]=a)},writable:!0}),t));return n[rc]=null,G9e(e,function(f){if(f&&f.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[V0];return a!==null&&(n[rc]=null,n[Ml]=null,n[V0]=null,a(f)),n[A2]=f,void 0}var d=n[Ml];d!==null&&(n[rc]=null,n[Ml]=null,n[V0]=null,d(Tl(void 0,!0))),n[y3]=!0}),e.on("readable",J9e.bind(null,n)),n},nS={},LZ=!1,t_e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;aS={},DZ=!1,r_e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;oS={},$Z=!1;n_e=FX(),UZ=Uf.codes.ERR_STREAM_PREMATURE_CLOSE;gR=function e(t,n,f){if(typeof n=="function")return e(t,null,n);n||(n={}),f=function(A){var T=!1;return function(){if(!T){T=!0;for(var I=arguments.length,B=new Array(I),P=0;P<I;P++)B[P]=arguments[P];A.apply(this,B)}}}(f||a_e);var a=n.readable||n.readable!==!1&&t.readable,d=n.writable||n.writable!==!1&&t.writable,l=function(){t.writable||w()},v=t._writableState&&t._writableState.finished,w=function(){d=!1,v=!0,a||f.call(t)},m=t._readableState&&t._readableState.endEmitted,y=function(){a=!1,m=!0,d||f.call(t)},g=function(A){f.call(t,A)},S=function(){var A;return a&&!m?(t._readableState&&t._readableState.ended||(A=new UZ),f.call(t,A)):d&&!v?(t._writableState&&t._writableState.ended||(A=new UZ),f.call(t,A)):void 0},x=function(){t.req.on("finish",w)};return function(A){return A.setHeader&&typeof A.abort=="function"}(t)?(t.on("complete",w),t.on("abort",S),t.req?x():t.on("request",x)):d&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",y),t.on("finish",w),n.error!==!1&&t.on("error",g),t.on("close",S),function(){t.removeListener("complete",w),t.removeListener("abort",S),t.removeListener("request",x),t.req&&t.req.removeListener("finish",w),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",w),t.removeListener("end",y),t.removeListener("error",g),t.removeListener("close",S)}};mb=Dr.Buffer,Cx=Yt.inspect,f_e=Cx&&Cx.custom||"inspect",u_e=function(){function e(){(function(f,a){if(!(f instanceof a))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,(n=[{key:"push",value:function(f){var a={data:f,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(f){var a={data:f,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(this.length===0)return"";for(var a=this.head,d=""+a.data;a=a.next;)d+=f+a.data;return d}},{key:"concat",value:function(f){if(this.length===0)return mb.alloc(0);for(var a,d,l,v=mb.allocUnsafe(f>>>0),w=this.head,m=0;w;)a=w.data,d=v,l=m,mb.prototype.copy.call(a,d,l),m+=w.data.length,w=w.next;return v}},{key:"consume",value:function(f,a){var d;return f<this.head.data.length?(d=this.head.data.slice(0,f),this.head.data=this.head.data.slice(f)):d=f===this.head.data.length?this.shift():a?this._getString(f):this._getBuffer(f),d}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(f){var a=this.head,d=1,l=a.data;for(f-=l.length;a=a.next;){var v=a.data,w=f>v.length?v.length:f;if(w===v.length?l+=v:l+=v.slice(0,f),(f-=w)==0){w===v.length?(++d,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=v.slice(w));break}++d}return this.length-=d,l}},{key:"_getBuffer",value:function(f){var a=mb.allocUnsafe(f),d=this.head,l=1;for(d.data.copy(a),f-=d.data.length;d=d.next;){var v=d.data,w=f>v.length?v.length:f;if(v.copy(a,a.length-f,0,w),(f-=w)==0){w===v.length?(++l,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=v.slice(w));break}++l}return this.length-=l,a}},{key:f_e,value:function(f,a){return Cx(this,function(d){for(var l=1;l<arguments.length;l++){var v=arguments[l]!=null?arguments[l]:{};l%2?qZ(Object(v),!0).forEach(function(w){o_e(d,w,v[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(v)):qZ(Object(v)).forEach(function(w){Object.defineProperty(d,w,Object.getOwnPropertyDescriptor(v,w))})}return d}({},a,{depth:0,customInspect:!1}))}}])&&s_e(t.prototype,n),e}(),L0=Cr;zX={destroy:function(e,t){var n=this,f=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return f||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,L0.nextTick(Lx,this,e)):L0.nextTick(Lx,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(d){!t&&d?n._writableState?n._writableState.errorEmitted?L0.nextTick(Qb,n):(n._writableState.errorEmitted=!0,L0.nextTick(jZ,n,d)):L0.nextTick(jZ,n,d):t?(L0.nextTick(Qb,n),t(d)):L0.nextTick(Qb,n)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,f=e._writableState;n&&n.autoDestroy||f&&f.autoDestroy?e.destroy(t):e.emit("error",t)}},h_e=Uf.codes.ERR_INVALID_OPT_VALUE,HX={getHighWaterMark:function(e,t,n,f){var a=function(d,l,v){return d.highWaterMark!=null?d.highWaterMark:l?d[v]:null}(t,f,n);if(a!=null){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new h_e(f?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}},KX=Cr;l_e=gR,El=Symbol("lastResolve"),G0=Symbol("lastReject"),x2=Symbol("error"),b3=Symbol("ended"),nc=Symbol("lastPromise"),Dx=Symbol("handlePromise"),ac=Symbol("stream");p_e=Object.getPrototypeOf(function(){}),v_e=Object.setPrototypeOf((Sl(sS={get stream(){return this[ac]},next:function(){var e=this,t=this[x2];if(t!==null)return Promise.reject(t);if(this[b3])return Promise.resolve(Il(void 0,!0));if(this[ac].destroyed)return new Promise(function(d,l){KX.nextTick(function(){e[x2]?l(e[x2]):d(Il(void 0,!0))})});var n,f=this[nc];if(f)n=new Promise(function(d,l){return function(v,w){d.then(function(){if(l[b3])return v(Il(void 0,!0)),void 0;l[Dx](v,w)},w)}}(f,this));else{var a=this[ac].read();if(a!==null)return Promise.resolve(Il(a,!1));n=new Promise(this[Dx])}return this[nc]=n,n}},Symbol.asyncIterator,function(){return this}),Sl(sS,"return",function(){var e=this;return new Promise(function(t,n){e[ac].destroy(null,function(f){if(f)return n(f),void 0;t(Il(void 0,!0))})})}),sS),p_e),m_e=function(e){var t,n=Object.create(v_e,(Sl(t={},ac,{value:e,writable:!0}),Sl(t,El,{value:null,writable:!0}),Sl(t,G0,{value:null,writable:!0}),Sl(t,x2,{value:null,writable:!0}),Sl(t,b3,{value:e._readableState.endEmitted,writable:!0}),Sl(t,Dx,{value:function(f,a){var d=n[ac].read();d?(n[nc]=null,n[El]=null,n[G0]=null,f(Il(d,!1))):(n[El]=f,n[G0]=a)},writable:!0}),t));return n[nc]=null,l_e(e,function(f){if(f&&f.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[G0];return a!==null&&(n[nc]=null,n[El]=null,n[G0]=null,a(f)),n[x2]=f,void 0}var d=n[El];d!==null&&(n[nc]=null,n[El]=null,n[G0]=null,d(Il(void 0,!0))),n[b3]=!0}),e.on("readable",d_e.bind(null,n)),n},fS={},FZ=!1,g_e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;uS={},zZ=!1,b_e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;hS={},HZ=!1;w_e=ZX(),WX=B2();VX=gh;C3=Uf.codes,__e=C3.ERR_METHOD_NOT_IMPLEMENTED,M_e=C3.ERR_MULTIPLE_CALLBACK,S_e=C3.ERR_TRANSFORM_ALREADY_TRANSFORMING,E_e=C3.ERR_TRANSFORM_WITH_LENGTH_0,e3=WX;Vr(gh,e3),gh.prototype.push=function(e,t){return this._transformState.needTransform=!1,e3.prototype.push.call(this,e,t)},gh.prototype._transform=function(e,t,n){n(new __e("_transform()"))},gh.prototype._write=function(e,t,n){var f=this._transformState;if(f.writecb=n,f.writechunk=e,f.writeencoding=t,!f.transforming){var a=this._readableState;(f.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}},gh.prototype._read=function(e){var t=this._transformState;t.writechunk===null||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},gh.prototype._destroy=function(e,t){e3.prototype._destroy.call(this,e,function(n){t(n)})};GX=VX;YX=O2;JX=GX;Vr(O2,JX),O2.prototype._transform=function(e,t,n){n(null,e)};R_e=YX,XX=Uf.codes,k_e=XX.ERR_MISSING_ARGS,T_e=XX.ERR_STREAM_DESTROYED;P_e=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var f,a=O_e(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new k_e("streams");var d=t.map(function(l,v){var w=v<t.length-1;return I_e(l,w,v>0,function(m){f||(f=m),m&&d.forEach(WZ),w||(d.forEach(WZ),a(f))})});return t.reduce(B_e)},$x=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;QX=Ls;Ux=Gi.EventEmitter;Vr(Ls,Ux),Ls.Readable=n_e,Ls.Writable=w_e,Ls.Duplex=WX,Ls.Transform=GX,Ls.PassThrough=R_e,Ls.finished=gR,Ls.pipeline=P_e,Ls.Stream=Ls,Ls.prototype.pipe=function(e,t){var n=this||$x;function f(y){e.writable&&e.write(y)===!1&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",f),e.on("drain",a),e._isStdio||t&&t.end===!1||(n.on("end",l),n.on("close",v));var d=!1;function l(){d||(d=!0,e.end())}function v(){d||(d=!0,typeof e.destroy=="function"&&e.destroy())}function w(y){if(m(),Ux.listenerCount(this||$x,"error")===0)throw y}function m(){n.removeListener("data",f),e.removeListener("drain",a),n.removeListener("end",l),n.removeListener("close",v),n.removeListener("error",w),e.removeListener("error",w),n.removeListener("end",m),n.removeListener("close",m),e.removeListener("close",m)}return n.on("error",w),e.on("error",w),n.on("end",m),n.on("close",m),e.on("close",m),e.emit("pipe",n),e};qs=QX;qs.Readable;qs.Writable;qs.Duplex;qs.Transform;qs.PassThrough;qs.finished;qs.pipeline;qs.Stream;cS={},VZ=!1,Pn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;dS={},GZ=!1;pS={},YZ=!1;vS={},JZ=!1;mS={},XZ=!1;rQ={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}},gS={},QZ=!1;yS={},eW=!1;bS={},tW=!1,gb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;wS={},rW=!1;_S={},iW=!1,xf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;MS={},nW=!1,Uo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;yb={},aW=!1;qo={},oW=!1;SS={},sW=!1;ES={},fW=!1;AS={},uW=!1;xS={},hW=!1;RS={},lW=!1;D0={},cW=!1;kS={},dW=!1,bb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;wb={},pW=!1;TS={},vW=!1;_b={},mW=!1;IS={},gW=!1;BS={},yW=!1;OS={},bW=!1;PS={},wW=!1;NS={},_W=!1;CS={},MW=!1;lQ={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},LS={},EW=!1;DS={},AW=!1,xs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;$S={},xW=!1,La=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;US={},RW=!1,ei=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;qS={},kW=!1,Rf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;jS={},TW=!1;Mb={},IW=!1,vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Sb={},BW=!1,zi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Rs={},OW=!1;mu={},PW=!1;ks={},NW=!1;pQ={},CW=!1,FS={exports:pQ},He=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;mQ={},LW=!1,zS={exports:mQ},Ke=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;_3=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,So={},Q_e=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1},Jd=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e)t.push(n);return t},$0=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)},eMe=function(){try{return Object.defineProperty({},"_",{}),function(e,t,n){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:n})}}catch{return function(t,n,f){t[n]=f}}}(),DW=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];t3.prototype={};wu=So.Script=function(e){if(!((this||_3)instanceof wu))return new wu(e);(this||_3).code=e};wu.prototype.runInContext=function(e){if(!(e instanceof t3))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var n=t.contentWindow,f=n.eval,a=n.execScript;!f&&a&&(a.call(n,"null"),f=n.eval),$0(Jd(e),function(v){n[v]=e[v]}),$0(DW,function(v){e[v]&&(n[v]=e[v])});var d=Jd(n),l=f.call(n,(this||_3).code);return $0(Jd(n),function(v){(v in e||Q_e(d,v)===-1)&&(e[v]=n[v])}),$0(DW,function(v){v in e||eMe(e,v,n[v])}),document.body.removeChild(t),l},wu.prototype.runInThisContext=function(){return eval((this||_3).code)},wu.prototype.runInNewContext=function(e){var t=wu.createContext(e),n=this.runInContext(t);return e&&$0(Jd(t),function(f){e[f]=t[f]}),n},$0(Jd(wu.prototype),function(e){So[e]=wu[e]=function(t){var n=wu(t);return n[e].apply(n,[].slice.call(arguments,1))}}),So.isContext=function(e){return e instanceof t3},So.createScript=function(e){return So.Script(e)},So.createContext=wu.createContext=function(e){var t=new t3;return typeof e=="object"&&$0(Jd(e),function(n){t[n]=e[n]}),t};So.Script;So.createContext;So.createScript;So.isContext;So.runInContext;So.runInNewContext;So.runInThisContext;$W=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,tMe=Cr,rMe=Si.Buffer,Eb=$W.crypto||$W.msCrypto,w1=Eb&&Eb.getRandomValues?function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var n=rMe.allocUnsafe(e);if(e>0)if(e>65536)for(var f=0;f<e;f+=65536)Eb.getRandomValues(n.slice(f,f+65536));else Eb.getRandomValues(n);return typeof t=="function"?tMe.nextTick(function(){t(null,n)}):n}:function(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
136
136
|
Use Chrome, Firefox or Internet Explorer 11`)},r3=Si.Buffer,gQ=qs.Transform;Vr(ml,gQ),ml.prototype._transform=function(e,t,n){var f=null;try{this.update(e,t)}catch(a){f=a}n(f)},ml.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(n){t=n}e(t)},ml.prototype.update=function(e,t){if(function(v,w){if(!r3.isBuffer(v)&&typeof v!="string")throw new TypeError(w+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");r3.isBuffer(e)||(e=r3.from(e,t));for(var n=this._block,f=0;this._blockOffset+e.length-f>=this._blockSize;){for(var a=this._blockOffset;a<this._blockSize;)n[a++]=e[f++];this._update(),this._blockOffset=0}for(;f<e.length;)n[this._blockOffset++]=e[f++];for(var d=0,l=8*e.length;l>0;++d)this._length[d]+=l,(l=this._length[d]/4294967296|0)>0&&(this._length[d]-=4294967296*l);return this},ml.prototype._update=function(){throw new Error("_update is not implemented")},ml.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},ml.prototype._digest=function(){throw new Error("_digest is not implemented")};yQ=ml,iMe=Vr,bQ=yQ,nMe=Si.Buffer,aMe=new Array(16);iMe(i3,bQ),i3.prototype._update=function(){for(var e=aMe,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,f=this._b,a=this._c,d=this._d;n=Da(n,f,a,d,e[0],3614090360,7),d=Da(d,n,f,a,e[1],3905402710,12),a=Da(a,d,n,f,e[2],606105819,17),f=Da(f,a,d,n,e[3],3250441966,22),n=Da(n,f,a,d,e[4],4118548399,7),d=Da(d,n,f,a,e[5],1200080426,12),a=Da(a,d,n,f,e[6],2821735955,17),f=Da(f,a,d,n,e[7],4249261313,22),n=Da(n,f,a,d,e[8],1770035416,7),d=Da(d,n,f,a,e[9],2336552879,12),a=Da(a,d,n,f,e[10],4294925233,17),f=Da(f,a,d,n,e[11],2304563134,22),n=Da(n,f,a,d,e[12],1804603682,7),d=Da(d,n,f,a,e[13],4254626195,12),a=Da(a,d,n,f,e[14],2792965006,17),n=$a(n,f=Da(f,a,d,n,e[15],1236535329,22),a,d,e[1],4129170786,5),d=$a(d,n,f,a,e[6],3225465664,9),a=$a(a,d,n,f,e[11],643717713,14),f=$a(f,a,d,n,e[0],3921069994,20),n=$a(n,f,a,d,e[5],3593408605,5),d=$a(d,n,f,a,e[10],38016083,9),a=$a(a,d,n,f,e[15],3634488961,14),f=$a(f,a,d,n,e[4],3889429448,20),n=$a(n,f,a,d,e[9],568446438,5),d=$a(d,n,f,a,e[14],3275163606,9),a=$a(a,d,n,f,e[3],4107603335,14),f=$a(f,a,d,n,e[8],1163531501,20),n=$a(n,f,a,d,e[13],2850285829,5),d=$a(d,n,f,a,e[2],4243563512,9),a=$a(a,d,n,f,e[7],1735328473,14),n=Ua(n,f=$a(f,a,d,n,e[12],2368359562,20),a,d,e[5],4294588738,4),d=Ua(d,n,f,a,e[8],2272392833,11),a=Ua(a,d,n,f,e[11],1839030562,16),f=Ua(f,a,d,n,e[14],4259657740,23),n=Ua(n,f,a,d,e[1],2763975236,4),d=Ua(d,n,f,a,e[4],1272893353,11),a=Ua(a,d,n,f,e[7],4139469664,16),f=Ua(f,a,d,n,e[10],3200236656,23),n=Ua(n,f,a,d,e[13],681279174,4),d=Ua(d,n,f,a,e[0],3936430074,11),a=Ua(a,d,n,f,e[3],3572445317,16),f=Ua(f,a,d,n,e[6],76029189,23),n=Ua(n,f,a,d,e[9],3654602809,4),d=Ua(d,n,f,a,e[12],3873151461,11),a=Ua(a,d,n,f,e[15],530742520,16),n=qa(n,f=Ua(f,a,d,n,e[2],3299628645,23),a,d,e[0],4096336452,6),d=qa(d,n,f,a,e[7],1126891415,10),a=qa(a,d,n,f,e[14],2878612391,15),f=qa(f,a,d,n,e[5],4237533241,21),n=qa(n,f,a,d,e[12],1700485571,6),d=qa(d,n,f,a,e[3],2399980690,10),a=qa(a,d,n,f,e[10],4293915773,15),f=qa(f,a,d,n,e[1],2240044497,21),n=qa(n,f,a,d,e[8],1873313359,6),d=qa(d,n,f,a,e[15],4264355552,10),a=qa(a,d,n,f,e[6],2734768916,15),f=qa(f,a,d,n,e[13],1309151649,21),n=qa(n,f,a,d,e[4],4149444226,6),d=qa(d,n,f,a,e[11],3174756917,10),a=qa(a,d,n,f,e[2],718787259,15),f=qa(f,a,d,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+f|0,this._c=this._c+a|0,this._d=this._d+d|0},i3.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=nMe.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};_R=i3,HS=Dr.Buffer,oMe=Vr,wQ=yQ,sMe=new Array(16),Qv=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],e2=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],t2=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],r2=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],i2=[0,1518500249,1859775393,2400959708,2840853838],n2=[1352829926,1548603684,1836072691,2053994217,0];oMe(n3,wQ),n3.prototype._update=function(){for(var e=sMe,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,f=0|this._b,a=0|this._c,d=0|this._d,l=0|this._e,v=0|this._a,w=0|this._b,m=0|this._c,y=0|this._d,g=0|this._e,S=0;S<80;S+=1){var x,A;S<16?(x=UW(n,f,a,d,l,e[Qv[S]],i2[0],t2[S]),A=zW(v,w,m,y,g,e[e2[S]],n2[0],r2[S])):S<32?(x=qW(n,f,a,d,l,e[Qv[S]],i2[1],t2[S]),A=FW(v,w,m,y,g,e[e2[S]],n2[1],r2[S])):S<48?(x=jW(n,f,a,d,l,e[Qv[S]],i2[2],t2[S]),A=jW(v,w,m,y,g,e[e2[S]],n2[2],r2[S])):S<64?(x=FW(n,f,a,d,l,e[Qv[S]],i2[3],t2[S]),A=qW(v,w,m,y,g,e[e2[S]],n2[3],r2[S])):(x=zW(n,f,a,d,l,e[Qv[S]],i2[4],t2[S]),A=UW(v,w,m,y,g,e[e2[S]],n2[4],r2[S])),n=l,l=d,d=lc(a,10),a=f,f=x,v=g,g=y,y=lc(m,10),m=w,w=A}var T=this._b+a+y|0;this._b=this._c+d+g|0,this._c=this._d+l+v|0,this._d=this._e+n+w|0,this._e=this._a+f+m|0,this._a=T},n3.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=HS.alloc?HS.alloc(20):new HS(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};MR=n3,An=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,_Q=Si.Buffer;a3.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=_Q.from(e,t));for(var n=(this||An)._block,f=(this||An)._blockSize,a=e.length,d=(this||An)._len,l=0;l<a;){for(var v=d%f,w=Math.min(a-l,f-v),m=0;m<w;m++)n[v+m]=e[l+m];l+=w,(d+=w)%f==0&&this._update(n)}return(this||An)._len+=a,this||An},a3.prototype.digest=function(e){var t=(this||An)._len%(this||An)._blockSize;(this||An)._block[t]=128,(this||An)._block.fill(0,t+1),t>=(this||An)._finalSize&&(this._update((this||An)._block),(this||An)._block.fill(0));var n=8*(this||An)._len;if(n<=4294967295)(this||An)._block.writeUInt32BE(n,(this||An)._blockSize-4);else{var f=(4294967295&n)>>>0,a=(n-f)/4294967296;(this||An)._block.writeUInt32BE(a,(this||An)._blockSize-8),(this||An)._block.writeUInt32BE(f,(this||An)._blockSize-4)}this._update((this||An)._block);var d=this._hash();return e?d.toString(e):d},a3.prototype._update=function(){throw new Error("_update must be implemented by subclass")};_1=a3,ti=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,fMe=Vr,MQ=_1,uMe=Si.Buffer,hMe=[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],lMe=new Array(64);fMe(d2,MQ),d2.prototype.init=function(){return(this||ti)._a=1779033703,(this||ti)._b=3144134277,(this||ti)._c=1013904242,(this||ti)._d=2773480762,(this||ti)._e=1359893119,(this||ti)._f=2600822924,(this||ti)._g=528734635,(this||ti)._h=1541459225,this||ti},d2.prototype._update=function(e){for(var t,n=(this||ti)._w,f=0|(this||ti)._a,a=0|(this||ti)._b,d=0|(this||ti)._c,l=0|(this||ti)._d,v=0|(this||ti)._e,w=0|(this||ti)._f,m=0|(this||ti)._g,y=0|(this||ti)._h,g=0;g<16;++g)n[g]=e.readInt32BE(4*g);for(;g<64;++g)n[g]=0|(((t=n[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[g-7]+mMe(n[g-15])+n[g-16];for(var S=0;S<64;++S){var x=y+vMe(v)+cMe(v,w,m)+hMe[S]+n[S]|0,A=pMe(f)+dMe(f,a,d)|0;y=m,m=w,w=v,v=l+x|0,l=d,d=a,a=f,f=x+A|0}(this||ti)._a=f+(this||ti)._a|0,(this||ti)._b=a+(this||ti)._b|0,(this||ti)._c=d+(this||ti)._c|0,(this||ti)._d=l+(this||ti)._d|0,(this||ti)._e=v+(this||ti)._e|0,(this||ti)._f=w+(this||ti)._f|0,(this||ti)._g=m+(this||ti)._g|0,(this||ti)._h=y+(this||ti)._h|0},d2.prototype._hash=function(){var e=uMe.allocUnsafe(32);return e.writeInt32BE((this||ti)._a,0),e.writeInt32BE((this||ti)._b,4),e.writeInt32BE((this||ti)._c,8),e.writeInt32BE((this||ti)._d,12),e.writeInt32BE((this||ti)._e,16),e.writeInt32BE((this||ti)._f,20),e.writeInt32BE((this||ti)._g,24),e.writeInt32BE((this||ti)._h,28),e};SQ=d2,en=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,gMe=Vr,EQ=_1,yMe=Si.Buffer,bMe=[1518500249,1859775393,-1894007588,-899497514],wMe=new Array(80);gMe(p2,EQ),p2.prototype.init=function(){return(this||en)._a=1732584193,(this||en)._b=4023233417,(this||en)._c=2562383102,(this||en)._d=271733878,(this||en)._e=3285377520,this||en},p2.prototype._update=function(e){for(var t,n=(this||en)._w,f=0|(this||en)._a,a=0|(this||en)._b,d=0|(this||en)._c,l=0|(this||en)._d,v=0|(this||en)._e,w=0;w<16;++w)n[w]=e.readInt32BE(4*w);for(;w<80;++w)n[w]=n[w-3]^n[w-8]^n[w-14]^n[w-16];for(var m=0;m<80;++m){var y=~~(m/20),g=0|((t=f)<<5|t>>>27)+MMe(y,a,d,l)+v+n[m]+bMe[y];v=l,l=d,d=_Me(a),a=f,f=g}(this||en)._a=f+(this||en)._a|0,(this||en)._b=a+(this||en)._b|0,(this||en)._c=d+(this||en)._c|0,(this||en)._d=l+(this||en)._d|0,(this||en)._e=v+(this||en)._e|0},p2.prototype._hash=function(){var e=yMe.allocUnsafe(20);return e.writeInt32BE(0|(this||en)._a,0),e.writeInt32BE(0|(this||en)._b,4),e.writeInt32BE(0|(this||en)._c,8),e.writeInt32BE(0|(this||en)._d,12),e.writeInt32BE(0|(this||en)._e,16),e};SMe=p2,tn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,EMe=Vr,AQ=_1,AMe=Si.Buffer,xMe=[1518500249,1859775393,-1894007588,-899497514],RMe=new Array(80);EMe(v2,AQ),v2.prototype.init=function(){return(this||tn)._a=1732584193,(this||tn)._b=4023233417,(this||tn)._c=2562383102,(this||tn)._d=271733878,(this||tn)._e=3285377520,this||tn},v2.prototype._update=function(e){for(var t,n=(this||tn)._w,f=0|(this||tn)._a,a=0|(this||tn)._b,d=0|(this||tn)._c,l=0|(this||tn)._d,v=0|(this||tn)._e,w=0;w<16;++w)n[w]=e.readInt32BE(4*w);for(;w<80;++w)n[w]=(t=n[w-3]^n[w-8]^n[w-14]^n[w-16])<<1|t>>>31;for(var m=0;m<80;++m){var y=~~(m/20),g=kMe(f)+IMe(y,a,d,l)+v+n[m]+xMe[y]|0;v=l,l=d,d=TMe(a),a=f,f=g}(this||tn)._a=f+(this||tn)._a|0,(this||tn)._b=a+(this||tn)._b|0,(this||tn)._c=d+(this||tn)._c|0,(this||tn)._d=l+(this||tn)._d|0,(this||tn)._e=v+(this||tn)._e|0},v2.prototype._hash=function(){var e=AMe.allocUnsafe(20);return e.writeInt32BE(0|(this||tn)._a,0),e.writeInt32BE(0|(this||tn)._b,4),e.writeInt32BE(0|(this||tn)._c,8),e.writeInt32BE(0|(this||tn)._d,12),e.writeInt32BE(0|(this||tn)._e,16),e};BMe=v2,Ma=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,OMe=Vr,PMe=SQ,NMe=_1,CMe=Si.Buffer,LMe=new Array(64);OMe(o3,PMe),o3.prototype.init=function(){return(this||Ma)._a=3238371032,(this||Ma)._b=914150663,(this||Ma)._c=812702999,(this||Ma)._d=4144912697,(this||Ma)._e=4290775857,(this||Ma)._f=1750603025,(this||Ma)._g=1694076839,(this||Ma)._h=3204075428,this||Ma},o3.prototype._hash=function(){var e=CMe.allocUnsafe(28);return e.writeInt32BE((this||Ma)._a,0),e.writeInt32BE((this||Ma)._b,4),e.writeInt32BE((this||Ma)._c,8),e.writeInt32BE((this||Ma)._d,12),e.writeInt32BE((this||Ma)._e,16),e.writeInt32BE((this||Ma)._f,20),e.writeInt32BE((this||Ma)._g,24),e};DMe=o3,yr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,$Me=Vr,xQ=_1,UMe=Si.Buffer,HW=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],qMe=new Array(160);$Me(m2,xQ),m2.prototype.init=function(){return(this||yr)._ah=1779033703,(this||yr)._bh=3144134277,(this||yr)._ch=1013904242,(this||yr)._dh=2773480762,(this||yr)._eh=1359893119,(this||yr)._fh=2600822924,(this||yr)._gh=528734635,(this||yr)._hh=1541459225,(this||yr)._al=4089235720,(this||yr)._bl=2227873595,(this||yr)._cl=4271175723,(this||yr)._dl=1595750129,(this||yr)._el=2917565137,(this||yr)._fl=725511199,(this||yr)._gl=4215389547,(this||yr)._hl=327033209,this||yr},m2.prototype._update=function(e){for(var t=(this||yr)._w,n=0|(this||yr)._ah,f=0|(this||yr)._bh,a=0|(this||yr)._ch,d=0|(this||yr)._dh,l=0|(this||yr)._eh,v=0|(this||yr)._fh,w=0|(this||yr)._gh,m=0|(this||yr)._hh,y=0|(this||yr)._al,g=0|(this||yr)._bl,S=0|(this||yr)._cl,x=0|(this||yr)._dl,A=0|(this||yr)._el,T=0|(this||yr)._fl,I=0|(this||yr)._gl,B=0|(this||yr)._hl,P=0;P<32;P+=2)t[P]=e.readInt32BE(4*P),t[P+1]=e.readInt32BE(4*P+4);for(;P<160;P+=2){var C=t[P-30],q=t[P-30+1],K=jMe(C,q),G=FMe(q,C),j=zMe(C=t[P-4],q=t[P-4+1]),z=HMe(q,C),J=t[P-14],E=t[P-14+1],i=t[P-32],s=t[P-32+1],u=G+E|0,c=K+J+ya(u,G)|0;c=(c=c+j+ya(u=u+z|0,z)|0)+i+ya(u=u+s|0,s)|0,t[P]=c,t[P+1]=u}for(var p=0;p<160;p+=2){c=t[p],u=t[p+1];var _=ZW(n,f,a),R=ZW(y,g,S),o=WW(n,y),r=WW(y,n),h=VW(l,A),b=VW(A,l),M=HW[p],k=HW[p+1],D=KW(l,v,w),Q=KW(A,T,I),W=B+b|0,X=m+h+ya(W,B)|0;X=(X=(X=X+D+ya(W=W+Q|0,Q)|0)+M+ya(W=W+k|0,k)|0)+c+ya(W=W+u|0,u)|0;var V=r+R|0,Y=o+_+ya(V,r)|0;m=w,B=I,w=v,I=T,v=l,T=A,l=d+X+ya(A=x+W|0,x)|0,d=a,x=S,a=f,S=g,f=n,g=y,n=X+Y+ya(y=W+V|0,W)|0}(this||yr)._al=(this||yr)._al+y|0,(this||yr)._bl=(this||yr)._bl+g|0,(this||yr)._cl=(this||yr)._cl+S|0,(this||yr)._dl=(this||yr)._dl+x|0,(this||yr)._el=(this||yr)._el+A|0,(this||yr)._fl=(this||yr)._fl+T|0,(this||yr)._gl=(this||yr)._gl+I|0,(this||yr)._hl=(this||yr)._hl+B|0,(this||yr)._ah=(this||yr)._ah+n+ya((this||yr)._al,y)|0,(this||yr)._bh=(this||yr)._bh+f+ya((this||yr)._bl,g)|0,(this||yr)._ch=(this||yr)._ch+a+ya((this||yr)._cl,S)|0,(this||yr)._dh=(this||yr)._dh+d+ya((this||yr)._dl,x)|0,(this||yr)._eh=(this||yr)._eh+l+ya((this||yr)._el,A)|0,(this||yr)._fh=(this||yr)._fh+v+ya((this||yr)._fl,T)|0,(this||yr)._gh=(this||yr)._gh+w+ya((this||yr)._gl,I)|0,(this||yr)._hh=(this||yr)._hh+m+ya((this||yr)._hl,B)|0},m2.prototype._hash=function(){var e=UMe.allocUnsafe(64);function t(n,f,a){e.writeInt32BE(n,a),e.writeInt32BE(f,a+4)}return t((this||yr)._ah,(this||yr)._al,0),t((this||yr)._bh,(this||yr)._bl,8),t((this||yr)._ch,(this||yr)._cl,16),t((this||yr)._dh,(this||yr)._dl,24),t((this||yr)._eh,(this||yr)._el,32),t((this||yr)._fh,(this||yr)._fl,40),t((this||yr)._gh,(this||yr)._gl,48),t((this||yr)._hh,(this||yr)._hl,56),e};RQ=m2,Hi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,KMe=Vr,ZMe=RQ,WMe=_1,VMe=Si.Buffer,GMe=new Array(160);KMe(s3,ZMe),s3.prototype.init=function(){return(this||Hi)._ah=3418070365,(this||Hi)._bh=1654270250,(this||Hi)._ch=2438529370,(this||Hi)._dh=355462360,(this||Hi)._eh=1731405415,(this||Hi)._fh=2394180231,(this||Hi)._gh=3675008525,(this||Hi)._hh=1203062813,(this||Hi)._al=3238371032,(this||Hi)._bl=914150663,(this||Hi)._cl=812702999,(this||Hi)._dl=4144912697,(this||Hi)._el=4290775857,(this||Hi)._fl=1750603025,(this||Hi)._gl=1694076839,(this||Hi)._hl=3204075428,this||Hi},s3.prototype._hash=function(){var e=VMe.allocUnsafe(48);function t(n,f,a){e.writeInt32BE(n,a),e.writeInt32BE(f,a+4)}return t((this||Hi)._ah,(this||Hi)._al,0),t((this||Hi)._bh,(this||Hi)._bl,8),t((this||Hi)._ch,(this||Hi)._cl,16),t((this||Hi)._dh,(this||Hi)._dl,24),t((this||Hi)._eh,(this||Hi)._el,32),t((this||Hi)._fh,(this||Hi)._fl,40),e};YMe=s3,kQ={exports:gl={}};(gl=kQ.exports=function(e){e=e.toLowerCase();var t=gl[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=SMe,gl.sha1=BMe,gl.sha224=DMe,gl.sha256=SQ,gl.sha384=YMe,gl.sha512=RQ;SR=kQ.exports,Dn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,GW=Si.Buffer,TQ=qs.Transform,JMe=Wn.StringDecoder;Vr(Bf,TQ),Bf.prototype.update=function(e,t,n){typeof e=="string"&&(e=GW.from(e,t));var f=this._update(e);return(this||Dn).hashMode?this||Dn:(n&&(f=this._toString(f,n)),f)},Bf.prototype.setAutoPadding=function(){},Bf.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},Bf.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},Bf.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},Bf.prototype._transform=function(e,t,n){var f;try{(this||Dn).hashMode?this._update(e):this.push(this._update(e))}catch(a){f=a}finally{n(f)}},Bf.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(n){t=n}e(t)},Bf.prototype._finalOrDigest=function(e){var t=this.__final()||GW.alloc(0);return e&&(t=this._toString(t,e,!0)),t},Bf.prototype._toString=function(e,t,n){if((this||Dn)._decoder||((this||Dn)._decoder=new JMe(t),(this||Dn)._encoding=t),(this||Dn)._encoding!==t)throw new Error("can't switch encodings");var f=(this||Dn)._decoder.write(e);return n&&(f+=(this||Dn)._decoder.end()),f};Pl=Bf,XMe=_R,QMe=MR,eSe=SR,IQ=Pl;Vr(f3,IQ),f3.prototype._update=function(e){this._hash.update(e)},f3.prototype._final=function(){return this._hash.digest()};F2=function(e){return(e=e.toLowerCase())==="md5"?new XMe:e==="rmd160"||e==="ripemd160"?new QMe:new f3(eSe(e))},tSe=_R,BQ=function(e){return new tSe().update(e).digest()},rSe=Vr,oc=Si.Buffer,OQ=Pl,iSe=oc.alloc(128);rSe(u3,OQ),u3.prototype._update=function(e){this._hash.push(e)},u3.prototype._final=function(){var e=this._alg(oc.concat(this._hash));return this._alg(oc.concat([this._opad,e]))};nSe=Vr,aSe=u3,PQ=Pl,g2=Si.Buffer,oSe=BQ,qx=MR,jx=SR,sSe=g2.alloc(128);nSe(R2,PQ),R2.prototype._update=function(e){this._hash.update(e)},R2.prototype._final=function(){var e=this._hash.digest();return(this._alg==="rmd160"?new qx:jx(this._alg)).update(this._opad).update(e).digest()};NQ=function(e,t){return(e=e.toLowerCase())==="rmd160"||e==="ripemd160"?new R2("rmd160",t):e==="md5"?new aSe(oSe,t):new R2(e,t)},CQ={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}},fSe=Dr.Buffer,uSe=Math.pow(2,30)-1;LQ=function(e,t,n,f){if(YW(e,"Password"),YW(t,"Salt"),typeof n!="number")throw new TypeError("Iterations not a number");if(n<0)throw new TypeError("Bad iterations");if(typeof f!="number")throw new TypeError("Key length not a number");if(f<0||f>uSe||f!=f)throw new TypeError("Bad key length")},JW=Cr;JW.browser?Fx="utf-8":Fx=parseInt(JW.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";DQ=Fx,Nf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,hSe=BQ,lSe=MR,cSe=SR,dSe=LQ,XW=DQ,Lf=Si.Buffer,pSe=Lf.alloc(128),h3={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};$Q.prototype.run=function(e,t){return e.copy(t,(this||Nf).blocksize),this.hash(t).copy((this||Nf).opad,(this||Nf).blocksize),this.hash((this||Nf).opad)};UQ=function(e,t,n,f,a){dSe(e,t,n,f),Lf.isBuffer(e)||(e=Lf.from(e,XW)),Lf.isBuffer(t)||(t=Lf.from(t,XW));var d=new $Q(a=a||"sha1",e,t.length),l=Lf.allocUnsafe(f),v=Lf.allocUnsafe(t.length+4);t.copy(v,0,0,t.length);for(var w=0,m=h3[a],y=Math.ceil(f/m),g=1;g<=y;g++){v.writeUInt32BE(g,t.length);for(var S=d.run(v,d.ipad1),x=S,A=1;A<n;A++){x=d.run(x,d.ipad2);for(var T=0;T<m;T++)S[T]^=x[T]}S.copy(l,w),w+=m}return l},k2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,ZS=Cr,vSe=LQ,QW=DQ,eV=UQ,i1=Si.Buffer,T2=k2.crypto&&k2.crypto.subtle,mSe={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},WS=[];gSe=function(e,t,n,f,a,d){typeof a=="function"&&(d=a,a=void 0);var l=mSe[(a=a||"sha1").toLowerCase()];if(!l||typeof k2.Promise!="function")return ZS.nextTick(function(){var v;try{v=eV(e,t,n,f,a)}catch(w){return d(w)}d(null,v)});if(vSe(e,t,n,f),typeof d!="function")throw new Error("No callback provided to pbkdf2");i1.isBuffer(e)||(e=i1.from(e,QW)),i1.isBuffer(t)||(t=i1.from(t,QW)),function(v,w){v.then(function(m){ZS.nextTick(function(){w(null,m)})},function(m){ZS.nextTick(function(){w(m)})})}(function(v){if(k2.process&&!k2.process.browser||!T2||!T2.importKey||!T2.deriveBits)return Promise.resolve(!1);if(WS[v]!==void 0)return WS[v];var w=tV(KS=KS||i1.alloc(8),KS,10,128,v).then(function(){return!0}).catch(function(){return!1});return WS[v]=w,w}(l).then(function(v){return v?tV(e,t,n,f,l):eV(e,t,n,f,a)}),d)},M3={};M3.pbkdf2=gSe,M3.pbkdf2Sync=UQ;qQ=rV,rV.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};js=qQ,cc={readUInt32BE:function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},writeUInt32BE:function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},ip:function(e,t,n,f){for(var a=0,d=0,l=6;l>=0;l-=2){for(var v=0;v<=24;v+=8)a<<=1,a|=t>>>v+l&1;for(v=0;v<=24;v+=8)a<<=1,a|=e>>>v+l&1}for(l=6;l>=0;l-=2){for(v=1;v<=25;v+=8)d<<=1,d|=t>>>v+l&1;for(v=1;v<=25;v+=8)d<<=1,d|=e>>>v+l&1}n[f+0]=a>>>0,n[f+1]=d>>>0},rip:function(e,t,n,f){for(var a=0,d=0,l=0;l<4;l++)for(var v=24;v>=0;v-=8)a<<=1,a|=t>>>v+l&1,a<<=1,a|=e>>>v+l&1;for(l=4;l<8;l++)for(v=24;v>=0;v-=8)d<<=1,d|=t>>>v+l&1,d<<=1,d|=e>>>v+l&1;n[f+0]=a>>>0,n[f+1]=d>>>0},pc1:function(e,t,n,f){for(var a=0,d=0,l=7;l>=5;l--){for(var v=0;v<=24;v+=8)a<<=1,a|=t>>v+l&1;for(v=0;v<=24;v+=8)a<<=1,a|=e>>v+l&1}for(v=0;v<=24;v+=8)a<<=1,a|=t>>v+l&1;for(l=1;l<=3;l++){for(v=0;v<=24;v+=8)d<<=1,d|=t>>v+l&1;for(v=0;v<=24;v+=8)d<<=1,d|=e>>v+l&1}for(v=0;v<=24;v+=8)d<<=1,d|=e>>v+l&1;n[f+0]=a>>>0,n[f+1]=d>>>0},r28shl:function(e,t){return e<<t&268435455|e>>>28-t}},Ab=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];cc.pc2=function(e,t,n,f){for(var a=0,d=0,l=Ab.length>>>1,v=0;v<l;v++)a<<=1,a|=e>>>Ab[v]&1;for(v=l;v<Ab.length;v++)d<<=1,d|=t>>>Ab[v]&1;n[f+0]=a>>>0,n[f+1]=d>>>0},cc.expand=function(e,t,n){var f=0,a=0;f=(1&e)<<5|e>>>27;for(var d=23;d>=15;d-=4)f<<=6,f|=e>>>d&63;for(d=11;d>=3;d-=4)a|=e>>>d&63,a<<=6;a|=(31&e)<<1|e>>>31,t[n+0]=f>>>0,t[n+1]=a>>>0};iV=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];cc.substitute=function(e,t){for(var n=0,f=0;f<4;f++)n<<=4,n|=iV[64*f+(e>>>18-6*f&63)];for(f=0;f<4;f++)n<<=4,n|=iV[256+64*f+(t>>>18-6*f&63)];return n>>>0};nV=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];cc.permute=function(e){for(var t=0,n=0;n<nV.length;n++)t<<=1,t|=e>>>nV[n]&1;return t>>>0},cc.padSplit=function(e,t,n){for(var f=e.toString(2);f.length<t;)f="0"+f;for(var a=[],d=0;d<t;d+=n)a.push(f.slice(d,d+n));return a.join(" ")};ySe=js;jQ=Ts,Ts.prototype._init=function(){},Ts.prototype.update=function(e){return e.length===0?[]:this.type==="decrypt"?this._updateDecrypt(e):this._updateEncrypt(e)},Ts.prototype._buffer=function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),f=0;f<n;f++)this.buffer[this.bufferOff+f]=e[t+f];return this.bufferOff+=n,n},Ts.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},Ts.prototype._updateEncrypt=function(e){var t=0,n=0,f=(this.bufferOff+e.length)/this.blockSize|0,a=new Array(f*this.blockSize);this.bufferOff!==0&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(n+=this._flushBuffer(a,n)));for(var d=e.length-(e.length-t)%this.blockSize;t<d;t+=this.blockSize)this._update(e,t,a,n),n+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return a},Ts.prototype._updateDecrypt=function(e){for(var t=0,n=0,f=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,a=new Array(f*this.blockSize);f>0;f--)t+=this._buffer(e,t),n+=this._flushBuffer(a,n);return t+=this._buffer(e,t),a},Ts.prototype.final=function(e){var t,n;return e&&(t=this.update(e)),n=this.type==="encrypt"?this._finalEncrypt():this._finalDecrypt(),t?t.concat(n):n},Ts.prototype._pad=function(e,t){if(t===0)return!1;for(;t<e.length;)e[t++]=0;return!0},Ts.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},Ts.prototype._unpad=function(e){return e},Ts.prototype._finalDecrypt=function(){ySe.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)};ER=jQ,aV=js,ra=cc,zQ=ER;Vr(Au,zQ),FQ=Au,Au.create=function(e){return new Au(e)};wSe=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];Au.prototype.deriveKeys=function(e,t){e.keys=new Array(32),aV.equal(t.length,this.blockSize,"Invalid key length");var n=ra.readUInt32BE(t,0),f=ra.readUInt32BE(t,4);ra.pc1(n,f,e.tmp,0),n=e.tmp[0],f=e.tmp[1];for(var a=0;a<e.keys.length;a+=2){var d=wSe[a>>>1];n=ra.r28shl(n,d),f=ra.r28shl(f,d),ra.pc2(n,f,e.keys,a)}},Au.prototype._update=function(e,t,n,f){var a=this._desState,d=ra.readUInt32BE(e,t),l=ra.readUInt32BE(e,t+4);ra.ip(d,l,a.tmp,0),d=a.tmp[0],l=a.tmp[1],this.type==="encrypt"?this._encrypt(a,d,l,a.tmp,0):this._decrypt(a,d,l,a.tmp,0),d=a.tmp[0],l=a.tmp[1],ra.writeUInt32BE(n,d,f),ra.writeUInt32BE(n,l,f+4)},Au.prototype._pad=function(e,t){for(var n=e.length-t,f=t;f<e.length;f++)e[f]=n;return!0},Au.prototype._unpad=function(e){for(var t=e[e.length-1],n=e.length-t;n<e.length;n++)aV.equal(e[n],t);return e.slice(0,e.length-t)},Au.prototype._encrypt=function(e,t,n,f,a){for(var d=t,l=n,v=0;v<e.keys.length;v+=2){var w=e.keys[v],m=e.keys[v+1];ra.expand(l,e.tmp,0),w^=e.tmp[0],m^=e.tmp[1];var y=ra.substitute(w,m),g=l;l=(d^ra.permute(y))>>>0,d=g}ra.rip(l,d,f,a)},Au.prototype._decrypt=function(e,t,n,f,a){for(var d=n,l=t,v=e.keys.length-2;v>=0;v-=2){var w=e.keys[v],m=e.keys[v+1];ra.expand(d,e.tmp,0),w^=e.tmp[0],m^=e.tmp[1];var y=ra.substitute(w,m),g=d;d=(l^ra.permute(y))>>>0,l=g}ra.rip(d,l,f,a)};HQ=FQ,KQ={},_Se=js,MSe=Vr,xb={};KQ.instantiate=function(e){function t(d){e.call(this,d),this._cbcInit()}MSe(t,e);for(var n=Object.keys(xb),f=0;f<n.length;f++){var a=n[f];t.prototype[a]=xb[a]}return t.create=function(d){return new t(d)},t},xb._cbcInit=function(){var e=new SSe(this.options.iv);this._cbcState=e},xb._update=function(e,t,n,f){var a=this._cbcState,d=this.constructor.super_.prototype,l=a.iv;if(this.type==="encrypt"){for(var v=0;v<this.blockSize;v++)l[v]^=e[t+v];for(d._update.call(this,l,0,n,f),v=0;v<this.blockSize;v++)l[v]=n[f+v]}else{for(d._update.call(this,e,t,n,f),v=0;v<this.blockSize;v++)n[f+v]^=l[v];for(v=0;v<this.blockSize;v++)l[v]=e[t+v]}};ESe=js,WQ=ER,Al=HQ;Vr(U0,WQ),ZQ=U0,U0.create=function(e){return new U0(e)},U0.prototype._update=function(e,t,n,f){var a=this._edeState;a.ciphers[0]._update(e,t,n,f),a.ciphers[1]._update(n,f,n,f),a.ciphers[2]._update(n,f,n,f)},U0.prototype._pad=Al.prototype._pad,U0.prototype._unpad=Al.prototype._unpad;xSe=ZQ,n1={};n1.utils=cc,n1.Cipher=ER,n1.DES=HQ,n1.CBC=KQ,n1.EDE=xSe;S3=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,GQ=Pl,ch=n1,RSe=Vr,ec=Si.Buffer,y2={"des-ede3-cbc":ch.CBC.instantiate(ch.EDE),"des-ede3":ch.EDE,"des-ede-cbc":ch.CBC.instantiate(ch.EDE),"des-ede":ch.EDE,"des-cbc":ch.CBC.instantiate(ch.DES),"des-ecb":ch.DES};y2.des=y2["des-cbc"],y2.des3=y2["des-ede3-cbc"],VQ=Rb,RSe(Rb,GQ),Rb.prototype._update=function(e){return ec.from((this||S3)._des.update(e))},Rb.prototype._final=function(){return ec.from((this||S3)._des.final())};kSe=VQ,TSe=Dr.Buffer,z2=function(e,t){for(var n=Math.min(e.length,t.length),f=new TSe(n),a=0;a<n;++a)f[a]=e[a]^t[a];return f},YQ=function(e){for(var t,n=e.length;n--;){if((t=e.readUInt8(n))!==255){t++,e.writeUInt8(t,n);break}e.writeUInt8(0,n)}},ISe={encrypt:function(e,t){return e._cipher.encryptBlock(t)},decrypt:function(e,t){return e._cipher.decryptBlock(t)}},zx={},oV=z2;zx.encrypt=function(e,t){var n=oV(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},zx.decrypt=function(e,t){var n=e._prev;e._prev=t;var f=e._cipher.decryptBlock(t);return oV(f,n)};JQ={},b2=Si.Buffer,BSe=z2;JQ.encrypt=function(e,t,n){for(var f,a=b2.allocUnsafe(0);t.length;){if(e._cache.length===0&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=b2.allocUnsafe(0)),!(e._cache.length<=t.length)){a=b2.concat([a,sV(e,t,n)]);break}f=e._cache.length,a=b2.concat([a,sV(e,t.slice(0,f),n)]),t=t.slice(f)}return a};XQ={},Hx=Si.Buffer;XQ.encrypt=function(e,t,n){for(var f=t.length,a=Hx.allocUnsafe(f),d=-1;++d<f;)a[d]=OSe(e,t[d],n);return a};QQ={},l3=Si.Buffer;QQ.encrypt=function(e,t,n){for(var f=t.length,a=l3.allocUnsafe(f),d=-1;++d<f;)a[d]=PSe(e,t[d],n);return a};eee={},CSe=Dr.Buffer,LSe=z2;eee.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=CSe.concat([e._cache,DSe(e)]);var n=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),LSe(t,n)};Kx={},$Se=z2,fV=Si.Buffer,USe=YQ;Kx.encrypt=function(e,t){var n=Math.ceil(t.length/16),f=e._cache.length;e._cache=fV.concat([e._cache,fV.allocUnsafe(16*n)]);for(var a=0;a<n;a++){var d=qSe(e),l=f+16*a;e._cache.writeUInt32BE(d[0],l+0),e._cache.writeUInt32BE(d[1],l+4),e._cache.writeUInt32BE(d[2],l+8),e._cache.writeUInt32BE(d[3],l+12)}var v=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),$Se(t,v)};tee={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},jSe={ECB:ISe,CBC:zx,CFB:JQ,CFB8:XQ,CFB1:QQ,OFB:eee,CTR:Kx,GCM:Kx},c3=tee;for(VS in c3)c3[VS].module=jSe[c3[VS].mode];AR=c3,Ds=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,H2={},E3=Si.Buffer;FSe=[0,1,2,4,8,16,32,64,128,27,54],Gn=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],f=[],a=[[],[],[],[]],d=[[],[],[],[]],l=0,v=0,w=0;w<256;++w){var m=v^v<<1^v<<2^v<<3^v<<4;m=m>>>8^255&m^99,n[l]=m,f[m]=l;var y=e[l],g=e[y],S=e[g],x=257*e[m]^16843008*m;a[0][l]=x<<24|x>>>8,a[1][l]=x<<16|x>>>16,a[2][l]=x<<8|x>>>24,a[3][l]=x,x=16843009*S^65537*g^257*y^16843008*l,d[0][m]=x<<24|x>>>8,d[1][m]=x<<16|x>>>16,d[2][m]=x<<8|x>>>24,d[3][m]=x,l===0?l=v=1:(l=y^e[e[e[S^y]]],v^=e[e[v]])}return{SBOX:n,INV_SBOX:f,SUB_MIX:a,INV_SUB_MIX:d}}();Is.blockSize=16,Is.keySize=32,Is.prototype.blockSize=Is.blockSize,Is.prototype.keySize=Is.keySize,Is.prototype._reset=function(){for(var e=(this||Ds)._key,t=e.length,n=t+6,f=4*(n+1),a=[],d=0;d<t;d++)a[d]=e[d];for(d=t;d<f;d++){var l=a[d-1];d%t==0?(l=l<<8|l>>>24,l=Gn.SBOX[l>>>24]<<24|Gn.SBOX[l>>>16&255]<<16|Gn.SBOX[l>>>8&255]<<8|Gn.SBOX[255&l],l^=FSe[d/t|0]<<24):t>6&&d%t==4&&(l=Gn.SBOX[l>>>24]<<24|Gn.SBOX[l>>>16&255]<<16|Gn.SBOX[l>>>8&255]<<8|Gn.SBOX[255&l]),a[d]=a[d-t]^l}for(var v=[],w=0;w<f;w++){var m=f-w,y=a[m-(w%4?0:4)];v[w]=w<4||m<=4?y:Gn.INV_SUB_MIX[0][Gn.SBOX[y>>>24]]^Gn.INV_SUB_MIX[1][Gn.SBOX[y>>>16&255]]^Gn.INV_SUB_MIX[2][Gn.SBOX[y>>>8&255]]^Gn.INV_SUB_MIX[3][Gn.SBOX[255&y]]}(this||Ds)._nRounds=n,(this||Ds)._keySchedule=a,(this||Ds)._invKeySchedule=v},Is.prototype.encryptBlockRaw=function(e){return uV(e=Zx(e),(this||Ds)._keySchedule,Gn.SUB_MIX,Gn.SBOX,(this||Ds)._nRounds)},Is.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=E3.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},Is.prototype.decryptBlock=function(e){var t=(e=Zx(e))[1];e[1]=e[3],e[3]=t;var n=uV(e,(this||Ds)._invKeySchedule,Gn.INV_SUB_MIX,Gn.INV_SBOX,(this||Ds)._nRounds),f=E3.allocUnsafe(16);return f.writeUInt32BE(n[0],0),f.writeUInt32BE(n[3],4),f.writeUInt32BE(n[2],8),f.writeUInt32BE(n[1],12),f},Is.prototype.scrub=function(){GS((this||Ds)._keySchedule),GS((this||Ds)._invKeySchedule),GS((this||Ds)._key)},H2.AES=Is;Fa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,d1=Si.Buffer,zSe=d1.alloc(16,0);w2.prototype.ghash=function(e){for(var t=-1;++t<e.length;)(this||Fa).state[t]^=e[t];this._multiply()},w2.prototype._multiply=function(){for(var e,t,n,f=[(e=(this||Fa).h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],a=[0,0,0,0],d=-1;++d<128;){for((this||Fa).state[~~(d/8)]&1<<7-d%8&&(a[0]^=f[0],a[1]^=f[1],a[2]^=f[2],a[3]^=f[3]),n=(1&f[3])!=0,t=3;t>0;t--)f[t]=f[t]>>>1|(1&f[t-1])<<31;f[0]=f[0]>>>1,n&&(f[0]=f[0]^225<<24)}(this||Fa).state=hV(a)},w2.prototype.update=function(e){var t;for((this||Fa).cache=d1.concat([(this||Fa).cache,e]);(this||Fa).cache.length>=16;)t=(this||Fa).cache.slice(0,16),(this||Fa).cache=(this||Fa).cache.slice(16),this.ghash(t)},w2.prototype.final=function(e,t){return(this||Fa).cache.length&&this.ghash(d1.concat([(this||Fa).cache,zSe],16)),this.ghash(hV([0,e,0,t])),(this||Fa).state};HSe=w2,ri=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,KSe=H2,_o=Si.Buffer,ree=Pl,lV=HSe,ZSe=z2,WSe=YQ;Vr(Y0,ree),Y0.prototype._update=function(e){if(!(this||ri)._called&&(this||ri)._alen){var t=16-(this||ri)._alen%16;t<16&&(t=_o.alloc(t,0),(this||ri)._ghash.update(t))}(this||ri)._called=!0;var n=(this||ri)._mode.encrypt(this||ri,e);return(this||ri)._decrypt?(this||ri)._ghash.update(e):(this||ri)._ghash.update(n),(this||ri)._len+=e.length,n},Y0.prototype._final=function(){if((this||ri)._decrypt&&!(this||ri)._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=ZSe((this||ri)._ghash.final(8*(this||ri)._alen,8*(this||ri)._len),(this||ri)._cipher.encryptBlock((this||ri)._finID));if((this||ri)._decrypt&&function(t,n){var f=0;t.length!==n.length&&f++;for(var a=Math.min(t.length,n.length),d=0;d<a;++d)f+=t[d]^n[d];return f}(e,(this||ri)._authTag))throw new Error("Unsupported state or unable to authenticate data");(this||ri)._authTag=e,(this||ri)._cipher.scrub()},Y0.prototype.getAuthTag=function(){if((this||ri)._decrypt||!_o.isBuffer((this||ri)._authTag))throw new Error("Attempting to get auth tag in unsupported state");return(this||ri)._authTag},Y0.prototype.setAuthTag=function(e){if(!(this||ri)._decrypt)throw new Error("Attempting to set auth tag in unsupported state");(this||ri)._authTag=e},Y0.prototype.setAAD=function(e){if((this||ri)._called)throw new Error("Attempting to set AAD in unsupported state");(this||ri)._ghash.update(e),(this||ri)._alen+=e.length};iee=Y0,Cf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,VSe=H2,YS=Si.Buffer,nee=Pl;Vr(d3,nee),d3.prototype._update=function(e){return(this||Cf)._mode.encrypt(this||Cf,e,(this||Cf)._decrypt)},d3.prototype._final=function(){(this||Cf)._cipher.scrub()};aee=d3,q0=Si.Buffer,GSe=_R,U3=function(e,t,n,f){if(q0.isBuffer(e)||(e=q0.from(e,"binary")),t&&(q0.isBuffer(t)||(t=q0.from(t,"binary")),t.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=n/8,d=q0.alloc(a),l=q0.alloc(f||0),v=q0.alloc(0);a>0||f>0;){var w=new GSe;w.update(v),w.update(e),t&&w.update(t),v=w.digest();var m=0;if(a>0){var y=d.length-a;m=Math.min(a,v.length),v.copy(d,y,0,m),a-=m}if(m<v.length&&f>0){var g=l.length-f,S=Math.min(f,v.length-m);v.copy(l,g,m,m+S),f-=S}}return v.fill(0),{key:d,iv:l}},Ki=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Wx={},YSe=iee,p1=Si.Buffer,oee=AR,JSe=aee,see=Pl,XSe=H2,QSe=U3;Vr(_2,see),_2.prototype._update=function(e){var t,n;(this||Ki)._cache.add(e);for(var f=[];t=(this||Ki)._cache.get((this||Ki)._autopadding);)n=(this||Ki)._mode.decrypt(this||Ki,t),f.push(n);return p1.concat(f)},_2.prototype._final=function(){var e=(this||Ki)._cache.flush();if((this||Ki)._autopadding)return function(t){var n=t[15];if(n<1||n>16)throw new Error("unable to decrypt data");for(var f=-1;++f<n;)if(t[f+(16-n)]!==n)throw new Error("unable to decrypt data");if(n!==16)return t.slice(0,16-n)}((this||Ki)._mode.decrypt(this||Ki,e));if(e)throw new Error("data not multiple of block length")},_2.prototype.setAutoPadding=function(e){return(this||Ki)._autopadding=!!e,this||Ki},p3.prototype.add=function(e){(this||Ki).cache=p1.concat([(this||Ki).cache,e])},p3.prototype.get=function(e){var t;if(e){if((this||Ki).cache.length>16)return t=(this||Ki).cache.slice(0,16),(this||Ki).cache=(this||Ki).cache.slice(16),t}else if((this||Ki).cache.length>=16)return t=(this||Ki).cache.slice(0,16),(this||Ki).cache=(this||Ki).cache.slice(16),t;return null},p3.prototype.flush=function(){if((this||Ki).cache.length)return(this||Ki).cache},Wx.createDecipher=function(e,t){var n=oee[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var f=QSe(t,!1,n.key,n.iv);return cV(e,f.key,f.iv)},Wx.createDecipheriv=cV;mn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Vx={},fee=AR,eEe=iee,wh=Si.Buffer,tEe=aee,uee=Pl,rEe=H2,iEe=U3;Vr(P2,uee),P2.prototype._update=function(e){var t,n;(this||mn)._cache.add(e);for(var f=[];t=(this||mn)._cache.get();)n=(this||mn)._mode.encrypt(this||mn,t),f.push(n);return wh.concat(f)};nEe=wh.alloc(16,16);P2.prototype._final=function(){var e=(this||mn)._cache.flush();if((this||mn)._autopadding)return e=(this||mn)._mode.encrypt(this||mn,e),(this||mn)._cipher.scrub(),e;if(!e.equals(nEe))throw(this||mn)._cipher.scrub(),new Error("data not multiple of block length")},P2.prototype.setAutoPadding=function(e){return(this||mn)._autopadding=!!e,this||mn},v3.prototype.add=function(e){(this||mn).cache=wh.concat([(this||mn).cache,e])},v3.prototype.get=function(){if((this||mn).cache.length>15){var e=(this||mn).cache.slice(0,16);return(this||mn).cache=(this||mn).cache.slice(16),e}return null},v3.prototype.flush=function(){for(var e=16-(this||mn).cache.length,t=wh.allocUnsafe(e),n=-1;++n<e;)t.writeUInt8(e,n);return wh.concat([(this||mn).cache,t])},Vx.createCipheriv=dV,Vx.createCipher=function(e,t){var n=fee[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var f=iEe(t,!1,n.key,n.iv);return dV(e,f.key,f.iv)};zo={},pV=Vx,vV=Wx,aEe=tee;zo.createCipher=zo.Cipher=pV.createCipher,zo.createCipheriv=zo.Cipheriv=pV.createCipheriv,zo.createDecipher=zo.Decipher=vV.createDecipher,zo.createDecipheriv=zo.Decipheriv=vV.createDecipheriv,zo.listCiphers=zo.getCiphers=function(){return Object.keys(aEe)};yl={"des-ecb":{key:8,iv:0}};yl["des-cbc"]=yl.des={key:8,iv:8},yl["des-ede3-cbc"]=yl.des3={key:24,iv:8},yl["des-ede3"]={key:24,iv:0},yl["des-ede-cbc"]={key:16,iv:8},yl["des-ede"]={key:16,iv:0};Of={},hee=kSe,xR=zo,xl=AR,ph=yl,mV=U3;Of.createCipher=Of.Cipher=function(e,t){var n,f;if(e=e.toLowerCase(),xl[e])n=xl[e].key,f=xl[e].iv;else{if(!ph[e])throw new TypeError("invalid suite type");n=8*ph[e].key,f=ph[e].iv}var a=mV(t,!1,n,f);return gV(e,a.key,a.iv)},Of.createCipheriv=Of.Cipheriv=gV,Of.createDecipher=Of.Decipher=function(e,t){var n,f;if(e=e.toLowerCase(),xl[e])n=xl[e].key,f=xl[e].iv;else{if(!ph[e])throw new TypeError("invalid suite type");n=8*ph[e].key,f=ph[e].iv}var a=mV(t,!1,n,f);return yV(e,a.key,a.iv)},Of.createDecipheriv=Of.Decipheriv=yV,Of.listCiphers=Of.getCiphers=function(){return Object.keys(ph).concat(xR.getCiphers())};oEe=Object.freeze({}),et=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,lee={},cee={exports:lee};(function(e,t){function n(j,z){if(!j)throw new Error(z||"Assertion failed")}function f(j,z){j.super_=z;var J=function(){};J.prototype=z.prototype,j.prototype=new J,j.prototype.constructor=j}function a(j,z,J){if(a.isBN(j))return j;(this||et).negative=0,(this||et).words=null,(this||et).length=0,(this||et).red=null,j!==null&&(z!=="le"&&z!=="be"||(J=z,z=10),this._init(j||0,z||10,J||"be"))}var d;typeof e=="object"?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{d=oEe.Buffer}catch{}function l(j,z,J){for(var E=0,i=Math.min(j.length,J),s=z;s<i;s++){var u=j.charCodeAt(s)-48;E<<=4,E|=u>=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:15&u}return E}function v(j,z,J,E){for(var i=0,s=Math.min(j.length,J),u=z;u<s;u++){var c=j.charCodeAt(u)-48;i*=E,i+=c>=49?c-49+10:c>=17?c-17+10:c}return i}a.isBN=function(j){return j instanceof a||j!==null&&typeof j=="object"&&j.constructor.wordSize===a.wordSize&&Array.isArray(j.words)},a.max=function(j,z){return j.cmp(z)>0?j:z},a.min=function(j,z){return j.cmp(z)<0?j:z},a.prototype._init=function(j,z,J){if(typeof j=="number")return this._initNumber(j,z,J);if(typeof j=="object")return this._initArray(j,z,J);z==="hex"&&(z=16),n(z===(0|z)&&z>=2&&z<=36);var E=0;(j=j.toString().replace(/\s+/g,""))[0]==="-"&&E++,z===16?this._parseHex(j,E):this._parseBase(j,z,E),j[0]==="-"&&((this||et).negative=1),this.strip(),J==="le"&&this._initArray(this.toArray(),z,J)},a.prototype._initNumber=function(j,z,J){j<0&&((this||et).negative=1,j=-j),j<67108864?((this||et).words=[67108863&j],(this||et).length=1):j<4503599627370496?((this||et).words=[67108863&j,j/67108864&67108863],(this||et).length=2):(n(j<9007199254740992),(this||et).words=[67108863&j,j/67108864&67108863,1],(this||et).length=3),J==="le"&&this._initArray(this.toArray(),z,J)},a.prototype._initArray=function(j,z,J){if(n(typeof j.length=="number"),j.length<=0)return(this||et).words=[0],(this||et).length=1,this||et;(this||et).length=Math.ceil(j.length/3),(this||et).words=new Array((this||et).length);for(var E=0;E<(this||et).length;E++)(this||et).words[E]=0;var i,s,u=0;if(J==="be")for(E=j.length-1,i=0;E>=0;E-=3)s=j[E]|j[E-1]<<8|j[E-2]<<16,(this||et).words[i]|=s<<u&67108863,(this||et).words[i+1]=s>>>26-u&67108863,(u+=24)>=26&&(u-=26,i++);else if(J==="le")for(E=0,i=0;E<j.length;E+=3)s=j[E]|j[E+1]<<8|j[E+2]<<16,(this||et).words[i]|=s<<u&67108863,(this||et).words[i+1]=s>>>26-u&67108863,(u+=24)>=26&&(u-=26,i++);return this.strip()},a.prototype._parseHex=function(j,z){(this||et).length=Math.ceil((j.length-z)/6),(this||et).words=new Array((this||et).length);for(var J=0;J<(this||et).length;J++)(this||et).words[J]=0;var E,i,s=0;for(J=j.length-6,E=0;J>=z;J-=6)i=l(j,J,J+6),(this||et).words[E]|=i<<s&67108863,(this||et).words[E+1]|=i>>>26-s&4194303,(s+=24)>=26&&(s-=26,E++);J+6!==z&&(i=l(j,z,J+6),(this||et).words[E]|=i<<s&67108863,(this||et).words[E+1]|=i>>>26-s&4194303),this.strip()},a.prototype._parseBase=function(j,z,J){(this||et).words=[0],(this||et).length=1;for(var E=0,i=1;i<=67108863;i*=z)E++;E--,i=i/z|0;for(var s=j.length-J,u=s%E,c=Math.min(s,s-u)+J,p=0,_=J;_<c;_+=E)p=v(j,_,_+E,z),this.imuln(i),(this||et).words[0]+p<67108864?(this||et).words[0]+=p:this._iaddn(p);if(u!==0){var R=1;for(p=v(j,_,j.length,z),_=0;_<u;_++)R*=z;this.imuln(R),(this||et).words[0]+p<67108864?(this||et).words[0]+=p:this._iaddn(p)}},a.prototype.copy=function(j){j.words=new Array((this||et).length);for(var z=0;z<(this||et).length;z++)j.words[z]=(this||et).words[z];j.length=(this||et).length,j.negative=(this||et).negative,j.red=(this||et).red},a.prototype.clone=function(){var j=new a(null);return this.copy(j),j},a.prototype._expand=function(j){for(;(this||et).length<j;)(this||et).words[(this||et).length++]=0;return this||et},a.prototype.strip=function(){for(;(this||et).length>1&&(this||et).words[(this||et).length-1]===0;)(this||et).length--;return this._normSign()},a.prototype._normSign=function(){return(this||et).length===1&&(this||et).words[0]===0&&((this||et).negative=0),this||et},a.prototype.inspect=function(){return((this||et).red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],m=[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],y=[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 g(j,z,J){J.negative=z.negative^j.negative;var E=j.length+z.length|0;J.length=E,E=E-1|0;var i=0|j.words[0],s=0|z.words[0],u=i*s,c=67108863&u,p=u/67108864|0;J.words[0]=c;for(var _=1;_<E;_++){for(var R=p>>>26,o=67108863&p,r=Math.min(_,z.length-1),h=Math.max(0,_-j.length+1);h<=r;h++){var b=_-h|0;R+=(u=(i=0|j.words[b])*(s=0|z.words[h])+o)/67108864|0,o=67108863&u}J.words[_]=0|o,p=0|R}return p!==0?J.words[_]=0|p:J.length--,J.strip()}a.prototype.toString=function(j,z){var J;if(z=0|z||1,(j=j||10)===16||j==="hex"){J="";for(var E=0,i=0,s=0;s<(this||et).length;s++){var u=(this||et).words[s],c=(16777215&(u<<E|i)).toString(16);J=(i=u>>>24-E&16777215)!==0||s!==(this||et).length-1?w[6-c.length]+c+J:c+J,(E+=2)>=26&&(E-=26,s--)}for(i!==0&&(J=i.toString(16)+J);J.length%z!=0;)J="0"+J;return(this||et).negative!==0&&(J="-"+J),J}if(j===(0|j)&&j>=2&&j<=36){var p=m[j],_=y[j];J="";var R=this.clone();for(R.negative=0;!R.isZero();){var o=R.modn(_).toString(j);J=(R=R.idivn(_)).isZero()?o+J:w[p-o.length]+o+J}for(this.isZero()&&(J="0"+J);J.length%z!=0;)J="0"+J;return(this||et).negative!==0&&(J="-"+J),J}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var j=(this||et).words[0];return(this||et).length===2?j+=67108864*(this||et).words[1]:(this||et).length===3&&(this||et).words[2]===1?j+=4503599627370496+67108864*(this||et).words[1]:(this||et).length>2&&n(!1,"Number can only safely store up to 53 bits"),(this||et).negative!==0?-j:j},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(j,z){return n(d!==void 0),this.toArrayLike(d,j,z)},a.prototype.toArray=function(j,z){return this.toArrayLike(Array,j,z)},a.prototype.toArrayLike=function(j,z,J){var E=this.byteLength(),i=J||Math.max(1,E);n(E<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var s,u,c=z==="le",p=new j(i),_=this.clone();if(c){for(u=0;!_.isZero();u++)s=_.andln(255),_.iushrn(8),p[u]=s;for(;u<i;u++)p[u]=0}else{for(u=0;u<i-E;u++)p[u]=0;for(u=0;!_.isZero();u++)s=_.andln(255),_.iushrn(8),p[i-u-1]=s}return p},Math.clz32?a.prototype._countBits=function(j){return 32-Math.clz32(j)}:a.prototype._countBits=function(j){var z=j,J=0;return z>=4096&&(J+=13,z>>>=13),z>=64&&(J+=7,z>>>=7),z>=8&&(J+=4,z>>>=4),z>=2&&(J+=2,z>>>=2),J+z},a.prototype._zeroBits=function(j){if(j===0)return 26;var z=j,J=0;return!(8191&z)&&(J+=13,z>>>=13),!(127&z)&&(J+=7,z>>>=7),!(15&z)&&(J+=4,z>>>=4),!(3&z)&&(J+=2,z>>>=2),!(1&z)&&J++,J},a.prototype.bitLength=function(){var j=(this||et).words[(this||et).length-1],z=this._countBits(j);return 26*((this||et).length-1)+z},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var j=0,z=0;z<(this||et).length;z++){var J=this._zeroBits((this||et).words[z]);if(j+=J,J!==26)break}return j},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(j){return(this||et).negative!==0?this.abs().inotn(j).iaddn(1):this.clone()},a.prototype.fromTwos=function(j){return this.testn(j-1)?this.notn(j).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return(this||et).negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||((this||et).negative^=1),this||et},a.prototype.iuor=function(j){for(;(this||et).length<j.length;)(this||et).words[(this||et).length++]=0;for(var z=0;z<j.length;z++)(this||et).words[z]=(this||et).words[z]|j.words[z];return this.strip()},a.prototype.ior=function(j){return n(((this||et).negative|j.negative)==0),this.iuor(j)},a.prototype.or=function(j){return(this||et).length>j.length?this.clone().ior(j):j.clone().ior(this||et)},a.prototype.uor=function(j){return(this||et).length>j.length?this.clone().iuor(j):j.clone().iuor(this||et)},a.prototype.iuand=function(j){var z;z=(this||et).length>j.length?j:this||et;for(var J=0;J<z.length;J++)(this||et).words[J]=(this||et).words[J]&j.words[J];return(this||et).length=z.length,this.strip()},a.prototype.iand=function(j){return n(((this||et).negative|j.negative)==0),this.iuand(j)},a.prototype.and=function(j){return(this||et).length>j.length?this.clone().iand(j):j.clone().iand(this||et)},a.prototype.uand=function(j){return(this||et).length>j.length?this.clone().iuand(j):j.clone().iuand(this||et)},a.prototype.iuxor=function(j){var z,J;(this||et).length>j.length?(z=this||et,J=j):(z=j,J=this||et);for(var E=0;E<J.length;E++)(this||et).words[E]=z.words[E]^J.words[E];if((this||et)!==z)for(;E<z.length;E++)(this||et).words[E]=z.words[E];return(this||et).length=z.length,this.strip()},a.prototype.ixor=function(j){return n(((this||et).negative|j.negative)==0),this.iuxor(j)},a.prototype.xor=function(j){return(this||et).length>j.length?this.clone().ixor(j):j.clone().ixor(this||et)},a.prototype.uxor=function(j){return(this||et).length>j.length?this.clone().iuxor(j):j.clone().iuxor(this||et)},a.prototype.inotn=function(j){n(typeof j=="number"&&j>=0);var z=0|Math.ceil(j/26),J=j%26;this._expand(z),J>0&&z--;for(var E=0;E<z;E++)(this||et).words[E]=67108863&~(this||et).words[E];return J>0&&((this||et).words[E]=~(this||et).words[E]&67108863>>26-J),this.strip()},a.prototype.notn=function(j){return this.clone().inotn(j)},a.prototype.setn=function(j,z){n(typeof j=="number"&&j>=0);var J=j/26|0,E=j%26;return this._expand(J+1),(this||et).words[J]=z?(this||et).words[J]|1<<E:(this||et).words[J]&~(1<<E),this.strip()},a.prototype.iadd=function(j){var z,J,E;if((this||et).negative!==0&&j.negative===0)return(this||et).negative=0,z=this.isub(j),(this||et).negative^=1,this._normSign();if((this||et).negative===0&&j.negative!==0)return j.negative=0,z=this.isub(j),j.negative=1,z._normSign();(this||et).length>j.length?(J=this||et,E=j):(J=j,E=this||et);for(var i=0,s=0;s<E.length;s++)z=(0|J.words[s])+(0|E.words[s])+i,(this||et).words[s]=67108863&z,i=z>>>26;for(;i!==0&&s<J.length;s++)z=(0|J.words[s])+i,(this||et).words[s]=67108863&z,i=z>>>26;if((this||et).length=J.length,i!==0)(this||et).words[(this||et).length]=i,(this||et).length++;else if(J!==(this||et))for(;s<J.length;s++)(this||et).words[s]=J.words[s];return this||et},a.prototype.add=function(j){var z;return j.negative!==0&&(this||et).negative===0?(j.negative=0,z=this.sub(j),j.negative^=1,z):j.negative===0&&(this||et).negative!==0?((this||et).negative=0,z=j.sub(this||et),(this||et).negative=1,z):(this||et).length>j.length?this.clone().iadd(j):j.clone().iadd(this||et)},a.prototype.isub=function(j){if(j.negative!==0){j.negative=0;var z=this.iadd(j);return j.negative=1,z._normSign()}if((this||et).negative!==0)return(this||et).negative=0,this.iadd(j),(this||et).negative=1,this._normSign();var J,E,i=this.cmp(j);if(i===0)return(this||et).negative=0,(this||et).length=1,(this||et).words[0]=0,this||et;i>0?(J=this||et,E=j):(J=j,E=this||et);for(var s=0,u=0;u<E.length;u++)s=(z=(0|J.words[u])-(0|E.words[u])+s)>>26,(this||et).words[u]=67108863&z;for(;s!==0&&u<J.length;u++)s=(z=(0|J.words[u])+s)>>26,(this||et).words[u]=67108863&z;if(s===0&&u<J.length&&J!==(this||et))for(;u<J.length;u++)(this||et).words[u]=J.words[u];return(this||et).length=Math.max((this||et).length,u),J!==(this||et)&&((this||et).negative=1),this.strip()},a.prototype.sub=function(j){return this.clone().isub(j)};var S=function(j,z,J){var E,i,s,u=j.words,c=z.words,p=J.words,_=0,R=0|u[0],o=8191&R,r=R>>>13,h=0|u[1],b=8191&h,M=h>>>13,k=0|u[2],D=8191&k,Q=k>>>13,W=0|u[3],X=8191&W,V=W>>>13,Y=0|u[4],ae=8191&Y,te=Y>>>13,U=0|u[5],Z=8191&U,ie=U>>>13,fe=0|u[6],de=8191&fe,he=fe>>>13,pe=0|u[7],De=8191&pe,Ae=pe>>>13,_e=0|u[8],ut=8191&_e,qe=_e>>>13,Te=0|u[9],mt=8191&Te,ne=Te>>>13,O=0|c[0],N=8191&O,$=O>>>13,ee=0|c[1],re=8191&ee,se=ee>>>13,ce=0|c[2],st=8191&ce,ye=ce>>>13,be=0|c[3],me=8191&be,ke=be>>>13,je=0|c[4],le=8191&je,Ie=je>>>13,Se=0|c[5],Ee=8191&Se,Me=Se>>>13,Re=0|c[6],wt=8191&Re,Ne=Re>>>13,Ce=0|c[7],At=8191&Ce,dt=Ce>>>13,rt=0|c[8],Et=8191&rt,lt=rt>>>13,ot=0|c[9],It=8191&ot,pt=ot>>>13;J.negative=j.negative^z.negative,J.length=19;var ft=(_+(E=Math.imul(o,N))|0)+((8191&(i=(i=Math.imul(o,$))+Math.imul(r,N)|0))<<13)|0;_=((s=Math.imul(r,$))+(i>>>13)|0)+(ft>>>26)|0,ft&=67108863,E=Math.imul(b,N),i=(i=Math.imul(b,$))+Math.imul(M,N)|0,s=Math.imul(M,$);var Tt=(_+(E=E+Math.imul(o,re)|0)|0)+((8191&(i=(i=i+Math.imul(o,se)|0)+Math.imul(r,re)|0))<<13)|0;_=((s=s+Math.imul(r,se)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,E=Math.imul(D,N),i=(i=Math.imul(D,$))+Math.imul(Q,N)|0,s=Math.imul(Q,$),E=E+Math.imul(b,re)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(M,re)|0,s=s+Math.imul(M,se)|0;var vt=(_+(E=E+Math.imul(o,st)|0)|0)+((8191&(i=(i=i+Math.imul(o,ye)|0)+Math.imul(r,st)|0))<<13)|0;_=((s=s+Math.imul(r,ye)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,E=Math.imul(X,N),i=(i=Math.imul(X,$))+Math.imul(V,N)|0,s=Math.imul(V,$),E=E+Math.imul(D,re)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(Q,re)|0,s=s+Math.imul(Q,se)|0,E=E+Math.imul(b,st)|0,i=(i=i+Math.imul(b,ye)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,ye)|0;var at=(_+(E=E+Math.imul(o,me)|0)|0)+((8191&(i=(i=i+Math.imul(o,ke)|0)+Math.imul(r,me)|0))<<13)|0;_=((s=s+Math.imul(r,ke)|0)+(i>>>13)|0)+(at>>>26)|0,at&=67108863,E=Math.imul(ae,N),i=(i=Math.imul(ae,$))+Math.imul(te,N)|0,s=Math.imul(te,$),E=E+Math.imul(X,re)|0,i=(i=i+Math.imul(X,se)|0)+Math.imul(V,re)|0,s=s+Math.imul(V,se)|0,E=E+Math.imul(D,st)|0,i=(i=i+Math.imul(D,ye)|0)+Math.imul(Q,st)|0,s=s+Math.imul(Q,ye)|0,E=E+Math.imul(b,me)|0,i=(i=i+Math.imul(b,ke)|0)+Math.imul(M,me)|0,s=s+Math.imul(M,ke)|0;var Bt=(_+(E=E+Math.imul(o,le)|0)|0)+((8191&(i=(i=i+Math.imul(o,Ie)|0)+Math.imul(r,le)|0))<<13)|0;_=((s=s+Math.imul(r,Ie)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,E=Math.imul(Z,N),i=(i=Math.imul(Z,$))+Math.imul(ie,N)|0,s=Math.imul(ie,$),E=E+Math.imul(ae,re)|0,i=(i=i+Math.imul(ae,se)|0)+Math.imul(te,re)|0,s=s+Math.imul(te,se)|0,E=E+Math.imul(X,st)|0,i=(i=i+Math.imul(X,ye)|0)+Math.imul(V,st)|0,s=s+Math.imul(V,ye)|0,E=E+Math.imul(D,me)|0,i=(i=i+Math.imul(D,ke)|0)+Math.imul(Q,me)|0,s=s+Math.imul(Q,ke)|0,E=E+Math.imul(b,le)|0,i=(i=i+Math.imul(b,Ie)|0)+Math.imul(M,le)|0,s=s+Math.imul(M,Ie)|0;var Wt=(_+(E=E+Math.imul(o,Ee)|0)|0)+((8191&(i=(i=i+Math.imul(o,Me)|0)+Math.imul(r,Ee)|0))<<13)|0;_=((s=s+Math.imul(r,Me)|0)+(i>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,E=Math.imul(de,N),i=(i=Math.imul(de,$))+Math.imul(he,N)|0,s=Math.imul(he,$),E=E+Math.imul(Z,re)|0,i=(i=i+Math.imul(Z,se)|0)+Math.imul(ie,re)|0,s=s+Math.imul(ie,se)|0,E=E+Math.imul(ae,st)|0,i=(i=i+Math.imul(ae,ye)|0)+Math.imul(te,st)|0,s=s+Math.imul(te,ye)|0,E=E+Math.imul(X,me)|0,i=(i=i+Math.imul(X,ke)|0)+Math.imul(V,me)|0,s=s+Math.imul(V,ke)|0,E=E+Math.imul(D,le)|0,i=(i=i+Math.imul(D,Ie)|0)+Math.imul(Q,le)|0,s=s+Math.imul(Q,Ie)|0,E=E+Math.imul(b,Ee)|0,i=(i=i+Math.imul(b,Me)|0)+Math.imul(M,Ee)|0,s=s+Math.imul(M,Me)|0;var Pt=(_+(E=E+Math.imul(o,wt)|0)|0)+((8191&(i=(i=i+Math.imul(o,Ne)|0)+Math.imul(r,wt)|0))<<13)|0;_=((s=s+Math.imul(r,Ne)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,E=Math.imul(De,N),i=(i=Math.imul(De,$))+Math.imul(Ae,N)|0,s=Math.imul(Ae,$),E=E+Math.imul(de,re)|0,i=(i=i+Math.imul(de,se)|0)+Math.imul(he,re)|0,s=s+Math.imul(he,se)|0,E=E+Math.imul(Z,st)|0,i=(i=i+Math.imul(Z,ye)|0)+Math.imul(ie,st)|0,s=s+Math.imul(ie,ye)|0,E=E+Math.imul(ae,me)|0,i=(i=i+Math.imul(ae,ke)|0)+Math.imul(te,me)|0,s=s+Math.imul(te,ke)|0,E=E+Math.imul(X,le)|0,i=(i=i+Math.imul(X,Ie)|0)+Math.imul(V,le)|0,s=s+Math.imul(V,Ie)|0,E=E+Math.imul(D,Ee)|0,i=(i=i+Math.imul(D,Me)|0)+Math.imul(Q,Ee)|0,s=s+Math.imul(Q,Me)|0,E=E+Math.imul(b,wt)|0,i=(i=i+Math.imul(b,Ne)|0)+Math.imul(M,wt)|0,s=s+Math.imul(M,Ne)|0;var Nt=(_+(E=E+Math.imul(o,At)|0)|0)+((8191&(i=(i=i+Math.imul(o,dt)|0)+Math.imul(r,At)|0))<<13)|0;_=((s=s+Math.imul(r,dt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,E=Math.imul(ut,N),i=(i=Math.imul(ut,$))+Math.imul(qe,N)|0,s=Math.imul(qe,$),E=E+Math.imul(De,re)|0,i=(i=i+Math.imul(De,se)|0)+Math.imul(Ae,re)|0,s=s+Math.imul(Ae,se)|0,E=E+Math.imul(de,st)|0,i=(i=i+Math.imul(de,ye)|0)+Math.imul(he,st)|0,s=s+Math.imul(he,ye)|0,E=E+Math.imul(Z,me)|0,i=(i=i+Math.imul(Z,ke)|0)+Math.imul(ie,me)|0,s=s+Math.imul(ie,ke)|0,E=E+Math.imul(ae,le)|0,i=(i=i+Math.imul(ae,Ie)|0)+Math.imul(te,le)|0,s=s+Math.imul(te,Ie)|0,E=E+Math.imul(X,Ee)|0,i=(i=i+Math.imul(X,Me)|0)+Math.imul(V,Ee)|0,s=s+Math.imul(V,Me)|0,E=E+Math.imul(D,wt)|0,i=(i=i+Math.imul(D,Ne)|0)+Math.imul(Q,wt)|0,s=s+Math.imul(Q,Ne)|0,E=E+Math.imul(b,At)|0,i=(i=i+Math.imul(b,dt)|0)+Math.imul(M,At)|0,s=s+Math.imul(M,dt)|0;var dr=(_+(E=E+Math.imul(o,Et)|0)|0)+((8191&(i=(i=i+Math.imul(o,lt)|0)+Math.imul(r,Et)|0))<<13)|0;_=((s=s+Math.imul(r,lt)|0)+(i>>>13)|0)+(dr>>>26)|0,dr&=67108863,E=Math.imul(mt,N),i=(i=Math.imul(mt,$))+Math.imul(ne,N)|0,s=Math.imul(ne,$),E=E+Math.imul(ut,re)|0,i=(i=i+Math.imul(ut,se)|0)+Math.imul(qe,re)|0,s=s+Math.imul(qe,se)|0,E=E+Math.imul(De,st)|0,i=(i=i+Math.imul(De,ye)|0)+Math.imul(Ae,st)|0,s=s+Math.imul(Ae,ye)|0,E=E+Math.imul(de,me)|0,i=(i=i+Math.imul(de,ke)|0)+Math.imul(he,me)|0,s=s+Math.imul(he,ke)|0,E=E+Math.imul(Z,le)|0,i=(i=i+Math.imul(Z,Ie)|0)+Math.imul(ie,le)|0,s=s+Math.imul(ie,Ie)|0,E=E+Math.imul(ae,Ee)|0,i=(i=i+Math.imul(ae,Me)|0)+Math.imul(te,Ee)|0,s=s+Math.imul(te,Me)|0,E=E+Math.imul(X,wt)|0,i=(i=i+Math.imul(X,Ne)|0)+Math.imul(V,wt)|0,s=s+Math.imul(V,Ne)|0,E=E+Math.imul(D,At)|0,i=(i=i+Math.imul(D,dt)|0)+Math.imul(Q,At)|0,s=s+Math.imul(Q,dt)|0,E=E+Math.imul(b,Et)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(M,Et)|0,s=s+Math.imul(M,lt)|0;var qt=(_+(E=E+Math.imul(o,It)|0)|0)+((8191&(i=(i=i+Math.imul(o,pt)|0)+Math.imul(r,It)|0))<<13)|0;_=((s=s+Math.imul(r,pt)|0)+(i>>>13)|0)+(qt>>>26)|0,qt&=67108863,E=Math.imul(mt,re),i=(i=Math.imul(mt,se))+Math.imul(ne,re)|0,s=Math.imul(ne,se),E=E+Math.imul(ut,st)|0,i=(i=i+Math.imul(ut,ye)|0)+Math.imul(qe,st)|0,s=s+Math.imul(qe,ye)|0,E=E+Math.imul(De,me)|0,i=(i=i+Math.imul(De,ke)|0)+Math.imul(Ae,me)|0,s=s+Math.imul(Ae,ke)|0,E=E+Math.imul(de,le)|0,i=(i=i+Math.imul(de,Ie)|0)+Math.imul(he,le)|0,s=s+Math.imul(he,Ie)|0,E=E+Math.imul(Z,Ee)|0,i=(i=i+Math.imul(Z,Me)|0)+Math.imul(ie,Ee)|0,s=s+Math.imul(ie,Me)|0,E=E+Math.imul(ae,wt)|0,i=(i=i+Math.imul(ae,Ne)|0)+Math.imul(te,wt)|0,s=s+Math.imul(te,Ne)|0,E=E+Math.imul(X,At)|0,i=(i=i+Math.imul(X,dt)|0)+Math.imul(V,At)|0,s=s+Math.imul(V,dt)|0,E=E+Math.imul(D,Et)|0,i=(i=i+Math.imul(D,lt)|0)+Math.imul(Q,Et)|0,s=s+Math.imul(Q,lt)|0;var Dt=(_+(E=E+Math.imul(b,It)|0)|0)+((8191&(i=(i=i+Math.imul(b,pt)|0)+Math.imul(M,It)|0))<<13)|0;_=((s=s+Math.imul(M,pt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,E=Math.imul(mt,st),i=(i=Math.imul(mt,ye))+Math.imul(ne,st)|0,s=Math.imul(ne,ye),E=E+Math.imul(ut,me)|0,i=(i=i+Math.imul(ut,ke)|0)+Math.imul(qe,me)|0,s=s+Math.imul(qe,ke)|0,E=E+Math.imul(De,le)|0,i=(i=i+Math.imul(De,Ie)|0)+Math.imul(Ae,le)|0,s=s+Math.imul(Ae,Ie)|0,E=E+Math.imul(de,Ee)|0,i=(i=i+Math.imul(de,Me)|0)+Math.imul(he,Ee)|0,s=s+Math.imul(he,Me)|0,E=E+Math.imul(Z,wt)|0,i=(i=i+Math.imul(Z,Ne)|0)+Math.imul(ie,wt)|0,s=s+Math.imul(ie,Ne)|0,E=E+Math.imul(ae,At)|0,i=(i=i+Math.imul(ae,dt)|0)+Math.imul(te,At)|0,s=s+Math.imul(te,dt)|0,E=E+Math.imul(X,Et)|0,i=(i=i+Math.imul(X,lt)|0)+Math.imul(V,Et)|0,s=s+Math.imul(V,lt)|0;var rr=(_+(E=E+Math.imul(D,It)|0)|0)+((8191&(i=(i=i+Math.imul(D,pt)|0)+Math.imul(Q,It)|0))<<13)|0;_=((s=s+Math.imul(Q,pt)|0)+(i>>>13)|0)+(rr>>>26)|0,rr&=67108863,E=Math.imul(mt,me),i=(i=Math.imul(mt,ke))+Math.imul(ne,me)|0,s=Math.imul(ne,ke),E=E+Math.imul(ut,le)|0,i=(i=i+Math.imul(ut,Ie)|0)+Math.imul(qe,le)|0,s=s+Math.imul(qe,Ie)|0,E=E+Math.imul(De,Ee)|0,i=(i=i+Math.imul(De,Me)|0)+Math.imul(Ae,Ee)|0,s=s+Math.imul(Ae,Me)|0,E=E+Math.imul(de,wt)|0,i=(i=i+Math.imul(de,Ne)|0)+Math.imul(he,wt)|0,s=s+Math.imul(he,Ne)|0,E=E+Math.imul(Z,At)|0,i=(i=i+Math.imul(Z,dt)|0)+Math.imul(ie,At)|0,s=s+Math.imul(ie,dt)|0,E=E+Math.imul(ae,Et)|0,i=(i=i+Math.imul(ae,lt)|0)+Math.imul(te,Et)|0,s=s+Math.imul(te,lt)|0;var sr=(_+(E=E+Math.imul(X,It)|0)|0)+((8191&(i=(i=i+Math.imul(X,pt)|0)+Math.imul(V,It)|0))<<13)|0;_=((s=s+Math.imul(V,pt)|0)+(i>>>13)|0)+(sr>>>26)|0,sr&=67108863,E=Math.imul(mt,le),i=(i=Math.imul(mt,Ie))+Math.imul(ne,le)|0,s=Math.imul(ne,Ie),E=E+Math.imul(ut,Ee)|0,i=(i=i+Math.imul(ut,Me)|0)+Math.imul(qe,Ee)|0,s=s+Math.imul(qe,Me)|0,E=E+Math.imul(De,wt)|0,i=(i=i+Math.imul(De,Ne)|0)+Math.imul(Ae,wt)|0,s=s+Math.imul(Ae,Ne)|0,E=E+Math.imul(de,At)|0,i=(i=i+Math.imul(de,dt)|0)+Math.imul(he,At)|0,s=s+Math.imul(he,dt)|0,E=E+Math.imul(Z,Et)|0,i=(i=i+Math.imul(Z,lt)|0)+Math.imul(ie,Et)|0,s=s+Math.imul(ie,lt)|0;var ir=(_+(E=E+Math.imul(ae,It)|0)|0)+((8191&(i=(i=i+Math.imul(ae,pt)|0)+Math.imul(te,It)|0))<<13)|0;_=((s=s+Math.imul(te,pt)|0)+(i>>>13)|0)+(ir>>>26)|0,ir&=67108863,E=Math.imul(mt,Ee),i=(i=Math.imul(mt,Me))+Math.imul(ne,Ee)|0,s=Math.imul(ne,Me),E=E+Math.imul(ut,wt)|0,i=(i=i+Math.imul(ut,Ne)|0)+Math.imul(qe,wt)|0,s=s+Math.imul(qe,Ne)|0,E=E+Math.imul(De,At)|0,i=(i=i+Math.imul(De,dt)|0)+Math.imul(Ae,At)|0,s=s+Math.imul(Ae,dt)|0,E=E+Math.imul(de,Et)|0,i=(i=i+Math.imul(de,lt)|0)+Math.imul(he,Et)|0,s=s+Math.imul(he,lt)|0;var lr=(_+(E=E+Math.imul(Z,It)|0)|0)+((8191&(i=(i=i+Math.imul(Z,pt)|0)+Math.imul(ie,It)|0))<<13)|0;_=((s=s+Math.imul(ie,pt)|0)+(i>>>13)|0)+(lr>>>26)|0,lr&=67108863,E=Math.imul(mt,wt),i=(i=Math.imul(mt,Ne))+Math.imul(ne,wt)|0,s=Math.imul(ne,Ne),E=E+Math.imul(ut,At)|0,i=(i=i+Math.imul(ut,dt)|0)+Math.imul(qe,At)|0,s=s+Math.imul(qe,dt)|0,E=E+Math.imul(De,Et)|0,i=(i=i+Math.imul(De,lt)|0)+Math.imul(Ae,Et)|0,s=s+Math.imul(Ae,lt)|0;var nr=(_+(E=E+Math.imul(de,It)|0)|0)+((8191&(i=(i=i+Math.imul(de,pt)|0)+Math.imul(he,It)|0))<<13)|0;_=((s=s+Math.imul(he,pt)|0)+(i>>>13)|0)+(nr>>>26)|0,nr&=67108863,E=Math.imul(mt,At),i=(i=Math.imul(mt,dt))+Math.imul(ne,At)|0,s=Math.imul(ne,dt),E=E+Math.imul(ut,Et)|0,i=(i=i+Math.imul(ut,lt)|0)+Math.imul(qe,Et)|0,s=s+Math.imul(qe,lt)|0;var ur=(_+(E=E+Math.imul(De,It)|0)|0)+((8191&(i=(i=i+Math.imul(De,pt)|0)+Math.imul(Ae,It)|0))<<13)|0;_=((s=s+Math.imul(Ae,pt)|0)+(i>>>13)|0)+(ur>>>26)|0,ur&=67108863,E=Math.imul(mt,Et),i=(i=Math.imul(mt,lt))+Math.imul(ne,Et)|0,s=Math.imul(ne,lt);var it=(_+(E=E+Math.imul(ut,It)|0)|0)+((8191&(i=(i=i+Math.imul(ut,pt)|0)+Math.imul(qe,It)|0))<<13)|0;_=((s=s+Math.imul(qe,pt)|0)+(i>>>13)|0)+(it>>>26)|0,it&=67108863;var we=(_+(E=Math.imul(mt,It))|0)+((8191&(i=(i=Math.imul(mt,pt))+Math.imul(ne,It)|0))<<13)|0;return _=((s=Math.imul(ne,pt))+(i>>>13)|0)+(we>>>26)|0,we&=67108863,p[0]=ft,p[1]=Tt,p[2]=vt,p[3]=at,p[4]=Bt,p[5]=Wt,p[6]=Pt,p[7]=Nt,p[8]=dr,p[9]=qt,p[10]=Dt,p[11]=rr,p[12]=sr,p[13]=ir,p[14]=lr,p[15]=nr,p[16]=ur,p[17]=it,p[18]=we,_!==0&&(p[19]=_,J.length++),J};function x(j,z,J){return new A().mulp(j,z,J)}function A(j,z){(this||et).x=j,(this||et).y=z}Math.imul||(S=g),a.prototype.mulTo=function(j,z){var J=(this||et).length+j.length;return(this||et).length===10&&j.length===10?S(this||et,j,z):J<63?g(this||et,j,z):J<1024?function(E,i,s){s.negative=i.negative^E.negative,s.length=E.length+i.length;for(var u=0,c=0,p=0;p<s.length-1;p++){var _=c;c=0;for(var R=67108863&u,o=Math.min(p,i.length-1),r=Math.max(0,p-E.length+1);r<=o;r++){var h=p-r,b=(0|E.words[h])*(0|i.words[r]),M=67108863&b;R=67108863&(M=M+R|0),c+=(_=(_=_+(b/67108864|0)|0)+(M>>>26)|0)>>>26,_&=67108863}s.words[p]=R,u=_,_=c}return u!==0?s.words[p]=u:s.length--,s.strip()}(this||et,j,z):x(this||et,j,z)},A.prototype.makeRBT=function(j){for(var z=new Array(j),J=a.prototype._countBits(j)-1,E=0;E<j;E++)z[E]=this.revBin(E,J,j);return z},A.prototype.revBin=function(j,z,J){if(j===0||j===J-1)return j;for(var E=0,i=0;i<z;i++)E|=(1&j)<<z-i-1,j>>=1;return E},A.prototype.permute=function(j,z,J,E,i,s){for(var u=0;u<s;u++)E[u]=z[j[u]],i[u]=J[j[u]]},A.prototype.transform=function(j,z,J,E,i,s){this.permute(s,j,z,J,E,i);for(var u=1;u<i;u<<=1)for(var c=u<<1,p=Math.cos(2*Math.PI/c),_=Math.sin(2*Math.PI/c),R=0;R<i;R+=c)for(var o=p,r=_,h=0;h<u;h++){var b=J[R+h],M=E[R+h],k=J[R+h+u],D=E[R+h+u],Q=o*k-r*D;D=o*D+r*k,k=Q,J[R+h]=b+k,E[R+h]=M+D,J[R+h+u]=b-k,E[R+h+u]=M-D,h!==c&&(Q=p*o-_*r,r=p*r+_*o,o=Q)}},A.prototype.guessLen13b=function(j,z){var J=1|Math.max(z,j),E=1&J,i=0;for(J=J/2|0;J;J>>>=1)i++;return 1<<i+1+E},A.prototype.conjugate=function(j,z,J){if(!(J<=1))for(var E=0;E<J/2;E++){var i=j[E];j[E]=j[J-E-1],j[J-E-1]=i,i=z[E],z[E]=-z[J-E-1],z[J-E-1]=-i}},A.prototype.normalize13b=function(j,z){for(var J=0,E=0;E<z/2;E++){var i=8192*Math.round(j[2*E+1]/z)+Math.round(j[2*E]/z)+J;j[E]=67108863&i,J=i<67108864?0:i/67108864|0}return j},A.prototype.convert13b=function(j,z,J,E){for(var i=0,s=0;s<z;s++)i+=0|j[s],J[2*s]=8191&i,i>>>=13,J[2*s+1]=8191&i,i>>>=13;for(s=2*z;s<E;++s)J[s]=0;n(i===0),n((-8192&i)==0)},A.prototype.stub=function(j){for(var z=new Array(j),J=0;J<j;J++)z[J]=0;return z},A.prototype.mulp=function(j,z,J){var E=2*this.guessLen13b(j.length,z.length),i=this.makeRBT(E),s=this.stub(E),u=new Array(E),c=new Array(E),p=new Array(E),_=new Array(E),R=new Array(E),o=new Array(E),r=J.words;r.length=E,this.convert13b(j.words,j.length,u,E),this.convert13b(z.words,z.length,_,E),this.transform(u,s,c,p,E,i),this.transform(_,s,R,o,E,i);for(var h=0;h<E;h++){var b=c[h]*R[h]-p[h]*o[h];p[h]=c[h]*o[h]+p[h]*R[h],c[h]=b}return this.conjugate(c,p,E),this.transform(c,p,r,s,E,i),this.conjugate(r,s,E),this.normalize13b(r,E),J.negative=j.negative^z.negative,J.length=j.length+z.length,J.strip()},a.prototype.mul=function(j){var z=new a(null);return z.words=new Array((this||et).length+j.length),this.mulTo(j,z)},a.prototype.mulf=function(j){var z=new a(null);return z.words=new Array((this||et).length+j.length),x(this||et,j,z)},a.prototype.imul=function(j){return this.clone().mulTo(j,this||et)},a.prototype.imuln=function(j){n(typeof j=="number"),n(j<67108864);for(var z=0,J=0;J<(this||et).length;J++){var E=(0|(this||et).words[J])*j,i=(67108863&E)+(67108863&z);z>>=26,z+=E/67108864|0,z+=i>>>26,(this||et).words[J]=67108863&i}return z!==0&&((this||et).words[J]=z,(this||et).length++),this||et},a.prototype.muln=function(j){return this.clone().imuln(j)},a.prototype.sqr=function(){return this.mul(this||et)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(j){var z=function(s){for(var u=new Array(s.bitLength()),c=0;c<u.length;c++){var p=c/26|0,_=c%26;u[c]=(s.words[p]&1<<_)>>>_}return u}(j);if(z.length===0)return new a(1);for(var J=this||et,E=0;E<z.length&&z[E]===0;E++,J=J.sqr());if(++E<z.length)for(var i=J.sqr();E<z.length;E++,i=i.sqr())z[E]!==0&&(J=J.mul(i));return J},a.prototype.iushln=function(j){n(typeof j=="number"&&j>=0);var z,J=j%26,E=(j-J)/26,i=67108863>>>26-J<<26-J;if(J!==0){var s=0;for(z=0;z<(this||et).length;z++){var u=(this||et).words[z]&i,c=(0|(this||et).words[z])-u<<J;(this||et).words[z]=c|s,s=u>>>26-J}s&&((this||et).words[z]=s,(this||et).length++)}if(E!==0){for(z=(this||et).length-1;z>=0;z--)(this||et).words[z+E]=(this||et).words[z];for(z=0;z<E;z++)(this||et).words[z]=0;(this||et).length+=E}return this.strip()},a.prototype.ishln=function(j){return n((this||et).negative===0),this.iushln(j)},a.prototype.iushrn=function(j,z,J){var E;n(typeof j=="number"&&j>=0),E=z?(z-z%26)/26:0;var i=j%26,s=Math.min((j-i)/26,(this||et).length),u=67108863^67108863>>>i<<i,c=J;if(E-=s,E=Math.max(0,E),c){for(var p=0;p<s;p++)c.words[p]=(this||et).words[p];c.length=s}if(s!==0)if((this||et).length>s)for((this||et).length-=s,p=0;p<(this||et).length;p++)(this||et).words[p]=(this||et).words[p+s];else(this||et).words[0]=0,(this||et).length=1;var _=0;for(p=(this||et).length-1;p>=0&&(_!==0||p>=E);p--){var R=0|(this||et).words[p];(this||et).words[p]=_<<26-i|R>>>i,_=R&u}return c&&_!==0&&(c.words[c.length++]=_),(this||et).length===0&&((this||et).words[0]=0,(this||et).length=1),this.strip()},a.prototype.ishrn=function(j,z,J){return n((this||et).negative===0),this.iushrn(j,z,J)},a.prototype.shln=function(j){return this.clone().ishln(j)},a.prototype.ushln=function(j){return this.clone().iushln(j)},a.prototype.shrn=function(j){return this.clone().ishrn(j)},a.prototype.ushrn=function(j){return this.clone().iushrn(j)},a.prototype.testn=function(j){n(typeof j=="number"&&j>=0);var z=j%26,J=(j-z)/26,E=1<<z;return!((this||et).length<=J)&&!!((this||et).words[J]&E)},a.prototype.imaskn=function(j){n(typeof j=="number"&&j>=0);var z=j%26,J=(j-z)/26;if(n((this||et).negative===0,"imaskn works only with positive numbers"),(this||et).length<=J)return this||et;if(z!==0&&J++,(this||et).length=Math.min(J,(this||et).length),z!==0){var E=67108863^67108863>>>z<<z;(this||et).words[(this||et).length-1]&=E}return this.strip()},a.prototype.maskn=function(j){return this.clone().imaskn(j)},a.prototype.iaddn=function(j){return n(typeof j=="number"),n(j<67108864),j<0?this.isubn(-j):(this||et).negative!==0?(this||et).length===1&&(0|(this||et).words[0])<j?((this||et).words[0]=j-(0|(this||et).words[0]),(this||et).negative=0,this||et):((this||et).negative=0,this.isubn(j),(this||et).negative=1,this||et):this._iaddn(j)},a.prototype._iaddn=function(j){(this||et).words[0]+=j;for(var z=0;z<(this||et).length&&(this||et).words[z]>=67108864;z++)(this||et).words[z]-=67108864,z===(this||et).length-1?(this||et).words[z+1]=1:(this||et).words[z+1]++;return(this||et).length=Math.max((this||et).length,z+1),this||et},a.prototype.isubn=function(j){if(n(typeof j=="number"),n(j<67108864),j<0)return this.iaddn(-j);if((this||et).negative!==0)return(this||et).negative=0,this.iaddn(j),(this||et).negative=1,this||et;if((this||et).words[0]-=j,(this||et).length===1&&(this||et).words[0]<0)(this||et).words[0]=-(this||et).words[0],(this||et).negative=1;else for(var z=0;z<(this||et).length&&(this||et).words[z]<0;z++)(this||et).words[z]+=67108864,(this||et).words[z+1]-=1;return this.strip()},a.prototype.addn=function(j){return this.clone().iaddn(j)},a.prototype.subn=function(j){return this.clone().isubn(j)},a.prototype.iabs=function(){return(this||et).negative=0,this||et},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(j,z,J){var E,i,s=j.length+J;this._expand(s);var u=0;for(E=0;E<j.length;E++){i=(0|(this||et).words[E+J])+u;var c=(0|j.words[E])*z;u=((i-=67108863&c)>>26)-(c/67108864|0),(this||et).words[E+J]=67108863&i}for(;E<(this||et).length-J;E++)u=(i=(0|(this||et).words[E+J])+u)>>26,(this||et).words[E+J]=67108863&i;if(u===0)return this.strip();for(n(u===-1),u=0,E=0;E<(this||et).length;E++)u=(i=-(0|(this||et).words[E])+u)>>26,(this||et).words[E]=67108863&i;return(this||et).negative=1,this.strip()},a.prototype._wordDiv=function(j,z){var J=((this||et).length,j.length),E=this.clone(),i=j,s=0|i.words[i.length-1];(J=26-this._countBits(s))!==0&&(i=i.ushln(J),E.iushln(J),s=0|i.words[i.length-1]);var u,c=E.length-i.length;if(z!=="mod"){(u=new a(null)).length=c+1,u.words=new Array(u.length);for(var p=0;p<u.length;p++)u.words[p]=0}var _=E.clone()._ishlnsubmul(i,1,c);_.negative===0&&(E=_,u&&(u.words[c]=1));for(var R=c-1;R>=0;R--){var o=67108864*(0|E.words[i.length+R])+(0|E.words[i.length+R-1]);for(o=Math.min(o/s|0,67108863),E._ishlnsubmul(i,o,R);E.negative!==0;)o--,E.negative=0,E._ishlnsubmul(i,1,R),E.isZero()||(E.negative^=1);u&&(u.words[R]=o)}return u&&u.strip(),E.strip(),z!=="div"&&J!==0&&E.iushrn(J),{div:u||null,mod:E}},a.prototype.divmod=function(j,z,J){return n(!j.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:(this||et).negative!==0&&j.negative===0?(s=this.neg().divmod(j,z),z!=="mod"&&(E=s.div.neg()),z!=="div"&&(i=s.mod.neg(),J&&i.negative!==0&&i.iadd(j)),{div:E,mod:i}):(this||et).negative===0&&j.negative!==0?(s=this.divmod(j.neg(),z),z!=="mod"&&(E=s.div.neg()),{div:E,mod:s.mod}):(this||et).negative&j.negative?(s=this.neg().divmod(j.neg(),z),z!=="div"&&(i=s.mod.neg(),J&&i.negative!==0&&i.isub(j)),{div:s.div,mod:i}):j.length>(this||et).length||this.cmp(j)<0?{div:new a(0),mod:this||et}:j.length===1?z==="div"?{div:this.divn(j.words[0]),mod:null}:z==="mod"?{div:null,mod:new a(this.modn(j.words[0]))}:{div:this.divn(j.words[0]),mod:new a(this.modn(j.words[0]))}:this._wordDiv(j,z);var E,i,s},a.prototype.div=function(j){return this.divmod(j,"div",!1).div},a.prototype.mod=function(j){return this.divmod(j,"mod",!1).mod},a.prototype.umod=function(j){return this.divmod(j,"mod",!0).mod},a.prototype.divRound=function(j){var z=this.divmod(j);if(z.mod.isZero())return z.div;var J=z.div.negative!==0?z.mod.isub(j):z.mod,E=j.ushrn(1),i=j.andln(1),s=J.cmp(E);return s<0||i===1&&s===0?z.div:z.div.negative!==0?z.div.isubn(1):z.div.iaddn(1)},a.prototype.modn=function(j){n(j<=67108863);for(var z=(1<<26)%j,J=0,E=(this||et).length-1;E>=0;E--)J=(z*J+(0|(this||et).words[E]))%j;return J},a.prototype.idivn=function(j){n(j<=67108863);for(var z=0,J=(this||et).length-1;J>=0;J--){var E=(0|(this||et).words[J])+67108864*z;(this||et).words[J]=E/j|0,z=E%j}return this.strip()},a.prototype.divn=function(j){return this.clone().idivn(j)},a.prototype.egcd=function(j){n(j.negative===0),n(!j.isZero());var z=this||et,J=j.clone();z=z.negative!==0?z.umod(j):z.clone();for(var E=new a(1),i=new a(0),s=new a(0),u=new a(1),c=0;z.isEven()&&J.isEven();)z.iushrn(1),J.iushrn(1),++c;for(var p=J.clone(),_=z.clone();!z.isZero();){for(var R=0,o=1;!(z.words[0]&o)&&R<26;++R,o<<=1);if(R>0)for(z.iushrn(R);R-- >0;)(E.isOdd()||i.isOdd())&&(E.iadd(p),i.isub(_)),E.iushrn(1),i.iushrn(1);for(var r=0,h=1;!(J.words[0]&h)&&r<26;++r,h<<=1);if(r>0)for(J.iushrn(r);r-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(p),u.isub(_)),s.iushrn(1),u.iushrn(1);z.cmp(J)>=0?(z.isub(J),E.isub(s),i.isub(u)):(J.isub(z),s.isub(E),u.isub(i))}return{a:s,b:u,gcd:J.iushln(c)}},a.prototype._invmp=function(j){n(j.negative===0),n(!j.isZero());var z=this||et,J=j.clone();z=z.negative!==0?z.umod(j):z.clone();for(var E,i=new a(1),s=new a(0),u=J.clone();z.cmpn(1)>0&&J.cmpn(1)>0;){for(var c=0,p=1;!(z.words[0]&p)&&c<26;++c,p<<=1);if(c>0)for(z.iushrn(c);c-- >0;)i.isOdd()&&i.iadd(u),i.iushrn(1);for(var _=0,R=1;!(J.words[0]&R)&&_<26;++_,R<<=1);if(_>0)for(J.iushrn(_);_-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);z.cmp(J)>=0?(z.isub(J),i.isub(s)):(J.isub(z),s.isub(i))}return(E=z.cmpn(1)===0?i:s).cmpn(0)<0&&E.iadd(j),E},a.prototype.gcd=function(j){if(this.isZero())return j.abs();if(j.isZero())return this.abs();var z=this.clone(),J=j.clone();z.negative=0,J.negative=0;for(var E=0;z.isEven()&&J.isEven();E++)z.iushrn(1),J.iushrn(1);for(;;){for(;z.isEven();)z.iushrn(1);for(;J.isEven();)J.iushrn(1);var i=z.cmp(J);if(i<0){var s=z;z=J,J=s}else if(i===0||J.cmpn(1)===0)break;z.isub(J)}return J.iushln(E)},a.prototype.invm=function(j){return this.egcd(j).a.umod(j)},a.prototype.isEven=function(){return(1&(this||et).words[0])==0},a.prototype.isOdd=function(){return(1&(this||et).words[0])==1},a.prototype.andln=function(j){return(this||et).words[0]&j},a.prototype.bincn=function(j){n(typeof j=="number");var z=j%26,J=(j-z)/26,E=1<<z;if((this||et).length<=J)return this._expand(J+1),(this||et).words[J]|=E,this||et;for(var i=E,s=J;i!==0&&s<(this||et).length;s++){var u=0|(this||et).words[s];i=(u+=i)>>>26,u&=67108863,(this||et).words[s]=u}return i!==0&&((this||et).words[s]=i,(this||et).length++),this||et},a.prototype.isZero=function(){return(this||et).length===1&&(this||et).words[0]===0},a.prototype.cmpn=function(j){var z,J=j<0;if((this||et).negative!==0&&!J)return-1;if((this||et).negative===0&&J)return 1;if(this.strip(),(this||et).length>1)z=1;else{J&&(j=-j),n(j<=67108863,"Number is too big");var E=0|(this||et).words[0];z=E===j?0:E<j?-1:1}return(this||et).negative!==0?0|-z:z},a.prototype.cmp=function(j){if((this||et).negative!==0&&j.negative===0)return-1;if((this||et).negative===0&&j.negative!==0)return 1;var z=this.ucmp(j);return(this||et).negative!==0?0|-z:z},a.prototype.ucmp=function(j){if((this||et).length>j.length)return 1;if((this||et).length<j.length)return-1;for(var z=0,J=(this||et).length-1;J>=0;J--){var E=0|(this||et).words[J],i=0|j.words[J];if(E!==i){E<i?z=-1:E>i&&(z=1);break}}return z},a.prototype.gtn=function(j){return this.cmpn(j)===1},a.prototype.gt=function(j){return this.cmp(j)===1},a.prototype.gten=function(j){return this.cmpn(j)>=0},a.prototype.gte=function(j){return this.cmp(j)>=0},a.prototype.ltn=function(j){return this.cmpn(j)===-1},a.prototype.lt=function(j){return this.cmp(j)===-1},a.prototype.lten=function(j){return this.cmpn(j)<=0},a.prototype.lte=function(j){return this.cmp(j)<=0},a.prototype.eqn=function(j){return this.cmpn(j)===0},a.prototype.eq=function(j){return this.cmp(j)===0},a.red=function(j){return new K(j)},a.prototype.toRed=function(j){return n(!(this||et).red,"Already a number in reduction context"),n((this||et).negative===0,"red works only with positives"),j.convertTo(this||et)._forceRed(j)},a.prototype.fromRed=function(){return n((this||et).red,"fromRed works only with numbers in reduction context"),(this||et).red.convertFrom(this||et)},a.prototype._forceRed=function(j){return(this||et).red=j,this||et},a.prototype.forceRed=function(j){return n(!(this||et).red,"Already a number in reduction context"),this._forceRed(j)},a.prototype.redAdd=function(j){return n((this||et).red,"redAdd works only with red numbers"),(this||et).red.add(this||et,j)},a.prototype.redIAdd=function(j){return n((this||et).red,"redIAdd works only with red numbers"),(this||et).red.iadd(this||et,j)},a.prototype.redSub=function(j){return n((this||et).red,"redSub works only with red numbers"),(this||et).red.sub(this||et,j)},a.prototype.redISub=function(j){return n((this||et).red,"redISub works only with red numbers"),(this||et).red.isub(this||et,j)},a.prototype.redShl=function(j){return n((this||et).red,"redShl works only with red numbers"),(this||et).red.shl(this||et,j)},a.prototype.redMul=function(j){return n((this||et).red,"redMul works only with red numbers"),(this||et).red._verify2(this||et,j),(this||et).red.mul(this||et,j)},a.prototype.redIMul=function(j){return n((this||et).red,"redMul works only with red numbers"),(this||et).red._verify2(this||et,j),(this||et).red.imul(this||et,j)},a.prototype.redSqr=function(){return n((this||et).red,"redSqr works only with red numbers"),(this||et).red._verify1(this||et),(this||et).red.sqr(this||et)},a.prototype.redISqr=function(){return n((this||et).red,"redISqr works only with red numbers"),(this||et).red._verify1(this||et),(this||et).red.isqr(this||et)},a.prototype.redSqrt=function(){return n((this||et).red,"redSqrt works only with red numbers"),(this||et).red._verify1(this||et),(this||et).red.sqrt(this||et)},a.prototype.redInvm=function(){return n((this||et).red,"redInvm works only with red numbers"),(this||et).red._verify1(this||et),(this||et).red.invm(this||et)},a.prototype.redNeg=function(){return n((this||et).red,"redNeg works only with red numbers"),(this||et).red._verify1(this||et),(this||et).red.neg(this||et)},a.prototype.redPow=function(j){return n((this||et).red&&!j.red,"redPow(normalNum)"),(this||et).red._verify1(this||et),(this||et).red.pow(this||et,j)};var T={k256:null,p224:null,p192:null,p25519:null};function I(j,z){(this||et).name=j,(this||et).p=new a(z,16),(this||et).n=(this||et).p.bitLength(),(this||et).k=new a(1).iushln((this||et).n).isub((this||et).p),(this||et).tmp=this._tmp()}function B(){I.call(this||et,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P(){I.call(this||et,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function C(){I.call(this||et,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function q(){I.call(this||et,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function K(j){if(typeof j=="string"){var z=a._prime(j);(this||et).m=z.p,(this||et).prime=z}else n(j.gtn(1),"modulus must be greater than 1"),(this||et).m=j,(this||et).prime=null}function G(j){K.call(this||et,j),(this||et).shift=(this||et).m.bitLength(),(this||et).shift%26!=0&&((this||et).shift+=26-(this||et).shift%26),(this||et).r=new a(1).iushln((this||et).shift),(this||et).r2=this.imod((this||et).r.sqr()),(this||et).rinv=(this||et).r._invmp((this||et).m),(this||et).minv=(this||et).rinv.mul((this||et).r).isubn(1).div((this||et).m),(this||et).minv=(this||et).minv.umod((this||et).r),(this||et).minv=(this||et).r.sub((this||et).minv)}I.prototype._tmp=function(){var j=new a(null);return j.words=new Array(Math.ceil((this||et).n/13)),j},I.prototype.ireduce=function(j){var z,J=j;do this.split(J,(this||et).tmp),z=(J=(J=this.imulK(J)).iadd((this||et).tmp)).bitLength();while(z>(this||et).n);var E=z<(this||et).n?-1:J.ucmp((this||et).p);return E===0?(J.words[0]=0,J.length=1):E>0?J.isub((this||et).p):J.strip(),J},I.prototype.split=function(j,z){j.iushrn((this||et).n,0,z)},I.prototype.imulK=function(j){return j.imul((this||et).k)},f(B,I),B.prototype.split=function(j,z){for(var J=Math.min(j.length,9),E=0;E<J;E++)z.words[E]=j.words[E];if(z.length=J,j.length<=9)return j.words[0]=0,j.length=1,void 0;var i=j.words[9];for(z.words[z.length++]=4194303&i,E=10;E<j.length;E++){var s=0|j.words[E];j.words[E-10]=(4194303&s)<<4|i>>>22,i=s}i>>>=22,j.words[E-10]=i,i===0&&j.length>10?j.length-=10:j.length-=9},B.prototype.imulK=function(j){j.words[j.length]=0,j.words[j.length+1]=0,j.length+=2;for(var z=0,J=0;J<j.length;J++){var E=0|j.words[J];z+=977*E,j.words[J]=67108863&z,z=64*E+(z/67108864|0)}return j.words[j.length-1]===0&&(j.length--,j.words[j.length-1]===0&&j.length--),j},f(P,I),f(C,I),f(q,I),q.prototype.imulK=function(j){for(var z=0,J=0;J<j.length;J++){var E=19*(0|j.words[J])+z,i=67108863&E;E>>>=26,j.words[J]=i,z=E}return z!==0&&(j.words[j.length++]=z),j},a._prime=function(j){if(T[j])return T[j];var z;if(j==="k256")z=new B;else if(j==="p224")z=new P;else if(j==="p192")z=new C;else{if(j!=="p25519")throw new Error("Unknown prime "+j);z=new q}return T[j]=z,z},K.prototype._verify1=function(j){n(j.negative===0,"red works only with positives"),n(j.red,"red works only with red numbers")},K.prototype._verify2=function(j,z){n((j.negative|z.negative)==0,"red works only with positives"),n(j.red&&j.red===z.red,"red works only with red numbers")},K.prototype.imod=function(j){return(this||et).prime?(this||et).prime.ireduce(j)._forceRed(this||et):j.umod((this||et).m)._forceRed(this||et)},K.prototype.neg=function(j){return j.isZero()?j.clone():(this||et).m.sub(j)._forceRed(this||et)},K.prototype.add=function(j,z){this._verify2(j,z);var J=j.add(z);return J.cmp((this||et).m)>=0&&J.isub((this||et).m),J._forceRed(this||et)},K.prototype.iadd=function(j,z){this._verify2(j,z);var J=j.iadd(z);return J.cmp((this||et).m)>=0&&J.isub((this||et).m),J},K.prototype.sub=function(j,z){this._verify2(j,z);var J=j.sub(z);return J.cmpn(0)<0&&J.iadd((this||et).m),J._forceRed(this||et)},K.prototype.isub=function(j,z){this._verify2(j,z);var J=j.isub(z);return J.cmpn(0)<0&&J.iadd((this||et).m),J},K.prototype.shl=function(j,z){return this._verify1(j),this.imod(j.ushln(z))},K.prototype.imul=function(j,z){return this._verify2(j,z),this.imod(j.imul(z))},K.prototype.mul=function(j,z){return this._verify2(j,z),this.imod(j.mul(z))},K.prototype.isqr=function(j){return this.imul(j,j.clone())},K.prototype.sqr=function(j){return this.mul(j,j)},K.prototype.sqrt=function(j){if(j.isZero())return j.clone();var z=(this||et).m.andln(3);if(n(z%2==1),z===3){var J=(this||et).m.add(new a(1)).iushrn(2);return this.pow(j,J)}for(var E=(this||et).m.subn(1),i=0;!E.isZero()&&E.andln(1)===0;)i++,E.iushrn(1);n(!E.isZero());var s=new a(1).toRed(this||et),u=s.redNeg(),c=(this||et).m.subn(1).iushrn(1),p=(this||et).m.bitLength();for(p=new a(2*p*p).toRed(this||et);this.pow(p,c).cmp(u)!==0;)p.redIAdd(u);for(var _=this.pow(p,E),R=this.pow(j,E.addn(1).iushrn(1)),o=this.pow(j,E),r=i;o.cmp(s)!==0;){for(var h=o,b=0;h.cmp(s)!==0;b++)h=h.redSqr();n(b<r);var M=this.pow(_,new a(1).iushln(r-b-1));R=R.redMul(M),_=M.redSqr(),o=o.redMul(_),r=b}return R},K.prototype.invm=function(j){var z=j._invmp((this||et).m);return z.negative!==0?(z.negative=0,this.imod(z).redNeg()):this.imod(z)},K.prototype.pow=function(j,z){if(z.isZero())return new a(1).toRed(this||et);if(z.cmpn(1)===0)return j.clone();var J=new Array(16);J[0]=new a(1).toRed(this||et),J[1]=j;for(var E=2;E<J.length;E++)J[E]=this.mul(J[E-1],j);var i=J[0],s=0,u=0,c=z.bitLength()%26;for(c===0&&(c=26),E=z.length-1;E>=0;E--){for(var p=z.words[E],_=c-1;_>=0;_--){var R=p>>_&1;i!==J[0]&&(i=this.sqr(i)),R!==0||s!==0?(s<<=1,s|=R,(++u===4||E===0&&_===0)&&(i=this.mul(i,J[s]),u=0,s=0)):u=0}c=26}return i},K.prototype.convertTo=function(j){var z=j.umod((this||et).m);return z===j?z.clone():z},K.prototype.convertFrom=function(j){var z=j.clone();return z.red=null,z},a.mont=function(j){return new G(j)},f(G,K),G.prototype.convertTo=function(j){return this.imod(j.ushln((this||et).shift))},G.prototype.convertFrom=function(j){var z=this.imod(j.mul((this||et).rinv));return z.red=null,z},G.prototype.imul=function(j,z){if(j.isZero()||z.isZero())return j.words[0]=0,j.length=1,j;var J=j.imul(z),E=J.maskn((this||et).shift).mul((this||et).minv).imaskn((this||et).shift).mul((this||et).m),i=J.isub(E).iushrn((this||et).shift),s=i;return i.cmp((this||et).m)>=0?s=i.isub((this||et).m):i.cmpn(0)<0&&(s=i.iadd((this||et).m)),s._forceRed(this||et)},G.prototype.mul=function(j,z){if(j.isZero()||z.isZero())return new a(0)._forceRed(this||et);var J=j.mul(z),E=J.maskn((this||et).shift).mul((this||et).minv).imaskn((this||et).shift).mul((this||et).m),i=J.isub(E).iushrn((this||et).shift),s=i;return i.cmp((this||et).m)>=0?s=i.isub((this||et).m):i.cmpn(0)<0&&(s=i.iadd((this||et).m)),s._forceRed(this||et)},G.prototype.invm=function(j){return this.imod(j._invmp((this||et).m).mul((this||et).r2))._forceRed(this||et)}})(cee,lee);Yn=cee.exports,sEe=Object.freeze({}),m3=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;if((dee=function(e){return JS||(JS=new ol(null)),JS.generate(e)}).Rand=ol,ol.prototype.generate=function(e){return this._rand(e)},ol.prototype._rand=function(e){if((this||m3).rand.getBytes)return(this||m3).rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=(this||m3).rand.getByte();return t},typeof self=="object")self.crypto&&self.crypto.getRandomValues?ol.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?ol.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:typeof window=="object"&&(ol.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(XS=sEe,typeof XS.randomBytes!="function")throw new Error("Not supported");ol.prototype._rand=function(e){return XS.randomBytes(e)}}catch(e){}RR=dee,vee=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,j0=Yn,fEe=RR;pee=F0,F0.create=function(e){return new F0(e)},F0.prototype._randbelow=function(e){var t=e.bitLength(),n=Math.ceil(t/8);do var f=new j0((this||vee).rand.generate(n));while(f.cmp(e)>=0);return f},F0.prototype._randrange=function(e,t){var n=t.sub(e);return e.add(this._randbelow(n))},F0.prototype.test=function(e,t,n){var f=e.bitLength(),a=j0.mont(e),d=new j0(1).toRed(a);t||(t=Math.max(1,f/48|0));for(var l=e.subn(1),v=0;!l.testn(v);v++);for(var w=e.shrn(v),m=l.toRed(a);t>0;t--){var y=this._randrange(new j0(2),l);n&&n(y);var g=y.toRed(a).redPow(w);if(g.cmp(d)!==0&&g.cmp(m)!==0){for(var S=1;S<v;S++){if((g=g.redSqr()).cmp(d)===0)return!1;if(g.cmp(m)===0)break}if(S===v)return!1}}return!0},F0.prototype.getDivisor=function(e,t){var n=e.bitLength(),f=j0.mont(e),a=new j0(1).toRed(f);t||(t=Math.max(1,n/48|0));for(var d=e.subn(1),l=0;!d.testn(l);l++);for(var v=e.shrn(l),w=d.toRed(f);t>0;t--){var m=this._randrange(new j0(2),d),y=e.gcd(m);if(y.cmpn(1)!==0)return y;var g=m.toRed(f).redPow(v);if(g.cmp(a)!==0&&g.cmp(w)!==0){for(var S=1;S<l;S++){if((g=g.redSqr()).cmp(a)===0)return g.fromRed().subn(1).gcd(e);if(g.cmp(w)===0)break}if(S===l)return(g=g.redSqr()).fromRed().subn(1).gcd(e)}}return!1};mee=pee,uEe=w1;gee=eE,eE.simpleSieve=Yx,eE.fermatTest=Jx;Ha=Yn,hEe=new Ha(24),bV=new mee,lEe=new Ha(1),Gx=new Ha(2),cEe=new Ha(5),dEe=(new Ha(16),new Ha(8),new Ha(10)),pEe=new Ha(3),vEe=(new Ha(7),new Ha(11)),wV=new Ha(4),QS=(new Ha(12),null);bee=gee,ki=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,xu=Dr.Buffer,Us=Yn,_V=new mee,gEe=new Us(24),yEe=new Us(11),bEe=new Us(10),wEe=new Us(3),_Ee=new Us(7),MV=bee,MEe=w1;yee=dh;kb={};Object.defineProperty(dh.prototype,"verifyError",{enumerable:!0,get:function(){return typeof(this||ki)._primeCode!="number"&&((this||ki)._primeCode=function(e,t){var n=t.toString("hex"),f=[n,e.toString(16)].join("_");if(f in kb)return kb[f];var a,d=0;if(e.isEven()||!MV.simpleSieve||!MV.fermatTest(e)||!_V.test(e))return d+=1,d+=n==="02"||n==="05"?8:4,kb[f]=d,d;switch(_V.test(e.shrn(1))||(d+=2),n){case"02":e.mod(gEe).cmp(yEe)&&(d+=8);break;case"05":(a=e.mod(bEe)).cmp(wEe)&&a.cmp(_Ee)&&(d+=8);break;default:d+=4}return kb[f]=d,d}((this||ki).__prime,(this||ki).__gen)),(this||ki)._primeCode}}),dh.prototype.generateKeys=function(){return(this||ki)._priv||((this||ki)._priv=new Us(MEe((this||ki)._primeLen))),(this||ki)._pub=(this||ki)._gen.toRed((this||ki)._prime).redPow((this||ki)._priv).fromRed(),this.getPublicKey()},dh.prototype.computeSecret=function(e){var t=(e=(e=new Us(e)).toRed((this||ki)._prime)).redPow((this||ki)._priv).fromRed(),n=new xu(t.toArray()),f=this.getPrime();if(n.length<f.length){var a=new xu(f.length-n.length);a.fill(0),n=xu.concat([a,n])}return n},dh.prototype.getPublicKey=function(e){return Tb((this||ki)._pub,e)},dh.prototype.getPrivateKey=function(e){return Tb((this||ki)._priv,e)},dh.prototype.getPrime=function(e){return Tb((this||ki).__prime,e)},dh.prototype.getGenerator=function(e){return Tb((this||ki)._gen,e)},dh.prototype.setGenerator=function(e,t){return t=t||"utf8",xu.isBuffer(e)||(e=new xu(e,t)),(this||ki).__gen=e,(this||ki)._gen=new Us(e),this||ki};AEe=yee,a1={},sl=Dr.Buffer,xEe=bee,SV={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}},tE=AEe,REe={binary:!0,hex:!0,base64:!0};a1.DiffieHellmanGroup=a1.createDiffieHellmanGroup=a1.getDiffieHellman=function(e){var t=new sl(SV[e].prime,"hex"),n=new sl(SV[e].gen,"hex");return new tE(t,n)},a1.createDiffieHellman=a1.DiffieHellman=function e(t,n,f,a){return sl.isBuffer(n)||REe[n]===void 0?e(t,"binary",n,f):(n=n||"binary",a=a||"binary",f=f||new sl([2]),sl.isBuffer(f)||(f=new sl(f,a)),typeof t=="number"?new tE(xEe(t,f),f,!0):(sl.isBuffer(t)||(t=new sl(t,n)),new tE(t,f,!0)))};kEe=Dr.Buffer,Rl=Yn,EV=w1;wee=AV,AV.getr=_ee;kR=wee,TR={},Ib=TR;Ib.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if(typeof e!="string"){for(var f=0;f<e.length;f++)n[f]=0|e[f];return n}if(t==="hex")for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),f=0;f<e.length;f+=2)n.push(parseInt(e[f]+e[f+1],16));else for(f=0;f<e.length;f++){var a=e.charCodeAt(f),d=a>>8,l=255&a;d?n.push(d,l):n.push(l)}return n},Ib.zero2=Mee,Ib.toHex=xV,Ib.encode=function(e,t){return t==="hex"?xV(e):e};Ho={},kf=Ho,TEe=Yn,IEe=js,Bb=TR;kf.assert=IEe,kf.toArray=Bb.toArray,kf.zero2=Bb.zero2,kf.toHex=Bb.toHex,kf.encode=Bb.encode,kf.getNAF=function(e,t,n){var f=new Array(Math.max(e.bitLength(),n)+1);f.fill(0);for(var a=1<<t+1,d=e.clone(),l=0;l<f.length;l++){var v,w=d.andln(a-1);d.isOdd()?(v=w>(a>>1)-1?(a>>1)-w:w,d.isubn(v)):v=0,f[l]=v,d.iushrn(1)}return f},kf.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var f=0,a=0;e.cmpn(-f)>0||t.cmpn(-a)>0;){var d,l,v,w=e.andln(3)+f&3,m=t.andln(3)+a&3;w===3&&(w=-1),m===3&&(m=-1),(1&w)==0?d=0:d=(v=e.andln(7)+f&7)!==3&&v!==5||m!==2?w:-w,n[0].push(d),(1&m)==0?l=0:l=(v=t.andln(7)+a&7)!==3&&v!==5||w!==2?m:-m,n[1].push(l),2*f===d+1&&(f=1-f),2*a===l+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return n},kf.cachedProperty=function(e,t,n){var f="_"+t;e.prototype[t]=function(){return this[f]!==void 0?this[f]:this[f]=n.call(this)}},kf.parseBytes=function(e){return typeof e=="string"?kf.toArray(e,"hex"):e},kf.intFromLE=function(e){return new TEe(e,"hex","le")};A3=Yn,Xx=Ho,BEe=Xx.assert;See=g3,g3.prototype._importDER=function(e,t){e=Xx.toArray(e,t);var n=new OEe;if(e[n.place++]!==48||rE(e,n)+n.place!==e.length||e[n.place++]!==2)return!1;var f=rE(e,n),a=e.slice(n.place,f+n.place);if(n.place+=f,e[n.place++]!==2)return!1;var d=rE(e,n);if(e.length!==d+n.place)return!1;var l=e.slice(n.place,d+n.place);return a[0]===0&&128&a[1]&&(a=a.slice(1)),l[0]===0&&128&l[1]&&(l=l.slice(1)),this.r=new A3(a),this.s=new A3(l),this.recoveryParam=null,!0},g3.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=RV(t),n=RV(n);!(n[0]||128&n[1]);)n=n.slice(1);var f=[2];iE(f,t.length),(f=f.concat(t)).push(2),iE(f,n.length);var a=f.concat(n),d=[48];return iE(d,a.length),d=d.concat(a),Xx.encode(d,e)};PEe=See,Ei={},NEe=js,CEe=Vr;Ei.inherits=CEe,Ei.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if(typeof e=="string")if(t){if(t==="hex")for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a<e.length;a+=2)n.push(parseInt(e[a]+e[a+1],16))}else for(var f=0,a=0;a<e.length;a++){var d=e.charCodeAt(a);d<128?n[f++]=d:d<2048?(n[f++]=d>>6|192,n[f++]=63&d|128):LEe(e,a)?(d=65536+((1023&d)<<10)+(1023&e.charCodeAt(++a)),n[f++]=d>>18|240,n[f++]=d>>12&63|128,n[f++]=d>>6&63|128,n[f++]=63&d|128):(n[f++]=d>>12|224,n[f++]=d>>6&63|128,n[f++]=63&d|128)}else for(a=0;a<e.length;a++)n[a]=0|e[a];return n},Ei.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=TV(e[n].toString(16));return t},Ei.htonl=kV,Ei.toHex32=function(e,t){for(var n="",f=0;f<e.length;f++){var a=e[f];t==="little"&&(a=kV(a)),n+=IV(a.toString(16))}return n},Ei.zero2=TV,Ei.zero8=IV,Ei.join32=function(e,t,n,f){var a=n-t;NEe(a%4==0);for(var d=new Array(a/4),l=0,v=t;l<d.length;l++,v+=4){var w;w=f==="big"?e[v]<<24|e[v+1]<<16|e[v+2]<<8|e[v+3]:e[v+3]<<24|e[v+2]<<16|e[v+1]<<8|e[v],d[l]=w>>>0}return d},Ei.split32=function(e,t){for(var n=new Array(4*e.length),f=0,a=0;f<e.length;f++,a+=4){var d=e[f];t==="big"?(n[a]=d>>>24,n[a+1]=d>>>16&255,n[a+2]=d>>>8&255,n[a+3]=255&d):(n[a+3]=d>>>24,n[a+2]=d>>>16&255,n[a+1]=d>>>8&255,n[a]=255&d)}return n},Ei.rotr32=function(e,t){return e>>>t|e<<32-t},Ei.rotl32=function(e,t){return e<<t|e>>>32-t},Ei.sum32=function(e,t){return e+t>>>0},Ei.sum32_3=function(e,t,n){return e+t+n>>>0},Ei.sum32_4=function(e,t,n,f){return e+t+n+f>>>0},Ei.sum32_5=function(e,t,n,f,a){return e+t+n+f+a>>>0},Ei.sum64=function(e,t,n,f){var a=e[t],d=f+e[t+1]>>>0,l=(d<f?1:0)+n+a;e[t]=l>>>0,e[t+1]=d},Ei.sum64_hi=function(e,t,n,f){return(t+f>>>0<t?1:0)+e+n>>>0},Ei.sum64_lo=function(e,t,n,f){return t+f>>>0},Ei.sum64_4_hi=function(e,t,n,f,a,d,l,v){var w=0,m=t;return w+=(m=m+f>>>0)<t?1:0,w+=(m=m+d>>>0)<d?1:0,e+n+a+l+(w+=(m=m+v>>>0)<v?1:0)>>>0},Ei.sum64_4_lo=function(e,t,n,f,a,d,l,v){return t+f+d+v>>>0},Ei.sum64_5_hi=function(e,t,n,f,a,d,l,v,w,m){var y=0,g=t;return y+=(g=g+f>>>0)<t?1:0,y+=(g=g+d>>>0)<d?1:0,y+=(g=g+v>>>0)<v?1:0,e+n+a+l+w+(y+=(g=g+m>>>0)<m?1:0)>>>0},Ei.sum64_5_lo=function(e,t,n,f,a,d,l,v,w,m){return t+f+d+v+m>>>0},Ei.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},Ei.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},Ei.shr64_hi=function(e,t,n){return e>>>n},Ei.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0};M1={},BV=Ei,DEe=js;M1.BlockHash=Ob,Ob.prototype.update=function(e,t){if(e=BV.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=BV.join32(e,0,e.length-n,this.endian);for(var f=0;f<e.length;f+=this._delta32)this._update(e,f,f+this._delta32)}return this},Ob.prototype.digest=function(e){return this.update(this._pad()),DEe(this.pending===null),this._digest(e)},Ob.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,f=new Array(n+this.padLength);f[0]=128;for(var a=1;a<n;a++)f[a]=0;if(e<<=3,this.endian==="big"){for(var d=8;d<this.padLength;d++)f[a++]=0;f[a++]=0,f[a++]=0,f[a++]=0,f[a++]=0,f[a++]=e>>>24&255,f[a++]=e>>>16&255,f[a++]=e>>>8&255,f[a++]=255&e}else for(f[a++]=255&e,f[a++]=e>>>8&255,f[a++]=e>>>16&255,f[a++]=e>>>24&255,f[a++]=0,f[a++]=0,f[a++]=0,f[a++]=0,d=8;d<this.padLength;d++)f[a++]=0;return f};Eo=Ei,$Ee=M1,UEe=js,Ru=Eo.rotr64_hi,ku=Eo.rotr64_lo,Aee=Eo.shr64_hi,xee=Eo.shr64_lo,fl=Eo.sum64,nE=Eo.sum64_hi,aE=Eo.sum64_lo,qEe=Eo.sum64_4_hi,jEe=Eo.sum64_4_lo,FEe=Eo.sum64_5_hi,zEe=Eo.sum64_5_lo,Ree=$Ee.BlockHash,HEe=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];Eo.inherits(Pf,Ree),Eee=Pf,Pf.blockSize=1024,Pf.outSize=512,Pf.hmacStrength=192,Pf.padLength=128,Pf.prototype._prepareBlock=function(e,t){for(var n=this.W,f=0;f<32;f++)n[f]=e[t+f];for(;f<n.length;f+=2){var a=tAe(n[f-4],n[f-3]),d=rAe(n[f-4],n[f-3]),l=n[f-14],v=n[f-13],w=QEe(n[f-30],n[f-29]),m=eAe(n[f-30],n[f-29]),y=n[f-32],g=n[f-31];n[f]=qEe(a,d,l,v,w,m,y,g),n[f+1]=jEe(a,d,l,v,w,m,y,g)}},Pf.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,f=this.h[0],a=this.h[1],d=this.h[2],l=this.h[3],v=this.h[4],w=this.h[5],m=this.h[6],y=this.h[7],g=this.h[8],S=this.h[9],x=this.h[10],A=this.h[11],T=this.h[12],I=this.h[13],B=this.h[14],P=this.h[15];UEe(this.k.length===n.length);for(var C=0;C<n.length;C+=2){var q=B,K=P,G=JEe(g,S),j=XEe(g,S),z=KEe(g,S,x,A,T),J=ZEe(g,S,x,A,T,I),E=this.k[C],i=this.k[C+1],s=n[C],u=n[C+1],c=FEe(q,K,G,j,z,J,E,i,s,u),p=zEe(q,K,G,j,z,J,E,i,s,u);q=GEe(f,a),K=YEe(f,a),G=WEe(f,a,d,l,v),j=VEe(f,a,d,l,v,w);var _=nE(q,K,G,j),R=aE(q,K,G,j);B=T,P=I,T=x,I=A,x=g,A=S,g=nE(m,y,c,p),S=aE(y,y,c,p),m=v,y=w,v=d,w=l,d=f,l=a,f=nE(c,p,_,R),a=aE(c,p,_,R)}fl(this.h,0,f,a),fl(this.h,2,d,l),fl(this.h,4,v,w),fl(this.h,6,m,y),fl(this.h,8,g,S),fl(this.h,10,x,A),fl(this.h,12,T,I),fl(this.h,14,B,P)},Pf.prototype._digest=function(e){return e==="hex"?Eo.toHex32(this.h,"big"):Eo.split32(this.h,"big")};kee=Eee,_u={},gu=Ei.rotr32;_u.ft_1=function(e,t,n,f){return e===0?OV(t,n,f):e===1||e===3?NV(t,n,f):e===2?PV(t,n,f):void 0},_u.ch32=OV,_u.maj32=PV,_u.p32=NV,_u.s0_256=function(e){return gu(e,2)^gu(e,13)^gu(e,22)},_u.s1_256=function(e){return gu(e,6)^gu(e,11)^gu(e,25)},_u.g0_256=function(e){return gu(e,7)^gu(e,18)^e>>>3},_u.g1_256=function(e){return gu(e,17)^gu(e,19)^e>>>10};h1=Ei,iAe=M1,S1=_u,nAe=js,Tf=h1.sum32,aAe=h1.sum32_4,oAe=h1.sum32_5,sAe=S1.ch32,fAe=S1.maj32,uAe=S1.s0_256,hAe=S1.s1_256,lAe=S1.g0_256,cAe=S1.g1_256,Iee=iAe.BlockHash,dAe=[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];h1.inherits(Mu,Iee),Tee=Mu,Mu.blockSize=512,Mu.outSize=256,Mu.hmacStrength=192,Mu.padLength=64,Mu.prototype._update=function(e,t){for(var n=this.W,f=0;f<16;f++)n[f]=e[t+f];for(;f<n.length;f++)n[f]=aAe(cAe(n[f-2]),n[f-7],lAe(n[f-15]),n[f-16]);var a=this.h[0],d=this.h[1],l=this.h[2],v=this.h[3],w=this.h[4],m=this.h[5],y=this.h[6],g=this.h[7];for(nAe(this.k.length===n.length),f=0;f<n.length;f++){var S=oAe(g,hAe(w),sAe(w,m,y),this.k[f],n[f]),x=Tf(uAe(a),fAe(a,d,l));g=y,y=m,m=w,w=Tf(v,S),v=l,l=d,d=a,a=Tf(S,x)}this.h[0]=Tf(this.h[0],a),this.h[1]=Tf(this.h[1],d),this.h[2]=Tf(this.h[2],l),this.h[3]=Tf(this.h[3],v),this.h[4]=Tf(this.h[4],w),this.h[5]=Tf(this.h[5],m),this.h[6]=Tf(this.h[6],y),this.h[7]=Tf(this.h[7],g)},Mu.prototype._digest=function(e){return e==="hex"?h1.toHex32(this.h,"big"):h1.split32(this.h,"big")};Bee=Tee,l1=Ei,pAe=M1,vAe=_u,oE=l1.rotl32,a2=l1.sum32,mAe=l1.sum32_5,gAe=vAe.ft_1,Pee=pAe.BlockHash,yAe=[1518500249,1859775393,2400959708,3395469782];l1.inherits(Su,Pee),Oee=Su,Su.blockSize=512,Su.outSize=160,Su.hmacStrength=80,Su.padLength=64,Su.prototype._update=function(e,t){for(var n=this.W,f=0;f<16;f++)n[f]=e[t+f];for(;f<n.length;f++)n[f]=oE(n[f-3]^n[f-8]^n[f-14]^n[f-16],1);var a=this.h[0],d=this.h[1],l=this.h[2],v=this.h[3],w=this.h[4];for(f=0;f<n.length;f++){var m=~~(f/20),y=mAe(oE(a,5),gAe(m,d,l,v),w,n[f],yAe[m]);w=v,v=l,l=oE(d,30),d=a,a=y}this.h[0]=a2(this.h[0],a),this.h[1]=a2(this.h[1],d),this.h[2]=a2(this.h[2],l),this.h[3]=a2(this.h[3],v),this.h[4]=a2(this.h[4],w)},Su.prototype._digest=function(e){return e==="hex"?l1.toHex32(this.h,"big"):l1.split32(this.h,"big")};bAe=Oee,sE=Ei,Cee=Bee;sE.inherits(vh,Cee),Nee=vh,vh.blockSize=512,vh.outSize=224,vh.hmacStrength=192,vh.padLength=64,vh.prototype._digest=function(e){return e==="hex"?sE.toHex32(this.h.slice(0,7),"big"):sE.split32(this.h.slice(0,7),"big")};wAe=Nee,fE=Ei,Dee=kee;fE.inherits(mh,Dee),Lee=mh,mh.blockSize=1024,mh.outSize=384,mh.hmacStrength=192,mh.padLength=128,mh.prototype._digest=function(e){return e==="hex"?fE.toHex32(this.h.slice(0,12),"big"):fE.split32(this.h.slice(0,12),"big")};_Ae=Lee,o1={};o1.sha1=bAe,o1.sha224=wAe,o1.sha256=Bee,o1.sha384=_Ae,o1.sha512=kee;$ee={},uc=Ei,MAe=M1,Pb=uc.rotl32,CV=uc.sum32,o2=uc.sum32_3,LV=uc.sum32_4,Uee=MAe.BlockHash;uc.inherits(Eu,Uee),$ee.ripemd160=Eu,Eu.blockSize=512,Eu.outSize=160,Eu.hmacStrength=192,Eu.padLength=64,Eu.prototype._update=function(e,t){for(var n=this.h[0],f=this.h[1],a=this.h[2],d=this.h[3],l=this.h[4],v=n,w=f,m=a,y=d,g=l,S=0;S<80;S++){var x=CV(Pb(LV(n,DV(S,f,a,d),e[AAe[S]+t],SAe(S)),RAe[S]),l);n=l,l=d,d=Pb(a,10),a=f,f=x,x=CV(Pb(LV(v,DV(79-S,w,m,y),e[xAe[S]+t],EAe(S)),kAe[S]),g),v=g,g=y,y=Pb(m,10),m=w,w=x}x=o2(this.h[1],a,y),this.h[1]=o2(this.h[2],d,g),this.h[2]=o2(this.h[3],l,v),this.h[3]=o2(this.h[4],n,w),this.h[4]=o2(this.h[0],f,m),this.h[0]=x},Eu.prototype._digest=function(e){return e==="hex"?uc.toHex32(this.h,"little"):uc.split32(this.h,"little")};AAe=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],xAe=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],RAe=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],kAe=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],TAe=Ei,IAe=js;qee=s1,s1.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),IAe(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=new this.Hash().update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)},s1.prototype.update=function(e,t){return this.inner.update(e,t),this},s1.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};BAe=qee,q3={},Ra=q3;Ra.utils=Ei,Ra.common=M1,Ra.sha=o1,Ra.ripemd=$ee,Ra.hmac=BAe,Ra.sha1=Ra.sha.sha1,Ra.sha256=Ra.sha.sha256,Ra.sha224=Ra.sha.sha224,Ra.sha384=Ra.sha.sha384,Ra.sha512=Ra.sha.sha512,Ra.ripemd160=Ra.ripemd.ripemd160;OAe=q3,sc=TR,Fee=js;jee=kl,kl.prototype._init=function(e,t,n){var f=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(f),this._reseed=1,this.reseedInterval=281474976710656},kl.prototype._hmac=function(){return new OAe.hmac(this.hash,this.K)},kl.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},kl.prototype.reseed=function(e,t,n,f){typeof t!="string"&&(f=n,n=t,t=null),e=sc.toArray(e,t),n=sc.toArray(n,f),Fee(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},kl.prototype.generate=function(e,t,n,f){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(f=n,n=t,t=null),n&&(n=sc.toArray(n,f||"hex"),this._update(n));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var d=a.slice(0,e);return this._update(n),this._reseed++,sc.encode(d,t)};PAe=jee,z0=Yn,N2=Ho,Nb=N2.getNAF,NAe=N2.getJSF,Cb=N2.assert;zee=ul,ul.prototype.point=function(){throw new Error("Not implemented")},ul.prototype.validate=function(){throw new Error("Not implemented")},ul.prototype._fixedNafMul=function(e,t){Cb(e.precomputed);var n=e._getDoubles(),f=Nb(t,1,this._bitLength),a=(1<<n.step+1)-(n.step%2==0?2:1);a/=3;for(var d=[],l=0;l<f.length;l+=n.step){var v=0;for(t=l+n.step-1;t>=l;t--)v=(v<<1)+f[t];d.push(v)}for(var w=this.jpoint(null,null,null),m=this.jpoint(null,null,null),y=a;y>0;y--){for(l=0;l<d.length;l++)(v=d[l])===y?m=m.mixedAdd(n.points[l]):v===-y&&(m=m.mixedAdd(n.points[l].neg()));w=w.add(m)}return w.toP()},ul.prototype._wnafMul=function(e,t){var n=4,f=e._getNAFPoints(n);n=f.wnd;for(var a=f.points,d=Nb(t,n,this._bitLength),l=this.jpoint(null,null,null),v=d.length-1;v>=0;v--){for(t=0;v>=0&&d[v]===0;v--)t++;if(v>=0&&t++,l=l.dblp(t),v<0)break;var w=d[v];Cb(w!==0),l=e.type==="affine"?w>0?l.mixedAdd(a[w-1>>1]):l.mixedAdd(a[-w-1>>1].neg()):w>0?l.add(a[w-1>>1]):l.add(a[-w-1>>1].neg())}return e.type==="affine"?l.toP():l},ul.prototype._wnafMulAdd=function(e,t,n,f,a){for(var d=this._wnafT1,l=this._wnafT2,v=this._wnafT3,w=0,m=0;m<f;m++){var y=(j=t[m])._getNAFPoints(e);d[m]=y.wnd,l[m]=y.points}for(m=f-1;m>=1;m-=2){var g=m-1,S=m;if(d[g]===1&&d[S]===1){var x=[t[g],null,null,t[S]];t[g].y.cmp(t[S].y)===0?(x[1]=t[g].add(t[S]),x[2]=t[g].toJ().mixedAdd(t[S].neg())):t[g].y.cmp(t[S].y.redNeg())===0?(x[1]=t[g].toJ().mixedAdd(t[S]),x[2]=t[g].add(t[S].neg())):(x[1]=t[g].toJ().mixedAdd(t[S]),x[2]=t[g].toJ().mixedAdd(t[S].neg()));var A=[-3,-1,-5,-7,0,7,5,1,3],T=NAe(n[g],n[S]);w=Math.max(T[0].length,w),v[g]=new Array(w),v[S]=new Array(w);for(var I=0;I<w;I++){var B=0|T[0][I],P=0|T[1][I];v[g][I]=A[3*(B+1)+(P+1)],v[S][I]=0,l[g]=x}}else v[g]=Nb(n[g],d[g],this._bitLength),v[S]=Nb(n[S],d[S],this._bitLength),w=Math.max(v[g].length,w),w=Math.max(v[S].length,w)}var C=this.jpoint(null,null,null),q=this._wnafT4;for(m=w;m>=0;m--){for(var K=0;m>=0;){var G=!0;for(I=0;I<f;I++)q[I]=0|v[I][m],q[I]!==0&&(G=!1);if(!G)break;K++,m--}if(m>=0&&K++,C=C.dblp(K),m<0)break;for(I=0;I<f;I++){var j,z=q[I];z!==0&&(z>0?j=l[I][z-1>>1]:z<0&&(j=l[I][-z-1>>1].neg()),C=j.type==="affine"?C.mixedAdd(j):C.add(j))}}for(m=0;m<f;m++)l[m]=null;return a?C:C.toP()},ul.BasePoint=Bs,Bs.prototype.eq=function(){throw new Error("Not implemented")},Bs.prototype.validate=function(){return this.curve.validate(this)},ul.prototype.decodePoint=function(e,t){e=N2.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1==2*n)return e[0]===6?Cb(e[e.length-1]%2==0):e[0]===7&&Cb(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")},Bs.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Bs.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},Bs.prototype.encode=function(e,t){return N2.encode(this._encode(t),e)},Bs.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},Bs.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},Bs.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],f=this,a=0;a<t;a+=e){for(var d=0;d<e;d++)f=f.dbl();n.push(f)}return{step:e,points:n}},Bs.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,f=n===1?null:this.dbl(),a=1;a<n;a++)t[a]=t[a-1].add(f);return{wnd:e,points:t}},Bs.prototype._getBeta=function(){return null},Bs.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t};j3=zee,Ln=Yn,uE=Vr,c1=j3,CAe=Ho.assert;uE(Os,c1),Hee=Os,Os.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&this.p.modn(3)===1){var t,n;if(e.beta)t=new Ln(e.beta,16).toRed(this.red);else{var f=this._getEndoRoots(this.p);t=(t=f[0].cmp(f[1])<0?f[0]:f[1]).toRed(this.red)}if(e.lambda)n=new Ln(e.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))===0?n=a[0]:(n=a[1],CAe(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}return{beta:t,lambda:n,basis:e.basis?e.basis.map(function(d){return{a:new Ln(d.a,16),b:new Ln(d.b,16)}}):this._getEndoBasis(n)}}},Os.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Ln.mont(e),n=new Ln(2).toRed(t).redInvm(),f=n.redNeg(),a=new Ln(3).toRed(t).redNeg().redSqrt().redMul(n);return[f.redAdd(a).fromRed(),f.redSub(a).fromRed()]},Os.prototype._getEndoBasis=function(e){for(var t,n,f,a,d,l,v,w,m,y=this.n.ushrn(Math.floor(this.n.bitLength()/2)),g=e,S=this.n.clone(),x=new Ln(1),A=new Ln(0),T=new Ln(0),I=new Ln(1),B=0;g.cmpn(0)!==0;){var P=S.div(g);w=S.sub(P.mul(g)),m=T.sub(P.mul(x));var C=I.sub(P.mul(A));if(!f&&w.cmp(y)<0)t=v.neg(),n=x,f=w.neg(),a=m;else if(f&&++B==2)break;v=w,S=g,g=w,T=x,x=m,I=A,A=C}d=w.neg(),l=m;var q=f.sqr().add(a.sqr());return d.sqr().add(l.sqr()).cmp(q)>=0&&(d=t,l=n),f.negative&&(f=f.neg(),a=a.neg()),d.negative&&(d=d.neg(),l=l.neg()),[{a:f,b:a},{a:d,b:l}]},Os.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],f=t[1],a=f.b.mul(e).divRound(this.n),d=n.b.neg().mul(e).divRound(this.n),l=a.mul(n.a),v=d.mul(f.a),w=a.mul(n.b),m=d.mul(f.b);return{k1:e.sub(l).sub(v),k2:w.add(m).neg()}},Os.prototype.pointFromX=function(e,t){(e=new Ln(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),f=n.redSqrt();if(f.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var a=f.fromRed().isOdd();return(t&&!a||!t&&a)&&(f=f.redNeg()),this.point(e,f)},Os.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,f=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(f).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0},Os.prototype._endoWnafMulAdd=function(e,t,n){for(var f=this._endoWnafT1,a=this._endoWnafT2,d=0;d<e.length;d++){var l=this._endoSplit(t[d]),v=e[d],w=v._getBeta();l.k1.negative&&(l.k1.ineg(),v=v.neg(!0)),l.k2.negative&&(l.k2.ineg(),w=w.neg(!0)),f[2*d]=v,f[2*d+1]=w,a[2*d]=l.k1,a[2*d+1]=l.k2}for(var m=this._wnafMulAdd(1,f,a,2*d,n),y=0;y<2*d;y++)f[y]=null,a[y]=null;return m},uE(ba,c1.BasePoint),Os.prototype.point=function(e,t,n){return new ba(this,e,t,n)},Os.prototype.pointFromJSON=function(e,t){return ba.fromJSON(this,e,t)},ba.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,f=function(a){return n.point(a.x.redMul(n.endo.beta),a.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(f)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(f)}}}return t}},ba.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},ba.fromJSON=function(e,t,n){typeof t=="string"&&(t=JSON.parse(t));var f=e.point(t[0],t[1],n);if(!t[2])return f;function a(l){return e.point(l[0],l[1],n)}var d=t[2];return f.precomputed={beta:null,doubles:d.doubles&&{step:d.doubles.step,points:[f].concat(d.doubles.points.map(a))},naf:d.naf&&{wnd:d.naf.wnd,points:[f].concat(d.naf.points.map(a))}},f},ba.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},ba.prototype.isInfinity=function(){return this.inf},ba.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),f=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,f)},ba.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),f=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(f),d=a.redSqr().redISub(this.x.redAdd(this.x)),l=a.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,l)},ba.prototype.getX=function(){return this.x.fromRed()},ba.prototype.getY=function(){return this.y.fromRed()},ba.prototype.mul=function(e){return e=new Ln(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},ba.prototype.mulAdd=function(e,t,n){var f=[this,t],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(f,a):this.curve._wnafMulAdd(1,f,a,2)},ba.prototype.jmulAdd=function(e,t,n){var f=[this,t],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(f,a,!0):this.curve._wnafMulAdd(1,f,a,2,!0)},ba.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},ba.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,f=function(a){return a.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(f)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(f)}}}return t},ba.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},uE(ka,c1.BasePoint),Os.prototype.jpoint=function(e,t,n){return new ka(this,e,t,n)},ka.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),f=this.y.redMul(t).redMul(e);return this.curve.point(n,f)},ka.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},ka.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),f=this.x.redMul(t),a=e.x.redMul(n),d=this.y.redMul(t.redMul(e.z)),l=e.y.redMul(n.redMul(this.z)),v=f.redSub(a),w=d.redSub(l);if(v.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=v.redSqr(),y=m.redMul(v),g=f.redMul(m),S=w.redSqr().redIAdd(y).redISub(g).redISub(g),x=w.redMul(g.redISub(S)).redISub(d.redMul(y)),A=this.z.redMul(e.z).redMul(v);return this.curve.jpoint(S,x,A)},ka.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,f=e.x.redMul(t),a=this.y,d=e.y.redMul(t).redMul(this.z),l=n.redSub(f),v=a.redSub(d);if(l.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=l.redSqr(),m=w.redMul(l),y=n.redMul(w),g=v.redSqr().redIAdd(m).redISub(y).redISub(y),S=v.redMul(y.redISub(g)).redISub(a.redMul(m)),x=this.z.redMul(l);return this.curve.jpoint(g,S,x)},ka.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,n=0;n<e;n++)t=t.dbl();return t}var f=this.curve.a,a=this.curve.tinv,d=this.x,l=this.y,v=this.z,w=v.redSqr().redSqr(),m=l.redAdd(l);for(n=0;n<e;n++){var y=d.redSqr(),g=m.redSqr(),S=g.redSqr(),x=y.redAdd(y).redIAdd(y).redIAdd(f.redMul(w)),A=d.redMul(g),T=x.redSqr().redISub(A.redAdd(A)),I=A.redISub(T),B=x.redMul(I);B=B.redIAdd(B).redISub(S);var P=m.redMul(v);n+1<e&&(w=w.redMul(S)),d=T,v=P,m=B}return this.curve.jpoint(d,m.redMul(a),v)},ka.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},ka.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var f=this.x.redSqr(),a=this.y.redSqr(),d=a.redSqr(),l=this.x.redAdd(a).redSqr().redISub(f).redISub(d);l=l.redIAdd(l);var v=f.redAdd(f).redIAdd(f),w=v.redSqr().redISub(l).redISub(l),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=w,t=v.redMul(l.redISub(w)).redISub(m),n=this.y.redAdd(this.y)}else{var y=this.x.redSqr(),g=this.y.redSqr(),S=g.redSqr(),x=this.x.redAdd(g).redSqr().redISub(y).redISub(S);x=x.redIAdd(x);var A=y.redAdd(y).redIAdd(y),T=A.redSqr(),I=S.redIAdd(S);I=(I=I.redIAdd(I)).redIAdd(I),e=T.redISub(x).redISub(x),t=A.redMul(x.redISub(e)).redISub(I),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,t,n)},ka.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var f=this.x.redSqr(),a=this.y.redSqr(),d=a.redSqr(),l=this.x.redAdd(a).redSqr().redISub(f).redISub(d);l=l.redIAdd(l);var v=f.redAdd(f).redIAdd(f).redIAdd(this.curve.a),w=v.redSqr().redISub(l).redISub(l);e=w;var m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),t=v.redMul(l.redISub(w)).redISub(m),n=this.y.redAdd(this.y)}else{var y=this.z.redSqr(),g=this.y.redSqr(),S=this.x.redMul(g),x=this.x.redSub(y).redMul(this.x.redAdd(y));x=x.redAdd(x).redIAdd(x);var A=S.redIAdd(S),T=(A=A.redIAdd(A)).redAdd(A);e=x.redSqr().redISub(T),n=this.y.redAdd(this.z).redSqr().redISub(g).redISub(y);var I=g.redSqr();I=(I=(I=I.redIAdd(I)).redIAdd(I)).redIAdd(I),t=x.redMul(A.redISub(e)).redISub(I)}return this.curve.jpoint(e,t,n)},ka.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,f=this.z,a=f.redSqr().redSqr(),d=t.redSqr(),l=n.redSqr(),v=d.redAdd(d).redIAdd(d).redIAdd(e.redMul(a)),w=t.redAdd(t),m=(w=w.redIAdd(w)).redMul(l),y=v.redSqr().redISub(m.redAdd(m)),g=m.redISub(y),S=l.redSqr();S=(S=(S=S.redIAdd(S)).redIAdd(S)).redIAdd(S);var x=v.redMul(g).redISub(S),A=n.redAdd(n).redMul(f);return this.curve.jpoint(y,x,A)},ka.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),f=t.redSqr(),a=e.redAdd(e).redIAdd(e),d=a.redSqr(),l=this.x.redAdd(t).redSqr().redISub(e).redISub(f),v=(l=(l=(l=l.redIAdd(l)).redAdd(l).redIAdd(l)).redISub(d)).redSqr(),w=f.redIAdd(f);w=(w=(w=w.redIAdd(w)).redIAdd(w)).redIAdd(w);var m=a.redIAdd(l).redSqr().redISub(d).redISub(v).redISub(w),y=t.redMul(m);y=(y=y.redIAdd(y)).redIAdd(y);var g=this.x.redMul(v).redISub(y);g=(g=g.redIAdd(g)).redIAdd(g);var S=this.y.redMul(m.redMul(w.redISub(m)).redISub(l.redMul(v)));S=(S=(S=S.redIAdd(S)).redIAdd(S)).redIAdd(S);var x=this.z.redAdd(l).redSqr().redISub(n).redISub(v);return this.curve.jpoint(g,S,x)},ka.prototype.mul=function(e,t){return e=new Ln(e,t),this.curve._wnafMul(this,e)},ka.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var f=t.redMul(this.z),a=n.redMul(e.z);return this.y.redMul(a).redISub(e.y.redMul(f)).cmpn(0)===0},ka.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var f=e.clone(),a=this.curve.redN.redMul(t);;){if(f.iadd(this.curve.n),f.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}},ka.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},ka.prototype.isInfinity=function(){return this.z.cmpn(0)===0};LAe=Hee,f1=Yn,$V=Vr,x3=j3,DAe=Ho;$V(Xd,x3),Kee=Xd,Xd.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),f=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return f.redSqrt().redSqr().cmp(f)===0},$V(wa,x3.BasePoint),Xd.prototype.decodePoint=function(e,t){return this.point(DAe.toArray(e,t),1)},Xd.prototype.point=function(e,t){return new wa(this,e,t)},Xd.prototype.pointFromJSON=function(e){return wa.fromJSON(this,e)},wa.prototype.precompute=function(){},wa.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},wa.fromJSON=function(e,t){return new wa(e,t[0],t[1]||e.one)},wa.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},wa.prototype.isInfinity=function(){return this.z.cmpn(0)===0},wa.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),f=e.redMul(t),a=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(f,a)},wa.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},wa.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),f=this.x.redSub(this.z),a=e.x.redAdd(e.z),d=e.x.redSub(e.z).redMul(n),l=a.redMul(f),v=t.z.redMul(d.redAdd(l).redSqr()),w=t.x.redMul(d.redISub(l).redSqr());return this.curve.point(v,w)},wa.prototype.mul=function(e){for(var t=e.clone(),n=this,f=this.curve.point(null,null),a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var d=a.length-1;d>=0;d--)a[d]===0?(n=n.diffAdd(f,this),f=f.dbl()):(f=n.diffAdd(f,this),n=n.dbl());return f},wa.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},wa.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},wa.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},wa.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},wa.prototype.getX=function(){return this.normalize(),this.x.fromRed()};$Ae=Kee,bh=Yn,UV=Vr,R3=j3,UAe=Ho.assert;UV(yu,R3),Zee=yu,yu.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},yu.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},yu.prototype.jpoint=function(e,t,n,f){return this.point(e,t,n,f)},yu.prototype.pointFromX=function(e,t){(e=new bh(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),f=this.c2.redSub(this.a.redMul(n)),a=this.one.redSub(this.c2.redMul(this.d).redMul(n)),d=f.redMul(a.redInvm()),l=d.redSqrt();if(l.redSqr().redSub(d).cmp(this.zero)!==0)throw new Error("invalid point");var v=l.fromRed().isOdd();return(t&&!v||!t&&v)&&(l=l.redNeg()),this.point(e,l)},yu.prototype.pointFromY=function(e,t){(e=new bh(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),f=n.redSub(this.c2),a=n.redMul(this.d).redMul(this.c2).redSub(this.a),d=f.redMul(a.redInvm());if(d.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var l=d.redSqrt();if(l.redSqr().redSub(d).cmp(this.zero)!==0)throw new Error("invalid point");return l.fromRed().isOdd()!==t&&(l=l.redNeg()),this.point(l,e)},yu.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),f=t.redMul(this.a).redAdd(n),a=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return f.cmp(a)===0},UV(bn,R3.BasePoint),yu.prototype.pointFromJSON=function(e){return bn.fromJSON(this,e)},yu.prototype.point=function(e,t,n,f){return new bn(this,e,t,n,f)},bn.fromJSON=function(e,t){return new bn(e,t[0],t[1],t[2])},bn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},bn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},bn.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var f=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),d=f.redAdd(t),l=d.redSub(n),v=f.redSub(t),w=a.redMul(l),m=d.redMul(v),y=a.redMul(v),g=l.redMul(d);return this.curve.point(w,m,g,y)},bn.prototype._projDbl=function(){var e,t,n,f=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),d=this.y.redSqr();if(this.curve.twisted){var l=(m=this.curve._mulA(a)).redAdd(d);if(this.zOne)e=f.redSub(a).redSub(d).redMul(l.redSub(this.curve.two)),t=l.redMul(m.redSub(d)),n=l.redSqr().redSub(l).redSub(l);else{var v=this.z.redSqr(),w=l.redSub(v).redISub(v);e=f.redSub(a).redISub(d).redMul(w),t=l.redMul(m.redSub(d)),n=l.redMul(w)}}else{var m=a.redAdd(d);v=this.curve._mulC(this.z).redSqr(),w=m.redSub(v).redSub(v),e=this.curve._mulC(f.redISub(m)).redMul(w),t=this.curve._mulC(m).redMul(a.redISub(d)),n=m.redMul(w)}return this.curve.point(e,t,n)},bn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},bn.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),f=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),d=n.redSub(t),l=a.redSub(f),v=a.redAdd(f),w=n.redAdd(t),m=d.redMul(l),y=v.redMul(w),g=d.redMul(w),S=l.redMul(v);return this.curve.point(m,y,S,g)},bn.prototype._projAdd=function(e){var t,n,f=this.z.redMul(e.z),a=f.redSqr(),d=this.x.redMul(e.x),l=this.y.redMul(e.y),v=this.curve.d.redMul(d).redMul(l),w=a.redSub(v),m=a.redAdd(v),y=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(d).redISub(l),g=f.redMul(w).redMul(y);return this.curve.twisted?(t=f.redMul(m).redMul(l.redSub(this.curve._mulA(d))),n=w.redMul(m)):(t=f.redMul(m).redMul(l.redSub(d)),n=this.curve._mulC(w).redMul(m)),this.curve.point(g,t,n)},bn.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},bn.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},bn.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},bn.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},bn.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},bn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},bn.prototype.getX=function(){return this.normalize(),this.x.fromRed()},bn.prototype.getY=function(){return this.normalize(),this.y.fromRed()},bn.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},bn.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var n=e.clone(),f=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(f),this.x.cmp(t)===0)return!0}},bn.prototype.toP=bn.prototype.normalize,bn.prototype.mixedAdd=bn.prototype.add;qAe=Zee,IR={},Lb=IR;Lb.base=j3,Lb.short=LAe,Lb.mont=$Ae,Lb.edwards=qAe;jAe={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},F3={},eR=F3,bl=q3,hE=IR,qV=Ho.assert;eR.PresetCurve=Wee,wl("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:bl.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),wl("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:bl.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),wl("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:bl.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),wl("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:bl.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),wl("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:bl.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),wl("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:bl.sha256,gRed:!1,g:["9"]}),wl("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:bl.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{Qx=jAe}catch(e){Qx=void 0}wl("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:bl.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Qx]});FAe=Yn,jV=Ho.assert;Vee=ja,ja.fromPublic=function(e,t,n){return t instanceof ja?t:new ja(e,{pub:t,pubEnc:n})},ja.fromPrivate=function(e,t,n){return t instanceof ja?t:new ja(e,{priv:t,privEnc:n})},ja.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},ja.prototype.getPublic=function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},ja.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv},ja.prototype._importPrivate=function(e,t){this.priv=new FAe(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},ja.prototype._importPublic=function(e,t){if(e.x||e.y)return this.ec.curve.type==="mont"?jV(e.x,"Need x coordinate"):this.ec.curve.type!=="short"&&this.ec.curve.type!=="edwards"||jV(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y),void 0;this.pub=this.ec.curve.decodePoint(e,t)},ja.prototype.derive=function(e){return e.mul(this.priv).getX()},ja.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},ja.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},ja.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};zAe=Vee,H0=Yn,FV=PAe,lE=F3,HAe=RR,Yee=Ho.assert,cE=zAe,Db=PEe;Gee=$s,$s.prototype.keyPair=function(e){return new cE(this,e)},$s.prototype.keyFromPrivate=function(e,t){return cE.fromPrivate(this,e,t)},$s.prototype.keyFromPublic=function(e,t){return cE.fromPublic(this,e,t)},$s.prototype.genKeyPair=function(e){e||(e={});for(var t=new FV({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||HAe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),f=this.n.sub(new H0(2));;){var a=new H0(t.generate(n));if(!(a.cmp(f)>0))return a.iaddn(1),this.keyFromPrivate(a)}},$s.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},$s.prototype.sign=function(e,t,n,f){typeof n=="object"&&(f=n,n=null),f||(f={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new H0(e,16));for(var a=this.n.byteLength(),d=t.getPrivate().toArray("be",a),l=e.toArray("be",a),v=new FV({hash:this.hash,entropy:d,nonce:l,pers:f.pers,persEnc:f.persEnc||"utf8"}),w=this.n.sub(new H0(1)),m=0;;m++){var y=f.k?f.k(m):new H0(v.generate(this.n.byteLength()));if(!((y=this._truncateToN(y,!0)).cmpn(1)<=0||y.cmp(w)>=0)){var g=this.g.mul(y);if(!g.isInfinity()){var S=g.getX(),x=S.umod(this.n);if(x.cmpn(0)!==0){var A=y.invm(this.n).mul(x.mul(t.getPrivate()).iadd(e));if((A=A.umod(this.n)).cmpn(0)!==0){var T=(g.getY().isOdd()?1:0)|(S.cmp(x)!==0?2:0);return f.canonical&&A.cmp(this.nh)>0&&(A=this.n.sub(A),T^=1),new Db({r:x,s:A,recoveryParam:T})}}}}}},$s.prototype.verify=function(e,t,n,f){e=this._truncateToN(new H0(e,16)),n=this.keyFromPublic(n,f);var a=(t=new Db(t,"hex")).r,d=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||d.cmpn(1)<0||d.cmp(this.n)>=0)return!1;var l,v=d.invm(this.n),w=v.mul(e).umod(this.n),m=v.mul(a).umod(this.n);return this.curve._maxwellTrick?!(l=this.g.jmulAdd(w,n.getPublic(),m)).isInfinity()&&l.eqXToP(a):!(l=this.g.mulAdd(w,n.getPublic(),m)).isInfinity()&&l.getX().umod(this.n).cmp(a)===0},$s.prototype.recoverPubKey=function(e,t,n,f){Yee((3&n)===n,"The recovery param is more than two bits"),t=new Db(t,f);var a=this.n,d=new H0(e),l=t.r,v=t.s,w=1&n,m=n>>1;if(l.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");l=m?this.curve.pointFromX(l.add(this.curve.n),w):this.curve.pointFromX(l,w);var y=t.r.invm(a),g=a.sub(d).mul(y).umod(a),S=v.mul(y).umod(a);return this.g.mulAdd(g,l,S)},$s.prototype.getKeyRecoveryParam=function(e,t,n,f){if((t=new Db(t,f)).recoveryParam!==null)return t.recoveryParam;for(var a=0;a<4;a++){var d;try{d=this.recoverPubKey(e,t,a)}catch{continue}if(d.eq(n))return a}throw new Error("Unable to find valid recovery factor")};KAe=Gee,C2=Ho,zV=C2.assert,HV=C2.parseBytes,Qd=C2.cachedProperty;_a.fromPublic=function(e,t){return t instanceof _a?t:new _a(e,{pub:t})},_a.fromSecret=function(e,t){return t instanceof _a?t:new _a(e,{secret:t})},_a.prototype.secret=function(){return this._secret},Qd(_a,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),Qd(_a,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),Qd(_a,"privBytes",function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,f=t.slice(0,e.encodingLength);return f[0]&=248,f[n]&=127,f[n]|=64,f}),Qd(_a,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),Qd(_a,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),Qd(_a,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),_a.prototype.sign=function(e){return zV(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},_a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},_a.prototype.getSecret=function(e){return zV(this._secret,"KeyPair is public only"),C2.encode(this.secret(),e)},_a.prototype.getPublic=function(e){return C2.encode(this.pubBytes(),e)};ZAe=_a,WAe=Yn,z3=Ho,VAe=z3.assert,$b=z3.cachedProperty,GAe=z3.parseBytes;$b(J0,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),$b(J0,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),$b(J0,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),$b(J0,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),J0.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},J0.prototype.toHex=function(){return z3.encode(this.toBytes(),"hex").toUpperCase()};YAe=J0,JAe=q3,XAe=F3,u1=Ho,QAe=u1.assert,KV=u1.parseBytes,ZV=ZAe,WV=YAe;Jee=Mo,Mo.prototype.sign=function(e,t){e=KV(e);var n=this.keyFromSecret(t),f=this.hashInt(n.messagePrefix(),e),a=this.g.mul(f),d=this.encodePoint(a),l=this.hashInt(d,n.pubBytes(),e).mul(n.priv()),v=f.add(l).umod(this.curve.n);return this.makeSignature({R:a,S:v,Rencoded:d})},Mo.prototype.verify=function(e,t,n){e=KV(e),t=this.makeSignature(t);var f=this.keyFromPublic(n),a=this.hashInt(t.Rencoded(),f.pubBytes(),e),d=this.g.mul(t.S());return t.R().add(f.pub().mul(a)).eq(d)},Mo.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return u1.intFromLE(e.digest()).umod(this.curve.n)},Mo.prototype.keyFromPublic=function(e){return ZV.fromPublic(this,e)},Mo.prototype.keyFromSecret=function(e){return ZV.fromSecret(this,e)},Mo.prototype.makeSignature=function(e){return e instanceof WV?e:new WV(this,e)},Mo.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},Mo.prototype.decodePoint=function(e){var t=(e=u1.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),f=(128&e[t])!=0,a=u1.intFromLE(n);return this.curve.pointFromY(a,f)},Mo.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},Mo.prototype.decodeInt=function(e){return u1.intFromLE(e)},Mo.prototype.isPoint=function(e){return e instanceof this.pointClass};exe=Jee,H3={},K0=H3;K0.version=["elliptic","6.5.2","EC cryptography","lib/elliptic.js",["lib"],{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},{type:"git",url:"git@github.com:indutny/elliptic"},["EC","Elliptic","curve","Cryptography"],"Fedor Indutny <fedor@indutny.com>","MIT",{url:"https://github.com/indutny/elliptic/issues"},"https://github.com/indutny/elliptic",{brfs:"^1.4.3",coveralls:"^3.0.8",grunt:"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.10.3",mocha:"^6.2.2"},{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}][1],K0.utils=Ho,K0.rand=RR,K0.curve=IR,K0.curves=F3,K0.ec=KAe,K0.eddsa=exe;dE={},VV=!1,jo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,oa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Xee={},txe=Vr;Xee.Reporter=Ps,Ps.prototype.isError=function(e){return e instanceof e1},Ps.prototype.save=function(){var e=(this||oa)._reporterState;return{obj:e.obj,pathLen:e.path.length}},Ps.prototype.restore=function(e){var t=(this||oa)._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},Ps.prototype.enterKey=function(e){return(this||oa)._reporterState.path.push(e)},Ps.prototype.exitKey=function(e){var t=(this||oa)._reporterState;t.path=t.path.slice(0,e-1)},Ps.prototype.leaveKey=function(e,t,n){var f=(this||oa)._reporterState;this.exitKey(e),f.obj!==null&&(f.obj[t]=n)},Ps.prototype.path=function(){return(this||oa)._reporterState.path.join("/")},Ps.prototype.enterObject=function(){var e=(this||oa)._reporterState,t=e.obj;return e.obj={},t},Ps.prototype.leaveObject=function(e){var t=(this||oa)._reporterState,n=t.obj;return t.obj=e,n},Ps.prototype.error=function(e){var t,n=(this||oa)._reporterState,f=e instanceof e1;if(t=f?e:new e1(n.path.map(function(a){return"["+JSON.stringify(a)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return f||n.errors.push(t),t},Ps.prototype.wrapResult=function(e){var t=(this||oa)._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},txe(e1,Error),e1.prototype.rethrow=function(e){if((this||oa).message=e+" at: "+((this||oa).path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this||oa,e1),!(this||oa).stack)try{throw new Error((this||oa).message)}catch(t){(this||oa).stack=t.stack}return this||oa};Ub={},GV=!1,Fr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;pE={},JV=!1,Nr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,vE={},XV=!1;hl={},QV=!1,mE={},eG=!1;gE={},tG=!1,ll=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;yE={},iG=!1,bE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,wE={},nG=!1;_E={},aG=!1,ia=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ME={},sG=!1,SE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,EE={},fG=!1;AE={},uG=!1;ete=K3(),qf=ete,hG=qf.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),nxe=qf.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),BR=qf.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),axe=qf.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(BR),this.key("subjectPublicKey").bitstr())}),oxe=qf.define("RelativeDistinguishedName",function(){this.setof(nxe)}),sxe=qf.define("RDNSequence",function(){this.seqof(oxe)}),lG=qf.define("Name",function(){this.choice({rdnSequence:this.use(sxe)})}),fxe=qf.define("Validity",function(){this.seq().obj(this.key("notBefore").use(hG),this.key("notAfter").use(hG))}),uxe=qf.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),hxe=qf.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(BR),this.key("issuer").use(lG),this.key("validity").use(fxe),this.key("subject").use(lG),this.key("subjectPublicKeyInfo").use(axe),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(uxe).optional())}),lxe=qf.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(hxe),this.key("signatureAlgorithm").use(BR),this.key("signatureValue").bitstr())}),$f={},jf=ete;$f.certificate=lxe;cxe=jf.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});$f.RSAPrivateKey=cxe;dxe=jf.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});$f.RSAPublicKey=dxe;pxe=jf.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(tte),this.key("subjectPublicKey").bitstr())});$f.PublicKey=pxe;tte=jf.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),vxe=jf.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(tte),this.key("subjectPrivateKey").octstr())});$f.PrivateKey=vxe;mxe=jf.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});$f.EncryptedPrivateKey=mxe;gxe=jf.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});$f.DSAPrivateKey=gxe,$f.DSAparam=jf.define("DSAparam",function(){this.int()});yxe=jf.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(bxe),this.key("publicKey").optional().explicit(1).bitstr())});$f.ECPrivateKey=yxe;bxe=jf.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});$f.signature=jf.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())});wxe=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,_xe=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,Mxe=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,Sxe=U3,Exe=zo,qb=Si.Buffer,wo=$f,Axe={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"},xxe=function(e,t){var n,f=e.toString(),a=f.match(wxe);if(a){var d="aes"+a[1],l=qb.from(a[2],"hex"),v=qb.from(a[3].replace(/[\r\n]/g,""),"base64"),w=Sxe(t,l.slice(0,8),parseInt(a[1],10)).key,m=[],y=Exe.createDecipheriv(d,w,l);m.push(y.update(v)),m.push(y.final()),n=qb.concat(m)}else{var g=f.match(Mxe);n=new qb(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:f.match(_xe)[1],data:n}},Rxe=zo,kxe=M3,xE=Si.Buffer;rte=cG,cG.signature=wo.signature;Z3=rte,ite={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"},tR={},za=Dr.Buffer,fc=NQ,Txe=kR,Ixe=H3.ec,k3=Yn,Bxe=Z3,Oxe=ite;(tR=function(e,t,n,f,a){var d=Bxe(t);if(d.curve){if(f!=="ecdsa"&&f!=="ecdsa/rsa")throw new Error("wrong private key type");return function(m,y){var g=Oxe[y.curve.join(".")];if(!g)throw new Error("unknown curve "+y.curve.join("."));var S=new Ixe(g).keyFromPrivate(y.privateKey).sign(m);return new za(S.toDER())}(e,d)}if(d.type==="dsa"){if(f!=="dsa")throw new Error("wrong private key type");return function(m,y,g){for(var S,x=y.params.priv_key,A=y.params.p,T=y.params.q,I=y.params.g,B=new k3(0),P=OR(m,T).mod(T),C=!1,q=dG(x,T,m,g);C===!1;)S=pG(T,q,g),B=Pxe(I,S,A,T),(C=S.invm(T).imul(P.add(x.mul(B))).mod(T)).cmpn(0)===0&&(C=!1,B=new k3(0));return function(K,G){K=K.toArray(),G=G.toArray(),128&K[0]&&(K=[0].concat(K)),128&G[0]&&(G=[0].concat(G));var j=[48,K.length+G.length+4,2,K.length];return j=j.concat(K,[2,G.length],G),new za(j)}(B,C)}(e,d,n)}if(f!=="rsa"&&f!=="ecdsa/rsa")throw new Error("wrong private key type");e=za.concat([a,e]);for(var l=d.modulus.byteLength(),v=[0,1];e.length+v.length+1<l;)v.push(255);v.push(0);for(var w=-1;++w<e.length;)v.push(e[w]);return Txe(v,d)}).getKey=dG,tR.makeKey=pG;Nxe=tR,RE=Dr.Buffer,s2=Yn,Cxe=H3.ec,vG=Z3,Lxe=ite;Dxe=function(e,t,n,f,a){var d=vG(n);if(d.type==="ec"){if(f!=="ecdsa"&&f!=="ecdsa/rsa")throw new Error("wrong public key type");return function(S,x,A){var T=Lxe[A.data.algorithm.curve.join(".")];if(!T)throw new Error("unknown curve "+A.data.algorithm.curve.join("."));var I=new Cxe(T),B=A.data.subjectPrivateKey.data;return I.verify(x,S,B)}(e,t,d)}if(d.type==="dsa"){if(f!=="dsa")throw new Error("wrong public key type");return function(S,x,A){var T=A.data.p,I=A.data.q,B=A.data.g,P=A.data.pub_key,C=vG.signature.decode(S,"der"),q=C.s,K=C.r;mG(q,I),mG(K,I);var G=s2.mont(T),j=q.invm(I);return B.toRed(G).redPow(new s2(x).mul(j).mod(I)).fromRed().mul(P.toRed(G).redPow(K.mul(j).mod(I)).fromRed()).mod(T).mod(I).cmp(K)===0}(e,t,d)}if(f!=="rsa"&&f!=="ecdsa/rsa")throw new Error("wrong public key type");t=RE.concat([a,t]);for(var l=d.modulus.byteLength(),v=[1],w=0;t.length+v.length+2<l;)v.push(255),w++;v.push(0);for(var m=-1;++m<t.length;)v.push(t[m]);v=new RE(v);var y=s2.mont(d.modulus);e=(e=new s2(e).toRed(y)).redPow(new s2(d.publicExponent)),e=new RE(e.fromRed().toArray());var g=w<8?1:0;for(l=Math.min(e.length,v.length),e.length!==v.length&&(g=1),m=-1;++m<l;)g|=e[m]^v[m];return g===0},$n=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,jb=Dr.Buffer,nte=F2,T3=qs,gG=Vr,$xe=Nxe,Uxe=Dxe,tc=CQ;Object.keys(tc).forEach(function(e){tc[e].id=new jb(tc[e].id,"hex"),tc[e.toLowerCase()]=tc[e]}),gG(M2,T3.Writable),M2.prototype._write=function(e,t,n){(this||$n)._hash.update(e),n()},M2.prototype.update=function(e,t){return typeof e=="string"&&(e=new jb(e,t)),(this||$n)._hash.update(e),this||$n},M2.prototype.sign=function(e,t){this.end();var n=(this||$n)._hash.digest(),f=$xe(n,e,(this||$n)._hashType,(this||$n)._signType,(this||$n)._tag);return t?f.toString(t):f},gG(S2,T3.Writable),S2.prototype._write=function(e,t,n){(this||$n)._hash.update(e),n()},S2.prototype.update=function(e,t){return typeof e=="string"&&(e=new jb(e,t)),(this||$n)._hash.update(e),this||$n},S2.prototype.verify=function(e,t,n){typeof t=="string"&&(t=new jb(t,n)),this.end();var f=(this||$n)._hash.digest();return Uxe(t,f,e,(this||$n)._signType,(this||$n)._tag)};qxe={Sign:yG,Verify:bG,createSign:yG,createVerify:bG},sa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,yh=Dr.Buffer,jxe=H3,Fxe=Yn;ate=function(e){return new X0(e)};Fo={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};Fo.p224=Fo.secp224r1,Fo.p256=Fo.secp256r1=Fo.prime256v1,Fo.p192=Fo.secp192r1=Fo.prime192v1,Fo.p384=Fo.secp384r1,Fo.p521=Fo.secp521r1,X0.prototype.generateKeys=function(e,t){return(this||sa).keys=(this||sa).curve.genKeyPair(),this.getPublicKey(e,t)},X0.prototype.computeSecret=function(e,t,n){return t=t||"utf8",yh.isBuffer(e)||(e=new yh(e,t)),kE((this||sa).curve.keyFromPublic(e).getPublic().mul((this||sa).keys.getPrivate()).getX(),n,(this||sa).curveType.byteLength)},X0.prototype.getPublicKey=function(e,t){var n=(this||sa).keys.getPublic(t==="compressed",!0);return t==="hybrid"&&(n[n.length-1]%2?n[0]=7:n[0]=6),kE(n,e)},X0.prototype.getPrivateKey=function(e){return kE((this||sa).keys.getPrivate(),e)},X0.prototype.setPublicKey=function(e,t){return t=t||"utf8",yh.isBuffer(e)||(e=new yh(e,t)),(this||sa).keys._importPublic(e),this||sa},X0.prototype.setPrivateKey=function(e,t){t=t||"utf8",yh.isBuffer(e)||(e=new yh(e,t));var n=new Fxe(e);return n=n.toString(16),(this||sa).keys=(this||sa).curve.genKeyPair(),(this||sa).keys._importPrivate(n),this||sa};zxe=ate,Hxe=F2,rR=Si.Buffer;ote=function(e,t){for(var n,f=rR.alloc(0),a=0;f.length<t;)n=Kxe(a++),f=rR.concat([f,Hxe("sha1").update(e).update(n).digest()]);return f.slice(0,t)},ste=function(e,t){for(var n=e.length,f=-1;++f<n;)e[f]^=t[f];return e},wG=Yn,Zxe=Si.Buffer,fte=function(e,t){return Zxe.from(e.toRed(wG.mont(t.modulus)).redPow(new wG(t.publicExponent)).fromRed().toArray())},Wxe=Z3,TE=w1,Vxe=F2,_G=ote,MG=ste,IE=Yn,Gxe=fte,Yxe=kR,If=Si.Buffer,Jxe=function(e,t,n){var f;f=e.padding?e.padding:n?1:4;var a,d=Wxe(e);if(f===4)a=function(l,v){var w=l.modulus.byteLength(),m=v.length,y=Vxe("sha1").update(If.alloc(0)).digest(),g=y.length,S=2*g;if(m>w-S-2)throw new Error("message too long");var x=If.alloc(w-m-S-2),A=w-g-1,T=TE(g),I=MG(If.concat([y,x,If.alloc(1,1),v],A),_G(T,A)),B=MG(T,_G(I,g));return new IE(If.concat([If.alloc(1),B,I],w))}(d,t);else if(f===1)a=function(l,v,w){var m,y=v.length,g=l.modulus.byteLength();if(y>g-11)throw new Error("message too long");return m=w?If.alloc(g-y-3,255):function(S){for(var x,A=If.allocUnsafe(S),T=0,I=TE(2*S),B=0;T<S;)B===I.length&&(I=TE(2*S),B=0),(x=I[B++])&&(A[T++]=x);return A}(g-y-3),new IE(If.concat([If.from([0,w?1:2]),m,If.alloc(1),v],g))}(d,t,n);else{if(f!==3)throw new Error("unknown padding");if((a=new IE(t)).cmp(d.modulus)>=0)throw new Error("data too long for modulus")}return n?Yxe(a,d):Gxe(a,d)},Xxe=Z3,SG=ote,EG=ste,AG=Yn,Qxe=kR,eRe=F2,tRe=fte,f2=Si.Buffer,rRe=function(e,t,n){var f;f=e.padding?e.padding:n?1:4;var a,d=Xxe(e),l=d.modulus.byteLength();if(t.length>l||new AG(t).cmp(d.modulus)>=0)throw new Error("decryption error");a=n?tRe(new AG(t),d):Qxe(t,d);var v=f2.alloc(l-a.length);if(a=f2.concat([v,a],l),f===4)return function(w,m){var y=w.modulus.byteLength(),g=eRe("sha1").update(f2.alloc(0)).digest(),S=g.length;if(m[0]!==0)throw new Error("decryption error");var x=m.slice(1,S+1),A=m.slice(S+1),T=EG(x,SG(A,S)),I=EG(A,SG(T,y-S-1));if(function(P,C){P=f2.from(P),C=f2.from(C);var q=0,K=P.length;P.length!==C.length&&(q++,K=Math.min(P.length,C.length));for(var G=-1;++G<K;)q+=P[G]^C[G];return q}(g,I.slice(0,S)))throw new Error("decryption error");for(var B=S;I[B]===0;)B++;if(I[B++]!==1)throw new Error("decryption error");return I.slice(B)}(d,a);if(f===1)return function(w,m,y){for(var g=m.slice(0,2),S=2,x=0;m[S++]!==0;)if(S>=m.length){x++;break}var A=m.slice(2,S-1);if((g.toString("hex")!=="0002"&&!y||g.toString("hex")!=="0001"&&y)&&x++,A.length<8&&x++,x)throw new Error("decryption error");return m.slice(S)}(0,a,n);if(f===3)return a;throw new Error("unknown padding")},Q0={};Q0.publicEncrypt=Jxe,Q0.privateDecrypt=rRe,Q0.privateEncrypt=function(e,t){return Q0.publicEncrypt(e,t,!0)},Q0.publicDecrypt=function(e,t){return Q0.privateDecrypt(e,t,!0)};I3=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,E2={},iR=Cr;ute=Si,RG=w1,kG=ute.Buffer,hte=ute.kMaxLength,nR=I3.crypto||I3.msCrypto,lte=Math.pow(2,32)-1;nR&&nR.getRandomValues||!iR.browser?(E2.randomFill=function(e,t,n,f){if(!(kG.isBuffer(e)||e instanceof I3.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof t=="function")f=t,t=0,n=e.length;else if(typeof n=="function")f=n,n=e.length-t;else if(typeof f!="function")throw new TypeError('"cb" argument must be a function');return TG(t,e.length),IG(n,t,e.length),BG(e,t,n,f)},E2.randomFillSync=function(e,t,n){if(t===void 0&&(t=0),!(kG.isBuffer(e)||e instanceof I3.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return TG(t,e.length),n===void 0&&(n=e.length-t),IG(n,t,e.length),BG(e,t,n)}):(E2.randomFill=xG,E2.randomFillSync=xG);di={};di.randomBytes=di.rng=di.pseudoRandomBytes=di.prng=w1,di.createHash=di.Hash=F2,di.createHmac=di.Hmac=NQ;iRe=CQ,nRe=Object.keys(iRe),aRe=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(nRe);di.getHashes=function(){return aRe};OG=M3;di.pbkdf2=OG.pbkdf2,di.pbkdf2Sync=OG.pbkdf2Sync;bu=Of;di.Cipher=bu.Cipher,di.createCipher=bu.createCipher,di.Cipheriv=bu.Cipheriv,di.createCipheriv=bu.createCipheriv,di.Decipher=bu.Decipher,di.createDecipher=bu.createDecipher,di.Decipheriv=bu.Decipheriv,di.createDecipheriv=bu.createDecipheriv,di.getCiphers=bu.getCiphers,di.listCiphers=bu.listCiphers;u2=a1;di.DiffieHellmanGroup=u2.DiffieHellmanGroup,di.createDiffieHellmanGroup=u2.createDiffieHellmanGroup,di.getDiffieHellman=u2.getDiffieHellman,di.createDiffieHellman=u2.createDiffieHellman,di.DiffieHellman=u2.DiffieHellman;Fb=qxe;di.createSign=Fb.createSign,di.Sign=Fb.Sign,di.createVerify=Fb.createVerify,di.Verify=Fb.Verify,di.createECDH=zxe;zb=Q0;di.publicEncrypt=zb.publicEncrypt,di.privateEncrypt=zb.privateEncrypt,di.publicDecrypt=zb.publicDecrypt,di.privateDecrypt=zb.privateDecrypt;PG=E2;di.randomFill=PG.randomFill,di.randomFillSync=PG.randomFillSync,di.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(`
|
|
137
137
|
`))},di.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6};Hb={},NG=!1,Kb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;BE={},CG=!1,LG=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;OE={},DG=!1;oRe={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}},PE={},$G=!1,xi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Z0={},UG=!1;pte={},qG=!1,NE={exports:pte},$e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;CE={},jG=!1;uRe={_args:[["elliptic@6.5.4","C:\\Users\\guybe\\Projects\\rollup-plugin-jspm"]],_from:"elliptic@6.5.4",_id:"elliptic@6.5.4",_inBundle:!1,_integrity:"sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",_location:"/@jspm/core/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.5.4",name:"elliptic",escapedName:"elliptic",rawSpec:"6.5.4",saveSpec:null,fetchSpec:"6.5.4"},_requiredBy:["/@jspm/core/browserify-sign","/@jspm/core/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",_spec:"6.5.4",_where:"C:\\Users\\guybe\\Projects\\rollup-plugin-jspm",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},description:"EC cryptography",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.5.4"},vte={},FG=!1,LE={exports:vte},Ze=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;DE={},zG=!1;$E={},HG=!1;UE={},KG=!1;qE={},ZG=!1;jE={},WG=!1;FE={},VG=!1;zE={},GG=!1;un={},YG=!1;HE={},JG=!1;XG={},QG=!1;KE={},eY=!1;ZE={},tY=!1;WE={},rY=!1;VE={},iY=!1;GE={},nY=!1;YE={},aY=!1;JE={},oY=!1;XE={},sY=!1;QE={},fY=!1;eA={},uY=!1;tA={},hY=!1;rA={},lY=!1;iA={},cY=!1;bte={},dY=!1,nA={exports:bte},We=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;aA={},pY=!1;oA={},vY=!1;Zb={},mY=!1;sA={},gY=!1;cl={},yY=!1;fA={},bY=!1;uA={},wY=!1;hA={},_Y=!1;lA={},MY=!1;cA={},SY=!1;dA={},EY=!1;pA={},AY=!1;vA={},xY=!1;mA={},RY=!1;gA={},kY=!1;yA={},TY=!1;Ns={},IY=!1;BRe={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"},bA={},BY=!1;wA={},OY=!1;xte={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"},h2={},PY=!1;_A={},NY=!1;MA={},CY=!1,Nn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Rte={},LY=!1,SA={exports:Rte},Ve=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;EA={},DY=!1,na=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;AA={},$Y=!1;xA={},UY=!1;Ite={},qY=!1,RA={exports:Ite},Ge=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;kA={},jY=!1;TA={},FY=!1;IA={},zY=!1;dl={},HY=!1;t1={},KY=!1,Wb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;fi={},ZY=!1;pi=FRe();pi.Cipher;pi.Cipheriv;pi.Decipher;pi.Decipheriv;pi.DiffieHellman;pi.DiffieHellmanGroup;pi.Hash;pi.Hmac;pi.Sign;pi.Verify;pi.constants;pi.createCipher;pi.createCipheriv;pi.createCredentials;pi.createDecipher;pi.createDecipheriv;pi.createDiffieHellman;pi.createDiffieHellmanGroup;pi.createECDH;pi.createHash;pi.createHmac;pi.createSign;pi.createVerify;pi.getCiphers;pi.getDiffieHellman;pi.getHashes;pi.listCiphers;pi.pbkdf2;pi.pbkdf2Sync;pi.privateDecrypt;pi.privateEncrypt;pi.prng;pi.pseudoRandomBytes;pi.publicDecrypt;pi.publicEncrypt;pi.randomBytes;pi.randomFill;pi.randomFillSync;pi.rng;Vb={},WY=!1,Gb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;BA={},VY=!1,GY=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;OA={},YY=!1;zRe={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}},PA={},JY=!1,Ri=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;W0={},XY=!1;l2={},QY=!1;Nte={},eJ=!1,NA={exports:Nte},Ue=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;CA={},tJ=!1;ZRe={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}},Cte={},rJ=!1,LA={exports:Cte},Ye=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;DA={},iJ=!1;$A={},nJ=!1;UA={},aJ=!1;qA={},oJ=!1;jA={},sJ=!1;FA={},fJ=!1;zA={},uJ=!1;hn={},hJ=!1;HA={},lJ=!1;cJ={},dJ=!1;KA={},pJ=!1;ZA={},vJ=!1;WA={},mJ=!1;VA={},gJ=!1;GA={},yJ=!1;YA={},bJ=!1;JA={},wJ=!1;XA={},_J=!1;QA={},MJ=!1;ex={},SJ=!1;tx={},EJ=!1;rx={},AJ=!1;ix={},xJ=!1;Ute={},RJ=!1,nx={exports:Ute},Je=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ax={},kJ=!1;ox={},TJ=!1;Yb={},IJ=!1;sx={},BJ=!1;pl={},OJ=!1;fx={},PJ=!1;ux={},NJ=!1;hx={},CJ=!1;lx={},LJ=!1;cx={},DJ=!1;dx={},$J=!1;px={},UJ=!1;vx={},qJ=!1;mx={},jJ=!1;gx={},FJ=!1;yx={},zJ=!1;Cs={},HJ=!1;pke={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"},bx={},KJ=!1;wx={},ZJ=!1;Zte={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"},c2={},WJ=!1;_x={},VJ=!1;Mx={},GJ=!1,Cn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Wte={},YJ=!1,Sx={exports:Wte},Xe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ex={},JJ=!1,aa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ax={},XJ=!1;xx={},QJ=!1;Yte={},eX=!1,Rx={exports:Yte},Qe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;kx={},tX=!1;Tx={},rX=!1;Ix={},iX=!1;vl={},nX=!1;r1={},aX=!1,Jb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ui={},oX=!1;_r=Ake();_r.randomBytes;_r.rng;_r.pseudoRandomBytes;_r.prng;_r.createHash;_r.Hash;_r.createHmac;_r.Hmac;_r.getHashes;_r.pbkdf2;_r.pbkdf2Sync;_r.Cipher;_r.createCipher;_r.Cipheriv;_r.createCipheriv;_r.Decipher;_r.createDecipher;_r.Decipheriv;_r.createDecipheriv;_r.getCiphers;_r.listCiphers;_r.DiffieHellmanGroup;_r.createDiffieHellmanGroup;_r.getDiffieHellman;_r.createDiffieHellman;_r.DiffieHellman;_r.createSign;_r.Sign;_r.createVerify;_r.Verify;_r.createECDH;_r.publicEncrypt;_r.privateEncrypt;_r.publicDecrypt;_r.privateDecrypt;_r.randomFill;_r.randomFillSync;_r.createCredentials;_r.constants;_r.webcrypto=globalThis.crypto;xke=_r.Cipher,Rke=_r.Cipheriv,kke=_r.Decipher,Tke=_r.Decipheriv,Ike=_r.DiffieHellman,Bke=_r.DiffieHellmanGroup,Oke=_r.Hash,Pke=_r.Hmac,Nke=_r.Sign,Cke=_r.Verify,Lke=_r.constants,Dke=_r.createCipher,$ke=_r.createCipheriv,Uke=_r.createCredentials,qke=_r.createDecipher,jke=_r.createDecipheriv,Fke=_r.createDiffieHellman,zke=_r.createDiffieHellmanGroup,Hke=_r.createECDH,Kke=_r.createHash,Zke=_r.createHmac,Wke=_r.createSign,Vke=_r.createVerify,Gke=_r.getCiphers,Yke=_r.getDiffieHellman,Jke=_r.getHashes,Xke=_r.listCiphers,Qke=_r.pbkdf2,eTe=_r.pbkdf2Sync,tTe=_r.privateDecrypt,rTe=_r.privateEncrypt,iTe=_r.prng,nTe=_r.pseudoRandomBytes,aTe=_r.publicDecrypt,oTe=_r.publicEncrypt,sTe=_r.randomBytes,fTe=_r.randomFill,uTe=_r.randomFillSync,hTe=_r.rng,lTe=_r.webcrypto});var tre=Ht(Sh=>{"use strict";Be();Pe();Oe();var cTe=Sh&&Sh.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),dTe=Sh&&Sh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),pTe=Sh&&Sh.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&cTe(t,e,n);return dTe(t,e),t};Object.defineProperty(Sh,"__esModule",{value:!0});var ere=GH(),Hs=pTe((Qte(),Li(Xte))),rk=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";encryptionAlgorithm="aes-256-cbc";generateJWK(){if(typeof Hs.generateKeyPair!="function")throw new Error("Keypair generation not supported in this version of Node, only supported in versions 10+");return new Promise((t,n)=>{Hs.generateKeyPair("rsa",{modulusLength:this.keyLength,publicExponent:this.publicExponent,privateKeyEncoding:{type:"pkcs1",format:"pem"},publicKeyEncoding:{type:"pkcs1",format:"pem"}},(f,a,d)=>{f&&n(f),t(this.pemToJWK(d))})})}sign(t,n,{saltLength:f}={}){return new Promise((a,d)=>{a(Hs.createSign(this.hashAlgorithm).update(n).sign({key:this.jwkToPem(t),padding:Hs.constants.RSA_PKCS1_PSS_PADDING,saltLength:f}))})}verify(t,n,f){return new Promise((a,d)=>{let l={kty:"RSA",e:"AQAB",n:t},v=this.jwkToPem(l);a(Hs.createVerify(this.hashAlgorithm).update(n).verify({key:v,padding:Hs.constants.RSA_PKCS1_PSS_PADDING},f))})}hash(t,n="SHA-256"){if(typeof t=="string")throw new TypeError("Data must be a Uint8Array");return new Promise((f,a)=>{f(Hs.createHash(this.parseHashAlgorithm(n)).update(t).digest())})}async encrypt(t,n,f){let a=Hs.pbkdf2Sync(n,f=f||"salt",1e5,32,this.hashAlgorithm),d=Hs.randomBytes(16),l=Hs.createCipheriv(this.encryptionAlgorithm,a,d);return St.concat([d,l.update(t),l.final()])}async decrypt(t,n,f){try{let a=Hs.pbkdf2Sync(n,f=f||"salt",1e5,32,this.hashAlgorithm),d=t.slice(0,16),l=t.slice(16),v=Hs.createDecipheriv(this.encryptionAlgorithm,a,d);return St.concat([v.update(l),v.final()])}catch{throw new Error("Failed to decrypt")}}jwkToPem(t){return(0,ere.jwkTopem)(t)}pemToJWK(t){return(0,ere.pemTojwk)(t)}parseHashAlgorithm(t){switch(t){case"SHA-256":return"sha256";case"SHA-384":return"sha384";default:throw new Error(`Algorithm not supported: ${t}`)}}};Sh.default=rk});var rre=Ht(nk=>{"use strict";Be();Pe();Oe();Object.defineProperty(nk,"__esModule",{value:!0});var ik=class{api;constructor(t){this.api=t}getInfo(){return this.api.get("info").then(t=>t.data)}getPeers(){return this.api.get("peers").then(t=>t.data)}};nk.default=ik});var Z2=Ht(K2=>{"use strict";Be();Pe();Oe();Object.defineProperty(K2,"__esModule",{value:!0});K2.getError=void 0;var ak=class extends Error{type;response;constructor(t,n={}){n.message?super(n.message):super(),this.type=t,this.response=n.response}getType(){return this.type}};K2.default=ak;function vTe(e){let t=e.data;if(typeof e.data=="string")try{t=JSON.parse(e.data)}catch{}if(e.data instanceof ArrayBuffer||e.data instanceof Uint8Array)try{t=JSON.parse(t.toString())}catch{}return t?t.error||t:e.statusText||"unknown"}K2.getError=vTe});var are=Ht(Q3=>{"use strict";Be();Pe();Oe();Q3.byteLength=gTe;Q3.toByteArray=bTe;Q3.fromByteArray=MTe;var Bu=[],Ks=[],mTe=typeof Uint8Array<"u"?Uint8Array:Array,ok="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(dc=0,ire=ok.length;dc<ire;++dc)Bu[dc]=ok[dc],Ks[ok.charCodeAt(dc)]=dc;var dc,ire;Ks[45]=62;Ks[95]=63;function nre(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var f=n===t?0:4-n%4;return[n,f]}function gTe(e){var t=nre(e),n=t[0],f=t[1];return(n+f)*3/4-f}function yTe(e,t,n){return(t+n)*3/4-n}function bTe(e){var t,n=nre(e),f=n[0],a=n[1],d=new mTe(yTe(e,f,a)),l=0,v=a>0?f-4:f,w;for(w=0;w<v;w+=4)t=Ks[e.charCodeAt(w)]<<18|Ks[e.charCodeAt(w+1)]<<12|Ks[e.charCodeAt(w+2)]<<6|Ks[e.charCodeAt(w+3)],d[l++]=t>>16&255,d[l++]=t>>8&255,d[l++]=t&255;return a===2&&(t=Ks[e.charCodeAt(w)]<<2|Ks[e.charCodeAt(w+1)]>>4,d[l++]=t&255),a===1&&(t=Ks[e.charCodeAt(w)]<<10|Ks[e.charCodeAt(w+1)]<<4|Ks[e.charCodeAt(w+2)]>>2,d[l++]=t>>8&255,d[l++]=t&255),d}function wTe(e){return Bu[e>>18&63]+Bu[e>>12&63]+Bu[e>>6&63]+Bu[e&63]}function _Te(e,t,n){for(var f,a=[],d=t;d<n;d+=3)f=(e[d]<<16&16711680)+(e[d+1]<<8&65280)+(e[d+2]&255),a.push(wTe(f));return a.join("")}function MTe(e){for(var t,n=e.length,f=n%3,a=[],d=16383,l=0,v=n-f;l<v;l+=d)a.push(_Te(e,l,l+d>v?v:l+d));return f===1?(t=e[n-1],a.push(Bu[t>>2]+Bu[t<<4&63]+"==")):f===2&&(t=(e[n-2]<<8)+e[n-1],a.push(Bu[t>>10]+Bu[t>>4&63]+Bu[t<<2&63]+"=")),a.join("")}});var Eh=Ht(ln=>{"use strict";Be();Pe();Oe();var STe=ln&&ln.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),ETe=ln&&ln.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ATe=ln&&ln.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&STe(t,e,n);return ETe(t,e),t};Object.defineProperty(ln,"__esModule",{value:!0});ln.b64UrlDecode=ln.b64UrlEncode=ln.bufferTob64Url=ln.bufferTob64=ln.b64UrlToBuffer=ln.stringToB64Url=ln.stringToBuffer=ln.bufferToString=ln.b64UrlToString=ln.concatBuffers=void 0;var ore=ATe(are());function xTe(e){let t=0;for(let a=0;a<e.length;a++)t+=e[a].byteLength;let n=new Uint8Array(t),f=0;n.set(new Uint8Array(e[0]),f),f+=e[0].byteLength;for(let a=1;a<e.length;a++)n.set(new Uint8Array(e[a]),f),f+=e[a].byteLength;return n}ln.concatBuffers=xTe;function RTe(e){let t=ure(e);return sre(t)}ln.b64UrlToString=RTe;function sre(e){return new TextDecoder("utf-8",{fatal:!0}).decode(e)}ln.bufferToString=sre;function fre(e){return new TextEncoder().encode(e)}ln.stringToBuffer=fre;function kTe(e){return lre(fre(e))}ln.stringToB64Url=kTe;function ure(e){return new Uint8Array(ore.toByteArray(dre(e)))}ln.b64UrlToBuffer=ure;function hre(e){return ore.fromByteArray(new Uint8Array(e))}ln.bufferTob64=hre;function lre(e){return cre(hre(e))}ln.bufferTob64Url=lre;function cre(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}ln.b64UrlEncode=cre;function dre(e){e=e.replace(/\-/g,"+").replace(/\_/g,"/");let t;return e.length%4==0?t=0:t=4-e.length%4,e.concat("=".repeat(t))}ln.b64UrlDecode=dre});var mre=Ht(W2=>{"use strict";Be();Pe();Oe();var TTe=W2&&W2.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(W2,"__esModule",{value:!0});var Ko=TTe(e8());async function pre(e){if(Array.isArray(e)){let f=Ko.default.utils.concatBuffers([Ko.default.utils.stringToBuffer("list"),Ko.default.utils.stringToBuffer(e.length.toString())]);return await vre(e,await Ko.default.crypto.hash(f,"SHA-384"))}let t=Ko.default.utils.concatBuffers([Ko.default.utils.stringToBuffer("blob"),Ko.default.utils.stringToBuffer(e.byteLength.toString())]),n=Ko.default.utils.concatBuffers([await Ko.default.crypto.hash(t,"SHA-384"),await Ko.default.crypto.hash(e,"SHA-384")]);return await Ko.default.crypto.hash(n,"SHA-384")}W2.default=pre;async function vre(e,t){if(e.length<1)return t;let n=Ko.default.utils.concatBuffers([t,await pre(e[0])]),f=await Ko.default.crypto.hash(n,"SHA-384");return await vre(e.slice(1),f)}});var ck=Ht(vi=>{"use strict";Be();Pe();Oe();var ITe=vi&&vi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vi,"__esModule",{value:!0});vi.debug=vi.validatePath=vi.arrayCompare=vi.bufferToInt=vi.intToBuffer=vi.arrayFlatten=vi.generateProofs=vi.buildLayers=vi.generateTransactionChunks=vi.generateTree=vi.computeRootHash=vi.generateLeaves=vi.chunkData=vi.MIN_CHUNK_SIZE=vi.MAX_CHUNK_SIZE=void 0;var t8=ITe(e8()),gre=Eh();vi.MAX_CHUNK_SIZE=256*1024;vi.MIN_CHUNK_SIZE=32*1024;var G2=32,E1=32;async function fk(e){let t=[],n=e,f=0;for(;n.byteLength>=vi.MAX_CHUNK_SIZE;){let a=vi.MAX_CHUNK_SIZE,d=n.byteLength-vi.MAX_CHUNK_SIZE;d>0&&d<vi.MIN_CHUNK_SIZE&&(a=Math.ceil(n.byteLength/2));let l=n.slice(0,a),v=await t8.default.crypto.hash(l);f+=l.byteLength,t.push({dataHash:v,minByteRange:f-l.byteLength,maxByteRange:f}),n=n.slice(a)}return t.push({dataHash:await t8.default.crypto.hash(n),minByteRange:f,maxByteRange:f+n.byteLength}),t}vi.chunkData=fk;async function uk(e){return Promise.all(e.map(async({dataHash:t,minByteRange:n,maxByteRange:f})=>({type:"leaf",id:await Sa(await Promise.all([Sa(t),Sa(Y2(f))])),dataHash:t,minByteRange:n,maxByteRange:f})))}vi.generateLeaves=uk;async function BTe(e){return(await yre(e)).id}vi.computeRootHash=BTe;async function yre(e){return await r8(await uk(await fk(e)))}vi.generateTree=yre;async function OTe(e){let t=await fk(e),n=await uk(t),f=await r8(n),a=await bre(f),d=t.slice(-1)[0];return d.maxByteRange-d.minByteRange===0&&(t.splice(t.length-1,1),a.splice(a.length-1,1)),{data_root:f.id,chunks:t,proofs:a}}vi.generateTransactionChunks=OTe;async function r8(e,t=0){if(e.length<2)return e[0];let n=[];for(let f=0;f<e.length;f+=2)n.push(await PTe(e[f],e[f+1]));return r8(n,t+1)}vi.buildLayers=r8;function bre(e){let t=sk(e);return Array.isArray(t)?hk(t):[t]}vi.generateProofs=bre;function sk(e,t=new Uint8Array,n=0){if(e.type=="leaf")return{offset:e.maxByteRange-1,proof:(0,gre.concatBuffers)([t,e.dataHash,Y2(e.maxByteRange)])};if(e.type=="branch"){let f=(0,gre.concatBuffers)([t,e.leftChild.id,e.rightChild.id,Y2(e.byteRange)]);return[sk(e.leftChild,f,n+1),sk(e.rightChild,f,n+1)]}throw new Error("Unexpected node type")}function hk(e){let t=[];return e.forEach(n=>{Array.isArray(n)?t.push(...hk(n)):t.push(n)}),t}vi.arrayFlatten=hk;async function PTe(e,t){return t?{type:"branch",id:await Sa([await Sa(e.id),await Sa(t.id),await Sa(Y2(e.maxByteRange))]),byteRange:e.maxByteRange,maxByteRange:t.maxByteRange,leftChild:e,rightChild:t}:e}async function Sa(e){return Array.isArray(e)&&(e=t8.default.utils.concatBuffers(e)),new Uint8Array(await t8.default.crypto.hash(e))}function Y2(e){let t=new Uint8Array(G2);for(var n=t.length-1;n>=0;n--){var f=e%256;t[n]=f,e=(e-f)/256}return t}vi.intToBuffer=Y2;function lk(e){let t=0;for(var n=0;n<e.length;n++)t*=256,t+=e[n];return t}vi.bufferToInt=lk;var NTe=(e,t)=>e.every((n,f)=>t[f]===n);vi.arrayCompare=NTe;async function V2(e,t,n,f,a){if(f<=0)return!1;if(t>=f)return V2(e,0,f-1,f,a);if(t<0)return V2(e,0,0,f,a);if(a.length==E1+G2){let g=a.slice(0,E1),S=a.slice(g.length,g.length+G2),x=await Sa([await Sa(g),await Sa(S)]);return(0,vi.arrayCompare)(e,x)?{offset:f-1,leftBound:n,rightBound:f,chunkSize:f-n}:!1}let d=a.slice(0,E1),l=a.slice(d.length,d.length+E1),v=a.slice(d.length+l.length,d.length+l.length+G2),w=lk(v),m=a.slice(d.length+l.length+v.length),y=await Sa([await Sa(d),await Sa(l),await Sa(v)]);return(0,vi.arrayCompare)(e,y)?t<w?await V2(d,t,n,Math.min(f,w),m):await V2(l,t,Math.max(n,w),f,m):!1}vi.validatePath=V2;async function wre(e,t=""){if(e.byteLength<1)return t;let n=e.slice(0,E1),f=e.slice(n.length,n.length+E1),a=e.slice(n.length+f.length,n.length+f.length+G2),d=lk(a),l=e.slice(n.length+f.length+a.length),v=await Sa([await Sa(n),await Sa(f),await Sa(a)]),w=`${t}
|
|
138
|
-
${JSON.stringify(St.from(n))},${JSON.stringify(St.from(f))},${d} => ${JSON.stringify(v)}`;return wre(l,w)}vi.debug=wre});var n8=Ht(Zo=>{"use strict";Be();Pe();Oe();var CTe=Zo&&Zo.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),LTe=Zo&&Zo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),DTe=Zo&&Zo.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&CTe(t,e,n);return LTe(t,e),t},$Te=Zo&&Zo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.Tag=void 0;var fa=DTe(Eh()),UTe=$Te(mre()),qTe=ck(),i8=class{get(t,n){if(!Object.getOwnPropertyNames(this).includes(t))throw new Error(`Field "${t}" is not a property of the Arweave Transaction class.`);if(this[t]instanceof Uint8Array)return n&&n.decode&&n.string?fa.bufferToString(this[t]):n&&n.decode&&!n.string?this[t]:fa.bufferTob64Url(this[t]);if(this[t]instanceof Array){if(n?.decode!==void 0||n?.string!==void 0)throw t==="tags"&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),new Error("Cannot decode or stringify an array.");return this[t]}return n&&n.decode==!0?n&&n.string?fa.b64UrlToString(this[t]):fa.b64UrlToBuffer(this[t]):this[t]}},J2=class extends i8{name;value;constructor(t,n,f=!1){super(),this.name=t,this.value=n}};Zo.Tag=J2;var dk=class extends i8{format=2;id="";last_tx="";owner="";tags=[];target="";quantity="0";data_size="0";data=new Uint8Array;data_root="";reward="0";signature="";chunks;constructor(t={}){super(),Object.assign(this,t),typeof this.data=="string"&&(this.data=fa.b64UrlToBuffer(this.data)),t.tags&&(this.tags=t.tags.map(n=>new J2(n.name,n.value)))}addTag(t,n){this.tags.push(new J2(fa.stringToB64Url(t),fa.stringToB64Url(n)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:fa.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(t){this.owner=t}setSignature({id:t,owner:n,reward:f,tags:a,signature:d}){this.id=t,this.owner=n,f&&(this.reward=f),a&&(this.tags=a),this.signature=d}async prepareChunks(t){!this.chunks&&t.byteLength>0&&(this.chunks=await(0,qTe.generateTransactionChunks)(t),this.data_root=fa.bufferTob64Url(this.chunks.data_root)),!this.chunks&&t.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root="")}getChunk(t,n){if(!this.chunks)throw new Error("Chunks have not been prepared");let f=this.chunks.proofs[t],a=this.chunks.chunks[t];return{data_root:this.data_root,data_size:this.data_size,data_path:fa.bufferTob64Url(f.proof),offset:f.offset.toString(),chunk:fa.bufferTob64Url(n.slice(a.minByteRange,a.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let t=this.tags.reduce((f,a)=>fa.concatBuffers([f,a.get("name",{decode:!0,string:!1}),a.get("value",{decode:!0,string:!1})]),new Uint8Array);return fa.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),fa.stringToBuffer(this.quantity),fa.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),t]);case 2:this.data_root||await this.prepareChunks(this.data);let n=this.tags.map(f=>[f.get("name",{decode:!0,string:!1}),f.get("value",{decode:!0,string:!1})]);return await(0,UTe.default)([fa.stringToBuffer(this.format.toString()),this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),fa.stringToBuffer(this.quantity),fa.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),n,fa.stringToBuffer(this.data_size),this.get("data_root",{decode:!0,string:!1})]);default:throw new Error(`Unexpected transaction format: ${this.format}`)}}};Zo.default=dk});var Ere=Ht(Zs=>{"use strict";Be();Pe();Oe();var jTe=Zs&&Zs.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),FTe=Zs&&Zs.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),zTe=Zs&&Zs.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&jTe(t,e,n);return FTe(t,e),t},HTe=Zs&&Zs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.TransactionUploader=void 0;var _re=HTe(n8()),KTe=zTe(Eh()),pk=Z2(),ZTe=ck(),Mre=1,WTe=["invalid_json","chunk_too_big","data_path_too_big","offset_too_big","data_size_too_big","chunk_proof_ratio_not_attractive","invalid_proof"],Sre=1e3*40,vk=class e{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError="";get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(t,n){if(this.api=t,!n.id)throw new Error("Transaction is not signed");if(!n.chunks)throw new Error("Transaction chunks not prepared");this.data=n.data,this.transaction=new _re.default(Object.assign({},n,{data:new Uint8Array(0)}))}async uploadChunk(t){if(this.isComplete)throw new Error("Upload is already complete");if(this.lastResponseError!==""?this.totalErrors++:this.totalErrors=0,this.totalErrors===100)throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let n=this.lastResponseError===""?0:Math.max(this.lastRequestTimeEnd+Sre-Date.now(),Sre);if(n>0&&(n=n-n*Math.random()*.3,await new Promise(l=>setTimeout(l,n))),this.lastResponseError="",!this.txPosted){await this.postTransaction();return}t&&(this.chunkIndex=t);let f=this.transaction.getChunk(t||this.chunkIndex,this.data);if(!await(0,ZTe.validatePath)(this.transaction.chunks.data_root,parseInt(f.offset),0,parseInt(f.data_size),KTe.b64UrlToBuffer(f.data_path)))throw new Error(`Unable to validate chunk ${this.chunkIndex}`);let d=await this.api.post("chunk",this.transaction.getChunk(this.chunkIndex,this.data)).catch(l=>(console.error(l.message),{status:-1,data:{error:l.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=d.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,pk.getError)(d),WTe.includes(this.lastResponseError))throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(t,n,f){if(!n||typeof n.chunkIndex!="number"||typeof n.transaction!="object")throw new Error("Serialized object does not match expected format.");var a=new _re.default(n.transaction);a.chunks||await a.prepareChunks(f);let d=new e(t,a);if(d.chunkIndex=n.chunkIndex,d.lastRequestTimeEnd=n.lastRequestTimeEnd,d.lastResponseError=n.lastResponseError,d.lastResponseStatus=n.lastResponseStatus,d.txPosted=n.txPosted,d.data=f,d.transaction.data_root!==n.transaction.data_root)throw new Error("Data mismatch: Uploader doesn't match provided data.");return d}static async fromTransactionId(t,n){let f=await t.get(`tx/${n}`);if(f.status!==200)throw new Error(`Tx ${n} not found: ${f.status}`);let a=f.data;return a.data=new Uint8Array(0),{txPosted:!0,chunkIndex:0,lastResponseError:"",lastRequestTimeEnd:0,lastResponseStatus:0,transaction:a}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=Mre){this.transaction.data=this.data;let f=await this.api.post("tx",this.transaction).catch(a=>(console.error(a),{status:-1,data:{error:a.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=f.status,this.transaction.data=new Uint8Array(0),f.status>=200&&f.status<300){this.txPosted=!0,this.chunkIndex=Mre;return}throw this.lastResponseError=(0,pk.getError)(f),new Error(`Unable to upload transaction: ${f.status}, ${this.lastResponseError}`)}let n=await this.api.post("tx",this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=n.status,!(n.status>=200&&n.status<300))throw this.lastResponseError=(0,pk.getError)(n),new Error(`Unable to upload transaction: ${n.status}, ${this.lastResponseError}`);this.txPosted=!0}};Zs.TransactionUploader=vk});var a8=Ht((AGe,Are)=>{"use strict";Be();Pe();Oe();Are.exports={}});var Rre=Ht(Ff=>{"use strict";Be();Pe();Oe();var VTe=Ff&&Ff.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),GTe=Ff&&Ff.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),YTe=Ff&&Ff.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&VTe(t,e,n);return GTe(t,e),t},xre=Ff&&Ff.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ff,"__esModule",{value:!0});var mk=xre(Z2()),Ah=xre(n8()),X2=YTe(Eh()),gk=Ere();a8();var yk=class{api;crypto;chunks;constructor(t,n,f){this.api=t,this.crypto=n,this.chunks=f}async getTransactionAnchor(){let t=await this.api.get("tx_anchor");if(!t.data.match(/^[a-z0-9_-]{43,}/i)||!t.ok)throw new Error(`Could not getTransactionAnchor. Received: ${t.data}. Status: ${t.status}, ${t.statusText}`);return t.data}async getPrice(t,n){let f=n?`price/${t}/${n}`:`price/${t}`,a=await this.api.get(f);if(!/^\d+$/.test(a.data)||!a.ok)throw new Error(`Could not getPrice. Received: ${a.data}. Status: ${a.status}, ${a.statusText}`);return a.data}async get(t){let n=await this.api.get(`tx/${t}`);if(n.status==200){let f=parseInt(n.data.data_size);if(n.data.format>=2&&f>0&&f<=1024*1024*12){let a=await this.getData(t);return new Ah.default({...n.data,data:a})}return new Ah.default({...n.data,format:n.data.format||1})}throw n.status==404?new mk.default("TX_NOT_FOUND"):n.status==410?new mk.default("TX_FAILED"):new mk.default("TX_INVALID")}fromRaw(t){return new Ah.default(t)}async search(t,n){return this.api.post("arql",{op:"equals",expr1:t,expr2:n}).then(f=>f.data?f.data:[])}getStatus(t){return this.api.get(`tx/${t}/status`).then(n=>n.status==200?{status:200,confirmed:n.data}:{status:n.status,confirmed:null})}async getData(t,n){let f;try{f=await this.chunks.downloadChunkedData(t)}catch(a){console.error(`Error while trying to download chunked data for ${t}`),console.error(a)}if(!f){console.warn(`Falling back to gateway cache for ${t}`);try{let{data:a,ok:d,status:l,statusText:v}=await this.api.get(`/${t}`,{responseType:"arraybuffer"});if(!d)throw new Error("Bad http status code",{cause:{status:l,statusText:v}});f=a}catch(a){console.error(`Error while trying to download contiguous data from gateway cache for ${t}`),console.error(a)}}if(!f)throw new Error(`${t} data was not found!`);return n&&n.decode&&!n.string?f:n&&n.decode&&n.string?X2.bufferToString(f):X2.bufferTob64Url(f)}async sign(t,n,f){let d=typeof n=="object"&&(v=>{let w=!0;return["n","e","d","p","q","dp","dq","qi"].map(m=>!(m in v)&&(w=!1)),w})(n),l=typeof arweaveWallet=="object";if(!d&&!l)throw new Error("No valid JWK or external wallet found to sign transaction.");if(d){t.setOwner(n.n);let v=await t.getSignatureData(),w=await this.crypto.sign(n,v,f),m=await this.crypto.hash(w);t.setSignature({id:X2.bufferTob64Url(m),owner:n.n,signature:X2.bufferTob64Url(w)})}else if(l){try{(await arweaveWallet.getPermissions()).includes("SIGN_TRANSACTION")||await arweaveWallet.connect(["SIGN_TRANSACTION"])}catch{}let v=await arweaveWallet.sign(t,f);t.setSignature({id:v.id,owner:v.owner,reward:v.reward,tags:v.tags,signature:v.signature})}else throw new Error("An error occurred while signing. Check wallet is valid")}async verify(t){let n=await t.getSignatureData(),f=t.get("signature",{decode:!0,string:!1}),a=X2.bufferTob64Url(await this.crypto.hash(f));if(t.id!==a)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(t.owner,n,f)}async post(t){if(typeof t=="string"?t=new Ah.default(JSON.parse(t)):typeof t.readInt32BE=="function"?t=new Ah.default(JSON.parse(t.toString())):typeof t=="object"&&!(t instanceof Ah.default)&&(t=new Ah.default(t)),!(t instanceof Ah.default))throw new Error("Must be Transaction object");t.chunks||await t.prepareChunks(t.data);let n=await this.getUploader(t,t.data);try{for(;!n.isComplete;)await n.uploadChunk()}catch(f){if(n.lastResponseStatus>0)return{status:n.lastResponseStatus,statusText:n.lastResponseError,data:{error:n.lastResponseError}};throw f}return{status:200,statusText:"OK",data:{}}}async getUploader(t,n){let f;if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),t instanceof Ah.default){if(n||(n=t.data),!(n instanceof Uint8Array))throw new Error("Data format is invalid");t.chunks||await t.prepareChunks(n),f=new gk.TransactionUploader(this.api,t),(!f.data||f.data.length===0)&&(f.data=n)}else{if(typeof t=="string"&&(t=await gk.TransactionUploader.fromTransactionId(this.api,t)),!n||!(n instanceof Uint8Array))throw new Error("Must provide data when resuming upload");f=await gk.TransactionUploader.fromSerialized(this.api,t,n)}return f}async*upload(t,n){let f=await this.getUploader(t,n);for(;!f.isComplete;)await f.uploadChunk(),yield f;return f}};Ff.default=yk});var Tre=Ht(xh=>{"use strict";Be();Pe();Oe();var JTe=xh&&xh.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),XTe=xh&&xh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),QTe=xh&&xh.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&JTe(t,e,n);return XTe(t,e),t};Object.defineProperty(xh,"__esModule",{value:!0});var kre=QTe(Eh());a8();var bk=class{api;crypto;constructor(t,n){this.api=t,this.crypto=n}getBalance(t){return this.api.get(`wallet/${t}/balance`).then(n=>n.data)}getLastTransactionID(t){return this.api.get(`wallet/${t}/last_tx`).then(n=>n.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(t){return!t||t==="use_wallet"?this.getAddress():this.getAddress(t)}async getAddress(t){if(!t||t==="use_wallet"){try{await arweaveWallet.connect(["ACCESS_ADDRESS"])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(t.n)}async ownerToAddress(t){return kre.bufferTob64Url(await this.crypto.hash(kre.b64UrlToBuffer(t)))}};xh.default=bk});var Bre=Ht(zf=>{"use strict";Be();Pe();Oe();var eIe=zf&&zf.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),tIe=zf&&zf.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),rIe=zf&&zf.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&eIe(t,e,n);return tIe(t,e),t};Object.defineProperty(zf,"__esModule",{value:!0});zf.SiloResource=void 0;var Ire=rIe(Eh()),wk=class{api;crypto;transactions;constructor(t,n,f){this.api=t,this.crypto=n,this.transactions=f}async get(t){if(!t)throw new Error("No Silo URI specified");let n=await this.parseUri(t),f=await this.transactions.search("Silo-Name",n.getAccessKey());if(f.length==0)throw new Error(`No data could be found for the Silo URI: ${t}`);let a=await this.transactions.get(f[0]);if(!a)throw new Error(`No data could be found for the Silo URI: ${t}`);let d=a.get("data",{decode:!0,string:!1});return this.crypto.decrypt(d,n.getEncryptionKey())}async readTransactionData(t,n){if(!n)throw new Error("No Silo URI specified");let f=await this.parseUri(n),a=t.get("data",{decode:!0,string:!1});return this.crypto.decrypt(a,f.getEncryptionKey())}async parseUri(t){let n=t.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!n)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");let f=n[1],a=Math.pow(2,parseInt(n[2])),d=await this.hash(Ire.stringToBuffer(f),a),l=Ire.bufferTob64(d.slice(0,15)),v=await this.hash(d.slice(16,31),1);return new o8(t,l,v)}async hash(t,n){let f=await this.crypto.hash(t);for(let a=0;a<n-1;a++)f=await this.crypto.hash(f);return f}};zf.default=wk;var o8=class{uri;accessKey;encryptionKey;constructor(t,n,f){this.uri=t,this.accessKey=n,this.encryptionKey=f}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};zf.SiloResource=o8});var Pre=Ht(Rh=>{"use strict";Be();Pe();Oe();var iIe=Rh&&Rh.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),nIe=Rh&&Rh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),aIe=Rh&&Rh.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&iIe(t,e,n);return nIe(t,e),t};Object.defineProperty(Rh,"__esModule",{value:!0});var Ore=Z2(),oIe=aIe(Eh()),_k=class{api;constructor(t){this.api=t}async getTransactionOffset(t){let n=await this.api.get(`tx/${t}/offset`);if(n.status===200)return n.data;throw new Error(`Unable to get transaction offset: ${(0,Ore.getError)(n)}`)}async getChunk(t){let n=await this.api.get(`chunk/${t}`);if(n.status===200)return n.data;throw new Error(`Unable to get chunk: ${(0,Ore.getError)(n)}`)}async getChunkData(t){let n=await this.getChunk(t);return oIe.b64UrlToBuffer(n.chunk)}firstChunkOffset(t){return parseInt(t.offset)-parseInt(t.size)+1}async downloadChunkedData(t){let n=await this.getTransactionOffset(t),f=parseInt(n.size),d=parseInt(n.offset)-f+1,l=new Uint8Array(f),v=0;for(;v<f;){this.api.config.logging&&console.log(`[chunk] ${v}/${f}`);let w;try{w=await this.getChunkData(d+v)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${d+v}`),console.error("[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node")}if(w)l.set(w,v),v+=w.length;else throw new Error(`Couldn't complete data download at ${v}/${f}`)}return l}};Rh.default=_k});var Cre=Ht(Q2=>{"use strict";Be();Pe();Oe();var sIe=Q2&&Q2.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q2,"__esModule",{value:!0});var Nre=sIe(Z2());a8();var Mk=class e{api;network;static HASH_ENDPOINT="block/hash/";static HEIGHT_ENDPOINT="block/height/";constructor(t,n){this.api=t,this.network=n}async get(t){let n=await this.api.get(`${e.HASH_ENDPOINT}${t}`);if(n.status===200)return n.data;throw n.status===404?new Nre.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${n}`)}async getByHeight(t){let n=await this.api.get(`${e.HEIGHT_ENDPOINT}${t}`);if(n.status===200)return n.data;throw n.status===404?new Nre.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${n}`)}async getCurrent(){let{current:t}=await this.network.getInfo();return await this.get(t)}};Q2.default=Mk});var e8=Ht(Hf=>{"use strict";Be();Pe();Oe();var fIe=Hf&&Hf.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),uIe=Hf&&Hf.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),hIe=Hf&&Hf.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&fIe(t,e,n);return uIe(t,e),t},Ou=Hf&&Hf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hf,"__esModule",{value:!0});var lIe=Ou(aH()),cIe=Ou(oH()),dIe=Ou(tre()),pIe=Ou(rre()),vIe=Ou(Rre()),mIe=Ou(Tre()),Lre=Ou(n8()),em=hIe(Eh()),gIe=Ou(Bre()),yIe=Ou(Pre()),bIe=Ou(Cre()),Sk=class e{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new dIe.default;static utils=em;constructor(t){this.api=new cIe.default(t),this.wallets=new mIe.default(this.api,e.crypto),this.chunks=new yIe.default(this.api),this.transactions=new vIe.default(this.api,e.crypto,this.chunks),this.silo=new gIe.default(this.api,this.crypto,this.transactions),this.network=new pIe.default(this.api),this.blocks=new bIe.default(this.api,this.network),this.ar=new lIe.default}get crypto(){return e.crypto}get utils(){return e.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(t,n){let f={};if(Object.assign(f,t),!t.data&&!(t.target&&t.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");if(t.owner==null&&n&&n!=="use_wallet"&&(f.owner=n.n),t.last_tx==null&&(f.last_tx=await this.transactions.getTransactionAnchor()),typeof t.data=="string"&&(t.data=em.stringToBuffer(t.data)),t.data instanceof ArrayBuffer&&(t.data=new Uint8Array(t.data)),t.data&&!(t.data instanceof Uint8Array))throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer");if(t.reward==null){let d=t.data?t.data.byteLength:0;f.reward=await this.transactions.getPrice(d,f.target)}f.data_root="",f.data_size=t.data?t.data.byteLength.toString():"0",f.data=t.data||new Uint8Array(0);let a=new Lre.default(f);return await a.getSignatureData(),a}async createSiloTransaction(t,n,f){let a={};if(Object.assign(a,t),!t.data)throw new Error("Silo transactions must have a 'data' value");if(!f)throw new Error("No Silo URI specified.");if(t.target||t.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");if(t.owner==null){if(!n||!n.n)throw new Error("A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.");a.owner=n.n}t.last_tx==null&&(a.last_tx=await this.transactions.getTransactionAnchor());let d=await this.silo.parseUri(f);if(typeof t.data=="string"){let v=await this.crypto.encrypt(em.stringToBuffer(t.data),d.getEncryptionKey());a.reward=await this.transactions.getPrice(v.byteLength),a.data=em.bufferTob64Url(v)}if(t.data instanceof Uint8Array){let v=await this.crypto.encrypt(t.data,d.getEncryptionKey());a.reward=await this.transactions.getPrice(v.byteLength),a.data=em.bufferTob64Url(v)}let l=new Lre.default(a);return l.addTag("Silo-Name",d.getAccessKey()),l.addTag("Silo-Version","0.1.0"),l}arql(t){return this.api.post("/arql",t).then(n=>n.data||[])}};Hf.default=Sk});var $re=Ht((Ak,Dre)=>{"use strict";Be();Pe();Oe();var wIe=Ak&&Ak.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ek=wIe(e8());Ek.default.init=function(e={}){return new Ek.default(e)};Dre.exports=Ek.default});var Rie=Ht((xit,xie)=>{"use strict";Be();Pe();Oe();var OBe=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);xie.exports=e=>!OBe.has(e&&e.code)});var Lie=Ht((Wit,tT)=>{"use strict";Be();Pe();Oe();var zBe=Object.prototype.hasOwnProperty,no="~";function dm(){}Object.create&&(dm.prototype=Object.create(null),new dm().__proto__||(no=!1));function HBe(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function Cie(e,t,n,f,a){if(typeof n!="function")throw new TypeError("The listener must be a function");var d=new HBe(n,f||e,a),l=no?no+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],d]:e._events[l].push(d):(e._events[l]=d,e._eventsCount++),e}function R8(e,t){--e._eventsCount===0?e._events=new dm:delete e._events[t]}function Ka(){this._events=new dm,this._eventsCount=0}Ka.prototype.eventNames=function(){var t=[],n,f;if(this._eventsCount===0)return t;for(f in n=this._events)zBe.call(n,f)&&t.push(no?f.slice(1):f);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t};Ka.prototype.listeners=function(t){var n=no?no+t:t,f=this._events[n];if(!f)return[];if(f.fn)return[f.fn];for(var a=0,d=f.length,l=new Array(d);a<d;a++)l[a]=f[a].fn;return l};Ka.prototype.listenerCount=function(t){var n=no?no+t:t,f=this._events[n];return f?f.fn?1:f.length:0};Ka.prototype.emit=function(t,n,f,a,d,l){var v=no?no+t:t;if(!this._events[v])return!1;var w=this._events[v],m=arguments.length,y,g;if(w.fn){switch(w.once&&this.removeListener(t,w.fn,void 0,!0),m){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,n),!0;case 3:return w.fn.call(w.context,n,f),!0;case 4:return w.fn.call(w.context,n,f,a),!0;case 5:return w.fn.call(w.context,n,f,a,d),!0;case 6:return w.fn.call(w.context,n,f,a,d,l),!0}for(g=1,y=new Array(m-1);g<m;g++)y[g-1]=arguments[g];w.fn.apply(w.context,y)}else{var S=w.length,x;for(g=0;g<S;g++)switch(w[g].once&&this.removeListener(t,w[g].fn,void 0,!0),m){case 1:w[g].fn.call(w[g].context);break;case 2:w[g].fn.call(w[g].context,n);break;case 3:w[g].fn.call(w[g].context,n,f);break;case 4:w[g].fn.call(w[g].context,n,f,a);break;default:if(!y)for(x=1,y=new Array(m-1);x<m;x++)y[x-1]=arguments[x];w[g].fn.apply(w[g].context,y)}}return!0};Ka.prototype.on=function(t,n,f){return Cie(this,t,n,f,!1)};Ka.prototype.once=function(t,n,f){return Cie(this,t,n,f,!0)};Ka.prototype.removeListener=function(t,n,f,a){var d=no?no+t:t;if(!this._events[d])return this;if(!n)return R8(this,d),this;var l=this._events[d];if(l.fn)l.fn===n&&(!a||l.once)&&(!f||l.context===f)&&R8(this,d);else{for(var v=0,w=[],m=l.length;v<m;v++)(l[v].fn!==n||a&&!l[v].once||f&&l[v].context!==f)&&w.push(l[v]);w.length?this._events[d]=w.length===1?w[0]:w:R8(this,d)}return this};Ka.prototype.removeAllListeners=function(t){var n;return t?(n=no?no+t:t,this._events[n]&&R8(this,n)):(this._events=new dm,this._eventsCount=0),this};Ka.prototype.off=Ka.prototype.removeListener;Ka.prototype.addListener=Ka.prototype.on;Ka.prefixed=no;Ka.EventEmitter=Ka;typeof tT<"u"&&(tT.exports=Ka)});Be();Pe();Oe();var qie=Cc(z4(),1);Be();Pe();Oe();Be();Pe();Oe();var dae=["gateway","gateways","prescribedObservers","record","auction","balance","epoch","priceForInteraction"],pae=["delegateStake","decreaseDelegateStake","joinNetwork","increaseOperatorStake","decreaseOperatorStake","updateGatewaySettings","saveObservations","extendRecord","buyRecord","increaseUndernameCount","transfer"],dOe=[...dae,...pae],pOe={GATEWAY:"gateway",GATEWAYS:"gateways",PRESCRIBED_OBSERVERS:"prescribedObservers",DELEGATE_STAKE:"delegateStake",DECREASE_DELEGATE_STAKE:"decreaseDelegateStake",JOIN_NETWORK:"joinNetwork",INCREASE_OPERATOR_STAKE:"increaseOperatorStake",DECREASE_OPERATOR_STAKE:"decreaseOperatorStake",UPDATE_GATEWAY_SETTINGS:"updateGatewaySettings",SAVE_OBSERVATIONS:"saveObservations",EXTEND_RECORD:"extendRecord",INCREASE_UNDERNAME_COUNT:"increaseUndernameCount",RECORD:"record",AUCTION:"auction",TRANSFER:"transfer",BALANCE:"balance",PRICE_FOR_INTERACTION:"priceForInteraction",EPOCH:"epoch",BUY_RECORD:"buyRecord"},vae=(n=>(n.IO="IO",n.MIO="mIO",n))(vae||{}),vOe={TRANSFER:"transfer",SET_CONTROLLER:"setController",REMOVE_CONTROLLER:"removeController",SET_NAME:"setName",SET_TICKER:"setTicker",SET_RECORD:"setRecord",REMOVE_RECORD:"removeRecord",BALANCE:"balance",EVOLVE:"evolve"};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var BO=new RegExp("^[a-zA-Z0-9_-]{43}$"),SOe=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),EOe=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),AOe=gt.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",xOe="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",mae="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",ROe=mae,zl="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",H4=1e6,OO="cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk",K4="Flwio4Lr08g6s6uim6lEJNnVGD9ylvz0_aafvpiL8FI",PO="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var Z4=class e{constructor(t){this.positiveFiniteInteger=t;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${t}`)}[Symbol.toPrimitive](t){return t==="string"&&this.toString(),this.positiveFiniteInteger}plus(t){return new e(this.positiveFiniteInteger+t.positiveFiniteInteger)}minus(t){return new e(this.positiveFiniteInteger-t.positiveFiniteInteger)}isGreaterThan(t){return this.positiveFiniteInteger>t.positiveFiniteInteger}isGreaterThanOrEqualTo(t){return this.positiveFiniteInteger>=t.positiveFiniteInteger}isLessThan(t){return this.positiveFiniteInteger<t.positiveFiniteInteger}isLessThanOrEqualTo(t){return this.positiveFiniteInteger<=t.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(t){return this.positiveFiniteInteger===t.positiveFiniteInteger}},W4=class{value;constructor(t){if(!Number.isFinite(t)||t<0)throw new Error("IOToken must be a non-negative finite number");this.value=+t.toFixed(6)}valueOf(){return this.value}toMIO(){return new V4(Math.floor(this.value*H4))}toString(){return`${this.value}`}},V4=class e extends Z4{constructor(t){super(t)}multiply(t){let n=Math.floor(this.valueOf()*t.valueOf());return new e(n)}divide(t){if(t.valueOf()===0)throw new Error("Cannot divide by zero");let n=Math.floor(this.valueOf()/t.valueOf());return new e(n)}plus(t){let n=super.plus(t);return new e(n.valueOf())}minus(t){let n=super.minus(t);return new e(n.valueOf())}toIO(){return new W4(this.valueOf()/H4)}};Be();Pe();Oe();Be();Pe();Oe();var NO=e=>BO.test(e);function $Oe(e){return e!==void 0&&!isNaN(parseInt(e.toString()))}function $c(e){return"process"in e}function Uc(e){return"processId"in e&&typeof e.processId=="string"&&NO(e.processId)===!0}function HOe(e){return e.type==="lease"&&e.endTimestamp!==void 0}Be();Pe();Oe();Be();Pe();Oe();var rf=class extends Error{constructor(t){super(t),this.name=this.constructor.name}},CO=class extends rf{},LO=class extends rf{},DO=class extends rf{constructor(t,n){super(`Failed request: ${t}: ${n}`)}},$O=class extends rf{},gg=class extends rf{},UO=class extends rf{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},$h=class extends rf{constructor(){super("Invalid contract configuration")}},qO=class extends rf{constructor(){super("Invalid process configuration")}},jO=class extends rf{};Be();Pe();Oe();var mf=Cc(Zj(),1);Be();Pe();Oe();var bd="2.1.0-alpha.4";var rh=class e{logger;silent=!1;static default=new e;constructor({level:t="info"}={}){t==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,mf.createLogger)({level:t,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:bd},format:mf.format.combine(mf.format.timestamp(),mf.format.json()),transports:[new mf.transports.Console({format:mf.format.combine(mf.format.timestamp(),mf.format.json())})]})}info(t,...n){this.silent||this.logger.info(t,...n)}warn(t,...n){this.silent||this.logger.warn(t,...n)}error(t,...n){this.silent||this.logger.error(t,...n)}debug(t,...n){this.silent||this.logger.debug(t,...n)}setLogLevel(t){this.silent=t==="none","silent"in this.logger&&(this.logger.silent=t==="none"),"level"in this.logger&&(this.logger.level=t)}};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var Q6e=Object.create,H9=Object.defineProperty,eye=Object.getOwnPropertyDescriptor,yF=Object.getOwnPropertyNames,tye=Object.getPrototypeOf,rye=Object.prototype.hasOwnProperty,Co=(e,t)=>function(){return t||(0,e[yF(e)[0]])((t={exports:{}}).exports,t),t.exports},bF=(e,t)=>{for(var n in t)H9(e,n,{get:t[n],enumerable:!0})},iye=(e,t,n,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of yF(t))!rye.call(e,a)&&a!==n&&H9(e,a,{get:()=>t[a],enumerable:!(f=eye(t,a))||f.enumerable});return e},K9=(e,t,n)=>(n=e!=null?Q6e(tye(e)):{},iye(t||!e||!e.__esModule?H9(n,"default",{value:e,enumerable:!0}):n,e)),nye=Co({"node_modules/obliterator/iterator.js"(e,t){function n(f){if(typeof f!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=f}typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var f=arguments,a=f.length,d=0;return new n(function(){return d>=a?{done:!0}:{done:!1,value:f[d++]}})},n.empty=function(){var f=new n(function(){return{done:!0}});return f},n.fromSequence=function(f){var a=0,d=f.length;return new n(function(){return a>=d?{done:!0}:{done:!1,value:f[a++]}})},n.is=function(f){return f instanceof n?!0:typeof f=="object"&&f!==null&&typeof f.next=="function"},t.exports=n}}),aye=Co({"node_modules/obliterator/support.js"(e){e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",e.SYMBOL_SUPPORT=typeof Symbol<"u"}}),Z9=Co({"node_modules/obliterator/foreach.js"(e,t){var n=aye(),f=n.ARRAY_BUFFER_SUPPORT,a=n.SYMBOL_SUPPORT;t.exports=function(l,v){var w,m,y,g,S;if(!l)throw new Error("obliterator/forEach: invalid iterable.");if(typeof v!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(l)||f&&ArrayBuffer.isView(l)||typeof l=="string"||l.toString()==="[object Arguments]"){for(y=0,g=l.length;y<g;y++)v(l[y],y);return}if(typeof l.forEach=="function"){l.forEach(v);return}if(a&&Symbol.iterator in l&&typeof l.next!="function"&&(l=l[Symbol.iterator]()),typeof l.next=="function"){for(w=l,y=0;S=w.next(),S.done!==!0;)v(S.value,y),y++;return}for(m in l)l.hasOwnProperty(m)&&v(l[m],m)}}}),W9=Co({"node_modules/mnemonist/utils/typed-arrays.js"(e){var t=Math.pow(2,8)-1,n=Math.pow(2,16)-1,f=Math.pow(2,32)-1,a=Math.pow(2,7)-1,d=Math.pow(2,15)-1,l=Math.pow(2,31)-1;e.getPointerArray=function(w){var m=w-1;if(m<=t)return Uint8Array;if(m<=n)return Uint16Array;if(m<=f)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},e.getSignedPointerArray=function(w){var m=w-1;return m<=a?Int8Array:m<=d?Int16Array:m<=l?Int32Array:Float64Array},e.getNumberType=function(w){return w===(w|0)?Math.sign(w)===-1?w<=127&&w>=-128?Int8Array:w<=32767&&w>=-32768?Int16Array:Int32Array:w<=255?Uint8Array:w<=65535?Uint16Array:Uint32Array:Float64Array};var v={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(w,m){var y=null,g=0,S,x,A,T,I;for(T=0,I=w.length;T<I;T++)A=m?m(w[T]):w[T],x=e.getNumberType(A),S=v[x.name],S>g&&(g=S,y=x);return y},e.isTypedArray=function(w){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(w)},e.concat=function(){var w=0,m,y,g;for(m=0,g=arguments.length;m<g;m++)w+=arguments[m].length;var S=new arguments[0].constructor(w);for(m=0,y=0;m<g;m++)S.set(arguments[m],y),y+=arguments[m].length;return S},e.indices=function(w){for(var m=e.getPointerArray(w),y=new m(w),g=0;g<w;g++)y[g]=g;return y}}}),wF=Co({"node_modules/mnemonist/utils/iterables.js"(e){var t=Z9(),n=W9();function f(v){return Array.isArray(v)||n.isTypedArray(v)}function a(v){if(typeof v.length=="number")return v.length;if(typeof v.size=="number")return v.size}function d(v){var w=a(v),m=typeof w=="number"?new Array(w):[],y=0;return t(v,function(g){m[y++]=g}),m}function l(v){var w=a(v),m=typeof w=="number"?n.getPointerArray(w):Array,y=typeof w=="number"?new Array(w):[],g=typeof w=="number"?new m(w):[],S=0;return t(v,function(x){y[S]=x,g[S]=S++}),[y,g]}e.isArrayLike=f,e.guessLength=a,e.toArray=d,e.toArrayWithIndices=l}}),oye=Co({"node_modules/mnemonist/lru-cache.js"(e,t){var n=nye(),f=Z9(),a=W9(),d=wF();function l(v,w,m){if(arguments.length<2&&(m=v,v=null,w=null),this.capacity=m,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=a.getPointerArray(m);this.forward=new y(m),this.backward=new y(m),this.K=typeof v=="function"?new v(m):new Array(m),this.V=typeof w=="function"?new w(m):new Array(m),this.size=0,this.head=0,this.tail=0,this.items={}}l.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},l.prototype.splayOnTop=function(v){var w=this.head;if(this.head===v)return this;var m=this.backward[v],y=this.forward[v];return this.tail===v?this.tail=m:this.backward[y]=m,this.forward[m]=y,this.backward[w]=v,this.head=v,this.forward[v]=w,this},l.prototype.set=function(v,w){var m=this.items[v];if(typeof m<"u"){this.splayOnTop(m),this.V[m]=w;return}this.size<this.capacity?m=this.size++:(m=this.tail,this.tail=this.backward[m],delete this.items[this.K[m]]),this.items[v]=m,this.K[m]=v,this.V[m]=w,this.forward[m]=this.head,this.backward[this.head]=m,this.head=m},l.prototype.setpop=function(v,w){var m=null,y=null,g=this.items[v];return typeof g<"u"?(this.splayOnTop(g),m=this.V[g],this.V[g]=w,{evicted:!1,key:v,value:m}):(this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],m=this.V[g],y=this.K[g],delete this.items[y]),this.items[v]=g,this.K[g]=v,this.V[g]=w,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g,y?{evicted:!0,key:y,value:m}:null)},l.prototype.has=function(v){return v in this.items},l.prototype.get=function(v){var w=this.items[v];if(!(typeof w>"u"))return this.splayOnTop(w),this.V[w]},l.prototype.peek=function(v){var w=this.items[v];if(!(typeof w>"u"))return this.V[w]},l.prototype.forEach=function(v,w){w=arguments.length>1?w:this;for(var m=0,y=this.size,g=this.head,S=this.K,x=this.V,A=this.forward;m<y;)v.call(w,x[g],S[g],this),g=A[g],m++},l.prototype.keys=function(){var v=0,w=this.size,m=this.head,y=this.K,g=this.forward;return new n(function(){if(v>=w)return{done:!0};var S=y[m];return v++,v<w&&(m=g[m]),{done:!1,value:S}})},l.prototype.values=function(){var v=0,w=this.size,m=this.head,y=this.V,g=this.forward;return new n(function(){if(v>=w)return{done:!0};var S=y[m];return v++,v<w&&(m=g[m]),{done:!1,value:S}})},l.prototype.entries=function(){var v=0,w=this.size,m=this.head,y=this.K,g=this.V,S=this.forward;return new n(function(){if(v>=w)return{done:!0};var x=y[m],A=g[m];return v++,v<w&&(m=S[m]),{done:!1,value:[x,A]}})},typeof Symbol<"u"&&(l.prototype[Symbol.iterator]=l.prototype.entries),l.prototype.inspect=function(){for(var v=new Map,w=this.entries(),m;m=w.next(),!m.done;)v.set(m.value[0],m.value[1]);return Object.defineProperty(v,"constructor",{value:l,enumerable:!1}),v},typeof Symbol<"u"&&(l.prototype[Symbol.for("nodejs.util.inspect.custom")]=l.prototype.inspect),l.from=function(v,w,m,y){if(arguments.length<2){if(y=d.guessLength(v),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=w,w=null,m=null);var g=new l(w,m,y);return f(v,function(S,x){g.set(x,S)}),g},t.exports=l}}),sye=Co({"node_modules/mnemonist/lru-map.js"(e,t){var n=oye(),f=Z9(),a=W9(),d=wF();function l(v,w,m){if(arguments.length<2&&(m=v,v=null,w=null),this.capacity=m,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=a.getPointerArray(m);this.forward=new y(m),this.backward=new y(m),this.K=typeof v=="function"?new v(m):new Array(m),this.V=typeof w=="function"?new w(m):new Array(m),this.size=0,this.head=0,this.tail=0,this.items=new Map}l.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},l.prototype.set=function(v,w){var m=this.items.get(v);if(typeof m<"u"){this.splayOnTop(m),this.V[m]=w;return}this.size<this.capacity?m=this.size++:(m=this.tail,this.tail=this.backward[m],this.items.delete(this.K[m])),this.items.set(v,m),this.K[m]=v,this.V[m]=w,this.forward[m]=this.head,this.backward[this.head]=m,this.head=m},l.prototype.setpop=function(v,w){var m=null,y=null,g=this.items.get(v);return typeof g<"u"?(this.splayOnTop(g),m=this.V[g],this.V[g]=w,{evicted:!1,key:v,value:m}):(this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],m=this.V[g],y=this.K[g],this.items.delete(y)),this.items.set(v,g),this.K[g]=v,this.V[g]=w,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g,y?{evicted:!0,key:y,value:m}:null)},l.prototype.has=function(v){return this.items.has(v)},l.prototype.get=function(v){var w=this.items.get(v);if(!(typeof w>"u"))return this.splayOnTop(w),this.V[w]},l.prototype.peek=function(v){var w=this.items.get(v);if(!(typeof w>"u"))return this.V[w]},l.prototype.splayOnTop=n.prototype.splayOnTop,l.prototype.forEach=n.prototype.forEach,l.prototype.keys=n.prototype.keys,l.prototype.values=n.prototype.values,l.prototype.entries=n.prototype.entries,typeof Symbol<"u"&&(l.prototype[Symbol.iterator]=l.prototype.entries),l.prototype.inspect=n.prototype.inspect,l.from=function(v,w,m,y){if(arguments.length<2){if(y=d.guessLength(v),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=w,w=null,m=null);var g=new l(w,m,y);return f(v,function(S,x){g.set(x,S)}),g},t.exports=l}}),fye=Co({"node_modules/ms/index.js"(e,t){var n=1e3,f=n*60,a=f*60,d=a*24,l=d*7,v=d*365.25;t.exports=function(S,x){x=x||{};var A=typeof S;if(A==="string"&&S.length>0)return w(S);if(A==="number"&&isFinite(S))return x.long?y(S):m(S);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(S))};function w(S){if(S=String(S),!(S.length>100)){var x=/^(-?(?:\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(x){var A=parseFloat(x[1]),T=(x[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return A*v;case"weeks":case"week":case"w":return A*l;case"days":case"day":case"d":return A*d;case"hours":case"hour":case"hrs":case"hr":case"h":return A*a;case"minutes":case"minute":case"mins":case"min":case"m":return A*f;case"seconds":case"second":case"secs":case"sec":case"s":return A*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function m(S){var x=Math.abs(S);return x>=d?Math.round(S/d)+"d":x>=a?Math.round(S/a)+"h":x>=f?Math.round(S/f)+"m":x>=n?Math.round(S/n)+"s":S+"ms"}function y(S){var x=Math.abs(S);return x>=d?g(S,x,d,"day"):x>=a?g(S,x,a,"hour"):x>=f?g(S,x,f,"minute"):x>=n?g(S,x,n,"second"):S+" ms"}function g(S,x,A,T){var I=x>=A*1.5;return Math.round(S/A)+" "+T+(I?"s":"")}}}),uye=Co({"node_modules/debug/src/common.js"(e,t){function n(f){d.debug=d,d.default=d,d.coerce=g,d.disable=w,d.enable=v,d.enabled=m,d.humanize=fye(),d.destroy=S,Object.keys(f).forEach(x=>{d[x]=f[x]}),d.names=[],d.skips=[],d.formatters={};function a(x){let A=0;for(let T=0;T<x.length;T++)A=(A<<5)-A+x.charCodeAt(T),A|=0;return d.colors[Math.abs(A)%d.colors.length]}d.selectColor=a;function d(x){let A,T=null,I,B;function P(...C){if(!P.enabled)return;let q=P,K=Number(new Date),G=K-(A||K);q.diff=G,q.prev=A,q.curr=K,A=K,C[0]=d.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let j=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(J,E)=>{if(J==="%%")return"%";j++;let i=d.formatters[E];if(typeof i=="function"){let s=C[j];J=i.call(q,s),C.splice(j,1),j--}return J}),d.formatArgs.call(q,C),(q.log||d.log).apply(q,C)}return P.namespace=x,P.useColors=d.useColors(),P.color=d.selectColor(x),P.extend=l,P.destroy=d.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>T!==null?T:(I!==d.namespaces&&(I=d.namespaces,B=d.enabled(x)),B),set:C=>{T=C}}),typeof d.init=="function"&&d.init(P),P}function l(x,A){let T=d(this.namespace+(typeof A>"u"?":":A)+x);return T.log=this.log,T}function v(x){d.save(x),d.namespaces=x,d.names=[],d.skips=[];let A,T=(typeof x=="string"?x:"").split(/[\s,]+/),I=T.length;for(A=0;A<I;A++)T[A]&&(x=T[A].replace(/\*/g,".*?"),x[0]==="-"?d.skips.push(new RegExp("^"+x.slice(1)+"$")):d.names.push(new RegExp("^"+x+"$")))}function w(){let x=[...d.names.map(y),...d.skips.map(y).map(A=>"-"+A)].join(",");return d.enable(""),x}function m(x){if(x[x.length-1]==="*")return!0;let A,T;for(A=0,T=d.skips.length;A<T;A++)if(d.skips[A].test(x))return!1;for(A=0,T=d.names.length;A<T;A++)if(d.names[A].test(x))return!0;return!1}function y(x){return x.toString().substring(2,x.toString().length-2).replace(/\.\*\?$/,"*")}function g(x){return x instanceof Error?x.stack||x.message:x}function S(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return d.enable(d.load()),d}t.exports=n}}),hye=Co({"node_modules/debug/src/browser.js"(e,t){e.formatArgs=f,e.save=a,e.load=d,e.useColors=n,e.storage=l(),e.destroy=(()=>{let w=!1;return()=>{w||(w=!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"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function f(w){if(w[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+w[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let m="color: "+this.color;w.splice(1,0,m,"color: inherit");let y=0,g=0;w[0].replace(/%[a-zA-Z%]/g,S=>{S!=="%%"&&(y++,S==="%c"&&(g=y))}),w.splice(g,0,m)}e.log=console.debug||console.log||(()=>{});function a(w){try{w?e.storage.setItem("debug",w):e.storage.removeItem("debug")}catch{}}function d(){let w;try{w=e.storage.getItem("debug")}catch{}return!w&&typeof gt<"u"&&"env"in gt&&(w=gt.env.DEBUG),w}function l(){try{return localStorage}catch{}}t.exports=uye()(e);var{formatters:v}=t.exports;v.j=function(w){try{return JSON.stringify(w)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}}}),lye=Co({"node_modules/base64-js/index.js"(e){"use strict";e.byteLength=w,e.toByteArray=y,e.fromByteArray=x;var t=[],n=[],f=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,l=a.length;d<l;++d)t[d]=a[d],n[a.charCodeAt(d)]=d;var d,l;n[45]=62,n[95]=63;function v(A){var T=A.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=A.indexOf("=");I===-1&&(I=T);var B=I===T?0:4-I%4;return[I,B]}function w(A){var T=v(A),I=T[0],B=T[1];return(I+B)*3/4-B}function m(A,T,I){return(T+I)*3/4-I}function y(A){var T,I=v(A),B=I[0],P=I[1],C=new f(m(A,B,P)),q=0,K=P>0?B-4:B,G;for(G=0;G<K;G+=4)T=n[A.charCodeAt(G)]<<18|n[A.charCodeAt(G+1)]<<12|n[A.charCodeAt(G+2)]<<6|n[A.charCodeAt(G+3)],C[q++]=T>>16&255,C[q++]=T>>8&255,C[q++]=T&255;return P===2&&(T=n[A.charCodeAt(G)]<<2|n[A.charCodeAt(G+1)]>>4,C[q++]=T&255),P===1&&(T=n[A.charCodeAt(G)]<<10|n[A.charCodeAt(G+1)]<<4|n[A.charCodeAt(G+2)]>>2,C[q++]=T>>8&255,C[q++]=T&255),C}function g(A){return t[A>>18&63]+t[A>>12&63]+t[A>>6&63]+t[A&63]}function S(A,T,I){for(var B,P=[],C=T;C<I;C+=3)B=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),P.push(g(B));return P.join("")}function x(A){for(var T,I=A.length,B=I%3,P=[],C=16383,q=0,K=I-B;q<K;q+=C)P.push(S(A,q,q+C>K?K:q+C));return B===1?(T=A[I-1],P.push(t[T>>2]+t[T<<4&63]+"==")):B===2&&(T=(A[I-2]<<8)+A[I-1],P.push(t[T>>10]+t[T>>4&63]+t[T<<2&63]+"=")),P.join("")}}}),cye=Co({"node_modules/ieee754/index.js"(e){e.read=function(t,n,f,a,d){var l,v,w=d*8-a-1,m=(1<<w)-1,y=m>>1,g=-7,S=f?d-1:0,x=f?-1:1,A=t[n+S];for(S+=x,l=A&(1<<-g)-1,A>>=-g,g+=w;g>0;l=l*256+t[n+S],S+=x,g-=8);for(v=l&(1<<-g)-1,l>>=-g,g+=a;g>0;v=v*256+t[n+S],S+=x,g-=8);if(l===0)l=1-y;else{if(l===m)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,a),l=l-y}return(A?-1:1)*v*Math.pow(2,l-a)},e.write=function(t,n,f,a,d,l){var v,w,m,y=l*8-d-1,g=(1<<y)-1,S=g>>1,x=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=a?0:l-1,T=a?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(w=isNaN(n)?1:0,v=g):(v=Math.floor(Math.log(n)/Math.LN2),n*(m=Math.pow(2,-v))<1&&(v--,m*=2),v+S>=1?n+=x/m:n+=x*Math.pow(2,1-S),n*m>=2&&(v++,m/=2),v+S>=g?(w=0,v=g):v+S>=1?(w=(n*m-1)*Math.pow(2,d),v=v+S):(w=n*Math.pow(2,S-1)*Math.pow(2,d),v=0));d>=8;t[f+A]=w&255,A+=T,w/=256,d-=8);for(v=v<<d|w,y+=d;y>0;t[f+A]=v&255,A+=T,v/=256,y-=8);t[f+A-T]|=I*128}}}),dye=Co({"node_modules/buffer/index.js"(e){"use strict";var t=lye(),n=cye(),f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=v,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;var a=2147483647;e.kMaxLength=a,v.TYPED_ARRAY_SUPPORT=d(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let O=new Uint8Array(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,Uint8Array.prototype),Object.setPrototypeOf(O,N),O.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function l(O){if(O>a)throw new RangeError('The value "'+O+'" is invalid for option "size"');let N=new Uint8Array(O);return Object.setPrototypeOf(N,v.prototype),N}function v(O,N,$){if(typeof O=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(O)}return w(O,N,$)}v.poolSize=8192;function w(O,N,$){if(typeof O=="string")return S(O,N);if(ArrayBuffer.isView(O))return A(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(ut(O,ArrayBuffer)||O&&ut(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(O,SharedArrayBuffer)||O&&ut(O.buffer,SharedArrayBuffer)))return T(O,N,$);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ee=O.valueOf&&O.valueOf();if(ee!=null&&ee!==O)return v.from(ee,N,$);let re=I(O);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return v.from(O[Symbol.toPrimitive]("string"),N,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}v.from=function(O,N,$){return w(O,N,$)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function m(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function y(O,N,$){return m(O),O<=0?l(O):N!==void 0?typeof $=="string"?l(O).fill(N,$):l(O).fill(N):l(O)}v.alloc=function(O,N,$){return y(O,N,$)};function g(O){return m(O),l(O<0?0:B(O)|0)}v.allocUnsafe=function(O){return g(O)},v.allocUnsafeSlow=function(O){return g(O)};function S(O,N){if((typeof N!="string"||N==="")&&(N="utf8"),!v.isEncoding(N))throw new TypeError("Unknown encoding: "+N);let $=C(O,N)|0,ee=l($),re=ee.write(O,N);return re!==$&&(ee=ee.slice(0,re)),ee}function x(O){let N=O.length<0?0:B(O.length)|0,$=l(N);for(let ee=0;ee<N;ee+=1)$[ee]=O[ee]&255;return $}function A(O){if(ut(O,Uint8Array)){let N=new Uint8Array(O);return T(N.buffer,N.byteOffset,N.byteLength)}return x(O)}function T(O,N,$){if(N<0||O.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<N+($||0))throw new RangeError('"length" is outside of buffer bounds');let ee;return N===void 0&&$===void 0?ee=new Uint8Array(O):$===void 0?ee=new Uint8Array(O,N):ee=new Uint8Array(O,N,$),Object.setPrototypeOf(ee,v.prototype),ee}function I(O){if(v.isBuffer(O)){let N=B(O.length)|0,$=l(N);return $.length===0||O.copy($,0,0,N),$}if(O.length!==void 0)return typeof O.length!="number"||qe(O.length)?l(0):x(O);if(O.type==="Buffer"&&Array.isArray(O.data))return x(O.data)}function B(O){if(O>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return O|0}function P(O){return+O!=O&&(O=0),v.alloc(+O)}v.isBuffer=function(N){return N!=null&&N._isBuffer===!0&&N!==v.prototype},v.compare=function(N,$){if(ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),ut($,Uint8Array)&&($=v.from($,$.offset,$.byteLength)),!v.isBuffer(N)||!v.isBuffer($))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(N===$)return 0;let ee=N.length,re=$.length;for(let se=0,ce=Math.min(ee,re);se<ce;++se)if(N[se]!==$[se]){ee=N[se],re=$[se];break}return ee<re?-1:re<ee?1:0},v.isEncoding=function(N){switch(String(N).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(N,$){if(!Array.isArray(N))throw new TypeError('"list" argument must be an Array of Buffers');if(N.length===0)return v.alloc(0);let ee;if($===void 0)for($=0,ee=0;ee<N.length;++ee)$+=N[ee].length;let re=v.allocUnsafe($),se=0;for(ee=0;ee<N.length;++ee){let ce=N[ee];if(ut(ce,Uint8Array))se+ce.length>re.length?(v.isBuffer(ce)||(ce=v.from(ce)),ce.copy(re,se)):Uint8Array.prototype.set.call(re,ce,se);else if(v.isBuffer(ce))ce.copy(re,se);else throw new TypeError('"list" argument must be an Array of Buffers');se+=ce.length}return re};function C(O,N){if(v.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||ut(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);let $=O.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&$===0)return 0;let re=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return he(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return Ae(O).length;default:if(re)return ee?-1:he(O).length;N=(""+N).toLowerCase(),re=!0}}v.byteLength=C;function q(O,N,$){let ee=!1;if((N===void 0||N<0)&&(N=0),N>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,N>>>=0,$<=N))return"";for(O||(O="utf8");;)switch(O){case"hex":return r(this,N,$);case"utf8":case"utf-8":return c(this,N,$);case"ascii":return R(this,N,$);case"latin1":case"binary":return o(this,N,$);case"base64":return u(this,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h(this,N,$);default:if(ee)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),ee=!0}}v.prototype._isBuffer=!0;function K(O,N,$){let ee=O[N];O[N]=O[$],O[$]=ee}v.prototype.swap16=function(){let N=this.length;if(N%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let $=0;$<N;$+=2)K(this,$,$+1);return this},v.prototype.swap32=function(){let N=this.length;if(N%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let $=0;$<N;$+=4)K(this,$,$+3),K(this,$+1,$+2);return this},v.prototype.swap64=function(){let N=this.length;if(N%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let $=0;$<N;$+=8)K(this,$,$+7),K(this,$+1,$+6),K(this,$+2,$+5),K(this,$+3,$+4);return this},v.prototype.toString=function(){let N=this.length;return N===0?"":arguments.length===0?c(this,0,N):q.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(N){if(!v.isBuffer(N))throw new TypeError("Argument must be a Buffer");return this===N?!0:v.compare(this,N)===0},v.prototype.inspect=function(){let N="",$=e.INSPECT_MAX_BYTES;return N=this.toString("hex",0,$).replace(/(.{2})/g,"$1 ").trim(),this.length>$&&(N+=" ... "),"<Buffer "+N+">"},f&&(v.prototype[f]=v.prototype.inspect),v.prototype.compare=function(N,$,ee,re,se){if(ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),!v.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if($===void 0&&($=0),ee===void 0&&(ee=N?N.length:0),re===void 0&&(re=0),se===void 0&&(se=this.length),$<0||ee>N.length||re<0||se>this.length)throw new RangeError("out of range index");if(re>=se&&$>=ee)return 0;if(re>=se)return-1;if($>=ee)return 1;if($>>>=0,ee>>>=0,re>>>=0,se>>>=0,this===N)return 0;let ce=se-re,st=ee-$,ye=Math.min(ce,st),be=this.slice(re,se),me=N.slice($,ee);for(let ke=0;ke<ye;++ke)if(be[ke]!==me[ke]){ce=be[ke],st=me[ke];break}return ce<st?-1:st<ce?1:0};function G(O,N,$,ee,re){if(O.length===0)return-1;if(typeof $=="string"?(ee=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,qe($)&&($=re?0:O.length-1),$<0&&($=O.length+$),$>=O.length){if(re)return-1;$=O.length-1}else if($<0)if(re)$=0;else return-1;if(typeof N=="string"&&(N=v.from(N,ee)),v.isBuffer(N))return N.length===0?-1:j(O,N,$,ee,re);if(typeof N=="number")return N=N&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(O,N,$):Uint8Array.prototype.lastIndexOf.call(O,N,$):j(O,[N],$,ee,re);throw new TypeError("val must be string, number or Buffer")}function j(O,N,$,ee,re){let se=1,ce=O.length,st=N.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(O.length<2||N.length<2)return-1;se=2,ce/=2,st/=2,$/=2}function ye(me,ke){return se===1?me[ke]:me.readUInt16BE(ke*se)}let be;if(re){let me=-1;for(be=$;be<ce;be++)if(ye(O,be)===ye(N,me===-1?0:be-me)){if(me===-1&&(me=be),be-me+1===st)return me*se}else me!==-1&&(be-=be-me),me=-1}else for($+st>ce&&($=ce-st),be=$;be>=0;be--){let me=!0;for(let ke=0;ke<st;ke++)if(ye(O,be+ke)!==ye(N,ke)){me=!1;break}if(me)return be}return-1}v.prototype.includes=function(N,$,ee){return this.indexOf(N,$,ee)!==-1},v.prototype.indexOf=function(N,$,ee){return G(this,N,$,ee,!0)},v.prototype.lastIndexOf=function(N,$,ee){return G(this,N,$,ee,!1)};function z(O,N,$,ee){$=Number($)||0;let re=O.length-$;ee?(ee=Number(ee),ee>re&&(ee=re)):ee=re;let se=N.length;ee>se/2&&(ee=se/2);let ce;for(ce=0;ce<ee;++ce){let st=parseInt(N.substr(ce*2,2),16);if(qe(st))return ce;O[$+ce]=st}return ce}function J(O,N,$,ee){return _e(he(N,O.length-$),O,$,ee)}function E(O,N,$,ee){return _e(pe(N),O,$,ee)}function i(O,N,$,ee){return _e(Ae(N),O,$,ee)}function s(O,N,$,ee){return _e(De(N,O.length-$),O,$,ee)}v.prototype.write=function(N,$,ee,re){if($===void 0)re="utf8",ee=this.length,$=0;else if(ee===void 0&&typeof $=="string")re=$,ee=this.length,$=0;else if(isFinite($))$=$>>>0,isFinite(ee)?(ee=ee>>>0,re===void 0&&(re="utf8")):(re=ee,ee=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let se=this.length-$;if((ee===void 0||ee>se)&&(ee=se),N.length>0&&(ee<0||$<0)||$>this.length)throw new RangeError("Attempt to write outside buffer bounds");re||(re="utf8");let ce=!1;for(;;)switch(re){case"hex":return z(this,N,$,ee);case"utf8":case"utf-8":return J(this,N,$,ee);case"ascii":case"latin1":case"binary":return E(this,N,$,ee);case"base64":return i(this,N,$,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,N,$,ee);default:if(ce)throw new TypeError("Unknown encoding: "+re);re=(""+re).toLowerCase(),ce=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function u(O,N,$){return N===0&&$===O.length?t.fromByteArray(O):t.fromByteArray(O.slice(N,$))}function c(O,N,$){$=Math.min(O.length,$);let ee=[],re=N;for(;re<$;){let se=O[re],ce=null,st=se>239?4:se>223?3:se>191?2:1;if(re+st<=$){let ye,be,me,ke;switch(st){case 1:se<128&&(ce=se);break;case 2:ye=O[re+1],(ye&192)===128&&(ke=(se&31)<<6|ye&63,ke>127&&(ce=ke));break;case 3:ye=O[re+1],be=O[re+2],(ye&192)===128&&(be&192)===128&&(ke=(se&15)<<12|(ye&63)<<6|be&63,ke>2047&&(ke<55296||ke>57343)&&(ce=ke));break;case 4:ye=O[re+1],be=O[re+2],me=O[re+3],(ye&192)===128&&(be&192)===128&&(me&192)===128&&(ke=(se&15)<<18|(ye&63)<<12|(be&63)<<6|me&63,ke>65535&&ke<1114112&&(ce=ke))}}ce===null?(ce=65533,st=1):ce>65535&&(ce-=65536,ee.push(ce>>>10&1023|55296),ce=56320|ce&1023),ee.push(ce),re+=st}return _(ee)}var p=4096;function _(O){let N=O.length;if(N<=p)return String.fromCharCode.apply(String,O);let $="",ee=0;for(;ee<N;)$+=String.fromCharCode.apply(String,O.slice(ee,ee+=p));return $}function R(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]&127);return ee}function o(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]);return ee}function r(O,N,$){let ee=O.length;(!N||N<0)&&(N=0),(!$||$<0||$>ee)&&($=ee);let re="";for(let se=N;se<$;++se)re+=Te[O[se]];return re}function h(O,N,$){let ee=O.slice(N,$),re="";for(let se=0;se<ee.length-1;se+=2)re+=String.fromCharCode(ee[se]+ee[se+1]*256);return re}v.prototype.slice=function(N,$){let ee=this.length;N=~~N,$=$===void 0?ee:~~$,N<0?(N+=ee,N<0&&(N=0)):N>ee&&(N=ee),$<0?($+=ee,$<0&&($=0)):$>ee&&($=ee),$<N&&($=N);let re=this.subarray(N,$);return Object.setPrototypeOf(re,v.prototype),re};function b(O,N,$){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+N>$)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N],se=1,ce=0;for(;++ce<$&&(se*=256);)re+=this[N+ce]*se;return re},v.prototype.readUintBE=v.prototype.readUIntBE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N+--$],se=1;for(;$>0&&(se*=256);)re+=this[N+--$]*se;return re},v.prototype.readUint8=v.prototype.readUInt8=function(N,$){return N=N>>>0,$||b(N,1,this.length),this[N]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(N,$){return N=N>>>0,$||b(N,2,this.length),this[N]|this[N+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(N,$){return N=N>>>0,$||b(N,2,this.length),this[N]<<8|this[N+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(N,$){return N=N>>>0,$||b(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+this[N+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]*16777216+(this[N+1]<<16|this[N+2]<<8|this[N+3])},v.prototype.readBigUInt64LE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=$+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24,se=this[++N]+this[++N]*2**8+this[++N]*2**16+ee*2**24;return BigInt(re)+(BigInt(se)<<BigInt(32))}),v.prototype.readBigUInt64BE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=$*2**24+this[++N]*2**16+this[++N]*2**8+this[++N],se=this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+ee;return(BigInt(re)<<BigInt(32))+BigInt(se)}),v.prototype.readIntLE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N],se=1,ce=0;for(;++ce<$&&(se*=256);)re+=this[N+ce]*se;return se*=128,re>=se&&(re-=Math.pow(2,8*$)),re},v.prototype.readIntBE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=$,se=1,ce=this[N+--re];for(;re>0&&(se*=256);)ce+=this[N+--re]*se;return se*=128,ce>=se&&(ce-=Math.pow(2,8*$)),ce},v.prototype.readInt8=function(N,$){return N=N>>>0,$||b(N,1,this.length),this[N]&128?(255-this[N]+1)*-1:this[N]},v.prototype.readInt16LE=function(N,$){N=N>>>0,$||b(N,2,this.length);let ee=this[N]|this[N+1]<<8;return ee&32768?ee|4294901760:ee},v.prototype.readInt16BE=function(N,$){N=N>>>0,$||b(N,2,this.length);let ee=this[N+1]|this[N]<<8;return ee&32768?ee|4294901760:ee},v.prototype.readInt32LE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},v.prototype.readInt32BE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},v.prototype.readBigInt64LE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=this[N+4]+this[N+5]*2**8+this[N+6]*2**16+(ee<<24);return(BigInt(re)<<BigInt(32))+BigInt($+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24)}),v.prototype.readBigInt64BE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=($<<24)+this[++N]*2**16+this[++N]*2**8+this[++N];return(BigInt(re)<<BigInt(32))+BigInt(this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+ee)}),v.prototype.readFloatLE=function(N,$){return N=N>>>0,$||b(N,4,this.length),n.read(this,N,!0,23,4)},v.prototype.readFloatBE=function(N,$){return N=N>>>0,$||b(N,4,this.length),n.read(this,N,!1,23,4)},v.prototype.readDoubleLE=function(N,$){return N=N>>>0,$||b(N,8,this.length),n.read(this,N,!0,52,8)},v.prototype.readDoubleBE=function(N,$){return N=N>>>0,$||b(N,8,this.length),n.read(this,N,!1,52,8)};function M(O,N,$,ee,re,se){if(!v.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>re||N<se)throw new RangeError('"value" argument is out of bounds');if($+ee>O.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(N,$,ee,re){if(N=+N,$=$>>>0,ee=ee>>>0,!re){let st=Math.pow(2,8*ee)-1;M(this,N,$,ee,st,0)}let se=1,ce=0;for(this[$]=N&255;++ce<ee&&(se*=256);)this[$+ce]=N/se&255;return $+ee},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(N,$,ee,re){if(N=+N,$=$>>>0,ee=ee>>>0,!re){let st=Math.pow(2,8*ee)-1;M(this,N,$,ee,st,0)}let se=ee-1,ce=1;for(this[$+se]=N&255;--se>=0&&(ce*=256);)this[$+se]=N/ce&255;return $+ee},v.prototype.writeUint8=v.prototype.writeUInt8=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,1,255,0),this[$]=N&255,$+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,65535,0),this[$]=N&255,this[$+1]=N>>>8,$+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,65535,0),this[$]=N>>>8,this[$+1]=N&255,$+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,4294967295,0),this[$+3]=N>>>24,this[$+2]=N>>>16,this[$+1]=N>>>8,this[$]=N&255,$+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,4294967295,0),this[$]=N>>>24,this[$+1]=N>>>16,this[$+2]=N>>>8,this[$+3]=N&255,$+4};function k(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,$}function D(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$+7]=se,se=se>>8,O[$+6]=se,se=se>>8,O[$+5]=se,se=se>>8,O[$+4]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$+3]=ce,ce=ce>>8,O[$+2]=ce,ce=ce>>8,O[$+1]=ce,ce=ce>>8,O[$]=ce,$+8}v.prototype.writeBigUInt64LE=mt(function(N,$=0){return k(this,N,$,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=mt(function(N,$=0){return D(this,N,$,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(N,$,ee,re){if(N=+N,$=$>>>0,!re){let ye=Math.pow(2,8*ee-1);M(this,N,$,ee,ye-1,-ye)}let se=0,ce=1,st=0;for(this[$]=N&255;++se<ee&&(ce*=256);)N<0&&st===0&&this[$+se-1]!==0&&(st=1),this[$+se]=(N/ce>>0)-st&255;return $+ee},v.prototype.writeIntBE=function(N,$,ee,re){if(N=+N,$=$>>>0,!re){let ye=Math.pow(2,8*ee-1);M(this,N,$,ee,ye-1,-ye)}let se=ee-1,ce=1,st=0;for(this[$+se]=N&255;--se>=0&&(ce*=256);)N<0&&st===0&&this[$+se+1]!==0&&(st=1),this[$+se]=(N/ce>>0)-st&255;return $+ee},v.prototype.writeInt8=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,1,127,-128),N<0&&(N=255+N+1),this[$]=N&255,$+1},v.prototype.writeInt16LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,32767,-32768),this[$]=N&255,this[$+1]=N>>>8,$+2},v.prototype.writeInt16BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,32767,-32768),this[$]=N>>>8,this[$+1]=N&255,$+2},v.prototype.writeInt32LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,2147483647,-2147483648),this[$]=N&255,this[$+1]=N>>>8,this[$+2]=N>>>16,this[$+3]=N>>>24,$+4},v.prototype.writeInt32BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[$]=N>>>24,this[$+1]=N>>>16,this[$+2]=N>>>8,this[$+3]=N&255,$+4},v.prototype.writeBigInt64LE=mt(function(N,$=0){return k(this,N,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=mt(function(N,$=0){return D(this,N,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(O,N,$,ee,re,se){if($+ee>O.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function W(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,4,34028234663852886e22,-34028234663852886e22),n.write(O,N,$,ee,23,4),$+4}v.prototype.writeFloatLE=function(N,$,ee){return W(this,N,$,!0,ee)},v.prototype.writeFloatBE=function(N,$,ee){return W(this,N,$,!1,ee)};function X(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,8,17976931348623157e292,-17976931348623157e292),n.write(O,N,$,ee,52,8),$+8}v.prototype.writeDoubleLE=function(N,$,ee){return X(this,N,$,!0,ee)},v.prototype.writeDoubleBE=function(N,$,ee){return X(this,N,$,!1,ee)},v.prototype.copy=function(N,$,ee,re){if(!v.isBuffer(N))throw new TypeError("argument should be a Buffer");if(ee||(ee=0),!re&&re!==0&&(re=this.length),$>=N.length&&($=N.length),$||($=0),re>0&&re<ee&&(re=ee),re===ee||N.length===0||this.length===0)return 0;if($<0)throw new RangeError("targetStart out of bounds");if(ee<0||ee>=this.length)throw new RangeError("Index out of range");if(re<0)throw new RangeError("sourceEnd out of bounds");re>this.length&&(re=this.length),N.length-$<re-ee&&(re=N.length-$+ee);let se=re-ee;return this===N&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin($,ee,re):Uint8Array.prototype.set.call(N,this.subarray(ee,re),$),se},v.prototype.fill=function(N,$,ee,re){if(typeof N=="string"){if(typeof $=="string"?(re=$,$=0,ee=this.length):typeof ee=="string"&&(re=ee,ee=this.length),re!==void 0&&typeof re!="string")throw new TypeError("encoding must be a string");if(typeof re=="string"&&!v.isEncoding(re))throw new TypeError("Unknown encoding: "+re);if(N.length===1){let ce=N.charCodeAt(0);(re==="utf8"&&ce<128||re==="latin1")&&(N=ce)}}else typeof N=="number"?N=N&255:typeof N=="boolean"&&(N=Number(N));if($<0||this.length<$||this.length<ee)throw new RangeError("Out of range index");if(ee<=$)return this;$=$>>>0,ee=ee===void 0?this.length:ee>>>0,N||(N=0);let se;if(typeof N=="number")for(se=$;se<ee;++se)this[se]=N;else{let ce=v.isBuffer(N)?N:v.from(N,re),st=ce.length;if(st===0)throw new TypeError('The value "'+N+'" is invalid for argument "value"');for(se=0;se<ee-$;++se)this[se+$]=ce[se%st]}return this};var V={};function Y(O,N,$){V[O]=class extends ${constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(re){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:re,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(O,N){return`The "${O}" argument must be of type number. Received type ${typeof N}`},TypeError),Y("ERR_OUT_OF_RANGE",function(O,N,$){let ee=`The value of "${O}" is out of range.`,re=$;return Number.isInteger($)&&Math.abs($)>2**32?re=ae(String($)):typeof $=="bigint"&&(re=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(re=ae(re)),re+="n"),ee+=` It must be ${N}. Received ${re}`,ee},RangeError);function ae(O){let N="",$=O.length,ee=O[0]==="-"?1:0;for(;$>=ee+4;$-=3)N=`_${O.slice($-3,$)}${N}`;return`${O.slice(0,$)}${N}`}function te(O,N,$){Z(N,"offset"),(O[N]===void 0||O[N+$]===void 0)&&ie(N,O.length-($+1))}function U(O,N,$,ee,re,se){if(O>$||O<N){let ce=typeof N=="bigint"?"n":"",st;throw se>3?N===0||N===BigInt(0)?st=`>= 0${ce} and < 2${ce} ** ${(se+1)*8}${ce}`:st=`>= -(2${ce} ** ${(se+1)*8-1}${ce}) and < 2 ** ${(se+1)*8-1}${ce}`:st=`>= ${N}${ce} and <= ${$}${ce}`,new V.ERR_OUT_OF_RANGE("value",st,O)}te(ee,re,se)}function Z(O,N){if(typeof O!="number")throw new V.ERR_INVALID_ARG_TYPE(N,"number",O)}function ie(O,N,$){throw Math.floor(O)!==O?(Z(O,$),new V.ERR_OUT_OF_RANGE($||"offset","an integer",O)):N<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${N}`,O)}var fe=/[^+/0-9A-Za-z-_]/g;function de(O){if(O=O.split("=")[0],O=O.trim().replace(fe,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function he(O,N){N=N||1/0;let $,ee=O.length,re=null,se=[];for(let ce=0;ce<ee;++ce){if($=O.charCodeAt(ce),$>55295&&$<57344){if(!re){if($>56319){(N-=3)>-1&&se.push(239,191,189);continue}else if(ce+1===ee){(N-=3)>-1&&se.push(239,191,189);continue}re=$;continue}if($<56320){(N-=3)>-1&&se.push(239,191,189),re=$;continue}$=(re-55296<<10|$-56320)+65536}else re&&(N-=3)>-1&&se.push(239,191,189);if(re=null,$<128){if((N-=1)<0)break;se.push($)}else if($<2048){if((N-=2)<0)break;se.push($>>6|192,$&63|128)}else if($<65536){if((N-=3)<0)break;se.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((N-=4)<0)break;se.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return se}function pe(O){let N=[];for(let $=0;$<O.length;++$)N.push(O.charCodeAt($)&255);return N}function De(O,N){let $,ee,re,se=[];for(let ce=0;ce<O.length&&!((N-=2)<0);++ce)$=O.charCodeAt(ce),ee=$>>8,re=$%256,se.push(re),se.push(ee);return se}function Ae(O){return t.toByteArray(de(O))}function _e(O,N,$,ee){let re;for(re=0;re<ee&&!(re+$>=N.length||re>=O.length);++re)N[re+$]=O[re];return re}function ut(O,N){return O instanceof N||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===N.name}function qe(O){return O!==O}var Te=function(){let O="0123456789abcdef",N=new Array(256);for(let $=0;$<16;++$){let ee=$*16;for(let re=0;re<16;++re)N[ee+re]=O[$]+O[re]}return N}();function mt(O){return typeof BigInt>"u"?ne:O}function ne(){throw new Error("BigInt not supported")}}}),pye={"@@functional/placeholder":!0};function _n(e){return e===pye}function eo(e){return function t(n){return arguments.length===0||_n(n)?t:e.apply(this,arguments)}}function ta(e){return function t(n,f){switch(arguments.length){case 0:return t;case 1:return _n(n)?t:eo(function(a){return e(n,a)});default:return _n(n)&&_n(f)?t:_n(n)?eo(function(a){return e(a,f)}):_n(f)?eo(function(a){return e(n,a)}):e(n,f)}}}function jy(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(n){return t.apply(this,arguments)};case 2:return function(n,f){return t.apply(this,arguments)};case 3:return function(n,f,a){return t.apply(this,arguments)};case 4:return function(n,f,a,d){return t.apply(this,arguments)};case 5:return function(n,f,a,d,l){return t.apply(this,arguments)};case 6:return function(n,f,a,d,l,v){return t.apply(this,arguments)};case 7:return function(n,f,a,d,l,v,w){return t.apply(this,arguments)};case 8:return function(n,f,a,d,l,v,w,m){return t.apply(this,arguments)};case 9:return function(n,f,a,d,l,v,w,m,y){return t.apply(this,arguments)};case 10:return function(n,f,a,d,l,v,w,m,y,g){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function _F(e,t,n){return function(){for(var f=[],a=0,d=e,l=0,v=!1;l<t.length||a<arguments.length;){var w;l<t.length&&(!_n(t[l])||a>=arguments.length)?w=t[l]:(w=arguments[a],a+=1),f[l]=w,_n(w)?v=!0:d-=1,l+=1}return!v&&d<=0?n.apply(this,f):jy(Math.max(0,d),_F(e,f,n))}}var vye=ta(function(e,t){return e===1?eo(t):jy(e,_F(e,[],t))}),MF=vye;function V9(e){return function t(n,f,a){switch(arguments.length){case 0:return t;case 1:return _n(n)?t:ta(function(d,l){return e(n,d,l)});case 2:return _n(n)&&_n(f)?t:_n(n)?ta(function(d,l){return e(d,f,l)}):_n(f)?ta(function(d,l){return e(n,d,l)}):eo(function(d){return e(n,f,d)});default:return _n(n)&&_n(f)&&_n(a)?t:_n(n)&&_n(f)?ta(function(d,l){return e(d,l,a)}):_n(n)&&_n(a)?ta(function(d,l){return e(d,f,l)}):_n(f)&&_n(a)?ta(function(d,l){return e(n,d,l)}):_n(n)?eo(function(d){return e(d,f,a)}):_n(f)?eo(function(d){return e(n,d,a)}):_n(a)?eo(function(d){return e(n,f,d)}):e(n,f,a)}}}var G9=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function mye(e){return e!=null&&typeof e["@@transducer/step"]=="function"}function Y9(e,t,n){return function(){if(arguments.length===0)return n();var f=arguments[arguments.length-1];if(!G9(f)){for(var a=0;a<e.length;){if(typeof f[e[a]]=="function")return f[e[a]].apply(f,Array.prototype.slice.call(arguments,0,-1));a+=1}if(mye(f)){var d=t.apply(null,Array.prototype.slice.call(arguments,0,-1));return d(f)}}return n.apply(this,arguments)}}function gye(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}var cv={init:function(){return this.xf["@@transducer/init"]()},result:function(e){return this.xf["@@transducer/result"](e)}};function Wj(e){for(var t=[],n;!(n=e.next()).done;)t.push(n.value);return t}function Vj(e,t,n){for(var f=0,a=n.length;f<a;){if(e(t,n[f]))return!0;f+=1}return!1}function yye(e){var t=String(e).match(/^function (\w*)/);return t==null?"":t[1]}function gy(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function bye(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var h9=typeof Object.is=="function"?Object.is:bye,Gj=Object.prototype.toString,wye=function(){return Gj.call(arguments)==="[object Arguments]"?function(e){return Gj.call(e)==="[object Arguments]"}:function(e){return gy("callee",e)}}(),_ye=wye,Mye=!{toString:null}.propertyIsEnumerable("toString"),Yj=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Jj=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),Sye=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},Eye=eo(typeof Object.keys=="function"&&!Jj?function(e){return Object(e)!==e?[]:Object.keys(e)}:function(e){if(Object(e)!==e)return[];var t,n,f=[],a=Jj&&_ye(e);for(t in e)gy(t,e)&&(!a||t!=="length")&&(f[f.length]=t);if(Mye)for(n=Yj.length-1;n>=0;)t=Yj[n],gy(t,e)&&!Sye(f,t)&&(f[f.length]=t),n-=1;return f}),Rd=Eye,Aye=eo(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),Xj=Aye;function Qj(e,t,n,f){var a=Wj(e),d=Wj(t);function l(v,w){return J9(v,w,n.slice(),f.slice())}return!Vj(function(v,w){return!Vj(l,w,v)},d,a)}function J9(e,t,n,f){if(h9(e,t))return!0;var a=Xj(e);if(a!==Xj(t))return!1;if(typeof e["fantasy-land/equals"]=="function"||typeof t["fantasy-land/equals"]=="function")return typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t)&&typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e);if(typeof e.equals=="function"||typeof t.equals=="function")return typeof e.equals=="function"&&e.equals(t)&&typeof t.equals=="function"&&t.equals(e);switch(a){case"Arguments":case"Array":case"Object":if(typeof e.constructor=="function"&&yye(e.constructor)==="Promise")return e===t;break;case"Boolean":case"Number":case"String":if(!(typeof e==typeof t&&h9(e.valueOf(),t.valueOf())))return!1;break;case"Date":if(!h9(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(!(e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.sticky===t.sticky&&e.unicode===t.unicode))return!1;break}for(var d=n.length-1;d>=0;){if(n[d]===e)return f[d]===t;d-=1}switch(a){case"Map":return e.size!==t.size?!1:Qj(e.entries(),t.entries(),n.concat([e]),f.concat([t]));case"Set":return e.size!==t.size?!1:Qj(e.values(),t.values(),n.concat([e]),f.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var l=Rd(e);if(l.length!==Rd(t).length)return!1;var v=n.concat([e]),w=f.concat([t]);for(d=l.length-1;d>=0;){var m=l[d];if(!(gy(m,t)&&J9(t[m],e[m],v,w)))return!1;d-=1}return!0}var xye=ta(function(e,t){return J9(e,t,[],[])}),SF=xye;function Rye(e,t,n){var f,a;if(typeof e.indexOf=="function")switch(typeof t){case"number":if(t===0){for(f=1/t;n<e.length;){if(a=e[n],a===0&&1/a===f)return n;n+=1}return-1}else if(t!==t){for(;n<e.length;){if(a=e[n],typeof a=="number"&&a!==a)return n;n+=1}return-1}return e.indexOf(t,n);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,n);case"object":if(t===null)return e.indexOf(t,n)}for(;n<e.length;){if(SF(e[n],t))return n;n+=1}return-1}function kye(e,t){return Rye(t,e,0)>=0}function hv(e,t){for(var n=0,f=t.length,a=Array(f);n<f;)a[n]=e(t[n]),n+=1;return a}function l9(e){var t=e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+t.replace(/"/g,'\\"')+'"'}var Qp=function(e){return(e<10?"0":"")+e},Tye=typeof Date.prototype.toISOString=="function"?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+Qp(e.getUTCMonth()+1)+"-"+Qp(e.getUTCDate())+"T"+Qp(e.getUTCHours())+":"+Qp(e.getUTCMinutes())+":"+Qp(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},Iye=Tye;function Bye(e){return function(){return!e.apply(this,arguments)}}function EF(e,t,n){for(var f=0,a=n.length;f<a;)t=e(t,n[f]),f+=1;return t}function Oye(e,t){for(var n=0,f=t.length,a=[];n<f;)e(t[n])&&(a[a.length]=t[n]),n+=1;return a}function Pye(e){return Object.prototype.toString.call(e)==="[object Object]"}var Nye=function(){function e(t,n){this.xf=n,this.f=t}return e.prototype["@@transducer/init"]=cv.init,e.prototype["@@transducer/result"]=cv.result,e.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):t},e}();function Cye(e){return function(t){return new Nye(e,t)}}var Lye=ta(Y9(["fantasy-land/filter","filter"],Cye,function(e,t){return Pye(t)?EF(function(n,f){return e(t[f])&&(n[f]=t[f]),n},{},Rd(t)):Oye(e,t)})),Dye=Lye,$ye=ta(function(e,t){return Dye(Bye(e),t)}),Uye=$ye;function AF(e,t){var n=function(d){var l=t.concat([e]);return kye(d,l)?"<Circular>":AF(d,l)},f=function(d,l){return hv(function(v){return l9(v)+": "+n(d[v])},l.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+hv(n,e).join(", ")+"))";case"[object Array]":return"["+hv(n,e).concat(f(e,Uye(function(d){return/^\d+$/.test(d)},Rd(e)))).join(", ")+"]";case"[object Boolean]":return typeof e=="object"?"new Boolean("+n(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?n(NaN):l9(Iye(e)))+")";case"[object Map]":return"new Map("+n(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return typeof e=="object"?"new Number("+n(e.valueOf())+")":1/e===-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+n(Array.from(e).sort())+")";case"[object String]":return typeof e=="object"?"new String("+n(e.valueOf())+")":l9(e);case"[object Undefined]":return"undefined";default:if(typeof e.toString=="function"){var a=e.toString();if(a!=="[object Object]")return a}return"{"+f(e,Rd(e)).join(", ")+"}"}}var qye=eo(function(e){return AF(e,[])}),eF=qye,jye=ta(function(e,t){if(e===t)return t;function n(v,w){if(v>w!=w>v)return w>v?w:v}var f=n(e,t);if(f!==void 0)return f;var a=n(typeof e,typeof t);if(a!==void 0)return a===typeof e?e:t;var d=eF(e),l=n(d,eF(t));return l!==void 0&&l===d?e:t}),Fye=jye,zye=function(){function e(t,n){this.xf=n,this.f=t}return e.prototype["@@transducer/init"]=cv.init,e.prototype["@@transducer/result"]=cv.result,e.prototype["@@transducer/step"]=function(t,n){return this.xf["@@transducer/step"](t,this.f(n))},e}(),Hye=function(e){return function(t){return new zye(e,t)}},Kye=Hye,Zye=ta(Y9(["fantasy-land/map","map"],Kye,function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return MF(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return EF(function(n,f){return n[f]=e(t[f]),n},{},Rd(t));default:return hv(e,t)}})),Wye=Zye,xF=Number.isInteger||function(e){return e<<0===e};function RF(e){return Object.prototype.toString.call(e)==="[object String]"}function kF(e,t){var n=e<0?t.length+e:e;return RF(t)?t.charAt(n):t[n]}var Vye=ta(function(e,t){if(t!=null)return xF(e)?kF(e,t):t[e]}),Fy=Vye,Gye=ta(function(e,t){return Wye(Fy(e),t)}),Yye=Gye,Jye=eo(function(e){return G9(e)?!0:!e||typeof e!="object"||RF(e)?!1:e.length===0?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1}),Xye=Jye,tF=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function Qye(e,t,n){return function(f,a,d){if(Xye(d))return e(f,a,d);if(d==null)return a;if(typeof d["fantasy-land/reduce"]=="function")return t(f,a,d,"fantasy-land/reduce");if(d[tF]!=null)return n(f,a,d[tF]());if(typeof d.next=="function")return n(f,a,d);if(typeof d.reduce=="function")return t(f,a,d,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function ebe(e,t,n){for(var f=0,a=n.length;f<a;){if(t=e["@@transducer/step"](t,n[f]),t&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}f+=1}return e["@@transducer/result"](t)}var tbe=ta(function(e,t){return jy(e.length,function(){return e.apply(t,arguments)})}),rbe=tbe;function ibe(e,t,n){for(var f=n.next();!f.done;){if(t=e["@@transducer/step"](t,f.value),t&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}f=n.next()}return e["@@transducer/result"](t)}function nbe(e,t,n,f){return e["@@transducer/result"](n[f](rbe(e["@@transducer/step"],e),t))}var abe=Qye(ebe,nbe,ibe),obe=abe,sbe=function(){function e(t){this.f=t}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(t){return t},e.prototype["@@transducer/step"]=function(t,n){return this.f(t,n)},e}();function fbe(e){return new sbe(e)}var ube=V9(function(e,t,n){return obe(typeof e=="function"?fbe(e):e,t,n)}),TF=ube;function hbe(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function IF(e,t){return function(){var n=arguments.length;if(n===0)return t();var f=arguments[n-1];return G9(f)||typeof f[e]!="function"?t.apply(this,arguments):f[e].apply(f,Array.prototype.slice.call(arguments,0,n-1))}}var lbe=V9(IF("slice",function(e,t,n){return Array.prototype.slice.call(n,e,t)})),cbe=lbe,dbe=eo(IF("tail",cbe(1,1/0))),pbe=dbe;function BF(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return jy(arguments[0].length,TF(hbe,arguments[0],pbe(arguments)))}var vbe=ta(function(e,t){return MF(TF(Fye,0,Yye("length",t)),function(){var n=arguments,f=this;return e.apply(f,hv(function(a){return a.apply(f,n)},t))})}),mbe=vbe,gbe=ta(function(e,t){return t==null||t!==t?e:t}),b9=gbe,ybe=function(){function e(t,n){this.xf=n,this.f=t,this.found=!1}return e.prototype["@@transducer/init"]=cv.init,e.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,void 0)),this.xf["@@transducer/result"](t)},e.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.found=!0,t=gye(this.xf["@@transducer/step"](t,n))),t},e}();function bbe(e){return function(t){return new ybe(e,t)}}var wbe=ta(Y9(["find"],bbe,function(e,t){for(var n=0,f=t.length;n<f;){if(e(t[n]))return t[n];n+=1}})),_be=wbe,Mbe=eo(function(e){return mbe(function(){return Array.prototype.slice.call(arguments,0)},e)}),Sbe=Mbe;function Ebe(e,t){for(var n=t,f=0;f<e.length;f+=1){if(n==null)return;var a=e[f];xF(a)?n=kF(a,n):n=n[a]}return n}var Abe=ta(Ebe),OF=Abe,xbe=V9(function(e,t,n){return SF(e,Fy(t,n))}),Rbe=xbe,yy=class extends Error{name="InvalidSchedulerLocation"},kbe=class extends Error{name="SchedulerTagNotFound"},Tbe=class extends Error{name="TransactionNotFound"},Ibe="Url",Bbe="Time-To-Live",Obe="Scheduler",w9=e=>BF(b9([]),_be(Rbe(e,"name")),b9({}),Fy("value")),PF=e=>BF(t=>{if(!t)throw new Tbe(e);return t},Fy("tags"),b9([]));function NF({fetch:e,GRAPHQL_URL:t}){return async({query:n,variables:f})=>e(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n,variables:f})}).then(a=>a.json())}function Pbe({fetch:e,GRAPHQL_URL:t}){let n=NF({fetch:e,GRAPHQL_URL:t}),f=CF({fetch:e,GRAPHQL_URL:t}),a=`
|
|
138
|
+
${JSON.stringify(St.from(n))},${JSON.stringify(St.from(f))},${d} => ${JSON.stringify(v)}`;return wre(l,w)}vi.debug=wre});var n8=Ht(Zo=>{"use strict";Be();Pe();Oe();var CTe=Zo&&Zo.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),LTe=Zo&&Zo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),DTe=Zo&&Zo.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&CTe(t,e,n);return LTe(t,e),t},$Te=Zo&&Zo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.Tag=void 0;var fa=DTe(Eh()),UTe=$Te(mre()),qTe=ck(),i8=class{get(t,n){if(!Object.getOwnPropertyNames(this).includes(t))throw new Error(`Field "${t}" is not a property of the Arweave Transaction class.`);if(this[t]instanceof Uint8Array)return n&&n.decode&&n.string?fa.bufferToString(this[t]):n&&n.decode&&!n.string?this[t]:fa.bufferTob64Url(this[t]);if(this[t]instanceof Array){if(n?.decode!==void 0||n?.string!==void 0)throw t==="tags"&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),new Error("Cannot decode or stringify an array.");return this[t]}return n&&n.decode==!0?n&&n.string?fa.b64UrlToString(this[t]):fa.b64UrlToBuffer(this[t]):this[t]}},J2=class extends i8{name;value;constructor(t,n,f=!1){super(),this.name=t,this.value=n}};Zo.Tag=J2;var dk=class extends i8{format=2;id="";last_tx="";owner="";tags=[];target="";quantity="0";data_size="0";data=new Uint8Array;data_root="";reward="0";signature="";chunks;constructor(t={}){super(),Object.assign(this,t),typeof this.data=="string"&&(this.data=fa.b64UrlToBuffer(this.data)),t.tags&&(this.tags=t.tags.map(n=>new J2(n.name,n.value)))}addTag(t,n){this.tags.push(new J2(fa.stringToB64Url(t),fa.stringToB64Url(n)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:fa.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(t){this.owner=t}setSignature({id:t,owner:n,reward:f,tags:a,signature:d}){this.id=t,this.owner=n,f&&(this.reward=f),a&&(this.tags=a),this.signature=d}async prepareChunks(t){!this.chunks&&t.byteLength>0&&(this.chunks=await(0,qTe.generateTransactionChunks)(t),this.data_root=fa.bufferTob64Url(this.chunks.data_root)),!this.chunks&&t.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root="")}getChunk(t,n){if(!this.chunks)throw new Error("Chunks have not been prepared");let f=this.chunks.proofs[t],a=this.chunks.chunks[t];return{data_root:this.data_root,data_size:this.data_size,data_path:fa.bufferTob64Url(f.proof),offset:f.offset.toString(),chunk:fa.bufferTob64Url(n.slice(a.minByteRange,a.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let t=this.tags.reduce((f,a)=>fa.concatBuffers([f,a.get("name",{decode:!0,string:!1}),a.get("value",{decode:!0,string:!1})]),new Uint8Array);return fa.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),fa.stringToBuffer(this.quantity),fa.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),t]);case 2:this.data_root||await this.prepareChunks(this.data);let n=this.tags.map(f=>[f.get("name",{decode:!0,string:!1}),f.get("value",{decode:!0,string:!1})]);return await(0,UTe.default)([fa.stringToBuffer(this.format.toString()),this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),fa.stringToBuffer(this.quantity),fa.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),n,fa.stringToBuffer(this.data_size),this.get("data_root",{decode:!0,string:!1})]);default:throw new Error(`Unexpected transaction format: ${this.format}`)}}};Zo.default=dk});var Ere=Ht(Zs=>{"use strict";Be();Pe();Oe();var jTe=Zs&&Zs.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),FTe=Zs&&Zs.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),zTe=Zs&&Zs.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&jTe(t,e,n);return FTe(t,e),t},HTe=Zs&&Zs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.TransactionUploader=void 0;var _re=HTe(n8()),KTe=zTe(Eh()),pk=Z2(),ZTe=ck(),Mre=1,WTe=["invalid_json","chunk_too_big","data_path_too_big","offset_too_big","data_size_too_big","chunk_proof_ratio_not_attractive","invalid_proof"],Sre=1e3*40,vk=class e{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError="";get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(t,n){if(this.api=t,!n.id)throw new Error("Transaction is not signed");if(!n.chunks)throw new Error("Transaction chunks not prepared");this.data=n.data,this.transaction=new _re.default(Object.assign({},n,{data:new Uint8Array(0)}))}async uploadChunk(t){if(this.isComplete)throw new Error("Upload is already complete");if(this.lastResponseError!==""?this.totalErrors++:this.totalErrors=0,this.totalErrors===100)throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let n=this.lastResponseError===""?0:Math.max(this.lastRequestTimeEnd+Sre-Date.now(),Sre);if(n>0&&(n=n-n*Math.random()*.3,await new Promise(l=>setTimeout(l,n))),this.lastResponseError="",!this.txPosted){await this.postTransaction();return}t&&(this.chunkIndex=t);let f=this.transaction.getChunk(t||this.chunkIndex,this.data);if(!await(0,ZTe.validatePath)(this.transaction.chunks.data_root,parseInt(f.offset),0,parseInt(f.data_size),KTe.b64UrlToBuffer(f.data_path)))throw new Error(`Unable to validate chunk ${this.chunkIndex}`);let d=await this.api.post("chunk",this.transaction.getChunk(this.chunkIndex,this.data)).catch(l=>(console.error(l.message),{status:-1,data:{error:l.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=d.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,pk.getError)(d),WTe.includes(this.lastResponseError))throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(t,n,f){if(!n||typeof n.chunkIndex!="number"||typeof n.transaction!="object")throw new Error("Serialized object does not match expected format.");var a=new _re.default(n.transaction);a.chunks||await a.prepareChunks(f);let d=new e(t,a);if(d.chunkIndex=n.chunkIndex,d.lastRequestTimeEnd=n.lastRequestTimeEnd,d.lastResponseError=n.lastResponseError,d.lastResponseStatus=n.lastResponseStatus,d.txPosted=n.txPosted,d.data=f,d.transaction.data_root!==n.transaction.data_root)throw new Error("Data mismatch: Uploader doesn't match provided data.");return d}static async fromTransactionId(t,n){let f=await t.get(`tx/${n}`);if(f.status!==200)throw new Error(`Tx ${n} not found: ${f.status}`);let a=f.data;return a.data=new Uint8Array(0),{txPosted:!0,chunkIndex:0,lastResponseError:"",lastRequestTimeEnd:0,lastResponseStatus:0,transaction:a}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=Mre){this.transaction.data=this.data;let f=await this.api.post("tx",this.transaction).catch(a=>(console.error(a),{status:-1,data:{error:a.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=f.status,this.transaction.data=new Uint8Array(0),f.status>=200&&f.status<300){this.txPosted=!0,this.chunkIndex=Mre;return}throw this.lastResponseError=(0,pk.getError)(f),new Error(`Unable to upload transaction: ${f.status}, ${this.lastResponseError}`)}let n=await this.api.post("tx",this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=n.status,!(n.status>=200&&n.status<300))throw this.lastResponseError=(0,pk.getError)(n),new Error(`Unable to upload transaction: ${n.status}, ${this.lastResponseError}`);this.txPosted=!0}};Zs.TransactionUploader=vk});var a8=Ht((AGe,Are)=>{"use strict";Be();Pe();Oe();Are.exports={}});var Rre=Ht(Ff=>{"use strict";Be();Pe();Oe();var VTe=Ff&&Ff.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),GTe=Ff&&Ff.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),YTe=Ff&&Ff.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&VTe(t,e,n);return GTe(t,e),t},xre=Ff&&Ff.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ff,"__esModule",{value:!0});var mk=xre(Z2()),Ah=xre(n8()),X2=YTe(Eh()),gk=Ere();a8();var yk=class{api;crypto;chunks;constructor(t,n,f){this.api=t,this.crypto=n,this.chunks=f}async getTransactionAnchor(){let t=await this.api.get("tx_anchor");if(!t.data.match(/^[a-z0-9_-]{43,}/i)||!t.ok)throw new Error(`Could not getTransactionAnchor. Received: ${t.data}. Status: ${t.status}, ${t.statusText}`);return t.data}async getPrice(t,n){let f=n?`price/${t}/${n}`:`price/${t}`,a=await this.api.get(f);if(!/^\d+$/.test(a.data)||!a.ok)throw new Error(`Could not getPrice. Received: ${a.data}. Status: ${a.status}, ${a.statusText}`);return a.data}async get(t){let n=await this.api.get(`tx/${t}`);if(n.status==200){let f=parseInt(n.data.data_size);if(n.data.format>=2&&f>0&&f<=1024*1024*12){let a=await this.getData(t);return new Ah.default({...n.data,data:a})}return new Ah.default({...n.data,format:n.data.format||1})}throw n.status==404?new mk.default("TX_NOT_FOUND"):n.status==410?new mk.default("TX_FAILED"):new mk.default("TX_INVALID")}fromRaw(t){return new Ah.default(t)}async search(t,n){return this.api.post("arql",{op:"equals",expr1:t,expr2:n}).then(f=>f.data?f.data:[])}getStatus(t){return this.api.get(`tx/${t}/status`).then(n=>n.status==200?{status:200,confirmed:n.data}:{status:n.status,confirmed:null})}async getData(t,n){let f;try{f=await this.chunks.downloadChunkedData(t)}catch(a){console.error(`Error while trying to download chunked data for ${t}`),console.error(a)}if(!f){console.warn(`Falling back to gateway cache for ${t}`);try{let{data:a,ok:d,status:l,statusText:v}=await this.api.get(`/${t}`,{responseType:"arraybuffer"});if(!d)throw new Error("Bad http status code",{cause:{status:l,statusText:v}});f=a}catch(a){console.error(`Error while trying to download contiguous data from gateway cache for ${t}`),console.error(a)}}if(!f)throw new Error(`${t} data was not found!`);return n&&n.decode&&!n.string?f:n&&n.decode&&n.string?X2.bufferToString(f):X2.bufferTob64Url(f)}async sign(t,n,f){let d=typeof n=="object"&&(v=>{let w=!0;return["n","e","d","p","q","dp","dq","qi"].map(m=>!(m in v)&&(w=!1)),w})(n),l=typeof arweaveWallet=="object";if(!d&&!l)throw new Error("No valid JWK or external wallet found to sign transaction.");if(d){t.setOwner(n.n);let v=await t.getSignatureData(),w=await this.crypto.sign(n,v,f),m=await this.crypto.hash(w);t.setSignature({id:X2.bufferTob64Url(m),owner:n.n,signature:X2.bufferTob64Url(w)})}else if(l){try{(await arweaveWallet.getPermissions()).includes("SIGN_TRANSACTION")||await arweaveWallet.connect(["SIGN_TRANSACTION"])}catch{}let v=await arweaveWallet.sign(t,f);t.setSignature({id:v.id,owner:v.owner,reward:v.reward,tags:v.tags,signature:v.signature})}else throw new Error("An error occurred while signing. Check wallet is valid")}async verify(t){let n=await t.getSignatureData(),f=t.get("signature",{decode:!0,string:!1}),a=X2.bufferTob64Url(await this.crypto.hash(f));if(t.id!==a)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(t.owner,n,f)}async post(t){if(typeof t=="string"?t=new Ah.default(JSON.parse(t)):typeof t.readInt32BE=="function"?t=new Ah.default(JSON.parse(t.toString())):typeof t=="object"&&!(t instanceof Ah.default)&&(t=new Ah.default(t)),!(t instanceof Ah.default))throw new Error("Must be Transaction object");t.chunks||await t.prepareChunks(t.data);let n=await this.getUploader(t,t.data);try{for(;!n.isComplete;)await n.uploadChunk()}catch(f){if(n.lastResponseStatus>0)return{status:n.lastResponseStatus,statusText:n.lastResponseError,data:{error:n.lastResponseError}};throw f}return{status:200,statusText:"OK",data:{}}}async getUploader(t,n){let f;if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),t instanceof Ah.default){if(n||(n=t.data),!(n instanceof Uint8Array))throw new Error("Data format is invalid");t.chunks||await t.prepareChunks(n),f=new gk.TransactionUploader(this.api,t),(!f.data||f.data.length===0)&&(f.data=n)}else{if(typeof t=="string"&&(t=await gk.TransactionUploader.fromTransactionId(this.api,t)),!n||!(n instanceof Uint8Array))throw new Error("Must provide data when resuming upload");f=await gk.TransactionUploader.fromSerialized(this.api,t,n)}return f}async*upload(t,n){let f=await this.getUploader(t,n);for(;!f.isComplete;)await f.uploadChunk(),yield f;return f}};Ff.default=yk});var Tre=Ht(xh=>{"use strict";Be();Pe();Oe();var JTe=xh&&xh.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),XTe=xh&&xh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),QTe=xh&&xh.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&JTe(t,e,n);return XTe(t,e),t};Object.defineProperty(xh,"__esModule",{value:!0});var kre=QTe(Eh());a8();var bk=class{api;crypto;constructor(t,n){this.api=t,this.crypto=n}getBalance(t){return this.api.get(`wallet/${t}/balance`).then(n=>n.data)}getLastTransactionID(t){return this.api.get(`wallet/${t}/last_tx`).then(n=>n.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(t){return!t||t==="use_wallet"?this.getAddress():this.getAddress(t)}async getAddress(t){if(!t||t==="use_wallet"){try{await arweaveWallet.connect(["ACCESS_ADDRESS"])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(t.n)}async ownerToAddress(t){return kre.bufferTob64Url(await this.crypto.hash(kre.b64UrlToBuffer(t)))}};xh.default=bk});var Bre=Ht(zf=>{"use strict";Be();Pe();Oe();var eIe=zf&&zf.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),tIe=zf&&zf.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),rIe=zf&&zf.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&eIe(t,e,n);return tIe(t,e),t};Object.defineProperty(zf,"__esModule",{value:!0});zf.SiloResource=void 0;var Ire=rIe(Eh()),wk=class{api;crypto;transactions;constructor(t,n,f){this.api=t,this.crypto=n,this.transactions=f}async get(t){if(!t)throw new Error("No Silo URI specified");let n=await this.parseUri(t),f=await this.transactions.search("Silo-Name",n.getAccessKey());if(f.length==0)throw new Error(`No data could be found for the Silo URI: ${t}`);let a=await this.transactions.get(f[0]);if(!a)throw new Error(`No data could be found for the Silo URI: ${t}`);let d=a.get("data",{decode:!0,string:!1});return this.crypto.decrypt(d,n.getEncryptionKey())}async readTransactionData(t,n){if(!n)throw new Error("No Silo URI specified");let f=await this.parseUri(n),a=t.get("data",{decode:!0,string:!1});return this.crypto.decrypt(a,f.getEncryptionKey())}async parseUri(t){let n=t.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!n)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");let f=n[1],a=Math.pow(2,parseInt(n[2])),d=await this.hash(Ire.stringToBuffer(f),a),l=Ire.bufferTob64(d.slice(0,15)),v=await this.hash(d.slice(16,31),1);return new o8(t,l,v)}async hash(t,n){let f=await this.crypto.hash(t);for(let a=0;a<n-1;a++)f=await this.crypto.hash(f);return f}};zf.default=wk;var o8=class{uri;accessKey;encryptionKey;constructor(t,n,f){this.uri=t,this.accessKey=n,this.encryptionKey=f}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};zf.SiloResource=o8});var Pre=Ht(Rh=>{"use strict";Be();Pe();Oe();var iIe=Rh&&Rh.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),nIe=Rh&&Rh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),aIe=Rh&&Rh.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&iIe(t,e,n);return nIe(t,e),t};Object.defineProperty(Rh,"__esModule",{value:!0});var Ore=Z2(),oIe=aIe(Eh()),_k=class{api;constructor(t){this.api=t}async getTransactionOffset(t){let n=await this.api.get(`tx/${t}/offset`);if(n.status===200)return n.data;throw new Error(`Unable to get transaction offset: ${(0,Ore.getError)(n)}`)}async getChunk(t){let n=await this.api.get(`chunk/${t}`);if(n.status===200)return n.data;throw new Error(`Unable to get chunk: ${(0,Ore.getError)(n)}`)}async getChunkData(t){let n=await this.getChunk(t);return oIe.b64UrlToBuffer(n.chunk)}firstChunkOffset(t){return parseInt(t.offset)-parseInt(t.size)+1}async downloadChunkedData(t){let n=await this.getTransactionOffset(t),f=parseInt(n.size),d=parseInt(n.offset)-f+1,l=new Uint8Array(f),v=0;for(;v<f;){this.api.config.logging&&console.log(`[chunk] ${v}/${f}`);let w;try{w=await this.getChunkData(d+v)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${d+v}`),console.error("[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node")}if(w)l.set(w,v),v+=w.length;else throw new Error(`Couldn't complete data download at ${v}/${f}`)}return l}};Rh.default=_k});var Cre=Ht(Q2=>{"use strict";Be();Pe();Oe();var sIe=Q2&&Q2.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q2,"__esModule",{value:!0});var Nre=sIe(Z2());a8();var Mk=class e{api;network;static HASH_ENDPOINT="block/hash/";static HEIGHT_ENDPOINT="block/height/";constructor(t,n){this.api=t,this.network=n}async get(t){let n=await this.api.get(`${e.HASH_ENDPOINT}${t}`);if(n.status===200)return n.data;throw n.status===404?new Nre.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${n}`)}async getByHeight(t){let n=await this.api.get(`${e.HEIGHT_ENDPOINT}${t}`);if(n.status===200)return n.data;throw n.status===404?new Nre.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${n}`)}async getCurrent(){let{current:t}=await this.network.getInfo();return await this.get(t)}};Q2.default=Mk});var e8=Ht(Hf=>{"use strict";Be();Pe();Oe();var fIe=Hf&&Hf.__createBinding||(Object.create?function(e,t,n,f){f===void 0&&(f=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,f,a)}:function(e,t,n,f){f===void 0&&(f=n),e[f]=t[n]}),uIe=Hf&&Hf.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),hIe=Hf&&Hf.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&fIe(t,e,n);return uIe(t,e),t},Ou=Hf&&Hf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hf,"__esModule",{value:!0});var lIe=Ou(aH()),cIe=Ou(oH()),dIe=Ou(tre()),pIe=Ou(rre()),vIe=Ou(Rre()),mIe=Ou(Tre()),Lre=Ou(n8()),em=hIe(Eh()),gIe=Ou(Bre()),yIe=Ou(Pre()),bIe=Ou(Cre()),Sk=class e{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new dIe.default;static utils=em;constructor(t){this.api=new cIe.default(t),this.wallets=new mIe.default(this.api,e.crypto),this.chunks=new yIe.default(this.api),this.transactions=new vIe.default(this.api,e.crypto,this.chunks),this.silo=new gIe.default(this.api,this.crypto,this.transactions),this.network=new pIe.default(this.api),this.blocks=new bIe.default(this.api,this.network),this.ar=new lIe.default}get crypto(){return e.crypto}get utils(){return e.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(t,n){let f={};if(Object.assign(f,t),!t.data&&!(t.target&&t.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");if(t.owner==null&&n&&n!=="use_wallet"&&(f.owner=n.n),t.last_tx==null&&(f.last_tx=await this.transactions.getTransactionAnchor()),typeof t.data=="string"&&(t.data=em.stringToBuffer(t.data)),t.data instanceof ArrayBuffer&&(t.data=new Uint8Array(t.data)),t.data&&!(t.data instanceof Uint8Array))throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer");if(t.reward==null){let d=t.data?t.data.byteLength:0;f.reward=await this.transactions.getPrice(d,f.target)}f.data_root="",f.data_size=t.data?t.data.byteLength.toString():"0",f.data=t.data||new Uint8Array(0);let a=new Lre.default(f);return await a.getSignatureData(),a}async createSiloTransaction(t,n,f){let a={};if(Object.assign(a,t),!t.data)throw new Error("Silo transactions must have a 'data' value");if(!f)throw new Error("No Silo URI specified.");if(t.target||t.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");if(t.owner==null){if(!n||!n.n)throw new Error("A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.");a.owner=n.n}t.last_tx==null&&(a.last_tx=await this.transactions.getTransactionAnchor());let d=await this.silo.parseUri(f);if(typeof t.data=="string"){let v=await this.crypto.encrypt(em.stringToBuffer(t.data),d.getEncryptionKey());a.reward=await this.transactions.getPrice(v.byteLength),a.data=em.bufferTob64Url(v)}if(t.data instanceof Uint8Array){let v=await this.crypto.encrypt(t.data,d.getEncryptionKey());a.reward=await this.transactions.getPrice(v.byteLength),a.data=em.bufferTob64Url(v)}let l=new Lre.default(a);return l.addTag("Silo-Name",d.getAccessKey()),l.addTag("Silo-Version","0.1.0"),l}arql(t){return this.api.post("/arql",t).then(n=>n.data||[])}};Hf.default=Sk});var $re=Ht((Ak,Dre)=>{"use strict";Be();Pe();Oe();var wIe=Ak&&Ak.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ek=wIe(e8());Ek.default.init=function(e={}){return new Ek.default(e)};Dre.exports=Ek.default});var Rie=Ht((xit,xie)=>{"use strict";Be();Pe();Oe();var OBe=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);xie.exports=e=>!OBe.has(e&&e.code)});var Lie=Ht((Wit,tT)=>{"use strict";Be();Pe();Oe();var zBe=Object.prototype.hasOwnProperty,no="~";function dm(){}Object.create&&(dm.prototype=Object.create(null),new dm().__proto__||(no=!1));function HBe(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function Cie(e,t,n,f,a){if(typeof n!="function")throw new TypeError("The listener must be a function");var d=new HBe(n,f||e,a),l=no?no+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],d]:e._events[l].push(d):(e._events[l]=d,e._eventsCount++),e}function R8(e,t){--e._eventsCount===0?e._events=new dm:delete e._events[t]}function Ka(){this._events=new dm,this._eventsCount=0}Ka.prototype.eventNames=function(){var t=[],n,f;if(this._eventsCount===0)return t;for(f in n=this._events)zBe.call(n,f)&&t.push(no?f.slice(1):f);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t};Ka.prototype.listeners=function(t){var n=no?no+t:t,f=this._events[n];if(!f)return[];if(f.fn)return[f.fn];for(var a=0,d=f.length,l=new Array(d);a<d;a++)l[a]=f[a].fn;return l};Ka.prototype.listenerCount=function(t){var n=no?no+t:t,f=this._events[n];return f?f.fn?1:f.length:0};Ka.prototype.emit=function(t,n,f,a,d,l){var v=no?no+t:t;if(!this._events[v])return!1;var w=this._events[v],m=arguments.length,y,g;if(w.fn){switch(w.once&&this.removeListener(t,w.fn,void 0,!0),m){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,n),!0;case 3:return w.fn.call(w.context,n,f),!0;case 4:return w.fn.call(w.context,n,f,a),!0;case 5:return w.fn.call(w.context,n,f,a,d),!0;case 6:return w.fn.call(w.context,n,f,a,d,l),!0}for(g=1,y=new Array(m-1);g<m;g++)y[g-1]=arguments[g];w.fn.apply(w.context,y)}else{var S=w.length,x;for(g=0;g<S;g++)switch(w[g].once&&this.removeListener(t,w[g].fn,void 0,!0),m){case 1:w[g].fn.call(w[g].context);break;case 2:w[g].fn.call(w[g].context,n);break;case 3:w[g].fn.call(w[g].context,n,f);break;case 4:w[g].fn.call(w[g].context,n,f,a);break;default:if(!y)for(x=1,y=new Array(m-1);x<m;x++)y[x-1]=arguments[x];w[g].fn.apply(w[g].context,y)}}return!0};Ka.prototype.on=function(t,n,f){return Cie(this,t,n,f,!1)};Ka.prototype.once=function(t,n,f){return Cie(this,t,n,f,!0)};Ka.prototype.removeListener=function(t,n,f,a){var d=no?no+t:t;if(!this._events[d])return this;if(!n)return R8(this,d),this;var l=this._events[d];if(l.fn)l.fn===n&&(!a||l.once)&&(!f||l.context===f)&&R8(this,d);else{for(var v=0,w=[],m=l.length;v<m;v++)(l[v].fn!==n||a&&!l[v].once||f&&l[v].context!==f)&&w.push(l[v]);w.length?this._events[d]=w.length===1?w[0]:w:R8(this,d)}return this};Ka.prototype.removeAllListeners=function(t){var n;return t?(n=no?no+t:t,this._events[n]&&R8(this,n)):(this._events=new dm,this._eventsCount=0),this};Ka.prototype.off=Ka.prototype.removeListener;Ka.prototype.addListener=Ka.prototype.on;Ka.prefixed=no;Ka.EventEmitter=Ka;typeof tT<"u"&&(tT.exports=Ka)});Be();Pe();Oe();var qie=Cc(z4(),1);Be();Pe();Oe();Be();Pe();Oe();var dae=["gateway","gateways","prescribedObservers","record","auction","balance","epoch","priceForInteraction"],pae=["delegateStake","decreaseDelegateStake","joinNetwork","increaseOperatorStake","decreaseOperatorStake","updateGatewaySettings","saveObservations","extendRecord","buyRecord","increaseUndernameCount","transfer"],dOe=[...dae,...pae],pOe={GATEWAY:"gateway",GATEWAYS:"gateways",PRESCRIBED_OBSERVERS:"prescribedObservers",DELEGATE_STAKE:"delegateStake",DECREASE_DELEGATE_STAKE:"decreaseDelegateStake",JOIN_NETWORK:"joinNetwork",INCREASE_OPERATOR_STAKE:"increaseOperatorStake",DECREASE_OPERATOR_STAKE:"decreaseOperatorStake",UPDATE_GATEWAY_SETTINGS:"updateGatewaySettings",SAVE_OBSERVATIONS:"saveObservations",EXTEND_RECORD:"extendRecord",INCREASE_UNDERNAME_COUNT:"increaseUndernameCount",RECORD:"record",AUCTION:"auction",TRANSFER:"transfer",BALANCE:"balance",PRICE_FOR_INTERACTION:"priceForInteraction",EPOCH:"epoch",BUY_RECORD:"buyRecord"},vae=(n=>(n.IO="IO",n.MIO="mIO",n))(vae||{}),vOe={TRANSFER:"transfer",SET_CONTROLLER:"setController",REMOVE_CONTROLLER:"removeController",SET_NAME:"setName",SET_TICKER:"setTicker",SET_RECORD:"setRecord",REMOVE_RECORD:"removeRecord",BALANCE:"balance",EVOLVE:"evolve"};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var BO=new RegExp("^[a-zA-Z0-9_-]{43}$"),SOe=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),EOe=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),AOe=gt.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",xOe="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",mae="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",ROe=mae,zl="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",H4=1e6,OO="cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk",K4="Flwio4Lr08g6s6uim6lEJNnVGD9ylvz0_aafvpiL8FI",PO="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var Z4=class e{constructor(t){this.positiveFiniteInteger=t;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${t}`)}[Symbol.toPrimitive](t){return t==="string"&&this.toString(),this.positiveFiniteInteger}plus(t){return new e(this.positiveFiniteInteger+t.positiveFiniteInteger)}minus(t){return new e(this.positiveFiniteInteger-t.positiveFiniteInteger)}isGreaterThan(t){return this.positiveFiniteInteger>t.positiveFiniteInteger}isGreaterThanOrEqualTo(t){return this.positiveFiniteInteger>=t.positiveFiniteInteger}isLessThan(t){return this.positiveFiniteInteger<t.positiveFiniteInteger}isLessThanOrEqualTo(t){return this.positiveFiniteInteger<=t.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(t){return this.positiveFiniteInteger===t.positiveFiniteInteger}},W4=class{value;constructor(t){if(!Number.isFinite(t)||t<0)throw new Error("IOToken must be a non-negative finite number");this.value=+t.toFixed(6)}valueOf(){return this.value}toMIO(){return new V4(Math.floor(this.value*H4))}toString(){return`${this.value}`}},V4=class e extends Z4{constructor(t){super(t)}multiply(t){let n=Math.floor(this.valueOf()*t.valueOf());return new e(n)}divide(t){if(t.valueOf()===0)throw new Error("Cannot divide by zero");let n=Math.floor(this.valueOf()/t.valueOf());return new e(n)}plus(t){let n=super.plus(t);return new e(n.valueOf())}minus(t){let n=super.minus(t);return new e(n.valueOf())}toIO(){return new W4(this.valueOf()/H4)}};Be();Pe();Oe();Be();Pe();Oe();var NO=e=>BO.test(e);function $Oe(e){return e!==void 0&&!isNaN(parseInt(e.toString()))}function $c(e){return"process"in e}function Uc(e){return"processId"in e&&typeof e.processId=="string"&&NO(e.processId)===!0}function HOe(e){return e.type==="lease"&&e.endTimestamp!==void 0}Be();Pe();Oe();Be();Pe();Oe();var rf=class extends Error{constructor(t){super(t),this.name=this.constructor.name}},CO=class extends rf{},LO=class extends rf{},DO=class extends rf{constructor(t,n){super(`Failed request: ${t}: ${n}`)}},$O=class extends rf{},gg=class extends rf{},UO=class extends rf{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},$h=class extends rf{constructor(){super("Invalid contract configuration")}},qO=class extends rf{constructor(){super("Invalid process configuration")}},jO=class extends rf{};Be();Pe();Oe();var mf=Cc(Zj(),1);Be();Pe();Oe();var bd="2.1.0-alpha.6";var rh=class e{logger;silent=!1;static default=new e;constructor({level:t="info"}={}){t==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,mf.createLogger)({level:t,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:bd},format:mf.format.combine(mf.format.timestamp(),mf.format.json()),transports:[new mf.transports.Console({format:mf.format.combine(mf.format.timestamp(),mf.format.json())})]})}info(t,...n){this.silent||this.logger.info(t,...n)}warn(t,...n){this.silent||this.logger.warn(t,...n)}error(t,...n){this.silent||this.logger.error(t,...n)}debug(t,...n){this.silent||this.logger.debug(t,...n)}setLogLevel(t){this.silent=t==="none","silent"in this.logger&&(this.logger.silent=t==="none"),"level"in this.logger&&(this.logger.level=t)}};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var Q6e=Object.create,H9=Object.defineProperty,eye=Object.getOwnPropertyDescriptor,yF=Object.getOwnPropertyNames,tye=Object.getPrototypeOf,rye=Object.prototype.hasOwnProperty,Co=(e,t)=>function(){return t||(0,e[yF(e)[0]])((t={exports:{}}).exports,t),t.exports},bF=(e,t)=>{for(var n in t)H9(e,n,{get:t[n],enumerable:!0})},iye=(e,t,n,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of yF(t))!rye.call(e,a)&&a!==n&&H9(e,a,{get:()=>t[a],enumerable:!(f=eye(t,a))||f.enumerable});return e},K9=(e,t,n)=>(n=e!=null?Q6e(tye(e)):{},iye(t||!e||!e.__esModule?H9(n,"default",{value:e,enumerable:!0}):n,e)),nye=Co({"node_modules/obliterator/iterator.js"(e,t){function n(f){if(typeof f!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=f}typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var f=arguments,a=f.length,d=0;return new n(function(){return d>=a?{done:!0}:{done:!1,value:f[d++]}})},n.empty=function(){var f=new n(function(){return{done:!0}});return f},n.fromSequence=function(f){var a=0,d=f.length;return new n(function(){return a>=d?{done:!0}:{done:!1,value:f[a++]}})},n.is=function(f){return f instanceof n?!0:typeof f=="object"&&f!==null&&typeof f.next=="function"},t.exports=n}}),aye=Co({"node_modules/obliterator/support.js"(e){e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",e.SYMBOL_SUPPORT=typeof Symbol<"u"}}),Z9=Co({"node_modules/obliterator/foreach.js"(e,t){var n=aye(),f=n.ARRAY_BUFFER_SUPPORT,a=n.SYMBOL_SUPPORT;t.exports=function(l,v){var w,m,y,g,S;if(!l)throw new Error("obliterator/forEach: invalid iterable.");if(typeof v!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(l)||f&&ArrayBuffer.isView(l)||typeof l=="string"||l.toString()==="[object Arguments]"){for(y=0,g=l.length;y<g;y++)v(l[y],y);return}if(typeof l.forEach=="function"){l.forEach(v);return}if(a&&Symbol.iterator in l&&typeof l.next!="function"&&(l=l[Symbol.iterator]()),typeof l.next=="function"){for(w=l,y=0;S=w.next(),S.done!==!0;)v(S.value,y),y++;return}for(m in l)l.hasOwnProperty(m)&&v(l[m],m)}}}),W9=Co({"node_modules/mnemonist/utils/typed-arrays.js"(e){var t=Math.pow(2,8)-1,n=Math.pow(2,16)-1,f=Math.pow(2,32)-1,a=Math.pow(2,7)-1,d=Math.pow(2,15)-1,l=Math.pow(2,31)-1;e.getPointerArray=function(w){var m=w-1;if(m<=t)return Uint8Array;if(m<=n)return Uint16Array;if(m<=f)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},e.getSignedPointerArray=function(w){var m=w-1;return m<=a?Int8Array:m<=d?Int16Array:m<=l?Int32Array:Float64Array},e.getNumberType=function(w){return w===(w|0)?Math.sign(w)===-1?w<=127&&w>=-128?Int8Array:w<=32767&&w>=-32768?Int16Array:Int32Array:w<=255?Uint8Array:w<=65535?Uint16Array:Uint32Array:Float64Array};var v={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(w,m){var y=null,g=0,S,x,A,T,I;for(T=0,I=w.length;T<I;T++)A=m?m(w[T]):w[T],x=e.getNumberType(A),S=v[x.name],S>g&&(g=S,y=x);return y},e.isTypedArray=function(w){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(w)},e.concat=function(){var w=0,m,y,g;for(m=0,g=arguments.length;m<g;m++)w+=arguments[m].length;var S=new arguments[0].constructor(w);for(m=0,y=0;m<g;m++)S.set(arguments[m],y),y+=arguments[m].length;return S},e.indices=function(w){for(var m=e.getPointerArray(w),y=new m(w),g=0;g<w;g++)y[g]=g;return y}}}),wF=Co({"node_modules/mnemonist/utils/iterables.js"(e){var t=Z9(),n=W9();function f(v){return Array.isArray(v)||n.isTypedArray(v)}function a(v){if(typeof v.length=="number")return v.length;if(typeof v.size=="number")return v.size}function d(v){var w=a(v),m=typeof w=="number"?new Array(w):[],y=0;return t(v,function(g){m[y++]=g}),m}function l(v){var w=a(v),m=typeof w=="number"?n.getPointerArray(w):Array,y=typeof w=="number"?new Array(w):[],g=typeof w=="number"?new m(w):[],S=0;return t(v,function(x){y[S]=x,g[S]=S++}),[y,g]}e.isArrayLike=f,e.guessLength=a,e.toArray=d,e.toArrayWithIndices=l}}),oye=Co({"node_modules/mnemonist/lru-cache.js"(e,t){var n=nye(),f=Z9(),a=W9(),d=wF();function l(v,w,m){if(arguments.length<2&&(m=v,v=null,w=null),this.capacity=m,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=a.getPointerArray(m);this.forward=new y(m),this.backward=new y(m),this.K=typeof v=="function"?new v(m):new Array(m),this.V=typeof w=="function"?new w(m):new Array(m),this.size=0,this.head=0,this.tail=0,this.items={}}l.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},l.prototype.splayOnTop=function(v){var w=this.head;if(this.head===v)return this;var m=this.backward[v],y=this.forward[v];return this.tail===v?this.tail=m:this.backward[y]=m,this.forward[m]=y,this.backward[w]=v,this.head=v,this.forward[v]=w,this},l.prototype.set=function(v,w){var m=this.items[v];if(typeof m<"u"){this.splayOnTop(m),this.V[m]=w;return}this.size<this.capacity?m=this.size++:(m=this.tail,this.tail=this.backward[m],delete this.items[this.K[m]]),this.items[v]=m,this.K[m]=v,this.V[m]=w,this.forward[m]=this.head,this.backward[this.head]=m,this.head=m},l.prototype.setpop=function(v,w){var m=null,y=null,g=this.items[v];return typeof g<"u"?(this.splayOnTop(g),m=this.V[g],this.V[g]=w,{evicted:!1,key:v,value:m}):(this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],m=this.V[g],y=this.K[g],delete this.items[y]),this.items[v]=g,this.K[g]=v,this.V[g]=w,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g,y?{evicted:!0,key:y,value:m}:null)},l.prototype.has=function(v){return v in this.items},l.prototype.get=function(v){var w=this.items[v];if(!(typeof w>"u"))return this.splayOnTop(w),this.V[w]},l.prototype.peek=function(v){var w=this.items[v];if(!(typeof w>"u"))return this.V[w]},l.prototype.forEach=function(v,w){w=arguments.length>1?w:this;for(var m=0,y=this.size,g=this.head,S=this.K,x=this.V,A=this.forward;m<y;)v.call(w,x[g],S[g],this),g=A[g],m++},l.prototype.keys=function(){var v=0,w=this.size,m=this.head,y=this.K,g=this.forward;return new n(function(){if(v>=w)return{done:!0};var S=y[m];return v++,v<w&&(m=g[m]),{done:!1,value:S}})},l.prototype.values=function(){var v=0,w=this.size,m=this.head,y=this.V,g=this.forward;return new n(function(){if(v>=w)return{done:!0};var S=y[m];return v++,v<w&&(m=g[m]),{done:!1,value:S}})},l.prototype.entries=function(){var v=0,w=this.size,m=this.head,y=this.K,g=this.V,S=this.forward;return new n(function(){if(v>=w)return{done:!0};var x=y[m],A=g[m];return v++,v<w&&(m=S[m]),{done:!1,value:[x,A]}})},typeof Symbol<"u"&&(l.prototype[Symbol.iterator]=l.prototype.entries),l.prototype.inspect=function(){for(var v=new Map,w=this.entries(),m;m=w.next(),!m.done;)v.set(m.value[0],m.value[1]);return Object.defineProperty(v,"constructor",{value:l,enumerable:!1}),v},typeof Symbol<"u"&&(l.prototype[Symbol.for("nodejs.util.inspect.custom")]=l.prototype.inspect),l.from=function(v,w,m,y){if(arguments.length<2){if(y=d.guessLength(v),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=w,w=null,m=null);var g=new l(w,m,y);return f(v,function(S,x){g.set(x,S)}),g},t.exports=l}}),sye=Co({"node_modules/mnemonist/lru-map.js"(e,t){var n=oye(),f=Z9(),a=W9(),d=wF();function l(v,w,m){if(arguments.length<2&&(m=v,v=null,w=null),this.capacity=m,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=a.getPointerArray(m);this.forward=new y(m),this.backward=new y(m),this.K=typeof v=="function"?new v(m):new Array(m),this.V=typeof w=="function"?new w(m):new Array(m),this.size=0,this.head=0,this.tail=0,this.items=new Map}l.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},l.prototype.set=function(v,w){var m=this.items.get(v);if(typeof m<"u"){this.splayOnTop(m),this.V[m]=w;return}this.size<this.capacity?m=this.size++:(m=this.tail,this.tail=this.backward[m],this.items.delete(this.K[m])),this.items.set(v,m),this.K[m]=v,this.V[m]=w,this.forward[m]=this.head,this.backward[this.head]=m,this.head=m},l.prototype.setpop=function(v,w){var m=null,y=null,g=this.items.get(v);return typeof g<"u"?(this.splayOnTop(g),m=this.V[g],this.V[g]=w,{evicted:!1,key:v,value:m}):(this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],m=this.V[g],y=this.K[g],this.items.delete(y)),this.items.set(v,g),this.K[g]=v,this.V[g]=w,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g,y?{evicted:!0,key:y,value:m}:null)},l.prototype.has=function(v){return this.items.has(v)},l.prototype.get=function(v){var w=this.items.get(v);if(!(typeof w>"u"))return this.splayOnTop(w),this.V[w]},l.prototype.peek=function(v){var w=this.items.get(v);if(!(typeof w>"u"))return this.V[w]},l.prototype.splayOnTop=n.prototype.splayOnTop,l.prototype.forEach=n.prototype.forEach,l.prototype.keys=n.prototype.keys,l.prototype.values=n.prototype.values,l.prototype.entries=n.prototype.entries,typeof Symbol<"u"&&(l.prototype[Symbol.iterator]=l.prototype.entries),l.prototype.inspect=n.prototype.inspect,l.from=function(v,w,m,y){if(arguments.length<2){if(y=d.guessLength(v),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=w,w=null,m=null);var g=new l(w,m,y);return f(v,function(S,x){g.set(x,S)}),g},t.exports=l}}),fye=Co({"node_modules/ms/index.js"(e,t){var n=1e3,f=n*60,a=f*60,d=a*24,l=d*7,v=d*365.25;t.exports=function(S,x){x=x||{};var A=typeof S;if(A==="string"&&S.length>0)return w(S);if(A==="number"&&isFinite(S))return x.long?y(S):m(S);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(S))};function w(S){if(S=String(S),!(S.length>100)){var x=/^(-?(?:\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(x){var A=parseFloat(x[1]),T=(x[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return A*v;case"weeks":case"week":case"w":return A*l;case"days":case"day":case"d":return A*d;case"hours":case"hour":case"hrs":case"hr":case"h":return A*a;case"minutes":case"minute":case"mins":case"min":case"m":return A*f;case"seconds":case"second":case"secs":case"sec":case"s":return A*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function m(S){var x=Math.abs(S);return x>=d?Math.round(S/d)+"d":x>=a?Math.round(S/a)+"h":x>=f?Math.round(S/f)+"m":x>=n?Math.round(S/n)+"s":S+"ms"}function y(S){var x=Math.abs(S);return x>=d?g(S,x,d,"day"):x>=a?g(S,x,a,"hour"):x>=f?g(S,x,f,"minute"):x>=n?g(S,x,n,"second"):S+" ms"}function g(S,x,A,T){var I=x>=A*1.5;return Math.round(S/A)+" "+T+(I?"s":"")}}}),uye=Co({"node_modules/debug/src/common.js"(e,t){function n(f){d.debug=d,d.default=d,d.coerce=g,d.disable=w,d.enable=v,d.enabled=m,d.humanize=fye(),d.destroy=S,Object.keys(f).forEach(x=>{d[x]=f[x]}),d.names=[],d.skips=[],d.formatters={};function a(x){let A=0;for(let T=0;T<x.length;T++)A=(A<<5)-A+x.charCodeAt(T),A|=0;return d.colors[Math.abs(A)%d.colors.length]}d.selectColor=a;function d(x){let A,T=null,I,B;function P(...C){if(!P.enabled)return;let q=P,K=Number(new Date),G=K-(A||K);q.diff=G,q.prev=A,q.curr=K,A=K,C[0]=d.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let j=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(J,E)=>{if(J==="%%")return"%";j++;let i=d.formatters[E];if(typeof i=="function"){let s=C[j];J=i.call(q,s),C.splice(j,1),j--}return J}),d.formatArgs.call(q,C),(q.log||d.log).apply(q,C)}return P.namespace=x,P.useColors=d.useColors(),P.color=d.selectColor(x),P.extend=l,P.destroy=d.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>T!==null?T:(I!==d.namespaces&&(I=d.namespaces,B=d.enabled(x)),B),set:C=>{T=C}}),typeof d.init=="function"&&d.init(P),P}function l(x,A){let T=d(this.namespace+(typeof A>"u"?":":A)+x);return T.log=this.log,T}function v(x){d.save(x),d.namespaces=x,d.names=[],d.skips=[];let A,T=(typeof x=="string"?x:"").split(/[\s,]+/),I=T.length;for(A=0;A<I;A++)T[A]&&(x=T[A].replace(/\*/g,".*?"),x[0]==="-"?d.skips.push(new RegExp("^"+x.slice(1)+"$")):d.names.push(new RegExp("^"+x+"$")))}function w(){let x=[...d.names.map(y),...d.skips.map(y).map(A=>"-"+A)].join(",");return d.enable(""),x}function m(x){if(x[x.length-1]==="*")return!0;let A,T;for(A=0,T=d.skips.length;A<T;A++)if(d.skips[A].test(x))return!1;for(A=0,T=d.names.length;A<T;A++)if(d.names[A].test(x))return!0;return!1}function y(x){return x.toString().substring(2,x.toString().length-2).replace(/\.\*\?$/,"*")}function g(x){return x instanceof Error?x.stack||x.message:x}function S(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return d.enable(d.load()),d}t.exports=n}}),hye=Co({"node_modules/debug/src/browser.js"(e,t){e.formatArgs=f,e.save=a,e.load=d,e.useColors=n,e.storage=l(),e.destroy=(()=>{let w=!1;return()=>{w||(w=!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"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function f(w){if(w[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+w[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let m="color: "+this.color;w.splice(1,0,m,"color: inherit");let y=0,g=0;w[0].replace(/%[a-zA-Z%]/g,S=>{S!=="%%"&&(y++,S==="%c"&&(g=y))}),w.splice(g,0,m)}e.log=console.debug||console.log||(()=>{});function a(w){try{w?e.storage.setItem("debug",w):e.storage.removeItem("debug")}catch{}}function d(){let w;try{w=e.storage.getItem("debug")}catch{}return!w&&typeof gt<"u"&&"env"in gt&&(w=gt.env.DEBUG),w}function l(){try{return localStorage}catch{}}t.exports=uye()(e);var{formatters:v}=t.exports;v.j=function(w){try{return JSON.stringify(w)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}}}),lye=Co({"node_modules/base64-js/index.js"(e){"use strict";e.byteLength=w,e.toByteArray=y,e.fromByteArray=x;var t=[],n=[],f=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,l=a.length;d<l;++d)t[d]=a[d],n[a.charCodeAt(d)]=d;var d,l;n[45]=62,n[95]=63;function v(A){var T=A.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=A.indexOf("=");I===-1&&(I=T);var B=I===T?0:4-I%4;return[I,B]}function w(A){var T=v(A),I=T[0],B=T[1];return(I+B)*3/4-B}function m(A,T,I){return(T+I)*3/4-I}function y(A){var T,I=v(A),B=I[0],P=I[1],C=new f(m(A,B,P)),q=0,K=P>0?B-4:B,G;for(G=0;G<K;G+=4)T=n[A.charCodeAt(G)]<<18|n[A.charCodeAt(G+1)]<<12|n[A.charCodeAt(G+2)]<<6|n[A.charCodeAt(G+3)],C[q++]=T>>16&255,C[q++]=T>>8&255,C[q++]=T&255;return P===2&&(T=n[A.charCodeAt(G)]<<2|n[A.charCodeAt(G+1)]>>4,C[q++]=T&255),P===1&&(T=n[A.charCodeAt(G)]<<10|n[A.charCodeAt(G+1)]<<4|n[A.charCodeAt(G+2)]>>2,C[q++]=T>>8&255,C[q++]=T&255),C}function g(A){return t[A>>18&63]+t[A>>12&63]+t[A>>6&63]+t[A&63]}function S(A,T,I){for(var B,P=[],C=T;C<I;C+=3)B=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),P.push(g(B));return P.join("")}function x(A){for(var T,I=A.length,B=I%3,P=[],C=16383,q=0,K=I-B;q<K;q+=C)P.push(S(A,q,q+C>K?K:q+C));return B===1?(T=A[I-1],P.push(t[T>>2]+t[T<<4&63]+"==")):B===2&&(T=(A[I-2]<<8)+A[I-1],P.push(t[T>>10]+t[T>>4&63]+t[T<<2&63]+"=")),P.join("")}}}),cye=Co({"node_modules/ieee754/index.js"(e){e.read=function(t,n,f,a,d){var l,v,w=d*8-a-1,m=(1<<w)-1,y=m>>1,g=-7,S=f?d-1:0,x=f?-1:1,A=t[n+S];for(S+=x,l=A&(1<<-g)-1,A>>=-g,g+=w;g>0;l=l*256+t[n+S],S+=x,g-=8);for(v=l&(1<<-g)-1,l>>=-g,g+=a;g>0;v=v*256+t[n+S],S+=x,g-=8);if(l===0)l=1-y;else{if(l===m)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,a),l=l-y}return(A?-1:1)*v*Math.pow(2,l-a)},e.write=function(t,n,f,a,d,l){var v,w,m,y=l*8-d-1,g=(1<<y)-1,S=g>>1,x=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=a?0:l-1,T=a?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(w=isNaN(n)?1:0,v=g):(v=Math.floor(Math.log(n)/Math.LN2),n*(m=Math.pow(2,-v))<1&&(v--,m*=2),v+S>=1?n+=x/m:n+=x*Math.pow(2,1-S),n*m>=2&&(v++,m/=2),v+S>=g?(w=0,v=g):v+S>=1?(w=(n*m-1)*Math.pow(2,d),v=v+S):(w=n*Math.pow(2,S-1)*Math.pow(2,d),v=0));d>=8;t[f+A]=w&255,A+=T,w/=256,d-=8);for(v=v<<d|w,y+=d;y>0;t[f+A]=v&255,A+=T,v/=256,y-=8);t[f+A-T]|=I*128}}}),dye=Co({"node_modules/buffer/index.js"(e){"use strict";var t=lye(),n=cye(),f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=v,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;var a=2147483647;e.kMaxLength=a,v.TYPED_ARRAY_SUPPORT=d(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let O=new Uint8Array(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,Uint8Array.prototype),Object.setPrototypeOf(O,N),O.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function l(O){if(O>a)throw new RangeError('The value "'+O+'" is invalid for option "size"');let N=new Uint8Array(O);return Object.setPrototypeOf(N,v.prototype),N}function v(O,N,$){if(typeof O=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(O)}return w(O,N,$)}v.poolSize=8192;function w(O,N,$){if(typeof O=="string")return S(O,N);if(ArrayBuffer.isView(O))return A(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(ut(O,ArrayBuffer)||O&&ut(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(O,SharedArrayBuffer)||O&&ut(O.buffer,SharedArrayBuffer)))return T(O,N,$);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ee=O.valueOf&&O.valueOf();if(ee!=null&&ee!==O)return v.from(ee,N,$);let re=I(O);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return v.from(O[Symbol.toPrimitive]("string"),N,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}v.from=function(O,N,$){return w(O,N,$)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function m(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function y(O,N,$){return m(O),O<=0?l(O):N!==void 0?typeof $=="string"?l(O).fill(N,$):l(O).fill(N):l(O)}v.alloc=function(O,N,$){return y(O,N,$)};function g(O){return m(O),l(O<0?0:B(O)|0)}v.allocUnsafe=function(O){return g(O)},v.allocUnsafeSlow=function(O){return g(O)};function S(O,N){if((typeof N!="string"||N==="")&&(N="utf8"),!v.isEncoding(N))throw new TypeError("Unknown encoding: "+N);let $=C(O,N)|0,ee=l($),re=ee.write(O,N);return re!==$&&(ee=ee.slice(0,re)),ee}function x(O){let N=O.length<0?0:B(O.length)|0,$=l(N);for(let ee=0;ee<N;ee+=1)$[ee]=O[ee]&255;return $}function A(O){if(ut(O,Uint8Array)){let N=new Uint8Array(O);return T(N.buffer,N.byteOffset,N.byteLength)}return x(O)}function T(O,N,$){if(N<0||O.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<N+($||0))throw new RangeError('"length" is outside of buffer bounds');let ee;return N===void 0&&$===void 0?ee=new Uint8Array(O):$===void 0?ee=new Uint8Array(O,N):ee=new Uint8Array(O,N,$),Object.setPrototypeOf(ee,v.prototype),ee}function I(O){if(v.isBuffer(O)){let N=B(O.length)|0,$=l(N);return $.length===0||O.copy($,0,0,N),$}if(O.length!==void 0)return typeof O.length!="number"||qe(O.length)?l(0):x(O);if(O.type==="Buffer"&&Array.isArray(O.data))return x(O.data)}function B(O){if(O>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return O|0}function P(O){return+O!=O&&(O=0),v.alloc(+O)}v.isBuffer=function(N){return N!=null&&N._isBuffer===!0&&N!==v.prototype},v.compare=function(N,$){if(ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),ut($,Uint8Array)&&($=v.from($,$.offset,$.byteLength)),!v.isBuffer(N)||!v.isBuffer($))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(N===$)return 0;let ee=N.length,re=$.length;for(let se=0,ce=Math.min(ee,re);se<ce;++se)if(N[se]!==$[se]){ee=N[se],re=$[se];break}return ee<re?-1:re<ee?1:0},v.isEncoding=function(N){switch(String(N).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(N,$){if(!Array.isArray(N))throw new TypeError('"list" argument must be an Array of Buffers');if(N.length===0)return v.alloc(0);let ee;if($===void 0)for($=0,ee=0;ee<N.length;++ee)$+=N[ee].length;let re=v.allocUnsafe($),se=0;for(ee=0;ee<N.length;++ee){let ce=N[ee];if(ut(ce,Uint8Array))se+ce.length>re.length?(v.isBuffer(ce)||(ce=v.from(ce)),ce.copy(re,se)):Uint8Array.prototype.set.call(re,ce,se);else if(v.isBuffer(ce))ce.copy(re,se);else throw new TypeError('"list" argument must be an Array of Buffers');se+=ce.length}return re};function C(O,N){if(v.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||ut(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);let $=O.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&$===0)return 0;let re=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return he(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return Ae(O).length;default:if(re)return ee?-1:he(O).length;N=(""+N).toLowerCase(),re=!0}}v.byteLength=C;function q(O,N,$){let ee=!1;if((N===void 0||N<0)&&(N=0),N>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,N>>>=0,$<=N))return"";for(O||(O="utf8");;)switch(O){case"hex":return r(this,N,$);case"utf8":case"utf-8":return c(this,N,$);case"ascii":return R(this,N,$);case"latin1":case"binary":return o(this,N,$);case"base64":return u(this,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h(this,N,$);default:if(ee)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),ee=!0}}v.prototype._isBuffer=!0;function K(O,N,$){let ee=O[N];O[N]=O[$],O[$]=ee}v.prototype.swap16=function(){let N=this.length;if(N%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let $=0;$<N;$+=2)K(this,$,$+1);return this},v.prototype.swap32=function(){let N=this.length;if(N%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let $=0;$<N;$+=4)K(this,$,$+3),K(this,$+1,$+2);return this},v.prototype.swap64=function(){let N=this.length;if(N%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let $=0;$<N;$+=8)K(this,$,$+7),K(this,$+1,$+6),K(this,$+2,$+5),K(this,$+3,$+4);return this},v.prototype.toString=function(){let N=this.length;return N===0?"":arguments.length===0?c(this,0,N):q.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(N){if(!v.isBuffer(N))throw new TypeError("Argument must be a Buffer");return this===N?!0:v.compare(this,N)===0},v.prototype.inspect=function(){let N="",$=e.INSPECT_MAX_BYTES;return N=this.toString("hex",0,$).replace(/(.{2})/g,"$1 ").trim(),this.length>$&&(N+=" ... "),"<Buffer "+N+">"},f&&(v.prototype[f]=v.prototype.inspect),v.prototype.compare=function(N,$,ee,re,se){if(ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),!v.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if($===void 0&&($=0),ee===void 0&&(ee=N?N.length:0),re===void 0&&(re=0),se===void 0&&(se=this.length),$<0||ee>N.length||re<0||se>this.length)throw new RangeError("out of range index");if(re>=se&&$>=ee)return 0;if(re>=se)return-1;if($>=ee)return 1;if($>>>=0,ee>>>=0,re>>>=0,se>>>=0,this===N)return 0;let ce=se-re,st=ee-$,ye=Math.min(ce,st),be=this.slice(re,se),me=N.slice($,ee);for(let ke=0;ke<ye;++ke)if(be[ke]!==me[ke]){ce=be[ke],st=me[ke];break}return ce<st?-1:st<ce?1:0};function G(O,N,$,ee,re){if(O.length===0)return-1;if(typeof $=="string"?(ee=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,qe($)&&($=re?0:O.length-1),$<0&&($=O.length+$),$>=O.length){if(re)return-1;$=O.length-1}else if($<0)if(re)$=0;else return-1;if(typeof N=="string"&&(N=v.from(N,ee)),v.isBuffer(N))return N.length===0?-1:j(O,N,$,ee,re);if(typeof N=="number")return N=N&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(O,N,$):Uint8Array.prototype.lastIndexOf.call(O,N,$):j(O,[N],$,ee,re);throw new TypeError("val must be string, number or Buffer")}function j(O,N,$,ee,re){let se=1,ce=O.length,st=N.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(O.length<2||N.length<2)return-1;se=2,ce/=2,st/=2,$/=2}function ye(me,ke){return se===1?me[ke]:me.readUInt16BE(ke*se)}let be;if(re){let me=-1;for(be=$;be<ce;be++)if(ye(O,be)===ye(N,me===-1?0:be-me)){if(me===-1&&(me=be),be-me+1===st)return me*se}else me!==-1&&(be-=be-me),me=-1}else for($+st>ce&&($=ce-st),be=$;be>=0;be--){let me=!0;for(let ke=0;ke<st;ke++)if(ye(O,be+ke)!==ye(N,ke)){me=!1;break}if(me)return be}return-1}v.prototype.includes=function(N,$,ee){return this.indexOf(N,$,ee)!==-1},v.prototype.indexOf=function(N,$,ee){return G(this,N,$,ee,!0)},v.prototype.lastIndexOf=function(N,$,ee){return G(this,N,$,ee,!1)};function z(O,N,$,ee){$=Number($)||0;let re=O.length-$;ee?(ee=Number(ee),ee>re&&(ee=re)):ee=re;let se=N.length;ee>se/2&&(ee=se/2);let ce;for(ce=0;ce<ee;++ce){let st=parseInt(N.substr(ce*2,2),16);if(qe(st))return ce;O[$+ce]=st}return ce}function J(O,N,$,ee){return _e(he(N,O.length-$),O,$,ee)}function E(O,N,$,ee){return _e(pe(N),O,$,ee)}function i(O,N,$,ee){return _e(Ae(N),O,$,ee)}function s(O,N,$,ee){return _e(De(N,O.length-$),O,$,ee)}v.prototype.write=function(N,$,ee,re){if($===void 0)re="utf8",ee=this.length,$=0;else if(ee===void 0&&typeof $=="string")re=$,ee=this.length,$=0;else if(isFinite($))$=$>>>0,isFinite(ee)?(ee=ee>>>0,re===void 0&&(re="utf8")):(re=ee,ee=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let se=this.length-$;if((ee===void 0||ee>se)&&(ee=se),N.length>0&&(ee<0||$<0)||$>this.length)throw new RangeError("Attempt to write outside buffer bounds");re||(re="utf8");let ce=!1;for(;;)switch(re){case"hex":return z(this,N,$,ee);case"utf8":case"utf-8":return J(this,N,$,ee);case"ascii":case"latin1":case"binary":return E(this,N,$,ee);case"base64":return i(this,N,$,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,N,$,ee);default:if(ce)throw new TypeError("Unknown encoding: "+re);re=(""+re).toLowerCase(),ce=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function u(O,N,$){return N===0&&$===O.length?t.fromByteArray(O):t.fromByteArray(O.slice(N,$))}function c(O,N,$){$=Math.min(O.length,$);let ee=[],re=N;for(;re<$;){let se=O[re],ce=null,st=se>239?4:se>223?3:se>191?2:1;if(re+st<=$){let ye,be,me,ke;switch(st){case 1:se<128&&(ce=se);break;case 2:ye=O[re+1],(ye&192)===128&&(ke=(se&31)<<6|ye&63,ke>127&&(ce=ke));break;case 3:ye=O[re+1],be=O[re+2],(ye&192)===128&&(be&192)===128&&(ke=(se&15)<<12|(ye&63)<<6|be&63,ke>2047&&(ke<55296||ke>57343)&&(ce=ke));break;case 4:ye=O[re+1],be=O[re+2],me=O[re+3],(ye&192)===128&&(be&192)===128&&(me&192)===128&&(ke=(se&15)<<18|(ye&63)<<12|(be&63)<<6|me&63,ke>65535&&ke<1114112&&(ce=ke))}}ce===null?(ce=65533,st=1):ce>65535&&(ce-=65536,ee.push(ce>>>10&1023|55296),ce=56320|ce&1023),ee.push(ce),re+=st}return _(ee)}var p=4096;function _(O){let N=O.length;if(N<=p)return String.fromCharCode.apply(String,O);let $="",ee=0;for(;ee<N;)$+=String.fromCharCode.apply(String,O.slice(ee,ee+=p));return $}function R(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]&127);return ee}function o(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]);return ee}function r(O,N,$){let ee=O.length;(!N||N<0)&&(N=0),(!$||$<0||$>ee)&&($=ee);let re="";for(let se=N;se<$;++se)re+=Te[O[se]];return re}function h(O,N,$){let ee=O.slice(N,$),re="";for(let se=0;se<ee.length-1;se+=2)re+=String.fromCharCode(ee[se]+ee[se+1]*256);return re}v.prototype.slice=function(N,$){let ee=this.length;N=~~N,$=$===void 0?ee:~~$,N<0?(N+=ee,N<0&&(N=0)):N>ee&&(N=ee),$<0?($+=ee,$<0&&($=0)):$>ee&&($=ee),$<N&&($=N);let re=this.subarray(N,$);return Object.setPrototypeOf(re,v.prototype),re};function b(O,N,$){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+N>$)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N],se=1,ce=0;for(;++ce<$&&(se*=256);)re+=this[N+ce]*se;return re},v.prototype.readUintBE=v.prototype.readUIntBE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N+--$],se=1;for(;$>0&&(se*=256);)re+=this[N+--$]*se;return re},v.prototype.readUint8=v.prototype.readUInt8=function(N,$){return N=N>>>0,$||b(N,1,this.length),this[N]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(N,$){return N=N>>>0,$||b(N,2,this.length),this[N]|this[N+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(N,$){return N=N>>>0,$||b(N,2,this.length),this[N]<<8|this[N+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(N,$){return N=N>>>0,$||b(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+this[N+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]*16777216+(this[N+1]<<16|this[N+2]<<8|this[N+3])},v.prototype.readBigUInt64LE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=$+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24,se=this[++N]+this[++N]*2**8+this[++N]*2**16+ee*2**24;return BigInt(re)+(BigInt(se)<<BigInt(32))}),v.prototype.readBigUInt64BE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=$*2**24+this[++N]*2**16+this[++N]*2**8+this[++N],se=this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+ee;return(BigInt(re)<<BigInt(32))+BigInt(se)}),v.prototype.readIntLE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N],se=1,ce=0;for(;++ce<$&&(se*=256);)re+=this[N+ce]*se;return se*=128,re>=se&&(re-=Math.pow(2,8*$)),re},v.prototype.readIntBE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=$,se=1,ce=this[N+--re];for(;re>0&&(se*=256);)ce+=this[N+--re]*se;return se*=128,ce>=se&&(ce-=Math.pow(2,8*$)),ce},v.prototype.readInt8=function(N,$){return N=N>>>0,$||b(N,1,this.length),this[N]&128?(255-this[N]+1)*-1:this[N]},v.prototype.readInt16LE=function(N,$){N=N>>>0,$||b(N,2,this.length);let ee=this[N]|this[N+1]<<8;return ee&32768?ee|4294901760:ee},v.prototype.readInt16BE=function(N,$){N=N>>>0,$||b(N,2,this.length);let ee=this[N+1]|this[N]<<8;return ee&32768?ee|4294901760:ee},v.prototype.readInt32LE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},v.prototype.readInt32BE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},v.prototype.readBigInt64LE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=this[N+4]+this[N+5]*2**8+this[N+6]*2**16+(ee<<24);return(BigInt(re)<<BigInt(32))+BigInt($+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24)}),v.prototype.readBigInt64BE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=($<<24)+this[++N]*2**16+this[++N]*2**8+this[++N];return(BigInt(re)<<BigInt(32))+BigInt(this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+ee)}),v.prototype.readFloatLE=function(N,$){return N=N>>>0,$||b(N,4,this.length),n.read(this,N,!0,23,4)},v.prototype.readFloatBE=function(N,$){return N=N>>>0,$||b(N,4,this.length),n.read(this,N,!1,23,4)},v.prototype.readDoubleLE=function(N,$){return N=N>>>0,$||b(N,8,this.length),n.read(this,N,!0,52,8)},v.prototype.readDoubleBE=function(N,$){return N=N>>>0,$||b(N,8,this.length),n.read(this,N,!1,52,8)};function M(O,N,$,ee,re,se){if(!v.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>re||N<se)throw new RangeError('"value" argument is out of bounds');if($+ee>O.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(N,$,ee,re){if(N=+N,$=$>>>0,ee=ee>>>0,!re){let st=Math.pow(2,8*ee)-1;M(this,N,$,ee,st,0)}let se=1,ce=0;for(this[$]=N&255;++ce<ee&&(se*=256);)this[$+ce]=N/se&255;return $+ee},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(N,$,ee,re){if(N=+N,$=$>>>0,ee=ee>>>0,!re){let st=Math.pow(2,8*ee)-1;M(this,N,$,ee,st,0)}let se=ee-1,ce=1;for(this[$+se]=N&255;--se>=0&&(ce*=256);)this[$+se]=N/ce&255;return $+ee},v.prototype.writeUint8=v.prototype.writeUInt8=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,1,255,0),this[$]=N&255,$+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,65535,0),this[$]=N&255,this[$+1]=N>>>8,$+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,65535,0),this[$]=N>>>8,this[$+1]=N&255,$+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,4294967295,0),this[$+3]=N>>>24,this[$+2]=N>>>16,this[$+1]=N>>>8,this[$]=N&255,$+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,4294967295,0),this[$]=N>>>24,this[$+1]=N>>>16,this[$+2]=N>>>8,this[$+3]=N&255,$+4};function k(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,$}function D(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$+7]=se,se=se>>8,O[$+6]=se,se=se>>8,O[$+5]=se,se=se>>8,O[$+4]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$+3]=ce,ce=ce>>8,O[$+2]=ce,ce=ce>>8,O[$+1]=ce,ce=ce>>8,O[$]=ce,$+8}v.prototype.writeBigUInt64LE=mt(function(N,$=0){return k(this,N,$,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=mt(function(N,$=0){return D(this,N,$,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(N,$,ee,re){if(N=+N,$=$>>>0,!re){let ye=Math.pow(2,8*ee-1);M(this,N,$,ee,ye-1,-ye)}let se=0,ce=1,st=0;for(this[$]=N&255;++se<ee&&(ce*=256);)N<0&&st===0&&this[$+se-1]!==0&&(st=1),this[$+se]=(N/ce>>0)-st&255;return $+ee},v.prototype.writeIntBE=function(N,$,ee,re){if(N=+N,$=$>>>0,!re){let ye=Math.pow(2,8*ee-1);M(this,N,$,ee,ye-1,-ye)}let se=ee-1,ce=1,st=0;for(this[$+se]=N&255;--se>=0&&(ce*=256);)N<0&&st===0&&this[$+se+1]!==0&&(st=1),this[$+se]=(N/ce>>0)-st&255;return $+ee},v.prototype.writeInt8=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,1,127,-128),N<0&&(N=255+N+1),this[$]=N&255,$+1},v.prototype.writeInt16LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,32767,-32768),this[$]=N&255,this[$+1]=N>>>8,$+2},v.prototype.writeInt16BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,32767,-32768),this[$]=N>>>8,this[$+1]=N&255,$+2},v.prototype.writeInt32LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,2147483647,-2147483648),this[$]=N&255,this[$+1]=N>>>8,this[$+2]=N>>>16,this[$+3]=N>>>24,$+4},v.prototype.writeInt32BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[$]=N>>>24,this[$+1]=N>>>16,this[$+2]=N>>>8,this[$+3]=N&255,$+4},v.prototype.writeBigInt64LE=mt(function(N,$=0){return k(this,N,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=mt(function(N,$=0){return D(this,N,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(O,N,$,ee,re,se){if($+ee>O.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function W(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,4,34028234663852886e22,-34028234663852886e22),n.write(O,N,$,ee,23,4),$+4}v.prototype.writeFloatLE=function(N,$,ee){return W(this,N,$,!0,ee)},v.prototype.writeFloatBE=function(N,$,ee){return W(this,N,$,!1,ee)};function X(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,8,17976931348623157e292,-17976931348623157e292),n.write(O,N,$,ee,52,8),$+8}v.prototype.writeDoubleLE=function(N,$,ee){return X(this,N,$,!0,ee)},v.prototype.writeDoubleBE=function(N,$,ee){return X(this,N,$,!1,ee)},v.prototype.copy=function(N,$,ee,re){if(!v.isBuffer(N))throw new TypeError("argument should be a Buffer");if(ee||(ee=0),!re&&re!==0&&(re=this.length),$>=N.length&&($=N.length),$||($=0),re>0&&re<ee&&(re=ee),re===ee||N.length===0||this.length===0)return 0;if($<0)throw new RangeError("targetStart out of bounds");if(ee<0||ee>=this.length)throw new RangeError("Index out of range");if(re<0)throw new RangeError("sourceEnd out of bounds");re>this.length&&(re=this.length),N.length-$<re-ee&&(re=N.length-$+ee);let se=re-ee;return this===N&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin($,ee,re):Uint8Array.prototype.set.call(N,this.subarray(ee,re),$),se},v.prototype.fill=function(N,$,ee,re){if(typeof N=="string"){if(typeof $=="string"?(re=$,$=0,ee=this.length):typeof ee=="string"&&(re=ee,ee=this.length),re!==void 0&&typeof re!="string")throw new TypeError("encoding must be a string");if(typeof re=="string"&&!v.isEncoding(re))throw new TypeError("Unknown encoding: "+re);if(N.length===1){let ce=N.charCodeAt(0);(re==="utf8"&&ce<128||re==="latin1")&&(N=ce)}}else typeof N=="number"?N=N&255:typeof N=="boolean"&&(N=Number(N));if($<0||this.length<$||this.length<ee)throw new RangeError("Out of range index");if(ee<=$)return this;$=$>>>0,ee=ee===void 0?this.length:ee>>>0,N||(N=0);let se;if(typeof N=="number")for(se=$;se<ee;++se)this[se]=N;else{let ce=v.isBuffer(N)?N:v.from(N,re),st=ce.length;if(st===0)throw new TypeError('The value "'+N+'" is invalid for argument "value"');for(se=0;se<ee-$;++se)this[se+$]=ce[se%st]}return this};var V={};function Y(O,N,$){V[O]=class extends ${constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(re){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:re,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(O,N){return`The "${O}" argument must be of type number. Received type ${typeof N}`},TypeError),Y("ERR_OUT_OF_RANGE",function(O,N,$){let ee=`The value of "${O}" is out of range.`,re=$;return Number.isInteger($)&&Math.abs($)>2**32?re=ae(String($)):typeof $=="bigint"&&(re=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(re=ae(re)),re+="n"),ee+=` It must be ${N}. Received ${re}`,ee},RangeError);function ae(O){let N="",$=O.length,ee=O[0]==="-"?1:0;for(;$>=ee+4;$-=3)N=`_${O.slice($-3,$)}${N}`;return`${O.slice(0,$)}${N}`}function te(O,N,$){Z(N,"offset"),(O[N]===void 0||O[N+$]===void 0)&&ie(N,O.length-($+1))}function U(O,N,$,ee,re,se){if(O>$||O<N){let ce=typeof N=="bigint"?"n":"",st;throw se>3?N===0||N===BigInt(0)?st=`>= 0${ce} and < 2${ce} ** ${(se+1)*8}${ce}`:st=`>= -(2${ce} ** ${(se+1)*8-1}${ce}) and < 2 ** ${(se+1)*8-1}${ce}`:st=`>= ${N}${ce} and <= ${$}${ce}`,new V.ERR_OUT_OF_RANGE("value",st,O)}te(ee,re,se)}function Z(O,N){if(typeof O!="number")throw new V.ERR_INVALID_ARG_TYPE(N,"number",O)}function ie(O,N,$){throw Math.floor(O)!==O?(Z(O,$),new V.ERR_OUT_OF_RANGE($||"offset","an integer",O)):N<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${N}`,O)}var fe=/[^+/0-9A-Za-z-_]/g;function de(O){if(O=O.split("=")[0],O=O.trim().replace(fe,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function he(O,N){N=N||1/0;let $,ee=O.length,re=null,se=[];for(let ce=0;ce<ee;++ce){if($=O.charCodeAt(ce),$>55295&&$<57344){if(!re){if($>56319){(N-=3)>-1&&se.push(239,191,189);continue}else if(ce+1===ee){(N-=3)>-1&&se.push(239,191,189);continue}re=$;continue}if($<56320){(N-=3)>-1&&se.push(239,191,189),re=$;continue}$=(re-55296<<10|$-56320)+65536}else re&&(N-=3)>-1&&se.push(239,191,189);if(re=null,$<128){if((N-=1)<0)break;se.push($)}else if($<2048){if((N-=2)<0)break;se.push($>>6|192,$&63|128)}else if($<65536){if((N-=3)<0)break;se.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((N-=4)<0)break;se.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return se}function pe(O){let N=[];for(let $=0;$<O.length;++$)N.push(O.charCodeAt($)&255);return N}function De(O,N){let $,ee,re,se=[];for(let ce=0;ce<O.length&&!((N-=2)<0);++ce)$=O.charCodeAt(ce),ee=$>>8,re=$%256,se.push(re),se.push(ee);return se}function Ae(O){return t.toByteArray(de(O))}function _e(O,N,$,ee){let re;for(re=0;re<ee&&!(re+$>=N.length||re>=O.length);++re)N[re+$]=O[re];return re}function ut(O,N){return O instanceof N||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===N.name}function qe(O){return O!==O}var Te=function(){let O="0123456789abcdef",N=new Array(256);for(let $=0;$<16;++$){let ee=$*16;for(let re=0;re<16;++re)N[ee+re]=O[$]+O[re]}return N}();function mt(O){return typeof BigInt>"u"?ne:O}function ne(){throw new Error("BigInt not supported")}}}),pye={"@@functional/placeholder":!0};function _n(e){return e===pye}function eo(e){return function t(n){return arguments.length===0||_n(n)?t:e.apply(this,arguments)}}function ta(e){return function t(n,f){switch(arguments.length){case 0:return t;case 1:return _n(n)?t:eo(function(a){return e(n,a)});default:return _n(n)&&_n(f)?t:_n(n)?eo(function(a){return e(a,f)}):_n(f)?eo(function(a){return e(n,a)}):e(n,f)}}}function jy(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(n){return t.apply(this,arguments)};case 2:return function(n,f){return t.apply(this,arguments)};case 3:return function(n,f,a){return t.apply(this,arguments)};case 4:return function(n,f,a,d){return t.apply(this,arguments)};case 5:return function(n,f,a,d,l){return t.apply(this,arguments)};case 6:return function(n,f,a,d,l,v){return t.apply(this,arguments)};case 7:return function(n,f,a,d,l,v,w){return t.apply(this,arguments)};case 8:return function(n,f,a,d,l,v,w,m){return t.apply(this,arguments)};case 9:return function(n,f,a,d,l,v,w,m,y){return t.apply(this,arguments)};case 10:return function(n,f,a,d,l,v,w,m,y,g){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function _F(e,t,n){return function(){for(var f=[],a=0,d=e,l=0,v=!1;l<t.length||a<arguments.length;){var w;l<t.length&&(!_n(t[l])||a>=arguments.length)?w=t[l]:(w=arguments[a],a+=1),f[l]=w,_n(w)?v=!0:d-=1,l+=1}return!v&&d<=0?n.apply(this,f):jy(Math.max(0,d),_F(e,f,n))}}var vye=ta(function(e,t){return e===1?eo(t):jy(e,_F(e,[],t))}),MF=vye;function V9(e){return function t(n,f,a){switch(arguments.length){case 0:return t;case 1:return _n(n)?t:ta(function(d,l){return e(n,d,l)});case 2:return _n(n)&&_n(f)?t:_n(n)?ta(function(d,l){return e(d,f,l)}):_n(f)?ta(function(d,l){return e(n,d,l)}):eo(function(d){return e(n,f,d)});default:return _n(n)&&_n(f)&&_n(a)?t:_n(n)&&_n(f)?ta(function(d,l){return e(d,l,a)}):_n(n)&&_n(a)?ta(function(d,l){return e(d,f,l)}):_n(f)&&_n(a)?ta(function(d,l){return e(n,d,l)}):_n(n)?eo(function(d){return e(d,f,a)}):_n(f)?eo(function(d){return e(n,d,a)}):_n(a)?eo(function(d){return e(n,f,d)}):e(n,f,a)}}}var G9=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function mye(e){return e!=null&&typeof e["@@transducer/step"]=="function"}function Y9(e,t,n){return function(){if(arguments.length===0)return n();var f=arguments[arguments.length-1];if(!G9(f)){for(var a=0;a<e.length;){if(typeof f[e[a]]=="function")return f[e[a]].apply(f,Array.prototype.slice.call(arguments,0,-1));a+=1}if(mye(f)){var d=t.apply(null,Array.prototype.slice.call(arguments,0,-1));return d(f)}}return n.apply(this,arguments)}}function gye(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}var cv={init:function(){return this.xf["@@transducer/init"]()},result:function(e){return this.xf["@@transducer/result"](e)}};function Wj(e){for(var t=[],n;!(n=e.next()).done;)t.push(n.value);return t}function Vj(e,t,n){for(var f=0,a=n.length;f<a;){if(e(t,n[f]))return!0;f+=1}return!1}function yye(e){var t=String(e).match(/^function (\w*)/);return t==null?"":t[1]}function gy(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function bye(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var h9=typeof Object.is=="function"?Object.is:bye,Gj=Object.prototype.toString,wye=function(){return Gj.call(arguments)==="[object Arguments]"?function(e){return Gj.call(e)==="[object Arguments]"}:function(e){return gy("callee",e)}}(),_ye=wye,Mye=!{toString:null}.propertyIsEnumerable("toString"),Yj=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Jj=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),Sye=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},Eye=eo(typeof Object.keys=="function"&&!Jj?function(e){return Object(e)!==e?[]:Object.keys(e)}:function(e){if(Object(e)!==e)return[];var t,n,f=[],a=Jj&&_ye(e);for(t in e)gy(t,e)&&(!a||t!=="length")&&(f[f.length]=t);if(Mye)for(n=Yj.length-1;n>=0;)t=Yj[n],gy(t,e)&&!Sye(f,t)&&(f[f.length]=t),n-=1;return f}),Rd=Eye,Aye=eo(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),Xj=Aye;function Qj(e,t,n,f){var a=Wj(e),d=Wj(t);function l(v,w){return J9(v,w,n.slice(),f.slice())}return!Vj(function(v,w){return!Vj(l,w,v)},d,a)}function J9(e,t,n,f){if(h9(e,t))return!0;var a=Xj(e);if(a!==Xj(t))return!1;if(typeof e["fantasy-land/equals"]=="function"||typeof t["fantasy-land/equals"]=="function")return typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t)&&typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e);if(typeof e.equals=="function"||typeof t.equals=="function")return typeof e.equals=="function"&&e.equals(t)&&typeof t.equals=="function"&&t.equals(e);switch(a){case"Arguments":case"Array":case"Object":if(typeof e.constructor=="function"&&yye(e.constructor)==="Promise")return e===t;break;case"Boolean":case"Number":case"String":if(!(typeof e==typeof t&&h9(e.valueOf(),t.valueOf())))return!1;break;case"Date":if(!h9(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(!(e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.sticky===t.sticky&&e.unicode===t.unicode))return!1;break}for(var d=n.length-1;d>=0;){if(n[d]===e)return f[d]===t;d-=1}switch(a){case"Map":return e.size!==t.size?!1:Qj(e.entries(),t.entries(),n.concat([e]),f.concat([t]));case"Set":return e.size!==t.size?!1:Qj(e.values(),t.values(),n.concat([e]),f.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var l=Rd(e);if(l.length!==Rd(t).length)return!1;var v=n.concat([e]),w=f.concat([t]);for(d=l.length-1;d>=0;){var m=l[d];if(!(gy(m,t)&&J9(t[m],e[m],v,w)))return!1;d-=1}return!0}var xye=ta(function(e,t){return J9(e,t,[],[])}),SF=xye;function Rye(e,t,n){var f,a;if(typeof e.indexOf=="function")switch(typeof t){case"number":if(t===0){for(f=1/t;n<e.length;){if(a=e[n],a===0&&1/a===f)return n;n+=1}return-1}else if(t!==t){for(;n<e.length;){if(a=e[n],typeof a=="number"&&a!==a)return n;n+=1}return-1}return e.indexOf(t,n);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,n);case"object":if(t===null)return e.indexOf(t,n)}for(;n<e.length;){if(SF(e[n],t))return n;n+=1}return-1}function kye(e,t){return Rye(t,e,0)>=0}function hv(e,t){for(var n=0,f=t.length,a=Array(f);n<f;)a[n]=e(t[n]),n+=1;return a}function l9(e){var t=e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+t.replace(/"/g,'\\"')+'"'}var Qp=function(e){return(e<10?"0":"")+e},Tye=typeof Date.prototype.toISOString=="function"?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+Qp(e.getUTCMonth()+1)+"-"+Qp(e.getUTCDate())+"T"+Qp(e.getUTCHours())+":"+Qp(e.getUTCMinutes())+":"+Qp(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},Iye=Tye;function Bye(e){return function(){return!e.apply(this,arguments)}}function EF(e,t,n){for(var f=0,a=n.length;f<a;)t=e(t,n[f]),f+=1;return t}function Oye(e,t){for(var n=0,f=t.length,a=[];n<f;)e(t[n])&&(a[a.length]=t[n]),n+=1;return a}function Pye(e){return Object.prototype.toString.call(e)==="[object Object]"}var Nye=function(){function e(t,n){this.xf=n,this.f=t}return e.prototype["@@transducer/init"]=cv.init,e.prototype["@@transducer/result"]=cv.result,e.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):t},e}();function Cye(e){return function(t){return new Nye(e,t)}}var Lye=ta(Y9(["fantasy-land/filter","filter"],Cye,function(e,t){return Pye(t)?EF(function(n,f){return e(t[f])&&(n[f]=t[f]),n},{},Rd(t)):Oye(e,t)})),Dye=Lye,$ye=ta(function(e,t){return Dye(Bye(e),t)}),Uye=$ye;function AF(e,t){var n=function(d){var l=t.concat([e]);return kye(d,l)?"<Circular>":AF(d,l)},f=function(d,l){return hv(function(v){return l9(v)+": "+n(d[v])},l.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+hv(n,e).join(", ")+"))";case"[object Array]":return"["+hv(n,e).concat(f(e,Uye(function(d){return/^\d+$/.test(d)},Rd(e)))).join(", ")+"]";case"[object Boolean]":return typeof e=="object"?"new Boolean("+n(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?n(NaN):l9(Iye(e)))+")";case"[object Map]":return"new Map("+n(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return typeof e=="object"?"new Number("+n(e.valueOf())+")":1/e===-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+n(Array.from(e).sort())+")";case"[object String]":return typeof e=="object"?"new String("+n(e.valueOf())+")":l9(e);case"[object Undefined]":return"undefined";default:if(typeof e.toString=="function"){var a=e.toString();if(a!=="[object Object]")return a}return"{"+f(e,Rd(e)).join(", ")+"}"}}var qye=eo(function(e){return AF(e,[])}),eF=qye,jye=ta(function(e,t){if(e===t)return t;function n(v,w){if(v>w!=w>v)return w>v?w:v}var f=n(e,t);if(f!==void 0)return f;var a=n(typeof e,typeof t);if(a!==void 0)return a===typeof e?e:t;var d=eF(e),l=n(d,eF(t));return l!==void 0&&l===d?e:t}),Fye=jye,zye=function(){function e(t,n){this.xf=n,this.f=t}return e.prototype["@@transducer/init"]=cv.init,e.prototype["@@transducer/result"]=cv.result,e.prototype["@@transducer/step"]=function(t,n){return this.xf["@@transducer/step"](t,this.f(n))},e}(),Hye=function(e){return function(t){return new zye(e,t)}},Kye=Hye,Zye=ta(Y9(["fantasy-land/map","map"],Kye,function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return MF(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return EF(function(n,f){return n[f]=e(t[f]),n},{},Rd(t));default:return hv(e,t)}})),Wye=Zye,xF=Number.isInteger||function(e){return e<<0===e};function RF(e){return Object.prototype.toString.call(e)==="[object String]"}function kF(e,t){var n=e<0?t.length+e:e;return RF(t)?t.charAt(n):t[n]}var Vye=ta(function(e,t){if(t!=null)return xF(e)?kF(e,t):t[e]}),Fy=Vye,Gye=ta(function(e,t){return Wye(Fy(e),t)}),Yye=Gye,Jye=eo(function(e){return G9(e)?!0:!e||typeof e!="object"||RF(e)?!1:e.length===0?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1}),Xye=Jye,tF=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function Qye(e,t,n){return function(f,a,d){if(Xye(d))return e(f,a,d);if(d==null)return a;if(typeof d["fantasy-land/reduce"]=="function")return t(f,a,d,"fantasy-land/reduce");if(d[tF]!=null)return n(f,a,d[tF]());if(typeof d.next=="function")return n(f,a,d);if(typeof d.reduce=="function")return t(f,a,d,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function ebe(e,t,n){for(var f=0,a=n.length;f<a;){if(t=e["@@transducer/step"](t,n[f]),t&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}f+=1}return e["@@transducer/result"](t)}var tbe=ta(function(e,t){return jy(e.length,function(){return e.apply(t,arguments)})}),rbe=tbe;function ibe(e,t,n){for(var f=n.next();!f.done;){if(t=e["@@transducer/step"](t,f.value),t&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}f=n.next()}return e["@@transducer/result"](t)}function nbe(e,t,n,f){return e["@@transducer/result"](n[f](rbe(e["@@transducer/step"],e),t))}var abe=Qye(ebe,nbe,ibe),obe=abe,sbe=function(){function e(t){this.f=t}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(t){return t},e.prototype["@@transducer/step"]=function(t,n){return this.f(t,n)},e}();function fbe(e){return new sbe(e)}var ube=V9(function(e,t,n){return obe(typeof e=="function"?fbe(e):e,t,n)}),TF=ube;function hbe(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function IF(e,t){return function(){var n=arguments.length;if(n===0)return t();var f=arguments[n-1];return G9(f)||typeof f[e]!="function"?t.apply(this,arguments):f[e].apply(f,Array.prototype.slice.call(arguments,0,n-1))}}var lbe=V9(IF("slice",function(e,t,n){return Array.prototype.slice.call(n,e,t)})),cbe=lbe,dbe=eo(IF("tail",cbe(1,1/0))),pbe=dbe;function BF(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return jy(arguments[0].length,TF(hbe,arguments[0],pbe(arguments)))}var vbe=ta(function(e,t){return MF(TF(Fye,0,Yye("length",t)),function(){var n=arguments,f=this;return e.apply(f,hv(function(a){return a.apply(f,n)},t))})}),mbe=vbe,gbe=ta(function(e,t){return t==null||t!==t?e:t}),b9=gbe,ybe=function(){function e(t,n){this.xf=n,this.f=t,this.found=!1}return e.prototype["@@transducer/init"]=cv.init,e.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,void 0)),this.xf["@@transducer/result"](t)},e.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.found=!0,t=gye(this.xf["@@transducer/step"](t,n))),t},e}();function bbe(e){return function(t){return new ybe(e,t)}}var wbe=ta(Y9(["find"],bbe,function(e,t){for(var n=0,f=t.length;n<f;){if(e(t[n]))return t[n];n+=1}})),_be=wbe,Mbe=eo(function(e){return mbe(function(){return Array.prototype.slice.call(arguments,0)},e)}),Sbe=Mbe;function Ebe(e,t){for(var n=t,f=0;f<e.length;f+=1){if(n==null)return;var a=e[f];xF(a)?n=kF(a,n):n=n[a]}return n}var Abe=ta(Ebe),OF=Abe,xbe=V9(function(e,t,n){return SF(e,Fy(t,n))}),Rbe=xbe,yy=class extends Error{name="InvalidSchedulerLocation"},kbe=class extends Error{name="SchedulerTagNotFound"},Tbe=class extends Error{name="TransactionNotFound"},Ibe="Url",Bbe="Time-To-Live",Obe="Scheduler",w9=e=>BF(b9([]),_be(Rbe(e,"name")),b9({}),Fy("value")),PF=e=>BF(t=>{if(!t)throw new Tbe(e);return t},Fy("tags"),b9([]));function NF({fetch:e,GRAPHQL_URL:t}){return async({query:n,variables:f})=>e(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n,variables:f})}).then(a=>a.json())}function Pbe({fetch:e,GRAPHQL_URL:t}){let n=NF({fetch:e,GRAPHQL_URL:t}),f=CF({fetch:e,GRAPHQL_URL:t}),a=`
|
|
139
139
|
query GetTransactions ($transactionIds: [ID!]!) {
|
|
140
140
|
transactions(ids: $transactionIds) {
|
|
141
141
|
edges {
|
|
@@ -190,7 +190,7 @@ ${JSON.stringify(St.from(n))},${JSON.stringify(St.from(f))},${d} => ${JSON.strin
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
}`,a=Jt.object({data:Jt.object({transactions:Jt.object({edges:Jt.array(Jt.object({node:Jt.record(Jt.any())}))})})});return d=>mi(d).chain(sn(l=>e(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:f,variables:{transactionIds:[l]}})}).then(async v=>{if(v.ok)return v.json();throw n('Error Encountered when querying gateway for transaction "%s"',l),new Error(`${v.status}: ${await v.text()}`)}).then(a.parse).then(K4e(["data","transactions","edges","0","node"])))).toPromise()}var rwe=K9(hye(),1),jz=(e="@permaweb/aoconnect")=>{let t=(0,rwe.default)(e);return t.child=n=>jz(`${t.namespace}:${n}`),t.tap=(n,...f)=>X4e((...a)=>t(n,...f,...a)),t},Fz=({url:e,path:t})=>t?t.startsWith("/")?Fz({url:e,path:t.slice(1)}):(e=new URL(e),e.pathname+=t,e.toString()):e;function iwe(e){return Ld(Vy([]),Cd((t,n)=>Ld(V4e([],n.name),s_(n.value),ps(n.name,sh,t))(t),{}),Zy(t=>t.length>1?t:t[0]))(e)}function ls(e,t){return n=>lz(i4e([dF(e,"name"),u_(o_(t),dF(t,"value"),i_)]),n)}function mF(e){return _z([[lv(String),Ad(e)],[lv(Array),L4e(e)],[i_,d8e]])}function B0(e){let t;return lv(cs,e)?(t=new Error(nwe(e)),t.stack+=e.stack):lv(Error,e)?t=e:P4e("message",e)?t=new Error(e.message):lv(String,e)?t=new Error(e):t=new Error("An error occurred"),t}function nwe(e){return Ld(t=>function n(f,a,d){return Cd((l,v)=>Ld(_z([[Ad(hr.invalid_arguments),()=>n(v.argumentsError,422,"Invalid Arguments")],[Ad(hr.invalid_return_type),()=>n(v.returnTypeError,500,"Invalid Return")],[Ad(hr.invalid_union),()=>b4e(w=>n(w,400,"Invalid Union"),v.unionErrors)],[i_,()=>[{...v,status:a,contextCode:d}]]]),f_(l))(v.code),[],f.issues)}(t,400,""),t=>Cd((n,f)=>{let{message:a,path:d,contextCode:l}=f,v=d[1]||d[0],w=l?`${l} `:"";return n.push(`${w}'${v}': ${a}.`),n},[],t),F4e(" | "))(e)}var awe=Jt.object({id:Jt.string().min(1,{message:"message is required to be a message id"}),processId:Jt.string().min(1,{message:"process is required to be a process id"})});function owe(){return e=>mi(e).map(awe.parse).map(()=>e)}var Vv=Jt.object({name:Jt.string(),value:Jt.string()}),swe=Jt.function().args(Jt.object({Id:Jt.string(),Target:Jt.string(),Owner:Jt.string(),Anchor:Jt.string().optional(),Data:Jt.any().default("1234"),Tags:Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}))})).returns(Jt.promise(Jt.any())),fwe=Jt.function().args(Jt.object({id:Jt.string().min(1,{message:"message id is required"}),processId:Jt.string().min(1,{message:"process id is required"})})).returns(Jt.promise(Jt.any())),uwe=Jt.function().args(Jt.object({process:Jt.string().min(1,{message:"process id is required"}),from:Jt.string().optional(),to:Jt.string().optional(),sort:Jt.enum(["ASC","DESC"]).default("ASC"),limit:Jt.number().optional()})).returns(Jt.promise(Jt.object({edges:Jt.array(Jt.object({cursor:Jt.string(),node:Jt.object({Output:Jt.any().optional(),Messages:Jt.array(Jt.any()).optional(),Spawns:Jt.array(Jt.any()).optional(),Error:Jt.any().optional()})}))}))),zz=Jt.function().args(Jt.object({processId:Jt.string(),data:Jt.any(),tags:Jt.array(Vv),anchor:Jt.string().optional(),signer:Jt.any()})).returns(Jt.promise(Jt.object({messageId:Jt.string()}).passthrough())),hwe=Jt.function().args(Jt.object({data:Jt.any(),tags:Jt.array(Vv),signer:Jt.any()})).returns(Jt.promise(Jt.object({processId:Jt.string()}).passthrough())),lwe=Jt.function().args(Jt.object({process:Jt.string(),message:Jt.string(),baseLayer:Jt.boolean().optional(),exclude:Jt.array(Jt.string()).optional()})).returns(Jt.promise(Jt.object({assignmentId:Jt.string()}).passthrough())),Hz=zz,CKe=Jt.function().args(Jt.object({suUrl:Jt.string().url(),processId:Jt.string()})).returns(Jt.promise(Jt.object({tags:Jt.array(Vv)}).passthrough())),LKe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.object({url:Jt.string()}))),cwe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.boolean())),dwe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.object({tags:Jt.array(Vv)}).passthrough())),Gy=Jt.function().args(Jt.object({data:Jt.any(),tags:Jt.array(Vv),target:Jt.string().optional(),anchor:Jt.string().optional()})).returns(Jt.promise(Jt.object({id:Jt.string(),raw:Jt.any()})));function pwe({loadResult:e}){return e=sn(fwe.implement(e)),t=>mi({id:t.id,processId:t.processId}).chain(e)}function vwe(e){let t=owe(e),n=pwe(e);return({message:f,process:a})=>mi({id:f,processId:a}).chain(t).chain(n).map(e.logger.tap('readResult result for message "%s": %O',f)).map(d=>d).bimap(B0,I0).toPromise()}var mwe=Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}));function gwe(){return e=>mi(e.tags).map(Vy([])).map(ls("Data-Protocol","ao")).map(ls("Variant")).map(ls("Type")).map(ls("SDK")).map(f_(sh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(mwe.parse).map(ps("tags",sh,e))}function ywe({logger:e}){return t=>mi(t).chain(u_(o_(t.data),()=>x0(t),()=>x0(Math.random().toString().slice(-4)).map(ps("data",sh,t)).map(n=>Ld(T0("tags"),ls("Content-Type"),s_({name:"Content-Type",value:"text/plain"}),ps("tags",sh,n))(n)).map(e.tap('added pseudo-random string as message "data"'))))}function bwe(e){let t=gwe(e),n=ywe(e),f=zz.implement(e.deployMessage);return a=>mi(a).chain(t).chain(n).chain(sn(({id:d,data:l,tags:v,anchor:w,signer:m})=>f({processId:d,data:l,tags:v,anchor:w,signer:Gy.implement(m)}))).map(d=>ps("messageId",d.messageId,a))}function wwe(e){let t=bwe(e);return({process:n,data:f,tags:a,anchor:d,signer:l})=>mi({id:n,data:f,tags:a,anchor:d,signer:l}).chain(t).map(v=>v.messageId).bimap(B0,I0).toPromise()}var tv=(e,t,n)=>f=>t(f[e])?x0(f):il(`Tag '${e}': ${n}`);function _we({loadTransactionMeta:e,logger:t}){return e=sn(dwe.implement(e)),n=>mi(n).chain(e).map(T0("tags")).map(iwe).chain(tv("Data-Protocol",mF("ao"),"value 'ao' was not found on module")).chain(tv("Type",mF("Module"),"value 'Module' was not found on module")).chain(tv("Module-Format",m9,"was not found on module")).chain(tv("Input-Encoding",m9,"was not found on module")).chain(tv("Output-Encoding",m9,"was not found on module")).bimap(t.tap("Verifying module source failed: %s"),t.tap("Verified module source"))}function Mwe({logger:e,validateScheduler:t}){return t=sn(cwe.implement(t)),n=>mi(n).chain(f=>t(f).chain(a=>a?x0(f):il(`Valid Scheduler-Location owned by ${f} not found`))).bimap(e.tap("Verifying scheduler failed: %s"),e.tap("Verified scheduler"))}function Swe({logger:e}){return t=>mi(t).map(e.tap("Checking for signer")).chain(n=>n?x0(n):il("signer not found"))}function Ewe(e){let t=e.logger.child("verifyInput");e={...e,logger:t};let n=_we(e),f=Mwe(e),a=Swe(e);return d=>mi(d).chain(l=>n(l.module).map(()=>l)).chain(l=>f(l.scheduler)).map(()=>d).chain(l=>a(l.signer).map(()=>l)).bimap(t.tap("Error when verify input: %s"),t.tap("Successfully verified inputs"))}var Awe=Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}));function xwe(){return e=>mi(e).map(T0("tags")).map(Vy([])).map(ls("Data-Protocol","ao")).map(ls("Variant")).map(ls("Type")).map(ls("Module")).map(ls("Scheduler")).map(ls("SDK")).map(f_(sh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:e.module},{name:"Scheduler",value:e.scheduler},{name:"SDK",value:"aoconnect"}])).map(Awe.parse).map(ps("tags",sh,e))}function Rwe({logger:e}){return t=>mi(t).chain(u_(o_(t.data),()=>x0(t),()=>x0(Math.random().toString().slice(-4)).map(ps("data",sh,t)).map(n=>Ld(T0("tags"),ls("Content-Type"),s_({name:"Content-Type",value:"text/plain"}),ps("tags",sh,n))(n)).map(e.tap('added pseudo-random string as process "data"'))))}function kwe(e){let t=e.logger.child("uploadProcess");e={...e,logger:t};let n=xwe(e),f=Rwe(e),a=hwe.implement(e.deployProcess);return d=>mi(d).chain(n).chain(f).chain(sn(({data:l,tags:v,signer:w})=>a({data:l,tags:v,signer:Gy.implement(w)}))).map(l=>ps("processId",l.processId,d))}function Twe(e){let t=Ewe(e),n=kwe(e);return({module:f,scheduler:a,signer:d,tags:l,data:v})=>mi({module:f,scheduler:a,signer:d,tags:l,data:v}).chain(t).chain(n).map(w=>w.processId).bimap(B0,I0).toPromise()}function Iwe(e){let t=Hz.implement(e.deployMonitor);return n=>mi(n).chain(sn(({id:f,signer:a})=>t({processId:f,signer:Gy.implement(a),data:Math.random().toString().slice(-4),tags:[]}))).map(f=>ps("monitorId",f.messageId,n))}function Bwe(e){let t=Iwe(e);return({process:n,signer:f})=>mi({id:n,signer:f}).chain(t).map(a=>a.monitorId).bimap(B0,I0).toPromise()}function Owe(e){let t=Hz.implement(e.deployUnmonitor);return n=>mi(n).chain(sn(({id:f,signer:a})=>t({processId:f,signer:Gy.implement(a),data:Math.random().toString().slice(-4),tags:[]}))).map(f=>ps("monitorId",f.messageId,n))}function Pwe(e){let t=Owe(e);return({process:n,signer:f})=>mi({id:n,signer:f}).chain(t).map(a=>a.monitorId).bimap(B0,I0).toPromise()}var Nwe=Jt.object({process:Jt.string().min(1,{message:"process identifier is required"}),from:Jt.string().optional(),to:Jt.string().optional(),sort:Jt.enum(["ASC","DESC"]).default("ASC"),limit:Jt.number().optional()});function Cwe(){return e=>mi(e).map(Nwe.parse).map(()=>e)}function Lwe({queryResults:e}){return e=sn(uwe.implement(e)),t=>mi({process:t.process,from:t.from,to:t.to,sort:t.sort,limit:t.limit}).chain(e)}function Dwe(e){let t=Cwe(e),n=Lwe(e);return({process:f,from:a,to:d,sort:l,limit:v})=>mi({process:f,from:a,to:d,sort:l,limit:v}).chain(t).chain(n).map(e.logger.tap('readResults result for message "%s": %O',f)).map(w=>w).bimap(B0,I0).toPromise()}var $we=Jt.object({Id:Jt.string(),Target:Jt.string(),Owner:Jt.string(),Anchor:Jt.string().optional(),Data:Jt.any().default("1234"),Tags:Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}))});function Uwe(){return e=>mi(e).map($we.parse).map(t=>(t.Tags=t.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),t))}function qwe({dryrunFetch:e}){return sn(swe.implement(e))}function jwe(e){let t=Uwe(e),n=qwe(e);return f=>mi(f).map(Fwe).chain(t).chain(n).toPromise()}function Fwe({process:e,data:t,tags:n,anchor:f,...a}){return{Id:"1234",Owner:"1234",...a,Target:e,Data:t||"1234",Tags:n||[],Anchor:f||"0"}}function zwe(e){let t=lwe.implement(e.deployAssign);return n=>mi(n).chain(sn(({process:f,message:a,baseLayer:d,exclude:l})=>t({process:f,message:a,baseLayer:d,exclude:l}))).map(f=>ps("assignmentId",f.assignmentId,n))}function Hwe(e){let t=zwe(e);return({process:n,message:f,baseLayer:a,exclude:d})=>mi({process:n,message:f,baseLayer:a,exclude:d}).chain(t).map(l=>l.assignmentId).bimap(B0,I0).toPromise()}var Kwe="https://arweave.net",Zwe="https://mu.ao-testnet.xyz",Wwe="https://cu.ao-testnet.xyz";function Fd({GRAPHQL_URL:e,GATEWAY_URL:t=Kwe,MU_URL:n=Zwe,CU_URL:f=Wwe}={}){let a=jz();e||(e=Fz({url:t,path:"/graphql"}));let{validate:d}=sz({cacheSize:100,GRAPHQL_URL:e}),l=l8e({MAX_SIZE:25}),v=a.child("result"),w=vwe({loadResult:f8e({fetch,CU_URL:f,logger:v}),logger:v}),m=a.child("message"),y=wwe({loadProcessMeta:d9({fetch,cache:l,logger:m}),deployMessage:r8e({fetch,MU_URL:n,logger:m}),logger:m}),g=a.child("spawn"),S=Twe({loadTransactionMeta:twe({fetch,GRAPHQL_URL:e,logger:g}),validateScheduler:d,deployProcess:i8e({fetch,MU_URL:n,logger:g}),logger:g}),x=a.child("monitor"),A=Bwe({loadProcessMeta:d9({fetch,cache:l,logger:x}),deployMonitor:n8e({fetch,MU_URL:n,logger:x}),logger:x}),T=a.child("unmonitor"),I=Pwe({loadProcessMeta:d9({fetch,cache:l,logger:T}),deployUnmonitor:a8e({fetch,MU_URL:n,logger:T}),logger:x}),B=a.child("results"),P=Dwe({queryResults:u8e({fetch,CU_URL:f,logger:B}),logger:B}),C=a.child("dryrun"),q=jwe({dryrunFetch:s8e({fetch,CU_URL:f,logger:C}),logger:C}),K=a.child("assign"),G=Hwe({deployAssign:o8e({fetch,MU_URL:n,logger:K}),logger:m});return{result:w,results:P,message:y,spawn:S,monitor:A,unmonitor:I,dryrun:q,assign:G}}var Kz={};bF(Kz,{createDataItemSigner:()=>y7e});var Zz=K9(dye(),1),Wz={};bF(Wz,{AVSCTap:()=>Gv,ArweaveSigner:()=>p_,DataItem:()=>Hv,MAX_TAG_BYTES:()=>Yy,MIN_BINARY_SIZE:()=>g_,SIG_CONFIG:()=>jd,SignatureConfig:()=>hs,Signer:()=>Jz,createData:()=>tH,default:()=>v7e,deserializeTags:()=>qy,indexToType:()=>v_,serializeTags:()=>m_,tagsExceedLimit:()=>eH,warparbundles:()=>m7e});var Vwe=Object.create,c_=Object.defineProperty,Gwe=Object.getOwnPropertyDescriptor,Ywe=Object.getOwnPropertyNames,Jwe=Object.getPrototypeOf,Xwe=Object.prototype.hasOwnProperty,uh=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qwe=(e,t)=>{for(var n in t)c_(e,n,{get:t[n],enumerable:!0})},e7e=(e,t,n,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ywe(t))!Xwe.call(e,a)&&a!==n&&c_(e,a,{get:()=>t[a],enumerable:!(f=Gwe(t,a))||f.enumerable});return e},O0=(e,t,n)=>(n=e!=null?Vwe(Jwe(e)):{},e7e(t||!e||!e.__esModule?c_(n,"default",{value:e,enumerable:!0}):n,e)),t7e=uh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(n){var f=4,a=n.length,d=a%f;if(!d)return n;var l=a,v=f-d,w=a+v,m=St.alloc(w);for(m.write(n);v--;)m.write("=",l++);return m.toString()}e.default=t}),r7e=uh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=t7e();function n(w,m){return m===void 0&&(m="utf8"),St.isBuffer(w)?d(w.toString("base64")):d(St.from(w,m).toString("base64"))}function f(w,m){return m===void 0&&(m="utf8"),St.from(a(w),"base64").toString(m)}function a(w){return w=w.toString(),t.default(w).replace(/\-/g,"+").replace(/_/g,"/")}function d(w){return w.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function l(w){return St.from(a(w),"base64")}var v=n;v.encode=n,v.decode=f,v.toBase64=a,v.fromBase64=d,v.toBuffer=l,e.default=v}),d_=uh((e,t)=>{t.exports=r7e().default,t.exports.default=t.exports}),Vz=uh(e=>{"use strict";e.byteLength=w,e.toByteArray=y,e.fromByteArray=x;var t=[],n=[],f=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,l=a.length;d<l;++d)t[d]=a[d],n[a.charCodeAt(d)]=d;var d,l;n[45]=62,n[95]=63;function v(A){var T=A.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=A.indexOf("=");I===-1&&(I=T);var B=I===T?0:4-I%4;return[I,B]}function w(A){var T=v(A),I=T[0],B=T[1];return(I+B)*3/4-B}function m(A,T,I){return(T+I)*3/4-I}function y(A){var T,I=v(A),B=I[0],P=I[1],C=new f(m(A,B,P)),q=0,K=P>0?B-4:B,G;for(G=0;G<K;G+=4)T=n[A.charCodeAt(G)]<<18|n[A.charCodeAt(G+1)]<<12|n[A.charCodeAt(G+2)]<<6|n[A.charCodeAt(G+3)],C[q++]=T>>16&255,C[q++]=T>>8&255,C[q++]=T&255;return P===2&&(T=n[A.charCodeAt(G)]<<2|n[A.charCodeAt(G+1)]>>4,C[q++]=T&255),P===1&&(T=n[A.charCodeAt(G)]<<10|n[A.charCodeAt(G+1)]<<4|n[A.charCodeAt(G+2)]>>2,C[q++]=T>>8&255,C[q++]=T&255),C}function g(A){return t[A>>18&63]+t[A>>12&63]+t[A>>6&63]+t[A&63]}function S(A,T,I){for(var B,P=[],C=T;C<I;C+=3)B=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),P.push(g(B));return P.join("")}function x(A){for(var T,I=A.length,B=I%3,P=[],C=16383,q=0,K=I-B;q<K;q+=C)P.push(S(A,q,q+C>K?K:q+C));return B===1?(T=A[I-1],P.push(t[T>>2]+t[T<<4&63]+"==")):B===2&&(T=(A[I-2]<<8)+A[I-1],P.push(t[T>>10]+t[T>>4&63]+t[T<<2&63]+"=")),P.join("")}}),Gz=uh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.b64UrlDecode=e.b64UrlEncode=e.bufferTob64Url=e.bufferTob64=e.b64UrlToBuffer=e.stringToB64Url=e.stringToBuffer=e.bufferToString=e.b64UrlToString=e.concatBuffers=void 0;var t=Vz();function n(S){let x=0;for(let I=0;I<S.length;I++)x+=S[I].byteLength;let A=new Uint8Array(x),T=0;A.set(new Uint8Array(S[0]),T),T+=S[0].byteLength;for(let I=1;I<S.length;I++)A.set(new Uint8Array(S[I]),T),T+=S[I].byteLength;return A}e.concatBuffers=n;function f(S){let x=v(S);return a(x)}e.b64UrlToString=f;function a(S){return new TextDecoder("utf-8",{fatal:!0}).decode(S)}e.bufferToString=a;function d(S){return new TextEncoder().encode(S)}e.stringToBuffer=d;function l(S){return m(d(S))}e.stringToB64Url=l;function v(S){return new Uint8Array(t.toByteArray(g(S)))}e.b64UrlToBuffer=v;function w(S){return t.fromByteArray(new Uint8Array(S))}e.bufferTob64=w;function m(S){return y(w(S))}e.bufferTob64Url=m;function y(S){return S.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}e.b64UrlEncode=y;function g(S){S=S.replace(/\-/g,"+").replace(/\_/g,"/");let x;return S.length%4==0?x=0:x=4-S.length%4,S.concat("=".repeat(x))}e.b64UrlDecode=g}),i7e=uh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Gz(),n=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let f=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),a=await this.driver.exportKey("jwk",f.privateKey);return{kty:a.kty,e:a.e,n:a.n,d:a.d,p:a.p,q:a.q,dp:a.dp,dq:a.dq,qi:a.qi}}async sign(f,a,{saltLength:d}={}){let l=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(f),a);return new Uint8Array(l)}async hash(f,a="SHA-256"){let d=await this.driver.digest(a,f);return new Uint8Array(d)}async verify(f,a,d){let l={kty:"RSA",e:"AQAB",n:f},v=await this.jwkToPublicCryptoKey(l),w=await this.driver.digest("SHA-256",a),m=await this.driver.verify({name:"RSA-PSS",saltLength:0},v,d,a),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},v,d,a),g=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((v.algorithm.modulusLength-1)/8)-w.byteLength-2},v,d,a);return m||y||g}async jwkToCryptoKey(f){return this.driver.importKey("jwk",f,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(f){return this.driver.importKey("jwk",f,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let f=crypto?.subtle;return f===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(a=>typeof f[a]=="function")}async encrypt(f,a,d){let l=await this.driver.importKey("raw",typeof a=="string"?t.stringToBuffer(a):a,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?t.stringToBuffer(d):t.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},l,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=new Uint8Array(16);crypto.getRandomValues(w);let m=await this.driver.encrypt({name:"AES-CBC",iv:w},v,f);return t.concatBuffers([w,m])}async decrypt(f,a,d){let l=await this.driver.importKey("raw",typeof a=="string"?t.stringToBuffer(a):a,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?t.stringToBuffer(d):t.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},l,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=f.slice(0,16),m=await this.driver.decrypt({name:"AES-CBC",iv:w},v,f.slice(16));return t.concatBuffers([m])}};e.default=n}),n7e=uh(e=>{e.read=function(t,n,f,a,d){var l,v,w=d*8-a-1,m=(1<<w)-1,y=m>>1,g=-7,S=f?d-1:0,x=f?-1:1,A=t[n+S];for(S+=x,l=A&(1<<-g)-1,A>>=-g,g+=w;g>0;l=l*256+t[n+S],S+=x,g-=8);for(v=l&(1<<-g)-1,l>>=-g,g+=a;g>0;v=v*256+t[n+S],S+=x,g-=8);if(l===0)l=1-y;else{if(l===m)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,a),l=l-y}return(A?-1:1)*v*Math.pow(2,l-a)},e.write=function(t,n,f,a,d,l){var v,w,m,y=l*8-d-1,g=(1<<y)-1,S=g>>1,x=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=a?0:l-1,T=a?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(w=isNaN(n)?1:0,v=g):(v=Math.floor(Math.log(n)/Math.LN2),n*(m=Math.pow(2,-v))<1&&(v--,m*=2),v+S>=1?n+=x/m:n+=x*Math.pow(2,1-S),n*m>=2&&(v++,m/=2),v+S>=g?(w=0,v=g):v+S>=1?(w=(n*m-1)*Math.pow(2,d),v=v+S):(w=n*Math.pow(2,S-1)*Math.pow(2,d),v=0));d>=8;t[f+A]=w&255,A+=T,w/=256,d-=8);for(v=v<<d|w,y+=d;y>0;t[f+A]=v&255,A+=T,v/=256,y-=8);t[f+A-T]|=I*128}}),F9=uh(e=>{"use strict";var t=Vz(),n=n7e(),f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=v,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;var a=2147483647;e.kMaxLength=a,v.TYPED_ARRAY_SUPPORT=d(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let O=new Uint8Array(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,Uint8Array.prototype),Object.setPrototypeOf(O,N),O.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function l(O){if(O>a)throw new RangeError('The value "'+O+'" is invalid for option "size"');let N=new Uint8Array(O);return Object.setPrototypeOf(N,v.prototype),N}function v(O,N,$){if(typeof O=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(O)}return w(O,N,$)}v.poolSize=8192;function w(O,N,$){if(typeof O=="string")return S(O,N);if(ArrayBuffer.isView(O))return A(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(ut(O,ArrayBuffer)||O&&ut(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(O,SharedArrayBuffer)||O&&ut(O.buffer,SharedArrayBuffer)))return T(O,N,$);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ee=O.valueOf&&O.valueOf();if(ee!=null&&ee!==O)return v.from(ee,N,$);let re=I(O);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return v.from(O[Symbol.toPrimitive]("string"),N,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}v.from=function(O,N,$){return w(O,N,$)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function m(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function y(O,N,$){return m(O),O<=0?l(O):N!==void 0?typeof $=="string"?l(O).fill(N,$):l(O).fill(N):l(O)}v.alloc=function(O,N,$){return y(O,N,$)};function g(O){return m(O),l(O<0?0:B(O)|0)}v.allocUnsafe=function(O){return g(O)},v.allocUnsafeSlow=function(O){return g(O)};function S(O,N){if((typeof N!="string"||N==="")&&(N="utf8"),!v.isEncoding(N))throw new TypeError("Unknown encoding: "+N);let $=C(O,N)|0,ee=l($),re=ee.write(O,N);return re!==$&&(ee=ee.slice(0,re)),ee}function x(O){let N=O.length<0?0:B(O.length)|0,$=l(N);for(let ee=0;ee<N;ee+=1)$[ee]=O[ee]&255;return $}function A(O){if(ut(O,Uint8Array)){let N=new Uint8Array(O);return T(N.buffer,N.byteOffset,N.byteLength)}return x(O)}function T(O,N,$){if(N<0||O.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<N+($||0))throw new RangeError('"length" is outside of buffer bounds');let ee;return N===void 0&&$===void 0?ee=new Uint8Array(O):$===void 0?ee=new Uint8Array(O,N):ee=new Uint8Array(O,N,$),Object.setPrototypeOf(ee,v.prototype),ee}function I(O){if(v.isBuffer(O)){let N=B(O.length)|0,$=l(N);return $.length===0||O.copy($,0,0,N),$}if(O.length!==void 0)return typeof O.length!="number"||qe(O.length)?l(0):x(O);if(O.type==="Buffer"&&Array.isArray(O.data))return x(O.data)}function B(O){if(O>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return O|0}function P(O){return+O!=O&&(O=0),v.alloc(+O)}v.isBuffer=function(O){return O!=null&&O._isBuffer===!0&&O!==v.prototype},v.compare=function(O,N){if(ut(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),!v.isBuffer(O)||!v.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(O===N)return 0;let $=O.length,ee=N.length;for(let re=0,se=Math.min($,ee);re<se;++re)if(O[re]!==N[re]){$=O[re],ee=N[re];break}return $<ee?-1:ee<$?1:0},v.isEncoding=function(O){switch(String(O).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(O,N){if(!Array.isArray(O))throw new TypeError('"list" argument must be an Array of Buffers');if(O.length===0)return v.alloc(0);let $;if(N===void 0)for(N=0,$=0;$<O.length;++$)N+=O[$].length;let ee=v.allocUnsafe(N),re=0;for($=0;$<O.length;++$){let se=O[$];if(ut(se,Uint8Array))re+se.length>ee.length?(v.isBuffer(se)||(se=v.from(se)),se.copy(ee,re)):Uint8Array.prototype.set.call(ee,se,re);else if(v.isBuffer(se))se.copy(ee,re);else throw new TypeError('"list" argument must be an Array of Buffers');re+=se.length}return ee};function C(O,N){if(v.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||ut(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);let $=O.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&$===0)return 0;let re=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return he(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return Ae(O).length;default:if(re)return ee?-1:he(O).length;N=(""+N).toLowerCase(),re=!0}}v.byteLength=C;function q(O,N,$){let ee=!1;if((N===void 0||N<0)&&(N=0),N>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,N>>>=0,$<=N))return"";for(O||(O="utf8");;)switch(O){case"hex":return r(this,N,$);case"utf8":case"utf-8":return c(this,N,$);case"ascii":return R(this,N,$);case"latin1":case"binary":return o(this,N,$);case"base64":return u(this,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h(this,N,$);default:if(ee)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),ee=!0}}v.prototype._isBuffer=!0;function K(O,N,$){let ee=O[N];O[N]=O[$],O[$]=ee}v.prototype.swap16=function(){let O=this.length;if(O%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<O;N+=2)K(this,N,N+1);return this},v.prototype.swap32=function(){let O=this.length;if(O%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<O;N+=4)K(this,N,N+3),K(this,N+1,N+2);return this},v.prototype.swap64=function(){let O=this.length;if(O%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<O;N+=8)K(this,N,N+7),K(this,N+1,N+6),K(this,N+2,N+5),K(this,N+3,N+4);return this},v.prototype.toString=function(){let O=this.length;return O===0?"":arguments.length===0?c(this,0,O):q.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(O){if(!v.isBuffer(O))throw new TypeError("Argument must be a Buffer");return this===O?!0:v.compare(this,O)===0},v.prototype.inspect=function(){let O="",N=e.INSPECT_MAX_BYTES;return O=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(O+=" ... "),"<Buffer "+O+">"},f&&(v.prototype[f]=v.prototype.inspect),v.prototype.compare=function(O,N,$,ee,re){if(ut(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),!v.isBuffer(O))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof O);if(N===void 0&&(N=0),$===void 0&&($=O?O.length:0),ee===void 0&&(ee=0),re===void 0&&(re=this.length),N<0||$>O.length||ee<0||re>this.length)throw new RangeError("out of range index");if(ee>=re&&N>=$)return 0;if(ee>=re)return-1;if(N>=$)return 1;if(N>>>=0,$>>>=0,ee>>>=0,re>>>=0,this===O)return 0;let se=re-ee,ce=$-N,st=Math.min(se,ce),ye=this.slice(ee,re),be=O.slice(N,$);for(let me=0;me<st;++me)if(ye[me]!==be[me]){se=ye[me],ce=be[me];break}return se<ce?-1:ce<se?1:0};function G(O,N,$,ee,re){if(O.length===0)return-1;if(typeof $=="string"?(ee=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,qe($)&&($=re?0:O.length-1),$<0&&($=O.length+$),$>=O.length){if(re)return-1;$=O.length-1}else if($<0)if(re)$=0;else return-1;if(typeof N=="string"&&(N=v.from(N,ee)),v.isBuffer(N))return N.length===0?-1:j(O,N,$,ee,re);if(typeof N=="number")return N=N&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(O,N,$):Uint8Array.prototype.lastIndexOf.call(O,N,$):j(O,[N],$,ee,re);throw new TypeError("val must be string, number or Buffer")}function j(O,N,$,ee,re){let se=1,ce=O.length,st=N.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(O.length<2||N.length<2)return-1;se=2,ce/=2,st/=2,$/=2}function ye(me,ke){return se===1?me[ke]:me.readUInt16BE(ke*se)}let be;if(re){let me=-1;for(be=$;be<ce;be++)if(ye(O,be)===ye(N,me===-1?0:be-me)){if(me===-1&&(me=be),be-me+1===st)return me*se}else me!==-1&&(be-=be-me),me=-1}else for($+st>ce&&($=ce-st),be=$;be>=0;be--){let me=!0;for(let ke=0;ke<st;ke++)if(ye(O,be+ke)!==ye(N,ke)){me=!1;break}if(me)return be}return-1}v.prototype.includes=function(O,N,$){return this.indexOf(O,N,$)!==-1},v.prototype.indexOf=function(O,N,$){return G(this,O,N,$,!0)},v.prototype.lastIndexOf=function(O,N,$){return G(this,O,N,$,!1)};function z(O,N,$,ee){$=Number($)||0;let re=O.length-$;ee?(ee=Number(ee),ee>re&&(ee=re)):ee=re;let se=N.length;ee>se/2&&(ee=se/2);let ce;for(ce=0;ce<ee;++ce){let st=parseInt(N.substr(ce*2,2),16);if(qe(st))return ce;O[$+ce]=st}return ce}function J(O,N,$,ee){return _e(he(N,O.length-$),O,$,ee)}function E(O,N,$,ee){return _e(pe(N),O,$,ee)}function i(O,N,$,ee){return _e(Ae(N),O,$,ee)}function s(O,N,$,ee){return _e(De(N,O.length-$),O,$,ee)}v.prototype.write=function(O,N,$,ee){if(N===void 0)ee="utf8",$=this.length,N=0;else if($===void 0&&typeof N=="string")ee=N,$=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite($)?($=$>>>0,ee===void 0&&(ee="utf8")):(ee=$,$=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let re=this.length-N;if(($===void 0||$>re)&&($=re),O.length>0&&($<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");ee||(ee="utf8");let se=!1;for(;;)switch(ee){case"hex":return z(this,O,N,$);case"utf8":case"utf-8":return J(this,O,N,$);case"ascii":case"latin1":case"binary":return E(this,O,N,$);case"base64":return i(this,O,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,O,N,$);default:if(se)throw new TypeError("Unknown encoding: "+ee);ee=(""+ee).toLowerCase(),se=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function u(O,N,$){return N===0&&$===O.length?t.fromByteArray(O):t.fromByteArray(O.slice(N,$))}function c(O,N,$){$=Math.min(O.length,$);let ee=[],re=N;for(;re<$;){let se=O[re],ce=null,st=se>239?4:se>223?3:se>191?2:1;if(re+st<=$){let ye,be,me,ke;switch(st){case 1:se<128&&(ce=se);break;case 2:ye=O[re+1],(ye&192)===128&&(ke=(se&31)<<6|ye&63,ke>127&&(ce=ke));break;case 3:ye=O[re+1],be=O[re+2],(ye&192)===128&&(be&192)===128&&(ke=(se&15)<<12|(ye&63)<<6|be&63,ke>2047&&(ke<55296||ke>57343)&&(ce=ke));break;case 4:ye=O[re+1],be=O[re+2],me=O[re+3],(ye&192)===128&&(be&192)===128&&(me&192)===128&&(ke=(se&15)<<18|(ye&63)<<12|(be&63)<<6|me&63,ke>65535&&ke<1114112&&(ce=ke))}}ce===null?(ce=65533,st=1):ce>65535&&(ce-=65536,ee.push(ce>>>10&1023|55296),ce=56320|ce&1023),ee.push(ce),re+=st}return _(ee)}var p=4096;function _(O){let N=O.length;if(N<=p)return String.fromCharCode.apply(String,O);let $="",ee=0;for(;ee<N;)$+=String.fromCharCode.apply(String,O.slice(ee,ee+=p));return $}function R(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]&127);return ee}function o(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]);return ee}function r(O,N,$){let ee=O.length;(!N||N<0)&&(N=0),(!$||$<0||$>ee)&&($=ee);let re="";for(let se=N;se<$;++se)re+=Te[O[se]];return re}function h(O,N,$){let ee=O.slice(N,$),re="";for(let se=0;se<ee.length-1;se+=2)re+=String.fromCharCode(ee[se]+ee[se+1]*256);return re}v.prototype.slice=function(O,N){let $=this.length;O=~~O,N=N===void 0?$:~~N,O<0?(O+=$,O<0&&(O=0)):O>$&&(O=$),N<0?(N+=$,N<0&&(N=0)):N>$&&(N=$),N<O&&(N=O);let ee=this.subarray(O,N);return Object.setPrototypeOf(ee,v.prototype),ee};function b(O,N,$){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+N>$)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O],re=1,se=0;for(;++se<N&&(re*=256);)ee+=this[O+se]*re;return ee},v.prototype.readUintBE=v.prototype.readUIntBE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O+--N],re=1;for(;N>0&&(re*=256);)ee+=this[O+--N]*re;return ee},v.prototype.readUint8=v.prototype.readUInt8=function(O,N){return O=O>>>0,N||b(O,1,this.length),this[O]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(O,N){return O=O>>>0,N||b(O,2,this.length),this[O]|this[O+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(O,N){return O=O>>>0,N||b(O,2,this.length),this[O]<<8|this[O+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(O,N){return O=O>>>0,N||b(O,4,this.length),(this[O]|this[O+1]<<8|this[O+2]<<16)+this[O+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]*16777216+(this[O+1]<<16|this[O+2]<<8|this[O+3])},v.prototype.readBigUInt64LE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=N+this[++O]*2**8+this[++O]*2**16+this[++O]*2**24,re=this[++O]+this[++O]*2**8+this[++O]*2**16+$*2**24;return BigInt(ee)+(BigInt(re)<<BigInt(32))}),v.prototype.readBigUInt64BE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=N*2**24+this[++O]*2**16+this[++O]*2**8+this[++O],re=this[++O]*2**24+this[++O]*2**16+this[++O]*2**8+$;return(BigInt(ee)<<BigInt(32))+BigInt(re)}),v.prototype.readIntLE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O],re=1,se=0;for(;++se<N&&(re*=256);)ee+=this[O+se]*re;return re*=128,ee>=re&&(ee-=Math.pow(2,8*N)),ee},v.prototype.readIntBE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=N,re=1,se=this[O+--ee];for(;ee>0&&(re*=256);)se+=this[O+--ee]*re;return re*=128,se>=re&&(se-=Math.pow(2,8*N)),se},v.prototype.readInt8=function(O,N){return O=O>>>0,N||b(O,1,this.length),this[O]&128?(255-this[O]+1)*-1:this[O]},v.prototype.readInt16LE=function(O,N){O=O>>>0,N||b(O,2,this.length);let $=this[O]|this[O+1]<<8;return $&32768?$|4294901760:$},v.prototype.readInt16BE=function(O,N){O=O>>>0,N||b(O,2,this.length);let $=this[O+1]|this[O]<<8;return $&32768?$|4294901760:$},v.prototype.readInt32LE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]|this[O+1]<<8|this[O+2]<<16|this[O+3]<<24},v.prototype.readInt32BE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]<<24|this[O+1]<<16|this[O+2]<<8|this[O+3]},v.prototype.readBigInt64LE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=this[O+4]+this[O+5]*2**8+this[O+6]*2**16+($<<24);return(BigInt(ee)<<BigInt(32))+BigInt(N+this[++O]*2**8+this[++O]*2**16+this[++O]*2**24)}),v.prototype.readBigInt64BE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=(N<<24)+this[++O]*2**16+this[++O]*2**8+this[++O];return(BigInt(ee)<<BigInt(32))+BigInt(this[++O]*2**24+this[++O]*2**16+this[++O]*2**8+$)}),v.prototype.readFloatLE=function(O,N){return O=O>>>0,N||b(O,4,this.length),n.read(this,O,!0,23,4)},v.prototype.readFloatBE=function(O,N){return O=O>>>0,N||b(O,4,this.length),n.read(this,O,!1,23,4)},v.prototype.readDoubleLE=function(O,N){return O=O>>>0,N||b(O,8,this.length),n.read(this,O,!0,52,8)},v.prototype.readDoubleBE=function(O,N){return O=O>>>0,N||b(O,8,this.length),n.read(this,O,!1,52,8)};function M(O,N,$,ee,re,se){if(!v.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>re||N<se)throw new RangeError('"value" argument is out of bounds');if($+ee>O.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(O,N,$,ee){if(O=+O,N=N>>>0,$=$>>>0,!ee){let ce=Math.pow(2,8*$)-1;M(this,O,N,$,ce,0)}let re=1,se=0;for(this[N]=O&255;++se<$&&(re*=256);)this[N+se]=O/re&255;return N+$},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(O,N,$,ee){if(O=+O,N=N>>>0,$=$>>>0,!ee){let ce=Math.pow(2,8*$)-1;M(this,O,N,$,ce,0)}let re=$-1,se=1;for(this[N+re]=O&255;--re>=0&&(se*=256);)this[N+re]=O/se&255;return N+$},v.prototype.writeUint8=v.prototype.writeUInt8=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,1,255,0),this[N]=O&255,N+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,65535,0),this[N]=O&255,this[N+1]=O>>>8,N+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,65535,0),this[N]=O>>>8,this[N+1]=O&255,N+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,4294967295,0),this[N+3]=O>>>24,this[N+2]=O>>>16,this[N+1]=O>>>8,this[N]=O&255,N+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,4294967295,0),this[N]=O>>>24,this[N+1]=O>>>16,this[N+2]=O>>>8,this[N+3]=O&255,N+4};function k(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,$}function D(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$+7]=se,se=se>>8,O[$+6]=se,se=se>>8,O[$+5]=se,se=se>>8,O[$+4]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$+3]=ce,ce=ce>>8,O[$+2]=ce,ce=ce>>8,O[$+1]=ce,ce=ce>>8,O[$]=ce,$+8}v.prototype.writeBigUInt64LE=mt(function(O,N=0){return k(this,O,N,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=mt(function(O,N=0){return D(this,O,N,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(O,N,$,ee){if(O=+O,N=N>>>0,!ee){let st=Math.pow(2,8*$-1);M(this,O,N,$,st-1,-st)}let re=0,se=1,ce=0;for(this[N]=O&255;++re<$&&(se*=256);)O<0&&ce===0&&this[N+re-1]!==0&&(ce=1),this[N+re]=(O/se>>0)-ce&255;return N+$},v.prototype.writeIntBE=function(O,N,$,ee){if(O=+O,N=N>>>0,!ee){let st=Math.pow(2,8*$-1);M(this,O,N,$,st-1,-st)}let re=$-1,se=1,ce=0;for(this[N+re]=O&255;--re>=0&&(se*=256);)O<0&&ce===0&&this[N+re+1]!==0&&(ce=1),this[N+re]=(O/se>>0)-ce&255;return N+$},v.prototype.writeInt8=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,1,127,-128),O<0&&(O=255+O+1),this[N]=O&255,N+1},v.prototype.writeInt16LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,32767,-32768),this[N]=O&255,this[N+1]=O>>>8,N+2},v.prototype.writeInt16BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,32767,-32768),this[N]=O>>>8,this[N+1]=O&255,N+2},v.prototype.writeInt32LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,2147483647,-2147483648),this[N]=O&255,this[N+1]=O>>>8,this[N+2]=O>>>16,this[N+3]=O>>>24,N+4},v.prototype.writeInt32BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,2147483647,-2147483648),O<0&&(O=4294967295+O+1),this[N]=O>>>24,this[N+1]=O>>>16,this[N+2]=O>>>8,this[N+3]=O&255,N+4},v.prototype.writeBigInt64LE=mt(function(O,N=0){return k(this,O,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=mt(function(O,N=0){return D(this,O,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(O,N,$,ee,re,se){if($+ee>O.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function W(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,4,34028234663852886e22,-34028234663852886e22),n.write(O,N,$,ee,23,4),$+4}v.prototype.writeFloatLE=function(O,N,$){return W(this,O,N,!0,$)},v.prototype.writeFloatBE=function(O,N,$){return W(this,O,N,!1,$)};function X(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,8,17976931348623157e292,-17976931348623157e292),n.write(O,N,$,ee,52,8),$+8}v.prototype.writeDoubleLE=function(O,N,$){return X(this,O,N,!0,$)},v.prototype.writeDoubleBE=function(O,N,$){return X(this,O,N,!1,$)},v.prototype.copy=function(O,N,$,ee){if(!v.isBuffer(O))throw new TypeError("argument should be a Buffer");if($||($=0),!ee&&ee!==0&&(ee=this.length),N>=O.length&&(N=O.length),N||(N=0),ee>0&&ee<$&&(ee=$),ee===$||O.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("sourceEnd out of bounds");ee>this.length&&(ee=this.length),O.length-N<ee-$&&(ee=O.length-N+$);let re=ee-$;return this===O&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(N,$,ee):Uint8Array.prototype.set.call(O,this.subarray($,ee),N),re},v.prototype.fill=function(O,N,$,ee){if(typeof O=="string"){if(typeof N=="string"?(ee=N,N=0,$=this.length):typeof $=="string"&&(ee=$,$=this.length),ee!==void 0&&typeof ee!="string")throw new TypeError("encoding must be a string");if(typeof ee=="string"&&!v.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee);if(O.length===1){let se=O.charCodeAt(0);(ee==="utf8"&&se<128||ee==="latin1")&&(O=se)}}else typeof O=="number"?O=O&255:typeof O=="boolean"&&(O=Number(O));if(N<0||this.length<N||this.length<$)throw new RangeError("Out of range index");if($<=N)return this;N=N>>>0,$=$===void 0?this.length:$>>>0,O||(O=0);let re;if(typeof O=="number")for(re=N;re<$;++re)this[re]=O;else{let se=v.isBuffer(O)?O:v.from(O,ee),ce=se.length;if(ce===0)throw new TypeError('The value "'+O+'" is invalid for argument "value"');for(re=0;re<$-N;++re)this[re+N]=se[re%ce]}return this};var V={};function Y(O,N,$){V[O]=class extends ${constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ee,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(O,N){return`The "${O}" argument must be of type number. Received type ${typeof N}`},TypeError),Y("ERR_OUT_OF_RANGE",function(O,N,$){let ee=`The value of "${O}" is out of range.`,re=$;return Number.isInteger($)&&Math.abs($)>2**32?re=ae(String($)):typeof $=="bigint"&&(re=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(re=ae(re)),re+="n"),ee+=` It must be ${N}. Received ${re}`,ee},RangeError);function ae(O){let N="",$=O.length,ee=O[0]==="-"?1:0;for(;$>=ee+4;$-=3)N=`_${O.slice($-3,$)}${N}`;return`${O.slice(0,$)}${N}`}function te(O,N,$){Z(N,"offset"),(O[N]===void 0||O[N+$]===void 0)&&ie(N,O.length-($+1))}function U(O,N,$,ee,re,se){if(O>$||O<N){let ce=typeof N=="bigint"?"n":"",st;throw se>3?N===0||N===BigInt(0)?st=`>= 0${ce} and < 2${ce} ** ${(se+1)*8}${ce}`:st=`>= -(2${ce} ** ${(se+1)*8-1}${ce}) and < 2 ** ${(se+1)*8-1}${ce}`:st=`>= ${N}${ce} and <= ${$}${ce}`,new V.ERR_OUT_OF_RANGE("value",st,O)}te(ee,re,se)}function Z(O,N){if(typeof O!="number")throw new V.ERR_INVALID_ARG_TYPE(N,"number",O)}function ie(O,N,$){throw Math.floor(O)!==O?(Z(O,$),new V.ERR_OUT_OF_RANGE($||"offset","an integer",O)):N<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${N}`,O)}var fe=/[^+/0-9A-Za-z-_]/g;function de(O){if(O=O.split("=")[0],O=O.trim().replace(fe,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function he(O,N){N=N||1/0;let $,ee=O.length,re=null,se=[];for(let ce=0;ce<ee;++ce){if($=O.charCodeAt(ce),$>55295&&$<57344){if(!re){if($>56319){(N-=3)>-1&&se.push(239,191,189);continue}else if(ce+1===ee){(N-=3)>-1&&se.push(239,191,189);continue}re=$;continue}if($<56320){(N-=3)>-1&&se.push(239,191,189),re=$;continue}$=(re-55296<<10|$-56320)+65536}else re&&(N-=3)>-1&&se.push(239,191,189);if(re=null,$<128){if((N-=1)<0)break;se.push($)}else if($<2048){if((N-=2)<0)break;se.push($>>6|192,$&63|128)}else if($<65536){if((N-=3)<0)break;se.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((N-=4)<0)break;se.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return se}function pe(O){let N=[];for(let $=0;$<O.length;++$)N.push(O.charCodeAt($)&255);return N}function De(O,N){let $,ee,re,se=[];for(let ce=0;ce<O.length&&!((N-=2)<0);++ce)$=O.charCodeAt(ce),ee=$>>8,re=$%256,se.push(re),se.push(ee);return se}function Ae(O){return t.toByteArray(de(O))}function _e(O,N,$,ee){let re;for(re=0;re<ee&&!(re+$>=N.length||re>=O.length);++re)N[re+$]=O[re];return re}function ut(O,N){return O instanceof N||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===N.name}function qe(O){return O!==O}var Te=function(){let O="0123456789abcdef",N=new Array(256);for(let $=0;$<16;++$){let ee=$*16;for(let re=0;re<16;++re)N[ee+re]=O[$]+O[re]}return N}();function mt(O){return typeof BigInt>"u"?ne:O}function ne(){throw new Error("BigInt not supported")}}),a7e=uh((e,t)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,t.exports={Buffer:F9().Buffer,Crypto:window.crypto}):t.exports={Buffer:F9().Buffer,Crypto:crypto}}),Yz={};Qwe(Yz,{AVSCTap:()=>Gv,ArweaveSigner:()=>p_,DataItem:()=>Hv,MAX_TAG_BYTES:()=>Yy,MIN_BINARY_SIZE:()=>g_,SIG_CONFIG:()=>jd,SignatureConfig:()=>hs,Signer:()=>Jz,createData:()=>tH,deserializeTags:()=>qy,indexToType:()=>v_,serializeTags:()=>m_,tagsExceedLimit:()=>eH});var Jz=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,t,n,f){throw new Error("You must implement verify method on child")}},o7e=O0(d_(),1),bf=O0(Gz(),1);async function Xz(e){if(Array.isArray(e)){let a=(0,bf.concatBuffers)([(0,bf.stringToBuffer)("list"),(0,bf.stringToBuffer)(e.length.toString())]);return await Qz(e,await ah().hash(a,"SHA-384"))}let t=e,n=(0,bf.concatBuffers)([(0,bf.stringToBuffer)("blob"),(0,bf.stringToBuffer)(t.byteLength.toString())]),f=(0,bf.concatBuffers)([await ah().hash(n,"SHA-384"),await ah().hash(t,"SHA-384")]);return await ah().hash(f,"SHA-384")}async function Qz(e,t){if(e.length<1)return t;let n=(0,bf.concatBuffers)([t,await Xz(e[0])]),f=await ah().hash(n,"SHA-384");return await Qz(e.slice(1),f)}var y9=O0(i7e(),1),s7e=y9.default.default?y9.default.default:y9.default,f7e=class extends s7e{getPublicKey(e){throw new Error("Unimplemented")}},u7e;function ah(){return u7e??=new f7e}var hs;(function(e){e[e.ARWEAVE=1]="ARWEAVE",e[e.ED25519=2]="ED25519",e[e.ETHEREUM=3]="ETHEREUM",e[e.SOLANA=4]="SOLANA",e[e.INJECTEDAPTOS=5]="INJECTEDAPTOS",e[e.MULTIAPTOS=6]="MULTIAPTOS",e[e.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(hs||(hs={}));var jd={[hs.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[hs.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[hs.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[hs.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[hs.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[hs.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[hs.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},p_=class{signatureType=1;ownerLength=jd[1].pubLength;signatureLength=jd[1].sigLength;jwk;pk;constructor(e){this.pk=e.n,this.jwk=e}get publicKey(){return o7e.default.toBuffer(this.pk)}sign(e){return ah().sign(this.jwk,e)}static async verify(e,t,n){return await ah().verify(e,t,n)}},v_={1:p_},uu=O0(d_(),1);async function z9(e){return Xz([(0,bf.stringToBuffer)("dataitem"),(0,bf.stringToBuffer)("1"),(0,bf.stringToBuffer)(e.signatureType.toString()),e.rawOwner,e.rawTarget,e.rawAnchor,e.rawTags,e.rawData])}async function h7e(e,t){let n=await z9(e),f=await t.sign(n),a=await ah().hash(f);return{signature:St.from(f),id:St.from(a)}}async function l7e(e,t){let{signature:n,id:f}=await h7e(e,t);return e.getRaw().set(n,2),f}var Gv=class{buf;pos;constructor(e=St.alloc(Yy),t=0){this.buf=e,this.pos=t}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let t=e.length,n;if(t)for(this.writeLong(t),n=0;n<t;n++){let f=e[n];if(f?.name===void 0||f?.value===void 0)throw new Error(`Invalid tag format for ${f}, expected {name:string, value: string}`);this.writeString(f.name),this.writeString(f.value)}this.writeLong(0)}toBuffer(){let e=St.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(e){let t=this.buf,n,f;if(e>=-1073741824&&e<1073741824){f=e>=0?e<<1:~e<<1|1;do t[this.pos]=f&127,f>>=7;while(f&&(t[this.pos++]|=128))}else{n=e>=0?e*2:-e*2-1;do t[this.pos]=n&127,n/=128;while(n>=1&&(t[this.pos++]|=128))}this.pos++,this.buf=t}writeString(e){let t=St.byteLength(e),n=this.buf;this.writeLong(t);let f=this.pos;if(this.pos+=t,!(this.pos>n.length)){if(t>64)this.buf.write(e,this.pos-t,t,"utf8");else{let a,d,l,v;for(a=0,d=t;a<d;a++)l=e.charCodeAt(a),l<128?n[f++]=l:l<2048?(n[f++]=l>>6|192,n[f++]=l&63|128):(l&64512)===55296&&((v=e.charCodeAt(a+1))&64512)===56320?(l=65536+((l&1023)<<10)+(v&1023),a++,n[f++]=l>>18|240,n[f++]=l>>12&63|128,n[f++]=l>>6&63|128,n[f++]=l&63|128):(n[f++]=l>>12|224,n[f++]=l>>6&63|128,n[f++]=l&63|128)}this.buf=n}}readLong(){let e=0,t=0,n=this.buf,f,a,d,l;do f=n[this.pos++],a=f&128,e|=(f&127)<<t,t+=7;while(a&&t<28);if(a){d=e,l=268435456;do f=n[this.pos++],d+=(f&127)*l,l*=128;while(f&128);return(d%2?-(d+1):d)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],t;for(;t=this.readLong();)for(t<0&&(t=-t,this.skipLong());t--;){let n=this.readString(),f=this.readString();e.push({name:n,value:f})}return e}readString(){let e=this.readLong(),t=this.pos,n=this.buf;if(this.pos+=e,!(this.pos>n.length))return this.buf.slice(t,t+e).toString()}};function m_(e){let t=new Gv;return t.writeTags(e),t.toBuffer()}function eH(e){let t=new Gv;return t.writeTags(e),t.tagsExceedLimit()}function qy(e){return new Gv(e).readTags()}function Vh(e){let t=0;for(let n=e.length-1;n>=0;n--)t=t*256+e[n];return t}function c7e(e){if(e>29)throw new Error("Short too long");let t=[0,0];for(let n=0;n<t.length;n++){let f=e&255;t[n]=f,e=(e-f)/256}return Uint8Array.from(t)}function gF(e){let t=[0,0,0,0,0,0,0,0];for(let n=0;n<t.length;n++){let f=e&255;t[n]=f,e=(e-f)/256}return Uint8Array.from(t)}var d7e=O0(a7e(),1),_d=O0(F9(),1),Yy=4096,g_=80,Hv=class{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=Vh(this.binary.subarray(0,2));if(hs?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return Hv.verify(this.binary)}get id(){return(async()=>uu.default.encode(await this.rawId))()}set id(e){this._id=uu.default.toBuffer(e)}get rawId(){return(async()=>_d.Buffer.from(await d7e.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return uu.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return jd[this.signatureType].sigLength}get owner(){return uu.default.encode(this.rawOwner)}get ownerLength(){return jd[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):_d.Buffer.alloc(0)}get target(){return uu.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):_d.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let e=this.getTagsStart(),t=Vh(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+t)}get tags(){let e=this.getTagsStart();if(Vh(this.binary.subarray(e,e+8))==0)return[];let t=Vh(this.binary.subarray(e+8,e+16));return qy(_d.Buffer.from(this.binary.subarray(e+16,e+16+t)))}get tagsB64Url(){return this.tags.map(e=>({name:uu.default.encode(e.name),value:uu.default.encode(e.value)}))}getStartOfData(){let e=this.getTagsStart(),t=this.binary.subarray(e+8,e+16),n=Vh(t);return e+16+n}get rawData(){let e=this.getTagsStart(),t=this.binary.subarray(e+8,e+16),n=Vh(t),f=e+16+n;return this.binary.subarray(f,this.binary.length)}get data(){return uu.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await l7e(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=_d.Buffer.from(await ah().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:uu.default.encode(e.name),value:uu.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<g_)return!1;let t=new Hv(e),n=t.signatureType,f=t.getTagsStart(),a=Vh(e.subarray(f,f+8)),d=e.subarray(f+8,f+16),l=Vh(d);if(l>Yy)return!1;if(a>0)try{if(qy(_d.Buffer.from(e.subarray(f+16,f+16+l))).length!==a)return!1}catch{return!1}let v=v_[n],w=await z9(t);return await v.verify(t.rawOwner,w,t.rawSignature)}async getSignatureData(){return z9(this)}getTagsStart(){let e=this.getTargetStart(),t=this.binary[e]==1,n=e+(t?33:1),f=this.binary[n]==1;return n+=f?33:1,n}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,t=this.binary[this.getTargetStart()]==1;return e+=t?32:0,e}},p7e=O0(d_(),1);function tH(e,t,n){let f=t.publicKey,a=n?.target?p7e.default.toBuffer(n.target):null,d=1+(a?.byteLength??0),l=n?.anchor?St.from(n.anchor):null,v=1+(l?.byteLength??0),w=(n?.tags?.length??0)>0?m_(n.tags):null,m=16+(w?w.byteLength:0),y=St.from(e),g=y.byteLength,S=2+t.signatureLength+t.ownerLength+d+v+m+g,x=St.alloc(S);if(x.set(c7e(t.signatureType),0),x.set(new Uint8Array(t.signatureLength).fill(0),2),f.byteLength!==t.ownerLength)throw new Error(`Owner must be ${t.ownerLength} bytes, but was incorrectly ${f.byteLength}`);x.set(f,2+t.signatureLength);let A=2+t.signatureLength+t.ownerLength;if(x[A]=a?1:0,a){if(a.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${a.byteLength}`);x.set(a,A+1)}let T=A+d,I=T+1;if(x[T]=l?1:0,l){if(I+=l.byteLength,l.byteLength!==32)throw new Error("Anchor must be 32 bytes");x.set(l,T+1)}x.set(gF(n?.tags?.length??0),I);let B=gF(w?.byteLength??0);x.set(B,I+8),w&&x.set(w,I+16);let P=I+m;return x.set(y,P),new Hv(x)}var y_={...Yz};globalThis.arbundles??=y_;var v7e=y_,m7e=y_;globalThis.Buffer||(globalThis.Buffer=Zz.Buffer);var{DataItem:g7e}=Wz;function y7e(e){return async({data:n,tags:f,target:a,anchor:d,createDataItem:l=v=>new g7e(v)})=>{let v=await e.signDataItem({data:n,tags:f,target:a,anchor:d}),w=l(Zz.Buffer.from(v));return{id:await w.id,raw:await w.getRaw()}}}var b7e=globalThis.GATEWAY_URL||void 0,w7e=globalThis.MU_URL||void 0,_7e=globalThis.CU_URL||void 0,M7e=globalThis.GRAPHQL_URL||void 0,{result:DKe,results:$Ke,message:UKe,spawn:qKe,monitor:jKe,unmonitor:FKe,dryrun:zKe,assign:HKe}=Fd({GATEWAY_URL:b7e,MU_URL:w7e,CU_URL:_7e,GRAPHQL_URL:M7e}),rH=Kz.createDataItemSigner;var qre=Cc(z4(),1);Be();Pe();Oe();var Ure=Cc($re(),1),tm=Ure.default.init({host:"arweave.net",port:443,protocol:"https"});async function hYe({signer:e,module:t=OO,luaCodeTxId:n=K4,ao:f=Fd(),scheduler:a=PO,state:d,stateContractTxId:l}){let v=await tm.transactions.getData(n,{decode:!0,string:!0}),w=await f.spawn({module:t,scheduler:a,signer:e}),m=new Ws({processId:w,ao:f});return await m.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:n}],data:v,signer:e}),d&&await m.send({tags:[{name:"Action",value:"Initialize-State"},...l!==void 0?[{name:"State-Contract-TX-ID",value:l}]:[]],data:JSON.stringify(d),signer:e}),w}async function lYe({signer:e,processId:t,luaCodeTxId:n=K4,ao:f=Fd()}){let a=new Ws({processId:t,ao:f}),d=await tm.transactions.getData(n,{decode:!0,string:!0}),{id:l}=await a.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:n}],data:d,signer:e});return l}function A1(e){return"publicKey"in e?async({data:n,tags:f,target:a,anchor:d})=>{e.publicKey===void 0&&"setPublicKey"in e&&typeof e.setPublicKey=="function"&&await e.setPublicKey();let l=(0,qre.createData)(n,e,{tags:f,target:a,anchor:d});return l.sign(e).then(async()=>({id:await l.id,raw:await l.getRaw()}))}:rH(e)}var rm=class{static init({signer:t,...n}){if($c(n)||Uc(n))return t?new xk({signer:t,...n}):new s8(n);throw new $h}},s8=class{process;constructor(t){if($c(t))this.process=t.process;else if(Uc(t))this.process=new Ws({processId:t.processId});else throw new $h}async getState(){let t=[{name:"Action",value:"State"}];return await this.process.read({tags:t})}async getInfo(){let t=[{name:"Action",value:"Info"}];return await this.process.read({tags:t})}async getRecord({undername:t}){let n=[{name:"Sub-Domain",value:t},{name:"Action",value:"Record"}];return await this.process.read({tags:n})}async getRecords(){let t=[{name:"Action",value:"Records"}];return await this.process.read({tags:t})}async getOwner(){return(await this.getInfo()).Owner}async getControllers(){let t=[{name:"Action",value:"Controllers"}];return await this.process.read({tags:t})}async getName(){return(await this.getInfo()).Name}async getTicker(){return(await this.getInfo()).Ticker}async getBalances(){let t=[{name:"Action",value:"Balances"}];return await this.process.read({tags:t})}async getBalance({address:t}){let n=[{name:"Action",value:"Balance"},{name:"Recipient",value:t}];return await this.process.read({tags:n})}},xk=class extends s8{signer;constructor({signer:t,...n}){super(n),this.signer=A1(t)}async transfer({target:t}){let n=[{name:"Action",value:"Transfer"},{name:"Recipient",value:t}];return this.process.send({tags:n,data:{},signer:this.signer})}async addController({controller:t}){let n=[{name:"Action",value:"Add-Controller"},{name:"Controller",value:t}];return this.process.send({tags:n,data:{},signer:this.signer})}async removeController({controller:t}){let n=[{name:"Action",value:"Remove-Controller"},{name:"Controller",value:t}];return this.process.send({tags:n,data:{},signer:this.signer})}async setRecord({undername:t,transactionId:n,ttlSeconds:f}){return this.process.send({tags:[{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:t},{name:"Transaction-Id",value:n},{name:"TTL-Seconds",value:f.toString()}],data:{transactionId:n,ttlSeconds:f},signer:this.signer})}async removeRecord({undername:t}){return this.process.send({tags:[{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:t}],data:{undername:t},signer:this.signer})}async setTicker({ticker:t}){return this.process.send({tags:[{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:t}],data:{ticker:t},signer:this.signer})}async setName({name:t}){return this.process.send({tags:[{name:"Action",value:"Set-Name"},{name:"Name",value:t}],data:{name:t},signer:this.signer})}};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function Rk(e){try{return JSON.parse(e)}catch{return e}}var Ws=class{logger;processId;ao;constructor({processId:t,ao:n=Fd(),logger:f=rh.default}){this.processId=t,this.logger=f,this.ao=n}async read({tags:t,retries:n=3}){let f=0,a;for(;f<n;)try{this.logger.debug("Evaluating read interaction on contract",{tags:t});let d=await this.ao.dryrun({process:this.processId,tags:t});if(d.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);let v=d.Messages[0].Tags.find(m=>m.name==="Error");if(v)throw new Error(`${v.Value}: ${d.Messages[0].Data}`);return this.logger.debug("Read interaction result",{result:d.Messages[0].Data}),d.Messages[0].Data===void 0?{}:Rk(d.Messages[0].Data)}catch(d){f++,this.logger.debug(`Read attempt ${f} failed`,{error:d,tags:t}),a=d,await new Promise(l=>setTimeout(l,2**f*1e3))}throw a}async send({tags:t,data:n,signer:f,retries:a=3}){let d=0,l;for(;d<a;)try{this.logger.debug("Evaluating send interaction on contract",{tags:t,data:n,processId:this.processId});let v=await this.ao.message({process:this.processId,tags:[...t,{name:"AR-IO-SDK",value:bd}],data:typeof n!="string"?JSON.stringify(n):n,signer:f});this.logger.debug("Sent message to process",{messageId:v,processId:this.processId});let w=await this.ao.result({message:v,process:this.processId});if(this.logger.debug("Message result",{output:w,messageId:v,processId:this.processId}),w.Messages?.length===0||w.Messages===void 0)return{id:v};let y=w.Messages[0].Tags.find(S=>S.name==="Error");if(y){let S=w.Messages[0].Data;throw new gg(`${y.Value}: ${S}`)}if(w.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(w.Messages[0].Data===void 0)return{id:v};let g=Rk(w.Messages[0].Data);return this.logger.debug("Message result data",{resultData:g,messageId:v,processId:this.processId}),{id:v,result:g}}catch(v){if(this.logger.error("Error sending message to process",{error:v.message,processId:this.processId,tags:t}),v.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:d,retries:a,error:v.message,processId:this.processId}),await new Promise(w=>setTimeout(w,2**d*2e3)),d++,l=v;else throw v}throw l}};var x1=class{static init(t){if(t&&t.signer){let{signer:n,...f}=t;return new kk({...f,signer:n})}return new f8(t)}},f8=class{process;arweave;constructor(t,n=tm){if(!t)this.process=new Ws({processId:zl});else if($c(t))this.process=t.process;else if(Uc(t))this.process=new Ws({processId:t.processId});else throw new $h;this.arweave=n}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async getEpochSettings(t){let f=[{name:"Action",value:"Epoch-Settings"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getEpoch(t){let f=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getArNSRecord({name:t}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:t}]})}async getArNSRecords(t){let f=[{name:"Action",value:"Paginated-Records"},{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy},{name:"Sort-Order",value:t?.sortOrder}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getArNSReservedNames(){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"}]})}async getArNSReservedName({name:t}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:t}]})}async getBalance({address:t}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:t}]})}async getBalances(t){let f=[{name:"Action",value:"Paginated-Balances"},{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy},{name:"Sort-Order",value:t?.sortOrder}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getGateway({address:t}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:t}]})}async getGateways(t){let f=[{name:"Action",value:"Paginated-Gateways"},{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy},{name:"Sort-Order",value:t?.sortOrder}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(t=>({timestamp:t.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}]})}async getPrescribedObservers(t){let f=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getPrescribedNames(t){let f=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getObservations(t){let f=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:`${Date.now()}`}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getDistributions(t){let f=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getTokenCost({intent:t,purchaseType:n,years:f,name:a,quantity:d}){let v=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:t},{name:"Name",value:a},{name:"Years",value:f?.toString()},{name:"Quantity",value:d?.toString()},{name:"Purchase-Type",value:n},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(w=>({timestamp:w.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}].filter(w=>w.value!==void 0);return this.process.read({tags:v})}},kk=class extends f8{signer;constructor({signer:t,...n}){if(Object.keys(n).length===0)super({process:new Ws({processId:zl})}),this.signer=A1(t);else if($c(n))super({process:n.process}),this.signer=A1(t);else if(Uc(n))super({process:new Ws({processId:n.processId})}),this.signer=A1(t);else throw new $h}async transfer({target:t,qty:n},f){let{tags:a=[]}=f||{};return this.process.send({tags:[...a,{name:"Action",value:"Transfer"},{name:"Recipient",value:t},{name:"Quantity",value:n.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:t,allowDelegatedStaking:n,delegateRewardShareRatio:f,fqdn:a,label:d,minDelegatedStake:l,note:v,port:w,properties:m,protocol:y,autoStake:g,observerAddress:S},x){let{tags:A=[]}=x||{},I=[...A,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:t.valueOf().toString()},{name:"Allow-Delegated-Staking",value:n.toString()},{name:"Delegate-Reward-Share-Ratio",value:f.toString()},{name:"FQDN",value:a},{name:"Label",value:d},{name:"Min-Delegated-Stake",value:l.valueOf().toString()},{name:"Note",value:v},{name:"Port",value:w.toString()},{name:"Properties",value:m},{name:"Protocol",value:y},{name:"Auto-Stake",value:g.toString()},{name:"Observer-Address",value:S}].filter(B=>B.value!==void 0);return this.process.send({signer:this.signer,tags:I})}async leaveNetwork(t){let{tags:n=[]}=t||{};return this.process.send({signer:this.signer,tags:[...n,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:t,delegateRewardShareRatio:n,fqdn:f,label:a,minDelegatedStake:d,note:l,port:v,properties:w,protocol:m,autoStake:y,observerAddress:g},S){let{tags:x=[]}=S||{},T=[...x,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:a},{name:"Note",value:l},{name:"FQDN",value:f},{name:"Port",value:v?.toString()},{name:"Properties",value:w},{name:"Protocol",value:m},{name:"Observer-Address",value:g},{name:"Allow-Delegated-Staking",value:t?.toString()},{name:"Delegate-Reward-Share-Ratio",value:n?.toString()},{name:"Min-Delegated-Stake",value:d?.valueOf().toString()},{name:"Auto-Stake",value:y?.toString()}].filter(I=>I.value!==void 0);return this.process.send({signer:this.signer,tags:T})}async delegateStake(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:t.target},{name:"Quantity",value:t.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:t.target},{name:"Quantity",value:t.decreaseQty.valueOf().toString()}]})}async increaseOperatorStake(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:t.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:t.decreaseQty.valueOf().toString()}]})}async saveObservations(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:t.reportTxId},{name:"Failed-Gateways",value:t.failedGateways.join(",")}],data:{reportTxId:t.reportTxId,failedGateways:t.failedGateways}})}async buyRecord(t,n){let{tags:f=[]}=n||{},d=[...f,{name:"Action",value:"Buy-Record"},{name:"Name",value:t.name},{name:"Years",value:t.years?.toString()??"1"},{name:"Process-Id",value:t.processId},{name:"Purchase-Type",value:t.type||"lease"}].filter(l=>l.value!==void 0);return this.process.send({signer:this.signer,tags:d})}async extendLease(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Extend-Lease"},{name:"Name",value:t.name},{name:"Years",value:t.years.toString()}]})}async increaseUndernameLimit(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:t.name},{name:"Quantity",value:t.increaseCount.toString()}]})}};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function im(e,t){return function(){return e.apply(t,arguments)}}var{toString:_Ie}=Object.prototype,{getPrototypeOf:Bk}=Object,h8=(e=>t=>{let n=_Ie.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Kf=e=>(e=e.toLowerCase(),t=>h8(t)===e),l8=e=>t=>typeof t===e,{isArray:R1}=Array,nm=l8("undefined");function MIe(e){return e!==null&&!nm(e)&&e.constructor!==null&&!nm(e.constructor)&&Vs(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var zre=Kf("ArrayBuffer");function SIe(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zre(e.buffer),t}var EIe=l8("string"),Vs=l8("function"),Hre=l8("number"),c8=e=>e!==null&&typeof e=="object",AIe=e=>e===!0||e===!1,u8=e=>{if(h8(e)!=="object")return!1;let t=Bk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},xIe=Kf("Date"),RIe=Kf("File"),kIe=Kf("Blob"),TIe=Kf("FileList"),IIe=e=>c8(e)&&Vs(e.pipe),BIe=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Vs(e.append)&&((t=h8(e))==="formdata"||t==="object"&&Vs(e.toString)&&e.toString()==="[object FormData]"))},OIe=Kf("URLSearchParams"),[PIe,NIe,CIe,LIe]=["ReadableStream","Request","Response","Headers"].map(Kf),DIe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function am(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let f,a;if(typeof e!="object"&&(e=[e]),R1(e))for(f=0,a=e.length;f<a;f++)t.call(null,e[f],f,e);else{let d=n?Object.getOwnPropertyNames(e):Object.keys(e),l=d.length,v;for(f=0;f<l;f++)v=d[f],t.call(null,e[v],v,e)}}function Kre(e,t){t=t.toLowerCase();let n=Object.keys(e),f=n.length,a;for(;f-- >0;)if(a=n[f],t===a.toLowerCase())return a;return null}var Zre=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wre=e=>!nm(e)&&e!==Zre;function Ik(){let{caseless:e}=Wre(this)&&this||{},t={},n=(f,a)=>{let d=e&&Kre(t,a)||a;u8(t[d])&&u8(f)?t[d]=Ik(t[d],f):u8(f)?t[d]=Ik({},f):R1(f)?t[d]=f.slice():t[d]=f};for(let f=0,a=arguments.length;f<a;f++)arguments[f]&&am(arguments[f],n);return t}var $Ie=(e,t,n,{allOwnKeys:f}={})=>(am(t,(a,d)=>{n&&Vs(a)?e[d]=im(a,n):e[d]=a},{allOwnKeys:f}),e),UIe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qIe=(e,t,n,f)=>{e.prototype=Object.create(t.prototype,f),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},jIe=(e,t,n,f)=>{let a,d,l,v={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),d=a.length;d-- >0;)l=a[d],(!f||f(l,e,t))&&!v[l]&&(t[l]=e[l],v[l]=!0);e=n!==!1&&Bk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},FIe=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let f=e.indexOf(t,n);return f!==-1&&f===n},zIe=e=>{if(!e)return null;if(R1(e))return e;let t=e.length;if(!Hre(t))return null;let n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},HIe=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Bk(Uint8Array)),KIe=(e,t)=>{let f=(e&&e[Symbol.iterator]).call(e),a;for(;(a=f.next())&&!a.done;){let d=a.value;t.call(e,d[0],d[1])}},ZIe=(e,t)=>{let n,f=[];for(;(n=e.exec(t))!==null;)f.push(n);return f},WIe=Kf("HTMLFormElement"),VIe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,f,a){return f.toUpperCase()+a}),jre=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),GIe=Kf("RegExp"),Vre=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),f={};am(n,(a,d)=>{let l;(l=t(a,d,e))!==!1&&(f[d]=l||a)}),Object.defineProperties(e,f)},YIe=e=>{Vre(e,(t,n)=>{if(Vs(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let f=e[n];if(Vs(f)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},JIe=(e,t)=>{let n={},f=a=>{a.forEach(d=>{n[d]=!0})};return R1(e)?f(e):f(String(e).split(t)),n},XIe=()=>{},QIe=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Tk="abcdefghijklmnopqrstuvwxyz",Fre="0123456789",Gre={DIGIT:Fre,ALPHA:Tk,ALPHA_DIGIT:Tk+Tk.toUpperCase()+Fre},eBe=(e=16,t=Gre.ALPHA_DIGIT)=>{let n="",{length:f}=t;for(;e--;)n+=t[Math.random()*f|0];return n};function tBe(e){return!!(e&&Vs(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var rBe=e=>{let t=new Array(10),n=(f,a)=>{if(c8(f)){if(t.indexOf(f)>=0)return;if(!("toJSON"in f)){t[a]=f;let d=R1(f)?[]:{};return am(f,(l,v)=>{let w=n(l,a+1);!nm(w)&&(d[v]=w)}),t[a]=void 0,d}}return f};return n(e,0)},iBe=Kf("AsyncFunction"),nBe=e=>e&&(c8(e)||Vs(e))&&Vs(e.then)&&Vs(e.catch),Kt={isArray:R1,isArrayBuffer:zre,isBuffer:MIe,isFormData:BIe,isArrayBufferView:SIe,isString:EIe,isNumber:Hre,isBoolean:AIe,isObject:c8,isPlainObject:u8,isReadableStream:PIe,isRequest:NIe,isResponse:CIe,isHeaders:LIe,isUndefined:nm,isDate:xIe,isFile:RIe,isBlob:kIe,isRegExp:GIe,isFunction:Vs,isStream:IIe,isURLSearchParams:OIe,isTypedArray:HIe,isFileList:TIe,forEach:am,merge:Ik,extend:$Ie,trim:DIe,stripBOM:UIe,inherits:qIe,toFlatObject:jIe,kindOf:h8,kindOfTest:Kf,endsWith:FIe,toArray:zIe,forEachEntry:KIe,matchAll:ZIe,isHTMLForm:WIe,hasOwnProperty:jre,hasOwnProp:jre,reduceDescriptors:Vre,freezeMethods:YIe,toObjectSet:JIe,toCamelCase:VIe,noop:XIe,toFiniteNumber:QIe,findKey:Kre,global:Zre,isContextDefined:Wre,ALPHABET:Gre,generateString:eBe,isSpecCompliantForm:tBe,toJSONObject:rBe,isAsyncFn:iBe,isThenable:nBe};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function k1(e,t,n,f,a){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),n&&(this.config=n),f&&(this.request=f),a&&(this.response=a)}Kt.inherits(k1,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:Kt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Yre=k1.prototype,Jre={};["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=>{Jre[e]={value:e}});Object.defineProperties(k1,Jre);Object.defineProperty(Yre,"isAxiosError",{value:!0});k1.from=(e,t,n,f,a,d)=>{let l=Object.create(Yre);return Kt.toFlatObject(e,l,function(w){return w!==Error.prototype},v=>v!=="isAxiosError"),k1.call(l,e.message,t,n,f,a),l.cause=e,l.name=e.name,d&&Object.assign(l,d),l};var zr=k1;Be();Pe();Oe();var d8=null;function Ok(e){return Kt.isPlainObject(e)||Kt.isArray(e)}function Qre(e){return Kt.endsWith(e,"[]")?e.slice(0,-2):e}function Xre(e,t,n){return e?e.concat(t).map(function(a,d){return a=Qre(a),!n&&d?"["+a+"]":a}).join(n?".":""):t}function aBe(e){return Kt.isArray(e)&&!e.some(Ok)}var oBe=Kt.toFlatObject(Kt,{},null,function(t){return/^is[A-Z]/.test(t)});function sBe(e,t,n){if(!Kt.isObject(e))throw new TypeError("target must be an object");t=t||new(d8||FormData),n=Kt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,I){return!Kt.isUndefined(I[T])});let f=n.metaTokens,a=n.visitor||y,d=n.dots,l=n.indexes,w=(n.Blob||typeof Blob<"u"&&Blob)&&Kt.isSpecCompliantForm(t);if(!Kt.isFunction(a))throw new TypeError("visitor must be a function");function m(A){if(A===null)return"";if(Kt.isDate(A))return A.toISOString();if(!w&&Kt.isBlob(A))throw new zr("Blob is not supported. Use a Buffer instead.");return Kt.isArrayBuffer(A)||Kt.isTypedArray(A)?w&&typeof Blob=="function"?new Blob([A]):St.from(A):A}function y(A,T,I){let B=A;if(A&&!I&&typeof A=="object"){if(Kt.endsWith(T,"{}"))T=f?T:T.slice(0,-2),A=JSON.stringify(A);else if(Kt.isArray(A)&&aBe(A)||(Kt.isFileList(A)||Kt.endsWith(T,"[]"))&&(B=Kt.toArray(A)))return T=Qre(T),B.forEach(function(C,q){!(Kt.isUndefined(C)||C===null)&&t.append(l===!0?Xre([T],q,d):l===null?T:T+"[]",m(C))}),!1}return Ok(A)?!0:(t.append(Xre(I,T,d),m(A)),!1)}let g=[],S=Object.assign(oBe,{defaultVisitor:y,convertValue:m,isVisitable:Ok});function x(A,T){if(!Kt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+T.join("."));g.push(A),Kt.forEach(A,function(B,P){(!(Kt.isUndefined(B)||B===null)&&a.call(t,B,Kt.isString(P)?P.trim():P,T,S))===!0&&x(B,T?T.concat(P):[P])}),g.pop()}}if(!Kt.isObject(e))throw new TypeError("data must be an object");return x(e),t}var Nl=sBe;function eie(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(f){return t[f]})}function tie(e,t){this._pairs=[],e&&Nl(e,this,t)}var rie=tie.prototype;rie.append=function(t,n){this._pairs.push([t,n])};rie.toString=function(t){let n=t?function(f){return t.call(this,f,eie)}:eie;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};var p8=tie;function fBe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function om(e,t,n){if(!t)return e;let f=n&&n.encode||fBe,a=n&&n.serialize,d;if(a?d=a(t,n):d=Kt.isURLSearchParams(t)?t.toString():new p8(t,n).toString(f),d){let l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+d}return e}Be();Pe();Oe();var Pk=class{constructor(){this.handlers=[]}use(t,n,f){return this.handlers.push({fulfilled:t,rejected:n,synchronous:f?f.synchronous:!1,runWhen:f?f.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Kt.forEach(this.handlers,function(f){f!==null&&t(f)})}},Nk=Pk;Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var v8={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var iie=typeof URLSearchParams<"u"?URLSearchParams:p8;Be();Pe();Oe();var nie=typeof FormData<"u"?FormData:null;Be();Pe();Oe();var aie=typeof Blob<"u"?Blob:null;var oie={isBrowser:!0,classes:{URLSearchParams:iie,FormData:nie,Blob:aie},protocols:["http","https","file","blob","url","data"]};var Lk={};To(Lk,{hasBrowserEnv:()=>Ck,hasStandardBrowserEnv:()=>uBe,hasStandardBrowserWebWorkerEnv:()=>hBe,origin:()=>lBe});Be();Pe();Oe();var Ck=typeof window<"u"&&typeof document<"u",uBe=(e=>Ck&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),hBe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",lBe=Ck&&window.location.href||"http://localhost";var Ea={...Lk,...oie};function Dk(e,t){return Nl(e,new Ea.classes.URLSearchParams,Object.assign({visitor:function(n,f,a,d){return Ea.isNode&&Kt.isBuffer(n)?(this.append(f,n.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},t))}Be();Pe();Oe();function cBe(e){return Kt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function dBe(e){let t={},n=Object.keys(e),f,a=n.length,d;for(f=0;f<a;f++)d=n[f],t[d]=e[d];return t}function pBe(e){function t(n,f,a,d){let l=n[d++];if(l==="__proto__")return!0;let v=Number.isFinite(+l),w=d>=n.length;return l=!l&&Kt.isArray(a)?a.length:l,w?(Kt.hasOwnProp(a,l)?a[l]=[a[l],f]:a[l]=f,!v):((!a[l]||!Kt.isObject(a[l]))&&(a[l]=[]),t(n,f,a[l],d)&&Kt.isArray(a[l])&&(a[l]=dBe(a[l])),!v)}if(Kt.isFormData(e)&&Kt.isFunction(e.entries)){let n={};return Kt.forEachEntry(e,(f,a)=>{t(cBe(f),a,n,0)}),n}return null}var m8=pBe;function vBe(e,t,n){if(Kt.isString(e))try{return(t||JSON.parse)(e),Kt.trim(e)}catch(f){if(f.name!=="SyntaxError")throw f}return(n||JSON.stringify)(e)}var $k={transitional:v8,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let f=n.getContentType()||"",a=f.indexOf("application/json")>-1,d=Kt.isObject(t);if(d&&Kt.isHTMLForm(t)&&(t=new FormData(t)),Kt.isFormData(t))return a?JSON.stringify(m8(t)):t;if(Kt.isArrayBuffer(t)||Kt.isBuffer(t)||Kt.isStream(t)||Kt.isFile(t)||Kt.isBlob(t)||Kt.isReadableStream(t))return t;if(Kt.isArrayBufferView(t))return t.buffer;if(Kt.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let v;if(d){if(f.indexOf("application/x-www-form-urlencoded")>-1)return Dk(t,this.formSerializer).toString();if((v=Kt.isFileList(t))||f.indexOf("multipart/form-data")>-1){let w=this.env&&this.env.FormData;return Nl(v?{"files[]":t}:t,w&&new w,this.formSerializer)}}return d||a?(n.setContentType("application/json",!1),vBe(t)):t}],transformResponse:[function(t){let n=this.transitional||$k.transitional,f=n&&n.forcedJSONParsing,a=this.responseType==="json";if(Kt.isResponse(t)||Kt.isReadableStream(t))return t;if(t&&Kt.isString(t)&&(f&&!this.responseType||a)){let l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(v){if(l)throw v.name==="SyntaxError"?zr.from(v,zr.ERR_BAD_RESPONSE,this,null,this.response):v}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ea.classes.FormData,Blob:Ea.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Kt.forEach(["delete","get","head","post","put","patch"],e=>{$k.headers[e]={}});var T1=$k;Be();Pe();Oe();Be();Pe();Oe();var mBe=Kt.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"]),sie=e=>{let t={},n,f,a;return e&&e.split(`
|
|
193
|
+
}`,a=Jt.object({data:Jt.object({transactions:Jt.object({edges:Jt.array(Jt.object({node:Jt.record(Jt.any())}))})})});return d=>mi(d).chain(sn(l=>e(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:f,variables:{transactionIds:[l]}})}).then(async v=>{if(v.ok)return v.json();throw n('Error Encountered when querying gateway for transaction "%s"',l),new Error(`${v.status}: ${await v.text()}`)}).then(a.parse).then(K4e(["data","transactions","edges","0","node"])))).toPromise()}var rwe=K9(hye(),1),jz=(e="@permaweb/aoconnect")=>{let t=(0,rwe.default)(e);return t.child=n=>jz(`${t.namespace}:${n}`),t.tap=(n,...f)=>X4e((...a)=>t(n,...f,...a)),t},Fz=({url:e,path:t})=>t?t.startsWith("/")?Fz({url:e,path:t.slice(1)}):(e=new URL(e),e.pathname+=t,e.toString()):e;function iwe(e){return Ld(Vy([]),Cd((t,n)=>Ld(V4e([],n.name),s_(n.value),ps(n.name,sh,t))(t),{}),Zy(t=>t.length>1?t:t[0]))(e)}function ls(e,t){return n=>lz(i4e([dF(e,"name"),u_(o_(t),dF(t,"value"),i_)]),n)}function mF(e){return _z([[lv(String),Ad(e)],[lv(Array),L4e(e)],[i_,d8e]])}function B0(e){let t;return lv(cs,e)?(t=new Error(nwe(e)),t.stack+=e.stack):lv(Error,e)?t=e:P4e("message",e)?t=new Error(e.message):lv(String,e)?t=new Error(e):t=new Error("An error occurred"),t}function nwe(e){return Ld(t=>function n(f,a,d){return Cd((l,v)=>Ld(_z([[Ad(hr.invalid_arguments),()=>n(v.argumentsError,422,"Invalid Arguments")],[Ad(hr.invalid_return_type),()=>n(v.returnTypeError,500,"Invalid Return")],[Ad(hr.invalid_union),()=>b4e(w=>n(w,400,"Invalid Union"),v.unionErrors)],[i_,()=>[{...v,status:a,contextCode:d}]]]),f_(l))(v.code),[],f.issues)}(t,400,""),t=>Cd((n,f)=>{let{message:a,path:d,contextCode:l}=f,v=d[1]||d[0],w=l?`${l} `:"";return n.push(`${w}'${v}': ${a}.`),n},[],t),F4e(" | "))(e)}var awe=Jt.object({id:Jt.string().min(1,{message:"message is required to be a message id"}),processId:Jt.string().min(1,{message:"process is required to be a process id"})});function owe(){return e=>mi(e).map(awe.parse).map(()=>e)}var Vv=Jt.object({name:Jt.string(),value:Jt.string()}),swe=Jt.function().args(Jt.object({Id:Jt.string(),Target:Jt.string(),Owner:Jt.string(),Anchor:Jt.string().optional(),Data:Jt.any().default("1234"),Tags:Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}))})).returns(Jt.promise(Jt.any())),fwe=Jt.function().args(Jt.object({id:Jt.string().min(1,{message:"message id is required"}),processId:Jt.string().min(1,{message:"process id is required"})})).returns(Jt.promise(Jt.any())),uwe=Jt.function().args(Jt.object({process:Jt.string().min(1,{message:"process id is required"}),from:Jt.string().optional(),to:Jt.string().optional(),sort:Jt.enum(["ASC","DESC"]).default("ASC"),limit:Jt.number().optional()})).returns(Jt.promise(Jt.object({edges:Jt.array(Jt.object({cursor:Jt.string(),node:Jt.object({Output:Jt.any().optional(),Messages:Jt.array(Jt.any()).optional(),Spawns:Jt.array(Jt.any()).optional(),Error:Jt.any().optional()})}))}))),zz=Jt.function().args(Jt.object({processId:Jt.string(),data:Jt.any(),tags:Jt.array(Vv),anchor:Jt.string().optional(),signer:Jt.any()})).returns(Jt.promise(Jt.object({messageId:Jt.string()}).passthrough())),hwe=Jt.function().args(Jt.object({data:Jt.any(),tags:Jt.array(Vv),signer:Jt.any()})).returns(Jt.promise(Jt.object({processId:Jt.string()}).passthrough())),lwe=Jt.function().args(Jt.object({process:Jt.string(),message:Jt.string(),baseLayer:Jt.boolean().optional(),exclude:Jt.array(Jt.string()).optional()})).returns(Jt.promise(Jt.object({assignmentId:Jt.string()}).passthrough())),Hz=zz,CKe=Jt.function().args(Jt.object({suUrl:Jt.string().url(),processId:Jt.string()})).returns(Jt.promise(Jt.object({tags:Jt.array(Vv)}).passthrough())),LKe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.object({url:Jt.string()}))),cwe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.boolean())),dwe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.object({tags:Jt.array(Vv)}).passthrough())),Gy=Jt.function().args(Jt.object({data:Jt.any(),tags:Jt.array(Vv),target:Jt.string().optional(),anchor:Jt.string().optional()})).returns(Jt.promise(Jt.object({id:Jt.string(),raw:Jt.any()})));function pwe({loadResult:e}){return e=sn(fwe.implement(e)),t=>mi({id:t.id,processId:t.processId}).chain(e)}function vwe(e){let t=owe(e),n=pwe(e);return({message:f,process:a})=>mi({id:f,processId:a}).chain(t).chain(n).map(e.logger.tap('readResult result for message "%s": %O',f)).map(d=>d).bimap(B0,I0).toPromise()}var mwe=Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}));function gwe(){return e=>mi(e.tags).map(Vy([])).map(ls("Data-Protocol","ao")).map(ls("Variant")).map(ls("Type")).map(ls("SDK")).map(f_(sh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(mwe.parse).map(ps("tags",sh,e))}function ywe({logger:e}){return t=>mi(t).chain(u_(o_(t.data),()=>x0(t),()=>x0(Math.random().toString().slice(-4)).map(ps("data",sh,t)).map(n=>Ld(T0("tags"),ls("Content-Type"),s_({name:"Content-Type",value:"text/plain"}),ps("tags",sh,n))(n)).map(e.tap('added pseudo-random string as message "data"'))))}function bwe(e){let t=gwe(e),n=ywe(e),f=zz.implement(e.deployMessage);return a=>mi(a).chain(t).chain(n).chain(sn(({id:d,data:l,tags:v,anchor:w,signer:m})=>f({processId:d,data:l,tags:v,anchor:w,signer:Gy.implement(m)}))).map(d=>ps("messageId",d.messageId,a))}function wwe(e){let t=bwe(e);return({process:n,data:f,tags:a,anchor:d,signer:l})=>mi({id:n,data:f,tags:a,anchor:d,signer:l}).chain(t).map(v=>v.messageId).bimap(B0,I0).toPromise()}var tv=(e,t,n)=>f=>t(f[e])?x0(f):il(`Tag '${e}': ${n}`);function _we({loadTransactionMeta:e,logger:t}){return e=sn(dwe.implement(e)),n=>mi(n).chain(e).map(T0("tags")).map(iwe).chain(tv("Data-Protocol",mF("ao"),"value 'ao' was not found on module")).chain(tv("Type",mF("Module"),"value 'Module' was not found on module")).chain(tv("Module-Format",m9,"was not found on module")).chain(tv("Input-Encoding",m9,"was not found on module")).chain(tv("Output-Encoding",m9,"was not found on module")).bimap(t.tap("Verifying module source failed: %s"),t.tap("Verified module source"))}function Mwe({logger:e,validateScheduler:t}){return t=sn(cwe.implement(t)),n=>mi(n).chain(f=>t(f).chain(a=>a?x0(f):il(`Valid Scheduler-Location owned by ${f} not found`))).bimap(e.tap("Verifying scheduler failed: %s"),e.tap("Verified scheduler"))}function Swe({logger:e}){return t=>mi(t).map(e.tap("Checking for signer")).chain(n=>n?x0(n):il("signer not found"))}function Ewe(e){let t=e.logger.child("verifyInput");e={...e,logger:t};let n=_we(e),f=Mwe(e),a=Swe(e);return d=>mi(d).chain(l=>n(l.module).map(()=>l)).chain(l=>f(l.scheduler)).map(()=>d).chain(l=>a(l.signer).map(()=>l)).bimap(t.tap("Error when verify input: %s"),t.tap("Successfully verified inputs"))}var Awe=Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}));function xwe(){return e=>mi(e).map(T0("tags")).map(Vy([])).map(ls("Data-Protocol","ao")).map(ls("Variant")).map(ls("Type")).map(ls("Module")).map(ls("Scheduler")).map(ls("SDK")).map(f_(sh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:e.module},{name:"Scheduler",value:e.scheduler},{name:"SDK",value:"aoconnect"}])).map(Awe.parse).map(ps("tags",sh,e))}function Rwe({logger:e}){return t=>mi(t).chain(u_(o_(t.data),()=>x0(t),()=>x0(Math.random().toString().slice(-4)).map(ps("data",sh,t)).map(n=>Ld(T0("tags"),ls("Content-Type"),s_({name:"Content-Type",value:"text/plain"}),ps("tags",sh,n))(n)).map(e.tap('added pseudo-random string as process "data"'))))}function kwe(e){let t=e.logger.child("uploadProcess");e={...e,logger:t};let n=xwe(e),f=Rwe(e),a=hwe.implement(e.deployProcess);return d=>mi(d).chain(n).chain(f).chain(sn(({data:l,tags:v,signer:w})=>a({data:l,tags:v,signer:Gy.implement(w)}))).map(l=>ps("processId",l.processId,d))}function Twe(e){let t=Ewe(e),n=kwe(e);return({module:f,scheduler:a,signer:d,tags:l,data:v})=>mi({module:f,scheduler:a,signer:d,tags:l,data:v}).chain(t).chain(n).map(w=>w.processId).bimap(B0,I0).toPromise()}function Iwe(e){let t=Hz.implement(e.deployMonitor);return n=>mi(n).chain(sn(({id:f,signer:a})=>t({processId:f,signer:Gy.implement(a),data:Math.random().toString().slice(-4),tags:[]}))).map(f=>ps("monitorId",f.messageId,n))}function Bwe(e){let t=Iwe(e);return({process:n,signer:f})=>mi({id:n,signer:f}).chain(t).map(a=>a.monitorId).bimap(B0,I0).toPromise()}function Owe(e){let t=Hz.implement(e.deployUnmonitor);return n=>mi(n).chain(sn(({id:f,signer:a})=>t({processId:f,signer:Gy.implement(a),data:Math.random().toString().slice(-4),tags:[]}))).map(f=>ps("monitorId",f.messageId,n))}function Pwe(e){let t=Owe(e);return({process:n,signer:f})=>mi({id:n,signer:f}).chain(t).map(a=>a.monitorId).bimap(B0,I0).toPromise()}var Nwe=Jt.object({process:Jt.string().min(1,{message:"process identifier is required"}),from:Jt.string().optional(),to:Jt.string().optional(),sort:Jt.enum(["ASC","DESC"]).default("ASC"),limit:Jt.number().optional()});function Cwe(){return e=>mi(e).map(Nwe.parse).map(()=>e)}function Lwe({queryResults:e}){return e=sn(uwe.implement(e)),t=>mi({process:t.process,from:t.from,to:t.to,sort:t.sort,limit:t.limit}).chain(e)}function Dwe(e){let t=Cwe(e),n=Lwe(e);return({process:f,from:a,to:d,sort:l,limit:v})=>mi({process:f,from:a,to:d,sort:l,limit:v}).chain(t).chain(n).map(e.logger.tap('readResults result for message "%s": %O',f)).map(w=>w).bimap(B0,I0).toPromise()}var $we=Jt.object({Id:Jt.string(),Target:Jt.string(),Owner:Jt.string(),Anchor:Jt.string().optional(),Data:Jt.any().default("1234"),Tags:Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}))});function Uwe(){return e=>mi(e).map($we.parse).map(t=>(t.Tags=t.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),t))}function qwe({dryrunFetch:e}){return sn(swe.implement(e))}function jwe(e){let t=Uwe(e),n=qwe(e);return f=>mi(f).map(Fwe).chain(t).chain(n).toPromise()}function Fwe({process:e,data:t,tags:n,anchor:f,...a}){return{Id:"1234",Owner:"1234",...a,Target:e,Data:t||"1234",Tags:n||[],Anchor:f||"0"}}function zwe(e){let t=lwe.implement(e.deployAssign);return n=>mi(n).chain(sn(({process:f,message:a,baseLayer:d,exclude:l})=>t({process:f,message:a,baseLayer:d,exclude:l}))).map(f=>ps("assignmentId",f.assignmentId,n))}function Hwe(e){let t=zwe(e);return({process:n,message:f,baseLayer:a,exclude:d})=>mi({process:n,message:f,baseLayer:a,exclude:d}).chain(t).map(l=>l.assignmentId).bimap(B0,I0).toPromise()}var Kwe="https://arweave.net",Zwe="https://mu.ao-testnet.xyz",Wwe="https://cu.ao-testnet.xyz";function Fd({GRAPHQL_URL:e,GATEWAY_URL:t=Kwe,MU_URL:n=Zwe,CU_URL:f=Wwe}={}){let a=jz();e||(e=Fz({url:t,path:"/graphql"}));let{validate:d}=sz({cacheSize:100,GRAPHQL_URL:e}),l=l8e({MAX_SIZE:25}),v=a.child("result"),w=vwe({loadResult:f8e({fetch,CU_URL:f,logger:v}),logger:v}),m=a.child("message"),y=wwe({loadProcessMeta:d9({fetch,cache:l,logger:m}),deployMessage:r8e({fetch,MU_URL:n,logger:m}),logger:m}),g=a.child("spawn"),S=Twe({loadTransactionMeta:twe({fetch,GRAPHQL_URL:e,logger:g}),validateScheduler:d,deployProcess:i8e({fetch,MU_URL:n,logger:g}),logger:g}),x=a.child("monitor"),A=Bwe({loadProcessMeta:d9({fetch,cache:l,logger:x}),deployMonitor:n8e({fetch,MU_URL:n,logger:x}),logger:x}),T=a.child("unmonitor"),I=Pwe({loadProcessMeta:d9({fetch,cache:l,logger:T}),deployUnmonitor:a8e({fetch,MU_URL:n,logger:T}),logger:x}),B=a.child("results"),P=Dwe({queryResults:u8e({fetch,CU_URL:f,logger:B}),logger:B}),C=a.child("dryrun"),q=jwe({dryrunFetch:s8e({fetch,CU_URL:f,logger:C}),logger:C}),K=a.child("assign"),G=Hwe({deployAssign:o8e({fetch,MU_URL:n,logger:K}),logger:m});return{result:w,results:P,message:y,spawn:S,monitor:A,unmonitor:I,dryrun:q,assign:G}}var Kz={};bF(Kz,{createDataItemSigner:()=>y7e});var Zz=K9(dye(),1),Wz={};bF(Wz,{AVSCTap:()=>Gv,ArweaveSigner:()=>p_,DataItem:()=>Hv,MAX_TAG_BYTES:()=>Yy,MIN_BINARY_SIZE:()=>g_,SIG_CONFIG:()=>jd,SignatureConfig:()=>hs,Signer:()=>Jz,createData:()=>tH,default:()=>v7e,deserializeTags:()=>qy,indexToType:()=>v_,serializeTags:()=>m_,tagsExceedLimit:()=>eH,warparbundles:()=>m7e});var Vwe=Object.create,c_=Object.defineProperty,Gwe=Object.getOwnPropertyDescriptor,Ywe=Object.getOwnPropertyNames,Jwe=Object.getPrototypeOf,Xwe=Object.prototype.hasOwnProperty,uh=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qwe=(e,t)=>{for(var n in t)c_(e,n,{get:t[n],enumerable:!0})},e7e=(e,t,n,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ywe(t))!Xwe.call(e,a)&&a!==n&&c_(e,a,{get:()=>t[a],enumerable:!(f=Gwe(t,a))||f.enumerable});return e},O0=(e,t,n)=>(n=e!=null?Vwe(Jwe(e)):{},e7e(t||!e||!e.__esModule?c_(n,"default",{value:e,enumerable:!0}):n,e)),t7e=uh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(n){var f=4,a=n.length,d=a%f;if(!d)return n;var l=a,v=f-d,w=a+v,m=St.alloc(w);for(m.write(n);v--;)m.write("=",l++);return m.toString()}e.default=t}),r7e=uh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=t7e();function n(w,m){return m===void 0&&(m="utf8"),St.isBuffer(w)?d(w.toString("base64")):d(St.from(w,m).toString("base64"))}function f(w,m){return m===void 0&&(m="utf8"),St.from(a(w),"base64").toString(m)}function a(w){return w=w.toString(),t.default(w).replace(/\-/g,"+").replace(/_/g,"/")}function d(w){return w.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function l(w){return St.from(a(w),"base64")}var v=n;v.encode=n,v.decode=f,v.toBase64=a,v.fromBase64=d,v.toBuffer=l,e.default=v}),d_=uh((e,t)=>{t.exports=r7e().default,t.exports.default=t.exports}),Vz=uh(e=>{"use strict";e.byteLength=w,e.toByteArray=y,e.fromByteArray=x;var t=[],n=[],f=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,l=a.length;d<l;++d)t[d]=a[d],n[a.charCodeAt(d)]=d;var d,l;n[45]=62,n[95]=63;function v(A){var T=A.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=A.indexOf("=");I===-1&&(I=T);var B=I===T?0:4-I%4;return[I,B]}function w(A){var T=v(A),I=T[0],B=T[1];return(I+B)*3/4-B}function m(A,T,I){return(T+I)*3/4-I}function y(A){var T,I=v(A),B=I[0],P=I[1],C=new f(m(A,B,P)),q=0,K=P>0?B-4:B,G;for(G=0;G<K;G+=4)T=n[A.charCodeAt(G)]<<18|n[A.charCodeAt(G+1)]<<12|n[A.charCodeAt(G+2)]<<6|n[A.charCodeAt(G+3)],C[q++]=T>>16&255,C[q++]=T>>8&255,C[q++]=T&255;return P===2&&(T=n[A.charCodeAt(G)]<<2|n[A.charCodeAt(G+1)]>>4,C[q++]=T&255),P===1&&(T=n[A.charCodeAt(G)]<<10|n[A.charCodeAt(G+1)]<<4|n[A.charCodeAt(G+2)]>>2,C[q++]=T>>8&255,C[q++]=T&255),C}function g(A){return t[A>>18&63]+t[A>>12&63]+t[A>>6&63]+t[A&63]}function S(A,T,I){for(var B,P=[],C=T;C<I;C+=3)B=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),P.push(g(B));return P.join("")}function x(A){for(var T,I=A.length,B=I%3,P=[],C=16383,q=0,K=I-B;q<K;q+=C)P.push(S(A,q,q+C>K?K:q+C));return B===1?(T=A[I-1],P.push(t[T>>2]+t[T<<4&63]+"==")):B===2&&(T=(A[I-2]<<8)+A[I-1],P.push(t[T>>10]+t[T>>4&63]+t[T<<2&63]+"=")),P.join("")}}),Gz=uh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.b64UrlDecode=e.b64UrlEncode=e.bufferTob64Url=e.bufferTob64=e.b64UrlToBuffer=e.stringToB64Url=e.stringToBuffer=e.bufferToString=e.b64UrlToString=e.concatBuffers=void 0;var t=Vz();function n(S){let x=0;for(let I=0;I<S.length;I++)x+=S[I].byteLength;let A=new Uint8Array(x),T=0;A.set(new Uint8Array(S[0]),T),T+=S[0].byteLength;for(let I=1;I<S.length;I++)A.set(new Uint8Array(S[I]),T),T+=S[I].byteLength;return A}e.concatBuffers=n;function f(S){let x=v(S);return a(x)}e.b64UrlToString=f;function a(S){return new TextDecoder("utf-8",{fatal:!0}).decode(S)}e.bufferToString=a;function d(S){return new TextEncoder().encode(S)}e.stringToBuffer=d;function l(S){return m(d(S))}e.stringToB64Url=l;function v(S){return new Uint8Array(t.toByteArray(g(S)))}e.b64UrlToBuffer=v;function w(S){return t.fromByteArray(new Uint8Array(S))}e.bufferTob64=w;function m(S){return y(w(S))}e.bufferTob64Url=m;function y(S){return S.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}e.b64UrlEncode=y;function g(S){S=S.replace(/\-/g,"+").replace(/\_/g,"/");let x;return S.length%4==0?x=0:x=4-S.length%4,S.concat("=".repeat(x))}e.b64UrlDecode=g}),i7e=uh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Gz(),n=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let f=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),a=await this.driver.exportKey("jwk",f.privateKey);return{kty:a.kty,e:a.e,n:a.n,d:a.d,p:a.p,q:a.q,dp:a.dp,dq:a.dq,qi:a.qi}}async sign(f,a,{saltLength:d}={}){let l=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(f),a);return new Uint8Array(l)}async hash(f,a="SHA-256"){let d=await this.driver.digest(a,f);return new Uint8Array(d)}async verify(f,a,d){let l={kty:"RSA",e:"AQAB",n:f},v=await this.jwkToPublicCryptoKey(l),w=await this.driver.digest("SHA-256",a),m=await this.driver.verify({name:"RSA-PSS",saltLength:0},v,d,a),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},v,d,a),g=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((v.algorithm.modulusLength-1)/8)-w.byteLength-2},v,d,a);return m||y||g}async jwkToCryptoKey(f){return this.driver.importKey("jwk",f,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(f){return this.driver.importKey("jwk",f,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let f=crypto?.subtle;return f===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(a=>typeof f[a]=="function")}async encrypt(f,a,d){let l=await this.driver.importKey("raw",typeof a=="string"?t.stringToBuffer(a):a,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?t.stringToBuffer(d):t.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},l,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=new Uint8Array(16);crypto.getRandomValues(w);let m=await this.driver.encrypt({name:"AES-CBC",iv:w},v,f);return t.concatBuffers([w,m])}async decrypt(f,a,d){let l=await this.driver.importKey("raw",typeof a=="string"?t.stringToBuffer(a):a,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?t.stringToBuffer(d):t.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},l,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=f.slice(0,16),m=await this.driver.decrypt({name:"AES-CBC",iv:w},v,f.slice(16));return t.concatBuffers([m])}};e.default=n}),n7e=uh(e=>{e.read=function(t,n,f,a,d){var l,v,w=d*8-a-1,m=(1<<w)-1,y=m>>1,g=-7,S=f?d-1:0,x=f?-1:1,A=t[n+S];for(S+=x,l=A&(1<<-g)-1,A>>=-g,g+=w;g>0;l=l*256+t[n+S],S+=x,g-=8);for(v=l&(1<<-g)-1,l>>=-g,g+=a;g>0;v=v*256+t[n+S],S+=x,g-=8);if(l===0)l=1-y;else{if(l===m)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,a),l=l-y}return(A?-1:1)*v*Math.pow(2,l-a)},e.write=function(t,n,f,a,d,l){var v,w,m,y=l*8-d-1,g=(1<<y)-1,S=g>>1,x=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=a?0:l-1,T=a?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(w=isNaN(n)?1:0,v=g):(v=Math.floor(Math.log(n)/Math.LN2),n*(m=Math.pow(2,-v))<1&&(v--,m*=2),v+S>=1?n+=x/m:n+=x*Math.pow(2,1-S),n*m>=2&&(v++,m/=2),v+S>=g?(w=0,v=g):v+S>=1?(w=(n*m-1)*Math.pow(2,d),v=v+S):(w=n*Math.pow(2,S-1)*Math.pow(2,d),v=0));d>=8;t[f+A]=w&255,A+=T,w/=256,d-=8);for(v=v<<d|w,y+=d;y>0;t[f+A]=v&255,A+=T,v/=256,y-=8);t[f+A-T]|=I*128}}),F9=uh(e=>{"use strict";var t=Vz(),n=n7e(),f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=v,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;var a=2147483647;e.kMaxLength=a,v.TYPED_ARRAY_SUPPORT=d(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let O=new Uint8Array(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,Uint8Array.prototype),Object.setPrototypeOf(O,N),O.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function l(O){if(O>a)throw new RangeError('The value "'+O+'" is invalid for option "size"');let N=new Uint8Array(O);return Object.setPrototypeOf(N,v.prototype),N}function v(O,N,$){if(typeof O=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(O)}return w(O,N,$)}v.poolSize=8192;function w(O,N,$){if(typeof O=="string")return S(O,N);if(ArrayBuffer.isView(O))return A(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(ut(O,ArrayBuffer)||O&&ut(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(O,SharedArrayBuffer)||O&&ut(O.buffer,SharedArrayBuffer)))return T(O,N,$);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ee=O.valueOf&&O.valueOf();if(ee!=null&&ee!==O)return v.from(ee,N,$);let re=I(O);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return v.from(O[Symbol.toPrimitive]("string"),N,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}v.from=function(O,N,$){return w(O,N,$)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function m(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function y(O,N,$){return m(O),O<=0?l(O):N!==void 0?typeof $=="string"?l(O).fill(N,$):l(O).fill(N):l(O)}v.alloc=function(O,N,$){return y(O,N,$)};function g(O){return m(O),l(O<0?0:B(O)|0)}v.allocUnsafe=function(O){return g(O)},v.allocUnsafeSlow=function(O){return g(O)};function S(O,N){if((typeof N!="string"||N==="")&&(N="utf8"),!v.isEncoding(N))throw new TypeError("Unknown encoding: "+N);let $=C(O,N)|0,ee=l($),re=ee.write(O,N);return re!==$&&(ee=ee.slice(0,re)),ee}function x(O){let N=O.length<0?0:B(O.length)|0,$=l(N);for(let ee=0;ee<N;ee+=1)$[ee]=O[ee]&255;return $}function A(O){if(ut(O,Uint8Array)){let N=new Uint8Array(O);return T(N.buffer,N.byteOffset,N.byteLength)}return x(O)}function T(O,N,$){if(N<0||O.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<N+($||0))throw new RangeError('"length" is outside of buffer bounds');let ee;return N===void 0&&$===void 0?ee=new Uint8Array(O):$===void 0?ee=new Uint8Array(O,N):ee=new Uint8Array(O,N,$),Object.setPrototypeOf(ee,v.prototype),ee}function I(O){if(v.isBuffer(O)){let N=B(O.length)|0,$=l(N);return $.length===0||O.copy($,0,0,N),$}if(O.length!==void 0)return typeof O.length!="number"||qe(O.length)?l(0):x(O);if(O.type==="Buffer"&&Array.isArray(O.data))return x(O.data)}function B(O){if(O>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return O|0}function P(O){return+O!=O&&(O=0),v.alloc(+O)}v.isBuffer=function(O){return O!=null&&O._isBuffer===!0&&O!==v.prototype},v.compare=function(O,N){if(ut(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),!v.isBuffer(O)||!v.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(O===N)return 0;let $=O.length,ee=N.length;for(let re=0,se=Math.min($,ee);re<se;++re)if(O[re]!==N[re]){$=O[re],ee=N[re];break}return $<ee?-1:ee<$?1:0},v.isEncoding=function(O){switch(String(O).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(O,N){if(!Array.isArray(O))throw new TypeError('"list" argument must be an Array of Buffers');if(O.length===0)return v.alloc(0);let $;if(N===void 0)for(N=0,$=0;$<O.length;++$)N+=O[$].length;let ee=v.allocUnsafe(N),re=0;for($=0;$<O.length;++$){let se=O[$];if(ut(se,Uint8Array))re+se.length>ee.length?(v.isBuffer(se)||(se=v.from(se)),se.copy(ee,re)):Uint8Array.prototype.set.call(ee,se,re);else if(v.isBuffer(se))se.copy(ee,re);else throw new TypeError('"list" argument must be an Array of Buffers');re+=se.length}return ee};function C(O,N){if(v.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||ut(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);let $=O.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&$===0)return 0;let re=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return he(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return Ae(O).length;default:if(re)return ee?-1:he(O).length;N=(""+N).toLowerCase(),re=!0}}v.byteLength=C;function q(O,N,$){let ee=!1;if((N===void 0||N<0)&&(N=0),N>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,N>>>=0,$<=N))return"";for(O||(O="utf8");;)switch(O){case"hex":return r(this,N,$);case"utf8":case"utf-8":return c(this,N,$);case"ascii":return R(this,N,$);case"latin1":case"binary":return o(this,N,$);case"base64":return u(this,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h(this,N,$);default:if(ee)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),ee=!0}}v.prototype._isBuffer=!0;function K(O,N,$){let ee=O[N];O[N]=O[$],O[$]=ee}v.prototype.swap16=function(){let O=this.length;if(O%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<O;N+=2)K(this,N,N+1);return this},v.prototype.swap32=function(){let O=this.length;if(O%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<O;N+=4)K(this,N,N+3),K(this,N+1,N+2);return this},v.prototype.swap64=function(){let O=this.length;if(O%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<O;N+=8)K(this,N,N+7),K(this,N+1,N+6),K(this,N+2,N+5),K(this,N+3,N+4);return this},v.prototype.toString=function(){let O=this.length;return O===0?"":arguments.length===0?c(this,0,O):q.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(O){if(!v.isBuffer(O))throw new TypeError("Argument must be a Buffer");return this===O?!0:v.compare(this,O)===0},v.prototype.inspect=function(){let O="",N=e.INSPECT_MAX_BYTES;return O=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(O+=" ... "),"<Buffer "+O+">"},f&&(v.prototype[f]=v.prototype.inspect),v.prototype.compare=function(O,N,$,ee,re){if(ut(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),!v.isBuffer(O))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof O);if(N===void 0&&(N=0),$===void 0&&($=O?O.length:0),ee===void 0&&(ee=0),re===void 0&&(re=this.length),N<0||$>O.length||ee<0||re>this.length)throw new RangeError("out of range index");if(ee>=re&&N>=$)return 0;if(ee>=re)return-1;if(N>=$)return 1;if(N>>>=0,$>>>=0,ee>>>=0,re>>>=0,this===O)return 0;let se=re-ee,ce=$-N,st=Math.min(se,ce),ye=this.slice(ee,re),be=O.slice(N,$);for(let me=0;me<st;++me)if(ye[me]!==be[me]){se=ye[me],ce=be[me];break}return se<ce?-1:ce<se?1:0};function G(O,N,$,ee,re){if(O.length===0)return-1;if(typeof $=="string"?(ee=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,qe($)&&($=re?0:O.length-1),$<0&&($=O.length+$),$>=O.length){if(re)return-1;$=O.length-1}else if($<0)if(re)$=0;else return-1;if(typeof N=="string"&&(N=v.from(N,ee)),v.isBuffer(N))return N.length===0?-1:j(O,N,$,ee,re);if(typeof N=="number")return N=N&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(O,N,$):Uint8Array.prototype.lastIndexOf.call(O,N,$):j(O,[N],$,ee,re);throw new TypeError("val must be string, number or Buffer")}function j(O,N,$,ee,re){let se=1,ce=O.length,st=N.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(O.length<2||N.length<2)return-1;se=2,ce/=2,st/=2,$/=2}function ye(me,ke){return se===1?me[ke]:me.readUInt16BE(ke*se)}let be;if(re){let me=-1;for(be=$;be<ce;be++)if(ye(O,be)===ye(N,me===-1?0:be-me)){if(me===-1&&(me=be),be-me+1===st)return me*se}else me!==-1&&(be-=be-me),me=-1}else for($+st>ce&&($=ce-st),be=$;be>=0;be--){let me=!0;for(let ke=0;ke<st;ke++)if(ye(O,be+ke)!==ye(N,ke)){me=!1;break}if(me)return be}return-1}v.prototype.includes=function(O,N,$){return this.indexOf(O,N,$)!==-1},v.prototype.indexOf=function(O,N,$){return G(this,O,N,$,!0)},v.prototype.lastIndexOf=function(O,N,$){return G(this,O,N,$,!1)};function z(O,N,$,ee){$=Number($)||0;let re=O.length-$;ee?(ee=Number(ee),ee>re&&(ee=re)):ee=re;let se=N.length;ee>se/2&&(ee=se/2);let ce;for(ce=0;ce<ee;++ce){let st=parseInt(N.substr(ce*2,2),16);if(qe(st))return ce;O[$+ce]=st}return ce}function J(O,N,$,ee){return _e(he(N,O.length-$),O,$,ee)}function E(O,N,$,ee){return _e(pe(N),O,$,ee)}function i(O,N,$,ee){return _e(Ae(N),O,$,ee)}function s(O,N,$,ee){return _e(De(N,O.length-$),O,$,ee)}v.prototype.write=function(O,N,$,ee){if(N===void 0)ee="utf8",$=this.length,N=0;else if($===void 0&&typeof N=="string")ee=N,$=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite($)?($=$>>>0,ee===void 0&&(ee="utf8")):(ee=$,$=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let re=this.length-N;if(($===void 0||$>re)&&($=re),O.length>0&&($<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");ee||(ee="utf8");let se=!1;for(;;)switch(ee){case"hex":return z(this,O,N,$);case"utf8":case"utf-8":return J(this,O,N,$);case"ascii":case"latin1":case"binary":return E(this,O,N,$);case"base64":return i(this,O,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,O,N,$);default:if(se)throw new TypeError("Unknown encoding: "+ee);ee=(""+ee).toLowerCase(),se=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function u(O,N,$){return N===0&&$===O.length?t.fromByteArray(O):t.fromByteArray(O.slice(N,$))}function c(O,N,$){$=Math.min(O.length,$);let ee=[],re=N;for(;re<$;){let se=O[re],ce=null,st=se>239?4:se>223?3:se>191?2:1;if(re+st<=$){let ye,be,me,ke;switch(st){case 1:se<128&&(ce=se);break;case 2:ye=O[re+1],(ye&192)===128&&(ke=(se&31)<<6|ye&63,ke>127&&(ce=ke));break;case 3:ye=O[re+1],be=O[re+2],(ye&192)===128&&(be&192)===128&&(ke=(se&15)<<12|(ye&63)<<6|be&63,ke>2047&&(ke<55296||ke>57343)&&(ce=ke));break;case 4:ye=O[re+1],be=O[re+2],me=O[re+3],(ye&192)===128&&(be&192)===128&&(me&192)===128&&(ke=(se&15)<<18|(ye&63)<<12|(be&63)<<6|me&63,ke>65535&&ke<1114112&&(ce=ke))}}ce===null?(ce=65533,st=1):ce>65535&&(ce-=65536,ee.push(ce>>>10&1023|55296),ce=56320|ce&1023),ee.push(ce),re+=st}return _(ee)}var p=4096;function _(O){let N=O.length;if(N<=p)return String.fromCharCode.apply(String,O);let $="",ee=0;for(;ee<N;)$+=String.fromCharCode.apply(String,O.slice(ee,ee+=p));return $}function R(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]&127);return ee}function o(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]);return ee}function r(O,N,$){let ee=O.length;(!N||N<0)&&(N=0),(!$||$<0||$>ee)&&($=ee);let re="";for(let se=N;se<$;++se)re+=Te[O[se]];return re}function h(O,N,$){let ee=O.slice(N,$),re="";for(let se=0;se<ee.length-1;se+=2)re+=String.fromCharCode(ee[se]+ee[se+1]*256);return re}v.prototype.slice=function(O,N){let $=this.length;O=~~O,N=N===void 0?$:~~N,O<0?(O+=$,O<0&&(O=0)):O>$&&(O=$),N<0?(N+=$,N<0&&(N=0)):N>$&&(N=$),N<O&&(N=O);let ee=this.subarray(O,N);return Object.setPrototypeOf(ee,v.prototype),ee};function b(O,N,$){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+N>$)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O],re=1,se=0;for(;++se<N&&(re*=256);)ee+=this[O+se]*re;return ee},v.prototype.readUintBE=v.prototype.readUIntBE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O+--N],re=1;for(;N>0&&(re*=256);)ee+=this[O+--N]*re;return ee},v.prototype.readUint8=v.prototype.readUInt8=function(O,N){return O=O>>>0,N||b(O,1,this.length),this[O]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(O,N){return O=O>>>0,N||b(O,2,this.length),this[O]|this[O+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(O,N){return O=O>>>0,N||b(O,2,this.length),this[O]<<8|this[O+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(O,N){return O=O>>>0,N||b(O,4,this.length),(this[O]|this[O+1]<<8|this[O+2]<<16)+this[O+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]*16777216+(this[O+1]<<16|this[O+2]<<8|this[O+3])},v.prototype.readBigUInt64LE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=N+this[++O]*2**8+this[++O]*2**16+this[++O]*2**24,re=this[++O]+this[++O]*2**8+this[++O]*2**16+$*2**24;return BigInt(ee)+(BigInt(re)<<BigInt(32))}),v.prototype.readBigUInt64BE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=N*2**24+this[++O]*2**16+this[++O]*2**8+this[++O],re=this[++O]*2**24+this[++O]*2**16+this[++O]*2**8+$;return(BigInt(ee)<<BigInt(32))+BigInt(re)}),v.prototype.readIntLE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O],re=1,se=0;for(;++se<N&&(re*=256);)ee+=this[O+se]*re;return re*=128,ee>=re&&(ee-=Math.pow(2,8*N)),ee},v.prototype.readIntBE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=N,re=1,se=this[O+--ee];for(;ee>0&&(re*=256);)se+=this[O+--ee]*re;return re*=128,se>=re&&(se-=Math.pow(2,8*N)),se},v.prototype.readInt8=function(O,N){return O=O>>>0,N||b(O,1,this.length),this[O]&128?(255-this[O]+1)*-1:this[O]},v.prototype.readInt16LE=function(O,N){O=O>>>0,N||b(O,2,this.length);let $=this[O]|this[O+1]<<8;return $&32768?$|4294901760:$},v.prototype.readInt16BE=function(O,N){O=O>>>0,N||b(O,2,this.length);let $=this[O+1]|this[O]<<8;return $&32768?$|4294901760:$},v.prototype.readInt32LE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]|this[O+1]<<8|this[O+2]<<16|this[O+3]<<24},v.prototype.readInt32BE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]<<24|this[O+1]<<16|this[O+2]<<8|this[O+3]},v.prototype.readBigInt64LE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=this[O+4]+this[O+5]*2**8+this[O+6]*2**16+($<<24);return(BigInt(ee)<<BigInt(32))+BigInt(N+this[++O]*2**8+this[++O]*2**16+this[++O]*2**24)}),v.prototype.readBigInt64BE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=(N<<24)+this[++O]*2**16+this[++O]*2**8+this[++O];return(BigInt(ee)<<BigInt(32))+BigInt(this[++O]*2**24+this[++O]*2**16+this[++O]*2**8+$)}),v.prototype.readFloatLE=function(O,N){return O=O>>>0,N||b(O,4,this.length),n.read(this,O,!0,23,4)},v.prototype.readFloatBE=function(O,N){return O=O>>>0,N||b(O,4,this.length),n.read(this,O,!1,23,4)},v.prototype.readDoubleLE=function(O,N){return O=O>>>0,N||b(O,8,this.length),n.read(this,O,!0,52,8)},v.prototype.readDoubleBE=function(O,N){return O=O>>>0,N||b(O,8,this.length),n.read(this,O,!1,52,8)};function M(O,N,$,ee,re,se){if(!v.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>re||N<se)throw new RangeError('"value" argument is out of bounds');if($+ee>O.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(O,N,$,ee){if(O=+O,N=N>>>0,$=$>>>0,!ee){let ce=Math.pow(2,8*$)-1;M(this,O,N,$,ce,0)}let re=1,se=0;for(this[N]=O&255;++se<$&&(re*=256);)this[N+se]=O/re&255;return N+$},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(O,N,$,ee){if(O=+O,N=N>>>0,$=$>>>0,!ee){let ce=Math.pow(2,8*$)-1;M(this,O,N,$,ce,0)}let re=$-1,se=1;for(this[N+re]=O&255;--re>=0&&(se*=256);)this[N+re]=O/se&255;return N+$},v.prototype.writeUint8=v.prototype.writeUInt8=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,1,255,0),this[N]=O&255,N+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,65535,0),this[N]=O&255,this[N+1]=O>>>8,N+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,65535,0),this[N]=O>>>8,this[N+1]=O&255,N+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,4294967295,0),this[N+3]=O>>>24,this[N+2]=O>>>16,this[N+1]=O>>>8,this[N]=O&255,N+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,4294967295,0),this[N]=O>>>24,this[N+1]=O>>>16,this[N+2]=O>>>8,this[N+3]=O&255,N+4};function k(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,$}function D(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$+7]=se,se=se>>8,O[$+6]=se,se=se>>8,O[$+5]=se,se=se>>8,O[$+4]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$+3]=ce,ce=ce>>8,O[$+2]=ce,ce=ce>>8,O[$+1]=ce,ce=ce>>8,O[$]=ce,$+8}v.prototype.writeBigUInt64LE=mt(function(O,N=0){return k(this,O,N,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=mt(function(O,N=0){return D(this,O,N,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(O,N,$,ee){if(O=+O,N=N>>>0,!ee){let st=Math.pow(2,8*$-1);M(this,O,N,$,st-1,-st)}let re=0,se=1,ce=0;for(this[N]=O&255;++re<$&&(se*=256);)O<0&&ce===0&&this[N+re-1]!==0&&(ce=1),this[N+re]=(O/se>>0)-ce&255;return N+$},v.prototype.writeIntBE=function(O,N,$,ee){if(O=+O,N=N>>>0,!ee){let st=Math.pow(2,8*$-1);M(this,O,N,$,st-1,-st)}let re=$-1,se=1,ce=0;for(this[N+re]=O&255;--re>=0&&(se*=256);)O<0&&ce===0&&this[N+re+1]!==0&&(ce=1),this[N+re]=(O/se>>0)-ce&255;return N+$},v.prototype.writeInt8=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,1,127,-128),O<0&&(O=255+O+1),this[N]=O&255,N+1},v.prototype.writeInt16LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,32767,-32768),this[N]=O&255,this[N+1]=O>>>8,N+2},v.prototype.writeInt16BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,32767,-32768),this[N]=O>>>8,this[N+1]=O&255,N+2},v.prototype.writeInt32LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,2147483647,-2147483648),this[N]=O&255,this[N+1]=O>>>8,this[N+2]=O>>>16,this[N+3]=O>>>24,N+4},v.prototype.writeInt32BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,2147483647,-2147483648),O<0&&(O=4294967295+O+1),this[N]=O>>>24,this[N+1]=O>>>16,this[N+2]=O>>>8,this[N+3]=O&255,N+4},v.prototype.writeBigInt64LE=mt(function(O,N=0){return k(this,O,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=mt(function(O,N=0){return D(this,O,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(O,N,$,ee,re,se){if($+ee>O.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function W(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,4,34028234663852886e22,-34028234663852886e22),n.write(O,N,$,ee,23,4),$+4}v.prototype.writeFloatLE=function(O,N,$){return W(this,O,N,!0,$)},v.prototype.writeFloatBE=function(O,N,$){return W(this,O,N,!1,$)};function X(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,8,17976931348623157e292,-17976931348623157e292),n.write(O,N,$,ee,52,8),$+8}v.prototype.writeDoubleLE=function(O,N,$){return X(this,O,N,!0,$)},v.prototype.writeDoubleBE=function(O,N,$){return X(this,O,N,!1,$)},v.prototype.copy=function(O,N,$,ee){if(!v.isBuffer(O))throw new TypeError("argument should be a Buffer");if($||($=0),!ee&&ee!==0&&(ee=this.length),N>=O.length&&(N=O.length),N||(N=0),ee>0&&ee<$&&(ee=$),ee===$||O.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("sourceEnd out of bounds");ee>this.length&&(ee=this.length),O.length-N<ee-$&&(ee=O.length-N+$);let re=ee-$;return this===O&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(N,$,ee):Uint8Array.prototype.set.call(O,this.subarray($,ee),N),re},v.prototype.fill=function(O,N,$,ee){if(typeof O=="string"){if(typeof N=="string"?(ee=N,N=0,$=this.length):typeof $=="string"&&(ee=$,$=this.length),ee!==void 0&&typeof ee!="string")throw new TypeError("encoding must be a string");if(typeof ee=="string"&&!v.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee);if(O.length===1){let se=O.charCodeAt(0);(ee==="utf8"&&se<128||ee==="latin1")&&(O=se)}}else typeof O=="number"?O=O&255:typeof O=="boolean"&&(O=Number(O));if(N<0||this.length<N||this.length<$)throw new RangeError("Out of range index");if($<=N)return this;N=N>>>0,$=$===void 0?this.length:$>>>0,O||(O=0);let re;if(typeof O=="number")for(re=N;re<$;++re)this[re]=O;else{let se=v.isBuffer(O)?O:v.from(O,ee),ce=se.length;if(ce===0)throw new TypeError('The value "'+O+'" is invalid for argument "value"');for(re=0;re<$-N;++re)this[re+N]=se[re%ce]}return this};var V={};function Y(O,N,$){V[O]=class extends ${constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ee,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(O,N){return`The "${O}" argument must be of type number. Received type ${typeof N}`},TypeError),Y("ERR_OUT_OF_RANGE",function(O,N,$){let ee=`The value of "${O}" is out of range.`,re=$;return Number.isInteger($)&&Math.abs($)>2**32?re=ae(String($)):typeof $=="bigint"&&(re=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(re=ae(re)),re+="n"),ee+=` It must be ${N}. Received ${re}`,ee},RangeError);function ae(O){let N="",$=O.length,ee=O[0]==="-"?1:0;for(;$>=ee+4;$-=3)N=`_${O.slice($-3,$)}${N}`;return`${O.slice(0,$)}${N}`}function te(O,N,$){Z(N,"offset"),(O[N]===void 0||O[N+$]===void 0)&&ie(N,O.length-($+1))}function U(O,N,$,ee,re,se){if(O>$||O<N){let ce=typeof N=="bigint"?"n":"",st;throw se>3?N===0||N===BigInt(0)?st=`>= 0${ce} and < 2${ce} ** ${(se+1)*8}${ce}`:st=`>= -(2${ce} ** ${(se+1)*8-1}${ce}) and < 2 ** ${(se+1)*8-1}${ce}`:st=`>= ${N}${ce} and <= ${$}${ce}`,new V.ERR_OUT_OF_RANGE("value",st,O)}te(ee,re,se)}function Z(O,N){if(typeof O!="number")throw new V.ERR_INVALID_ARG_TYPE(N,"number",O)}function ie(O,N,$){throw Math.floor(O)!==O?(Z(O,$),new V.ERR_OUT_OF_RANGE($||"offset","an integer",O)):N<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${N}`,O)}var fe=/[^+/0-9A-Za-z-_]/g;function de(O){if(O=O.split("=")[0],O=O.trim().replace(fe,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function he(O,N){N=N||1/0;let $,ee=O.length,re=null,se=[];for(let ce=0;ce<ee;++ce){if($=O.charCodeAt(ce),$>55295&&$<57344){if(!re){if($>56319){(N-=3)>-1&&se.push(239,191,189);continue}else if(ce+1===ee){(N-=3)>-1&&se.push(239,191,189);continue}re=$;continue}if($<56320){(N-=3)>-1&&se.push(239,191,189),re=$;continue}$=(re-55296<<10|$-56320)+65536}else re&&(N-=3)>-1&&se.push(239,191,189);if(re=null,$<128){if((N-=1)<0)break;se.push($)}else if($<2048){if((N-=2)<0)break;se.push($>>6|192,$&63|128)}else if($<65536){if((N-=3)<0)break;se.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((N-=4)<0)break;se.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return se}function pe(O){let N=[];for(let $=0;$<O.length;++$)N.push(O.charCodeAt($)&255);return N}function De(O,N){let $,ee,re,se=[];for(let ce=0;ce<O.length&&!((N-=2)<0);++ce)$=O.charCodeAt(ce),ee=$>>8,re=$%256,se.push(re),se.push(ee);return se}function Ae(O){return t.toByteArray(de(O))}function _e(O,N,$,ee){let re;for(re=0;re<ee&&!(re+$>=N.length||re>=O.length);++re)N[re+$]=O[re];return re}function ut(O,N){return O instanceof N||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===N.name}function qe(O){return O!==O}var Te=function(){let O="0123456789abcdef",N=new Array(256);for(let $=0;$<16;++$){let ee=$*16;for(let re=0;re<16;++re)N[ee+re]=O[$]+O[re]}return N}();function mt(O){return typeof BigInt>"u"?ne:O}function ne(){throw new Error("BigInt not supported")}}),a7e=uh((e,t)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,t.exports={Buffer:F9().Buffer,Crypto:window.crypto}):t.exports={Buffer:F9().Buffer,Crypto:crypto}}),Yz={};Qwe(Yz,{AVSCTap:()=>Gv,ArweaveSigner:()=>p_,DataItem:()=>Hv,MAX_TAG_BYTES:()=>Yy,MIN_BINARY_SIZE:()=>g_,SIG_CONFIG:()=>jd,SignatureConfig:()=>hs,Signer:()=>Jz,createData:()=>tH,deserializeTags:()=>qy,indexToType:()=>v_,serializeTags:()=>m_,tagsExceedLimit:()=>eH});var Jz=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,t,n,f){throw new Error("You must implement verify method on child")}},o7e=O0(d_(),1),bf=O0(Gz(),1);async function Xz(e){if(Array.isArray(e)){let a=(0,bf.concatBuffers)([(0,bf.stringToBuffer)("list"),(0,bf.stringToBuffer)(e.length.toString())]);return await Qz(e,await ah().hash(a,"SHA-384"))}let t=e,n=(0,bf.concatBuffers)([(0,bf.stringToBuffer)("blob"),(0,bf.stringToBuffer)(t.byteLength.toString())]),f=(0,bf.concatBuffers)([await ah().hash(n,"SHA-384"),await ah().hash(t,"SHA-384")]);return await ah().hash(f,"SHA-384")}async function Qz(e,t){if(e.length<1)return t;let n=(0,bf.concatBuffers)([t,await Xz(e[0])]),f=await ah().hash(n,"SHA-384");return await Qz(e.slice(1),f)}var y9=O0(i7e(),1),s7e=y9.default.default?y9.default.default:y9.default,f7e=class extends s7e{getPublicKey(e){throw new Error("Unimplemented")}},u7e;function ah(){return u7e??=new f7e}var hs;(function(e){e[e.ARWEAVE=1]="ARWEAVE",e[e.ED25519=2]="ED25519",e[e.ETHEREUM=3]="ETHEREUM",e[e.SOLANA=4]="SOLANA",e[e.INJECTEDAPTOS=5]="INJECTEDAPTOS",e[e.MULTIAPTOS=6]="MULTIAPTOS",e[e.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(hs||(hs={}));var jd={[hs.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[hs.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[hs.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[hs.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[hs.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[hs.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[hs.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},p_=class{signatureType=1;ownerLength=jd[1].pubLength;signatureLength=jd[1].sigLength;jwk;pk;constructor(e){this.pk=e.n,this.jwk=e}get publicKey(){return o7e.default.toBuffer(this.pk)}sign(e){return ah().sign(this.jwk,e)}static async verify(e,t,n){return await ah().verify(e,t,n)}},v_={1:p_},uu=O0(d_(),1);async function z9(e){return Xz([(0,bf.stringToBuffer)("dataitem"),(0,bf.stringToBuffer)("1"),(0,bf.stringToBuffer)(e.signatureType.toString()),e.rawOwner,e.rawTarget,e.rawAnchor,e.rawTags,e.rawData])}async function h7e(e,t){let n=await z9(e),f=await t.sign(n),a=await ah().hash(f);return{signature:St.from(f),id:St.from(a)}}async function l7e(e,t){let{signature:n,id:f}=await h7e(e,t);return e.getRaw().set(n,2),f}var Gv=class{buf;pos;constructor(e=St.alloc(Yy),t=0){this.buf=e,this.pos=t}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let t=e.length,n;if(t)for(this.writeLong(t),n=0;n<t;n++){let f=e[n];if(f?.name===void 0||f?.value===void 0)throw new Error(`Invalid tag format for ${f}, expected {name:string, value: string}`);this.writeString(f.name),this.writeString(f.value)}this.writeLong(0)}toBuffer(){let e=St.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(e){let t=this.buf,n,f;if(e>=-1073741824&&e<1073741824){f=e>=0?e<<1:~e<<1|1;do t[this.pos]=f&127,f>>=7;while(f&&(t[this.pos++]|=128))}else{n=e>=0?e*2:-e*2-1;do t[this.pos]=n&127,n/=128;while(n>=1&&(t[this.pos++]|=128))}this.pos++,this.buf=t}writeString(e){let t=St.byteLength(e),n=this.buf;this.writeLong(t);let f=this.pos;if(this.pos+=t,!(this.pos>n.length)){if(t>64)this.buf.write(e,this.pos-t,t,"utf8");else{let a,d,l,v;for(a=0,d=t;a<d;a++)l=e.charCodeAt(a),l<128?n[f++]=l:l<2048?(n[f++]=l>>6|192,n[f++]=l&63|128):(l&64512)===55296&&((v=e.charCodeAt(a+1))&64512)===56320?(l=65536+((l&1023)<<10)+(v&1023),a++,n[f++]=l>>18|240,n[f++]=l>>12&63|128,n[f++]=l>>6&63|128,n[f++]=l&63|128):(n[f++]=l>>12|224,n[f++]=l>>6&63|128,n[f++]=l&63|128)}this.buf=n}}readLong(){let e=0,t=0,n=this.buf,f,a,d,l;do f=n[this.pos++],a=f&128,e|=(f&127)<<t,t+=7;while(a&&t<28);if(a){d=e,l=268435456;do f=n[this.pos++],d+=(f&127)*l,l*=128;while(f&128);return(d%2?-(d+1):d)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],t;for(;t=this.readLong();)for(t<0&&(t=-t,this.skipLong());t--;){let n=this.readString(),f=this.readString();e.push({name:n,value:f})}return e}readString(){let e=this.readLong(),t=this.pos,n=this.buf;if(this.pos+=e,!(this.pos>n.length))return this.buf.slice(t,t+e).toString()}};function m_(e){let t=new Gv;return t.writeTags(e),t.toBuffer()}function eH(e){let t=new Gv;return t.writeTags(e),t.tagsExceedLimit()}function qy(e){return new Gv(e).readTags()}function Vh(e){let t=0;for(let n=e.length-1;n>=0;n--)t=t*256+e[n];return t}function c7e(e){if(e>29)throw new Error("Short too long");let t=[0,0];for(let n=0;n<t.length;n++){let f=e&255;t[n]=f,e=(e-f)/256}return Uint8Array.from(t)}function gF(e){let t=[0,0,0,0,0,0,0,0];for(let n=0;n<t.length;n++){let f=e&255;t[n]=f,e=(e-f)/256}return Uint8Array.from(t)}var d7e=O0(a7e(),1),_d=O0(F9(),1),Yy=4096,g_=80,Hv=class{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=Vh(this.binary.subarray(0,2));if(hs?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return Hv.verify(this.binary)}get id(){return(async()=>uu.default.encode(await this.rawId))()}set id(e){this._id=uu.default.toBuffer(e)}get rawId(){return(async()=>_d.Buffer.from(await d7e.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return uu.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return jd[this.signatureType].sigLength}get owner(){return uu.default.encode(this.rawOwner)}get ownerLength(){return jd[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):_d.Buffer.alloc(0)}get target(){return uu.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):_d.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let e=this.getTagsStart(),t=Vh(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+t)}get tags(){let e=this.getTagsStart();if(Vh(this.binary.subarray(e,e+8))==0)return[];let t=Vh(this.binary.subarray(e+8,e+16));return qy(_d.Buffer.from(this.binary.subarray(e+16,e+16+t)))}get tagsB64Url(){return this.tags.map(e=>({name:uu.default.encode(e.name),value:uu.default.encode(e.value)}))}getStartOfData(){let e=this.getTagsStart(),t=this.binary.subarray(e+8,e+16),n=Vh(t);return e+16+n}get rawData(){let e=this.getTagsStart(),t=this.binary.subarray(e+8,e+16),n=Vh(t),f=e+16+n;return this.binary.subarray(f,this.binary.length)}get data(){return uu.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await l7e(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=_d.Buffer.from(await ah().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:uu.default.encode(e.name),value:uu.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<g_)return!1;let t=new Hv(e),n=t.signatureType,f=t.getTagsStart(),a=Vh(e.subarray(f,f+8)),d=e.subarray(f+8,f+16),l=Vh(d);if(l>Yy)return!1;if(a>0)try{if(qy(_d.Buffer.from(e.subarray(f+16,f+16+l))).length!==a)return!1}catch{return!1}let v=v_[n],w=await z9(t);return await v.verify(t.rawOwner,w,t.rawSignature)}async getSignatureData(){return z9(this)}getTagsStart(){let e=this.getTargetStart(),t=this.binary[e]==1,n=e+(t?33:1),f=this.binary[n]==1;return n+=f?33:1,n}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,t=this.binary[this.getTargetStart()]==1;return e+=t?32:0,e}},p7e=O0(d_(),1);function tH(e,t,n){let f=t.publicKey,a=n?.target?p7e.default.toBuffer(n.target):null,d=1+(a?.byteLength??0),l=n?.anchor?St.from(n.anchor):null,v=1+(l?.byteLength??0),w=(n?.tags?.length??0)>0?m_(n.tags):null,m=16+(w?w.byteLength:0),y=St.from(e),g=y.byteLength,S=2+t.signatureLength+t.ownerLength+d+v+m+g,x=St.alloc(S);if(x.set(c7e(t.signatureType),0),x.set(new Uint8Array(t.signatureLength).fill(0),2),f.byteLength!==t.ownerLength)throw new Error(`Owner must be ${t.ownerLength} bytes, but was incorrectly ${f.byteLength}`);x.set(f,2+t.signatureLength);let A=2+t.signatureLength+t.ownerLength;if(x[A]=a?1:0,a){if(a.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${a.byteLength}`);x.set(a,A+1)}let T=A+d,I=T+1;if(x[T]=l?1:0,l){if(I+=l.byteLength,l.byteLength!==32)throw new Error("Anchor must be 32 bytes");x.set(l,T+1)}x.set(gF(n?.tags?.length??0),I);let B=gF(w?.byteLength??0);x.set(B,I+8),w&&x.set(w,I+16);let P=I+m;return x.set(y,P),new Hv(x)}var y_={...Yz};globalThis.arbundles??=y_;var v7e=y_,m7e=y_;globalThis.Buffer||(globalThis.Buffer=Zz.Buffer);var{DataItem:g7e}=Wz;function y7e(e){return async({data:n,tags:f,target:a,anchor:d,createDataItem:l=v=>new g7e(v)})=>{let v=await e.signDataItem({data:n,tags:f,target:a,anchor:d}),w=l(Zz.Buffer.from(v));return{id:await w.id,raw:await w.getRaw()}}}var b7e=globalThis.GATEWAY_URL||void 0,w7e=globalThis.MU_URL||void 0,_7e=globalThis.CU_URL||void 0,M7e=globalThis.GRAPHQL_URL||void 0,{result:DKe,results:$Ke,message:UKe,spawn:qKe,monitor:jKe,unmonitor:FKe,dryrun:zKe,assign:HKe}=Fd({GATEWAY_URL:b7e,MU_URL:w7e,CU_URL:_7e,GRAPHQL_URL:M7e}),rH=Kz.createDataItemSigner;var qre=Cc(z4(),1);Be();Pe();Oe();var Ure=Cc($re(),1),tm=Ure.default.init({host:"arweave.net",port:443,protocol:"https"});async function hYe({signer:e,module:t=OO,luaCodeTxId:n=K4,ao:f=Fd(),scheduler:a=PO,state:d,stateContractTxId:l}){let v=await tm.transactions.getData(n,{decode:!0,string:!0}),w=await f.spawn({module:t,scheduler:a,signer:e}),m=new Ws({processId:w,ao:f});return await m.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:n}],data:v,signer:e}),d&&await m.send({tags:[{name:"Action",value:"Initialize-State"},...l!==void 0?[{name:"State-Contract-TX-ID",value:l}]:[]],data:JSON.stringify(d),signer:e}),w}async function lYe({signer:e,processId:t,luaCodeTxId:n=K4,ao:f=Fd()}){let a=new Ws({processId:t,ao:f}),d=await tm.transactions.getData(n,{decode:!0,string:!0}),{id:l}=await a.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:n}],data:d,signer:e});return l}function A1(e){return"publicKey"in e?async({data:n,tags:f,target:a,anchor:d})=>{e.publicKey===void 0&&"setPublicKey"in e&&typeof e.setPublicKey=="function"&&await e.setPublicKey();let l=(0,qre.createData)(n,e,{tags:f,target:a,anchor:d});return l.sign(e).then(async()=>({id:await l.id,raw:await l.getRaw()}))}:rH(e)}var rm=class{static init({signer:t,...n}){if($c(n)||Uc(n))return t?new xk({signer:t,...n}):new s8(n);throw new $h}},s8=class{process;constructor(t){if($c(t))this.process=t.process;else if(Uc(t))this.process=new Ws({processId:t.processId});else throw new $h}async getState(){let t=[{name:"Action",value:"State"}];return await this.process.read({tags:t})}async getInfo(){let t=[{name:"Action",value:"Info"}];return await this.process.read({tags:t})}async getRecord({undername:t}){let n=[{name:"Sub-Domain",value:t},{name:"Action",value:"Record"}];return await this.process.read({tags:n})}async getRecords(){let t=[{name:"Action",value:"Records"}];return await this.process.read({tags:t})}async getOwner(){return(await this.getInfo()).Owner}async getControllers(){let t=[{name:"Action",value:"Controllers"}];return await this.process.read({tags:t})}async getName(){return(await this.getInfo()).Name}async getTicker(){return(await this.getInfo()).Ticker}async getBalances(){let t=[{name:"Action",value:"Balances"}];return await this.process.read({tags:t})}async getBalance({address:t}){let n=[{name:"Action",value:"Balance"},{name:"Recipient",value:t}];return await this.process.read({tags:n})}},xk=class extends s8{signer;constructor({signer:t,...n}){super(n),this.signer=A1(t)}async transfer({target:t}){let n=[{name:"Action",value:"Transfer"},{name:"Recipient",value:t}];return this.process.send({tags:n,signer:this.signer})}async addController({controller:t}){let n=[{name:"Action",value:"Add-Controller"},{name:"Controller",value:t}];return this.process.send({tags:n,signer:this.signer})}async removeController({controller:t}){let n=[{name:"Action",value:"Remove-Controller"},{name:"Controller",value:t}];return this.process.send({tags:n,signer:this.signer})}async setRecord({undername:t,transactionId:n,ttlSeconds:f}){return this.process.send({tags:[{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:t},{name:"Transaction-Id",value:n},{name:"TTL-Seconds",value:f.toString()}],signer:this.signer})}async removeRecord({undername:t}){return this.process.send({tags:[{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:t}],signer:this.signer})}async setTicker({ticker:t}){return this.process.send({tags:[{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:t}],signer:this.signer})}async setName({name:t}){return this.process.send({tags:[{name:"Action",value:"Set-Name"},{name:"Name",value:t}],signer:this.signer})}};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function Rk(e){try{return JSON.parse(e)}catch{return e}}var Ws=class{logger;processId;ao;constructor({processId:t,ao:n=Fd(),logger:f=rh.default}){this.processId=t,this.logger=f,this.ao=n}async read({tags:t,retries:n=3}){let f=0,a;for(;f<n;)try{this.logger.debug("Evaluating read interaction on contract",{tags:t});let d=await this.ao.dryrun({process:this.processId,tags:t});if(d.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);let v=d.Messages[0].Tags.find(m=>m.name==="Error");if(v)throw new Error(`${v.Value}: ${d.Messages[0].Data}`);return this.logger.debug("Read interaction result",{result:d.Messages[0].Data}),d.Messages[0].Data===void 0?{}:Rk(d.Messages[0].Data)}catch(d){f++,this.logger.debug(`Read attempt ${f} failed`,{error:d,tags:t}),a=d,await new Promise(l=>setTimeout(l,2**f*1e3))}throw a}async send({tags:t,data:n,signer:f,retries:a=3}){let d=0,l;for(;d<a;)try{this.logger.debug("Evaluating send interaction on contract",{tags:t,data:n,processId:this.processId});let v=await this.ao.message({process:this.processId,tags:[...t,{name:"AR-IO-SDK",value:bd}],data:n,signer:f});this.logger.debug("Sent message to process",{messageId:v,processId:this.processId});let w=await this.ao.result({message:v,process:this.processId});if(this.logger.debug("Message result",{output:w,messageId:v,processId:this.processId}),w.Messages?.length===0||w.Messages===void 0)return{id:v};let y=w.Messages[0].Tags.find(S=>S.name==="Error");if(y){let S=w.Messages[0].Data;throw new gg(`${y.Value}: ${S}`)}if(w.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(w.Messages[0].Data===void 0)return{id:v};let g=Rk(w.Messages[0].Data);return this.logger.debug("Message result data",{resultData:g,messageId:v,processId:this.processId}),{id:v,result:g}}catch(v){if(this.logger.error("Error sending message to process",{error:v.message,processId:this.processId,tags:t}),v.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:d,retries:a,error:v.message,processId:this.processId}),await new Promise(w=>setTimeout(w,2**d*2e3)),d++,l=v;else throw v}throw l}};var x1=class{static init(t){if(t&&t.signer){let{signer:n,...f}=t;return new kk({...f,signer:n})}return new f8(t)}},f8=class{process;arweave;constructor(t,n=tm){if(!t)this.process=new Ws({processId:zl});else if($c(t))this.process=t.process;else if(Uc(t))this.process=new Ws({processId:t.processId});else throw new $h;this.arweave=n}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async getEpochSettings(t){let f=[{name:"Action",value:"Epoch-Settings"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getEpoch(t){let f=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getArNSRecord({name:t}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:t}]})}async getArNSRecords(t){let f=[{name:"Action",value:"Paginated-Records"},{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy},{name:"Sort-Order",value:t?.sortOrder}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getArNSReservedNames(){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"}]})}async getArNSReservedName({name:t}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:t}]})}async getBalance({address:t}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:t}]})}async getBalances(t){let f=[{name:"Action",value:"Paginated-Balances"},{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy},{name:"Sort-Order",value:t?.sortOrder}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getGateway({address:t}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:t}]})}async getGateways(t){let f=[{name:"Action",value:"Paginated-Gateways"},{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy},{name:"Sort-Order",value:t?.sortOrder}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(t=>({timestamp:t.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}]})}async getPrescribedObservers(t){let f=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getPrescribedNames(t){let f=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getObservations(t){let f=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:`${Date.now()}`}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getDistributions(t){let f=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:t?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:t?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:f})}async getTokenCost({intent:t,purchaseType:n,years:f,name:a,quantity:d}){let v=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:t},{name:"Name",value:a},{name:"Years",value:f?.toString()},{name:"Quantity",value:d?.toString()},{name:"Purchase-Type",value:n},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(w=>({timestamp:w.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}].filter(w=>w.value!==void 0);return this.process.read({tags:v})}},kk=class extends f8{signer;constructor({signer:t,...n}){if(Object.keys(n).length===0)super({process:new Ws({processId:zl})}),this.signer=A1(t);else if($c(n))super({process:n.process}),this.signer=A1(t);else if(Uc(n))super({process:new Ws({processId:n.processId})}),this.signer=A1(t);else throw new $h}async transfer({target:t,qty:n},f){let{tags:a=[]}=f||{};return this.process.send({tags:[...a,{name:"Action",value:"Transfer"},{name:"Recipient",value:t},{name:"Quantity",value:n.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:t,allowDelegatedStaking:n,delegateRewardShareRatio:f,fqdn:a,label:d,minDelegatedStake:l,note:v,port:w,properties:m,protocol:y,autoStake:g,observerAddress:S},x){let{tags:A=[]}=x||{},I=[...A,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:t.valueOf().toString()},{name:"Allow-Delegated-Staking",value:n.toString()},{name:"Delegate-Reward-Share-Ratio",value:f.toString()},{name:"FQDN",value:a},{name:"Label",value:d},{name:"Min-Delegated-Stake",value:l.valueOf().toString()},{name:"Note",value:v},{name:"Port",value:w.toString()},{name:"Properties",value:m},{name:"Protocol",value:y},{name:"Auto-Stake",value:g.toString()},{name:"Observer-Address",value:S}].filter(B=>B.value!==void 0);return this.process.send({signer:this.signer,tags:I})}async leaveNetwork(t){let{tags:n=[]}=t||{};return this.process.send({signer:this.signer,tags:[...n,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:t,delegateRewardShareRatio:n,fqdn:f,label:a,minDelegatedStake:d,note:l,port:v,properties:w,protocol:m,autoStake:y,observerAddress:g},S){let{tags:x=[]}=S||{},T=[...x,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:a},{name:"Note",value:l},{name:"FQDN",value:f},{name:"Port",value:v?.toString()},{name:"Properties",value:w},{name:"Protocol",value:m},{name:"Observer-Address",value:g},{name:"Allow-Delegated-Staking",value:t?.toString()},{name:"Delegate-Reward-Share-Ratio",value:n?.toString()},{name:"Min-Delegated-Stake",value:d?.valueOf().toString()},{name:"Auto-Stake",value:y?.toString()}].filter(I=>I.value!==void 0);return this.process.send({signer:this.signer,tags:T})}async delegateStake(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:t.target},{name:"Quantity",value:t.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:t.target},{name:"Quantity",value:t.decreaseQty.valueOf().toString()}]})}async increaseOperatorStake(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:t.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:t.decreaseQty.valueOf().toString()}]})}async saveObservations(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:t.reportTxId},{name:"Failed-Gateways",value:t.failedGateways.join(",")}]})}async buyRecord(t,n){let{tags:f=[]}=n||{},d=[...f,{name:"Action",value:"Buy-Record"},{name:"Name",value:t.name},{name:"Years",value:t.years?.toString()??"1"},{name:"Process-Id",value:t.processId},{name:"Purchase-Type",value:t.type||"lease"}].filter(l=>l.value!==void 0);return this.process.send({signer:this.signer,tags:d})}async extendLease(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Extend-Lease"},{name:"Name",value:t.name},{name:"Years",value:t.years.toString()}]})}async increaseUndernameLimit(t,n){let{tags:f=[]}=n||{};return this.process.send({signer:this.signer,tags:[...f,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:t.name},{name:"Quantity",value:t.increaseCount.toString()}]})}};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function im(e,t){return function(){return e.apply(t,arguments)}}var{toString:_Ie}=Object.prototype,{getPrototypeOf:Bk}=Object,h8=(e=>t=>{let n=_Ie.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Kf=e=>(e=e.toLowerCase(),t=>h8(t)===e),l8=e=>t=>typeof t===e,{isArray:R1}=Array,nm=l8("undefined");function MIe(e){return e!==null&&!nm(e)&&e.constructor!==null&&!nm(e.constructor)&&Vs(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var zre=Kf("ArrayBuffer");function SIe(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zre(e.buffer),t}var EIe=l8("string"),Vs=l8("function"),Hre=l8("number"),c8=e=>e!==null&&typeof e=="object",AIe=e=>e===!0||e===!1,u8=e=>{if(h8(e)!=="object")return!1;let t=Bk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},xIe=Kf("Date"),RIe=Kf("File"),kIe=Kf("Blob"),TIe=Kf("FileList"),IIe=e=>c8(e)&&Vs(e.pipe),BIe=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Vs(e.append)&&((t=h8(e))==="formdata"||t==="object"&&Vs(e.toString)&&e.toString()==="[object FormData]"))},OIe=Kf("URLSearchParams"),[PIe,NIe,CIe,LIe]=["ReadableStream","Request","Response","Headers"].map(Kf),DIe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function am(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let f,a;if(typeof e!="object"&&(e=[e]),R1(e))for(f=0,a=e.length;f<a;f++)t.call(null,e[f],f,e);else{let d=n?Object.getOwnPropertyNames(e):Object.keys(e),l=d.length,v;for(f=0;f<l;f++)v=d[f],t.call(null,e[v],v,e)}}function Kre(e,t){t=t.toLowerCase();let n=Object.keys(e),f=n.length,a;for(;f-- >0;)if(a=n[f],t===a.toLowerCase())return a;return null}var Zre=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wre=e=>!nm(e)&&e!==Zre;function Ik(){let{caseless:e}=Wre(this)&&this||{},t={},n=(f,a)=>{let d=e&&Kre(t,a)||a;u8(t[d])&&u8(f)?t[d]=Ik(t[d],f):u8(f)?t[d]=Ik({},f):R1(f)?t[d]=f.slice():t[d]=f};for(let f=0,a=arguments.length;f<a;f++)arguments[f]&&am(arguments[f],n);return t}var $Ie=(e,t,n,{allOwnKeys:f}={})=>(am(t,(a,d)=>{n&&Vs(a)?e[d]=im(a,n):e[d]=a},{allOwnKeys:f}),e),UIe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qIe=(e,t,n,f)=>{e.prototype=Object.create(t.prototype,f),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},jIe=(e,t,n,f)=>{let a,d,l,v={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),d=a.length;d-- >0;)l=a[d],(!f||f(l,e,t))&&!v[l]&&(t[l]=e[l],v[l]=!0);e=n!==!1&&Bk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},FIe=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let f=e.indexOf(t,n);return f!==-1&&f===n},zIe=e=>{if(!e)return null;if(R1(e))return e;let t=e.length;if(!Hre(t))return null;let n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},HIe=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Bk(Uint8Array)),KIe=(e,t)=>{let f=(e&&e[Symbol.iterator]).call(e),a;for(;(a=f.next())&&!a.done;){let d=a.value;t.call(e,d[0],d[1])}},ZIe=(e,t)=>{let n,f=[];for(;(n=e.exec(t))!==null;)f.push(n);return f},WIe=Kf("HTMLFormElement"),VIe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,f,a){return f.toUpperCase()+a}),jre=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),GIe=Kf("RegExp"),Vre=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),f={};am(n,(a,d)=>{let l;(l=t(a,d,e))!==!1&&(f[d]=l||a)}),Object.defineProperties(e,f)},YIe=e=>{Vre(e,(t,n)=>{if(Vs(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let f=e[n];if(Vs(f)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},JIe=(e,t)=>{let n={},f=a=>{a.forEach(d=>{n[d]=!0})};return R1(e)?f(e):f(String(e).split(t)),n},XIe=()=>{},QIe=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Tk="abcdefghijklmnopqrstuvwxyz",Fre="0123456789",Gre={DIGIT:Fre,ALPHA:Tk,ALPHA_DIGIT:Tk+Tk.toUpperCase()+Fre},eBe=(e=16,t=Gre.ALPHA_DIGIT)=>{let n="",{length:f}=t;for(;e--;)n+=t[Math.random()*f|0];return n};function tBe(e){return!!(e&&Vs(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var rBe=e=>{let t=new Array(10),n=(f,a)=>{if(c8(f)){if(t.indexOf(f)>=0)return;if(!("toJSON"in f)){t[a]=f;let d=R1(f)?[]:{};return am(f,(l,v)=>{let w=n(l,a+1);!nm(w)&&(d[v]=w)}),t[a]=void 0,d}}return f};return n(e,0)},iBe=Kf("AsyncFunction"),nBe=e=>e&&(c8(e)||Vs(e))&&Vs(e.then)&&Vs(e.catch),Kt={isArray:R1,isArrayBuffer:zre,isBuffer:MIe,isFormData:BIe,isArrayBufferView:SIe,isString:EIe,isNumber:Hre,isBoolean:AIe,isObject:c8,isPlainObject:u8,isReadableStream:PIe,isRequest:NIe,isResponse:CIe,isHeaders:LIe,isUndefined:nm,isDate:xIe,isFile:RIe,isBlob:kIe,isRegExp:GIe,isFunction:Vs,isStream:IIe,isURLSearchParams:OIe,isTypedArray:HIe,isFileList:TIe,forEach:am,merge:Ik,extend:$Ie,trim:DIe,stripBOM:UIe,inherits:qIe,toFlatObject:jIe,kindOf:h8,kindOfTest:Kf,endsWith:FIe,toArray:zIe,forEachEntry:KIe,matchAll:ZIe,isHTMLForm:WIe,hasOwnProperty:jre,hasOwnProp:jre,reduceDescriptors:Vre,freezeMethods:YIe,toObjectSet:JIe,toCamelCase:VIe,noop:XIe,toFiniteNumber:QIe,findKey:Kre,global:Zre,isContextDefined:Wre,ALPHABET:Gre,generateString:eBe,isSpecCompliantForm:tBe,toJSONObject:rBe,isAsyncFn:iBe,isThenable:nBe};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function k1(e,t,n,f,a){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),n&&(this.config=n),f&&(this.request=f),a&&(this.response=a)}Kt.inherits(k1,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:Kt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Yre=k1.prototype,Jre={};["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=>{Jre[e]={value:e}});Object.defineProperties(k1,Jre);Object.defineProperty(Yre,"isAxiosError",{value:!0});k1.from=(e,t,n,f,a,d)=>{let l=Object.create(Yre);return Kt.toFlatObject(e,l,function(w){return w!==Error.prototype},v=>v!=="isAxiosError"),k1.call(l,e.message,t,n,f,a),l.cause=e,l.name=e.name,d&&Object.assign(l,d),l};var zr=k1;Be();Pe();Oe();var d8=null;function Ok(e){return Kt.isPlainObject(e)||Kt.isArray(e)}function Qre(e){return Kt.endsWith(e,"[]")?e.slice(0,-2):e}function Xre(e,t,n){return e?e.concat(t).map(function(a,d){return a=Qre(a),!n&&d?"["+a+"]":a}).join(n?".":""):t}function aBe(e){return Kt.isArray(e)&&!e.some(Ok)}var oBe=Kt.toFlatObject(Kt,{},null,function(t){return/^is[A-Z]/.test(t)});function sBe(e,t,n){if(!Kt.isObject(e))throw new TypeError("target must be an object");t=t||new(d8||FormData),n=Kt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,I){return!Kt.isUndefined(I[T])});let f=n.metaTokens,a=n.visitor||y,d=n.dots,l=n.indexes,w=(n.Blob||typeof Blob<"u"&&Blob)&&Kt.isSpecCompliantForm(t);if(!Kt.isFunction(a))throw new TypeError("visitor must be a function");function m(A){if(A===null)return"";if(Kt.isDate(A))return A.toISOString();if(!w&&Kt.isBlob(A))throw new zr("Blob is not supported. Use a Buffer instead.");return Kt.isArrayBuffer(A)||Kt.isTypedArray(A)?w&&typeof Blob=="function"?new Blob([A]):St.from(A):A}function y(A,T,I){let B=A;if(A&&!I&&typeof A=="object"){if(Kt.endsWith(T,"{}"))T=f?T:T.slice(0,-2),A=JSON.stringify(A);else if(Kt.isArray(A)&&aBe(A)||(Kt.isFileList(A)||Kt.endsWith(T,"[]"))&&(B=Kt.toArray(A)))return T=Qre(T),B.forEach(function(C,q){!(Kt.isUndefined(C)||C===null)&&t.append(l===!0?Xre([T],q,d):l===null?T:T+"[]",m(C))}),!1}return Ok(A)?!0:(t.append(Xre(I,T,d),m(A)),!1)}let g=[],S=Object.assign(oBe,{defaultVisitor:y,convertValue:m,isVisitable:Ok});function x(A,T){if(!Kt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+T.join("."));g.push(A),Kt.forEach(A,function(B,P){(!(Kt.isUndefined(B)||B===null)&&a.call(t,B,Kt.isString(P)?P.trim():P,T,S))===!0&&x(B,T?T.concat(P):[P])}),g.pop()}}if(!Kt.isObject(e))throw new TypeError("data must be an object");return x(e),t}var Nl=sBe;function eie(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(f){return t[f]})}function tie(e,t){this._pairs=[],e&&Nl(e,this,t)}var rie=tie.prototype;rie.append=function(t,n){this._pairs.push([t,n])};rie.toString=function(t){let n=t?function(f){return t.call(this,f,eie)}:eie;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};var p8=tie;function fBe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function om(e,t,n){if(!t)return e;let f=n&&n.encode||fBe,a=n&&n.serialize,d;if(a?d=a(t,n):d=Kt.isURLSearchParams(t)?t.toString():new p8(t,n).toString(f),d){let l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+d}return e}Be();Pe();Oe();var Pk=class{constructor(){this.handlers=[]}use(t,n,f){return this.handlers.push({fulfilled:t,rejected:n,synchronous:f?f.synchronous:!1,runWhen:f?f.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Kt.forEach(this.handlers,function(f){f!==null&&t(f)})}},Nk=Pk;Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var v8={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var iie=typeof URLSearchParams<"u"?URLSearchParams:p8;Be();Pe();Oe();var nie=typeof FormData<"u"?FormData:null;Be();Pe();Oe();var aie=typeof Blob<"u"?Blob:null;var oie={isBrowser:!0,classes:{URLSearchParams:iie,FormData:nie,Blob:aie},protocols:["http","https","file","blob","url","data"]};var Lk={};To(Lk,{hasBrowserEnv:()=>Ck,hasStandardBrowserEnv:()=>uBe,hasStandardBrowserWebWorkerEnv:()=>hBe,origin:()=>lBe});Be();Pe();Oe();var Ck=typeof window<"u"&&typeof document<"u",uBe=(e=>Ck&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),hBe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",lBe=Ck&&window.location.href||"http://localhost";var Ea={...Lk,...oie};function Dk(e,t){return Nl(e,new Ea.classes.URLSearchParams,Object.assign({visitor:function(n,f,a,d){return Ea.isNode&&Kt.isBuffer(n)?(this.append(f,n.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},t))}Be();Pe();Oe();function cBe(e){return Kt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function dBe(e){let t={},n=Object.keys(e),f,a=n.length,d;for(f=0;f<a;f++)d=n[f],t[d]=e[d];return t}function pBe(e){function t(n,f,a,d){let l=n[d++];if(l==="__proto__")return!0;let v=Number.isFinite(+l),w=d>=n.length;return l=!l&&Kt.isArray(a)?a.length:l,w?(Kt.hasOwnProp(a,l)?a[l]=[a[l],f]:a[l]=f,!v):((!a[l]||!Kt.isObject(a[l]))&&(a[l]=[]),t(n,f,a[l],d)&&Kt.isArray(a[l])&&(a[l]=dBe(a[l])),!v)}if(Kt.isFormData(e)&&Kt.isFunction(e.entries)){let n={};return Kt.forEachEntry(e,(f,a)=>{t(cBe(f),a,n,0)}),n}return null}var m8=pBe;function vBe(e,t,n){if(Kt.isString(e))try{return(t||JSON.parse)(e),Kt.trim(e)}catch(f){if(f.name!=="SyntaxError")throw f}return(n||JSON.stringify)(e)}var $k={transitional:v8,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let f=n.getContentType()||"",a=f.indexOf("application/json")>-1,d=Kt.isObject(t);if(d&&Kt.isHTMLForm(t)&&(t=new FormData(t)),Kt.isFormData(t))return a?JSON.stringify(m8(t)):t;if(Kt.isArrayBuffer(t)||Kt.isBuffer(t)||Kt.isStream(t)||Kt.isFile(t)||Kt.isBlob(t)||Kt.isReadableStream(t))return t;if(Kt.isArrayBufferView(t))return t.buffer;if(Kt.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let v;if(d){if(f.indexOf("application/x-www-form-urlencoded")>-1)return Dk(t,this.formSerializer).toString();if((v=Kt.isFileList(t))||f.indexOf("multipart/form-data")>-1){let w=this.env&&this.env.FormData;return Nl(v?{"files[]":t}:t,w&&new w,this.formSerializer)}}return d||a?(n.setContentType("application/json",!1),vBe(t)):t}],transformResponse:[function(t){let n=this.transitional||$k.transitional,f=n&&n.forcedJSONParsing,a=this.responseType==="json";if(Kt.isResponse(t)||Kt.isReadableStream(t))return t;if(t&&Kt.isString(t)&&(f&&!this.responseType||a)){let l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(v){if(l)throw v.name==="SyntaxError"?zr.from(v,zr.ERR_BAD_RESPONSE,this,null,this.response):v}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ea.classes.FormData,Blob:Ea.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Kt.forEach(["delete","get","head","post","put","patch"],e=>{$k.headers[e]={}});var T1=$k;Be();Pe();Oe();Be();Pe();Oe();var mBe=Kt.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"]),sie=e=>{let t={},n,f,a;return e&&e.split(`
|
|
194
194
|
`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),f=l.substring(a+1).trim(),!(!n||t[n]&&mBe[n])&&(n==="set-cookie"?t[n]?t[n].push(f):t[n]=[f]:t[n]=t[n]?t[n]+", "+f:f)}),t};var fie=Symbol("internals");function sm(e){return e&&String(e).trim().toLowerCase()}function g8(e){return e===!1||e==null?e:Kt.isArray(e)?e.map(g8):String(e)}function gBe(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,f;for(;f=n.exec(e);)t[f[1]]=f[2];return t}var yBe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Uk(e,t,n,f,a){if(Kt.isFunction(f))return f.call(this,t,n);if(a&&(t=n),!!Kt.isString(t)){if(Kt.isString(f))return t.indexOf(f)!==-1;if(Kt.isRegExp(f))return f.test(t)}}function bBe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,f)=>n.toUpperCase()+f)}function wBe(e,t){let n=Kt.toCamelCase(" "+t);["get","set","has"].forEach(f=>{Object.defineProperty(e,f+n,{value:function(a,d,l){return this[f].call(this,t,a,d,l)},configurable:!0})})}var I1=class{constructor(t){t&&this.set(t)}set(t,n,f){let a=this;function d(v,w,m){let y=sm(w);if(!y)throw new Error("header name must be a non-empty string");let g=Kt.findKey(a,y);(!g||a[g]===void 0||m===!0||m===void 0&&a[g]!==!1)&&(a[g||w]=g8(v))}let l=(v,w)=>Kt.forEach(v,(m,y)=>d(m,y,w));if(Kt.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(Kt.isString(t)&&(t=t.trim())&&!yBe(t))l(sie(t),n);else if(Kt.isHeaders(t))for(let[v,w]of t.entries())d(w,v,f);else t!=null&&d(n,t,f);return this}get(t,n){if(t=sm(t),t){let f=Kt.findKey(this,t);if(f){let a=this[f];if(!n)return a;if(n===!0)return gBe(a);if(Kt.isFunction(n))return n.call(this,a,f);if(Kt.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=sm(t),t){let f=Kt.findKey(this,t);return!!(f&&this[f]!==void 0&&(!n||Uk(this,this[f],f,n)))}return!1}delete(t,n){let f=this,a=!1;function d(l){if(l=sm(l),l){let v=Kt.findKey(f,l);v&&(!n||Uk(f,f[v],v,n))&&(delete f[v],a=!0)}}return Kt.isArray(t)?t.forEach(d):d(t),a}clear(t){let n=Object.keys(this),f=n.length,a=!1;for(;f--;){let d=n[f];(!t||Uk(this,this[d],d,t,!0))&&(delete this[d],a=!0)}return a}normalize(t){let n=this,f={};return Kt.forEach(this,(a,d)=>{let l=Kt.findKey(f,d);if(l){n[l]=g8(a),delete n[d];return}let v=t?bBe(d):String(d).trim();v!==d&&delete n[d],n[v]=g8(a),f[v]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let n=Object.create(null);return Kt.forEach(this,(f,a)=>{f!=null&&f!==!1&&(n[a]=t&&Kt.isArray(f)?f.join(", "):f)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
195
195
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let f=new this(t);return n.forEach(a=>f.set(a)),f}static accessor(t){let f=(this[fie]=this[fie]={accessors:{}}).accessors,a=this.prototype;function d(l){let v=sm(l);f[v]||(wBe(a,l),f[v]=!0)}return Kt.isArray(t)?t.forEach(d):d(t),this}};I1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Kt.reduceDescriptors(I1.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(f){this[n]=f}}});Kt.freezeMethods(I1);var ua=I1;function fm(e,t){let n=this||T1,f=t||n,a=ua.from(f.headers),d=f.data;return Kt.forEach(e,function(v){d=v.call(n,d,a.normalize(),t?t.status:void 0)}),a.normalize(),d}Be();Pe();Oe();function um(e){return!!(e&&e.__CANCEL__)}Be();Pe();Oe();function uie(e,t,n){zr.call(this,e??"canceled",zr.ERR_CANCELED,t,n),this.name="CanceledError"}Kt.inherits(uie,zr,{__CANCEL__:!0});var Pu=uie;Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function hm(e,t,n){let f=n.config.validateStatus;!n.status||!f||f(n.status)?e(n):t(new zr("Request failed with status code "+n.status,[zr.ERR_BAD_REQUEST,zr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}Be();Pe();Oe();function qk(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}Be();Pe();Oe();Be();Pe();Oe();function _Be(e,t){e=e||10;let n=new Array(e),f=new Array(e),a=0,d=0,l;return t=t!==void 0?t:1e3,function(w){let m=Date.now(),y=f[d];l||(l=m),n[a]=w,f[a]=m;let g=d,S=0;for(;g!==a;)S+=n[g++],g=g%e;if(a=(a+1)%e,a===d&&(d=(d+1)%e),m-l<t)return;let x=y&&m-y;return x?Math.round(S*1e3/x):void 0}}var hie=_Be;Be();Pe();Oe();function MBe(e,t){let n=0,f=1e3/t,a=null;return function(){let l=this===!0,v=Date.now();if(l||v-n>f)return a&&(clearTimeout(a),a=null),n=v,e.apply(null,arguments);a||(a=setTimeout(()=>(a=null,n=Date.now(),e.apply(null,arguments)),f-(v-n)))}}var lie=MBe;var B1=(e,t,n=3)=>{let f=0,a=hie(50,250);return lie(d=>{let l=d.loaded,v=d.lengthComputable?d.total:void 0,w=l-f,m=a(w),y=l<=v;f=l;let g={loaded:l,total:v,progress:v?l/v:void 0,bytes:w,rate:m||void 0,estimated:m&&v&&y?(v-l)/m:void 0,event:d,lengthComputable:v!=null};g[t?"download":"upload"]=!0,e(g)},n)};Be();Pe();Oe();Be();Pe();Oe();var cie=Ea.hasStandardBrowserEnv?function(){let t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),f;function a(d){let l=d;return t&&(n.setAttribute("href",l),l=n.href),n.setAttribute("href",l),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return f=a(window.location.href),function(l){let v=Kt.isString(l)?a(l):l;return v.protocol===f.protocol&&v.host===f.host}}():function(){return function(){return!0}}();Be();Pe();Oe();var die=Ea.hasStandardBrowserEnv?{write(e,t,n,f,a,d){let l=[e+"="+encodeURIComponent(t)];Kt.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),Kt.isString(f)&&l.push("path="+f),Kt.isString(a)&&l.push("domain="+a),d===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};Be();Pe();Oe();Be();Pe();Oe();function jk(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}Be();Pe();Oe();function Fk(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function lm(e,t){return e&&!jk(t)?Fk(e,t):t}Be();Pe();Oe();var pie=e=>e instanceof ua?{...e}:e;function Zf(e,t){t=t||{};let n={};function f(m,y,g){return Kt.isPlainObject(m)&&Kt.isPlainObject(y)?Kt.merge.call({caseless:g},m,y):Kt.isPlainObject(y)?Kt.merge({},y):Kt.isArray(y)?y.slice():y}function a(m,y,g){if(Kt.isUndefined(y)){if(!Kt.isUndefined(m))return f(void 0,m,g)}else return f(m,y,g)}function d(m,y){if(!Kt.isUndefined(y))return f(void 0,y)}function l(m,y){if(Kt.isUndefined(y)){if(!Kt.isUndefined(m))return f(void 0,m)}else return f(void 0,y)}function v(m,y,g){if(g in t)return f(m,y);if(g in e)return f(void 0,m)}let w={url:d,method:d,data:d,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:v,headers:(m,y)=>a(pie(m),pie(y),!0)};return Kt.forEach(Object.keys(Object.assign({},e,t)),function(y){let g=w[y]||a,S=g(e[y],t[y],y);Kt.isUndefined(S)&&g!==v||(n[y]=S)}),n}var y8=e=>{let t=Zf({},e),{data:n,withXSRFToken:f,xsrfHeaderName:a,xsrfCookieName:d,headers:l,auth:v}=t;t.headers=l=ua.from(l),t.url=om(lm(t.baseURL,t.url),e.params,e.paramsSerializer),v&&l.set("Authorization","Basic "+btoa((v.username||"")+":"+(v.password?unescape(encodeURIComponent(v.password)):"")));let w;if(Kt.isFormData(n)){if(Ea.hasStandardBrowserEnv||Ea.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((w=l.getContentType())!==!1){let[m,...y]=w?w.split(";").map(g=>g.trim()).filter(Boolean):[];l.setContentType([m||"multipart/form-data",...y].join("; "))}}if(Ea.hasStandardBrowserEnv&&(f&&Kt.isFunction(f)&&(f=f(t)),f||f!==!1&&cie(t.url))){let m=a&&d&&die.read(d);m&&l.set(a,m)}return t};var SBe=typeof XMLHttpRequest<"u",vie=SBe&&function(e){return new Promise(function(n,f){let a=y8(e),d=a.data,l=ua.from(a.headers).normalize(),{responseType:v}=a,w;function m(){a.cancelToken&&a.cancelToken.unsubscribe(w),a.signal&&a.signal.removeEventListener("abort",w)}let y=new XMLHttpRequest;y.open(a.method.toUpperCase(),a.url,!0),y.timeout=a.timeout;function g(){if(!y)return;let x=ua.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),T={data:!v||v==="text"||v==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:e,request:y};hm(function(B){n(B),m()},function(B){f(B),m()},T),y=null}"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(g)},y.onabort=function(){y&&(f(new zr("Request aborted",zr.ECONNABORTED,a,y)),y=null)},y.onerror=function(){f(new zr("Network Error",zr.ERR_NETWORK,a,y)),y=null},y.ontimeout=function(){let A=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",T=a.transitional||v8;a.timeoutErrorMessage&&(A=a.timeoutErrorMessage),f(new zr(A,T.clarifyTimeoutError?zr.ETIMEDOUT:zr.ECONNABORTED,a,y)),y=null},d===void 0&&l.setContentType(null),"setRequestHeader"in y&&Kt.forEach(l.toJSON(),function(A,T){y.setRequestHeader(T,A)}),Kt.isUndefined(a.withCredentials)||(y.withCredentials=!!a.withCredentials),v&&v!=="json"&&(y.responseType=a.responseType),typeof a.onDownloadProgress=="function"&&y.addEventListener("progress",B1(a.onDownloadProgress,!0)),typeof a.onUploadProgress=="function"&&y.upload&&y.upload.addEventListener("progress",B1(a.onUploadProgress)),(a.cancelToken||a.signal)&&(w=x=>{y&&(f(!x||x.type?new Pu(null,e,y):x),y.abort(),y=null)},a.cancelToken&&a.cancelToken.subscribe(w),a.signal&&(a.signal.aborted?w():a.signal.addEventListener("abort",w)));let S=qk(a.url);if(S&&Ea.protocols.indexOf(S)===-1){f(new zr("Unsupported protocol "+S+":",zr.ERR_BAD_REQUEST,e));return}y.send(d||null)})};Be();Pe();Oe();Be();Pe();Oe();var EBe=(e,t)=>{let n=new AbortController,f,a=function(w){if(!f){f=!0,l();let m=w instanceof Error?w:this.reason;n.abort(m instanceof zr?m:new Pu(m instanceof Error?m.message:m))}},d=t&&setTimeout(()=>{a(new zr(`timeout ${t} of ms exceeded`,zr.ETIMEDOUT))},t),l=()=>{e&&(d&&clearTimeout(d),d=null,e.forEach(w=>{w&&(w.removeEventListener?w.removeEventListener("abort",a):w.unsubscribe(a))}),e=null)};e.forEach(w=>w&&w.addEventListener&&w.addEventListener("abort",a));let{signal:v}=n;return v.unsubscribe=l,[v,()=>{d&&clearTimeout(d),d=null}]},mie=EBe;Be();Pe();Oe();var ABe=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let f=0,a;for(;f<n;)a=f+t,yield e.slice(f,a),f=a},xBe=async function*(e,t,n){for await(let f of e)yield*ABe(ArrayBuffer.isView(f)?f:await n(String(f)),t)},zk=(e,t,n,f,a)=>{let d=xBe(e,t,a),l=0;return new ReadableStream({type:"bytes",async pull(v){let{done:w,value:m}=await d.next();if(w){v.close(),f();return}let y=m.byteLength;n&&n(l+=y),v.enqueue(new Uint8Array(m))},cancel(v){return f(v),d.return()}},{highWaterMark:2})};var gie=(e,t)=>{let n=e!=null;return f=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:f}))},w8=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",bie=w8&&typeof ReadableStream=="function",Hk=w8&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),RBe=bie&&(()=>{let e=!1,t=new Request(Ea.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),yie=64*1024,Kk=bie&&!!(()=>{try{return Kt.isReadableStream(new Response("").body)}catch{}})(),b8={stream:Kk&&(e=>e.body)};w8&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!b8[t]&&(b8[t]=Kt.isFunction(e[t])?n=>n[t]():(n,f)=>{throw new zr(`Response type '${t}' is not supported`,zr.ERR_NOT_SUPPORT,f)})})})(new Response);var kBe=async e=>{if(e==null)return 0;if(Kt.isBlob(e))return e.size;if(Kt.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(Kt.isArrayBufferView(e))return e.byteLength;if(Kt.isURLSearchParams(e)&&(e=e+""),Kt.isString(e))return(await Hk(e)).byteLength},TBe=async(e,t)=>{let n=Kt.toFiniteNumber(e.getContentLength());return n??kBe(t)},wie=w8&&(async e=>{let{url:t,method:n,data:f,signal:a,cancelToken:d,timeout:l,onDownloadProgress:v,onUploadProgress:w,responseType:m,headers:y,withCredentials:g="same-origin",fetchOptions:S}=y8(e);m=m?(m+"").toLowerCase():"text";let[x,A]=a||d||l?mie([a,d],l):[],T,I,B=()=>{!T&&setTimeout(()=>{x&&x.unsubscribe()}),T=!0},P;try{if(w&&RBe&&n!=="get"&&n!=="head"&&(P=await TBe(y,f))!==0){let G=new Request(t,{method:"POST",body:f,duplex:"half"}),j;Kt.isFormData(f)&&(j=G.headers.get("content-type"))&&y.setContentType(j),G.body&&(f=zk(G.body,yie,gie(P,B1(w)),null,Hk))}Kt.isString(g)||(g=g?"cors":"omit"),I=new Request(t,{...S,signal:x,method:n.toUpperCase(),headers:y.normalize().toJSON(),body:f,duplex:"half",withCredentials:g});let C=await fetch(I),q=Kk&&(m==="stream"||m==="response");if(Kk&&(v||q)){let G={};["status","statusText","headers"].forEach(z=>{G[z]=C[z]});let j=Kt.toFiniteNumber(C.headers.get("content-length"));C=new Response(zk(C.body,yie,v&&gie(j,B1(v,!0)),q&&B,Hk),G)}m=m||"text";let K=await b8[Kt.findKey(b8,m)||"text"](C,e);return!q&&B(),A&&A(),await new Promise((G,j)=>{hm(G,j,{data:K,headers:ua.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:I})})}catch(C){throw B(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new zr("Network Error",zr.ERR_NETWORK,e,I),{cause:C.cause||C}):zr.from(C,C&&C.code,e,I)}});var Zk={http:d8,xhr:vie,fetch:wie};Kt.forEach(Zk,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var _ie=e=>`- ${e}`,IBe=e=>Kt.isFunction(e)||e===null||e===!1,_8={getAdapter:e=>{e=Kt.isArray(e)?e:[e];let{length:t}=e,n,f,a={};for(let d=0;d<t;d++){n=e[d];let l;if(f=n,!IBe(n)&&(f=Zk[(l=String(n)).toLowerCase()],f===void 0))throw new zr(`Unknown adapter '${l}'`);if(f)break;a[l||"#"+d]=f}if(!f){let d=Object.entries(a).map(([v,w])=>`adapter ${v} `+(w===!1?"is not supported by the environment":"is not available in the build")),l=t?d.length>1?`since :
|
|
196
196
|
`+d.map(_ie).join(`
|