f.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){n(typeof f=="number"&&f>=0);var p=Math.ceil(f/26)|0,E=f%26;this._expand(p),E>0&&p--;for(var k=0;k0&&(this.words[k]=~this.words[k]&67108863>>26-E),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,p){n(typeof f=="number"&&f>=0);var E=f/26|0,k=f%26;return this._expand(E+1),p?this.words[E]=this.words[E]|1<f.length?(E=this,k=f):(E=f,k=this);for(var _=0,C=0;C>>26;for(;_!==0&&C>>26;if(this.length=E.length,_!==0)this.words[this.length]=_,this.length++;else if(E!==this)for(;Cf.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var p=this.iadd(f);return f.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var E=this.cmp(f);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var k,_;E>0?(k=this,_=f):(k=f,_=this);for(var C=0,R=0;R<_.length;R++)p=(k.words[R]|0)-(_.words[R]|0)+C,C=p>>26,this.words[R]=p&67108863;for(;C!==0&&R>26,this.words[R]=p&67108863;if(C===0&&R>>26,Y=N&67108863,v=Math.min(d,f.length-1),B=Math.max(0,d-I.length+1);B<=v;B++){var F=d-B|0;k=I.words[F]|0,_=f.words[B]|0,C=k*_+Y,P+=C/67108864|0,Y=C&67108863}p.words[d]=Y|0,N=P|0}return N!==0?p.words[d]=N|0:p.length--,p._strip()}var y=function(f,p,E){var k=f.words,_=p.words,C=E.words,R=0,N,d,P,Y=k[0]|0,v=Y&8191,B=Y>>>13,F=k[1]|0,U=F&8191,q=F>>>13,ie=k[2]|0,Q=ie&8191,W=ie>>>13,Ye=k[3]|0,K=Ye&8191,ae=Ye>>>13,Yr=k[4]|0,Te=Yr&8191,Me=Yr>>>13,Xr=k[5]|0,Pe=Xr&8191,ce=Xr>>>13,xr=k[6]|0,fe=xr&8191,Le=xr>>>13,Zr=k[7]|0,me=Zr&8191,$e=Zr>>>13,bn=k[8]|0,He=bn&8191,Ve=bn>>>13,Vt=k[9]|0,je=Vt&8191,qe=Vt>>>13,Tr=_[0]|0,Ce=Tr&8191,Ge=Tr>>>13,En=_[1]|0,Be=En&8191,We=En>>>13,An=_[2]|0,De=An&8191,ne=An>>>13,at=_[3]|0,ge=at&8191,he=at>>>13,nt=_[4]|0,Ae=nt&8191,_e=nt>>>13,Pt=_[5]|0,Ie=Pt&8191,Fe=Pt>>>13,Qt=_[6]|0,Ke=Qt&8191,Qe=Qt>>>13,Jt=_[7]|0,Re=Jt&8191,Ue=Jt>>>13,br=_[8]|0,ke=br&8191,Xe=br>>>13,Pi=_[9]|0,Ze=Pi&8191,et=Pi>>>13;E.negative=f.negative^p.negative,E.length=19,N=Math.imul(v,Ce),d=Math.imul(v,Ge),d=d+Math.imul(B,Ce)|0,P=Math.imul(B,Ge);var Kn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,N=Math.imul(U,Ce),d=Math.imul(U,Ge),d=d+Math.imul(q,Ce)|0,P=Math.imul(q,Ge),N=N+Math.imul(v,Be)|0,d=d+Math.imul(v,We)|0,d=d+Math.imul(B,Be)|0,P=P+Math.imul(B,We)|0;var Qn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,N=Math.imul(Q,Ce),d=Math.imul(Q,Ge),d=d+Math.imul(W,Ce)|0,P=Math.imul(W,Ge),N=N+Math.imul(U,Be)|0,d=d+Math.imul(U,We)|0,d=d+Math.imul(q,Be)|0,P=P+Math.imul(q,We)|0,N=N+Math.imul(v,De)|0,d=d+Math.imul(v,ne)|0,d=d+Math.imul(B,De)|0,P=P+Math.imul(B,ne)|0;var Jn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,N=Math.imul(K,Ce),d=Math.imul(K,Ge),d=d+Math.imul(ae,Ce)|0,P=Math.imul(ae,Ge),N=N+Math.imul(Q,Be)|0,d=d+Math.imul(Q,We)|0,d=d+Math.imul(W,Be)|0,P=P+Math.imul(W,We)|0,N=N+Math.imul(U,De)|0,d=d+Math.imul(U,ne)|0,d=d+Math.imul(q,De)|0,P=P+Math.imul(q,ne)|0,N=N+Math.imul(v,ge)|0,d=d+Math.imul(v,he)|0,d=d+Math.imul(B,ge)|0,P=P+Math.imul(B,he)|0;var Yn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,N=Math.imul(Te,Ce),d=Math.imul(Te,Ge),d=d+Math.imul(Me,Ce)|0,P=Math.imul(Me,Ge),N=N+Math.imul(K,Be)|0,d=d+Math.imul(K,We)|0,d=d+Math.imul(ae,Be)|0,P=P+Math.imul(ae,We)|0,N=N+Math.imul(Q,De)|0,d=d+Math.imul(Q,ne)|0,d=d+Math.imul(W,De)|0,P=P+Math.imul(W,ne)|0,N=N+Math.imul(U,ge)|0,d=d+Math.imul(U,he)|0,d=d+Math.imul(q,ge)|0,P=P+Math.imul(q,he)|0,N=N+Math.imul(v,Ae)|0,d=d+Math.imul(v,_e)|0,d=d+Math.imul(B,Ae)|0,P=P+Math.imul(B,_e)|0;var Xn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,N=Math.imul(Pe,Ce),d=Math.imul(Pe,Ge),d=d+Math.imul(ce,Ce)|0,P=Math.imul(ce,Ge),N=N+Math.imul(Te,Be)|0,d=d+Math.imul(Te,We)|0,d=d+Math.imul(Me,Be)|0,P=P+Math.imul(Me,We)|0,N=N+Math.imul(K,De)|0,d=d+Math.imul(K,ne)|0,d=d+Math.imul(ae,De)|0,P=P+Math.imul(ae,ne)|0,N=N+Math.imul(Q,ge)|0,d=d+Math.imul(Q,he)|0,d=d+Math.imul(W,ge)|0,P=P+Math.imul(W,he)|0,N=N+Math.imul(U,Ae)|0,d=d+Math.imul(U,_e)|0,d=d+Math.imul(q,Ae)|0,P=P+Math.imul(q,_e)|0,N=N+Math.imul(v,Ie)|0,d=d+Math.imul(v,Fe)|0,d=d+Math.imul(B,Ie)|0,P=P+Math.imul(B,Fe)|0;var ic=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(ic>>>26)|0,ic&=67108863,N=Math.imul(fe,Ce),d=Math.imul(fe,Ge),d=d+Math.imul(Le,Ce)|0,P=Math.imul(Le,Ge),N=N+Math.imul(Pe,Be)|0,d=d+Math.imul(Pe,We)|0,d=d+Math.imul(ce,Be)|0,P=P+Math.imul(ce,We)|0,N=N+Math.imul(Te,De)|0,d=d+Math.imul(Te,ne)|0,d=d+Math.imul(Me,De)|0,P=P+Math.imul(Me,ne)|0,N=N+Math.imul(K,ge)|0,d=d+Math.imul(K,he)|0,d=d+Math.imul(ae,ge)|0,P=P+Math.imul(ae,he)|0,N=N+Math.imul(Q,Ae)|0,d=d+Math.imul(Q,_e)|0,d=d+Math.imul(W,Ae)|0,P=P+Math.imul(W,_e)|0,N=N+Math.imul(U,Ie)|0,d=d+Math.imul(U,Fe)|0,d=d+Math.imul(q,Ie)|0,P=P+Math.imul(q,Fe)|0,N=N+Math.imul(v,Ke)|0,d=d+Math.imul(v,Qe)|0,d=d+Math.imul(B,Ke)|0,P=P+Math.imul(B,Qe)|0;var sc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(sc>>>26)|0,sc&=67108863,N=Math.imul(me,Ce),d=Math.imul(me,Ge),d=d+Math.imul($e,Ce)|0,P=Math.imul($e,Ge),N=N+Math.imul(fe,Be)|0,d=d+Math.imul(fe,We)|0,d=d+Math.imul(Le,Be)|0,P=P+Math.imul(Le,We)|0,N=N+Math.imul(Pe,De)|0,d=d+Math.imul(Pe,ne)|0,d=d+Math.imul(ce,De)|0,P=P+Math.imul(ce,ne)|0,N=N+Math.imul(Te,ge)|0,d=d+Math.imul(Te,he)|0,d=d+Math.imul(Me,ge)|0,P=P+Math.imul(Me,he)|0,N=N+Math.imul(K,Ae)|0,d=d+Math.imul(K,_e)|0,d=d+Math.imul(ae,Ae)|0,P=P+Math.imul(ae,_e)|0,N=N+Math.imul(Q,Ie)|0,d=d+Math.imul(Q,Fe)|0,d=d+Math.imul(W,Ie)|0,P=P+Math.imul(W,Fe)|0,N=N+Math.imul(U,Ke)|0,d=d+Math.imul(U,Qe)|0,d=d+Math.imul(q,Ke)|0,P=P+Math.imul(q,Qe)|0,N=N+Math.imul(v,Re)|0,d=d+Math.imul(v,Ue)|0,d=d+Math.imul(B,Re)|0,P=P+Math.imul(B,Ue)|0;var oc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(oc>>>26)|0,oc&=67108863,N=Math.imul(He,Ce),d=Math.imul(He,Ge),d=d+Math.imul(Ve,Ce)|0,P=Math.imul(Ve,Ge),N=N+Math.imul(me,Be)|0,d=d+Math.imul(me,We)|0,d=d+Math.imul($e,Be)|0,P=P+Math.imul($e,We)|0,N=N+Math.imul(fe,De)|0,d=d+Math.imul(fe,ne)|0,d=d+Math.imul(Le,De)|0,P=P+Math.imul(Le,ne)|0,N=N+Math.imul(Pe,ge)|0,d=d+Math.imul(Pe,he)|0,d=d+Math.imul(ce,ge)|0,P=P+Math.imul(ce,he)|0,N=N+Math.imul(Te,Ae)|0,d=d+Math.imul(Te,_e)|0,d=d+Math.imul(Me,Ae)|0,P=P+Math.imul(Me,_e)|0,N=N+Math.imul(K,Ie)|0,d=d+Math.imul(K,Fe)|0,d=d+Math.imul(ae,Ie)|0,P=P+Math.imul(ae,Fe)|0,N=N+Math.imul(Q,Ke)|0,d=d+Math.imul(Q,Qe)|0,d=d+Math.imul(W,Ke)|0,P=P+Math.imul(W,Qe)|0,N=N+Math.imul(U,Re)|0,d=d+Math.imul(U,Ue)|0,d=d+Math.imul(q,Re)|0,P=P+Math.imul(q,Ue)|0,N=N+Math.imul(v,ke)|0,d=d+Math.imul(v,Xe)|0,d=d+Math.imul(B,ke)|0,P=P+Math.imul(B,Xe)|0;var ac=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(ac>>>26)|0,ac&=67108863,N=Math.imul(je,Ce),d=Math.imul(je,Ge),d=d+Math.imul(qe,Ce)|0,P=Math.imul(qe,Ge),N=N+Math.imul(He,Be)|0,d=d+Math.imul(He,We)|0,d=d+Math.imul(Ve,Be)|0,P=P+Math.imul(Ve,We)|0,N=N+Math.imul(me,De)|0,d=d+Math.imul(me,ne)|0,d=d+Math.imul($e,De)|0,P=P+Math.imul($e,ne)|0,N=N+Math.imul(fe,ge)|0,d=d+Math.imul(fe,he)|0,d=d+Math.imul(Le,ge)|0,P=P+Math.imul(Le,he)|0,N=N+Math.imul(Pe,Ae)|0,d=d+Math.imul(Pe,_e)|0,d=d+Math.imul(ce,Ae)|0,P=P+Math.imul(ce,_e)|0,N=N+Math.imul(Te,Ie)|0,d=d+Math.imul(Te,Fe)|0,d=d+Math.imul(Me,Ie)|0,P=P+Math.imul(Me,Fe)|0,N=N+Math.imul(K,Ke)|0,d=d+Math.imul(K,Qe)|0,d=d+Math.imul(ae,Ke)|0,P=P+Math.imul(ae,Qe)|0,N=N+Math.imul(Q,Re)|0,d=d+Math.imul(Q,Ue)|0,d=d+Math.imul(W,Re)|0,P=P+Math.imul(W,Ue)|0,N=N+Math.imul(U,ke)|0,d=d+Math.imul(U,Xe)|0,d=d+Math.imul(q,ke)|0,P=P+Math.imul(q,Xe)|0,N=N+Math.imul(v,Ze)|0,d=d+Math.imul(v,et)|0,d=d+Math.imul(B,Ze)|0,P=P+Math.imul(B,et)|0;var lc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(lc>>>26)|0,lc&=67108863,N=Math.imul(je,Be),d=Math.imul(je,We),d=d+Math.imul(qe,Be)|0,P=Math.imul(qe,We),N=N+Math.imul(He,De)|0,d=d+Math.imul(He,ne)|0,d=d+Math.imul(Ve,De)|0,P=P+Math.imul(Ve,ne)|0,N=N+Math.imul(me,ge)|0,d=d+Math.imul(me,he)|0,d=d+Math.imul($e,ge)|0,P=P+Math.imul($e,he)|0,N=N+Math.imul(fe,Ae)|0,d=d+Math.imul(fe,_e)|0,d=d+Math.imul(Le,Ae)|0,P=P+Math.imul(Le,_e)|0,N=N+Math.imul(Pe,Ie)|0,d=d+Math.imul(Pe,Fe)|0,d=d+Math.imul(ce,Ie)|0,P=P+Math.imul(ce,Fe)|0,N=N+Math.imul(Te,Ke)|0,d=d+Math.imul(Te,Qe)|0,d=d+Math.imul(Me,Ke)|0,P=P+Math.imul(Me,Qe)|0,N=N+Math.imul(K,Re)|0,d=d+Math.imul(K,Ue)|0,d=d+Math.imul(ae,Re)|0,P=P+Math.imul(ae,Ue)|0,N=N+Math.imul(Q,ke)|0,d=d+Math.imul(Q,Xe)|0,d=d+Math.imul(W,ke)|0,P=P+Math.imul(W,Xe)|0,N=N+Math.imul(U,Ze)|0,d=d+Math.imul(U,et)|0,d=d+Math.imul(q,Ze)|0,P=P+Math.imul(q,et)|0;var uc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(uc>>>26)|0,uc&=67108863,N=Math.imul(je,De),d=Math.imul(je,ne),d=d+Math.imul(qe,De)|0,P=Math.imul(qe,ne),N=N+Math.imul(He,ge)|0,d=d+Math.imul(He,he)|0,d=d+Math.imul(Ve,ge)|0,P=P+Math.imul(Ve,he)|0,N=N+Math.imul(me,Ae)|0,d=d+Math.imul(me,_e)|0,d=d+Math.imul($e,Ae)|0,P=P+Math.imul($e,_e)|0,N=N+Math.imul(fe,Ie)|0,d=d+Math.imul(fe,Fe)|0,d=d+Math.imul(Le,Ie)|0,P=P+Math.imul(Le,Fe)|0,N=N+Math.imul(Pe,Ke)|0,d=d+Math.imul(Pe,Qe)|0,d=d+Math.imul(ce,Ke)|0,P=P+Math.imul(ce,Qe)|0,N=N+Math.imul(Te,Re)|0,d=d+Math.imul(Te,Ue)|0,d=d+Math.imul(Me,Re)|0,P=P+Math.imul(Me,Ue)|0,N=N+Math.imul(K,ke)|0,d=d+Math.imul(K,Xe)|0,d=d+Math.imul(ae,ke)|0,P=P+Math.imul(ae,Xe)|0,N=N+Math.imul(Q,Ze)|0,d=d+Math.imul(Q,et)|0,d=d+Math.imul(W,Ze)|0,P=P+Math.imul(W,et)|0;var cc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(cc>>>26)|0,cc&=67108863,N=Math.imul(je,ge),d=Math.imul(je,he),d=d+Math.imul(qe,ge)|0,P=Math.imul(qe,he),N=N+Math.imul(He,Ae)|0,d=d+Math.imul(He,_e)|0,d=d+Math.imul(Ve,Ae)|0,P=P+Math.imul(Ve,_e)|0,N=N+Math.imul(me,Ie)|0,d=d+Math.imul(me,Fe)|0,d=d+Math.imul($e,Ie)|0,P=P+Math.imul($e,Fe)|0,N=N+Math.imul(fe,Ke)|0,d=d+Math.imul(fe,Qe)|0,d=d+Math.imul(Le,Ke)|0,P=P+Math.imul(Le,Qe)|0,N=N+Math.imul(Pe,Re)|0,d=d+Math.imul(Pe,Ue)|0,d=d+Math.imul(ce,Re)|0,P=P+Math.imul(ce,Ue)|0,N=N+Math.imul(Te,ke)|0,d=d+Math.imul(Te,Xe)|0,d=d+Math.imul(Me,ke)|0,P=P+Math.imul(Me,Xe)|0,N=N+Math.imul(K,Ze)|0,d=d+Math.imul(K,et)|0,d=d+Math.imul(ae,Ze)|0,P=P+Math.imul(ae,et)|0;var fc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(fc>>>26)|0,fc&=67108863,N=Math.imul(je,Ae),d=Math.imul(je,_e),d=d+Math.imul(qe,Ae)|0,P=Math.imul(qe,_e),N=N+Math.imul(He,Ie)|0,d=d+Math.imul(He,Fe)|0,d=d+Math.imul(Ve,Ie)|0,P=P+Math.imul(Ve,Fe)|0,N=N+Math.imul(me,Ke)|0,d=d+Math.imul(me,Qe)|0,d=d+Math.imul($e,Ke)|0,P=P+Math.imul($e,Qe)|0,N=N+Math.imul(fe,Re)|0,d=d+Math.imul(fe,Ue)|0,d=d+Math.imul(Le,Re)|0,P=P+Math.imul(Le,Ue)|0,N=N+Math.imul(Pe,ke)|0,d=d+Math.imul(Pe,Xe)|0,d=d+Math.imul(ce,ke)|0,P=P+Math.imul(ce,Xe)|0,N=N+Math.imul(Te,Ze)|0,d=d+Math.imul(Te,et)|0,d=d+Math.imul(Me,Ze)|0,P=P+Math.imul(Me,et)|0;var hc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(hc>>>26)|0,hc&=67108863,N=Math.imul(je,Ie),d=Math.imul(je,Fe),d=d+Math.imul(qe,Ie)|0,P=Math.imul(qe,Fe),N=N+Math.imul(He,Ke)|0,d=d+Math.imul(He,Qe)|0,d=d+Math.imul(Ve,Ke)|0,P=P+Math.imul(Ve,Qe)|0,N=N+Math.imul(me,Re)|0,d=d+Math.imul(me,Ue)|0,d=d+Math.imul($e,Re)|0,P=P+Math.imul($e,Ue)|0,N=N+Math.imul(fe,ke)|0,d=d+Math.imul(fe,Xe)|0,d=d+Math.imul(Le,ke)|0,P=P+Math.imul(Le,Xe)|0,N=N+Math.imul(Pe,Ze)|0,d=d+Math.imul(Pe,et)|0,d=d+Math.imul(ce,Ze)|0,P=P+Math.imul(ce,et)|0;var dc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(dc>>>26)|0,dc&=67108863,N=Math.imul(je,Ke),d=Math.imul(je,Qe),d=d+Math.imul(qe,Ke)|0,P=Math.imul(qe,Qe),N=N+Math.imul(He,Re)|0,d=d+Math.imul(He,Ue)|0,d=d+Math.imul(Ve,Re)|0,P=P+Math.imul(Ve,Ue)|0,N=N+Math.imul(me,ke)|0,d=d+Math.imul(me,Xe)|0,d=d+Math.imul($e,ke)|0,P=P+Math.imul($e,Xe)|0,N=N+Math.imul(fe,Ze)|0,d=d+Math.imul(fe,et)|0,d=d+Math.imul(Le,Ze)|0,P=P+Math.imul(Le,et)|0;var pc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(pc>>>26)|0,pc&=67108863,N=Math.imul(je,Re),d=Math.imul(je,Ue),d=d+Math.imul(qe,Re)|0,P=Math.imul(qe,Ue),N=N+Math.imul(He,ke)|0,d=d+Math.imul(He,Xe)|0,d=d+Math.imul(Ve,ke)|0,P=P+Math.imul(Ve,Xe)|0,N=N+Math.imul(me,Ze)|0,d=d+Math.imul(me,et)|0,d=d+Math.imul($e,Ze)|0,P=P+Math.imul($e,et)|0;var mc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(mc>>>26)|0,mc&=67108863,N=Math.imul(je,ke),d=Math.imul(je,Xe),d=d+Math.imul(qe,ke)|0,P=Math.imul(qe,Xe),N=N+Math.imul(He,Ze)|0,d=d+Math.imul(He,et)|0,d=d+Math.imul(Ve,Ze)|0,P=P+Math.imul(Ve,et)|0;var gc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(gc>>>26)|0,gc&=67108863,N=Math.imul(je,Ze),d=Math.imul(je,et),d=d+Math.imul(qe,Ze)|0,P=Math.imul(qe,et);var vc=(R+N|0)+((d&8191)<<13)|0;return R=(P+(d>>>13)|0)+(vc>>>26)|0,vc&=67108863,C[0]=Kn,C[1]=Qn,C[2]=Jn,C[3]=Yn,C[4]=Xn,C[5]=ic,C[6]=sc,C[7]=oc,C[8]=ac,C[9]=lc,C[10]=uc,C[11]=cc,C[12]=fc,C[13]=hc,C[14]=dc,C[15]=pc,C[16]=mc,C[17]=gc,C[18]=vc,R!==0&&(C[19]=R,E.length++),E};Math.imul||(y=x);function A(I,f,p){p.negative=f.negative^I.negative,p.length=I.length+f.length;for(var E=0,k=0,_=0;_>>26)|0,k+=C>>>26,C&=67108863}p.words[_]=R,E=C,C=k}return E!==0?p.words[_]=E:p.length--,p._strip()}function T(I,f,p){return A(I,f,p)}s.prototype.mulTo=function(f,p){var E,k=this.length+f.length;return this.length===10&&f.length===10?E=y(this,f,p):k<63?E=x(this,f,p):k<1024?E=A(this,f,p):E=T(this,f,p),E},s.prototype.mul=function(f){var p=new s(null);return p.words=new Array(this.length+f.length),this.mulTo(f,p)},s.prototype.mulf=function(f){var p=new s(null);return p.words=new Array(this.length+f.length),T(this,f,p)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var p=f<0;p&&(f=-f),n(typeof f=="number"),n(f<67108864);for(var E=0,k=0;k>=26,E+=_/67108864|0,E+=C>>>26,this.words[k]=C&67108863}return E!==0&&(this.words[k]=E,this.length++),p?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var p=S(f);if(p.length===0)return new s(1);for(var E=this,k=0;k=0);var p=f%26,E=(f-p)/26,k=67108863>>>26-p<<26-p,_;if(p!==0){var C=0;for(_=0;_>>26-p}C&&(this.words[_]=C,this.length++)}if(E!==0){for(_=this.length-1;_>=0;_--)this.words[_+E]=this.words[_];for(_=0;_=0);var k;p?k=(p-p%26)/26:k=0;var _=f%26,C=Math.min((f-_)/26,this.length),R=67108863^67108863>>>_<<_,N=E;if(k-=C,k=Math.max(0,k),N){for(var d=0;dC)for(this.length-=C,d=0;d=0&&(P!==0||d>=k);d--){var Y=this.words[d]|0;this.words[d]=P<<26-_|Y>>>_,P=Y&R}return N&&P!==0&&(N.words[N.length++]=P),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,p,E){return n(this.negative===0),this.iushrn(f,p,E)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){n(typeof f=="number"&&f>=0);var p=f%26,E=(f-p)/26,k=1<=0);var p=f%26,E=(f-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(p!==0&&E++,this.length=Math.min(E,this.length),p!==0){var k=67108863^67108863>>>p<
=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},s.prototype.isubn=function(f){if(n(typeof f=="number"),n(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(N/67108864|0),this.words[_+E]=C&67108863}for(;_>26,this.words[_+E]=C&67108863;if(R===0)return this._strip();for(n(R===-1),R=0,_=0;_>26,this.words[_]=C&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,p){var E=this.length-f.length,k=this.clone(),_=f,C=_.words[_.length-1]|0,R=this._countBits(C);E=26-R,E!==0&&(_=_.ushln(E),k.iushln(E),C=_.words[_.length-1]|0);var N=k.length-_.length,d;if(p!=="mod"){d=new s(null),d.length=N+1,d.words=new Array(d.length);for(var P=0;P=0;v--){var B=(k.words[_.length+v]|0)*67108864+(k.words[_.length+v-1]|0);for(B=Math.min(B/C|0,67108863),k._ishlnsubmul(_,B,v);k.negative!==0;)B--,k.negative=0,k._ishlnsubmul(_,1,v),k.isZero()||(k.negative^=1);d&&(d.words[v]=B)}return d&&d._strip(),k._strip(),p!=="div"&&E!==0&&k.iushrn(E),{div:d||null,mod:k}},s.prototype.divmod=function(f,p,E){if(n(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var k,_,C;return this.negative!==0&&f.negative===0?(C=this.neg().divmod(f,p),p!=="mod"&&(k=C.div.neg()),p!=="div"&&(_=C.mod.neg(),E&&_.negative!==0&&_.iadd(f)),{div:k,mod:_}):this.negative===0&&f.negative!==0?(C=this.divmod(f.neg(),p),p!=="mod"&&(k=C.div.neg()),{div:k,mod:C.mod}):this.negative&f.negative?(C=this.neg().divmod(f.neg(),p),p!=="div"&&(_=C.mod.neg(),E&&_.negative!==0&&_.isub(f)),{div:C.div,mod:_}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?p==="div"?{div:this.divn(f.words[0]),mod:null}:p==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,p)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var p=this.divmod(f);if(p.mod.isZero())return p.div;var E=p.div.negative!==0?p.mod.isub(f):p.mod,k=f.ushrn(1),_=f.andln(1),C=E.cmp(k);return C<0||_===1&&C===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},s.prototype.modrn=function(f){var p=f<0;p&&(f=-f),n(f<=67108863);for(var E=(1<<26)%f,k=0,_=this.length-1;_>=0;_--)k=(E*k+(this.words[_]|0))%f;return p?-k:k},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var p=f<0;p&&(f=-f),n(f<=67108863);for(var E=0,k=this.length-1;k>=0;k--){var _=(this.words[k]|0)+E*67108864;this.words[k]=_/f|0,E=_%f}return this._strip(),p?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){n(f.negative===0),n(!f.isZero());var p=this,E=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var k=new s(1),_=new s(0),C=new s(0),R=new s(1),N=0;p.isEven()&&E.isEven();)p.iushrn(1),E.iushrn(1),++N;for(var d=E.clone(),P=p.clone();!p.isZero();){for(var Y=0,v=1;!(p.words[0]&v)&&Y<26;++Y,v<<=1);if(Y>0)for(p.iushrn(Y);Y-- >0;)(k.isOdd()||_.isOdd())&&(k.iadd(d),_.isub(P)),k.iushrn(1),_.iushrn(1);for(var B=0,F=1;!(E.words[0]&F)&&B<26;++B,F<<=1);if(B>0)for(E.iushrn(B);B-- >0;)(C.isOdd()||R.isOdd())&&(C.iadd(d),R.isub(P)),C.iushrn(1),R.iushrn(1);p.cmp(E)>=0?(p.isub(E),k.isub(C),_.isub(R)):(E.isub(p),C.isub(k),R.isub(_))}return{a:C,b:R,gcd:E.iushln(N)}},s.prototype._invmp=function(f){n(f.negative===0),n(!f.isZero());var p=this,E=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var k=new s(1),_=new s(0),C=E.clone();p.cmpn(1)>0&&E.cmpn(1)>0;){for(var R=0,N=1;!(p.words[0]&N)&&R<26;++R,N<<=1);if(R>0)for(p.iushrn(R);R-- >0;)k.isOdd()&&k.iadd(C),k.iushrn(1);for(var d=0,P=1;!(E.words[0]&P)&&d<26;++d,P<<=1);if(d>0)for(E.iushrn(d);d-- >0;)_.isOdd()&&_.iadd(C),_.iushrn(1);p.cmp(E)>=0?(p.isub(E),k.isub(_)):(E.isub(p),_.isub(k))}var Y;return p.cmpn(1)===0?Y=k:Y=_,Y.cmpn(0)<0&&Y.iadd(f),Y},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var p=this.clone(),E=f.clone();p.negative=0,E.negative=0;for(var k=0;p.isEven()&&E.isEven();k++)p.iushrn(1),E.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;E.isEven();)E.iushrn(1);var _=p.cmp(E);if(_<0){var C=p;p=E,E=C}else if(_===0||E.cmpn(1)===0)break;p.isub(E)}while(!0);return E.iushln(k)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){n(typeof f=="number");var p=f%26,E=(f-p)/26,k=1<>>26,R&=67108863,this.words[C]=R}return _!==0&&(this.words[C]=_,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var p=f<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var E;if(this.length>1)E=1;else{p&&(f=-f),n(f<=67108863,"Number is too big");var k=this.words[0]|0;E=k===f?0:kf.length)return 1;if(this.length=0;E--){var k=this.words[E]|0,_=f.words[E]|0;if(k!==_){k<_?p=-1:k>_&&(p=1);break}}return p},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new se(f)},s.prototype.toRed=function(f){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return n(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return n(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var j={k256:null,p224:null,p192:null,p25519:null};function D(I,f){this.name=I,this.p=new s(f,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},D.prototype.ireduce=function(f){var p=f,E;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),E=p.bitLength();while(E>this.n);var k=E0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},D.prototype.split=function(f,p){f.iushrn(this.n,0,p)},D.prototype.imulK=function(f){return f.imul(this.k)};function $(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i($,D),$.prototype.split=function(f,p){for(var E=4194303,k=Math.min(f.length,9),_=0;_>>22,C=R}C>>>=22,f.words[_-10]=C,C===0&&f.length>10?f.length-=10:f.length-=9},$.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var p=0,E=0;E>>=26,f.words[E]=_,p=k}return p!==0&&(f.words[f.length++]=p),f},s._prime=function(f){if(j[f])return j[f];var p;if(f==="k256")p=new $;else if(f==="p224")p=new H;else if(f==="p192")p=new J;else if(f==="p25519")p=new Z;else throw new Error("Unknown prime "+f);return j[f]=p,p};function se(I){if(typeof I=="string"){var f=s._prime(I);this.m=f.p,this.prime=f}else n(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}se.prototype._verify1=function(f){n(f.negative===0,"red works only with positives"),n(f.red,"red works only with red numbers")},se.prototype._verify2=function(f,p){n((f.negative|p.negative)===0,"red works only with positives"),n(f.red&&f.red===p.red,"red works only with red numbers")},se.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(c(f,f.umod(this.m)._forceRed(this)),f)},se.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},se.prototype.add=function(f,p){this._verify2(f,p);var E=f.add(p);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},se.prototype.iadd=function(f,p){this._verify2(f,p);var E=f.iadd(p);return E.cmp(this.m)>=0&&E.isub(this.m),E},se.prototype.sub=function(f,p){this._verify2(f,p);var E=f.sub(p);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},se.prototype.isub=function(f,p){this._verify2(f,p);var E=f.isub(p);return E.cmpn(0)<0&&E.iadd(this.m),E},se.prototype.shl=function(f,p){return this._verify1(f),this.imod(f.ushln(p))},se.prototype.imul=function(f,p){return this._verify2(f,p),this.imod(f.imul(p))},se.prototype.mul=function(f,p){return this._verify2(f,p),this.imod(f.mul(p))},se.prototype.isqr=function(f){return this.imul(f,f.clone())},se.prototype.sqr=function(f){return this.mul(f,f)},se.prototype.sqrt=function(f){if(f.isZero())return f.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var E=this.m.add(new s(1)).iushrn(2);return this.pow(f,E)}for(var k=this.m.subn(1),_=0;!k.isZero()&&k.andln(1)===0;)_++,k.iushrn(1);n(!k.isZero());var C=new s(1).toRed(this),R=C.redNeg(),N=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new s(2*d*d).toRed(this);this.pow(d,N).cmp(R)!==0;)d.redIAdd(R);for(var P=this.pow(d,k),Y=this.pow(f,k.addn(1).iushrn(1)),v=this.pow(f,k),B=_;v.cmp(C)!==0;){for(var F=v,U=0;F.cmp(C)!==0;U++)F=F.redSqr();n(U=0;_--){for(var P=p.words[_],Y=d-1;Y>=0;Y--){var v=P>>Y&1;if(C!==k[0]&&(C=this.sqr(C)),v===0&&R===0){N=0;continue}R<<=1,R|=v,N++,!(N!==E&&(_!==0||Y!==0))&&(C=this.mul(C,k[R]),N=0,R=0)}d=26}return C},se.prototype.convertTo=function(f){var p=f.umod(this.m);return p===f?p.clone():p},se.prototype.convertFrom=function(f){var p=f.clone();return p.red=null,p},s.mont=function(f){return new Ne(f)};function Ne(I){se.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(Ne,se),Ne.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},Ne.prototype.convertFrom=function(f){var p=this.imod(f.mul(this.rinv));return p.red=null,p},Ne.prototype.imul=function(f,p){if(f.isZero()||p.isZero())return f.words[0]=0,f.length=1,f;var E=f.imul(p),k=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=E.isub(k).iushrn(this.shift),C=_;return _.cmp(this.m)>=0?C=_.isub(this.m):_.cmpn(0)<0&&(C=_.iadd(this.m)),C._forceRed(this)},Ne.prototype.mul=function(f,p){if(f.isZero()||p.isZero())return new s(0)._forceRed(this);var E=f.mul(p),k=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=E.isub(k).iushrn(this.shift),C=_;return _.cmp(this.m)>=0?C=_.isub(this.m):_.cmpn(0)<0&&(C=_.iadd(this.m)),C._forceRed(this)},Ne.prototype.invm=function(f){var p=this.imod(f._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(t,ze)})(jd);var aE=jd.exports;const ue=_i(aE),lE="bignumber/5.7.0";var la=ue.BN;const Sn=new O(lE),Wc={},kp=9007199254740991;let Np=!1;class G{constructor(e,r){e!==Wc&&Sn.throwError("cannot call constructor directly; use BigNumber.from",O.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Yt(ve(this).fromTwos(e))}toTwos(e){return Yt(ve(this).toTwos(e))}abs(){return this._hex[0]==="-"?G.from(this._hex.substring(1)):this}add(e){return Yt(ve(this).add(ve(e)))}sub(e){return Yt(ve(this).sub(ve(e)))}div(e){return G.from(e).isZero()&&Er("division-by-zero","div"),Yt(ve(this).div(ve(e)))}mul(e){return Yt(ve(this).mul(ve(e)))}mod(e){const r=ve(e);return r.isNeg()&&Er("division-by-zero","mod"),Yt(ve(this).umod(r))}pow(e){const r=ve(e);return r.isNeg()&&Er("negative-power","pow"),Yt(ve(this).pow(r))}and(e){const r=ve(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","and"),Yt(ve(this).and(r))}or(e){const r=ve(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","or"),Yt(ve(this).or(r))}xor(e){const r=ve(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","xor"),Yt(ve(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Er("negative-width","mask"),Yt(ve(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Er("negative-width","shl"),Yt(ve(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Er("negative-width","shr"),Yt(ve(this).shrn(e))}eq(e){return ve(this).eq(ve(e))}lt(e){return ve(this).lt(ve(e))}lte(e){return ve(this).lte(ve(e))}gt(e){return ve(this).gt(ve(e))}gte(e){return ve(this).gte(ve(e))}isNegative(){return this._hex[0]==="-"}isZero(){return ve(this).isZero()}toNumber(){try{return ve(this).toNumber()}catch{Er("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Sn.throwError("this platform does not support BigInt",O.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Np||(Np=!0,Sn.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Sn.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",O.errors.UNEXPECTED_ARGUMENT,{}):Sn.throwError("BigNumber.toString does not accept parameters",O.errors.UNEXPECTED_ARGUMENT,{})),ve(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof G)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new G(Wc,ua(e)):e.match(/^-?[0-9]+$/)?new G(Wc,ua(new la(e))):Sn.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Er("underflow","BigNumber.from",e),(e>=kp||e<=-kp)&&Er("overflow","BigNumber.from",e),G.from(String(e));const r=e;if(typeof r=="bigint")return G.from(r.toString());if(zu(r))return G.from(re(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return G.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(pe(n)||n[0]==="-"&&pe(n.substring(1))))return G.from(n)}return Sn.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function ua(t){if(typeof t!="string")return ua(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Sn.throwArgumentError("invalid hex","value",t),t=ua(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Yt(t){return G.from(ua(t))}function ve(t){const e=G.from(t).toHexString();return e[0]==="-"?new la("-"+e.substring(3),16):new la(e.substring(2),16)}function Er(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Sn.throwError(t,O.errors.NUMERIC_FAULT,n)}function uE(t){return new la(t,36).toString(16)}function cE(t){return new la(t,16).toString(36)}var _1={exports:{}};/**
+ */const Xb="startTransition",vp=Jw[Xb];function Zb(t){let{basename:e,children:r,future:n,window:i}=t,s=L.useRef();s.current==null&&(s.current=ob({window:i,v5Compat:!0}));let o=s.current,[a,l]=L.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=L.useCallback(h=>{u&&vp?vp(()=>l(h)):l(h)},[l,u]);return L.useLayoutEffect(()=>o.listen(c),[o,c]),L.createElement(Jb,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}var yp;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(yp||(yp={}));var wp;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(wp||(wp={}));var Uu={},Ln={},E1={};const eE="logger/5.7.0";let xp=!1,bp=!1;const El={debug:1,default:2,info:2,warning:3,error:4,off:5};let Ep=El.default,qc=null;function tE(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const Ap=tE();var vh;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(vh||(vh={}));var zr;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(zr||(zr={}));const _p="0123456789abcdef";class O{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();El[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Ep>El[n])&&console.log.apply(console,r)}debug(...e){this._log(O.levels.DEBUG,e)}info(...e){this._log(O.levels.INFO,e)}warn(...e){this._log(O.levels.WARNING,e)}makeError(e,r,n){if(bp)return this.makeError("censored error",r,{});r||(r=O.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const u=n[l];try{if(u instanceof Uint8Array){let c="";for(let h=0;h>4],c+=_p[u[h]&15];i.push(l+"=Uint8Array(0x"+c+")")}else i.push(l+"="+JSON.stringify(u))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case zr.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case zr.CALL_EXCEPTION:case zr.INSUFFICIENT_FUNDS:case zr.MISSING_NEW:case zr.NONCE_EXPIRED:case zr.REPLACEMENT_UNDERPRICED:case zr.TRANSACTION_REPLACED:case zr.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,O.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){Ap&&this.throwError("platform missing String.prototype.normalize",O.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Ap})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,O.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,O.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,O.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",O.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",O.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",O.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return qc||(qc=new O(eE)),qc}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",O.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),xp){if(!e)return;this.globalLogger().throwError("error censorship permanent",O.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}bp=!!e,xp=!!r}static setLogLevel(e){const r=El[e.toLowerCase()];if(r==null){O.globalLogger().warn("invalid log level - "+e);return}Ep=r}static from(e){return new O(e)}}O.errors=zr;O.levels=vh;const rE="bytes/5.7.0",dt=new O(rE);function A1(t){return!!t.toHexString}function Rs(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Rs(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Ld(t){return pe(t)&&!(t.length%2)||zu(t)}function Sp(t){return typeof t=="number"&&t==t&&t%1===0}function zu(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Sp(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function oe(t,e){if(e||(e={}),typeof t=="number"){dt.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Rs(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),A1(t)&&(t=t.toHexString()),pe(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":dt.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ioe(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Rs(n)}function $s(t){let e=oe(t);if(e.length===0)return e;let r=0;for(;re&&dt.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Rs(r)}function pe(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const Gc="0123456789abcdef";function re(t,e){if(e||(e={}),typeof t=="number"){dt.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=Gc[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),A1(t))return t.toHexString();if(pe(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":dt.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(zu(t)){let r="0x";for(let n=0;n>4]+Gc[i&15]}return r}return dt.throwArgumentError("invalid hexlify value","value",t)}function Un(t){if(typeof t!="string")t=re(t);else if(!pe(t)||t.length%2)return null;return(t.length-2)/2}function Rt(t,e,r){return typeof t!="string"?t=re(t):(!pe(t)||t.length%2)&&dt.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function tr(t){let e="0x";return t.forEach(r=>{e+=re(r).substring(2)}),e}function $u(t){const e=nE(re(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function nE(t){typeof t!="string"&&(t=re(t)),pe(t)||dt.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&dt.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Hu(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Ld(t)){let r=oe(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=re(r.slice(0,32)),e.s=re(r.slice(32,64))):r.length===65?(e.r=re(r.slice(0,32)),e.s=re(r.slice(32,64)),e.v=r[64]):dt.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:dt.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=re(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=Al(oe(e._vs),32);e._vs=re(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&dt.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=re(i);e.s==null?e.s=o:e.s!==o&&dt.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?dt.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&dt.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!pe(e.r)?dt.throwArgumentError("signature missing or invalid r","signature",t):e.r=mt(e.r,32),e.s==null||!pe(e.s)?dt.throwArgumentError("signature missing or invalid s","signature",t):e.s=mt(e.s,32);const r=oe(e.s);r[0]>=128&&dt.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=re(r);e._vs&&(pe(e._vs)||dt.throwArgumentError("signature invalid _vs","signature",t),e._vs=mt(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&dt.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}var jd={exports:{}};const iE={},sE=Object.freeze(Object.defineProperty({__proto__:null,default:iE},Symbol.toStringTag,{value:"Module"})),oE=Ks(sE);jd.exports;(function(t){(function(e,r){function n(I,f){if(!I)throw new Error(f||"Assertion failed")}function i(I,f){I.super_=f;var p=function(){};p.prototype=f.prototype,I.prototype=new p,I.prototype.constructor=I}function s(I,f,p){if(s.isBN(I))return I;this.negative=0,this.words=null,this.length=0,this.red=null,I!==null&&((f==="le"||f==="be")&&(p=f,f=10),this._init(I||0,f||10,p||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=oE.Buffer}catch{}s.isBN=function(f){return f instanceof s?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===s.wordSize&&Array.isArray(f.words)},s.max=function(f,p){return f.cmp(p)>0?f:p},s.min=function(f,p){return f.cmp(p)<0?f:p},s.prototype._init=function(f,p,E){if(typeof f=="number")return this._initNumber(f,p,E);if(typeof f=="object")return this._initArray(f,p,E);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),f=f.toString().replace(/\s+/g,"");var k=0;f[0]==="-"&&(k++,this.negative=1),k=0;k-=3)C=f[k]|f[k-1]<<8|f[k-2]<<16,this.words[_]|=C<>>26-R&67108863,R+=24,R>=26&&(R-=26,_++);else if(E==="le")for(k=0,_=0;k>>26-R&67108863,R+=24,R>=26&&(R-=26,_++);return this._strip()};function a(I,f){var p=I.charCodeAt(f);if(p>=48&&p<=57)return p-48;if(p>=65&&p<=70)return p-55;if(p>=97&&p<=102)return p-87;n(!1,"Invalid character in "+I)}function l(I,f,p){var E=a(I,p);return p-1>=f&&(E|=a(I,p-1)<<4),E}s.prototype._parseHex=function(f,p,E){this.length=Math.ceil((f.length-p)/6),this.words=new Array(this.length);for(var k=0;k=p;k-=2)R=l(f,p,k)<<_,this.words[C]|=R&67108863,_>=18?(_-=18,C+=1,this.words[C]|=R>>>26):_+=8;else{var N=f.length-p;for(k=N%2===0?p+1:p;k=18?(_-=18,C+=1,this.words[C]|=R>>>26):_+=8}this._strip()};function u(I,f,p,E){for(var k=0,_=0,C=Math.min(I.length,p),R=f;R=49?_=N-49+10:N>=17?_=N-17+10:_=N,n(N>=0&&_1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{s.prototype.inspect=h}else s.prototype.inspect=h;function h(){return(this.red?""}var m=["","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"],g=[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],w=[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];s.prototype.toString=function(f,p){f=f||10,p=p|0||1;var E;if(f===16||f==="hex"){E="";for(var k=0,_=0,C=0;C>>24-k&16777215,k+=2,k>=26&&(k-=26,C--),_!==0||C!==this.length-1?E=m[6-N.length]+N+E:E=N+E}for(_!==0&&(E=_.toString(16)+E);E.length%p!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(f===(f|0)&&f>=2&&f<=36){var d=g[f],P=w[f];E="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var v=Y.modrn(P).toString(f);Y=Y.idivn(P),Y.isZero()?E=v+E:E=m[d-v.length]+v+E}for(this.isZero()&&(E="0"+E);E.length%p!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(f,p){return this.toArrayLike(o,f,p)}),s.prototype.toArray=function(f,p){return this.toArrayLike(Array,f,p)};var b=function(f,p){return f.allocUnsafe?f.allocUnsafe(p):new f(p)};s.prototype.toArrayLike=function(f,p,E){this._strip();var k=this.byteLength(),_=E||Math.max(1,k);n(k<=_,"byte array longer than desired length"),n(_>0,"Requested array length <= 0");var C=b(f,_),R=p==="le"?"LE":"BE";return this["_toArrayLike"+R](C,k),C},s.prototype._toArrayLikeLE=function(f,p){for(var E=0,k=0,_=0,C=0;_>8&255),E>16&255),C===6?(E>24&255),k=0,C=0):(k=R>>>24,C+=2)}if(E=0&&(f[E--]=R>>8&255),E>=0&&(f[E--]=R>>16&255),C===6?(E>=0&&(f[E--]=R>>24&255),k=0,C=0):(k=R>>>24,C+=2)}if(E>=0)for(f[E--]=k;E>=0;)f[E--]=0},Math.clz32?s.prototype._countBits=function(f){return 32-Math.clz32(f)}:s.prototype._countBits=function(f){var p=f,E=0;return p>=4096&&(E+=13,p>>>=13),p>=64&&(E+=7,p>>>=7),p>=8&&(E+=4,p>>>=4),p>=2&&(E+=2,p>>>=2),E+p},s.prototype._zeroBits=function(f){if(f===0)return 26;var p=f,E=0;return p&8191||(E+=13,p>>>=13),p&127||(E+=7,p>>>=7),p&15||(E+=4,p>>>=4),p&3||(E+=2,p>>>=2),p&1||E++,E},s.prototype.bitLength=function(){var f=this.words[this.length-1],p=this._countBits(f);return(this.length-1)*26+p};function S(I){for(var f=new Array(I.bitLength()),p=0;p>>k&1}return f}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,p=0;pf.length?this.clone().ior(f):f.clone().ior(this)},s.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},s.prototype.iuand=function(f){var p;this.length>f.length?p=f:p=this;for(var E=0;Ef.length?this.clone().iand(f):f.clone().iand(this)},s.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},s.prototype.iuxor=function(f){var p,E;this.length>f.length?(p=this,E=f):(p=f,E=this);for(var k=0;kf.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){n(typeof f=="number"&&f>=0);var p=Math.ceil(f/26)|0,E=f%26;this._expand(p),E>0&&p--;for(var k=0;k0&&(this.words[k]=~this.words[k]&67108863>>26-E),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,p){n(typeof f=="number"&&f>=0);var E=f/26|0,k=f%26;return this._expand(E+1),p?this.words[E]=this.words[E]|1<f.length?(E=this,k=f):(E=f,k=this);for(var _=0,C=0;C>>26;for(;_!==0&&C>>26;if(this.length=E.length,_!==0)this.words[this.length]=_,this.length++;else if(E!==this)for(;Cf.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var p=this.iadd(f);return f.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var E=this.cmp(f);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var k,_;E>0?(k=this,_=f):(k=f,_=this);for(var C=0,R=0;R<_.length;R++)p=(k.words[R]|0)-(_.words[R]|0)+C,C=p>>26,this.words[R]=p&67108863;for(;C!==0&&R>26,this.words[R]=p&67108863;if(C===0&&R>>26,Y=N&67108863,v=Math.min(d,f.length-1),B=Math.max(0,d-I.length+1);B<=v;B++){var F=d-B|0;k=I.words[F]|0,_=f.words[B]|0,C=k*_+Y,P+=C/67108864|0,Y=C&67108863}p.words[d]=Y|0,N=P|0}return N!==0?p.words[d]=N|0:p.length--,p._strip()}var y=function(f,p,E){var k=f.words,_=p.words,C=E.words,R=0,N,d,P,Y=k[0]|0,v=Y&8191,B=Y>>>13,F=k[1]|0,U=F&8191,q=F>>>13,ie=k[2]|0,Q=ie&8191,W=ie>>>13,Ye=k[3]|0,K=Ye&8191,ae=Ye>>>13,Yr=k[4]|0,Te=Yr&8191,Me=Yr>>>13,Xr=k[5]|0,Pe=Xr&8191,ce=Xr>>>13,xr=k[6]|0,fe=xr&8191,Le=xr>>>13,Zr=k[7]|0,me=Zr&8191,$e=Zr>>>13,bn=k[8]|0,He=bn&8191,Ve=bn>>>13,Vt=k[9]|0,je=Vt&8191,qe=Vt>>>13,Lr=_[0]|0,Ce=Lr&8191,Ge=Lr>>>13,En=_[1]|0,Be=En&8191,We=En>>>13,An=_[2]|0,De=An&8191,ne=An>>>13,at=_[3]|0,ge=at&8191,he=at>>>13,nt=_[4]|0,Ae=nt&8191,_e=nt>>>13,Pt=_[5]|0,Ie=Pt&8191,Fe=Pt>>>13,Qt=_[6]|0,Ke=Qt&8191,Qe=Qt>>>13,Jt=_[7]|0,Re=Jt&8191,Ue=Jt>>>13,br=_[8]|0,ke=br&8191,Xe=br>>>13,Pi=_[9]|0,Ze=Pi&8191,et=Pi>>>13;E.negative=f.negative^p.negative,E.length=19,N=Math.imul(v,Ce),d=Math.imul(v,Ge),d=d+Math.imul(B,Ce)|0,P=Math.imul(B,Ge);var Kn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,N=Math.imul(U,Ce),d=Math.imul(U,Ge),d=d+Math.imul(q,Ce)|0,P=Math.imul(q,Ge),N=N+Math.imul(v,Be)|0,d=d+Math.imul(v,We)|0,d=d+Math.imul(B,Be)|0,P=P+Math.imul(B,We)|0;var Qn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,N=Math.imul(Q,Ce),d=Math.imul(Q,Ge),d=d+Math.imul(W,Ce)|0,P=Math.imul(W,Ge),N=N+Math.imul(U,Be)|0,d=d+Math.imul(U,We)|0,d=d+Math.imul(q,Be)|0,P=P+Math.imul(q,We)|0,N=N+Math.imul(v,De)|0,d=d+Math.imul(v,ne)|0,d=d+Math.imul(B,De)|0,P=P+Math.imul(B,ne)|0;var Jn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,N=Math.imul(K,Ce),d=Math.imul(K,Ge),d=d+Math.imul(ae,Ce)|0,P=Math.imul(ae,Ge),N=N+Math.imul(Q,Be)|0,d=d+Math.imul(Q,We)|0,d=d+Math.imul(W,Be)|0,P=P+Math.imul(W,We)|0,N=N+Math.imul(U,De)|0,d=d+Math.imul(U,ne)|0,d=d+Math.imul(q,De)|0,P=P+Math.imul(q,ne)|0,N=N+Math.imul(v,ge)|0,d=d+Math.imul(v,he)|0,d=d+Math.imul(B,ge)|0,P=P+Math.imul(B,he)|0;var Yn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,N=Math.imul(Te,Ce),d=Math.imul(Te,Ge),d=d+Math.imul(Me,Ce)|0,P=Math.imul(Me,Ge),N=N+Math.imul(K,Be)|0,d=d+Math.imul(K,We)|0,d=d+Math.imul(ae,Be)|0,P=P+Math.imul(ae,We)|0,N=N+Math.imul(Q,De)|0,d=d+Math.imul(Q,ne)|0,d=d+Math.imul(W,De)|0,P=P+Math.imul(W,ne)|0,N=N+Math.imul(U,ge)|0,d=d+Math.imul(U,he)|0,d=d+Math.imul(q,ge)|0,P=P+Math.imul(q,he)|0,N=N+Math.imul(v,Ae)|0,d=d+Math.imul(v,_e)|0,d=d+Math.imul(B,Ae)|0,P=P+Math.imul(B,_e)|0;var Xn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,N=Math.imul(Pe,Ce),d=Math.imul(Pe,Ge),d=d+Math.imul(ce,Ce)|0,P=Math.imul(ce,Ge),N=N+Math.imul(Te,Be)|0,d=d+Math.imul(Te,We)|0,d=d+Math.imul(Me,Be)|0,P=P+Math.imul(Me,We)|0,N=N+Math.imul(K,De)|0,d=d+Math.imul(K,ne)|0,d=d+Math.imul(ae,De)|0,P=P+Math.imul(ae,ne)|0,N=N+Math.imul(Q,ge)|0,d=d+Math.imul(Q,he)|0,d=d+Math.imul(W,ge)|0,P=P+Math.imul(W,he)|0,N=N+Math.imul(U,Ae)|0,d=d+Math.imul(U,_e)|0,d=d+Math.imul(q,Ae)|0,P=P+Math.imul(q,_e)|0,N=N+Math.imul(v,Ie)|0,d=d+Math.imul(v,Fe)|0,d=d+Math.imul(B,Ie)|0,P=P+Math.imul(B,Fe)|0;var ic=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(ic>>>26)|0,ic&=67108863,N=Math.imul(fe,Ce),d=Math.imul(fe,Ge),d=d+Math.imul(Le,Ce)|0,P=Math.imul(Le,Ge),N=N+Math.imul(Pe,Be)|0,d=d+Math.imul(Pe,We)|0,d=d+Math.imul(ce,Be)|0,P=P+Math.imul(ce,We)|0,N=N+Math.imul(Te,De)|0,d=d+Math.imul(Te,ne)|0,d=d+Math.imul(Me,De)|0,P=P+Math.imul(Me,ne)|0,N=N+Math.imul(K,ge)|0,d=d+Math.imul(K,he)|0,d=d+Math.imul(ae,ge)|0,P=P+Math.imul(ae,he)|0,N=N+Math.imul(Q,Ae)|0,d=d+Math.imul(Q,_e)|0,d=d+Math.imul(W,Ae)|0,P=P+Math.imul(W,_e)|0,N=N+Math.imul(U,Ie)|0,d=d+Math.imul(U,Fe)|0,d=d+Math.imul(q,Ie)|0,P=P+Math.imul(q,Fe)|0,N=N+Math.imul(v,Ke)|0,d=d+Math.imul(v,Qe)|0,d=d+Math.imul(B,Ke)|0,P=P+Math.imul(B,Qe)|0;var sc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(sc>>>26)|0,sc&=67108863,N=Math.imul(me,Ce),d=Math.imul(me,Ge),d=d+Math.imul($e,Ce)|0,P=Math.imul($e,Ge),N=N+Math.imul(fe,Be)|0,d=d+Math.imul(fe,We)|0,d=d+Math.imul(Le,Be)|0,P=P+Math.imul(Le,We)|0,N=N+Math.imul(Pe,De)|0,d=d+Math.imul(Pe,ne)|0,d=d+Math.imul(ce,De)|0,P=P+Math.imul(ce,ne)|0,N=N+Math.imul(Te,ge)|0,d=d+Math.imul(Te,he)|0,d=d+Math.imul(Me,ge)|0,P=P+Math.imul(Me,he)|0,N=N+Math.imul(K,Ae)|0,d=d+Math.imul(K,_e)|0,d=d+Math.imul(ae,Ae)|0,P=P+Math.imul(ae,_e)|0,N=N+Math.imul(Q,Ie)|0,d=d+Math.imul(Q,Fe)|0,d=d+Math.imul(W,Ie)|0,P=P+Math.imul(W,Fe)|0,N=N+Math.imul(U,Ke)|0,d=d+Math.imul(U,Qe)|0,d=d+Math.imul(q,Ke)|0,P=P+Math.imul(q,Qe)|0,N=N+Math.imul(v,Re)|0,d=d+Math.imul(v,Ue)|0,d=d+Math.imul(B,Re)|0,P=P+Math.imul(B,Ue)|0;var oc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(oc>>>26)|0,oc&=67108863,N=Math.imul(He,Ce),d=Math.imul(He,Ge),d=d+Math.imul(Ve,Ce)|0,P=Math.imul(Ve,Ge),N=N+Math.imul(me,Be)|0,d=d+Math.imul(me,We)|0,d=d+Math.imul($e,Be)|0,P=P+Math.imul($e,We)|0,N=N+Math.imul(fe,De)|0,d=d+Math.imul(fe,ne)|0,d=d+Math.imul(Le,De)|0,P=P+Math.imul(Le,ne)|0,N=N+Math.imul(Pe,ge)|0,d=d+Math.imul(Pe,he)|0,d=d+Math.imul(ce,ge)|0,P=P+Math.imul(ce,he)|0,N=N+Math.imul(Te,Ae)|0,d=d+Math.imul(Te,_e)|0,d=d+Math.imul(Me,Ae)|0,P=P+Math.imul(Me,_e)|0,N=N+Math.imul(K,Ie)|0,d=d+Math.imul(K,Fe)|0,d=d+Math.imul(ae,Ie)|0,P=P+Math.imul(ae,Fe)|0,N=N+Math.imul(Q,Ke)|0,d=d+Math.imul(Q,Qe)|0,d=d+Math.imul(W,Ke)|0,P=P+Math.imul(W,Qe)|0,N=N+Math.imul(U,Re)|0,d=d+Math.imul(U,Ue)|0,d=d+Math.imul(q,Re)|0,P=P+Math.imul(q,Ue)|0,N=N+Math.imul(v,ke)|0,d=d+Math.imul(v,Xe)|0,d=d+Math.imul(B,ke)|0,P=P+Math.imul(B,Xe)|0;var ac=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(ac>>>26)|0,ac&=67108863,N=Math.imul(je,Ce),d=Math.imul(je,Ge),d=d+Math.imul(qe,Ce)|0,P=Math.imul(qe,Ge),N=N+Math.imul(He,Be)|0,d=d+Math.imul(He,We)|0,d=d+Math.imul(Ve,Be)|0,P=P+Math.imul(Ve,We)|0,N=N+Math.imul(me,De)|0,d=d+Math.imul(me,ne)|0,d=d+Math.imul($e,De)|0,P=P+Math.imul($e,ne)|0,N=N+Math.imul(fe,ge)|0,d=d+Math.imul(fe,he)|0,d=d+Math.imul(Le,ge)|0,P=P+Math.imul(Le,he)|0,N=N+Math.imul(Pe,Ae)|0,d=d+Math.imul(Pe,_e)|0,d=d+Math.imul(ce,Ae)|0,P=P+Math.imul(ce,_e)|0,N=N+Math.imul(Te,Ie)|0,d=d+Math.imul(Te,Fe)|0,d=d+Math.imul(Me,Ie)|0,P=P+Math.imul(Me,Fe)|0,N=N+Math.imul(K,Ke)|0,d=d+Math.imul(K,Qe)|0,d=d+Math.imul(ae,Ke)|0,P=P+Math.imul(ae,Qe)|0,N=N+Math.imul(Q,Re)|0,d=d+Math.imul(Q,Ue)|0,d=d+Math.imul(W,Re)|0,P=P+Math.imul(W,Ue)|0,N=N+Math.imul(U,ke)|0,d=d+Math.imul(U,Xe)|0,d=d+Math.imul(q,ke)|0,P=P+Math.imul(q,Xe)|0,N=N+Math.imul(v,Ze)|0,d=d+Math.imul(v,et)|0,d=d+Math.imul(B,Ze)|0,P=P+Math.imul(B,et)|0;var lc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(lc>>>26)|0,lc&=67108863,N=Math.imul(je,Be),d=Math.imul(je,We),d=d+Math.imul(qe,Be)|0,P=Math.imul(qe,We),N=N+Math.imul(He,De)|0,d=d+Math.imul(He,ne)|0,d=d+Math.imul(Ve,De)|0,P=P+Math.imul(Ve,ne)|0,N=N+Math.imul(me,ge)|0,d=d+Math.imul(me,he)|0,d=d+Math.imul($e,ge)|0,P=P+Math.imul($e,he)|0,N=N+Math.imul(fe,Ae)|0,d=d+Math.imul(fe,_e)|0,d=d+Math.imul(Le,Ae)|0,P=P+Math.imul(Le,_e)|0,N=N+Math.imul(Pe,Ie)|0,d=d+Math.imul(Pe,Fe)|0,d=d+Math.imul(ce,Ie)|0,P=P+Math.imul(ce,Fe)|0,N=N+Math.imul(Te,Ke)|0,d=d+Math.imul(Te,Qe)|0,d=d+Math.imul(Me,Ke)|0,P=P+Math.imul(Me,Qe)|0,N=N+Math.imul(K,Re)|0,d=d+Math.imul(K,Ue)|0,d=d+Math.imul(ae,Re)|0,P=P+Math.imul(ae,Ue)|0,N=N+Math.imul(Q,ke)|0,d=d+Math.imul(Q,Xe)|0,d=d+Math.imul(W,ke)|0,P=P+Math.imul(W,Xe)|0,N=N+Math.imul(U,Ze)|0,d=d+Math.imul(U,et)|0,d=d+Math.imul(q,Ze)|0,P=P+Math.imul(q,et)|0;var uc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(uc>>>26)|0,uc&=67108863,N=Math.imul(je,De),d=Math.imul(je,ne),d=d+Math.imul(qe,De)|0,P=Math.imul(qe,ne),N=N+Math.imul(He,ge)|0,d=d+Math.imul(He,he)|0,d=d+Math.imul(Ve,ge)|0,P=P+Math.imul(Ve,he)|0,N=N+Math.imul(me,Ae)|0,d=d+Math.imul(me,_e)|0,d=d+Math.imul($e,Ae)|0,P=P+Math.imul($e,_e)|0,N=N+Math.imul(fe,Ie)|0,d=d+Math.imul(fe,Fe)|0,d=d+Math.imul(Le,Ie)|0,P=P+Math.imul(Le,Fe)|0,N=N+Math.imul(Pe,Ke)|0,d=d+Math.imul(Pe,Qe)|0,d=d+Math.imul(ce,Ke)|0,P=P+Math.imul(ce,Qe)|0,N=N+Math.imul(Te,Re)|0,d=d+Math.imul(Te,Ue)|0,d=d+Math.imul(Me,Re)|0,P=P+Math.imul(Me,Ue)|0,N=N+Math.imul(K,ke)|0,d=d+Math.imul(K,Xe)|0,d=d+Math.imul(ae,ke)|0,P=P+Math.imul(ae,Xe)|0,N=N+Math.imul(Q,Ze)|0,d=d+Math.imul(Q,et)|0,d=d+Math.imul(W,Ze)|0,P=P+Math.imul(W,et)|0;var cc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(cc>>>26)|0,cc&=67108863,N=Math.imul(je,ge),d=Math.imul(je,he),d=d+Math.imul(qe,ge)|0,P=Math.imul(qe,he),N=N+Math.imul(He,Ae)|0,d=d+Math.imul(He,_e)|0,d=d+Math.imul(Ve,Ae)|0,P=P+Math.imul(Ve,_e)|0,N=N+Math.imul(me,Ie)|0,d=d+Math.imul(me,Fe)|0,d=d+Math.imul($e,Ie)|0,P=P+Math.imul($e,Fe)|0,N=N+Math.imul(fe,Ke)|0,d=d+Math.imul(fe,Qe)|0,d=d+Math.imul(Le,Ke)|0,P=P+Math.imul(Le,Qe)|0,N=N+Math.imul(Pe,Re)|0,d=d+Math.imul(Pe,Ue)|0,d=d+Math.imul(ce,Re)|0,P=P+Math.imul(ce,Ue)|0,N=N+Math.imul(Te,ke)|0,d=d+Math.imul(Te,Xe)|0,d=d+Math.imul(Me,ke)|0,P=P+Math.imul(Me,Xe)|0,N=N+Math.imul(K,Ze)|0,d=d+Math.imul(K,et)|0,d=d+Math.imul(ae,Ze)|0,P=P+Math.imul(ae,et)|0;var fc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(fc>>>26)|0,fc&=67108863,N=Math.imul(je,Ae),d=Math.imul(je,_e),d=d+Math.imul(qe,Ae)|0,P=Math.imul(qe,_e),N=N+Math.imul(He,Ie)|0,d=d+Math.imul(He,Fe)|0,d=d+Math.imul(Ve,Ie)|0,P=P+Math.imul(Ve,Fe)|0,N=N+Math.imul(me,Ke)|0,d=d+Math.imul(me,Qe)|0,d=d+Math.imul($e,Ke)|0,P=P+Math.imul($e,Qe)|0,N=N+Math.imul(fe,Re)|0,d=d+Math.imul(fe,Ue)|0,d=d+Math.imul(Le,Re)|0,P=P+Math.imul(Le,Ue)|0,N=N+Math.imul(Pe,ke)|0,d=d+Math.imul(Pe,Xe)|0,d=d+Math.imul(ce,ke)|0,P=P+Math.imul(ce,Xe)|0,N=N+Math.imul(Te,Ze)|0,d=d+Math.imul(Te,et)|0,d=d+Math.imul(Me,Ze)|0,P=P+Math.imul(Me,et)|0;var hc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(hc>>>26)|0,hc&=67108863,N=Math.imul(je,Ie),d=Math.imul(je,Fe),d=d+Math.imul(qe,Ie)|0,P=Math.imul(qe,Fe),N=N+Math.imul(He,Ke)|0,d=d+Math.imul(He,Qe)|0,d=d+Math.imul(Ve,Ke)|0,P=P+Math.imul(Ve,Qe)|0,N=N+Math.imul(me,Re)|0,d=d+Math.imul(me,Ue)|0,d=d+Math.imul($e,Re)|0,P=P+Math.imul($e,Ue)|0,N=N+Math.imul(fe,ke)|0,d=d+Math.imul(fe,Xe)|0,d=d+Math.imul(Le,ke)|0,P=P+Math.imul(Le,Xe)|0,N=N+Math.imul(Pe,Ze)|0,d=d+Math.imul(Pe,et)|0,d=d+Math.imul(ce,Ze)|0,P=P+Math.imul(ce,et)|0;var dc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(dc>>>26)|0,dc&=67108863,N=Math.imul(je,Ke),d=Math.imul(je,Qe),d=d+Math.imul(qe,Ke)|0,P=Math.imul(qe,Qe),N=N+Math.imul(He,Re)|0,d=d+Math.imul(He,Ue)|0,d=d+Math.imul(Ve,Re)|0,P=P+Math.imul(Ve,Ue)|0,N=N+Math.imul(me,ke)|0,d=d+Math.imul(me,Xe)|0,d=d+Math.imul($e,ke)|0,P=P+Math.imul($e,Xe)|0,N=N+Math.imul(fe,Ze)|0,d=d+Math.imul(fe,et)|0,d=d+Math.imul(Le,Ze)|0,P=P+Math.imul(Le,et)|0;var pc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(pc>>>26)|0,pc&=67108863,N=Math.imul(je,Re),d=Math.imul(je,Ue),d=d+Math.imul(qe,Re)|0,P=Math.imul(qe,Ue),N=N+Math.imul(He,ke)|0,d=d+Math.imul(He,Xe)|0,d=d+Math.imul(Ve,ke)|0,P=P+Math.imul(Ve,Xe)|0,N=N+Math.imul(me,Ze)|0,d=d+Math.imul(me,et)|0,d=d+Math.imul($e,Ze)|0,P=P+Math.imul($e,et)|0;var mc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(mc>>>26)|0,mc&=67108863,N=Math.imul(je,ke),d=Math.imul(je,Xe),d=d+Math.imul(qe,ke)|0,P=Math.imul(qe,Xe),N=N+Math.imul(He,Ze)|0,d=d+Math.imul(He,et)|0,d=d+Math.imul(Ve,Ze)|0,P=P+Math.imul(Ve,et)|0;var gc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(gc>>>26)|0,gc&=67108863,N=Math.imul(je,Ze),d=Math.imul(je,et),d=d+Math.imul(qe,Ze)|0,P=Math.imul(qe,et);var vc=(R+N|0)+((d&8191)<<13)|0;return R=(P+(d>>>13)|0)+(vc>>>26)|0,vc&=67108863,C[0]=Kn,C[1]=Qn,C[2]=Jn,C[3]=Yn,C[4]=Xn,C[5]=ic,C[6]=sc,C[7]=oc,C[8]=ac,C[9]=lc,C[10]=uc,C[11]=cc,C[12]=fc,C[13]=hc,C[14]=dc,C[15]=pc,C[16]=mc,C[17]=gc,C[18]=vc,R!==0&&(C[19]=R,E.length++),E};Math.imul||(y=x);function A(I,f,p){p.negative=f.negative^I.negative,p.length=I.length+f.length;for(var E=0,k=0,_=0;_>>26)|0,k+=C>>>26,C&=67108863}p.words[_]=R,E=C,C=k}return E!==0?p.words[_]=E:p.length--,p._strip()}function T(I,f,p){return A(I,f,p)}s.prototype.mulTo=function(f,p){var E,k=this.length+f.length;return this.length===10&&f.length===10?E=y(this,f,p):k<63?E=x(this,f,p):k<1024?E=A(this,f,p):E=T(this,f,p),E},s.prototype.mul=function(f){var p=new s(null);return p.words=new Array(this.length+f.length),this.mulTo(f,p)},s.prototype.mulf=function(f){var p=new s(null);return p.words=new Array(this.length+f.length),T(this,f,p)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var p=f<0;p&&(f=-f),n(typeof f=="number"),n(f<67108864);for(var E=0,k=0;k>=26,E+=_/67108864|0,E+=C>>>26,this.words[k]=C&67108863}return E!==0&&(this.words[k]=E,this.length++),p?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var p=S(f);if(p.length===0)return new s(1);for(var E=this,k=0;k=0);var p=f%26,E=(f-p)/26,k=67108863>>>26-p<<26-p,_;if(p!==0){var C=0;for(_=0;_>>26-p}C&&(this.words[_]=C,this.length++)}if(E!==0){for(_=this.length-1;_>=0;_--)this.words[_+E]=this.words[_];for(_=0;_=0);var k;p?k=(p-p%26)/26:k=0;var _=f%26,C=Math.min((f-_)/26,this.length),R=67108863^67108863>>>_<<_,N=E;if(k-=C,k=Math.max(0,k),N){for(var d=0;dC)for(this.length-=C,d=0;d=0&&(P!==0||d>=k);d--){var Y=this.words[d]|0;this.words[d]=P<<26-_|Y>>>_,P=Y&R}return N&&P!==0&&(N.words[N.length++]=P),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,p,E){return n(this.negative===0),this.iushrn(f,p,E)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){n(typeof f=="number"&&f>=0);var p=f%26,E=(f-p)/26,k=1<=0);var p=f%26,E=(f-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(p!==0&&E++,this.length=Math.min(E,this.length),p!==0){var k=67108863^67108863>>>p<
=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},s.prototype.isubn=function(f){if(n(typeof f=="number"),n(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(N/67108864|0),this.words[_+E]=C&67108863}for(;_>26,this.words[_+E]=C&67108863;if(R===0)return this._strip();for(n(R===-1),R=0,_=0;_>26,this.words[_]=C&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,p){var E=this.length-f.length,k=this.clone(),_=f,C=_.words[_.length-1]|0,R=this._countBits(C);E=26-R,E!==0&&(_=_.ushln(E),k.iushln(E),C=_.words[_.length-1]|0);var N=k.length-_.length,d;if(p!=="mod"){d=new s(null),d.length=N+1,d.words=new Array(d.length);for(var P=0;P=0;v--){var B=(k.words[_.length+v]|0)*67108864+(k.words[_.length+v-1]|0);for(B=Math.min(B/C|0,67108863),k._ishlnsubmul(_,B,v);k.negative!==0;)B--,k.negative=0,k._ishlnsubmul(_,1,v),k.isZero()||(k.negative^=1);d&&(d.words[v]=B)}return d&&d._strip(),k._strip(),p!=="div"&&E!==0&&k.iushrn(E),{div:d||null,mod:k}},s.prototype.divmod=function(f,p,E){if(n(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var k,_,C;return this.negative!==0&&f.negative===0?(C=this.neg().divmod(f,p),p!=="mod"&&(k=C.div.neg()),p!=="div"&&(_=C.mod.neg(),E&&_.negative!==0&&_.iadd(f)),{div:k,mod:_}):this.negative===0&&f.negative!==0?(C=this.divmod(f.neg(),p),p!=="mod"&&(k=C.div.neg()),{div:k,mod:C.mod}):this.negative&f.negative?(C=this.neg().divmod(f.neg(),p),p!=="div"&&(_=C.mod.neg(),E&&_.negative!==0&&_.isub(f)),{div:C.div,mod:_}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?p==="div"?{div:this.divn(f.words[0]),mod:null}:p==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,p)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var p=this.divmod(f);if(p.mod.isZero())return p.div;var E=p.div.negative!==0?p.mod.isub(f):p.mod,k=f.ushrn(1),_=f.andln(1),C=E.cmp(k);return C<0||_===1&&C===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},s.prototype.modrn=function(f){var p=f<0;p&&(f=-f),n(f<=67108863);for(var E=(1<<26)%f,k=0,_=this.length-1;_>=0;_--)k=(E*k+(this.words[_]|0))%f;return p?-k:k},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var p=f<0;p&&(f=-f),n(f<=67108863);for(var E=0,k=this.length-1;k>=0;k--){var _=(this.words[k]|0)+E*67108864;this.words[k]=_/f|0,E=_%f}return this._strip(),p?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){n(f.negative===0),n(!f.isZero());var p=this,E=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var k=new s(1),_=new s(0),C=new s(0),R=new s(1),N=0;p.isEven()&&E.isEven();)p.iushrn(1),E.iushrn(1),++N;for(var d=E.clone(),P=p.clone();!p.isZero();){for(var Y=0,v=1;!(p.words[0]&v)&&Y<26;++Y,v<<=1);if(Y>0)for(p.iushrn(Y);Y-- >0;)(k.isOdd()||_.isOdd())&&(k.iadd(d),_.isub(P)),k.iushrn(1),_.iushrn(1);for(var B=0,F=1;!(E.words[0]&F)&&B<26;++B,F<<=1);if(B>0)for(E.iushrn(B);B-- >0;)(C.isOdd()||R.isOdd())&&(C.iadd(d),R.isub(P)),C.iushrn(1),R.iushrn(1);p.cmp(E)>=0?(p.isub(E),k.isub(C),_.isub(R)):(E.isub(p),C.isub(k),R.isub(_))}return{a:C,b:R,gcd:E.iushln(N)}},s.prototype._invmp=function(f){n(f.negative===0),n(!f.isZero());var p=this,E=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var k=new s(1),_=new s(0),C=E.clone();p.cmpn(1)>0&&E.cmpn(1)>0;){for(var R=0,N=1;!(p.words[0]&N)&&R<26;++R,N<<=1);if(R>0)for(p.iushrn(R);R-- >0;)k.isOdd()&&k.iadd(C),k.iushrn(1);for(var d=0,P=1;!(E.words[0]&P)&&d<26;++d,P<<=1);if(d>0)for(E.iushrn(d);d-- >0;)_.isOdd()&&_.iadd(C),_.iushrn(1);p.cmp(E)>=0?(p.isub(E),k.isub(_)):(E.isub(p),_.isub(k))}var Y;return p.cmpn(1)===0?Y=k:Y=_,Y.cmpn(0)<0&&Y.iadd(f),Y},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var p=this.clone(),E=f.clone();p.negative=0,E.negative=0;for(var k=0;p.isEven()&&E.isEven();k++)p.iushrn(1),E.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;E.isEven();)E.iushrn(1);var _=p.cmp(E);if(_<0){var C=p;p=E,E=C}else if(_===0||E.cmpn(1)===0)break;p.isub(E)}while(!0);return E.iushln(k)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){n(typeof f=="number");var p=f%26,E=(f-p)/26,k=1<>>26,R&=67108863,this.words[C]=R}return _!==0&&(this.words[C]=_,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var p=f<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var E;if(this.length>1)E=1;else{p&&(f=-f),n(f<=67108863,"Number is too big");var k=this.words[0]|0;E=k===f?0:kf.length)return 1;if(this.length=0;E--){var k=this.words[E]|0,_=f.words[E]|0;if(k!==_){k<_?p=-1:k>_&&(p=1);break}}return p},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new se(f)},s.prototype.toRed=function(f){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return n(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return n(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var j={k256:null,p224:null,p192:null,p25519:null};function D(I,f){this.name=I,this.p=new s(f,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},D.prototype.ireduce=function(f){var p=f,E;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),E=p.bitLength();while(E>this.n);var k=E0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},D.prototype.split=function(f,p){f.iushrn(this.n,0,p)},D.prototype.imulK=function(f){return f.imul(this.k)};function $(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i($,D),$.prototype.split=function(f,p){for(var E=4194303,k=Math.min(f.length,9),_=0;_>>22,C=R}C>>>=22,f.words[_-10]=C,C===0&&f.length>10?f.length-=10:f.length-=9},$.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var p=0,E=0;E>>=26,f.words[E]=_,p=k}return p!==0&&(f.words[f.length++]=p),f},s._prime=function(f){if(j[f])return j[f];var p;if(f==="k256")p=new $;else if(f==="p224")p=new H;else if(f==="p192")p=new J;else if(f==="p25519")p=new Z;else throw new Error("Unknown prime "+f);return j[f]=p,p};function se(I){if(typeof I=="string"){var f=s._prime(I);this.m=f.p,this.prime=f}else n(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}se.prototype._verify1=function(f){n(f.negative===0,"red works only with positives"),n(f.red,"red works only with red numbers")},se.prototype._verify2=function(f,p){n((f.negative|p.negative)===0,"red works only with positives"),n(f.red&&f.red===p.red,"red works only with red numbers")},se.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(c(f,f.umod(this.m)._forceRed(this)),f)},se.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},se.prototype.add=function(f,p){this._verify2(f,p);var E=f.add(p);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},se.prototype.iadd=function(f,p){this._verify2(f,p);var E=f.iadd(p);return E.cmp(this.m)>=0&&E.isub(this.m),E},se.prototype.sub=function(f,p){this._verify2(f,p);var E=f.sub(p);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},se.prototype.isub=function(f,p){this._verify2(f,p);var E=f.isub(p);return E.cmpn(0)<0&&E.iadd(this.m),E},se.prototype.shl=function(f,p){return this._verify1(f),this.imod(f.ushln(p))},se.prototype.imul=function(f,p){return this._verify2(f,p),this.imod(f.imul(p))},se.prototype.mul=function(f,p){return this._verify2(f,p),this.imod(f.mul(p))},se.prototype.isqr=function(f){return this.imul(f,f.clone())},se.prototype.sqr=function(f){return this.mul(f,f)},se.prototype.sqrt=function(f){if(f.isZero())return f.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var E=this.m.add(new s(1)).iushrn(2);return this.pow(f,E)}for(var k=this.m.subn(1),_=0;!k.isZero()&&k.andln(1)===0;)_++,k.iushrn(1);n(!k.isZero());var C=new s(1).toRed(this),R=C.redNeg(),N=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new s(2*d*d).toRed(this);this.pow(d,N).cmp(R)!==0;)d.redIAdd(R);for(var P=this.pow(d,k),Y=this.pow(f,k.addn(1).iushrn(1)),v=this.pow(f,k),B=_;v.cmp(C)!==0;){for(var F=v,U=0;F.cmp(C)!==0;U++)F=F.redSqr();n(U=0;_--){for(var P=p.words[_],Y=d-1;Y>=0;Y--){var v=P>>Y&1;if(C!==k[0]&&(C=this.sqr(C)),v===0&&R===0){N=0;continue}R<<=1,R|=v,N++,!(N!==E&&(_!==0||Y!==0))&&(C=this.mul(C,k[R]),N=0,R=0)}d=26}return C},se.prototype.convertTo=function(f){var p=f.umod(this.m);return p===f?p.clone():p},se.prototype.convertFrom=function(f){var p=f.clone();return p.red=null,p},s.mont=function(f){return new Ne(f)};function Ne(I){se.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(Ne,se),Ne.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},Ne.prototype.convertFrom=function(f){var p=this.imod(f.mul(this.rinv));return p.red=null,p},Ne.prototype.imul=function(f,p){if(f.isZero()||p.isZero())return f.words[0]=0,f.length=1,f;var E=f.imul(p),k=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=E.isub(k).iushrn(this.shift),C=_;return _.cmp(this.m)>=0?C=_.isub(this.m):_.cmpn(0)<0&&(C=_.iadd(this.m)),C._forceRed(this)},Ne.prototype.mul=function(f,p){if(f.isZero()||p.isZero())return new s(0)._forceRed(this);var E=f.mul(p),k=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=E.isub(k).iushrn(this.shift),C=_;return _.cmp(this.m)>=0?C=_.isub(this.m):_.cmpn(0)<0&&(C=_.iadd(this.m)),C._forceRed(this)},Ne.prototype.invm=function(f){var p=this.imod(f._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(t,ze)})(jd);var aE=jd.exports;const ue=_i(aE),lE="bignumber/5.7.0";var la=ue.BN;const Sn=new O(lE),Wc={},kp=9007199254740991;let Np=!1;class G{constructor(e,r){e!==Wc&&Sn.throwError("cannot call constructor directly; use BigNumber.from",O.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Yt(ve(this).fromTwos(e))}toTwos(e){return Yt(ve(this).toTwos(e))}abs(){return this._hex[0]==="-"?G.from(this._hex.substring(1)):this}add(e){return Yt(ve(this).add(ve(e)))}sub(e){return Yt(ve(this).sub(ve(e)))}div(e){return G.from(e).isZero()&&Er("division-by-zero","div"),Yt(ve(this).div(ve(e)))}mul(e){return Yt(ve(this).mul(ve(e)))}mod(e){const r=ve(e);return r.isNeg()&&Er("division-by-zero","mod"),Yt(ve(this).umod(r))}pow(e){const r=ve(e);return r.isNeg()&&Er("negative-power","pow"),Yt(ve(this).pow(r))}and(e){const r=ve(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","and"),Yt(ve(this).and(r))}or(e){const r=ve(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","or"),Yt(ve(this).or(r))}xor(e){const r=ve(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","xor"),Yt(ve(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Er("negative-width","mask"),Yt(ve(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Er("negative-width","shl"),Yt(ve(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Er("negative-width","shr"),Yt(ve(this).shrn(e))}eq(e){return ve(this).eq(ve(e))}lt(e){return ve(this).lt(ve(e))}lte(e){return ve(this).lte(ve(e))}gt(e){return ve(this).gt(ve(e))}gte(e){return ve(this).gte(ve(e))}isNegative(){return this._hex[0]==="-"}isZero(){return ve(this).isZero()}toNumber(){try{return ve(this).toNumber()}catch{Er("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Sn.throwError("this platform does not support BigInt",O.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Np||(Np=!0,Sn.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Sn.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",O.errors.UNEXPECTED_ARGUMENT,{}):Sn.throwError("BigNumber.toString does not accept parameters",O.errors.UNEXPECTED_ARGUMENT,{})),ve(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof G)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new G(Wc,ua(e)):e.match(/^-?[0-9]+$/)?new G(Wc,ua(new la(e))):Sn.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Er("underflow","BigNumber.from",e),(e>=kp||e<=-kp)&&Er("overflow","BigNumber.from",e),G.from(String(e));const r=e;if(typeof r=="bigint")return G.from(r.toString());if(zu(r))return G.from(re(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return G.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(pe(n)||n[0]==="-"&&pe(n.substring(1))))return G.from(n)}return Sn.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function ua(t){if(typeof t!="string")return ua(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Sn.throwArgumentError("invalid hex","value",t),t=ua(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Yt(t){return G.from(ua(t))}function ve(t){const e=G.from(t).toHexString();return e[0]==="-"?new la("-"+e.substring(3),16):new la(e.substring(2),16)}function Er(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Sn.throwError(t,O.errors.NUMERIC_FAULT,n)}function uE(t){return new la(t,36).toString(16)}function cE(t){return new la(t,16).toString(36)}var _1={exports:{}};/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
- */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=ze:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),c=[31,7936,2031616,520093696],h=[4,1024,262144,67108864],m=[1,256,65536,16777216],g=[6,1536,393216,100663296],w=[0,8,16,24],b=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],S=[224,256,384,512],x=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],A={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(v){return Object.prototype.toString.call(v)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(v){return typeof v=="object"&&v.buffer&&v.buffer.constructor===ArrayBuffer});for(var T=function(v,B,F){return function(U){return new d(v,B,v).update(U)[F]()}},j=function(v,B,F){return function(U,q){return new d(v,B,q).update(U)[F]()}},D=function(v,B,F){return function(U,q,ie,Q){return f["cshake"+v].update(U,q,ie,Q)[F]()}},$=function(v,B,F){return function(U,q,ie,Q){return f["kmac"+v].update(U,q,ie,Q)[F]()}},H=function(v,B,F,U){for(var q=0;q>5,this.byteCount=this.blockCount<<2,this.outputBlocks=F>>5,this.extraBytes=(F&31)>>3;for(var U=0;U<50;++U)this.s[U]=0}d.prototype.update=function(v){if(this.finalized)throw new Error(r);var B,F=typeof v;if(F!=="string"){if(F==="object"){if(v===null)throw new Error(e);if(l&&v.constructor===ArrayBuffer)v=new Uint8Array(v);else if(!Array.isArray(v)&&(!l||!ArrayBuffer.isView(v)))throw new Error(e)}else throw new Error(e);B=!0}for(var U=this.blocks,q=this.byteCount,ie=v.length,Q=this.blockCount,W=0,Ye=this.s,K,ae;W>2]|=v[W]<>2]|=ae<>2]|=(192|ae>>6)<>2]|=(128|ae&63)<=57344?(U[K>>2]|=(224|ae>>12)<>2]|=(128|ae>>6&63)<>2]|=(128|ae&63)<>2]|=(240|ae>>18)<>2]|=(128|ae>>12&63)<>2]|=(128|ae>>6&63)<>2]|=(128|ae&63)<=q){for(this.start=K-q,this.block=U[Q],K=0;K>8,F=v&255;F>0;)q.unshift(F),v=v>>8,F=v&255,++U;return B?q.push(U):q.unshift(U),this.update(q),q.length},d.prototype.encodeString=function(v){var B,F=typeof v;if(F!=="string"){if(F==="object"){if(v===null)throw new Error(e);if(l&&v.constructor===ArrayBuffer)v=new Uint8Array(v);else if(!Array.isArray(v)&&(!l||!ArrayBuffer.isView(v)))throw new Error(e)}else throw new Error(e);B=!0}var U=0,q=v.length;if(B)U=q;else for(var ie=0;ie=57344?U+=3:(Q=65536+((Q&1023)<<10|v.charCodeAt(++ie)&1023),U+=4)}return U+=this.encode(U*8),this.update(v),U},d.prototype.bytepad=function(v,B){for(var F=this.encode(B),U=0;U>2]|=this.padding[B&3],this.lastByteIndex===this.byteCount)for(v[0]=v[F],B=1;B>4&15]+u[W&15]+u[W>>12&15]+u[W>>8&15]+u[W>>20&15]+u[W>>16&15]+u[W>>28&15]+u[W>>24&15];ie%v===0&&(Y(B),q=0)}return U&&(W=B[q],Q+=u[W>>4&15]+u[W&15],U>1&&(Q+=u[W>>12&15]+u[W>>8&15]),U>2&&(Q+=u[W>>20&15]+u[W>>16&15])),Q},d.prototype.arrayBuffer=function(){this.finalize();var v=this.blockCount,B=this.s,F=this.outputBlocks,U=this.extraBytes,q=0,ie=0,Q=this.outputBits>>3,W;U?W=new ArrayBuffer(F+1<<2):W=new ArrayBuffer(Q);for(var Ye=new Uint32Array(W);ie>8&255,Q[W+2]=Ye>>16&255,Q[W+3]=Ye>>24&255;ie%v===0&&Y(B)}return U&&(W=ie<<2,Ye=B[q],Q[W]=Ye&255,U>1&&(Q[W+1]=Ye>>8&255),U>2&&(Q[W+2]=Ye>>16&255)),Q};function P(v,B,F){d.call(this,v,B,F)}P.prototype=new d,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),d.prototype.finalize.call(this)};var Y=function(v){var B,F,U,q,ie,Q,W,Ye,K,ae,Yr,Te,Me,Xr,Pe,ce,xr,fe,Le,Zr,me,$e,bn,He,Ve,Vt,je,qe,Tr,Ce,Ge,En,Be,We,An,De,ne,at,ge,he,nt,Ae,_e,Pt,Ie,Fe,Qt,Ke,Qe,Jt,Re,Ue,br,ke,Xe,Pi,Ze,et,Kn,Qn,Jn,Yn,Xn;for(U=0;U<48;U+=2)q=v[0]^v[10]^v[20]^v[30]^v[40],ie=v[1]^v[11]^v[21]^v[31]^v[41],Q=v[2]^v[12]^v[22]^v[32]^v[42],W=v[3]^v[13]^v[23]^v[33]^v[43],Ye=v[4]^v[14]^v[24]^v[34]^v[44],K=v[5]^v[15]^v[25]^v[35]^v[45],ae=v[6]^v[16]^v[26]^v[36]^v[46],Yr=v[7]^v[17]^v[27]^v[37]^v[47],Te=v[8]^v[18]^v[28]^v[38]^v[48],Me=v[9]^v[19]^v[29]^v[39]^v[49],B=Te^(Q<<1|W>>>31),F=Me^(W<<1|Q>>>31),v[0]^=B,v[1]^=F,v[10]^=B,v[11]^=F,v[20]^=B,v[21]^=F,v[30]^=B,v[31]^=F,v[40]^=B,v[41]^=F,B=q^(Ye<<1|K>>>31),F=ie^(K<<1|Ye>>>31),v[2]^=B,v[3]^=F,v[12]^=B,v[13]^=F,v[22]^=B,v[23]^=F,v[32]^=B,v[33]^=F,v[42]^=B,v[43]^=F,B=Q^(ae<<1|Yr>>>31),F=W^(Yr<<1|ae>>>31),v[4]^=B,v[5]^=F,v[14]^=B,v[15]^=F,v[24]^=B,v[25]^=F,v[34]^=B,v[35]^=F,v[44]^=B,v[45]^=F,B=Ye^(Te<<1|Me>>>31),F=K^(Me<<1|Te>>>31),v[6]^=B,v[7]^=F,v[16]^=B,v[17]^=F,v[26]^=B,v[27]^=F,v[36]^=B,v[37]^=F,v[46]^=B,v[47]^=F,B=ae^(q<<1|ie>>>31),F=Yr^(ie<<1|q>>>31),v[8]^=B,v[9]^=F,v[18]^=B,v[19]^=F,v[28]^=B,v[29]^=F,v[38]^=B,v[39]^=F,v[48]^=B,v[49]^=F,Xr=v[0],Pe=v[1],Fe=v[11]<<4|v[10]>>>28,Qt=v[10]<<4|v[11]>>>28,qe=v[20]<<3|v[21]>>>29,Tr=v[21]<<3|v[20]>>>29,Qn=v[31]<<9|v[30]>>>23,Jn=v[30]<<9|v[31]>>>23,Ae=v[40]<<18|v[41]>>>14,_e=v[41]<<18|v[40]>>>14,We=v[2]<<1|v[3]>>>31,An=v[3]<<1|v[2]>>>31,ce=v[13]<<12|v[12]>>>20,xr=v[12]<<12|v[13]>>>20,Ke=v[22]<<10|v[23]>>>22,Qe=v[23]<<10|v[22]>>>22,Ce=v[33]<<13|v[32]>>>19,Ge=v[32]<<13|v[33]>>>19,Yn=v[42]<<2|v[43]>>>30,Xn=v[43]<<2|v[42]>>>30,ke=v[5]<<30|v[4]>>>2,Xe=v[4]<<30|v[5]>>>2,De=v[14]<<6|v[15]>>>26,ne=v[15]<<6|v[14]>>>26,fe=v[25]<<11|v[24]>>>21,Le=v[24]<<11|v[25]>>>21,Jt=v[34]<<15|v[35]>>>17,Re=v[35]<<15|v[34]>>>17,En=v[45]<<29|v[44]>>>3,Be=v[44]<<29|v[45]>>>3,He=v[6]<<28|v[7]>>>4,Ve=v[7]<<28|v[6]>>>4,Pi=v[17]<<23|v[16]>>>9,Ze=v[16]<<23|v[17]>>>9,at=v[26]<<25|v[27]>>>7,ge=v[27]<<25|v[26]>>>7,Zr=v[36]<<21|v[37]>>>11,me=v[37]<<21|v[36]>>>11,Ue=v[47]<<24|v[46]>>>8,br=v[46]<<24|v[47]>>>8,Pt=v[8]<<27|v[9]>>>5,Ie=v[9]<<27|v[8]>>>5,Vt=v[18]<<20|v[19]>>>12,je=v[19]<<20|v[18]>>>12,et=v[29]<<7|v[28]>>>25,Kn=v[28]<<7|v[29]>>>25,he=v[38]<<8|v[39]>>>24,nt=v[39]<<8|v[38]>>>24,$e=v[48]<<14|v[49]>>>18,bn=v[49]<<14|v[48]>>>18,v[0]=Xr^~ce&fe,v[1]=Pe^~xr&Le,v[10]=He^~Vt&qe,v[11]=Ve^~je&Tr,v[20]=We^~De&at,v[21]=An^~ne&ge,v[30]=Pt^~Fe&Ke,v[31]=Ie^~Qt&Qe,v[40]=ke^~Pi&et,v[41]=Xe^~Ze&Kn,v[2]=ce^~fe&Zr,v[3]=xr^~Le&me,v[12]=Vt^~qe&Ce,v[13]=je^~Tr&Ge,v[22]=De^~at&he,v[23]=ne^~ge&nt,v[32]=Fe^~Ke&Jt,v[33]=Qt^~Qe&Re,v[42]=Pi^~et&Qn,v[43]=Ze^~Kn&Jn,v[4]=fe^~Zr&$e,v[5]=Le^~me&bn,v[14]=qe^~Ce&En,v[15]=Tr^~Ge&Be,v[24]=at^~he&Ae,v[25]=ge^~nt&_e,v[34]=Ke^~Jt&Ue,v[35]=Qe^~Re&br,v[44]=et^~Qn&Yn,v[45]=Kn^~Jn&Xn,v[6]=Zr^~$e&Xr,v[7]=me^~bn&Pe,v[16]=Ce^~En&He,v[17]=Ge^~Be&Ve,v[26]=he^~Ae&We,v[27]=nt^~_e&An,v[36]=Jt^~Ue&Pt,v[37]=Re^~br&Ie,v[46]=Qn^~Yn&ke,v[47]=Jn^~Xn&Xe,v[8]=$e^~Xr&ce,v[9]=bn^~Pe&xr,v[18]=En^~He&Vt,v[19]=Be^~Ve&je,v[28]=Ae^~We&De,v[29]=_e^~An&ne,v[38]=Ue^~Pt&Fe,v[39]=br^~Ie&Qt,v[48]=Yn^~ke&Pi,v[49]=Xn^~Xe&Ze,v[0]^=b[U],v[1]^=b[U+1]};if(a)t.exports=f;else for(E=0;E>=8;return e}function Pp(t,e,r){let n=0;for(let i=0;ie+1+n&&nn.throwError("child data too short",O.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function k1(t,e){if(t.length===0&&nn.throwError("data too short",O.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&nn.throwError("data short segment too short",O.errors.BUFFER_OVERRUN,{});const n=Pp(t,e+1,r);return e+1+r+n>t.length&&nn.throwError("data long segment too short",O.errors.BUFFER_OVERRUN,{}),Cp(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&nn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{}),Cp(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&nn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const n=Pp(t,e+1,r);e+1+r+n>t.length&&nn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const i=re(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&nn.throwError("data too short",O.errors.BUFFER_OVERRUN,{});const n=re(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:re(t[e])}}function Bd(t){const e=oe(t),r=k1(e,0);return r.consumed!==e.length&&nn.throwArgumentError("invalid rlp data","data",t),r.result}const pE="address/5.7.0",fi=new O(pE);function Ip(t){pe(t,20)||fi.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=oe(st(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const mE=9007199254740991;function gE(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Dd={};for(let t=0;t<10;t++)Dd[String(t)]=String(t);for(let t=0;t<26;t++)Dd[String.fromCharCode(65+t)]=String(10+t);const Rp=Math.floor(gE(mE));function N1(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Dd[n]).join("");for(;e.length>=Rp;){let n=e.substring(0,Rp);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function gt(t){let e=null;if(typeof t!="string"&&fi.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=Ip(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&fi.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==N1(t)&&fi.throwArgumentError("bad icap checksum","address",t),e=uE(t.substring(4));e.length<40;)e="0"+e;e=Ip("0x"+e)}else fi.throwArgumentError("invalid address","address",t);return e}function vE(t){try{return gt(t),!0}catch{}return!1}function yE(t){let e=cE(gt(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+N1("XE00"+e)+e}function Fd(t){let e=null;try{e=gt(t.from)}catch{fi.throwArgumentError("missing from address","transaction",t)}const r=$s(oe(G.from(t.nonce).toHexString()));return gt(Rt(st(Vu([e,r])),12))}function wE(t,e,r){return Un(e)!==32&&fi.throwArgumentError("salt must be 32 bytes","salt",e),Un(r)!==32&&fi.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),gt(Rt(st(Ut(["0xff",gt(t),e,r])),12))}const xE=Object.freeze(Object.defineProperty({__proto__:null,getAddress:gt,getContractAddress:Fd,getCreate2Address:wE,getIcapAddress:yE,isAddress:vE},Symbol.toStringTag,{value:"Module"})),bE=Ks(xE);var EE={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Op=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??typeof c!="object"?c:Object.assign({},e,c),r.forEach(m=>m(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(EE?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},M1=t=>t?Op(t):Op;var P1={exports:{}},C1={},I1={exports:{}},R1={};/**
+ */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=ze:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),c=[31,7936,2031616,520093696],h=[4,1024,262144,67108864],m=[1,256,65536,16777216],g=[6,1536,393216,100663296],w=[0,8,16,24],b=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],S=[224,256,384,512],x=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],A={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(v){return Object.prototype.toString.call(v)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(v){return typeof v=="object"&&v.buffer&&v.buffer.constructor===ArrayBuffer});for(var T=function(v,B,F){return function(U){return new d(v,B,v).update(U)[F]()}},j=function(v,B,F){return function(U,q){return new d(v,B,q).update(U)[F]()}},D=function(v,B,F){return function(U,q,ie,Q){return f["cshake"+v].update(U,q,ie,Q)[F]()}},$=function(v,B,F){return function(U,q,ie,Q){return f["kmac"+v].update(U,q,ie,Q)[F]()}},H=function(v,B,F,U){for(var q=0;q>5,this.byteCount=this.blockCount<<2,this.outputBlocks=F>>5,this.extraBytes=(F&31)>>3;for(var U=0;U<50;++U)this.s[U]=0}d.prototype.update=function(v){if(this.finalized)throw new Error(r);var B,F=typeof v;if(F!=="string"){if(F==="object"){if(v===null)throw new Error(e);if(l&&v.constructor===ArrayBuffer)v=new Uint8Array(v);else if(!Array.isArray(v)&&(!l||!ArrayBuffer.isView(v)))throw new Error(e)}else throw new Error(e);B=!0}for(var U=this.blocks,q=this.byteCount,ie=v.length,Q=this.blockCount,W=0,Ye=this.s,K,ae;W>2]|=v[W]<>2]|=ae<>2]|=(192|ae>>6)<>2]|=(128|ae&63)<=57344?(U[K>>2]|=(224|ae>>12)<>2]|=(128|ae>>6&63)<>2]|=(128|ae&63)<>2]|=(240|ae>>18)<>2]|=(128|ae>>12&63)<>2]|=(128|ae>>6&63)<>2]|=(128|ae&63)<=q){for(this.start=K-q,this.block=U[Q],K=0;K>8,F=v&255;F>0;)q.unshift(F),v=v>>8,F=v&255,++U;return B?q.push(U):q.unshift(U),this.update(q),q.length},d.prototype.encodeString=function(v){var B,F=typeof v;if(F!=="string"){if(F==="object"){if(v===null)throw new Error(e);if(l&&v.constructor===ArrayBuffer)v=new Uint8Array(v);else if(!Array.isArray(v)&&(!l||!ArrayBuffer.isView(v)))throw new Error(e)}else throw new Error(e);B=!0}var U=0,q=v.length;if(B)U=q;else for(var ie=0;ie=57344?U+=3:(Q=65536+((Q&1023)<<10|v.charCodeAt(++ie)&1023),U+=4)}return U+=this.encode(U*8),this.update(v),U},d.prototype.bytepad=function(v,B){for(var F=this.encode(B),U=0;U>2]|=this.padding[B&3],this.lastByteIndex===this.byteCount)for(v[0]=v[F],B=1;B>4&15]+u[W&15]+u[W>>12&15]+u[W>>8&15]+u[W>>20&15]+u[W>>16&15]+u[W>>28&15]+u[W>>24&15];ie%v===0&&(Y(B),q=0)}return U&&(W=B[q],Q+=u[W>>4&15]+u[W&15],U>1&&(Q+=u[W>>12&15]+u[W>>8&15]),U>2&&(Q+=u[W>>20&15]+u[W>>16&15])),Q},d.prototype.arrayBuffer=function(){this.finalize();var v=this.blockCount,B=this.s,F=this.outputBlocks,U=this.extraBytes,q=0,ie=0,Q=this.outputBits>>3,W;U?W=new ArrayBuffer(F+1<<2):W=new ArrayBuffer(Q);for(var Ye=new Uint32Array(W);ie>8&255,Q[W+2]=Ye>>16&255,Q[W+3]=Ye>>24&255;ie%v===0&&Y(B)}return U&&(W=ie<<2,Ye=B[q],Q[W]=Ye&255,U>1&&(Q[W+1]=Ye>>8&255),U>2&&(Q[W+2]=Ye>>16&255)),Q};function P(v,B,F){d.call(this,v,B,F)}P.prototype=new d,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),d.prototype.finalize.call(this)};var Y=function(v){var B,F,U,q,ie,Q,W,Ye,K,ae,Yr,Te,Me,Xr,Pe,ce,xr,fe,Le,Zr,me,$e,bn,He,Ve,Vt,je,qe,Lr,Ce,Ge,En,Be,We,An,De,ne,at,ge,he,nt,Ae,_e,Pt,Ie,Fe,Qt,Ke,Qe,Jt,Re,Ue,br,ke,Xe,Pi,Ze,et,Kn,Qn,Jn,Yn,Xn;for(U=0;U<48;U+=2)q=v[0]^v[10]^v[20]^v[30]^v[40],ie=v[1]^v[11]^v[21]^v[31]^v[41],Q=v[2]^v[12]^v[22]^v[32]^v[42],W=v[3]^v[13]^v[23]^v[33]^v[43],Ye=v[4]^v[14]^v[24]^v[34]^v[44],K=v[5]^v[15]^v[25]^v[35]^v[45],ae=v[6]^v[16]^v[26]^v[36]^v[46],Yr=v[7]^v[17]^v[27]^v[37]^v[47],Te=v[8]^v[18]^v[28]^v[38]^v[48],Me=v[9]^v[19]^v[29]^v[39]^v[49],B=Te^(Q<<1|W>>>31),F=Me^(W<<1|Q>>>31),v[0]^=B,v[1]^=F,v[10]^=B,v[11]^=F,v[20]^=B,v[21]^=F,v[30]^=B,v[31]^=F,v[40]^=B,v[41]^=F,B=q^(Ye<<1|K>>>31),F=ie^(K<<1|Ye>>>31),v[2]^=B,v[3]^=F,v[12]^=B,v[13]^=F,v[22]^=B,v[23]^=F,v[32]^=B,v[33]^=F,v[42]^=B,v[43]^=F,B=Q^(ae<<1|Yr>>>31),F=W^(Yr<<1|ae>>>31),v[4]^=B,v[5]^=F,v[14]^=B,v[15]^=F,v[24]^=B,v[25]^=F,v[34]^=B,v[35]^=F,v[44]^=B,v[45]^=F,B=Ye^(Te<<1|Me>>>31),F=K^(Me<<1|Te>>>31),v[6]^=B,v[7]^=F,v[16]^=B,v[17]^=F,v[26]^=B,v[27]^=F,v[36]^=B,v[37]^=F,v[46]^=B,v[47]^=F,B=ae^(q<<1|ie>>>31),F=Yr^(ie<<1|q>>>31),v[8]^=B,v[9]^=F,v[18]^=B,v[19]^=F,v[28]^=B,v[29]^=F,v[38]^=B,v[39]^=F,v[48]^=B,v[49]^=F,Xr=v[0],Pe=v[1],Fe=v[11]<<4|v[10]>>>28,Qt=v[10]<<4|v[11]>>>28,qe=v[20]<<3|v[21]>>>29,Lr=v[21]<<3|v[20]>>>29,Qn=v[31]<<9|v[30]>>>23,Jn=v[30]<<9|v[31]>>>23,Ae=v[40]<<18|v[41]>>>14,_e=v[41]<<18|v[40]>>>14,We=v[2]<<1|v[3]>>>31,An=v[3]<<1|v[2]>>>31,ce=v[13]<<12|v[12]>>>20,xr=v[12]<<12|v[13]>>>20,Ke=v[22]<<10|v[23]>>>22,Qe=v[23]<<10|v[22]>>>22,Ce=v[33]<<13|v[32]>>>19,Ge=v[32]<<13|v[33]>>>19,Yn=v[42]<<2|v[43]>>>30,Xn=v[43]<<2|v[42]>>>30,ke=v[5]<<30|v[4]>>>2,Xe=v[4]<<30|v[5]>>>2,De=v[14]<<6|v[15]>>>26,ne=v[15]<<6|v[14]>>>26,fe=v[25]<<11|v[24]>>>21,Le=v[24]<<11|v[25]>>>21,Jt=v[34]<<15|v[35]>>>17,Re=v[35]<<15|v[34]>>>17,En=v[45]<<29|v[44]>>>3,Be=v[44]<<29|v[45]>>>3,He=v[6]<<28|v[7]>>>4,Ve=v[7]<<28|v[6]>>>4,Pi=v[17]<<23|v[16]>>>9,Ze=v[16]<<23|v[17]>>>9,at=v[26]<<25|v[27]>>>7,ge=v[27]<<25|v[26]>>>7,Zr=v[36]<<21|v[37]>>>11,me=v[37]<<21|v[36]>>>11,Ue=v[47]<<24|v[46]>>>8,br=v[46]<<24|v[47]>>>8,Pt=v[8]<<27|v[9]>>>5,Ie=v[9]<<27|v[8]>>>5,Vt=v[18]<<20|v[19]>>>12,je=v[19]<<20|v[18]>>>12,et=v[29]<<7|v[28]>>>25,Kn=v[28]<<7|v[29]>>>25,he=v[38]<<8|v[39]>>>24,nt=v[39]<<8|v[38]>>>24,$e=v[48]<<14|v[49]>>>18,bn=v[49]<<14|v[48]>>>18,v[0]=Xr^~ce&fe,v[1]=Pe^~xr&Le,v[10]=He^~Vt&qe,v[11]=Ve^~je&Lr,v[20]=We^~De&at,v[21]=An^~ne&ge,v[30]=Pt^~Fe&Ke,v[31]=Ie^~Qt&Qe,v[40]=ke^~Pi&et,v[41]=Xe^~Ze&Kn,v[2]=ce^~fe&Zr,v[3]=xr^~Le&me,v[12]=Vt^~qe&Ce,v[13]=je^~Lr&Ge,v[22]=De^~at&he,v[23]=ne^~ge&nt,v[32]=Fe^~Ke&Jt,v[33]=Qt^~Qe&Re,v[42]=Pi^~et&Qn,v[43]=Ze^~Kn&Jn,v[4]=fe^~Zr&$e,v[5]=Le^~me&bn,v[14]=qe^~Ce&En,v[15]=Lr^~Ge&Be,v[24]=at^~he&Ae,v[25]=ge^~nt&_e,v[34]=Ke^~Jt&Ue,v[35]=Qe^~Re&br,v[44]=et^~Qn&Yn,v[45]=Kn^~Jn&Xn,v[6]=Zr^~$e&Xr,v[7]=me^~bn&Pe,v[16]=Ce^~En&He,v[17]=Ge^~Be&Ve,v[26]=he^~Ae&We,v[27]=nt^~_e&An,v[36]=Jt^~Ue&Pt,v[37]=Re^~br&Ie,v[46]=Qn^~Yn&ke,v[47]=Jn^~Xn&Xe,v[8]=$e^~Xr&ce,v[9]=bn^~Pe&xr,v[18]=En^~He&Vt,v[19]=Be^~Ve&je,v[28]=Ae^~We&De,v[29]=_e^~An&ne,v[38]=Ue^~Pt&Fe,v[39]=br^~Ie&Qt,v[48]=Yn^~ke&Pi,v[49]=Xn^~Xe&Ze,v[0]^=b[U],v[1]^=b[U+1]};if(a)t.exports=f;else for(E=0;E>=8;return e}function Pp(t,e,r){let n=0;for(let i=0;ie+1+n&&nn.throwError("child data too short",O.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function k1(t,e){if(t.length===0&&nn.throwError("data too short",O.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&nn.throwError("data short segment too short",O.errors.BUFFER_OVERRUN,{});const n=Pp(t,e+1,r);return e+1+r+n>t.length&&nn.throwError("data long segment too short",O.errors.BUFFER_OVERRUN,{}),Cp(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&nn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{}),Cp(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&nn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const n=Pp(t,e+1,r);e+1+r+n>t.length&&nn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const i=re(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&nn.throwError("data too short",O.errors.BUFFER_OVERRUN,{});const n=re(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:re(t[e])}}function Bd(t){const e=oe(t),r=k1(e,0);return r.consumed!==e.length&&nn.throwArgumentError("invalid rlp data","data",t),r.result}const pE="address/5.7.0",fi=new O(pE);function Ip(t){pe(t,20)||fi.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=oe(st(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const mE=9007199254740991;function gE(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Dd={};for(let t=0;t<10;t++)Dd[String(t)]=String(t);for(let t=0;t<26;t++)Dd[String.fromCharCode(65+t)]=String(10+t);const Rp=Math.floor(gE(mE));function N1(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Dd[n]).join("");for(;e.length>=Rp;){let n=e.substring(0,Rp);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function gt(t){let e=null;if(typeof t!="string"&&fi.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=Ip(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&fi.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==N1(t)&&fi.throwArgumentError("bad icap checksum","address",t),e=uE(t.substring(4));e.length<40;)e="0"+e;e=Ip("0x"+e)}else fi.throwArgumentError("invalid address","address",t);return e}function vE(t){try{return gt(t),!0}catch{}return!1}function yE(t){let e=cE(gt(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+N1("XE00"+e)+e}function Fd(t){let e=null;try{e=gt(t.from)}catch{fi.throwArgumentError("missing from address","transaction",t)}const r=$s(oe(G.from(t.nonce).toHexString()));return gt(Rt(st(Vu([e,r])),12))}function wE(t,e,r){return Un(e)!==32&&fi.throwArgumentError("salt must be 32 bytes","salt",e),Un(r)!==32&&fi.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),gt(Rt(st(Ut(["0xff",gt(t),e,r])),12))}const xE=Object.freeze(Object.defineProperty({__proto__:null,getAddress:gt,getContractAddress:Fd,getCreate2Address:wE,getIcapAddress:yE,isAddress:vE},Symbol.toStringTag,{value:"Module"})),bE=Ks(xE);var EE={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Op=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??typeof c!="object"?c:Object.assign({},e,c),r.forEach(m=>m(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(EE?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},M1=t=>t?Op(t):Op;var P1={exports:{}},C1={},I1={exports:{}},R1={};/**
* @license React
* use-sync-external-store-shim.production.min.js
*
@@ -87,8 +87,8 @@ Error generating stack: `+s.message+`
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var qu=L,OE=RE;function TE(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var LE=typeof Object.is=="function"?Object.is:TE,jE=OE.useSyncExternalStore,BE=qu.useRef,DE=qu.useEffect,FE=qu.useMemo,UE=qu.useDebugValue;C1.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var s=BE(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=FE(function(){function l(g){if(!u){if(u=!0,c=g,g=n(g),i!==void 0&&o.hasValue){var w=o.value;if(i(w,g))return h=w}return h=g}if(w=h,LE(c,g))return w;var b=n(g);return i!==void 0&&i(w,b)?w:(c=g,h=b)}var u=!1,c,h,m=r===void 0?null:r;return[function(){return l(e())},m===null?void 0:function(){return l(m())}]},[e,r,n,i]);var a=jE(t,s[0],s[1]);return DE(function(){o.hasValue=!0,o.value=a},[a]),UE(a),a};P1.exports=C1;var zE=P1.exports;const Gu=_i(zE),{useSyncExternalStoreWithSelector:$E}=Gu;function O1(t,e=t.getState,r){const n=$E(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return L.useDebugValue(n),n}const Tp=t=>{const e=typeof t=="function"?M1(t):t,r=(n,i)=>O1(e,n,i);return Object.assign(r,e),r},T1=t=>t?Tp(t):Tp;var HE=t=>T1(t);const VE=Object.freeze(Object.defineProperty({__proto__:null,create:T1,createStore:M1,default:HE,useStore:O1},Symbol.toStringTag,{value:"Module"})),qE=Ks(VE);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createWeb3ReactStoreAndActions=t.MAX_SAFE_CHAIN_ID=void 0;const e=bE,r=qE;t.MAX_SAFE_CHAIN_ID=0xfffffffffffec;function n(a){if(!Number.isInteger(a)||a<=0||a>t.MAX_SAFE_CHAIN_ID)throw new Error(`Invalid chainId ${a}`)}function i(a){return(0,e.getAddress)(a)}const s={chainId:void 0,accounts:void 0,activating:!1};function o(){const a=(0,r.createStore)()(()=>s);let l=0;function u(){const m=++l;return a.setState(Object.assign(Object.assign({},s),{activating:!0})),()=>{l===m&&a.setState({activating:!1})}}function c(m){if(m.chainId!==void 0&&n(m.chainId),m.accounts!==void 0)for(let g=0;g{var w,b;const S=(w=m.chainId)!==null&&w!==void 0?w:g.chainId,x=(b=m.accounts)!==null&&b!==void 0?b:g.accounts;let y=g.activating;return y&&S&&x&&(y=!1),{chainId:S,accounts:x,activating:y}})}function h(){l++,a.setState(s)}return[a,{startActivation:u,update:c,resetState:h}]}t.createWeb3ReactStoreAndActions=o})(E1);var GE={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Lp=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??typeof c!="object"?c:Object.assign({},e,c),r.forEach(m=>m(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(GE?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},Ud=t=>t?Lp(t):Lp,{useSyncExternalStoreWithSelector:WE}=Gu;function L1(t,e=t.getState,r){const n=WE(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return L.useDebugValue(n),n}const jp=t=>{const e=typeof t=="function"?Ud(t):t,r=(n,i)=>L1(e,n,i);return Object.assign(r,e),r},j1=t=>t?jp(t):jp;var KE=t=>j1(t);const QE=Object.freeze(Object.defineProperty({__proto__:null,create:j1,createStore:Ud,default:KE,useStore:L1},Symbol.toStringTag,{value:"Module"})),JE=Ks(QE),{useSyncExternalStoreWithSelector:YE}=Gu;function B1(t,e=t.getState,r){const n=YE(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return L.useDebugValue(n),n}const Bp=(t,e)=>{const r=Ud(t),n=(i,s=e)=>B1(r,i,s);return Object.assign(n,r),n},XE=(t,e)=>t?Bp(t,e):Bp,ZE=Object.freeze(Object.defineProperty({__proto__:null,createWithEqualityFn:XE,useStoreWithEqualityFn:B1},Symbol.toStringTag,{value:"Module"})),eA=Ks(ZE),tA="properties/5.7.0";var rA=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const nu=new O(tA);function z(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function dr(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function wt(t){return rA(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function nA(t,e){(!t||typeof t!="object")&&nu.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||nu.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function ot(t){const e={};for(const r in t)e[r]=t[r];return e}const iA={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function D1(t){if(t==null||iA[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;ror(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&z(e,r,or(n))}return e}return nu.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function or(t){return sA(t)}class Na{constructor(e){for(const r in e)this[r]=or(e[r])}}const oA="abstract-provider/5.7.0";var aA=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const lA=new O(oA);class uA extends Na{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class Zs{constructor(){lA.checkAbstract(new.target,Zs),z(this,"_isProvider",!0)}getFeeData(){return aA(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield wt({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=G.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const cA="networks/5.7.1",Dp=new O(cA);function fA(t){return t&&typeof t.renetwork=="function"}function Mn(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return Mn(r)},e}function iu(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return iu(t,n)},r}const Fp={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Mn("homestead")},Up={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Mn("ropsten")},zp={chainId:63,name:"classicMordor",_defaultProvider:iu("https://www.ethercluster.com/mordor","classicMordor")},Ya={unspecified:{chainId:0,name:"unspecified"},homestead:Fp,mainnet:Fp,morden:{chainId:2,name:"morden"},ropsten:Up,testnet:Up,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Mn("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Mn("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Mn("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Mn("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:iu("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:zp,classicTestnet:zp,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:iu("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Mn("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Mn("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function zd(t){if(t==null)return null;if(typeof t=="number"){for(const n in Ya){const i=Ya[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=Ya[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=Ya[t.name];if(!e)return typeof t.chainId!="number"&&Dp.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&Dp.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(fA(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}function F1(t){t=atob(t);const e=[];for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n>6===2;o++)s++;return s}return t===cr.OVERRUN?r.length-e-1:0}function wA(t,e,r,n,i){return t===cr.OVERLONG?(n.push(i),0):(n.push(65533),V1(t,e,r))}const xA=Object.freeze({error:yA,ignore:V1,replace:wA});function q1(t,e){e==null&&(e=xA.error),t=oe(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(cr.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(cr.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(cr.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let l=0;l1114111){n+=e(cr.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(cr.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(cr.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function gr(t,e=ca.current){e!=ca.current&&(H1.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return oe(r)}function bA(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Ma(t,e){return bA(q1(t,e))}function EA(t,e=ca.current){return q1(gr(t,e))}function bs(t){return st(gr(t))}const G1="hash/5.7.0";function W1(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(s,o){n.call(s,function(a){o>0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function AA(t){const e={};for(let r=0;r>--l&1}const h=31,m=Math.pow(2,h),g=m>>>1,w=g>>1,b=m-1;let S=0;for(let j=0;j1;){let Z=D+$>>>1;j>>1|c(),H=H<<1^g,J=(J^g)<<1|g|1;y=H,A=1+J-H}let T=n-4;return x.map(j=>{switch(j-T){case 3:return T+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return T+256+(t[a++]<<8|t[a++]);case 1:return T+t[a++];default:return j-1}})}function SA(t){let e=0;return()=>t[e++]}function kA(t){return SA(_A(t))}function NA(t){return t&1?~t>>1:t>>1}function MA(t,e){let r=Array(t);for(let n=0;ne[o]):r}function CA(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(RA(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(OA(r,t))}return AA(W1(e))}function IA(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function K1(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function RA(t,e){let r=1+e(),n=e(),i=IA(e),s=K1(i.length,1+t,e);return W1(s.map((o,a)=>{const l=o[0],u=o.slice(1);return Array(i[a]).fill(void 0).map((c,h)=>{let m=h*n;return[l+h*r,u.map(g=>g+m)]})}))}function OA(t,e){let r=1+e();return K1(r,1+t,e).map(i=>[i[0],i.slice(1)])}function TA(t){let e=su(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=su(t,e);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,c)=>c.set.size-u.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:l}}}function LA(){return kA(F1("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"))}const Wu=LA(),jA=new Set(su(Wu)),BA=new Set(su(Wu)),DA=CA(Wu),FA=TA(Wu),Hp=45,Vp=95;function Q1(t){return EA(t)}function UA(t){return t.filter(e=>e!=65039)}function J1(t){for(let e of t.split(".")){let r=Q1(e);try{for(let n=r.lastIndexOf(Vp)-1;n>=0;n--)if(r[n]!==Vp)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===Hp&&r[3]===Hp)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function zA(t){return J1($A(t,UA))}function $A(t,e){let r=Q1(t).reverse(),n=[];for(;r.length;){let i=VA(r);if(i){n.push(...e(i));continue}let s=r.pop();if(jA.has(s)){n.push(s);continue}if(BA.has(s))continue;let o=DA[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return J1(HA(String.fromCodePoint(...n)))}function HA(t){return t.normalize("NFC")}function VA(t,e){var r;let n=FA,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let l=t[--a];if(n=(r=n.branches.find(u=>u.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=l;else if(n.check&&l===s)break;o.push(l),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const qA=new O(G1),Y1=new Uint8Array(32);Y1.fill(0);function qp(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function X1(t){const e=gr(zA(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(qp(e.slice(n))),r}function _l(t){typeof t!="string"&&qA.throwArgumentError("invalid ENS name; not a string","name",t);let e=Y1;const r=X1(t);for(;r.length;)e=st(Ut([e,st(r.pop())]));return re(e)}function GA(t){return re(Ut(X1(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}var WA=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const ut=new O(G1),Z1=new Uint8Array(32);Z1.fill(0);const KA=G.from(-1),ey=G.from(0),ty=G.from(1),QA=G.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function JA(t){const e=oe(t),r=e.length%32;return r?tr([e,Z1.slice(r)]):re(e)}const YA=mt(ty.toHexString(),32),XA=mt(ey.toHexString(),32),Gp={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Qc=["name","version","chainId","verifyingContract","salt"];function Wp(t){return function(e){return typeof e!="string"&&ut.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const ZA={name:Wp("name"),version:Wp("version"),chainId:function(t){try{return G.from(t).toString()}catch{}return ut.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return gt(t).toLowerCase()}catch{}return ut.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=oe(t);if(e.length!==32)throw new Error("bad length");return re(e)}catch{}return ut.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Jc(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&ut.throwArgumentError("invalid numeric width","type",t);const i=QA.mask(r?n-1:n),s=r?i.add(ty).mul(KA):ey;return function(o){const a=G.from(o);return(a.lt(s)||a.gt(i))&&ut.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),mt(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&ut.throwArgumentError("invalid bytes width","type",t),function(n){return oe(n).length!==r&&ut.throwArgumentError(`invalid length for ${t}`,"value",n),JA(n)}}}switch(t){case"address":return function(e){return mt(gt(e),32)};case"bool":return function(e){return e?YA:XA};case"bytes":return function(e){return st(e)};case"string":return function(e){return bs(e)}}return null}function Kp(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class lr{constructor(e){z(this,"types",Object.freeze(or(e))),z(this,"_encoderCache",{}),z(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const l={};e[a].forEach(u=>{l[u.name]&&ut.throwArgumentError(`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l[u.name]=!0;const c=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1];c===a&&ut.throwArgumentError(`circular type reference to ${JSON.stringify(c)}`,"types",e),!Jc(c)&&(n[c]||ut.throwArgumentError(`unknown type ${JSON.stringify(c)}`,"types",e),n[c].push(a),r[a][c]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?ut.throwArgumentError("missing primary type","types",e):s.length>1&&ut.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),z(this,"primaryType",s[0]);function o(a,l){l[a]&&ut.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),l[a]=!0,Object.keys(r[a]).forEach(u=>{n[u]&&(o(u,l),Object.keys(l).forEach(c=>{i[c][u]=!0}))}),delete l[a]}o(this.primaryType,{});for(const a in i){const l=Object.keys(i[a]);l.sort(),this._types[a]=Kp(a,e[a])+l.map(u=>Kp(u,e[u])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Jc(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&ut.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let l=a.map(s);return this._types[i]&&(l=l.map(st)),st(tr(l))}}const n=this.types[e];if(n){const i=bs(this._types[e]);return s=>{const o=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(s[a]);return this._types[l]?st(u):u});return o.unshift(i),tr(o)}}return ut.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||ut.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return st(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Jc(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&ut.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(o,l,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{}):ut.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new lr(e)}static getPrimaryType(e){return lr.from(e).primaryType}static hashStruct(e,r,n){return lr.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=Gp[n];i||ut.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>Qc.indexOf(n.name)-Qc.indexOf(i.name)),lr.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return tr(["0x1901",lr.hashDomain(e),lr.from(r).hash(n)])}static hash(e,r,n){return st(lr.encode(e,r,n))}static resolveNames(e,r,n,i){return WA(this,void 0,void 0,function*(){e=ot(e);const s={};e.verifyingContract&&!pe(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=lr.from(r);o.visit(n,(a,l)=>(a==="address"&&!pe(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){lr.hashDomain(e);const i={},s=[];Qc.forEach(l=>{const u=e[l];u!=null&&(i[l]=ZA[l](u),s.push({name:l,type:Gp[l]}))});const o=lr.from(r),a=ot(r);return a.EIP712Domain?ut.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return re(oe(u));if(l.match(/^u?int/))return G.from(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return typeof u!="string"&&ut.throwArgumentError("invalid string","value",u),u}return ut.throwArgumentError("unsupported type","type",l)})}}}var ry={},we={},Pa=ny;function ny(t,e){if(!t)throw new Error(e||"Assertion failed")}ny.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var wh={exports:{}};typeof Object.create=="function"?wh.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:wh.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var e3=wh.exports,t3=Pa,r3=e3;we.inherits=r3;function n3(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function i3(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):n3(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}we.htonl=iy;function o3(t,e){for(var r="",n=0;n>>0}return s}we.join32=a3;function l3(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}we.split32=l3;function u3(t,e){return t>>>e|t<<32-e}we.rotr32=u3;function c3(t,e){return t<>>32-e}we.rotl32=c3;function f3(t,e){return t+e>>>0}we.sum32=f3;function h3(t,e,r){return t+e+r>>>0}we.sum32_3=h3;function d3(t,e,r,n){return t+e+r+n>>>0}we.sum32_4=d3;function p3(t,e,r,n,i){return t+e+r+n+i>>>0}we.sum32_5=p3;function m3(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}we.sum64=m3;function g3(t,e,r,n){var i=e+n>>>0,s=(i>>0}we.sum64_hi=g3;function v3(t,e,r,n){var i=e+n;return i>>>0}we.sum64_lo=v3;function y3(t,e,r,n,i,s,o,a){var l=0,u=e;u=u+n>>>0,l+=u>>0,l+=u>>0,l+=u>>0}we.sum64_4_hi=y3;function w3(t,e,r,n,i,s,o,a){var l=e+n+s+a;return l>>>0}we.sum64_4_lo=w3;function x3(t,e,r,n,i,s,o,a,l,u){var c=0,h=e;h=h+n>>>0,c+=h>>0,c+=h>>0,c+=h>>0,c+=h>>0}we.sum64_5_hi=x3;function b3(t,e,r,n,i,s,o,a,l,u){var c=e+n+s+a+u;return c>>>0}we.sum64_5_lo=b3;function E3(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}we.rotr64_hi=E3;function A3(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}we.rotr64_lo=A3;function _3(t,e,r){return t>>>r}we.shr64_hi=_3;function S3(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}we.shr64_lo=S3;var eo={},Qp=we,k3=Pa;function Ku(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}eo.BlockHash=Ku;Ku.prototype.update=function(e,r){if(e=Qp.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=Qp.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}xn.g0_256=I3;function R3(t){return hn(t,17)^hn(t,19)^t>>>10}xn.g1_256=R3;var Vs=we,O3=eo,T3=xn,Yc=Vs.rotl32,po=Vs.sum32,L3=Vs.sum32_5,j3=T3.ft_1,cy=O3.BlockHash,B3=[1518500249,1859775393,2400959708,3395469782];function vn(){if(!(this instanceof vn))return new vn;cy.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Vs.inherits(vn,cy);var D3=vn;vn.blockSize=512;vn.outSize=160;vn.hmacStrength=80;vn.padLength=64;vn.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),S_(e.length<=this.blockSize);for(var r=e.length;r{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:oe(new Uint8Array(i))}})}var C_=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Dr=new O(N_);function em(t){return new Promise(e=>{setTimeout(e,t)})}function ti(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Ld(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return Ma(t)}catch{}return re(t)}return t}function I_(t){return gr(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function R_(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;Dr.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;Dr.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let l=null;const u={method:"GET"};let c=!1,h=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&Dr.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(h=t.timeout),t.headers)for(const x in t.headers)a[x.toLowerCase()]={key:x,value:String(t.headers[x])},["if-none-match","if-modified-since"].indexOf(x.toLowerCase())>=0&&(c=!0);if(u.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&Dr.throwError("basic authentication requires a secure https url",O.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const x=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+U1(gr(x))}}t.skipFetchSetup!=null&&(u.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(u.fetchOptions=ot(t.fetchOptions))}const m=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=l?l.match(m):null;if(g)try{const x={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?F1(g[3]):I_(g[3])};let y=x.body;return r&&(y=r(x.body,x)),Promise.resolve(y)}catch(x){Dr.throwError("processing response error",O.errors.SERVER_ERROR,{body:ti(g[1],g[2]),error:x,requestBody:null,requestMethod:"GET",url:l})}e&&(u.method="POST",u.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const w={};Object.keys(a).forEach(x=>{const y=a[x];w[y.key]=y.value}),u.headers=w;const b=function(){let x=null;return{promise:new Promise(function(T,j){h&&(x=setTimeout(()=>{x!=null&&(x=null,j(Dr.makeError("timeout",O.errors.TIMEOUT,{requestBody:ti(u.body,w["content-type"]),requestMethod:u.method,timeout:h,url:l})))},h))}),cancel:function(){x!=null&&(clearTimeout(x),x=null)}}}(),S=function(){return C_(this,void 0,void 0,function*(){for(let x=0;x=300)&&(b.cancel(),Dr.throwError("bad response",O.errors.SERVER_ERROR,{status:y.statusCode,headers:y.headers,body:ti(A,y.headers?y.headers["content-type"]:null),requestBody:ti(u.body,w["content-type"]),requestMethod:u.method,url:l})),r)try{const T=yield r(A,y);return b.cancel(),T}catch(T){if(T.throttleRetry&&x{let a=null;if(s!=null)try{a=JSON.parse(Ma(s))}catch(l){Dr.throwError("invalid JSON",O.errors.SERVER_ERROR,{body:s,error:l})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=gr(e);const s=typeof t=="string"?{url:t}:ot(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=ot(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return R_(t,i,n)}function Es(t,e){return e||(e={}),e=ot(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function u(){return t().then(function(c){if(c!==void 0)o()&&r(c);else if(e.oncePoll)e.oncePoll.once("poll",u);else if(e.onceBlock)e.onceBlock.once("block",u);else if(!s){if(l++,l>a){o()&&n(new Error("retry limit reached"));return}let h=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));he.ceiling&&(h=e.ceiling),setTimeout(u,h)}return null},function(c){o()&&n(c)})}u()})}var ou="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Eh={};for(var Za=0;Za>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function by(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=Os(e)^n>>5}for(e=Os(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=by(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=Os(n)^o,i+=ou.charAt(o)}for(s=0;s<6;++s)n=Os(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=ou.charAt(a)}return i}function Ey(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=by(s);if(typeof a=="string")return a;for(var l=[],u=0;u=o.length)&&l.push(h)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:l}}function T_(){var t=Ey.apply(null,arguments);if(typeof t=="object")return t}function L_(t){var e=Ey.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function Qu(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<>8,m=c&255;h?l.push(h,m):l.push(m)}return l}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",l=0;l(m>>1)-1?b=(m>>1)-S:b=S,g.isubn(b)):b=0,h[w]=b,g.iushrn(1)}return h}r.getNAF=n;function i(l,u){var c=[[],[]];l=l.clone(),u=u.clone();for(var h=0,m=0,g;l.cmpn(-h)>0||u.cmpn(-m)>0;){var w=l.andln(3)+h&3,b=u.andln(3)+m&3;w===3&&(w=-1),b===3&&(b=-1);var S;w&1?(g=l.andln(7)+h&7,(g===3||g===5)&&b===2?S=-w:S=w):S=0,c[0].push(S);var x;b&1?(g=u.andln(7)+m&7,(g===3||g===5)&&w===2?x=-b:x=b):x=0,c[1].push(x),2*h===S+1&&(h=1-h),2*m===x+1&&(m=1-m),l.iushrn(1),u.iushrn(1)}return c}r.getJSF=i;function s(l,u,c){var h="_"+u;l.prototype[u]=function(){return this[h]!==void 0?this[h]:this[h]=c.call(this)}}r.cachedProperty=s;function o(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=o;function a(l){return new ue(l,"hex","le")}r.intFromLE=a}),au=wr.getNAF,$_=wr.getJSF,lu=wr.assert;function Mi(t,e){this.type=t,this.p=new ue(e.p,16),this.red=e.prime?ue.red(e.prime):ue.mont(this.p),this.zero=new ue(0).toRed(this.red),this.one=new ue(1).toRed(this.red),this.two=new ue(2).toRed(this.red),this.n=e.n&&new ue(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Zi=Mi;Mi.prototype.point=function(){throw new Error("Not implemented")};Mi.prototype.validate=function(){throw new Error("Not implemented")};Mi.prototype._fixedNafMul=function(e,r){lu(e.precomputed);var n=e._getDoubles(),i=au(r,1,this._bitLength),s=(1<=a;u--)l=(l<<1)+i[u];o.push(l)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),m=s;m>0;m--){for(a=0;a=0;l--){for(var u=0;l>=0&&o[l]===0;l--)u++;if(l>=0&&u++,a=a.dblp(u),l<0)break;var c=o[l];lu(c!==0),e.type==="affine"?c>0?a=a.mixedAdd(s[c-1>>1]):a=a.mixedAdd(s[-c-1>>1].neg()):c>0?a=a.add(s[c-1>>1]):a=a.add(s[-c-1>>1].neg())}return e.type==="affine"?a.toP():a};Mi.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,l=this._wnafT3,u=0,c,h,m;for(c=0;c=1;c-=2){var w=c-1,b=c;if(o[w]!==1||o[b]!==1){l[w]=au(n[w],o[w],this._bitLength),l[b]=au(n[b],o[b],this._bitLength),u=Math.max(l[w].length,u),u=Math.max(l[b].length,u);continue}var S=[r[w],null,null,r[b]];r[w].y.cmp(r[b].y)===0?(S[1]=r[w].add(r[b]),S[2]=r[w].toJ().mixedAdd(r[b].neg())):r[w].y.cmp(r[b].y.redNeg())===0?(S[1]=r[w].toJ().mixedAdd(r[b]),S[2]=r[w].add(r[b].neg())):(S[1]=r[w].toJ().mixedAdd(r[b]),S[2]=r[w].toJ().mixedAdd(r[b].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],y=$_(n[w],n[b]);for(u=Math.max(y[0].length,u),l[w]=new Array(u),l[b]=new Array(u),h=0;h=0;c--){for(var $=0;c>=0;){var H=!0;for(h=0;h=0&&$++,j=j.dblp($),c<0)break;for(h=0;h0?m=a[h][J-1>>1]:J<0&&(m=a[h][-J-1>>1].neg()),m.type==="affine"?j=j.mixedAdd(m):j=j.add(m))}}for(c=0;c=Math.ceil((e.bitLength()+1)/r.step):!1};Rr.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(g=u,w=c),h.negative&&(h=h.neg(),m=m.neg()),g.negative&&(g=g.neg(),w=w.neg()),[{a:h,b:m},{a:g,b:w}]};Or.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),l=o.mul(i.a),u=s.mul(n.b),c=o.mul(i.b),h=e.sub(a).sub(l),m=u.add(c).neg();return{k1:h,k2:m}};Or.prototype.pointFromX=function(e,r){e=new ue(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};Or.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};Or.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Mt.prototype.isInfinity=function(){return this.inf};Mt.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 r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Mt.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 r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Mt.prototype.getX=function(){return this.x.fromRed()};Mt.prototype.getY=function(){return this.y.fromRed()};Mt.prototype.mul=function(e){return e=new ue(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)};Mt.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Mt.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Mt.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)};Mt.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Mt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Lt(t,e,r,n){Zi.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ue(0)):(this.x=new ue(e,16),this.y=new ue(r,16),this.z=new ue(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Hd(Lt,Zi.BasePoint);Or.prototype.jpoint=function(e,r,n){return new Lt(this,e,r,n)};Lt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};Lt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Lt.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),u=o.redSub(a);if(l.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=l.redSqr(),h=c.redMul(l),m=i.redMul(c),g=u.redSqr().redIAdd(h).redISub(m).redISub(m),w=u.redMul(m.redISub(g)).redISub(o.redMul(h)),b=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,w,b)};Lt.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=s.redSub(o);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),h=n.redMul(u),m=l.redSqr().redIAdd(c).redISub(h).redISub(h),g=l.redMul(h.redISub(m)).redISub(s.redMul(c)),w=this.z.redMul(a);return this.curve.jpoint(m,g,w)};Lt.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};Lt.prototype.inspect=function(){return this.isInfinity()?"":""};Lt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Sl=no(function(t,e){var r=e;r.base=Zi,r.short=V_,r.mont=null,r.edwards=null}),kl=no(function(t,e){var r=e,n=wr.assert;function i(a){a.type==="short"?this.curve=new Sl.short(a):a.type==="edwards"?this.curve=new Sl.edwards(a):this.curve=new Sl.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,l){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var u=new i(l);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:u}),u}})}s("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:rn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:rn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:rn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:rn.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"]}),s("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:rn.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:rn.sha256,gRed:!1,g:["9"]}),s("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:rn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("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:rn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Ai(t){if(!(this instanceof Ai))return new Ai(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Vr.toArray(t.entropy,t.entropyEnc||"hex"),r=Vr.toArray(t.nonce,t.nonceEnc||"hex"),n=Vr.toArray(t.pers,t.persEnc||"hex");$d(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var _y=Ai;Ai.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Ai.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Vr.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var q_=wr.assert;function Ju(t,e){if(t instanceof Ju)return t;this._importDER(t,e)||(q_(t.r&&t.s,"Signature without r or s"),this.r=new ue(t.r,16),this.s=new ue(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Yu=Ju;function G_(){this.place=0}function tf(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function rm(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Ju.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=rm(r),n=rm(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];rf(i,r.length),i=i.concat(r),i.push(2),rf(i,n.length);var s=i.concat(n),o=[48];return rf(o,s.length),o=o.concat(s),wr.encode(o,e)};var W_=function(){throw new Error("unsupported")},Sy=wr.assert;function Ir(t){if(!(this instanceof Ir))return new Ir(t);typeof t=="string"&&(Sy(Object.prototype.hasOwnProperty.call(kl,t),"Unknown curve "+t),t=kl[t]),t instanceof kl.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var K_=Ir;Ir.prototype.keyPair=function(e){return new Vd(this,e)};Ir.prototype.keyFromPrivate=function(e,r){return Vd.fromPrivate(this,e,r)};Ir.prototype.keyFromPublic=function(e,r){return Vd.fromPublic(this,e,r)};Ir.prototype.genKeyPair=function(e){e||(e={});for(var r=new _y({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||W_(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ue(2));;){var s=new ue(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};Ir.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Ir.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ue(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),l=new _y({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new ue(1)),c=0;;c++){var h=i.k?i.k(c):new ue(l.generate(this.n.byteLength()));if(h=this._truncateToN(h,!0),!(h.cmpn(1)<=0||h.cmp(u)>=0)){var m=this.g.mul(h);if(!m.isInfinity()){var g=m.getX(),w=g.umod(this.n);if(w.cmpn(0)!==0){var b=h.invm(this.n).mul(w.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var S=(m.getY().isOdd()?1:0)|(g.cmp(w)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),S^=1),new Yu({r:w,s:b,recoveryParam:S})}}}}}};Ir.prototype.verify=function(e,r,n,i){e=this._truncateToN(new ue(e,16)),n=this.keyFromPublic(n,i),r=new Yu(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),l=a.mul(e).umod(this.n),u=a.mul(s).umod(this.n),c;return this.curve._maxwellTrick?(c=this.g.jmulAdd(l,n.getPublic(),u),c.isInfinity()?!1:c.eqXToP(s)):(c=this.g.mulAdd(l,n.getPublic(),u),c.isInfinity()?!1:c.getX().umod(this.n).cmp(s)===0)};Ir.prototype.recoverPubKey=function(t,e,r,n){Sy((3&r)===r,"The recovery param is more than two bits"),e=new Yu(e,n);var i=this.n,s=new ue(t),o=e.r,a=e.s,l=r&1,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var c=e.r.invm(i),h=i.sub(s).mul(c).umod(i),m=a.mul(c).umod(i);return this.g.mulAdd(h,o,m)};Ir.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Yu(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Q_=no(function(t,e){var r=e;r.version="6.5.4",r.utils=wr,r.rand=function(){throw new Error("unsupported")},r.curve=Sl,r.curves=kl,r.ec=K_,r.eddsa=null}),J_=Q_.ec;const Y_="signing-key/5.7.0",_h=new O(Y_);let nf=null;function sn(){return nf||(nf=new J_("secp256k1")),nf}class X_{constructor(e){z(this,"curve","secp256k1"),z(this,"privateKey",re(e)),Un(this.privateKey)!==32&&_h.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=sn().keyFromPrivate(oe(this.privateKey));z(this,"publicKey","0x"+r.getPublic(!1,"hex")),z(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),z(this,"_isSigningKey",!0)}_addPoint(e){const r=sn().keyFromPublic(oe(this.publicKey)),n=sn().keyFromPublic(oe(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=sn().keyFromPrivate(oe(this.privateKey)),n=oe(e);n.length!==32&&_h.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return Hu({recoveryParam:i.recoveryParam,r:mt("0x"+i.r.toString(16),32),s:mt("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=sn().keyFromPrivate(oe(this.privateKey)),n=sn().keyFromPublic(oe(ky(e)));return mt("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function Z_(t,e){const r=Hu(e),n={r:oe(r.r),s:oe(r.s)};return"0x"+sn().recoverPubKey(oe(t),n,r.recoveryParam).encode("hex",!1)}function ky(t,e){const r=oe(t);if(r.length===32){const n=new X_(r);return e?"0x"+sn().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?re(r):"0x"+sn().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+sn().keyFromPublic(r).getPublic(!0,"hex"):re(r)}return _h.throwArgumentError("invalid public or private key","key","[REDACTED]")}const eS="transactions/5.7.0",Vn=new O(eS);var nm;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(nm||(nm={}));function qd(t){return t==="0x"?null:gt(t)}function Ft(t){return t==="0x"?$1:G.from(t)}function tS(t){const e=ky(t);return gt(Rt(st(Rt(e,1)),12))}function Ny(t,e){return tS(Z_(oe(t),e))}function fr(t,e){const r=$s(G.from(t).toHexString());return r.length>32&&Vn.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function sf(t,e){return{address:gt(t),storageKeys:(e||[]).map((r,n)=>(Un(r)!==32&&Vn.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function es(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Vn.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),sf(r[0],r[1])):sf(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return sf(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function My(t){return es(t).map(e=>[e.address,e.storageKeys])}function rS(t,e){if(t.gasPrice!=null){const n=G.from(t.gasPrice),i=G.from(t.maxFeePerGas||0);n.eq(i)||Vn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[fr(t.chainId||0,"chainId"),fr(t.nonce||0,"nonce"),fr(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),fr(t.maxFeePerGas||0,"maxFeePerGas"),fr(t.gasLimit||0,"gasLimit"),t.to!=null?gt(t.to):"0x",fr(t.value||0,"value"),t.data||"0x",My(t.accessList||[])];if(e){const n=Hu(e);r.push(fr(n.recoveryParam,"recoveryParam")),r.push($s(n.r)),r.push($s(n.s))}return tr(["0x02",Vu(r)])}function nS(t,e){const r=[fr(t.chainId||0,"chainId"),fr(t.nonce||0,"nonce"),fr(t.gasPrice||0,"gasPrice"),fr(t.gasLimit||0,"gasLimit"),t.to!=null?gt(t.to):"0x",fr(t.value||0,"value"),t.data||"0x",My(t.accessList||[])];if(e){const n=Hu(e);r.push(fr(n.recoveryParam,"recoveryParam")),r.push($s(n.r)),r.push($s(n.s))}return tr(["0x01",Vu(r)])}function Py(t,e,r){try{const n=Ft(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Vn.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=mt(e[1],32),t.s=mt(e[2],32);try{const n=st(r(t));t.from=Ny(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function iS(t){const e=Bd(t.slice(1));e.length!==9&&e.length!==12&&Vn.throwArgumentError("invalid component count for transaction type: 2","payload",re(t));const r=Ft(e[2]),n=Ft(e[3]),i={type:2,chainId:Ft(e[0]).toNumber(),nonce:Ft(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ft(e[4]),to:qd(e[5]),value:Ft(e[6]),data:e[7],accessList:es(e[8])};return e.length===9||(i.hash=st(t),Py(i,e.slice(9),rS)),i}function sS(t){const e=Bd(t.slice(1));e.length!==8&&e.length!==11&&Vn.throwArgumentError("invalid component count for transaction type: 1","payload",re(t));const r={type:1,chainId:Ft(e[0]).toNumber(),nonce:Ft(e[1]).toNumber(),gasPrice:Ft(e[2]),gasLimit:Ft(e[3]),to:qd(e[4]),value:Ft(e[5]),data:e[6],accessList:es(e[7])};return e.length===8||(r.hash=st(t),Py(r,e.slice(8),nS)),r}function oS(t){const e=Bd(t);e.length!==9&&e.length!==6&&Vn.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Ft(e[0]).toNumber(),gasPrice:Ft(e[1]),gasLimit:Ft(e[2]),to:qd(e[3]),value:Ft(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=G.from(e[6]).toNumber()}catch{return r}if(r.r=mt(e[7],32),r.s=mt(e[8],32),G.from(r.r).isZero()&&G.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(re(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=st(Vu(i));try{r.from=Ny(s,{r:re(r.r),s:re(r.s),recoveryParam:n})}catch{}r.hash=st(t)}return r.type=null,r}function aS(t){const e=oe(t);if(e[0]>127)return oS(e);switch(e[0]){case 1:return sS(e);case 2:return iS(e)}return Vn.throwError(`unsupported transaction type: ${e[0]}`,O.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const go=new O(Ht);class ee{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),s=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),l=this.number.bind(this),u=this.type.bind(this),c=h=>this.data(h,!0);return e.transaction={hash:o,type:u,accessList:ee.allowNull(this.accessList.bind(this),null),blockHash:ee.allowNull(o,null),blockNumber:ee.allowNull(l,null),transactionIndex:ee.allowNull(l,null),confirmations:ee.allowNull(l,null),from:r,gasPrice:ee.allowNull(n),maxPriorityFeePerGas:ee.allowNull(n),maxFeePerGas:ee.allowNull(n),gasLimit:n,to:ee.allowNull(r,null),value:n,nonce:l,data:s,r:ee.allowNull(this.uint256),s:ee.allowNull(this.uint256),v:ee.allowNull(l),creates:ee.allowNull(r,null),raw:ee.allowNull(s)},e.transactionRequest={from:ee.allowNull(r),nonce:ee.allowNull(l),gasLimit:ee.allowNull(n),gasPrice:ee.allowNull(n),maxPriorityFeePerGas:ee.allowNull(n),maxFeePerGas:ee.allowNull(n),to:ee.allowNull(r),value:ee.allowNull(n),data:ee.allowNull(c),type:ee.allowNull(l),accessList:ee.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:r,topics:ee.arrayOf(o),data:s,logIndex:l,blockHash:o},e.receipt={to:ee.allowNull(this.address,null),from:ee.allowNull(this.address,null),contractAddress:ee.allowNull(r,null),transactionIndex:l,root:ee.allowNull(a),gasUsed:n,logsBloom:ee.allowNull(s),blockHash:o,transactionHash:o,logs:ee.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:ee.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:ee.allowNull(n),status:ee.allowNull(l),type:u},e.block={hash:ee.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:ee.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:ee.allowNull(r),extraData:s,transactions:ee.allowNull(ee.arrayOf(o)),baseFeePerGas:ee.allowNull(n)},e.blockWithTransactions=ot(e.block),e.blockWithTransactions.transactions=ee.allowNull(ee.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:ee.allowNull(i,void 0),toBlock:ee.allowNull(i,void 0),blockHash:ee.allowNull(o,void 0),address:ee.allowNull(r,void 0),topics:ee.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:ee.allowNull(l),blockHash:ee.allowNull(o),transactionIndex:l,removed:ee.allowNull(this.boolean.bind(this)),address:r,data:ee.allowFalsish(s,"0x"),topics:ee.arrayOf(o),transactionHash:o,logIndex:l},e}accessList(e){return es(e||[])}number(e){return e==="0x"?0:G.from(e).toNumber()}type(e){return e==="0x"||e==null?0:G.from(e).toNumber()}bigNumber(e){return G.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),pe(e))?e.toLowerCase():go.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return gt(e)}callAddress(e){if(!pe(e,32))return null;const r=gt(Rt(e,12));return r===hA?null:r}contractAddress(e){return Fd(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||pe(e))return $u(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Un(n)!==32?go.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=G.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!pe(e))throw new Error("invalid uint256");return mt(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=ee.check(r,e);return i._difficulty=n==null?null:G.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return ee.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&G.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=ee.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;pe(n)&&(n=G.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),pe(n)&&(n=G.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return aS(e)}receiptLog(e){return ee.check(this.formats.receiptLog,e)}receipt(e){const r=ee.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=G.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&go.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):go.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&go.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return ee.check(this.formats.filter,e)}filterLog(e){return ee.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function Cy(t){return t&&typeof t.isCommunityResource=="function"}function Sh(t){return Cy(t)&&t.isCommunityResource()}let im=!1;function Ia(){im||(im=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var le=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const de=new O(Ht),lS=10;function sm(t){return t==null?"null":(Un(t)!==32&&de.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function om(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[sm(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return sm(e)}).join("&")}function uS(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function rs(t){if(typeof t=="string"){if(t=t.toLowerCase(),Un(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+om(t);if(uA.isForkEvent(t))throw de.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+om(t.topics||[])}throw new Error("invalid event - "+t)}function vo(){return new Date().getTime()}function am(t){return new Promise(e=>{setTimeout(e,t)})}const cS=["block","network","pending","poll"];class fS{constructor(e,r,n){z(this,"tag",e),z(this,"listener",r),z(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=uS(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||cS.indexOf(this.tag)>=0}}const hS={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function of(t){return mt(G.from(t).toHexString(),32)}function lm(t){return yh.encode(Ut([t,Rt(Zp(Zp(t)),0,4)]))}const Iy=new RegExp("^(ipfs)://(.*)$","i"),um=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Iy,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Nl(t,e){try{return Ma(fa(t,e))}catch{}return null}function fa(t,e){if(t==="0x")return null;const r=G.from(Rt(t,e,e+32)).toNumber(),n=G.from(Rt(t,r,r+32)).toNumber();return Rt(t,r+32,r+32+n)}function af(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):de.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function cm(t){const e=oe(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function dS(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function Ry(t){const e=[];let r=0;for(let n=0;nG.from(e).eq(1)).catch(e=>{if(e.code===O.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return le(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:tr([e,_l(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=tr(["0x9061b923",Ry([GA(this.name),n.data])]));try{let s=yield this.provider.call(n);return oe(s).length%32===4&&de.throwError("resolver threw error",O.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=fa(s,0)),s}catch(s){if(s.code===O.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return le(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?fa(n,0):null})}_getAddress(e,r){const n=hS[String(e)];if(n==null&&de.throwError(`unsupported coin type: ${e}`,O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=oe(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return lm(Ut([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return lm(Ut([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=tm.toWords(i.slice(2));return a.unshift(o),tm.encode(n.prefix,a)}}return null}getAddress(e){return le(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===gA?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===O.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",of(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&de.throwError("invalid or unsupported coin data",O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return le(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[l])}return de.throwError("invalid or unsupported content hash data",O.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return le(this,void 0,void 0,function*(){let r=gr(e);r=Ut([of(64),of(r.length),r]),r.length%32!==0&&(r=Ut([r,mt("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",re(r));return n==null||n==="0x"?null:Ma(n)})}}let lf=null,pS=1;class Xu extends Zs{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),z(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=dr(new.target,"getNetwork")(e);r?(z(this,"_network",r),this.emit("network",r,null)):de.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return le(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||de.throwError("no network detected",O.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:z(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Es(()=>this._ready().then(e=>e,e=>{if(!(e.code===O.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return lf==null&&(lf=new ee),lf}static getNetwork(e){return zd(e??"homestead")}ccipReadFetch(e,r,n){return le(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),h=yield Ca({url:u,errorPassThrough:!0},c,(g,w)=>(g.status=w.statusCode,g));if(h.data)return h.data;const m=h.message||"unknown error";if(h.status>=400&&h.status<500)return de.throwError(`response not found during CCIP fetch: ${m}`,O.errors.SERVER_ERROR,{url:l,errorMessage:m});o.push(m)}return de.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,O.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return le(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(vo()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=vo(),n=wt({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=vo();return i=G.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return le(this,void 0,void 0,function*(){const e=pS++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)de.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",de.makeError("network block skew detected",O.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(u=>{u.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=u.blockNumber),this._emitted["b:"+u.blockHash]=u.blockNumber,this._emitted["t:"+u.transactionHash]=u.blockNumber,this.emit(s,u)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return le(this,void 0,void 0,function*(){return de.throwError("provider does not support network detection",O.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return le(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield am(0),this._network;const n=de.makeError("underlying network changed",O.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=vo();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&ðis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return le(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return le(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const l=[];let u=!1;const c=function(){return u?!0:(u=!0,l.forEach(m=>{m()}),!1)},h=m=>{m.confirmations{this.removeListener(e,h)}),i){let m=i.startBlock,g=null;const w=b=>le(this,void 0,void 0,function*(){u||(yield am(1e3),this.getTransactionCount(i.from).then(S=>le(this,void 0,void 0,function*(){if(!u){if(S<=i.nonce)m=b;else{{const x=yield this.getTransaction(e);if(x&&x.blockNumber!=null)return}for(g==null&&(g=m-3,g{u||this.once("block",w)}))});if(u)return;this.once("block",w),l.push(()=>{this.removeListener("block",w)})}if(typeof n=="number"&&n>0){const m=setTimeout(()=>{c()||a(de.makeError("timeout exceeded",O.errors.TIMEOUT,{timeout:n}))},n);m.unref&&m.unref(),l.push(()=>{clearTimeout(m)})}})})}getBlockNumber(){return le(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return le(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return G.from(e)}catch(r){return de.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return le(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return G.from(i)}catch(s){return de.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return le(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return G.from(i).toNumber()}catch(s){return de.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return le(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return re(i)}catch(s){return de.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return le(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>$u(o))}),s=yield this.perform("getStorageAt",i);try{return re(s)}catch(o){return de.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&Un(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&de.throwError("Transaction hash mismatch from Provider.sendTransaction.",O.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>le(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,s,o,a);return l==null&&s===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&de.throwError("transaction failed",O.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return le(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>re(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return le(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?G.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?re(s):null))}),this.formatter.transactionRequest(yield wt(n))})}_getFilter(e){return le(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield wt(r))})}_call(e,r,n){return le(this,void 0,void 0,function*(){n>=lS&&de.throwError("CCIP read exceeded maximum redirections",O.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&Un(s)%32===4)try{const o=Rt(s,4),a=Rt(o,0,32);G.from(a).eq(i)||de.throwError("CCIP Read sender did not match",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const l=[],u=G.from(Rt(o,32,64)).toNumber(),c=G.from(Rt(o,u,u+32)).toNumber(),h=Rt(o,u+32);for(let x=0;xle(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let l=0;lthis._wrapTransaction(l)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return le(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Es(()=>le(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return le(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Es(()=>le(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return le(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield wt({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),ee.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return le(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return le(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&de.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return le(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new kh(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return le(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||de.throwError("network does not support ENS",O.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+_l(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return le(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(pe(e))throw n}typeof e!="string"&&de.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return le(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=Nl(yield this.call({to:n,data:"0x691f3431"+_l(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return le(this,void 0,void 0,function*(){let r=null;if(pe(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new kh(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==O.errors.CALL_EXCEPTION)throw a}try{const a=Nl(yield this.call({to:o,data:"0x691f3431"+_l(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==O.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return de.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new fS(rs(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=rs(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=rs(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=rs(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=rs(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=rs(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}const mS="abstract-signer/5.7.0";var Br=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Ar=new O(mS),gS=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],vS=[O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED];class Ra{constructor(){Ar.checkAbstract(new.target,Ra),z(this,"_isSigner",!0)}getBalance(e){return Br(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Br(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Br(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield wt(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Br(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield wt(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Br(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Br(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Br(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Br(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Br(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)gS.indexOf(n)===-1&&Ar.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=ot(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Ar.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Br(this,void 0,void 0,function*(){const r=yield wt(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Br(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Ar.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Ar.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Ar.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Ar.throwError("network does not support EIP-1559",O.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Ar.throwError("failed to get consistent fee data",O.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(vS.indexOf(i.code)>=0)throw i;return Ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Ar.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield wt(r)})}_checkProvider(e){this.provider||Ar.throwError("missing provider",O.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class Gd extends Ra{constructor(e,r){super(),z(this,"address",e),z(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Ar.throwError(e,O.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Gd(this.address,e)}}var kn=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const xt=new O(Ht),yS=["call","estimateGas"];function Bo(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=pe(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=Bo(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Bo(JSON.parse(t),e)}catch{}return null}function Oy(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=Bo(e,!0);if(s)return s.data;xt.throwError("missing revert data in call exception; Transaction reverted without a reason string",O.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=Bo(e.body,!1);s==null&&(s=Bo(e,!1)),s&&xt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===O.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&xt.throwError("insufficient funds for intrinsic transaction cost",O.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&xt.throwError("nonce has already been used",O.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&xt.throwError("replacement fee too low",O.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&xt.throwError("legacy pre-eip-155 transactions not supported",O.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),yS.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&xt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function fm(t){return new Promise(function(e){setTimeout(e,t)})}function wS(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function yo(t){return t&&t.toLowerCase()}const Nh={};class Wd extends Ra{constructor(e,r,n){if(super(),e!==Nh)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");z(this,"provider",r),n==null&&(n=0),typeof n=="string"?(z(this,"_address",this.provider.formatter.address(n)),z(this,"_index",null)):typeof n=="number"?(z(this,"_index",n),z(this,"_address",null)):xt.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return xt.throwError("cannot alter JSON-RPC Signer connection",O.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new xS(Nh,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&xt.throwError("unknown account #"+this._index,O.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=ot(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=ot(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>kn(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&xt.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),wt({tx:wt(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&xt.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&xt.throwError("user rejected transaction",O.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),Oy("sendTransaction",o,s)))})}signTransaction(e){return xt.throwError("signing transactions is unsupported",O.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return kn(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield Es(()=>kn(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return kn(this,void 0,void 0,function*(){const r=typeof e=="string"?gr(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[re(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&xt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return kn(this,void 0,void 0,function*(){const r=typeof e=="string"?gr(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),re(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&xt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return kn(this,void 0,void 0,function*(){const i=yield lr.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(lr.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&xt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return kn(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class xS extends Wd{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const bS={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Wi extends Xu{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=dr(this.constructor,"defaultUrl")()),typeof e=="string"?z(this,"connection",Object.freeze({url:e})):z(this,"connection",Object.freeze(ot(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return kn(this,void 0,void 0,function*(){yield fm(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=dr(this.constructor,"getNetwork");try{return r(G.from(e).toNumber())}catch(n){return xt.throwError("could not detect network",O.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return xt.throwError("could not detect network",O.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new Wd(Nh,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:or(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=Ca(this.connection,JSON.stringify(n),wS).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[yo(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[yo(r.address),r.blockTag]];case"getCode":return["eth_getCode",[yo(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[yo(r.address),mt(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[dr(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[dr(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=yo(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return kn(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&G.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=ot(r),r.transaction=ot(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&xt.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return Oy(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),o.then(function(){return fm(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=ot(bS);if(r)for(const s in r)r[s]&&(n[s]=!0);nA(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=$u(G.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=re(e[s]))}),e.accessList&&(i.accessList=es(e.accessList)),i}}let Do=null;try{if(Do=WebSocket,Do==null)throw new Error("inject please")}catch{const e=new O(Ht);Do=function(){e.throwError("WebSockets not supported in this environment",O.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var uf=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const el=new O(Ht);let ES=1;class Zu extends Wi{constructor(e,r){r==="any"&&el.throwError("WebSocketProvider does not support 'any' network yet",O.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),typeof e=="string"?super(e,r):super("_websocket",r),this._pollingInterval=-1,this._wsReady=!1,typeof e=="string"?z(this,"_websocket",new Do(this.connection.url)):z(this,"_websocket",e),z(this,"_requests",{}),z(this,"_subs",{}),z(this,"_subIds",{}),z(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(i=>{this.websocket.send(this._requests[i].payload)})},this.websocket.onmessage=i=>{const s=i.data,o=JSON.parse(s);if(o.id!=null){const a=String(o.id),l=this._requests[a];if(delete this._requests[a],o.result!==void 0)l.callback(null,o.result),this.emit("debug",{action:"response",request:JSON.parse(l.payload),response:o.result,provider:this});else{let u=null;o.error?(u=new Error(o.error.message||"unknown error"),z(u,"code",o.error.code||null),z(u,"response",s)):u=new Error("unknown error"),l.callback(u,void 0),this.emit("debug",{action:"response",error:u,request:JSON.parse(l.payload),provider:this})}}else if(o.method==="eth_subscription"){const a=this._subs[o.params.subscription];a&&a.processFunc(o.params.result)}else console.warn("this should not happen")};const n=setInterval(()=>{this.emit("poll")},1e3);n.unref&&n.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){el.throwError("cannot reset events block on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){el.throwError("cannot set polling interval on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return uf(this,void 0,void 0,function*(){return null})}set polling(e){e&&el.throwError("cannot set polling on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,r){const n=ES++;return new Promise((i,s)=>{function o(l,u){return l?s(l):i(u)}const a=JSON.stringify({method:e,params:r,id:n,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(a),provider:this}),this._requests[String(n)]={callback:o,payload:a},this._wsReady&&this.websocket.send(a)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,r,n){return uf(this,void 0,void 0,function*(){let i=this._subIds[e];i==null&&(i=Promise.all(r).then(o=>this.send("eth_subscribe",o)),this._subIds[e]=i);const s=yield i;this._subs[s]={tag:e,processFunc:n}})}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],r=>{const n=G.from(r.number).toNumber();this._emitted.block=n,this.emit("block",n)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],r=>{this.emit("pending",r)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],r=>{r.removed==null&&(r.removed=!1),this.emit(e.filter,this.formatter.filterLog(r))});break;case"tx":{const r=n=>{const i=n.hash;this.getTransactionReceipt(i).then(s=>{s&&this.emit(i,s)})};r(e),this._subscribe("tx",["newHeads"],n=>{this._events.filter(i=>i.type==="tx").forEach(r)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e);break}}_stopEvent(e){let r=e.tag;if(e.type==="tx"){if(this._events.filter(i=>i.type==="tx").length)return;r="tx"}else if(this.listenerCount(e.event))return;const n=this._subIds[r];n&&(delete this._subIds[r],n.then(i=>{this._subs[i]&&(delete this._subs[i],this.send("eth_unsubscribe",[i]))}))}destroy(){return uf(this,void 0,void 0,function*(){this.websocket.readyState===Do.CONNECTING&&(yield new Promise(e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}})),this.websocket.close(1e3)})}}var AS=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const So=new O(Ht);class Ty extends Wi{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return AS(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||So.throwError("no network detected",O.errors.UNKNOWN_ERROR,{}),this._network==null&&(z(this,"_network",r),this.emit("network",r,null))),r})}}class qn extends Ty{constructor(e,r){So.checkAbstract(new.target,qn),e=dr(new.target,"getNetwork")(e),r=dr(new.target,"getApiKey")(r);const n=dr(new.target,"getUrl")(e,r);super(n,e),typeof r=="string"?z(this,"apiKey",r):r!=null&&Object.keys(r).forEach(i=>{z(this,i,r[i])})}_startPending(){So.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return So.throwError("API provider does not support signing",O.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,r){return So.throwError("not implemented; sub-classes must override getUrl",O.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const hm=new O(Ht),Ml="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class Ly extends Zu{constructor(e,r){const n=new Kd(e,r),i=n.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(i,n.network),z(this,"apiKey",n.apiKey)}isCommunityResource(){return this.apiKey===Ml}}class Kd extends qn{static getWebSocketProvider(e,r){return new Ly(e,r)}static getApiKey(e){return e==null?Ml:(e&&typeof e!="string"&&hm.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,r){let n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.g.alchemy.com/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":n="arb-goerli.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":n="opt-goerli.g.alchemy.com/v2/";break;default:hm.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+r,throttleCallback:(i,s)=>(r===Ml&&Ia(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===Ml}}const _S=new O(Ht),tl="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function SS(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return _S.throwArgumentError("unsupported network","name",t)}class jy extends qn{isCommunityResource(){return this.apiKey===tl}static getApiKey(e){return e??tl}static getUrl(e,r){r==null&&(r=tl);const n={allowGzip:!0,url:"https://"+SS(e.name)+r,throttleCallback:(i,s)=>(r.apiKey===tl&&Ia(),Promise.resolve(!0))};return r.projectSecret!=null&&(n.user="",n.password=r.projectSecret),n}}var kS=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const dm=new O(Ht);class By extends qn{static getApiKey(e){return e!=null&&dm.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,r){let n=null;switch(e.name){case"homestead":n="https://cloudflare-eth.com/";break;default:dm.throwArgumentError("unsupported network","network",arguments[0])}return n}perform(e,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return kS(this,void 0,void 0,function*(){return e==="getBlockNumber"?(yield n.perform.call(this,"getBlock",{blockTag:"latest"})).number:n.perform.call(this,e,r)})}}var rl=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const oi=new O(Ht);function pm(t){const e={};for(let r in t){if(t[r]==null)continue;let n=t[r];r==="type"&&n===0||({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?n=$u(re(n)):r==="accessList"?n="["+es(n).map(i=>`{address:"${i.address}",storageKeys:["${i.storageKeys.join('","')}"]}`).join(",")+"]":n=re(n),e[r]=n)}return e}function NS(t){if(t.status==0&&(t.message==="No records found"||t.message==="No transactions found"))return t.result;if(t.status!=1||typeof t.message!="string"||!t.message.match(/^OK/)){const e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function mm(t){if(t&&t.status==0&&t.message=="NOTOK"&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){const e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if(t.jsonrpc!="2.0"){const e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){const e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function gm(t){if(t==="pending")throw new Error("pending not supported");return t==="latest"?t:parseInt(t.substring(2),16)}function cf(t,e,r){if(t==="call"&&e.code===O.errors.SERVER_ERROR){const i=e.error;if(i&&(i.message.match(/reverted/i)||i.message.match(/VM execution error/i))){let s=i.data;if(s&&(s="0x"+s.replace(/^.*0x/i,"")),pe(s))return s;oi.throwError("missing revert data in call exception",O.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let n=e.message;throw e.code===O.errors.SERVER_ERROR&&(e.error&&typeof e.error.message=="string"?n=e.error.message:typeof e.body=="string"?n=e.body:typeof e.responseText=="string"&&(n=e.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&oi.throwError("insufficient funds for intrinsic transaction cost",O.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&oi.throwError("nonce has already been used",O.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),n.match(/another transaction with same nonce/)&&oi.throwError("replacement fee too low",O.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&oi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class Dy extends Xu{constructor(e,r){super(e),z(this,"baseUrl",this.getBaseUrl()),z(this,"apiKey",r||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return oi.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,r){const n=Object.keys(r).reduce((s,o)=>{const a=r[o];return a!=null&&(s+=`&${o}=${a}`),s},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${n}${i}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,r){return r.module=e,r.apikey=this.apiKey,r}fetch(e,r,n){return rl(this,void 0,void 0,function*(){const i=n?this.getPostUrl():this.getUrl(e,r),s=n?this.getPostData(e,r):null,o=e==="proxy"?mm:NS;this.emit("debug",{action:"request",request:i,provider:this});const a={url:i,throttleSlotInterval:1e3,throttleCallback:(c,h)=>(this.isCommunityResource()&&Ia(),Promise.resolve(!0))};let l=null;s&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},l=Object.keys(s).map(c=>`${c}=${s[c]}`).join("&"));const u=yield Ca(a,l,o||mm);return this.emit("debug",{action:"response",request:i,response:or(u),provider:this}),u})}detectNetwork(){return rl(this,void 0,void 0,function*(){return this.network})}perform(e,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return rl(this,void 0,void 0,function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:r.address,tag:r.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:r.address,tag:r.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:r.address,tag:r.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:r.address,position:r.position,tag:r.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:r.signedTransaction},!0).catch(i=>cf("sendTransaction",i,r.signedTransaction));case"getBlock":if(r.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:r.blockTag,boolean:r.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:r.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:r.transactionHash});case"call":{if(r.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const i=pm(r.transaction);i.module="proxy",i.action="eth_call";try{return yield this.fetch("proxy",i,!0)}catch(s){return cf("call",s,r.transaction)}}case"estimateGas":{const i=pm(r.transaction);i.module="proxy",i.action="eth_estimateGas";try{return yield this.fetch("proxy",i,!0)}catch(s){return cf("estimateGas",s,r.transaction)}}case"getLogs":{const i={action:"getLogs"};if(r.filter.fromBlock&&(i.fromBlock=gm(r.filter.fromBlock)),r.filter.toBlock&&(i.toBlock=gm(r.filter.toBlock)),r.filter.address&&(i.address=r.filter.address),r.filter.topics&&r.filter.topics.length>0&&(r.filter.topics.length>1&&oi.throwError("unsupported topic count",O.errors.UNSUPPORTED_OPERATION,{topics:r.filter.topics}),r.filter.topics.length===1)){const a=r.filter.topics[0];(typeof a!="string"||a.length!==66)&&oi.throwError("unsupported topic format",O.errors.UNSUPPORTED_OPERATION,{topic0:a}),i.topic0=a}const s=yield this.fetch("logs",i);let o={};for(let a=0;a{["contractAddress","to"].forEach(function(l){o[l]==""&&delete o[l]}),o.creates==null&&o.contractAddress!=null&&(o.creates=o.contractAddress);const a=this.formatter.transactionResponse(o);return o.timeStamp&&(a.timestamp=parseInt(o.timeStamp)),a})})}isCommunityResource(){return this.apiKey==null}}function MS(t){t=t.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}var uu=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Ri=new O(Ht);function nl(){return new Date().getTime()}function vm(t){let e=null;for(let r=0;re?null:(n+i)/2}function As(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(G.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>As(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=As(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let PS=1;function wm(t){let e=null,r=null,n=new Promise(o=>{e=function(){r&&(clearTimeout(r),r=null),o()},r=setTimeout(e,t)});const i=o=>(n=n.then(o),n);function s(){return n}return{cancel:e,getPromise:s,wait:i}}const CS=[O.errors.CALL_EXCEPTION,O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED,O.errors.UNPREDICTABLE_GAS_LIMIT],IS=["address","args","errorArgs","errorSignature","method","transaction"];function il(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function RS(t,e){return function(r){const n={};r.forEach(s=>{const o=t(s.result);n[o]||(n[o]={count:0,result:s.result}),n[o].count++});const i=Object.keys(n);for(let s=0;s=e)return o.result}}}function OS(t,e,r){let n=As;switch(e){case"getBlockNumber":return function(i){const s=i.map(a=>a.result);let o=ym(i.map(a=>a.result),2);if(o!=null)return o=Math.ceil(o),s.indexOf(o+1)>=0&&o++,o>=t._highestBlockNumber&&(t._highestBlockNumber=o),t._highestBlockNumber};case"getGasPrice":return function(i){const s=i.map(o=>o.result);return s.sort(),s[Math.floor(s.length/2)]};case"getEtherPrice":return function(i){return ym(i.map(s=>s.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=ot(i),i.confirmations=-1,As(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=ot(i),i.transactions=i.transactions.map(s=>(s=ot(s),s.confirmations=-1,s)),As(i))}:n=function(i){return i==null?null:As(i)};break;default:throw new Error("unknown method: "+e)}return RS(n,t.quorum)}function wo(t,e){return uu(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:Es(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function TS(t,e,r,n){return uu(this,void 0,void 0,function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&pe(n.blockTag)&&(i=yield wo(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&pe(n.blockTag)&&(i=yield wo(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&pe(n.blockTag)&&(i=yield wo(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&pe(n.blockTag)&&(i=yield wo(t,e)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&pe(s.fromBlock)||s.toBlock&&pe(s.toBlock))&&(i=yield wo(t,e)),i.getLogs(s)}}return Ri.throwError("unknown method error",O.errors.UNKNOWN_ERROR,{method:r,params:n})})}class Fy extends Xu{constructor(e,r){e.length===0&&Ri.throwArgumentError("missing providers","providers",e);const n=e.map((o,a)=>{if(Zs.isProvider(o)){const c=Sh(o)?2e3:750;return Object.freeze({provider:o,weight:1,stallTimeout:c,priority:1})}const l=ot(o);l.priority==null&&(l.priority=1),l.stallTimeout==null&&(l.stallTimeout=Sh(o)?2e3:750),l.weight==null&&(l.weight=1);const u=l.weight;return(u%1||u>512||u<1)&&Ri.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,u),Object.freeze(l)}),i=n.reduce((o,a)=>o+a.weight,0);r==null?r=i/2:r>i&&Ri.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let s=vm(n.map(o=>o.provider.network));s==null&&(s=new Promise((o,a)=>{setTimeout(()=>{this.detectNetwork().then(o,a)},0)})),super(s),z(this,"providerConfigs",Object.freeze(n)),z(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return uu(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return vm(e)})}perform(e,r){return uu(this,void 0,void 0,function*(){if(e==="sendTransaction"){const l=yield Promise.all(this.providerConfigs.map(u=>u.provider.sendTransaction(r.signedTransaction).then(c=>c.hash,c=>c)));for(let u=0;ul.priority-u.priority);const s=this._highestBlockNumber;let o=0,a=!0;for(;;){const l=nl();let u=i.filter(g=>g.runner&&l-g.start