*/(function(e,t){var n=Me,o=n.Buffer;function l(_,v){for(var u in _)v[u]=_[u]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(l(n,t),t.Buffer=d);function d(_,v,u){return o(_,v,u)}d.prototype=Object.create(o.prototype),l(o,d),d.from=function(_,v,u){if(typeof _=="number")throw new TypeError("Argument must not be a number");return o(_,v,u)},d.alloc=function(_,v,u){if(typeof _!="number")throw new TypeError("Argument must be a number");var w=o(_);return v!==void 0?typeof u=="string"?w.fill(v,u):w.fill(v):w.fill(0),w},d.allocUnsafe=function(_){if(typeof _!="number")throw new TypeError("Argument must be a number");return o(_)},d.allocUnsafeSlow=function(_){if(typeof _!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(_)}})(Ht,Ht.exports);var fe=Ht.exports,Yt;function Xt(){if(Yt)return kt;Yt=1;var e=fe.Buffer,t=e.isEncoding||function(a){switch(a=""+a,a&&a.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(a){if(!a)return"utf8";for(var h;;)switch(a){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return a;default:if(h)return;a=(""+a).toLowerCase(),h=!0}}function o(a){var h=n(a);if(typeof h!="string"&&(e.isEncoding===t||!t(a)))throw new Error("Unknown encoding: "+a);return h||a}kt.StringDecoder=l;function l(a){this.encoding=o(a);var h;switch(this.encoding){case"utf16le":this.text=C,this.end=R,h=4;break;case"utf8":this.fillLast=u,h=4;break;case"base64":this.text=T,this.end=S,h=3;break;default:this.write=m,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(h)}l.prototype.write=function(a){if(a.length===0)return"";var h,p;if(this.lastNeed){if(h=this.fillLast(a),h===void 0)return"";p=this.lastNeed,this.lastNeed=0}else p=0;return p>5===6?2:a>>4===14?3:a>>3===30?4:a>>6===2?-1:-2}function _(a,h,p){var g=h.length-1;if(g=0?(x>0&&(a.lastNeed=x-1),x):--g
=0?(x>0&&(a.lastNeed=x-2),x):--g
=0?(x>0&&(x===2?x=0:a.lastNeed=x-3),x):0))}function v(a,h,p){if((h[0]&192)!==128)return a.lastNeed=0,"�";if(a.lastNeed>1&&h.length>1){if((h[1]&192)!==128)return a.lastNeed=1,"�";if(a.lastNeed>2&&h.length>2&&(h[2]&192)!==128)return a.lastNeed=2,"�"}}function u(a){var h=this.lastTotal-this.lastNeed,p=v(this,a);if(p!==void 0)return p;if(this.lastNeed<=a.length)return a.copy(this.lastChar,h,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,h,0,a.length),this.lastNeed-=a.length}function w(a,h){var p=_(this,a,h);if(!this.lastNeed)return a.toString("utf8",h);this.lastTotal=p;var g=a.length-(p-this.lastNeed);return a.copy(this.lastChar,0,g),a.toString("utf8",h,g)}function A(a){var h=a&&a.length?this.write(a):"";return this.lastNeed?h+"�":h}function C(a,h){if((a.length-h)%2===0){var p=a.toString("utf16le",h);if(p){var g=p.charCodeAt(p.length-1);if(g>=55296&&g<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],p.slice(0,-1)}return p}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",h,a.length-1)}function R(a){var h=a&&a.length?this.write(a):"";if(this.lastNeed){var p=this.lastTotal-this.lastNeed;return h+this.lastChar.toString("utf16le",0,p)}return h}function T(a,h){var p=(a.length-h)%3;return p===0?a.toString("base64",h):(this.lastNeed=3-p,this.lastTotal=3,p===1?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",h,a.length-p))}function S(a){var h=a&&a.length?this.write(a):"";return this.lastNeed?h+this.lastChar.toString("base64",0,3-this.lastNeed):h}function m(a){return a.toString(this.encoding)}function y(a){return a&&a.length?this.write(a):""}return kt}var Jt=he.codes.ERR_STREAM_PREMATURE_CLOSE;function Xr(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,o=new Array(n),l=0;l0)if(typeof i!="string"&&!L.objectMode&&Object.getPrototypeOf(i)!==o.prototype&&(i=d(i)),E)L.endEmitted?x(r,new a):V(r,L,i,!0);else if(L.ended)x(r,new m);else{if(L.destroyed)return!1;L.reading=!1,L.decoder&&!c?(i=L.decoder.write(i),L.objectMode||i.length!==0?V(r,L,i,!1):z(r,L)):V(r,L,i,!1)}else E||(L.reading=!1,z(r,L))}return!L.ended&&(L.length=F?r=F:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r}function H(r,i){return r<=0||i.length===0&&i.ended?0:i.objectMode?1:r!==r?i.flowing&&i.length?i.buffer.head.data.length:i.length:(r>i.highWaterMark&&(i.highWaterMark=U(r)),r<=i.length?r:i.ended?i.length:(i.needReadable=!0,0))}M.prototype.read=function(r){u("read",r),r=parseInt(r,10);var i=this._readableState,c=r;if(r!==0&&(i.emittedReadable=!1),r===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended))return u("read: emitReadable",i.length,i.ended),i.length===0&&i.ended?b(this):W(this),null;if(r=H(r,i),r===0&&i.ended)return i.length===0&&b(this),null;var E=i.needReadable;u("need readable",E),(i.length===0||i.length-r0?P=s(r,i):P=null,P===null?(i.needReadable=i.length<=i.highWaterMark,r=0):(i.length-=r,i.awaitDrain=0),i.length===0&&(i.ended||(i.needReadable=!0),c!==r&&i.ended&&b(this)),P!==null&&this.emit("data",P),P};function ne(r,i){if(u("onEofChunk"),!i.ended){if(i.decoder){var c=i.decoder.end();c&&c.length&&(i.buffer.push(c),i.length+=i.objectMode?1:c.length)}i.ended=!0,i.sync?W(r):(i.needReadable=!1,i.emittedReadable||(i.emittedReadable=!0,J(r)))}}function W(r){var i=r._readableState;u("emitReadable",i.needReadable,i.emittedReadable),i.needReadable=!1,i.emittedReadable||(u("emitReadable",i.flowing),i.emittedReadable=!0,process.nextTick(J,r))}function J(r){var i=r._readableState;u("emitReadable_",i.destroyed,i.length,i.ended),!i.destroyed&&(i.length||i.ended)&&(r.emit("readable"),i.emittedReadable=!1),i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark,f(r)}function z(r,i){i.readingMore||(i.readingMore=!0,process.nextTick(Q,r,i))}function Q(r,i){for(;!i.reading&&!i.ended&&(i.length1&&k(E.pipes,r)!==-1)&&!ye&&(u("false write response, pause",E.awaitDrain),E.awaitDrain++),c.pause())}function ce(re){u("onerror",re),se(),r.removeListener("error",ce),t(r,"error")===0&&x(r,re)}I(r,"error",ce);function de(){r.removeListener("finish",_e),se()}r.once("close",de);function _e(){u("onfinish"),r.removeListener("close",de),se()}r.once("finish",_e);function se(){u("unpipe"),c.unpipe(r)}return r.emit("pipe",c),E.flowing||(u("pipe resume"),c.resume()),r};function ae(r){return function(){var c=r._readableState;u("pipeOnDrain",c.awaitDrain),c.awaitDrain&&c.awaitDrain--,c.awaitDrain===0&&t(r,"data")&&(c.flowing=!0,f(r))}}M.prototype.unpipe=function(r){var i=this._readableState,c={hasUnpiped:!1};if(i.pipesCount===0)return this;if(i.pipesCount===1)return r&&r!==i.pipes?this:(r||(r=i.pipes),i.pipes=null,i.pipesCount=0,i.flowing=!1,r&&r.emit("unpipe",this,c),this);if(!r){var E=i.pipes,P=i.pipesCount;i.pipes=null,i.pipesCount=0,i.flowing=!1;for(var L=0;L0,E.flowing!==!1&&this.resume()):r==="readable"&&!E.endEmitted&&!E.readableListening&&(E.readableListening=E.needReadable=!0,E.flowing=!1,E.emittedReadable=!1,u("on readable",E.length,E.reading),E.length?W(this):E.reading||process.nextTick($,this)),c},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(r,i){var c=n.prototype.removeListener.call(this,r,i);return r==="readable"&&process.nextTick(Z,this),c},M.prototype.removeAllListeners=function(r){var i=n.prototype.removeAllListeners.apply(this,arguments);return(r==="readable"||r===void 0)&&process.nextTick(Z,this),i};function Z(r){var i=r._readableState;i.readableListening=r.listenerCount("readable")>0,i.resumeScheduled&&!i.paused?i.flowing=!0:r.listenerCount("data")>0&&r.resume()}function $(r){u("readable nexttick read 0"),r.read(0)}M.prototype.resume=function(){var r=this._readableState;return r.flowing||(u("resume"),r.flowing=!r.readableListening,oe(this,r)),r.paused=!1,this};function oe(r,i){i.resumeScheduled||(i.resumeScheduled=!0,process.nextTick(ee,r,i))}function ee(r,i){u("resume",i.reading),i.reading||r.read(0),i.resumeScheduled=!1,r.emit("resume"),f(r),i.flowing&&!i.reading&&r.read(0)}M.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function f(r){var i=r._readableState;for(u("flow",i.flowing);i.flowing&&r.read()!==null;);}M.prototype.wrap=function(r){var i=this,c=this._readableState,E=!1;r.on("end",function(){if(u("wrapped end"),c.decoder&&!c.ended){var N=c.decoder.end();N&&N.length&&i.push(N)}i.push(null)}),r.on("data",function(N){if(u("wrapped data"),c.decoder&&(N=c.decoder.write(N)),!(c.objectMode&&N==null)&&!(!c.objectMode&&(!N||!N.length))){var te=i.push(N);te||(E=!0,r.pause())}});for(var P in r)this[P]===void 0&&typeof r[P]=="function"&&(this[P]=function(te){return function(){return r[te].apply(r,arguments)}}(P));for(var L=0;L=i.length?(i.decoder?c=i.buffer.join(""):i.buffer.length===1?c=i.buffer.first():c=i.buffer.concat(i.length),i.buffer.clear()):c=i.buffer.consume(r,i.decoder),c}function b(r){var i=r._readableState;u("endReadable",i.endEmitted),i.endEmitted||(i.ended=!0,process.nextTick(B,i,r))}function B(r,i){if(u("endReadableNT",r.endEmitted,r.length),!r.endEmitted&&r.length===0&&(r.endEmitted=!0,i.readable=!1,i.emit("end"),r.autoDestroy)){var c=i._writableState;(!c||c.autoDestroy&&c.finished)&&i.destroy()}}typeof Symbol=="function"&&(M.from=function(r,i){return g===void 0&&(g=ei()),g(M,r,i)});function k(r,i){for(var c=0,E=r.length;c0;return ci(_,u,w,function(A){l||(l=A),A&&d.forEach(ir),!u&&(d.forEach(ir),o(l))})});return t.reduce(di)}var pi=bi;(function(e,t){t=e.exports=yr(),t.Stream=t,t.Readable=t,t.Writable=vr(),t.Duplex=pe(),t.Transform=wr,t.PassThrough=si,t.finished=$t,t.pipeline=pi})(qt,qt.exports);var Sr=qt.exports;const{Transform:vi}=Sr;var gi=e=>class Rr extends vi{constructor(n,o,l,d,_){super(_),this._rate=n,this._capacity=o,this._delimitedSuffix=l,this._hashBitLength=d,this._options=_,this._state=new e,this._state.initialize(n,o),this._finalized=!1}_transform(n,o,l){let d=null;try{this.update(n,o)}catch(_){d=_}l(d)}_flush(n){let o=null;try{this.push(this.digest())}catch(l){o=l}n(o)}update(n,o){if(!Buffer.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(n)||(n=Buffer.from(n,o)),this._state.absorb(n),this}digest(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let o=this._state.squeeze(this._hashBitLength/8);return n!==void 0&&(o=o.toString(n)),this._resetState(),o}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new Rr(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}};const{Transform:yi}=Sr;var wi=e=>class mr extends yi{constructor(n,o,l,d){super(d),this._rate=n,this._capacity=o,this._delimitedSuffix=l,this._options=d,this._state=new e,this._state.initialize(n,o),this._finalized=!1}_transform(n,o,l){let d=null;try{this.update(n,o)}catch(_){d=_}l(d)}_flush(){}_read(n){this.push(this.squeeze(n))}update(n,o){if(!Buffer.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(n)||(n=Buffer.from(n,o)),this._state.absorb(n),this}squeeze(n,o){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let l=this._state.squeeze(n);return o!==void 0&&(l=l.toString(o)),l}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new mr(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}};const xi=gi,Ei=wi;var Si=function(e){const t=xi(e),n=Ei(e);return function(o,l){switch(typeof o=="string"?o.toLowerCase():o){case"keccak224":return new t(1152,448,null,224,l);case"keccak256":return new t(1088,512,null,256,l);case"keccak384":return new t(832,768,null,384,l);case"keccak512":return new t(576,1024,null,512,l);case"sha3-224":return new t(1152,448,6,224,l);case"sha3-256":return new t(1088,512,6,256,l);case"sha3-384":return new t(832,768,6,384,l);case"sha3-512":return new t(576,1024,6,512,l);case"shake128":return new n(1344,256,31,l);case"shake256":return new n(1088,512,31,l);default:throw new Error("Invald algorithm: "+o)}}},Tr={};const nr=[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];Tr.p1600=function(e){for(let t=0;t<24;++t){const n=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],l=e[2]^e[12]^e[22]^e[32]^e[42],d=e[3]^e[13]^e[23]^e[33]^e[43],_=e[4]^e[14]^e[24]^e[34]^e[44],v=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],w=e[7]^e[17]^e[27]^e[37]^e[47],A=e[8]^e[18]^e[28]^e[38]^e[48],C=e[9]^e[19]^e[29]^e[39]^e[49];let R=A^(l<<1|d>>>31),T=C^(d<<1|l>>>31);const S=e[0]^R,m=e[1]^T,y=e[10]^R,a=e[11]^T,h=e[20]^R,p=e[21]^T,g=e[30]^R,x=e[31]^T,D=e[40]^R,I=e[41]^T;R=n^(_<<1|v>>>31),T=o^(v<<1|_>>>31);const O=e[2]^R,M=e[3]^T,j=e[12]^R,V=e[13]^T,X=e[22]^R,F=e[23]^T,U=e[32]^R,H=e[33]^T,ne=e[42]^R,W=e[43]^T;R=l^(u<<1|w>>>31),T=d^(w<<1|u>>>31);const J=e[4]^R,z=e[5]^T,Q=e[14]^R,ae=e[15]^T,Z=e[24]^R,$=e[25]^T,oe=e[34]^R,ee=e[35]^T,f=e[44]^R,s=e[45]^T;R=_^(A<<1|C>>>31),T=v^(C<<1|A>>>31);const b=e[6]^R,B=e[7]^T,k=e[16]^R,r=e[17]^T,i=e[26]^R,c=e[27]^T,E=e[36]^R,P=e[37]^T,L=e[46]^R,N=e[47]^T;R=u^(n<<1|o>>>31),T=w^(o<<1|n>>>31);const te=e[8]^R,le=e[9]^T,ye=e[18]^R,Te=e[19]^T,we=e[28]^R,ce=e[29]^T,de=e[38]^R,_e=e[39]^T,se=e[48]^R,re=e[49]^T,Y=S,Ne=m,Ie=a<<4|y>>>28,Pe=y<<4|a>>>28,Fe=h<<3|p>>>29,qe=p<<3|h>>>29,je=x<<9|g>>>23,Ue=g<<9|x>>>23,He=D<<18|I>>>14,$e=I<<18|D>>>14,We=O<<1|M>>>31,ze=M<<1|O>>>31,Ge=V<<12|j>>>20,Ke=j<<12|V>>>20,Ve=X<<10|F>>>22,Ye=F<<10|X>>>22,Xe=H<<13|U>>>19,Je=U<<13|H>>>19,Qe=ne<<2|W>>>30,Ze=W<<2|ne>>>30,et=z<<30|J>>>2,tt=J<<30|z>>>2,rt=Q<<6|ae>>>26,it=ae<<6|Q>>>26,nt=$<<11|Z>>>21,at=Z<<11|$>>>21,ot=oe<<15|ee>>>17,st=ee<<15|oe>>>17,ft=s<<29|f>>>3,lt=f<<29|s>>>3,ht=b<<28|B>>>4,ut=B<<28|b>>>4,ct=r<<23|k>>>9,dt=k<<23|r>>>9,_t=i<<25|c>>>7,bt=c<<25|i>>>7,pt=E<<21|P>>>11,vt=P<<21|E>>>11,gt=N<<24|L>>>8,yt=L<<24|N>>>8,wt=te<<27|le>>>5,xt=le<<27|te>>>5,Et=ye<<20|Te>>>12,St=Te<<20|ye>>>12,Rt=ce<<7|we>>>25,mt=we<<7|ce>>>25,Tt=de<<8|_e>>>24,At=_e<<8|de>>>24,Bt=se<<14|re>>>18,Mt=re<<14|se>>>18;e[0]=Y^~Ge&nt,e[1]=Ne^~Ke&at,e[10]=ht^~Et&Fe,e[11]=ut^~St&qe,e[20]=We^~rt&_t,e[21]=ze^~it&bt,e[30]=wt^~Ie&Ve,e[31]=xt^~Pe&Ye,e[40]=et^~ct&Rt,e[41]=tt^~dt&mt,e[2]=Ge^~nt&pt,e[3]=Ke^~at&vt,e[12]=Et^~Fe&Xe,e[13]=St^~qe&Je,e[22]=rt^~_t&Tt,e[23]=it^~bt&At,e[32]=Ie^~Ve&ot,e[33]=Pe^~Ye&st,e[42]=ct^~Rt&je,e[43]=dt^~mt&Ue,e[4]=nt^~pt&Bt,e[5]=at^~vt&Mt,e[14]=Fe^~Xe&ft,e[15]=qe^~Je<,e[24]=_t^~Tt&He,e[25]=bt^~At&$e,e[34]=Ve^~ot>,e[35]=Ye^~st&yt,e[44]=Rt^~je&Qe,e[45]=mt^~Ue&Ze,e[6]=pt^~Bt&Y,e[7]=vt^~Mt&Ne,e[16]=Xe^~ft&ht,e[17]=Je^~lt&ut,e[26]=Tt^~He&We,e[27]=At^~$e&ze,e[36]=ot^~gt&wt,e[37]=st^~yt&xt,e[46]=je^~Qe&et,e[47]=Ue^~Ze&tt,e[8]=Bt^~Y&Ge,e[9]=Mt^~Ne&Ke,e[18]=ft^~ht&Et,e[19]=lt^~ut&St,e[28]=He^~We&rt,e[29]=$e^~ze&it,e[38]=gt^~wt&Ie,e[39]=yt^~xt&Pe,e[48]=Qe^~et&ct,e[49]=Ze^~tt&dt,e[0]^=nr[t*2],e[1]^=nr[t*2+1]}};const Be=Tr;function ve(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}ve.prototype.initialize=function(e,t){for(let n=0;n<50;++n)this.state[n]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};ve.prototype.absorb=function(e){for(let t=0;t>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Be.p1600(this.state),this.count=0);return t};ve.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Ri=ve,xn=Si(Ri),Ar={exports:{}},Br=fe.Buffer;function Oe(e,t){this._block=Br.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Oe.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Br.from(e,t));for(var n=this._block,o=this._blockSize,l=e.length,d=this._len,_=0;_=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=this._len*8;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var o=(n&4294967295)>>>0,l=(n-o)/4294967296;this._block.writeUInt32BE(l,this._blockSize-8),this._block.writeUInt32BE(o,this._blockSize-4)}this._update(this._block);var d=this._hash();return e?d.toString(e):d};Oe.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var ge=Oe,mi=K,Mr=ge,Ti=fe.Buffer,Ai=[1518500249,1859775393,-1894007588,-899497514],Bi=new Array(80);function Ee(){this.init(),this._w=Bi,Mr.call(this,64,56)}mi(Ee,Mr);Ee.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Mi(e){return e<<5|e>>>27}function Ci(e){return e<<30|e>>>2}function Di(e,t,n,o){return e===0?t&n|~t&o:e===2?t&n|t&o|n&o:t^n^o}Ee.prototype._update=function(e){for(var t=this._w,n=this._a|0,o=this._b|0,l=this._c|0,d=this._d|0,_=this._e|0,v=0;v<16;++v)t[v]=e.readInt32BE(v*4);for(;v<80;++v)t[v]=t[v-3]^t[v-8]^t[v-14]^t[v-16];for(var u=0;u<80;++u){var w=~~(u/20),A=Mi(n)+Di(w,o,l,d)+_+t[u]+Ai[w]|0;_=d,d=l,l=Ci(o),o=n,n=A}this._a=n+this._a|0,this._b=o+this._b|0,this._c=l+this._c|0,this._d=d+this._d|0,this._e=_+this._e|0};Ee.prototype._hash=function(){var e=Ti.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Oi=Ee,Li=K,Cr=ge,ki=fe.Buffer,Ni=[1518500249,1859775393,-1894007588,-899497514],Ii=new Array(80);function Se(){this.init(),this._w=Ii,Cr.call(this,64,56)}Li(Se,Cr);Se.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Pi(e){return e<<1|e>>>31}function Fi(e){return e<<5|e>>>27}function qi(e){return e<<30|e>>>2}function ji(e,t,n,o){return e===0?t&n|~t&o:e===2?t&n|t&o|n&o:t^n^o}Se.prototype._update=function(e){for(var t=this._w,n=this._a|0,o=this._b|0,l=this._c|0,d=this._d|0,_=this._e|0,v=0;v<16;++v)t[v]=e.readInt32BE(v*4);for(;v<80;++v)t[v]=Pi(t[v-3]^t[v-8]^t[v-14]^t[v-16]);for(var u=0;u<80;++u){var w=~~(u/20),A=Fi(n)+ji(w,o,l,d)+_+t[u]+Ni[w]|0;_=d,d=l,l=qi(o),o=n,n=A}this._a=n+this._a|0,this._b=o+this._b|0,this._c=l+this._c|0,this._d=d+this._d|0,this._e=_+this._e|0};Se.prototype._hash=function(){var e=ki.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Ui=Se,Hi=K,Dr=ge,$i=fe.Buffer,Wi=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],zi=new Array(64);function Re(){this.init(),this._w=zi,Dr.call(this,64,56)}Hi(Re,Dr);Re.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Gi(e,t,n){return n^e&(t^n)}function Ki(e,t,n){return e&t|n&(e|t)}function Vi(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Yi(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Xi(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Ji(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Re.prototype._update=function(e){for(var t=this._w,n=this._a|0,o=this._b|0,l=this._c|0,d=this._d|0,_=this._e|0,v=this._f|0,u=this._g|0,w=this._h|0,A=0;A<16;++A)t[A]=e.readInt32BE(A*4);for(;A<64;++A)t[A]=Ji(t[A-2])+t[A-7]+Xi(t[A-15])+t[A-16]|0;for(var C=0;C<64;++C){var R=w+Yi(_)+Gi(_,v,u)+Wi[C]+t[C]|0,T=Vi(n)+Ki(n,o,l)|0;w=u,u=v,v=_,_=d+R|0,d=l,l=o,o=n,n=R+T|0}this._a=n+this._a|0,this._b=o+this._b|0,this._c=l+this._c|0,this._d=d+this._d|0,this._e=_+this._e|0,this._f=v+this._f|0,this._g=u+this._g|0,this._h=w+this._h|0};Re.prototype._hash=function(){var e=$i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Or=Re,Qi=K,Zi=Or,en=ge,tn=fe.Buffer,rn=new Array(64);function Le(){this.init(),this._w=rn,en.call(this,64,56)}Qi(Le,Zi);Le.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Le.prototype._hash=function(){var e=tn.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var nn=Le,an=K,Lr=ge,on=fe.Buffer,ar=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],sn=new Array(160);function me(){this.init(),this._w=sn,Lr.call(this,128,112)}an(me,Lr);me.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function or(e,t,n){return n^e&(t^n)}function sr(e,t,n){return e&t|n&(e|t)}function fr(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function lr(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function fn(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function ln(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function hn(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function un(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function q(e,t){return e>>>0>>0?1:0}me.prototype._update=function(e){for(var t=this._w,n=this._ah|0,o=this._bh|0,l=this._ch|0,d=this._dh|0,_=this._eh|0,v=this._fh|0,u=this._gh|0,w=this._hh|0,A=this._al|0,C=this._bl|0,R=this._cl|0,T=this._dl|0,S=this._el|0,m=this._fl|0,y=this._gl|0,a=this._hl|0,h=0;h<32;h+=2)t[h]=e.readInt32BE(h*4),t[h+1]=e.readInt32BE(h*4+4);for(;h<160;h+=2){var p=t[h-30],g=t[h-15*2+1],x=fn(p,g),D=ln(g,p);p=t[h-2*2],g=t[h-2*2+1];var I=hn(p,g),O=un(g,p),M=t[h-7*2],j=t[h-7*2+1],V=t[h-16*2],X=t[h-16*2+1],F=D+j|0,U=x+M+q(F,D)|0;F=F+O|0,U=U+I+q(F,O)|0,F=F+X|0,U=U+V+q(F,X)|0,t[h]=U,t[h+1]=F}for(var H=0;H<160;H+=2){U=t[H],F=t[H+1];var ne=sr(n,o,l),W=sr(A,C,R),J=fr(n,A),z=fr(A,n),Q=lr(_,S),ae=lr(S,_),Z=ar[H],$=ar[H+1],oe=or(_,v,u),ee=or(S,m,y),f=a+ae|0,s=w+Q+q(f,a)|0;f=f+ee|0,s=s+oe+q(f,ee)|0,f=f+$|0,s=s+Z+q(f,$)|0,f=f+F|0,s=s+U+q(f,F)|0;var b=z+W|0,B=J+ne+q(b,z)|0;w=u,a=y,u=v,y=m,v=_,m=S,S=T+f|0,_=d+s+q(S,T)|0,d=l,T=R,l=o,R=C,o=n,C=A,A=f+b|0,n=s+B+q(A,f)|0}this._al=this._al+A|0,this._bl=this._bl+C|0,this._cl=this._cl+R|0,this._dl=this._dl+T|0,this._el=this._el+S|0,this._fl=this._fl+m|0,this._gl=this._gl+y|0,this._hl=this._hl+a|0,this._ah=this._ah+n+q(this._al,A)|0,this._bh=this._bh+o+q(this._bl,C)|0,this._ch=this._ch+l+q(this._cl,R)|0,this._dh=this._dh+d+q(this._dl,T)|0,this._eh=this._eh+_+q(this._el,S)|0,this._fh=this._fh+v+q(this._fl,m)|0,this._gh=this._gh+u+q(this._gl,y)|0,this._hh=this._hh+w+q(this._hl,a)|0};me.prototype._hash=function(){var e=on.allocUnsafe(64);function t(n,o,l){e.writeInt32BE(n,l),e.writeInt32BE(o,l+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var kr=me,cn=K,dn=kr,_n=ge,bn=fe.Buffer,pn=new Array(160);function ke(){this.init(),this._w=pn,_n.call(this,128,112)}cn(ke,dn);ke.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};ke.prototype._hash=function(){var e=bn.allocUnsafe(48);function t(n,o,l){e.writeInt32BE(n,l),e.writeInt32BE(o,l+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var vn=ke,ue=Ar.exports=function(t){t=t.toLowerCase();var n=ue[t];if(!n)throw new Error(t+" is not supported (we accept pull requests)");return new n};ue.sha=Oi;ue.sha1=Ui;ue.sha224=nn;ue.sha256=Or;ue.sha384=vn;ue.sha512=kr;var En=Ar.exports;function Nr(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};An.walletLogo=yu;var Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.LINK_API_URL=void 0;Nn.LINK_API_URL="https://www.walletlink.org";var T={},Ei={exports:{}};Ei.exports;(function(t){(function(e,r){function n(y,o){if(!y)throw new Error(o||"Assertion failed")}function i(y,o){y.super_=o;var d=function(){};d.prototype=o.prototype,y.prototype=new d,y.prototype.constructor=y}function s(y,o,d){if(s.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,y!==null&&((o==="le"||o==="be")&&(d=o,o=10),this._init(y||0,o||10,d||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=mu.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,d){return o.cmp(d)>0?o:d},s.min=function(o,d){return o.cmp(d)<0?o:d},s.prototype._init=function(o,d,g){if(typeof o=="number")return this._initNumber(o,d,g);if(typeof o=="object")return this._initArray(o,d,g);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),o=o.toString().replace(/\s+/g,"");var m=0;o[0]==="-"&&(m++,this.negative=1),m=0;m-=3)E=o[m]|o[m-1]<<8|o[m-2]<<16,this.words[w]|=E<>>26-k&67108863,k+=24,k>=26&&(k-=26,w++);else if(g==="le")for(m=0,w=0;m>>26-k&67108863,k+=24,k>=26&&(k-=26,w++);return this._strip()};function c(y,o){var d=y.charCodeAt(o);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+y)}function h(y,o,d){var g=c(y,d);return d-1>=o&&(g|=c(y,d-1)<<4),g}s.prototype._parseHex=function(o,d,g){this.length=Math.ceil((o.length-d)/6),this.words=new Array(this.length);for(var m=0;m=d;m-=2)k=h(o,d,m)<=18?(w-=18,E+=1,this.words[E]|=k>>>26):w+=8;else{var _=o.length-d;for(m=_%2===0?d+1:d;m=18?(w-=18,E+=1,this.words[E]|=k>>>26):w+=8}this._strip()};function u(y,o,d,g){for(var m=0,w=0,E=Math.min(y.length,d),k=o;k=49?w=_-49+10:_>=17?w=_-17+10:w=_,n(_>=0&&w1&&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")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var v=["","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"],S=[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],C=[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(o,d){o=o||10,d=d|0||1;var g;if(o===16||o==="hex"){g="";for(var m=0,w=0,E=0;E>>24-m&16777215,m+=2,m>=26&&(m-=26,E--),w!==0||E!==this.length-1?g=v[6-_.length]+_+g:g=_+g}for(w!==0&&(g=w.toString(16)+g);g.length%d!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(o===(o|0)&&o>=2&&o<=36){var l=S[o],b=C[o];g="";var L=this.clone();for(L.negative=0;!L.isZero();){var O=L.modrn(b).toString(o);L=L.idivn(b),L.isZero()?g=O+g:g=v[l-O.length]+O+g}for(this.isZero()&&(g="0"+g);g.length%d!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(o,d){return this.toArrayLike(a,o,d)}),s.prototype.toArray=function(o,d){return this.toArrayLike(Array,o,d)};var N=function(o,d){return o.allocUnsafe?o.allocUnsafe(d):new o(d)};s.prototype.toArrayLike=function(o,d,g){this._strip();var m=this.byteLength(),w=g||Math.max(1,m);n(m<=w,"byte array longer than desired length"),n(w>0,"Requested array length <= 0");var E=N(o,w),k=d==="le"?"LE":"BE";return this["_toArrayLike"+k](E,m),E},s.prototype._toArrayLikeLE=function(o,d){for(var g=0,m=0,w=0,E=0;w>8&255),g>16&255),E===6?(g>24&255),m=0,E=0):(m=k>>>24,E+=2)}if(g=0&&(o[g--]=k>>8&255),g>=0&&(o[g--]=k>>16&255),E===6?(g>=0&&(o[g--]=k>>24&255),m=0,E=0):(m=k>>>24,E+=2)}if(g>=0)for(o[g--]=m;g>=0;)o[g--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var d=o,g=0;return d>=4096&&(g+=13,d>>>=13),d>=64&&(g+=7,d>>>=7),d>=8&&(g+=4,d>>>=4),d>=2&&(g+=2,d>>>=2),g+d},s.prototype._zeroBits=function(o){if(o===0)return 26;var d=o,g=0;return d&8191||(g+=13,d>>>=13),d&127||(g+=7,d>>>=7),d&15||(g+=4,d>>>=4),d&3||(g+=2,d>>>=2),d&1||g++,g},s.prototype.bitLength=function(){var o=this.words[this.length-1],d=this._countBits(o);return(this.length-1)*26+d};function M(y){for(var o=new Array(y.bitLength()),d=0;d>>m&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,d=0;do.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var d;this.length>o.length?d=o:d=this;for(var g=0;go.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var d,g;this.length>o.length?(d=this,g=o):(d=o,g=this);for(var m=0;mo.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var d=Math.ceil(o/26)|0,g=o%26;this._expand(d),g>0&&d--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-g),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,d){n(typeof o=="number"&&o>=0);var g=o/26|0,m=o%26;return this._expand(g+1),d?this.words[g]=this.words[g]|1<o.length?(g=this,m=o):(g=o,m=this);for(var w=0,E=0;E>>26;for(;w!==0&&E>>26;if(this.length=g.length,w!==0)this.words[this.length]=w,this.length++;else if(g!==this)for(;Eo.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var d=this.iadd(o);return o.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var g=this.cmp(o);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,w;g>0?(m=this,w=o):(m=o,w=this);for(var E=0,k=0;k>26,this.words[k]=d&67108863;for(;E!==0&&k>26,this.words[k]=d&67108863;if(E===0&&k>>26,L=_&67108863,O=Math.min(l,o.length-1),F=Math.max(0,l-y.length+1);F<=O;F++){var Ze=l-F|0;m=y.words[Ze]|0,w=o.words[F]|0,E=m*w+L,b+=E/67108864|0,L=E&67108863}d.words[l]=L|0,_=b|0}return _!==0?d.words[l]=_|0:d.length--,d._strip()}var I=function(o,d,g){var m=o.words,w=d.words,E=g.words,k=0,_,l,b,L=m[0]|0,O=L&8191,F=L>>>13,Ze=m[1]|0,K=Ze&8191,ee=Ze>>>13,ho=m[2]|0,oe=ho&8191,ae=ho>>>13,fo=m[3]|0,ce=fo&8191,le=fo>>>13,po=m[4]|0,ue=po&8191,de=po>>>13,go=m[5]|0,he=go&8191,fe=go>>>13,mo=m[6]|0,pe=mo&8191,ge=mo>>>13,_o=m[7]|0,me=_o&8191,_e=_o>>>13,vo=m[8]|0,ve=vo&8191,ye=vo>>>13,yo=m[9]|0,we=yo&8191,be=yo>>>13,wo=w[0]|0,Ee=wo&8191,Se=wo>>>13,bo=w[1]|0,ke=bo&8191,Ce=bo>>>13,Eo=w[2]|0,Me=Eo&8191,Re=Eo>>>13,So=w[3]|0,Ie=So&8191,Ae=So>>>13,ko=w[4]|0,Ne=ko&8191,xe=ko>>>13,Co=w[5]|0,Le=Co&8191,Te=Co>>>13,Mo=w[6]|0,Pe=Mo&8191,Oe=Mo>>>13,Ro=w[7]|0,$e=Ro&8191,Be=Ro>>>13,Io=w[8]|0,Fe=Io&8191,je=Io>>>13,Ao=w[9]|0,De=Ao&8191,He=Ao>>>13;g.negative=o.negative^d.negative,g.length=19,_=Math.imul(O,Ee),l=Math.imul(O,Se),l=l+Math.imul(F,Ee)|0,b=Math.imul(F,Se);var Es=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Es>>>26)|0,Es&=67108863,_=Math.imul(K,Ee),l=Math.imul(K,Se),l=l+Math.imul(ee,Ee)|0,b=Math.imul(ee,Se),_=_+Math.imul(O,ke)|0,l=l+Math.imul(O,Ce)|0,l=l+Math.imul(F,ke)|0,b=b+Math.imul(F,Ce)|0;var Ss=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,_=Math.imul(oe,Ee),l=Math.imul(oe,Se),l=l+Math.imul(ae,Ee)|0,b=Math.imul(ae,Se),_=_+Math.imul(K,ke)|0,l=l+Math.imul(K,Ce)|0,l=l+Math.imul(ee,ke)|0,b=b+Math.imul(ee,Ce)|0,_=_+Math.imul(O,Me)|0,l=l+Math.imul(O,Re)|0,l=l+Math.imul(F,Me)|0,b=b+Math.imul(F,Re)|0;var ks=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(ks>>>26)|0,ks&=67108863,_=Math.imul(ce,Ee),l=Math.imul(ce,Se),l=l+Math.imul(le,Ee)|0,b=Math.imul(le,Se),_=_+Math.imul(oe,ke)|0,l=l+Math.imul(oe,Ce)|0,l=l+Math.imul(ae,ke)|0,b=b+Math.imul(ae,Ce)|0,_=_+Math.imul(K,Me)|0,l=l+Math.imul(K,Re)|0,l=l+Math.imul(ee,Me)|0,b=b+Math.imul(ee,Re)|0,_=_+Math.imul(O,Ie)|0,l=l+Math.imul(O,Ae)|0,l=l+Math.imul(F,Ie)|0,b=b+Math.imul(F,Ae)|0;var Cs=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Cs>>>26)|0,Cs&=67108863,_=Math.imul(ue,Ee),l=Math.imul(ue,Se),l=l+Math.imul(de,Ee)|0,b=Math.imul(de,Se),_=_+Math.imul(ce,ke)|0,l=l+Math.imul(ce,Ce)|0,l=l+Math.imul(le,ke)|0,b=b+Math.imul(le,Ce)|0,_=_+Math.imul(oe,Me)|0,l=l+Math.imul(oe,Re)|0,l=l+Math.imul(ae,Me)|0,b=b+Math.imul(ae,Re)|0,_=_+Math.imul(K,Ie)|0,l=l+Math.imul(K,Ae)|0,l=l+Math.imul(ee,Ie)|0,b=b+Math.imul(ee,Ae)|0,_=_+Math.imul(O,Ne)|0,l=l+Math.imul(O,xe)|0,l=l+Math.imul(F,Ne)|0,b=b+Math.imul(F,xe)|0;var Ms=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ms>>>26)|0,Ms&=67108863,_=Math.imul(he,Ee),l=Math.imul(he,Se),l=l+Math.imul(fe,Ee)|0,b=Math.imul(fe,Se),_=_+Math.imul(ue,ke)|0,l=l+Math.imul(ue,Ce)|0,l=l+Math.imul(de,ke)|0,b=b+Math.imul(de,Ce)|0,_=_+Math.imul(ce,Me)|0,l=l+Math.imul(ce,Re)|0,l=l+Math.imul(le,Me)|0,b=b+Math.imul(le,Re)|0,_=_+Math.imul(oe,Ie)|0,l=l+Math.imul(oe,Ae)|0,l=l+Math.imul(ae,Ie)|0,b=b+Math.imul(ae,Ae)|0,_=_+Math.imul(K,Ne)|0,l=l+Math.imul(K,xe)|0,l=l+Math.imul(ee,Ne)|0,b=b+Math.imul(ee,xe)|0,_=_+Math.imul(O,Le)|0,l=l+Math.imul(O,Te)|0,l=l+Math.imul(F,Le)|0,b=b+Math.imul(F,Te)|0;var Rs=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Rs>>>26)|0,Rs&=67108863,_=Math.imul(pe,Ee),l=Math.imul(pe,Se),l=l+Math.imul(ge,Ee)|0,b=Math.imul(ge,Se),_=_+Math.imul(he,ke)|0,l=l+Math.imul(he,Ce)|0,l=l+Math.imul(fe,ke)|0,b=b+Math.imul(fe,Ce)|0,_=_+Math.imul(ue,Me)|0,l=l+Math.imul(ue,Re)|0,l=l+Math.imul(de,Me)|0,b=b+Math.imul(de,Re)|0,_=_+Math.imul(ce,Ie)|0,l=l+Math.imul(ce,Ae)|0,l=l+Math.imul(le,Ie)|0,b=b+Math.imul(le,Ae)|0,_=_+Math.imul(oe,Ne)|0,l=l+Math.imul(oe,xe)|0,l=l+Math.imul(ae,Ne)|0,b=b+Math.imul(ae,xe)|0,_=_+Math.imul(K,Le)|0,l=l+Math.imul(K,Te)|0,l=l+Math.imul(ee,Le)|0,b=b+Math.imul(ee,Te)|0,_=_+Math.imul(O,Pe)|0,l=l+Math.imul(O,Oe)|0,l=l+Math.imul(F,Pe)|0,b=b+Math.imul(F,Oe)|0;var Is=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Is>>>26)|0,Is&=67108863,_=Math.imul(me,Ee),l=Math.imul(me,Se),l=l+Math.imul(_e,Ee)|0,b=Math.imul(_e,Se),_=_+Math.imul(pe,ke)|0,l=l+Math.imul(pe,Ce)|0,l=l+Math.imul(ge,ke)|0,b=b+Math.imul(ge,Ce)|0,_=_+Math.imul(he,Me)|0,l=l+Math.imul(he,Re)|0,l=l+Math.imul(fe,Me)|0,b=b+Math.imul(fe,Re)|0,_=_+Math.imul(ue,Ie)|0,l=l+Math.imul(ue,Ae)|0,l=l+Math.imul(de,Ie)|0,b=b+Math.imul(de,Ae)|0,_=_+Math.imul(ce,Ne)|0,l=l+Math.imul(ce,xe)|0,l=l+Math.imul(le,Ne)|0,b=b+Math.imul(le,xe)|0,_=_+Math.imul(oe,Le)|0,l=l+Math.imul(oe,Te)|0,l=l+Math.imul(ae,Le)|0,b=b+Math.imul(ae,Te)|0,_=_+Math.imul(K,Pe)|0,l=l+Math.imul(K,Oe)|0,l=l+Math.imul(ee,Pe)|0,b=b+Math.imul(ee,Oe)|0,_=_+Math.imul(O,$e)|0,l=l+Math.imul(O,Be)|0,l=l+Math.imul(F,$e)|0,b=b+Math.imul(F,Be)|0;var As=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(As>>>26)|0,As&=67108863,_=Math.imul(ve,Ee),l=Math.imul(ve,Se),l=l+Math.imul(ye,Ee)|0,b=Math.imul(ye,Se),_=_+Math.imul(me,ke)|0,l=l+Math.imul(me,Ce)|0,l=l+Math.imul(_e,ke)|0,b=b+Math.imul(_e,Ce)|0,_=_+Math.imul(pe,Me)|0,l=l+Math.imul(pe,Re)|0,l=l+Math.imul(ge,Me)|0,b=b+Math.imul(ge,Re)|0,_=_+Math.imul(he,Ie)|0,l=l+Math.imul(he,Ae)|0,l=l+Math.imul(fe,Ie)|0,b=b+Math.imul(fe,Ae)|0,_=_+Math.imul(ue,Ne)|0,l=l+Math.imul(ue,xe)|0,l=l+Math.imul(de,Ne)|0,b=b+Math.imul(de,xe)|0,_=_+Math.imul(ce,Le)|0,l=l+Math.imul(ce,Te)|0,l=l+Math.imul(le,Le)|0,b=b+Math.imul(le,Te)|0,_=_+Math.imul(oe,Pe)|0,l=l+Math.imul(oe,Oe)|0,l=l+Math.imul(ae,Pe)|0,b=b+Math.imul(ae,Oe)|0,_=_+Math.imul(K,$e)|0,l=l+Math.imul(K,Be)|0,l=l+Math.imul(ee,$e)|0,b=b+Math.imul(ee,Be)|0,_=_+Math.imul(O,Fe)|0,l=l+Math.imul(O,je)|0,l=l+Math.imul(F,Fe)|0,b=b+Math.imul(F,je)|0;var Ns=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ns>>>26)|0,Ns&=67108863,_=Math.imul(we,Ee),l=Math.imul(we,Se),l=l+Math.imul(be,Ee)|0,b=Math.imul(be,Se),_=_+Math.imul(ve,ke)|0,l=l+Math.imul(ve,Ce)|0,l=l+Math.imul(ye,ke)|0,b=b+Math.imul(ye,Ce)|0,_=_+Math.imul(me,Me)|0,l=l+Math.imul(me,Re)|0,l=l+Math.imul(_e,Me)|0,b=b+Math.imul(_e,Re)|0,_=_+Math.imul(pe,Ie)|0,l=l+Math.imul(pe,Ae)|0,l=l+Math.imul(ge,Ie)|0,b=b+Math.imul(ge,Ae)|0,_=_+Math.imul(he,Ne)|0,l=l+Math.imul(he,xe)|0,l=l+Math.imul(fe,Ne)|0,b=b+Math.imul(fe,xe)|0,_=_+Math.imul(ue,Le)|0,l=l+Math.imul(ue,Te)|0,l=l+Math.imul(de,Le)|0,b=b+Math.imul(de,Te)|0,_=_+Math.imul(ce,Pe)|0,l=l+Math.imul(ce,Oe)|0,l=l+Math.imul(le,Pe)|0,b=b+Math.imul(le,Oe)|0,_=_+Math.imul(oe,$e)|0,l=l+Math.imul(oe,Be)|0,l=l+Math.imul(ae,$e)|0,b=b+Math.imul(ae,Be)|0,_=_+Math.imul(K,Fe)|0,l=l+Math.imul(K,je)|0,l=l+Math.imul(ee,Fe)|0,b=b+Math.imul(ee,je)|0,_=_+Math.imul(O,De)|0,l=l+Math.imul(O,He)|0,l=l+Math.imul(F,De)|0,b=b+Math.imul(F,He)|0;var xs=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(xs>>>26)|0,xs&=67108863,_=Math.imul(we,ke),l=Math.imul(we,Ce),l=l+Math.imul(be,ke)|0,b=Math.imul(be,Ce),_=_+Math.imul(ve,Me)|0,l=l+Math.imul(ve,Re)|0,l=l+Math.imul(ye,Me)|0,b=b+Math.imul(ye,Re)|0,_=_+Math.imul(me,Ie)|0,l=l+Math.imul(me,Ae)|0,l=l+Math.imul(_e,Ie)|0,b=b+Math.imul(_e,Ae)|0,_=_+Math.imul(pe,Ne)|0,l=l+Math.imul(pe,xe)|0,l=l+Math.imul(ge,Ne)|0,b=b+Math.imul(ge,xe)|0,_=_+Math.imul(he,Le)|0,l=l+Math.imul(he,Te)|0,l=l+Math.imul(fe,Le)|0,b=b+Math.imul(fe,Te)|0,_=_+Math.imul(ue,Pe)|0,l=l+Math.imul(ue,Oe)|0,l=l+Math.imul(de,Pe)|0,b=b+Math.imul(de,Oe)|0,_=_+Math.imul(ce,$e)|0,l=l+Math.imul(ce,Be)|0,l=l+Math.imul(le,$e)|0,b=b+Math.imul(le,Be)|0,_=_+Math.imul(oe,Fe)|0,l=l+Math.imul(oe,je)|0,l=l+Math.imul(ae,Fe)|0,b=b+Math.imul(ae,je)|0,_=_+Math.imul(K,De)|0,l=l+Math.imul(K,He)|0,l=l+Math.imul(ee,De)|0,b=b+Math.imul(ee,He)|0;var Ls=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ls>>>26)|0,Ls&=67108863,_=Math.imul(we,Me),l=Math.imul(we,Re),l=l+Math.imul(be,Me)|0,b=Math.imul(be,Re),_=_+Math.imul(ve,Ie)|0,l=l+Math.imul(ve,Ae)|0,l=l+Math.imul(ye,Ie)|0,b=b+Math.imul(ye,Ae)|0,_=_+Math.imul(me,Ne)|0,l=l+Math.imul(me,xe)|0,l=l+Math.imul(_e,Ne)|0,b=b+Math.imul(_e,xe)|0,_=_+Math.imul(pe,Le)|0,l=l+Math.imul(pe,Te)|0,l=l+Math.imul(ge,Le)|0,b=b+Math.imul(ge,Te)|0,_=_+Math.imul(he,Pe)|0,l=l+Math.imul(he,Oe)|0,l=l+Math.imul(fe,Pe)|0,b=b+Math.imul(fe,Oe)|0,_=_+Math.imul(ue,$e)|0,l=l+Math.imul(ue,Be)|0,l=l+Math.imul(de,$e)|0,b=b+Math.imul(de,Be)|0,_=_+Math.imul(ce,Fe)|0,l=l+Math.imul(ce,je)|0,l=l+Math.imul(le,Fe)|0,b=b+Math.imul(le,je)|0,_=_+Math.imul(oe,De)|0,l=l+Math.imul(oe,He)|0,l=l+Math.imul(ae,De)|0,b=b+Math.imul(ae,He)|0;var Ts=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,_=Math.imul(we,Ie),l=Math.imul(we,Ae),l=l+Math.imul(be,Ie)|0,b=Math.imul(be,Ae),_=_+Math.imul(ve,Ne)|0,l=l+Math.imul(ve,xe)|0,l=l+Math.imul(ye,Ne)|0,b=b+Math.imul(ye,xe)|0,_=_+Math.imul(me,Le)|0,l=l+Math.imul(me,Te)|0,l=l+Math.imul(_e,Le)|0,b=b+Math.imul(_e,Te)|0,_=_+Math.imul(pe,Pe)|0,l=l+Math.imul(pe,Oe)|0,l=l+Math.imul(ge,Pe)|0,b=b+Math.imul(ge,Oe)|0,_=_+Math.imul(he,$e)|0,l=l+Math.imul(he,Be)|0,l=l+Math.imul(fe,$e)|0,b=b+Math.imul(fe,Be)|0,_=_+Math.imul(ue,Fe)|0,l=l+Math.imul(ue,je)|0,l=l+Math.imul(de,Fe)|0,b=b+Math.imul(de,je)|0,_=_+Math.imul(ce,De)|0,l=l+Math.imul(ce,He)|0,l=l+Math.imul(le,De)|0,b=b+Math.imul(le,He)|0;var Ps=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,_=Math.imul(we,Ne),l=Math.imul(we,xe),l=l+Math.imul(be,Ne)|0,b=Math.imul(be,xe),_=_+Math.imul(ve,Le)|0,l=l+Math.imul(ve,Te)|0,l=l+Math.imul(ye,Le)|0,b=b+Math.imul(ye,Te)|0,_=_+Math.imul(me,Pe)|0,l=l+Math.imul(me,Oe)|0,l=l+Math.imul(_e,Pe)|0,b=b+Math.imul(_e,Oe)|0,_=_+Math.imul(pe,$e)|0,l=l+Math.imul(pe,Be)|0,l=l+Math.imul(ge,$e)|0,b=b+Math.imul(ge,Be)|0,_=_+Math.imul(he,Fe)|0,l=l+Math.imul(he,je)|0,l=l+Math.imul(fe,Fe)|0,b=b+Math.imul(fe,je)|0,_=_+Math.imul(ue,De)|0,l=l+Math.imul(ue,He)|0,l=l+Math.imul(de,De)|0,b=b+Math.imul(de,He)|0;var Os=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Os>>>26)|0,Os&=67108863,_=Math.imul(we,Le),l=Math.imul(we,Te),l=l+Math.imul(be,Le)|0,b=Math.imul(be,Te),_=_+Math.imul(ve,Pe)|0,l=l+Math.imul(ve,Oe)|0,l=l+Math.imul(ye,Pe)|0,b=b+Math.imul(ye,Oe)|0,_=_+Math.imul(me,$e)|0,l=l+Math.imul(me,Be)|0,l=l+Math.imul(_e,$e)|0,b=b+Math.imul(_e,Be)|0,_=_+Math.imul(pe,Fe)|0,l=l+Math.imul(pe,je)|0,l=l+Math.imul(ge,Fe)|0,b=b+Math.imul(ge,je)|0,_=_+Math.imul(he,De)|0,l=l+Math.imul(he,He)|0,l=l+Math.imul(fe,De)|0,b=b+Math.imul(fe,He)|0;var $s=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+($s>>>26)|0,$s&=67108863,_=Math.imul(we,Pe),l=Math.imul(we,Oe),l=l+Math.imul(be,Pe)|0,b=Math.imul(be,Oe),_=_+Math.imul(ve,$e)|0,l=l+Math.imul(ve,Be)|0,l=l+Math.imul(ye,$e)|0,b=b+Math.imul(ye,Be)|0,_=_+Math.imul(me,Fe)|0,l=l+Math.imul(me,je)|0,l=l+Math.imul(_e,Fe)|0,b=b+Math.imul(_e,je)|0,_=_+Math.imul(pe,De)|0,l=l+Math.imul(pe,He)|0,l=l+Math.imul(ge,De)|0,b=b+Math.imul(ge,He)|0;var Bs=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Bs>>>26)|0,Bs&=67108863,_=Math.imul(we,$e),l=Math.imul(we,Be),l=l+Math.imul(be,$e)|0,b=Math.imul(be,Be),_=_+Math.imul(ve,Fe)|0,l=l+Math.imul(ve,je)|0,l=l+Math.imul(ye,Fe)|0,b=b+Math.imul(ye,je)|0,_=_+Math.imul(me,De)|0,l=l+Math.imul(me,He)|0,l=l+Math.imul(_e,De)|0,b=b+Math.imul(_e,He)|0;var Fs=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Fs>>>26)|0,Fs&=67108863,_=Math.imul(we,Fe),l=Math.imul(we,je),l=l+Math.imul(be,Fe)|0,b=Math.imul(be,je),_=_+Math.imul(ve,De)|0,l=l+Math.imul(ve,He)|0,l=l+Math.imul(ye,De)|0,b=b+Math.imul(ye,He)|0;var js=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(js>>>26)|0,js&=67108863,_=Math.imul(we,De),l=Math.imul(we,He),l=l+Math.imul(be,De)|0,b=Math.imul(be,He);var Ds=(k+_|0)+((l&8191)<<13)|0;return k=(b+(l>>>13)|0)+(Ds>>>26)|0,Ds&=67108863,E[0]=Es,E[1]=Ss,E[2]=ks,E[3]=Cs,E[4]=Ms,E[5]=Rs,E[6]=Is,E[7]=As,E[8]=Ns,E[9]=xs,E[10]=Ls,E[11]=Ts,E[12]=Ps,E[13]=Os,E[14]=$s,E[15]=Bs,E[16]=Fs,E[17]=js,E[18]=Ds,k!==0&&(E[19]=k,g.length++),g};Math.imul||(I=A);function R(y,o,d){d.negative=o.negative^y.negative,d.length=y.length+o.length;for(var g=0,m=0,w=0;w>>26)|0,m+=E>>>26,E&=67108863}d.words[w]=k,g=E,E=m}return g!==0?d.words[w]=g:d.length--,d._strip()}function j(y,o,d){return R(y,o,d)}s.prototype.mulTo=function(o,d){var g,m=this.length+o.length;return this.length===10&&o.length===10?g=I(this,o,d):m<63?g=A(this,o,d):m<1024?g=R(this,o,d):g=j(this,o,d),g},s.prototype.mul=function(o){var d=new s(null);return d.words=new Array(this.length+o.length),this.mulTo(o,d)},s.prototype.mulf=function(o){var d=new s(null);return d.words=new Array(this.length+o.length),j(this,o,d)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var d=o<0;d&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var g=0,m=0;m>=26,g+=w/67108864|0,g+=E>>>26,this.words[m]=E&67108863}return g!==0&&(this.words[m]=g,this.length++),d?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var d=M(o);if(d.length===0)return new s(1);for(var g=this,m=0;m=0);var d=o%26,g=(o-d)/26,m=67108863>>>26-d<<26-d,w;if(d!==0){var E=0;for(w=0;w>>26-d}E&&(this.words[w]=E,this.length++)}if(g!==0){for(w=this.length-1;w>=0;w--)this.words[w+g]=this.words[w];for(w=0;w=0);var m;d?m=(d-d%26)/26:m=0;var w=o%26,E=Math.min((o-w)/26,this.length),k=67108863^67108863>>>w<E)for(this.length-=E,l=0;l=0&&(b!==0||l>=m);l--){var L=this.words[l]|0;this.words[l]=b<<26-w|L>>>w,b=L&k}return _&&b!==0&&(_.words[_.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,d,g){return n(this.negative===0),this.iushrn(o,d,g)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var d=o%26,g=(o-d)/26,m=1<=0);var d=o%26,g=(o-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(d!==0&&g++,this.length=Math.min(g,this.length),d!==0){var m=67108863^67108863>>>d<=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d>26)-(_/67108864|0),this.words[w+g]=E&67108863}for(;w>26,this.words[w+g]=E&67108863;if(k===0)return this._strip();for(n(k===-1),k=0,w=0;w>26,this.words[w]=E&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,d){var g=this.length-o.length,m=this.clone(),w=o,E=w.words[w.length-1]|0,k=this._countBits(E);g=26-k,g!==0&&(w=w.ushln(g),m.iushln(g),E=w.words[w.length-1]|0);var _=m.length-w.length,l;if(d!=="mod"){l=new s(null),l.length=_+1,l.words=new Array(l.length);for(var b=0;b=0;O--){var F=(m.words[w.length+O]|0)*67108864+(m.words[w.length+O-1]|0);for(F=Math.min(F/E|0,67108863),m._ishlnsubmul(w,F,O);m.negative!==0;)F--,m.negative=0,m._ishlnsubmul(w,1,O),m.isZero()||(m.negative^=1);l&&(l.words[O]=F)}return l&&l._strip(),m._strip(),d!=="div"&&g!==0&&m.iushrn(g),{div:l||null,mod:m}},s.prototype.divmod=function(o,d,g){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,w,E;return this.negative!==0&&o.negative===0?(E=this.neg().divmod(o,d),d!=="mod"&&(m=E.div.neg()),d!=="div"&&(w=E.mod.neg(),g&&w.negative!==0&&w.iadd(o)),{div:m,mod:w}):this.negative===0&&o.negative!==0?(E=this.divmod(o.neg(),d),d!=="mod"&&(m=E.div.neg()),{div:m,mod:E.mod}):this.negative&o.negative?(E=this.neg().divmod(o.neg(),d),d!=="div"&&(w=E.mod.neg(),g&&w.negative!==0&&w.isub(o)),{div:E.div,mod:w}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?d==="div"?{div:this.divn(o.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,d)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var d=this.divmod(o);if(d.mod.isZero())return d.div;var g=d.div.negative!==0?d.mod.isub(o):d.mod,m=o.ushrn(1),w=o.andln(1),E=g.cmp(m);return E<0||w===1&&E===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(o){var d=o<0;d&&(o=-o),n(o<=67108863);for(var g=(1<<26)%o,m=0,w=this.length-1;w>=0;w--)m=(g*m+(this.words[w]|0))%o;return d?-m:m},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var d=o<0;d&&(o=-o),n(o<=67108863);for(var g=0,m=this.length-1;m>=0;m--){var w=(this.words[m]|0)+g*67108864;this.words[m]=w/o|0,g=w%o}return this._strip(),d?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var d=this,g=o.clone();d.negative!==0?d=d.umod(o):d=d.clone();for(var m=new s(1),w=new s(0),E=new s(0),k=new s(1),_=0;d.isEven()&&g.isEven();)d.iushrn(1),g.iushrn(1),++_;for(var l=g.clone(),b=d.clone();!d.isZero();){for(var L=0,O=1;!(d.words[0]&O)&&L<26;++L,O<<=1);if(L>0)for(d.iushrn(L);L-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(l),w.isub(b)),m.iushrn(1),w.iushrn(1);for(var F=0,Ze=1;!(g.words[0]&Ze)&&F<26;++F,Ze<<=1);if(F>0)for(g.iushrn(F);F-- >0;)(E.isOdd()||k.isOdd())&&(E.iadd(l),k.isub(b)),E.iushrn(1),k.iushrn(1);d.cmp(g)>=0?(d.isub(g),m.isub(E),w.isub(k)):(g.isub(d),E.isub(m),k.isub(w))}return{a:E,b:k,gcd:g.iushln(_)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var d=this,g=o.clone();d.negative!==0?d=d.umod(o):d=d.clone();for(var m=new s(1),w=new s(0),E=g.clone();d.cmpn(1)>0&&g.cmpn(1)>0;){for(var k=0,_=1;!(d.words[0]&_)&&k<26;++k,_<<=1);if(k>0)for(d.iushrn(k);k-- >0;)m.isOdd()&&m.iadd(E),m.iushrn(1);for(var l=0,b=1;!(g.words[0]&b)&&l<26;++l,b<<=1);if(l>0)for(g.iushrn(l);l-- >0;)w.isOdd()&&w.iadd(E),w.iushrn(1);d.cmp(g)>=0?(d.isub(g),m.isub(w)):(g.isub(d),w.isub(m))}var L;return d.cmpn(1)===0?L=m:L=w,L.cmpn(0)<0&&L.iadd(o),L},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var d=this.clone(),g=o.clone();d.negative=0,g.negative=0;for(var m=0;d.isEven()&&g.isEven();m++)d.iushrn(1),g.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;g.isEven();)g.iushrn(1);var w=d.cmp(g);if(w<0){var E=d;d=g,g=E}else if(w===0||g.cmpn(1)===0)break;d.isub(g)}while(!0);return g.iushln(m)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var d=o%26,g=(o-d)/26,m=1<>>26,k&=67108863,this.words[E]=k}return w!==0&&(this.words[E]=w,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var d=o<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var g;if(this.length>1)g=1;else{d&&(o=-o),n(o<=67108863,"Number is too big");var m=this.words[0]|0;g=m===o?0:mo.length)return 1;if(this.length=0;g--){var m=this.words[g]|0,w=o.words[g]|0;if(m!==w){mw&&(d=1);break}}return d},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new U(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},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(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var x={k256:null,p224:null,p192:null,p25519:null};function P(y,o){this.name=y,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},P.prototype.ireduce=function(o){var d=o,g;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),g=d.bitLength();while(g>this.n);var m=g0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},P.prototype.split=function(o,d){o.iushrn(this.n,0,d)},P.prototype.imulK=function(o){return o.imul(this.k)};function q(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(q,P),q.prototype.split=function(o,d){for(var g=4194303,m=Math.min(o.length,9),w=0;w>>22,E=k}E>>>=22,o.words[w-10]=E,E===0&&o.length>10?o.length-=10:o.length-=9},q.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var d=0,g=0;g>>=26,o.words[g]=w,d=m}return d!==0&&(o.words[o.length++]=d),o},s._prime=function(o){if(x[o])return x[o];var d;if(o==="k256")d=new q;else if(o==="p224")d=new Y;else if(o==="p192")d=new J;else if(o==="p25519")d=new G;else throw new Error("Unknown prime "+o);return x[o]=d,d};function U(y){if(typeof y=="string"){var o=s._prime(y);this.m=o.p,this.prime=o}else n(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}U.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},U.prototype._verify2=function(o,d){n((o.negative|d.negative)===0,"red works only with positives"),n(o.red&&o.red===d.red,"red works only with red numbers")},U.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(p(o,o.umod(this.m)._forceRed(this)),o)},U.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},U.prototype.add=function(o,d){this._verify2(o,d);var g=o.add(d);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},U.prototype.iadd=function(o,d){this._verify2(o,d);var g=o.iadd(d);return g.cmp(this.m)>=0&&g.isub(this.m),g},U.prototype.sub=function(o,d){this._verify2(o,d);var g=o.sub(d);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},U.prototype.isub=function(o,d){this._verify2(o,d);var g=o.isub(d);return g.cmpn(0)<0&&g.iadd(this.m),g},U.prototype.shl=function(o,d){return this._verify1(o),this.imod(o.ushln(d))},U.prototype.imul=function(o,d){return this._verify2(o,d),this.imod(o.imul(d))},U.prototype.mul=function(o,d){return this._verify2(o,d),this.imod(o.mul(d))},U.prototype.isqr=function(o){return this.imul(o,o.clone())},U.prototype.sqr=function(o){return this.mul(o,o)},U.prototype.sqrt=function(o){if(o.isZero())return o.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var g=this.m.add(new s(1)).iushrn(2);return this.pow(o,g)}for(var m=this.m.subn(1),w=0;!m.isZero()&&m.andln(1)===0;)w++,m.iushrn(1);n(!m.isZero());var E=new s(1).toRed(this),k=E.redNeg(),_=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);this.pow(l,_).cmp(k)!==0;)l.redIAdd(k);for(var b=this.pow(l,m),L=this.pow(o,m.addn(1).iushrn(1)),O=this.pow(o,m),F=w;O.cmp(E)!==0;){for(var Ze=O,K=0;Ze.cmp(E)!==0;K++)Ze=Ze.redSqr();n(K=0;w--){for(var b=d.words[w],L=l-1;L>=0;L--){var O=b>>L&1;if(E!==m[0]&&(E=this.sqr(E)),O===0&&k===0){_=0;continue}k<<=1,k|=O,_++,!(_!==g&&(w!==0||L!==0))&&(E=this.mul(E,m[k]),_=0,k=0)}l=26}return E},U.prototype.convertTo=function(o){var d=o.umod(this.m);return d===o?d.clone():d},U.prototype.convertFrom=function(o){var d=o.clone();return d.red=null,d},s.mont=function(o){return new Q(o)};function Q(y){U.call(this,y),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(Q,U),Q.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},Q.prototype.convertFrom=function(o){var d=this.imod(o.mul(this.rinv));return d.red=null,d},Q.prototype.imul=function(o,d){if(o.isZero()||d.isZero())return o.words[0]=0,o.length=1,o;var g=o.imul(d),m=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=g.isub(m).iushrn(this.shift),E=w;return w.cmp(this.m)>=0?E=w.isub(this.m):w.cmpn(0)<0&&(E=w.iadd(this.m)),E._forceRed(this)},Q.prototype.mul=function(o,d){if(o.isZero()||d.isZero())return new s(0)._forceRed(this);var g=o.mul(d),m=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=g.isub(m).iushrn(this.shift),E=w;return w.cmp(this.m)>=0?E=w.isub(this.m):w.cmpn(0)<0&&(E=w.iadd(this.m)),E._forceRed(this)},Q.prototype.invm=function(o){var d=this.imod(o._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(t,$)})(Ei);var xn=Ei.exports,Br={},Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.errorValues=Rt.standardErrorCodes=void 0;Rt.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};Rt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var Ln={},Tn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Rt,r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(v,S=r){if(v&&Number.isInteger(v)){const C=v.toString();if(p(e.errorValues,C))return e.errorValues[C].message;if(h(v))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return S}t.getMessageFromCode=n;function i(v){if(!Number.isInteger(v))return!1;const S=v.toString();return!!(e.errorValues[S]||h(v))}t.isValidCode=i;function s(v){var S;if(typeof v=="number")return v;if(a(v))return(S=v.code)!==null&&S!==void 0?S:v.errorCode}t.getErrorCode=s;function a(v){return typeof v=="object"&&v!==null&&(typeof v.code=="number"||typeof v.errorCode=="number")}function c(v,{shouldIncludeStack:S=!1}={}){const C={};if(v&&typeof v=="object"&&!Array.isArray(v)&&p(v,"code")&&i(v.code)){const N=v;C.code=N.code,N.message&&typeof N.message=="string"?(C.message=N.message,p(N,"data")&&(C.data=N.data)):(C.message=n(C.code),C.data={originalError:u(v)})}else C.code=e.standardErrorCodes.rpc.internal,C.message=f(v,"message")?v.message:r,C.data={originalError:u(v)};return S&&(C.stack=f(v,"stack")?v.stack:void 0),C}t.serialize=c;function h(v){return v>=-32099&&v<=-32e3}function u(v){return v&&typeof v=="object"&&!Array.isArray(v)?Object.assign({},v):v}function p(v,S){return Object.prototype.hasOwnProperty.call(v,S)}function f(v,S){return typeof v=="object"&&v!==null&&S in v&&typeof v[S]=="string"}})(Tn);Object.defineProperty(Ln,"__esModule",{value:!0});Ln.standardErrors=void 0;const qe=Rt,ec=Tn;Ln.standardErrors={rpc:{parse:t=>it(qe.standardErrorCodes.rpc.parse,t),invalidRequest:t=>it(qe.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>it(qe.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>it(qe.standardErrorCodes.rpc.methodNotFound,t),internal:t=>it(qe.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return it(e,t)},invalidInput:t=>it(qe.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>it(qe.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>it(qe.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>it(qe.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>it(qe.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>it(qe.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Xt(qe.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>Xt(qe.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>Xt(qe.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>Xt(qe.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>Xt(qe.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>Xt(qe.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new nc(e,r,n)}}};function it(t,e){const[r,n]=tc(e);return new rc(t,r||(0,ec.getMessageFromCode)(t),n)}function Xt(t,e){const[r,n]=tc(e);return new nc(t,r||(0,ec.getMessageFromCode)(t),n)}function tc(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}let rc=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}},nc=class extends rc{constructor(e,r,n){if(!wu(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};function wu(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}var Pn={},vr={};Object.defineProperty(vr,"__esModule",{value:!0});vr.isErrorResponse=void 0;function bu(t){return t.errorMessage!==void 0}vr.isErrorResponse=bu;var yr={};Object.defineProperty(yr,"__esModule",{value:!0});yr.LIB_VERSION=void 0;yr.LIB_VERSION="3.9.3";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.serializeError=void 0;const Eu=vr,Su=yr,ku=Rt,Cu=Tn;function Mu(t,e){const r=(0,Cu.serialize)(Ru(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Su.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Iu(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Pn.serializeError=Mu;function Ru(t){return typeof t=="string"?{message:t,code:ku.standardErrorCodes.rpc.internal}:(0,Eu.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function Iu(t,e){const r=t==null?void 0:t.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=t.serializeError=t.getMessageFromCode=t.getErrorCode=void 0;const e=Rt;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});const r=Ln;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Pn;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Tn;Object.defineProperty(t,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Br);var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.ProviderType=Ve.RegExpString=Ve.IntNumber=Ve.BigIntString=Ve.AddressString=Ve.HexString=Ve.OpaqueType=void 0;function Fr(){return t=>t}Ve.OpaqueType=Fr;Ve.HexString=Fr();Ve.AddressString=Fr();Ve.BigIntString=Fr();function Au(t){return Math.floor(t)}Ve.IntNumber=Au;Ve.RegExpString=Fr();var No;(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(No||(Ve.ProviderType=No={}));var Nu=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(T,"__esModule",{value:!0});T.isMobileWeb=T.getLocation=T.isInIFrame=T.createQrUrl=T.getFavicon=T.range=T.isBigNumber=T.ensureParsedJSONObject=T.ensureBN=T.ensureRegExpString=T.ensureIntNumber=T.ensureBuffer=T.ensureAddressString=T.ensureEvenLengthHexString=T.ensureHexString=T.isHexString=T.prepend0x=T.strip0x=T.has0xPrefix=T.hexStringFromIntNumber=T.intNumberFromHexString=T.bigIntStringFromBN=T.hexStringFromBuffer=T.hexStringToUint8Array=T.uint8ArrayToHex=T.randomBytesHex=void 0;const xt=Nu(xn),Gt=Br,lt=Ve,sc=/^[0-9]*$/,ic=/^[a-f0-9]*$/;function xu(t){return oc(crypto.getRandomValues(new Uint8Array(t)))}T.randomBytesHex=xu;function oc(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}T.uint8ArrayToHex=oc;function Lu(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}T.hexStringToUint8Array=Lu;function Tu(t,e=!1){const r=t.toString("hex");return(0,lt.HexString)(e?`0x${r}`:r)}T.hexStringFromBuffer=Tu;function Pu(t){return(0,lt.BigIntString)(t.toString(10))}T.bigIntStringFromBN=Pu;function Ou(t){return(0,lt.IntNumber)(new xt.default(Dr(t,!1),16).toNumber())}T.intNumberFromHexString=Ou;function $u(t){return(0,lt.HexString)(`0x${new xt.default(t).toString(16)}`)}T.hexStringFromIntNumber=$u;function Si(t){return t.startsWith("0x")||t.startsWith("0X")}T.has0xPrefix=Si;function On(t){return Si(t)?t.slice(2):t}T.strip0x=On;function ac(t){return Si(t)?`0x${t.slice(2)}`:`0x${t}`}T.prepend0x=ac;function jr(t){if(typeof t!="string")return!1;const e=On(t).toLowerCase();return ic.test(e)}T.isHexString=jr;function cc(t,e=!1){if(typeof t=="string"){const r=On(t).toLowerCase();if(ic.test(r))return(0,lt.HexString)(e?`0x${r}`:r)}throw Gt.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}T.ensureHexString=cc;function Dr(t,e=!1){let r=cc(t,!1);return r.length%2===1&&(r=(0,lt.HexString)(`0${r}`)),e?(0,lt.HexString)(`0x${r}`):r}T.ensureEvenLengthHexString=Dr;function Bu(t){if(typeof t=="string"){const e=On(t).toLowerCase();if(jr(e)&&e.length===40)return(0,lt.AddressString)(ac(e))}throw Gt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}T.ensureAddressString=Bu;function Fu(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(jr(t)){const e=Dr(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw Gt.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}T.ensureBuffer=Fu;function lc(t){if(typeof t=="number"&&Number.isInteger(t))return(0,lt.IntNumber)(t);if(typeof t=="string"){if(sc.test(t))return(0,lt.IntNumber)(Number(t));if(jr(t))return(0,lt.IntNumber)(new xt.default(Dr(t,!1),16).toNumber())}throw Gt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}T.ensureIntNumber=lc;function ju(t){if(t instanceof RegExp)return(0,lt.RegExpString)(t.toString());throw Gt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}T.ensureRegExpString=ju;function Du(t){if(t!==null&&(xt.default.isBN(t)||uc(t)))return new xt.default(t.toString(10),10);if(typeof t=="number")return new xt.default(lc(t));if(typeof t=="string"){if(sc.test(t))return new xt.default(t,10);if(jr(t))return new xt.default(Dr(t,!1),16)}throw Gt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}T.ensureBN=Du;function Hu(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Gt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}T.ensureParsedJSONObject=Hu;function uc(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}T.isBigNumber=uc;function Uu(t,e){return Array.from({length:e-t},(r,n)=>t+n)}T.range=Uu;function Vu(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}T.getFavicon=Vu;function Wu(t,e,r,n,i,s){const a=n?"parent-id":"id",c=new URLSearchParams({[a]:t,secret:e,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${c}`}T.createQrUrl=Wu;function dc(){try{return window.frameElement!==null}catch{return!1}}T.isInIFrame=dc;function zu(){try{return dc()&&window.top?window.top.location:window.location}catch{return window.location}}T.getLocation=zu;function qu(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}T.isMobileWeb=qu;var $n={};Object.defineProperty($n,"__esModule",{value:!0});$n.ScopedLocalStorage=void 0;class Ju{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}$n.ScopedLocalStorage=Ju;var ur={},hc={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(h,u,p){this.fn=h,this.context=u,this.once=p||!1}function s(h,u,p,f,v){if(typeof p!="function")throw new TypeError("The listener must be a function");var S=new i(p,f||h,v),C=r?r+u:u;return h._events[C]?h._events[C].fn?h._events[C]=[h._events[C],S]:h._events[C].push(S):(h._events[C]=S,h._eventsCount++),h}function a(h,u){--h._eventsCount===0?h._events=new n:delete h._events[u]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var u=[],p,f;if(this._eventsCount===0)return u;for(f in p=this._events)e.call(p,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(p)):u},c.prototype.listeners=function(u){var p=r?r+u:u,f=this._events[p];if(!f)return[];if(f.fn)return[f.fn];for(var v=0,S=f.length,C=new Array(S);vn.json()).then(n=>{if(!n)throw xo.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,xo.serializeError)(s,e.method);return i})}}ct.RelayAbstract=Zu;var br={};Object.defineProperty(br,"__esModule",{value:!0});br.Session=void 0;const Lo=_u,To=T,Po="session:id",Oo="session:secret",$o="session:linked";class ki{constructor(e,r,n,i){this._storage=e,this._id=r||(0,To.randomBytesHex)(16),this._secret=n||(0,To.randomBytesHex)(32),this._key=new Lo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(Po),n=e.getItem($o),i=e.getItem(Oo);return r&&i?new ki(e,r,i,n==="1"):null}static hash(e){return new Lo.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(Po,this._id),this._storage.setItem(Oo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem($o,this._linked?"1":"0")}}br.Session=ki;var Bn={},Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Cipher=void 0;const on=T;class Qu{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,on.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(e)),c=16,h=a.slice(a.byteLength-c),u=a.slice(0,a.byteLength-c),p=new Uint8Array(h),f=new Uint8Array(u),v=new Uint8Array([...n,...p,...f]);return(0,on.uint8ArrayToHex)(v)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,on.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,on.hexStringToUint8Array)(e),c=a.slice(0,12),h=a.slice(12,28),u=a.slice(28),p=new Uint8Array([...u,...h]),f={name:"AES-GCM",iv:new Uint8Array(c)};try{const v=await window.crypto.subtle.decrypt(f,s,p),S=new TextDecoder;n(S.decode(v))}catch(v){i(v)}})()})}}Fn.Cipher=Qu;var jn={};Object.defineProperty(jn,"__esModule",{value:!0});jn.WalletLinkHTTP=void 0;class Ku{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(e=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}jn.WalletLinkHTTP=Ku;var dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.WalletLinkWebSocket=dr.ConnectionState=void 0;var ir;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(ir||(dr.ConnectionState=ir={}));class Xu{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,ir.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,ir.DISCONNECTED)},i.onopen=s=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,ir.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},i.onmessage=s=>{var a,c;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(s.data);(c=this.incomingDataListener)===null||c===void 0||c.call(this,h)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,ir.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}dr.WalletLinkWebSocket=Xu;Object.defineProperty(Bn,"__esModule",{value:!0});Bn.WalletLinkConnection=void 0;const Yt=Ve,Yu=Fn,gt=wr,Bo=ct,er=br,ed=jn,an=dr,Fo=1e4,td=6e4;class rd{constructor({session:e,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Yt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",u=>c.JsonRpcUrl&&this.handleChainUpdated(u,c.JsonRpcUrl)]]).forEach((u,p)=>{const f=c[p];f!==void 0&&u(f)})},this.handleDestroyed=c=>{var h,u;c==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(u=this.diagnostic)===null||u===void 0||u.log(gt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:er.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var h,u;try{const p=await this.cipher.decrypt(c);(h=this.listener)===null||h===void 0||h.accountUpdated(p)}catch{(u=this.diagnostic)===null||u===void 0||u.log(gt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,h)=>{var u,p;try{const f=await this.cipher.decrypt(h);(u=this.listener)===null||u===void 0||u.metadataUpdated(c,f)}catch{(p=this.diagnostic)===null||p===void 0||p.log(gt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(Bo.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(Bo.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,h)=>{var u,p;try{const f=await this.cipher.decrypt(c),v=await this.cipher.decrypt(h);(u=this.listener)===null||u===void 0||u.chainUpdated(f,v)}catch{(p=this.diagnostic)===null||p===void 0||p.log(gt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=e,this.cipher=new Yu.Cipher(e.secret),this.diagnostic=i,this.listener=n;const a=new an.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async c=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(gt.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:er.Session.hash(e.id)});let u=!1;switch(c){case an.ConnectionState.DISCONNECTED:if(!this.destroyed){const p=async()=>{await new Promise(f=>setTimeout(f,5e3)),this.destroyed||a.connect().catch(()=>{p()})};p()}break;case an.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),u=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Fo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case an.ConnectionState.CONNECTING:break}this.connected!==u&&(this.connected=u)}),a.setIncomingDataListener(c=>{var h,u,p;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const f=c.type==="IsLinkedOK"?c.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(gt.EVENTS.LINKED,{sessionIdHash:er.Session.hash(e.id),linked:f,type:c.type,onlineGuests:c.onlineGuests}),this.linked=f||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(u=this.diagnostic)===null||u===void 0||u.log(gt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:er.Session.hash(e.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((p=this.requestResolutions.get(c.id))===null||p===void 0||p(c))}),this.ws=a,this.http=new ed.WalletLinkHTTP(r,e.id,e.key)}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(gt.EVENTS.STARTED_CONNECTING,{sessionIdHash:er.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(gt.EVENTS.DISCONNECTED,{sessionIdHash:er.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r,n;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(e)}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r,n;if(!(e.type!=="Event"||e.event!=="Web3Response"))try{const i=await this.cipher.decrypt(e.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(gt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){const n={type:"SetSessionConfig",id:(0,Yt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Yt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Fo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=td){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,Yt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const e={type:"IsLinked",id:(0,Yt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,Yt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}Bn.WalletLinkConnection=rd;var Vr={},Wr={},Ci={};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var nd=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.injectCssReset=void 0;const sd=nd(Ci);function id(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(sd.default)),document.documentElement.appendChild(t)}Wr.injectCssReset=id;var Dn={},zr,X,fc,pc,jt,jo,gc,ci,Mi,li,ui,mc,Tr={},_c=[],od=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Hn=Array.isArray;function Mt(t,e){for(var r in e)t[r]=e[r];return t}function vc(t){var e=t.parentNode;e&&e.removeChild(t)}function di(t,e,r){var n,i,s,a={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?zr.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)a[s]===void 0&&(a[s]=t.defaultProps[s]);return Ar(t,a,n,i,null)}function Ar(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++fc,__i:-1,__u:0};return i==null&&X.vnode!=null&&X.vnode(s),s}function ad(){return{current:null}}function qr(t){return t.children}function Nr(t,e){this.props=t,this.context=e}function zt(t,e){if(e==null)return t.__?zt(t.__,t.__i+1):null;for(var r;ee&&jt.sort(ci));Sn.__r=0}function wc(t,e,r,n,i,s,a,c,h,u,p){var f,v,S,C,N,M=n&&n.__k||_c,A=e.length;for(r.__d=h,cd(r,e,M),h=r.__d,f=0;f0?Ar(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,c=ld(i,r,a,p),i.__i=c,s=null,c!==-1&&(p--,(s=r[c])&&(s.__u|=131072)),s==null||s.__v===null?(c==-1&&f--,typeof i.type!="function"&&(i.__u|=65536)):c!==a&&(c===a+1?f++:c>a?p>h-a?f+=c-a:f--:c(h!=null&&!(131072&h.__u)?1:0))for(;a>=0||c=0){if((h=e[a])&&!(131072&h.__u)&&i==h.key&&s===h.type)return a;a--}if(c2&&(c.children=arguments.length>3?zr.call(arguments,2):r),Ar(t.type,c,n||t.key,i||t.ref,null)}function fd(t,e){var r={__c:e="__cC"+mc++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(c){c.__e=!0,hi(c)})},this.sub=function(a){i.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),c&&c.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}zr=_c.slice,X={__e:function(t,e,r,n){for(var i,s,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),a=i.__d),a)return i.__E=i}catch(c){t=c}throw t}},fc=0,pc=function(t){return t!=null&&t.constructor==null},Nr.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Mt({},this.state),typeof t=="function"&&(t=t(Mt({},r),this.props)),t&&Mt(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),hi(this))},Nr.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),hi(this))},Nr.prototype.render=qr,jt=[],gc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ci=function(t,e){return t.__v.__b-e.__v.__b},Sn.__r=0,Mi=0,li=Ho(!1),ui=Ho(!0),mc=0;const pd=Object.freeze(Object.defineProperty({__proto__:null,Component:Nr,Fragment:qr,cloneElement:hd,createContext:fd,createElement:di,createRef:ad,h:di,hydrate:Cc,get isValidElement(){return pc},get options(){return X},render:kc,toChildArray:Ec},Symbol.toStringTag,{value:"Module"})),et=In(pd);var Un={},It,Z,Hs,Uo,hr=0,Mc=[],wn=[],ne=X,Vo=ne.__b,Wo=ne.__r,zo=ne.diffed,qo=ne.__c,Jo=ne.unmount,Go=ne.__;function Zt(t,e){ne.__h&&ne.__h(Z,t,hr||e),hr=0;var r=Z.__H||(Z.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:wn}),r.__[t]}function Rc(t){return hr=1,Ic(Nc,t)}function Ic(t,e,r){var n=Zt(It++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):Nc(void 0,e),function(c){var h=n.__N?n.__N[0]:n.__[0],u=n.t(h,c);h!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=Z,!Z.u)){var i=function(c,h,u){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(v){return!!v.__c});if(p.every(function(v){return!v.__N}))return!s||s.call(this,c,h,u);var f=!1;return p.forEach(function(v){if(v.__N){var S=v.__[0];v.__=v.__N,v.__N=void 0,S!==v.__[0]&&(f=!0)}}),!(!f&&n.__c.props===c)&&(!s||s.call(this,c,h,u))};Z.u=!0;var s=Z.shouldComponentUpdate,a=Z.componentWillUpdate;Z.componentWillUpdate=function(c,h,u){if(this.__e){var p=s;s=void 0,i(c,h,u),s=p}a&&a.call(this,c,h,u)},Z.shouldComponentUpdate=i}return n.__N||n.__}function gd(t,e){var r=Zt(It++,3);!ne.__s&&Ni(r.__H,e)&&(r.__=t,r.i=e,Z.__H.__h.push(r))}function Ac(t,e){var r=Zt(It++,4);!ne.__s&&Ni(r.__H,e)&&(r.__=t,r.i=e,Z.__h.push(r))}function md(t){return hr=5,Ai(function(){return{current:t}},[])}function _d(t,e,r){hr=6,Ac(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function Ai(t,e){var r=Zt(It++,7);return Ni(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function vd(t,e){return hr=8,Ai(function(){return t},e)}function yd(t){var e=Z.context[t.__c],r=Zt(It++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(Z)),e.props.value):t.__}function wd(t,e){ne.useDebugValue&&ne.useDebugValue(e?e(t):t)}function bd(t){var e=Zt(It++,10),r=Rc();return e.__=t,Z.componentDidCatch||(Z.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Ed(){var t=Zt(It++,11);if(!t.__){for(var e=Z.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function Sd(){for(var t;t=Mc.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(bn),t.__H.__h.forEach(pi),t.__H.__h=[]}catch(e){t.__H.__h=[],ne.__e(e,t.__v)}}ne.__b=function(t){Z=null,Vo&&Vo(t)},ne.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Go&&Go(t,e)},ne.__r=function(t){Wo&&Wo(t),It=0;var e=(Z=t.__c).__H;e&&(Hs===Z?(e.__h=[],Z.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=wn,r.__N=r.i=void 0})):(e.__h.forEach(bn),e.__h.forEach(pi),e.__h=[],It=0)),Hs=Z},ne.diffed=function(t){zo&&zo(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Mc.push(e)!==1&&Uo===ne.requestAnimationFrame||((Uo=ne.requestAnimationFrame)||kd)(Sd)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==wn&&(r.__=r.__V),r.i=void 0,r.__V=wn})),Hs=Z=null},ne.__c=function(t,e){e.some(function(r){try{r.__h.forEach(bn),r.__h=r.__h.filter(function(n){return!n.__||pi(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],ne.__e(n,r.__v)}}),qo&&qo(t,e)},ne.unmount=function(t){Jo&&Jo(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{bn(n)}catch(i){e=i}}),r.__H=void 0,e&&ne.__e(e,r.__v))};var Zo=typeof requestAnimationFrame=="function";function kd(t){var e,r=function(){clearTimeout(n),Zo&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);Zo&&(e=requestAnimationFrame(r))}function bn(t){var e=Z,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Z=e}function pi(t){var e=Z;t.__c=t.__(),Z=e}function Ni(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function Nc(t,e){return typeof e=="function"?e(t):e}const Cd=Object.freeze(Object.defineProperty({__proto__:null,useCallback:vd,useContext:yd,useDebugValue:wd,useEffect:gd,useErrorBoundary:bd,useId:Ed,useImperativeHandle:_d,useLayoutEffect:Ac,useMemo:Ai,useReducer:Ic,useRef:md,useState:Rc},Symbol.toStringTag,{value:"Module"})),Vn=In(Cd);var fr={},Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.CloseIcon=void 0;const Qo=et;function Md(t){return(0,Qo.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,Qo.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}Wn.CloseIcon=Md;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.CoinbaseWalletRound=void 0;const ln=et;function Rd(t){return(0,ln.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,ln.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,ln.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,ln.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}zn.CoinbaseWalletRound=Rd;var qn={};Object.defineProperty(qn,"__esModule",{value:!0});qn.QRCodeIcon=void 0;const Cr=et;function Id(t){return(0,Cr.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),(0,Cr.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Cr.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Cr.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Cr.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}qn.QRCodeIcon=Id;var Jn={};function xc(t){this.mode=nt.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}xc.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=bt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=re.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=re.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[n][a-c]==null){var h=!1;s>>i&1)==1);var u=re.getMask(e,n,a-c);u&&(h=!h),this.modules[n][a-c]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};bt.PAD0=236;bt.PAD1=17;bt.createData=function(t,e,r){for(var n=wt.getRSBlocks(t,e),i=new Lc,s=0;sc*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+c*8+")");for(i.getLengthInBits()+4<=c*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=c*8||(i.put(bt.PAD0,8),i.getLengthInBits()>=c*8));)i.put(bt.PAD1,8);return bt.createBytes(i,n)};bt.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),a=new Array(e.length),c=0;c=0?S.get(C):0}}for(var N=0,p=0;p=0;)e^=re.G15<=0;)e^=re.G18<>>=1;return e},getPatternPosition:function(t){return re.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case At.PATTERN000:return(e+r)%2==0;case At.PATTERN001:return e%2==0;case At.PATTERN010:return r%3==0;case At.PATTERN011:return(e+r)%3==0;case At.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case At.PATTERN101:return e*r%2+e*r%3==0;case At.PATTERN110:return(e*r%2+e*r%3)%2==0;case At.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new or([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)t-=255;return ze.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Je=0;Je<8;Je++)ze.EXP_TABLE[Je]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Us=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Tc(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Lt.L;case"M":return Lt.M;case"Q":return Lt.Q;case"H":return Lt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,u){for(var p=i(h),f=1,v=0,S=0,C=Us.length;S<=C;S++){var N=Us[S];if(!N)throw new Error("Content too long: expected "+v+" but got "+p);switch(u){case"L":v=N[0];break;case"M":v=N[1];break;case"Q":v=N[2];break;case"H":v=N[3];break;default:throw new Error("Unknwon error correction level: "+u)}if(p<=v)break;f++}if(f>Us.length)throw new Error("Content too long");return f}function i(h){var u=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return u.length+(u.length!=h?3:0)}var s=this.options.content,a=n(s,this.options.ecl),c=r(this.options.ecl);this.qrcode=new bt(a,c),this.qrcode.addData(s),this.qrcode.make()}Tc.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r
+`:"",a=e.width,c=e.height,h=r.length,u=a/(h+2*e.padding),p=c/(h+2*e.padding),f=typeof e.join<"u"?!!e.join:!1,v=typeof e.swap<"u"?!!e.swap:!1,S=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,C=typeof e.predefined<"u"?!!e.predefined:!1,N=C?i+''+s:"",M=i+''+s,A="",I="",R=0;R'+s:A+=i+''+s}}f&&(A=i+'');let U="";if(this.options.image!==void 0&&this.options.image.svg){const y=a*this.options.image.width/100,o=c*this.options.image.height/100,d=a/2-y/2,g=c/2-o/2;U+=`"}var Q="";switch(t.container){case"svg":S&&(Q+=''+s),Q+='";break;case"svg-viewbox":S&&(Q+=''+s),Q+='";break;case"g":Q+=''+s,Q+=N+M+A,Q+=U,Q+="";break;default:Q+=(N+M+A+U).replace(/^\s+/,"");break}return Q};var Ad=Tc,Nd=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.QRCode=void 0;const xd=et,Ko=Vn,Ld=Nd(Ad),Td=t=>{const[e,r]=(0,Ko.useState)("");return(0,Ko.useEffect)(()=>{var n,i;const s=new Ld.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),a=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)},[t.bgColor,t.content,t.fgColor,t.height,t.image,t.width]),e?(0,xd.h)("img",{src:e,alt:"QR Code"}):null};Jn.QRCode=Td;var Gn={},xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var Pd=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.Spinner=void 0;const un=et,Od=Pd(xi),$d=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,un.h)("div",{class:"-cbwsdk-spinner"},(0,un.h)("style",null,Od.default),(0,un.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,un.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Gn.Spinner=$d;var Li={};Object.defineProperty(Li,"__esModule",{value:!0});Li.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var Pc=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fr,"__esModule",{value:!0});fr.CoinbaseWalletSteps=fr.ConnectContent=void 0;const Wt=Pc($r),W=et,Bd=T,Fd=yr,jd=Wn,Dd=zn,Hd=qn,Ud=Jn,Vd=Gn,Wd=Pc(Li),Vs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Oc},zd=t=>t==="light"?"#FFFFFF":"#0A0B0D";function qd(t){const{theme:e}=t,r=(0,Bd.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),n=Vs.steps;return(0,W.h)("div",{"data-testid":"connect-content",className:(0,Wt.default)("-cbwsdk-connect-content",e)},(0,W.h)("style",null,Wd.default),(0,W.h)("div",{className:"-cbwsdk-connect-content-header"},(0,W.h)("h2",{className:(0,Wt.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with our mobile app"),t.onCancel&&(0,W.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,W.h)(jd.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,W.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,W.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,W.h)(Jd,{title:Vs.title,description:Vs.description,theme:e})),(0,W.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,W.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,W.h)(Ud.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,W.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Fd.LIB_VERSION}),(0,W.h)("input",{type:"hidden",value:r})),(0,W.h)(n,{theme:e}),!t.isConnected&&(0,W.h)("div",{"data-testid":"connecting-spinner",className:(0,Wt.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,W.h)(Vd.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,W.h)("p",null,"Connecting...")))))}fr.ConnectContent=qd;function Jd({title:t,description:e,theme:r}){return(0,W.h)("div",{className:(0,Wt.default)("-cbwsdk-connect-item",r)},(0,W.h)("div",null,(0,W.h)(Dd.CoinbaseWalletRound,null)),(0,W.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,W.h)("h3",{className:"-cbwsdk-connect-item-title"},t),(0,W.h)("p",{className:"-cbwsdk-connect-item-description"},e)))}function Oc({theme:t}){return(0,W.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,W.h)("li",{className:(0,Wt.default)("-cbwsdk-wallet-steps-item",t)},(0,W.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,W.h)("li",{className:(0,Wt.default)("-cbwsdk-wallet-steps-item",t)},(0,W.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,W.h)("span",null,"Tap ",(0,W.h)("strong",null,"Scan")," "),(0,W.h)("span",{className:(0,Wt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,W.h)(Hd.QRCodeIcon,{fill:zd(t)})))))}fr.CoinbaseWalletSteps=Oc;var Zn={},Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.ArrowLeftIcon=void 0;const Xo=et;function Gd(t){return(0,Xo.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,Xo.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Qn.ArrowLeftIcon=Gd;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.LaptopIcon=void 0;const Ws=et;function Zd(t){return(0,Ws.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ws.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ws.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Kn.LaptopIcon=Zd;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.SafeIcon=void 0;const Yo=et;function Qd(t){return(0,Yo.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Yo.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Xn.SafeIcon=Qd;var Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var $c=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.TryExtensionContent=void 0;const Ot=$c($r),Ue=et,zs=Vn,Kd=Qn,Xd=Kn,Yd=Xn,eh=$c(Ti);function th({theme:t}){const[e,r]=(0,zs.useState)(!1),n=(0,zs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,zs.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,Ue.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension",t)},(0,Ue.h)("style",null,eh.default),(0,Ue.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ue.h)("h3",{class:(0,Ot.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,Ue.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Ue.h)("button",{class:(0,Ot.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,Ue.h)("div",null,!e&&(0,Ue.h)(Kd.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,Ue.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ue.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Ue.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ue.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ue.h)("span",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Ue.h)(Xd.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ue.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,Ue.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ue.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ue.h)("span",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Ue.h)(Yd.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ue.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Zn.TryExtensionContent=th;var Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Bc=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Un,"__esModule",{value:!0});Un.ConnectDialog=void 0;const qs=Bc($r),$t=et,Js=Vn,rh=fr,nh=Zn,sh=Bc(Pi),ih=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,Js.useState)(!e),[s,a]=(0,Js.useState)(!e);(0,Js.useEffect)(()=>{const h=[window.setTimeout(()=>{a(!e)},10)];return e?i(!1):h.push(window.setTimeout(()=>{i(!0)},360)),()=>{h.forEach(window.clearTimeout)}},[e]);const c=r?"dark":"light";return(0,$t.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,$t.h)("style",null,sh.default),(0,$t.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-backdrop",c,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,$t.h)("div",{class:"-cbwsdk-connect-dialog"},(0,$t.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,$t.h)(rh.ConnectContent,{theme:c,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,$t.h)(nh.TryExtensionContent,{theme:c}))))};Un.ConnectDialog=ih;Object.defineProperty(Dn,"__esModule",{value:!0});Dn.LinkFlow=void 0;const Gs=et,oh=Un;class ah{constructor(e){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render()}setConnected(e){this.connected!==e&&(this.connected=e,this.render())}setChainId(e){this.chainId!==e&&(this.chainId=e,this.render())}detach(){var e;this.root&&((0,Gs.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Gs.render)((0,Gs.h)(oh.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}Dn.LinkFlow=ah;var Oi={},$i={};Object.defineProperty($i,"__esModule",{value:!0});$i.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=$&&$.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e($r),n=et,i=Vn,s=e($i),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{constructor(v){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=v.darkMode}attach(v){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",v.appendChild(this.root),this.render()}presentItem(v){const S=this.nextItemKey++;return this.items.set(S,v),this.render(),()=>{this.items.delete(S),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([v,S])=>(0,n.h)(t.SnackbarInstance,Object.assign({},S,{key:v}))))),this.root)}}t.Snackbar=h;const u=f=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},f.children));t.SnackbarContainer=u;const p=({autoExpand:f,message:v,menuItems:S})=>{const[C,N]=(0,i.useState)(!0),[M,A]=(0,i.useState)(f??!1);(0,i.useEffect)(()=>{const R=[window.setTimeout(()=>{N(!1)},1),window.setTimeout(()=>{A(!0)},1e4)];return()=>{R.forEach(window.clearTimeout)}});const I=()=>{A(!M)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",C&&"-cbwsdk-snackbar-instance-hidden",M&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:I},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},v),(0,n.h)("div",{class:"-gear-container"},!M&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),S&&S.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},S.map((R,j)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",R.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:R.onClick,key:j},(0,n.h)("svg",{width:R.svgWidth,height:R.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":R.defaultFillRule,"clip-rule":R.defaultClipRule,d:R.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",R.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},R.info)))))};t.SnackbarInstance=p})(Oi);Object.defineProperty(Vr,"__esModule",{value:!0});Vr.WalletLinkRelayUI=void 0;const ch=Wr,lh=Dn,uh=Oi;class dh{constructor(e){this.standalone=null,this.attached=!1,this.snackbar=new uh.Snackbar({darkMode:e.darkMode}),this.linkFlow=new lh.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,ch.injectCssReset)()}setConnected(e){this.linkFlow.setConnected(e)}setChainId(e){this.linkFlow.setChainId(e)}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Vr.WalletLinkRelayUI=dh;Object.defineProperty(Ur,"__esModule",{value:!0});Ur.WalletLinkRelay=void 0;const tr=Br,hh=Ve,te=T,Bt=wr,ea=ct,Nt=br,fh=Bn,Ft=vr,ph=Vr;class Ct extends ea.RelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{var c;this.isLinked=a;const h=this.storage.getItem(ea.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,h){const u=h.split(" "),p=this.storage.getItem("IsStandaloneSigning")==="true";if(u[0]!==""&&!a&&this.session.linked&&!p){this.isUnlinkedErrorState=!0;const f=this.getSessionIdHash();(c=this.diagnostic)===null||c===void 0||c.log(Bt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:f})}}},this.metadataUpdated=(a,c)=>{this.storage.setItem(a,c)},this.chainUpdated=(a,c)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===c||(this.chainCallbackParams={chainId:a,jsonRpcUrl:c},this.chainCallback&&this.chainCallback(a,c))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),Ct.accountRequestCallbackIds.size>0&&(Array.from(Ct.accountRequestCallbackIds.values()).forEach(c=>{const h={type:"WEB3_RESPONSE",id:c,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},h),{id:c}))}),Ct.accountRequestCallbackIds.clear())},this.connectedUpdated=a=>{this.ui.setConnected(a)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const e=Nt.Session.load(this.storage)||new Nt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new fh.WalletLinkConnection({session:e,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:a}=this.options,c=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:a,session:e});return i.connect(),{session:e,ui:c,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{var e,r;const n=this.ui.isStandalone();(e=this.diagnostic)===null||e===void 0||e.log(Bt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Nt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(Bt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Nt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:a,connection:c}=this.subscribe();this._session=s,this.connection=c,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Bt.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,te.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,te.hexStringFromBuffer)(e,!0),signature:(0,te.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,te.bigIntStringFromBN)(e.weiValue),data:(0,te.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,te.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,te.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,te.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,te.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,te.bigIntStringFromBN)(e.weiValue),data:(0,te.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,te.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,te.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,te.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,te.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,te.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getQRCodeUrl(){return(0,te.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,te.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,a),r==null||r()};return{promise:new Promise((a,c)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,h=>{if(r==null||r(),(0,Ft.isErrorResponse)(h))return c(new Error(h.errorMessage));a(h)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e,this.ui instanceof ph.WalletLinkRelayUI&&this.ui.setChainId(e)}publishWeb3RequestEvent(e,r){var n;const i={type:"WEB3_REQUEST",id:e,request:r},s=Nt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Bt.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Nt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(Bt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Nt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:a.message}})})}publishWeb3RequestCanceledEvent(e){const r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(Bt.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Ct.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Ct.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const a=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,tr.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:a,errorCode:i}})}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,te.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(r,c=>{if(this.ui.hideRequestEthereumAccounts(),(0,Ft.isErrorResponse)(c))return a(new Error(c.errorMessage));s(c)}),this.ui.inlineAccountsResponse()){const c=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:h}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:c})}else{const c=tr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(c)})}Ct.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:"selectProvider",params:{providerOptions:e}},n=(0,te.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},s=new Promise((a,c)=>{this.relayEventManager.callbacks.set(n,p=>{if((0,Ft.isErrorResponse)(p))return c(new Error(p.errorMessage));a(p)});const h=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:hh.ProviderType.Unselected}})},u=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:p}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:h,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,a){const c={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let h=null;const u=(0,te.randomBytesHex)(8),p=v=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,c.method,v),h==null||h()};this.ui.inlineWatchAsset()||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const f=new Promise((v,S)=>{this.relayEventManager.callbacks.set(u,M=>{if(h==null||h(),(0,Ft.isErrorResponse)(M))return S(new Error(M.errorMessage));v(M)});const C=M=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!1}})},N=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:N,onCancel:C,type:e,address:r,symbol:n,decimals:i,image:s,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,c)});return{cancel:p,promise:f}}addEthereumChain(e,r,n,i,s,a){const c={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let h=null;const u=(0,te.randomBytesHex)(8),p=v=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,c.method,v),h==null||h()};return this.ui.inlineAddEthereumChain(e)||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((v,S)=>{this.relayEventManager.callbacks.set(u,M=>{if(h==null||h(),(0,Ft.isErrorResponse)(M))return S(new Error(M.errorMessage));v(M)});const C=M=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},N=M=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:M}}})};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:C,onApprove:N,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,c)}),cancel:p}}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,te.randomBytesHex)(8),s=c=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,c)};return{promise:new Promise((c,h)=>{this.relayEventManager.callbacks.set(i,f=>{if((0,Ft.isErrorResponse)(f)&&f.errorCode)return h(tr.standardErrors.provider.custom({code:f.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,Ft.isErrorResponse)(f))return h(new Error(f.errorMessage));c(f)});const u=f=>{var v;if(f){const S=(v=(0,tr.getErrorCode)(f))!==null&&v!==void 0?v:tr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",f instanceof Error?f:tr.standardErrors.provider.unsupportedChain(e),S)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:f}}})};this.ui.switchEthereumChain({onCancel:u,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Nt.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Ur.WalletLinkRelay=Ct;Ct.accountRequestCallbackIds=new Set;var Jr={},Yn={},Fc={};(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Oi,t)})(Fc);var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var jc=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.RedirectDialog=void 0;const gh=jc($r),yt=et,mh=Wr,_h=Fc,vh=jc(Bi);class yh{constructor(){this.root=null}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,mh.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,yt.render)(null,this.root),e&&(0,yt.render)((0,yt.h)(wh,Object.assign({},e,{onDismiss:()=>{this.clear()}})),this.root))}}Yn.RedirectDialog=yh;const wh=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,yt.h)(_h.SnackbarContainer,{darkMode:r},(0,yt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,yt.h)("style",null,vh.default),(0,yt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,yt.h)("div",{class:(0,gh.default)("-cbwsdk-redirect-dialog-box",s)},(0,yt.h)("p",null,t),(0,yt.h)("button",{onClick:n},e))))};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.MobileRelayUI=void 0;const bh=Yn;class Eh{constructor(e){this.attached=!1,this.darkMode=!1,this.redirectDialog=new bh.RedirectDialog,this.darkMode=e.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(e){}redirectToCoinbaseWallet(e){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),e&&r.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}Jr.MobileRelayUI=Eh;Object.defineProperty(Hr,"__esModule",{value:!0});Hr.MobileRelay=void 0;const Sh=T,kh=Ur,Ch=Jr;class Mh extends kh.WalletLinkRelay{constructor(e){var r;super(e),this._enableMobileWalletLink=(r=e.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const e=(0,Sh.getLocation)();e.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(e.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(e,r){if(super.publishWeb3RequestEvent(e,r),!(this._enableMobileWalletLink&&this.ui instanceof Ch.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(e){super.handleWeb3ResponseMessage(e)}connectAndSignIn(e){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:e.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:e.statement,resources:e.resources}})}}Hr.MobileRelay=Mh;const Rh=vu,Ih=xn;function Dc(t){return Buffer.allocUnsafe(t).fill(0)}function Hc(t,e,r){const n=Dc(e);return t=es(t),r?t.length"u")throw new Error("Not an array?");if(r=qc(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(vt(t,e[s]));if(r==="dynamic"){var a=vt("uint256",e.length);i.unshift(a)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([vt("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,qt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=ar(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return qt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=ar(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=Dt(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=ar(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=Dt(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=ta(t),n=Dt(e),n<0)throw new Error("Supplied ufixed is negative");return vt("uint256",n.mul(new Ut(2).pow(new Ut(r[1]))))}else if(t.startsWith("fixed"))return r=ta(t),vt("int256",Dt(e).mul(new Ut(2).pow(new Ut(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Th(t){return t==="string"||t==="bytes"||qc(t)==="dynamic"}function Ph(t){return t.lastIndexOf("]")===t.length-1}function Oh(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var a=zc(t[s]),c=e[s],h=vt(a,c);Th(a)?(r.push(vt("uint256",i)),n.push(h),i+=h.length):r.push(h)}return Buffer.concat(r.concat(n))}function Jc(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(qt.setLengthRight(c,r))}else if(a.startsWith("uint")){if(r=ar(a),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=Dt(c),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(a.startsWith("int")){if(r=ar(a),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=Dt(c),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(i)}function $h(t,e){return qt.keccak(Jc(t,e))}var Bh={rawEncode:Oh,solidityPack:Jc,soliditySHA3:$h};const ht=Wc,xr=Bh,Gc={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Zs={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const a=(c,h,u)=>{if(r[h]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":ht.keccak(this.encodeData(h,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${c} of type ${h}`);if(h==="bytes")return["bytes32",ht.keccak(u)];if(h==="string")return typeof u=="string"&&(u=Buffer.from(u,"utf8")),["bytes32",ht.keccak(u)];if(h.lastIndexOf("]")===h.length-1){const p=h.slice(0,h.lastIndexOf("[")),f=u.map(v=>a(c,p,v));return["bytes32",ht.keccak(xr.rawEncode(f.map(([v])=>v),f.map(([,v])=>v)))]}return[h,u]};for(const c of r[t]){const[h,u]=a(c.name,c.type,e[c.name]);i.push(h),s.push(u)}}else for(const a of r[t]){let c=e[a.name];if(c!==void 0)if(a.type==="bytes")i.push("bytes32"),c=ht.keccak(c),s.push(c);else if(a.type==="string")i.push("bytes32"),typeof c=="string"&&(c=Buffer.from(c,"utf8")),c=ht.keccak(c),s.push(c);else if(r[a.type]!==void 0)i.push("bytes32"),c=ht.keccak(this.encodeData(a.type,c,r,n)),s.push(c);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(c)}}return xr.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:a,type:c})=>c+" "+a).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return ht.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return ht.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Gc.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),ht.keccak(Buffer.concat(n))}};var Fh={TYPED_MESSAGE_SCHEMA:Gc,TypedDataUtils:Zs,hashForSignTypedDataLegacy:function(t){return jh(t.data)},hashForSignTypedData_v3:function(t){return Zs.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Zs.hash(t.data)}};function jh(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?ht.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return xr.soliditySHA3(["bytes32","bytes32"],[xr.soliditySHA3(new Array(t.length).fill("string"),i),xr.soliditySHA3(n,r)])}var pr={};Object.defineProperty(pr,"__esModule",{value:!0});pr.filterFromParam=pr.FilterPolyfill=void 0;const sr=Ve,Ke=T,Dh=5*60*1e3,Ht={jsonrpc:"2.0",id:0};class Hh{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,sr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=e}async newFilter(e){const r=Zc(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Ke.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Ke.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Ke.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,Ke.intNumberFromHexString)(e);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,Ke.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(dn())}async getFilterLogs(e){const r=(0,Ke.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_getLogs",params:[ra(n)]})):dn()}makeFilterId(){return(0,sr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.info(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return dn();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return hn();console.info(`Fetching logs from ${n} to ${s} for filter ${e}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_getLogs",params:[ra(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(a.result)){const c=a.result.map(u=>(0,Ke.intNumberFromHexString)(u.blockNumber||"0x0")),h=Math.max(...c);if(h&&h>n){const u=(0,sr.IntNumber)(h+1);console.info(`Moving cursor position for filter (${e}) from ${n} to ${u}`),this.cursors.set(e,u)}}return a}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return dn();const n=await this.getCurrentBlockHeight();if(r>n)return hn();console.info(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,Ke.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,sr.IntNumber)(a))))).filter(a=>!!a),s=(0,sr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Ht),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(hn())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${e}) timed out`),this.deleteFilter(e)},Dh);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const e=new Date;if(e.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=e;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_blockNumber",params:[]}));return(0,Ke.intNumberFromHexString)((0,Ke.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_getBlockByNumber",params:[(0,Ke.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Ke.ensureHexString)(r.result.hash):null}}pr.FilterPolyfill=Hh;function Zc(t){return{fromBlock:na(t.fromBlock),toBlock:na(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}pr.filterFromParam=Zc;function ra(t){const e={fromBlock:sa(t.fromBlock),toBlock:sa(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function na(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,sr.IntNumber)(0);if((0,Ke.isHexString)(t))return(0,Ke.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function sa(t){return t==="latest"?t:(0,Ke.hexStringFromIntNumber)(t)}function dn(){return Object.assign(Object.assign({},Ht),{error:{code:-32e3,message:"filter not found"}})}function hn(){return Object.assign(Object.assign({},Ht),{result:[]})}var ts={},Qc={},rs={},Fi=Uh;function Uh(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const ia=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i{e.errorFirst?n.push(function(a,c){if(e.multiArgs){const h=new Array(arguments.length-1);for(let u=1;u{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=a=>typeof a=="string"?i===a:a.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):ia(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?ia(s,e):s}return n},Gr={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});const Wh=Xa;function oa(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function zh(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([a]=r),a instanceof Error)throw a;const c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")oa(s,this,r);else{const a=s.length,c=zh(s);for(let h=0;ht+e,aa=["sync","latest"];class Kh extends Gh.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*Zh,this._usePastBlocks=e.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){aa.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return aa.map(e=>this.listenerCount(e)).reduce(Qh)}_shouldUseNewBlock(e){const r=this._currentBlock;if(!r)return!0;const n=ca(e),i=ca(r);return this._usePastBlocks&&ni}_newPotentialLatest(e){this._shouldUseNewBlock(e)&&this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Gr.BaseBlockTracker=Kh;function ca(t){return Number.parseInt(t,16)}var Kc={},Xc={},Ge={};class Yc extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...a}=e,{path:c}=e,h=c.length===0?i:`At path: ${c.join(".")} -- ${i}`;super(s??h),s!=null&&(this.cause=h),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function Xh(t){return ut(t)&&typeof t[Symbol.iterator]=="function"}function ut(t){return typeof t=="object"&&t!=null}function la(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function We(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Yh(t){const{done:e,value:r}=t.next();return e?void 0:r}function ef(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:a}=r,{refinement:c,message:h=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${We(n)}\``}=t;return{value:n,type:a,refinement:c,key:i[i.length-1],path:i,branch:s,...t,message:h}}function*gi(t,e,r,n){Xh(t)||(t=[t]);for(const i of t){const s=ef(i,e,r,n);s&&(yield s)}}function*ji(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:a=!1}=r,c={path:n,branch:i};if(s&&(t=e.coercer(t,c),a&&e.type!=="type"&&ut(e.schema)&&ut(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let h="valid";for(const u of e.validator(t,c))u.explanation=r.message,h="not_valid",yield[u,void 0];for(let[u,p,f]of e.entries(t,c)){const v=ji(p,f,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,p],coerce:s,mask:a,message:r.message});for(const S of v)S[0]?(h=S[0].refinement!=null?"not_refined":"not_valid",yield[S[0],void 0]):s&&(p=S[1],u===void 0?t=p:t instanceof Map?t.set(u,p):t instanceof Set?t.add(p):ut(t)&&(p!==void 0||u in t)&&(t[u]=p))}if(h!=="not_valid")for(const u of e.refiner(t,c))u.explanation=r.message,h="not_refined",yield[u,void 0];h==="valid"&&(yield[void 0,t])}class ie{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:a=h=>h,entries:c=function*(){}}=e;this.type=r,this.schema=n,this.entries=c,this.coercer=a,i?this.validator=(h,u)=>{const p=i(h,u);return gi(p,u,this,h)}:this.validator=()=>[],s?this.refiner=(h,u)=>{const p=s(h,u);return gi(p,u,this,h)}:this.refiner=()=>[]}assert(e,r){return el(e,this,r)}create(e,r){return tl(e,this,r)}is(e){return Di(e,this)}mask(e,r){return rl(e,this,r)}validate(e,r={}){return Er(e,this,r)}}function el(t,e,r){const n=Er(t,e,{message:r});if(n[0])throw n[0]}function tl(t,e,r){const n=Er(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function rl(t,e,r){const n=Er(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Di(t,e){return!Er(t,e)[0]}function Er(t,e,r={}){const n=ji(t,e,r),i=Yh(n);return i[0]?[new Yc(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function tf(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Kr(n):Qr(n)}function tt(t,e){return new ie({type:t,schema:null,validator:e})}function rf(t,e){return new ie({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function nf(t){return new ie({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function sf(t){let e;return new ie({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function of(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return Kr(n);default:return Qr(n)}}function af(t){const e=t instanceof ie,r=e?{...t.schema}:{...t};for(const n in r)r[n]=nl(r[n]);return e&&t.type==="type"?Kr(r):Qr(r)}function cf(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];switch(t.type){case"type":return Kr(n);default:return Qr(n)}}function lf(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),tt(t,e)}function uf(){return tt("any",()=>!0)}function df(t){return new ie({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${We(e)}`}})}function hf(){return tt("bigint",t=>typeof t=="bigint")}function ff(){return tt("boolean",t=>typeof t=="boolean")}function pf(){return tt("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${We(t)}`)}function gf(t){const e={},r=t.map(n=>We(n)).join();for(const n of t)e[n]=n;return new ie({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${We(n)}`}})}function mf(){return tt("func",t=>typeof t=="function"||`Expected a function, but received: ${We(t)}`)}function _f(t){return tt("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${We(e)}`)}function vf(){return tt("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${We(t)}`)}function yf(t){return new ie({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function wf(t){const e=We(t),r=typeof t;return new ie({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${We(n)}`}})}function bf(t,e){return new ie({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${We(r)}`}})}function Hi(){return tt("never",()=>!1)}function Ef(t){return new ie({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function Sf(){return tt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${We(t)}`)}function Qr(t){const e=t?Object.keys(t):[],r=Hi();return new ie({type:"object",schema:t||null,*entries(n){if(t&&ut(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return ut(n)||`Expected an object, but received: ${We(n)}`},coercer(n){return ut(n)?{...n}:n}})}function nl(t){return new ie({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function kf(t,e){return new ie({type:"record",schema:null,*entries(r){if(ut(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return ut(r)||`Expected an object, but received: ${We(r)}`}})}function Cf(){return tt("regexp",t=>t instanceof RegExp)}function Mf(t){return new ie({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${We(e)}`}})}function sl(){return tt("string",t=>typeof t=="string"||`Expected a string, but received: ${We(t)}`)}function Rf(t){const e=Hi();return new ie({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;ir.type).join(" | ");return new ie({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...a]=ji(r,s,n),[c]=a;if(c[0])for(const[h]of a)h&&i.push(h);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${We(r)}`,...i]}})}function il(){return tt("unknown",()=>!0)}function Ui(t,e,r){return new ie({...t,coercer:(n,i)=>Di(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function Af(t,e,r={}){return Ui(t,il(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&la(n)&&la(i)){const s={...n};let a=!1;for(const c in i)s[c]===void 0&&(s[c]=i[c],a=!0);if(a)return s}return n})}function Nf(t){return Ui(t,sl(),e=>e.trim())}function xf(t){return Qt(t,"empty",e=>{const r=ol(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function ol(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Lf(t,e,r={}){const{exclusive:n}=r;return Qt(t,"max",i=>n?in?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function Pf(t){return Qt(t,"nonempty",e=>ol(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function Of(t,e){return Qt(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function $f(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return Qt(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:a}=s;return e<=a&&a<=r||`${n} with a size ${i} but received one with a size of \`${a}\``}else{const{length:a}=s;return e<=a&&a<=r||`${n} with a length ${i} but received one with a length of \`${a}\``}})}function Qt(t,e,r){return new ie({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),a=gi(s,i,t,n);for(const c of a)yield{...c,refinement:e}}})}const Bf=Object.freeze(Object.defineProperty({__proto__:null,Struct:ie,StructError:Yc,any:uf,array:df,assert:el,assign:tf,bigint:hf,boolean:ff,coerce:Ui,create:tl,date:pf,defaulted:Af,define:tt,deprecated:rf,dynamic:nf,empty:xf,enums:gf,func:mf,instance:_f,integer:vf,intersection:yf,is:Di,lazy:sf,literal:wf,map:bf,mask:rl,max:Lf,min:Tf,never:Hi,nonempty:Pf,nullable:Ef,number:Sf,object:Qr,omit:of,optional:nl,partial:af,pattern:Of,pick:cf,record:kf,refine:Qt,regexp:Cf,set:Mf,size:$f,string:sl,struct:lf,trimmed:Nf,tuple:Rf,type:Kr,union:If,unknown:il,validate:Er},Symbol.toStringTag,{value:"Module"})),Kt=In(Bf);Object.defineProperty(Ge,"__esModule",{value:!0});Ge.assertExhaustive=Ge.assertStruct=Ge.assert=Ge.AssertionError=void 0;const Ff=Kt;function jf(t){return typeof t=="object"&&t!==null&&"message"in t}function Df(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function Hf(t){const e=jf(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function al(t,e){return Df(t)?new t({message:e}):t({message:e})}class Vi extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}Ge.AssertionError=Vi;function Uf(t,e="Assertion failed.",r=Vi){if(!t)throw e instanceof Error?e:al(r,e)}Ge.assert=Uf;function Vf(t,e,r="Assertion failed",n=Vi){try{(0,Ff.assert)(t,e)}catch(i){throw al(n,`${r}: ${Hf(i)}.`)}}Ge.assertStruct=Vf;function Wf(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}Ge.assertExhaustive=Wf;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.base64=void 0;const zf=Kt,qf=Ge,Jf=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let a;s==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,qf.assert)(s==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let c;return i?c=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):c=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,zf.pattern)(t,c)};Xr.base64=Jf;var z={},Yr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Kt,r=Ge;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(u){return(0,e.is)(u,t.HexStruct)}t.isHexString=n;function i(u){return(0,e.is)(u,t.StrictHexStruct)}t.isStrictHexString=i;function s(u){(0,r.assert)(n(u),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function a(u){(0,r.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=a;function c(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}t.add0x=c;function h(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}t.remove0x=h})(Yr);Object.defineProperty(z,"__esModule",{value:!0});z.createDataView=z.concatBytes=z.valueToBytes=z.stringToBytes=z.numberToBytes=z.signedBigIntToBytes=z.bigIntToBytes=z.hexToBytes=z.bytesToString=z.bytesToNumber=z.bytesToSignedBigInt=z.bytesToBigInt=z.bytesToHex=z.assertIsBytes=z.isBytes=void 0;const st=Ge,mi=Yr,ua=48,da=58,ha=87;function Gf(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const Zf=Gf();function Wi(t){return t instanceof Uint8Array}z.isBytes=Wi;function Sr(t){(0,st.assert)(Wi(t),"Value must be a Uint8Array.")}z.assertIsBytes=Sr;function cl(t){if(Sr(t),t.length===0)return"0x";const e=Zf(),r=new Array(t.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return ns(e)}z.bigIntToBytes=ul;function Yf(t,e){(0,st.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function e0(t,e){(0,st.assert)(typeof t=="bigint","Value must be a bigint."),(0,st.assert)(typeof e=="number","Byte length must be a number."),(0,st.assert)(e>0,"Byte length must be greater than 0."),(0,st.assert)(Yf(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i>=BigInt(8);return n.reverse()}z.signedBigIntToBytes=e0;function dl(t){(0,st.assert)(typeof t=="number","Value must be a number."),(0,st.assert)(t>=0,"Value must be a non-negative number."),(0,st.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return ns(e)}z.numberToBytes=dl;function hl(t){return(0,st.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}z.stringToBytes=hl;function fl(t){if(typeof t=="bigint")return ul(t);if(typeof t=="number")return dl(t);if(typeof t=="string")return t.startsWith("0x")?ns(t):hl(t);if(Wi(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}z.valueToBytes=fl;function t0(t){const e=new Array(t.length);let r=0;for(let i=0;ie.call(r,n,i,this))}get(e){return Xe(this,dt,"f").get(e)}has(e){return Xe(this,dt,"f").has(e)}keys(){return Xe(this,dt,"f").keys()}values(){return Xe(this,dt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}gr.FrozenMap=zi;class qi{constructor(e){mt.set(this,void 0),ml(this,mt,new Set(e),"f"),Object.freeze(this)}get size(){return Xe(this,mt,"f").size}[(mt=new WeakMap,Symbol.iterator)](){return Xe(this,mt,"f")[Symbol.iterator]()}entries(){return Xe(this,mt,"f").entries()}forEach(e,r){return Xe(this,mt,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return Xe(this,mt,"f").has(e)}keys(){return Xe(this,mt,"f").keys()}values(){return Xe(this,mt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}gr.FrozenSet=qi;Object.freeze(zi);Object.freeze(zi.prototype);Object.freeze(qi);Object.freeze(qi.prototype);var _l={};Object.defineProperty(_l,"__esModule",{value:!0});var vl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;const e=Kt,r=Ge,n=()=>(0,e.define)("finite number",x=>(0,e.is)(x,(0,e.number)())&&Number.isFinite(x));t.UnsafeJsonStruct=(0,e.union)([(0,e.literal)(null),(0,e.boolean)(),n(),(0,e.string)(),(0,e.array)((0,e.lazy)(()=>t.UnsafeJsonStruct)),(0,e.record)((0,e.string)(),(0,e.lazy)(()=>t.UnsafeJsonStruct))]),t.JsonStruct=(0,e.define)("Json",(x,P)=>{function q(Y,J){const U=[...J.validator(Y,P)];return U.length>0?U:!0}try{const Y=q(x,t.UnsafeJsonStruct);return Y!==!0?Y:q(JSON.parse(JSON.stringify(x)),t.UnsafeJsonStruct)}catch(Y){return Y instanceof RangeError?"Circular reference detected":!1}});function i(x){return(0,e.is)(x,t.JsonStruct)}t.isValidJson=i;function s(x){(0,r.assertStruct)(x,t.JsonStruct,"Invalid JSON value");const P=JSON.stringify(x);return new TextEncoder().encode(P).byteLength}t.getJsonSize=s,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function a(x){return(0,e.is)(x,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=a;function c(x,P){(0,r.assertStruct)(x,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",P)}t.assertIsJsonRpcNotification=c;function h(x){return(0,e.is)(x,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=h;function u(x,P){(0,r.assertStruct)(x,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",P)}t.assertIsJsonRpcRequest=u,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function p(x){return(0,e.is)(x,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=p;function f(x,P){(0,r.assertStruct)(x,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",P)}t.assertIsPendingJsonRpcResponse=f;function v(x){return(0,e.is)(x,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=v;function S(x,P){(0,r.assertStruct)(x,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",P)}t.assertIsJsonRpcResponse=S;function C(x){return(0,e.is)(x,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=C;function N(x,P){(0,r.assertStruct)(x,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",P)}t.assertIsJsonRpcSuccess=N;function M(x){return(0,e.is)(x,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=M;function A(x,P){(0,r.assertStruct)(x,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",P)}t.assertIsJsonRpcFailure=A;function I(x){return(0,e.is)(x,t.JsonRpcErrorStruct)}t.isJsonRpcError=I;function R(x,P){(0,r.assertStruct)(x,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",P)}t.assertIsJsonRpcError=R;function j(x){const{permitEmptyString:P,permitFractions:q,permitNull:Y}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},x);return G=>!!(typeof G=="number"&&(q||Number.isInteger(G))||typeof G=="string"&&(P||G.length>0)||Y&&G===null)}t.getJsonRpcIdValidator=j})(vl);var yl={};Object.defineProperty(yl,"__esModule",{value:!0});var mr={},_i={exports:{}},Qs,pa;function f0(){if(pa)return Qs;pa=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;Qs=function(p,f){f=f||{};var v=typeof p;if(v==="string"&&p.length>0)return a(p);if(v==="number"&&isFinite(p))return f.long?h(p):c(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function a(p){if(p=String(p),!(p.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(f){var v=parseFloat(f[1]),S=(f[2]||"ms").toLowerCase();switch(S){case"years":case"year":case"yrs":case"yr":case"y":return v*s;case"weeks":case"week":case"w":return v*i;case"days":case"day":case"d":return v*n;case"hours":case"hour":case"hrs":case"hr":case"h":return v*r;case"minutes":case"minute":case"mins":case"min":case"m":return v*e;case"seconds":case"second":case"secs":case"sec":case"s":return v*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}function c(p){var f=Math.abs(p);return f>=n?Math.round(p/n)+"d":f>=r?Math.round(p/r)+"h":f>=e?Math.round(p/e)+"m":f>=t?Math.round(p/t)+"s":p+"ms"}function h(p){var f=Math.abs(p);return f>=n?u(p,f,n,"day"):f>=r?u(p,f,r,"hour"):f>=e?u(p,f,e,"minute"):f>=t?u(p,f,t,"second"):p+" ms"}function u(p,f,v,S){var C=f>=v*1.5;return Math.round(p/v)+" "+S+(C?"s":"")}return Qs}function p0(t){r.debug=r,r.default=r,r.coerce=h,r.disable=s,r.enable=i,r.enabled=a,r.humanize=f0(),r.destroy=u,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let f=0;for(let v=0;v{if(P==="%%")return"%";j++;const Y=r.formatters[q];if(typeof Y=="function"){const J=M[j];P=Y.call(A,J),M.splice(j,1),j--}return P}),r.formatArgs.call(A,M),(A.log||r.log).apply(A,M)}return N.namespace=p,N.useColors=r.useColors(),N.color=r.selectColor(p),N.extend=n,N.destroy=r.destroy,Object.defineProperty(N,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(S!==r.namespaces&&(S=r.namespaces,C=r.enabled(p)),C),set:M=>{v=M}}),typeof r.init=="function"&&r.init(N),N}function n(p,f){const v=r(this.namespace+(typeof f>"u"?":":f)+p);return v.log=this.log,v}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let f;const v=(typeof p=="string"?p:"").split(/[\s,]+/),S=v.length;for(f=0;f"-"+f)].join(",");return r.enable(""),p}function a(p){if(p[p.length-1]==="*")return!0;let f,v;for(f=0,v=r.skips.length;f{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;u.splice(1,0,p,"color: inherit");let f=0,v=0;u[0].replace(/%[a-zA-Z%]/g,S=>{S!=="%%"&&(f++,S==="%c"&&(v=f))}),u.splice(v,0,p)}e.log=console.debug||console.log||(()=>{});function s(u){try{u?e.storage.setItem("debug",u):e.storage.removeItem("debug")}catch{}}function a(){let u;try{u=e.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=r.DEBUG),u}function c(){try{return localStorage}catch{}}t.exports=g0(e);const{formatters:h}=t.exports;h.j=function(u){try{return JSON.stringify(u)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(_i,_i.exports);var m0=_i.exports,_0=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mr,"__esModule",{value:!0});mr.createModuleLogger=mr.createProjectLogger=void 0;const v0=_0(m0),y0=(0,v0.default)("metamask");function w0(t){return y0.extend(t)}mr.createProjectLogger=w0;function b0(t,e){return t.extend(e)}mr.createModuleLogger=b0;var wl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(u){return Array.isArray(u)&&u.length>0}t.isNonEmptyArray=e;function r(u){return u==null}t.isNullOrUndefined=r;function n(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}t.isObject=n;const i=(u,p)=>Object.hasOwnProperty.call(u,p);t.hasProperty=i,function(u){u[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(u){if(typeof u!="object"||u===null)return!1;try{let p=u;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(u)===p}catch{return!1}}t.isPlainObject=s;function a(u){return u.charCodeAt(0)<=127}t.isASCII=a;function c(u){var p;return u.split("").reduce((v,S)=>a(S)?v+1:v+2,0)+((p=u.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}t.calculateStringSize=c;function h(u){return u.toString().length}t.calculateNumberSize=h})(wl);var St={};Object.defineProperty(St,"__esModule",{value:!0});St.hexToBigInt=St.hexToNumber=St.bigIntToHex=St.numberToHex=void 0;const cr=Ge,Pr=Yr,E0=t=>((0,cr.assert)(typeof t=="number","Value must be a number."),(0,cr.assert)(t>=0,"Value must be a non-negative number."),(0,cr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Pr.add0x)(t.toString(16)));St.numberToHex=E0;const S0=t=>((0,cr.assert)(typeof t=="bigint","Value must be a bigint."),(0,cr.assert)(t>=0,"Value must be a non-negative bigint."),(0,Pr.add0x)(t.toString(16)));St.bigIntToHex=S0;const k0=t=>{(0,Pr.assertIsHexString)(t);const e=parseInt(t,16);return(0,cr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};St.hexToNumber=k0;const C0=t=>((0,Pr.assertIsHexString)(t),BigInt((0,Pr.add0x)(t)));St.hexToBigInt=C0;var bl={};Object.defineProperty(bl,"__esModule",{value:!0});var El={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,a)=>{if(!e(s))throw new Error(`"${a}" must be a non-negative integer. Received: "${s}".`)};function n(s,a){return r(s,"count"),s*a}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(El);var Sl={};Object.defineProperty(Sl,"__esModule",{value:!0});var kl={},vi={exports:{}};const M0="2.0.0",Cl=256,R0=Number.MAX_SAFE_INTEGER||9007199254740991,I0=16,A0=Cl-6,N0=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var os={MAX_LENGTH:Cl,MAX_SAFE_COMPONENT_LENGTH:I0,MAX_SAFE_BUILD_LENGTH:A0,MAX_SAFE_INTEGER:R0,RELEASE_TYPES:N0,SEMVER_SPEC_VERSION:M0,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ks={};const x0=typeof process=="object"&&Ks&&Ks.NODE_DEBUG&&/\bsemver\b/i.test(Ks.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var as=x0;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=os,s=as;e=t.exports={};const a=e.re=[],c=e.safeRe=[],h=e.src=[],u=e.t={};let p=0;const f="[a-zA-Z0-9-]",v=[["\\s",1],["\\d",i],[f,n]],S=N=>{for(const[M,A]of v)N=N.split(`${M}*`).join(`${M}{0,${A}}`).split(`${M}+`).join(`${M}{1,${A}}`);return N},C=(N,M,A)=>{const I=S(M),R=p++;s(N,R,M),u[N]=R,h[R]=M,a[R]=new RegExp(M,A?"g":void 0),c[R]=new RegExp(I,A?"g":void 0)};C("NUMERICIDENTIFIER","0|[1-9]\\d*"),C("NUMERICIDENTIFIERLOOSE","\\d+"),C("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),C("MAINVERSION",`(${h[u.NUMERICIDENTIFIER]})\\.(${h[u.NUMERICIDENTIFIER]})\\.(${h[u.NUMERICIDENTIFIER]})`),C("MAINVERSIONLOOSE",`(${h[u.NUMERICIDENTIFIERLOOSE]})\\.(${h[u.NUMERICIDENTIFIERLOOSE]})\\.(${h[u.NUMERICIDENTIFIERLOOSE]})`),C("PRERELEASEIDENTIFIER",`(?:${h[u.NUMERICIDENTIFIER]}|${h[u.NONNUMERICIDENTIFIER]})`),C("PRERELEASEIDENTIFIERLOOSE",`(?:${h[u.NUMERICIDENTIFIERLOOSE]}|${h[u.NONNUMERICIDENTIFIER]})`),C("PRERELEASE",`(?:-(${h[u.PRERELEASEIDENTIFIER]}(?:\\.${h[u.PRERELEASEIDENTIFIER]})*))`),C("PRERELEASELOOSE",`(?:-?(${h[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[u.PRERELEASEIDENTIFIERLOOSE]})*))`),C("BUILDIDENTIFIER",`${f}+`),C("BUILD",`(?:\\+(${h[u.BUILDIDENTIFIER]}(?:\\.${h[u.BUILDIDENTIFIER]})*))`),C("FULLPLAIN",`v?${h[u.MAINVERSION]}${h[u.PRERELEASE]}?${h[u.BUILD]}?`),C("FULL",`^${h[u.FULLPLAIN]}$`),C("LOOSEPLAIN",`[v=\\s]*${h[u.MAINVERSIONLOOSE]}${h[u.PRERELEASELOOSE]}?${h[u.BUILD]}?`),C("LOOSE",`^${h[u.LOOSEPLAIN]}$`),C("GTLT","((?:<|>)?=?)"),C("XRANGEIDENTIFIERLOOSE",`${h[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),C("XRANGEIDENTIFIER",`${h[u.NUMERICIDENTIFIER]}|x|X|\\*`),C("XRANGEPLAIN",`[v=\\s]*(${h[u.XRANGEIDENTIFIER]})(?:\\.(${h[u.XRANGEIDENTIFIER]})(?:\\.(${h[u.XRANGEIDENTIFIER]})(?:${h[u.PRERELEASE]})?${h[u.BUILD]}?)?)?`),C("XRANGEPLAINLOOSE",`[v=\\s]*(${h[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[u.XRANGEIDENTIFIERLOOSE]})(?:${h[u.PRERELEASELOOSE]})?${h[u.BUILD]}?)?)?`),C("XRANGE",`^${h[u.GTLT]}\\s*${h[u.XRANGEPLAIN]}$`),C("XRANGELOOSE",`^${h[u.GTLT]}\\s*${h[u.XRANGEPLAINLOOSE]}$`),C("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),C("COERCE",`${h[u.COERCEPLAIN]}(?:$|[^\\d])`),C("COERCEFULL",h[u.COERCEPLAIN]+`(?:${h[u.PRERELEASE]})?(?:${h[u.BUILD]})?(?:$|[^\\d])`),C("COERCERTL",h[u.COERCE],!0),C("COERCERTLFULL",h[u.COERCEFULL],!0),C("LONETILDE","(?:~>?)"),C("TILDETRIM",`(\\s*)${h[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",C("TILDE",`^${h[u.LONETILDE]}${h[u.XRANGEPLAIN]}$`),C("TILDELOOSE",`^${h[u.LONETILDE]}${h[u.XRANGEPLAINLOOSE]}$`),C("LONECARET","(?:\\^)"),C("CARETTRIM",`(\\s*)${h[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",C("CARET",`^${h[u.LONECARET]}${h[u.XRANGEPLAIN]}$`),C("CARETLOOSE",`^${h[u.LONECARET]}${h[u.XRANGEPLAINLOOSE]}$`),C("COMPARATORLOOSE",`^${h[u.GTLT]}\\s*(${h[u.LOOSEPLAIN]})$|^$`),C("COMPARATOR",`^${h[u.GTLT]}\\s*(${h[u.FULLPLAIN]})$|^$`),C("COMPARATORTRIM",`(\\s*)${h[u.GTLT]}\\s*(${h[u.LOOSEPLAIN]}|${h[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",C("HYPHENRANGE",`^\\s*(${h[u.XRANGEPLAIN]})\\s+-\\s+(${h[u.XRANGEPLAIN]})\\s*$`),C("HYPHENRANGELOOSE",`^\\s*(${h[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[u.XRANGEPLAINLOOSE]})\\s*$`),C("STAR","(<|>)?=?\\s*\\*"),C("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),C("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(vi,vi.exports);var en=vi.exports;const L0=Object.freeze({loose:!0}),T0=Object.freeze({}),P0=t=>t?typeof t!="object"?L0:t:T0;var Ji=P0;const ga=/^[0-9]+$/,Ml=(t,e)=>{const r=ga.test(t),n=ga.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:tMl(e,t);var Rl={compareIdentifiers:Ml,rcompareIdentifiers:O0};const fn=as,{MAX_LENGTH:ma,MAX_SAFE_INTEGER:pn}=os,{safeRe:_a,t:va}=en,$0=Ji,{compareIdentifiers:rr}=Rl;let B0=class _t{constructor(e,r){if(r=$0(r),e instanceof _t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ma)throw new TypeError(`version is longer than ${ma} characters`);fn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?_a[va.LOOSE]:_a[va.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>pn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>pn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>pn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),rr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Ye=B0;const ya=Ye,F0=(t,e,r=!1)=>{if(t instanceof ya)return t;try{return new ya(t,e)}catch(n){if(!r)return null;throw n}};var kr=F0;const j0=kr,D0=(t,e)=>{const r=j0(t,e);return r?r.version:null};var H0=D0;const U0=kr,V0=(t,e)=>{const r=U0(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var W0=V0;const wa=Ye,z0=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new wa(t instanceof wa?t.version:t,r).inc(e,n,i).version}catch{return null}};var q0=z0;const ba=kr,J0=(t,e)=>{const r=ba(t,null,!0),n=ba(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,a=s?r:n,c=s?n:r,h=!!a.prerelease.length;if(!!c.prerelease.length&&!h)return!c.patch&&!c.minor?"major":a.patch?"patch":a.minor?"minor":"major";const p=h?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};var G0=J0;const Z0=Ye,Q0=(t,e)=>new Z0(t,e).major;var K0=Q0;const X0=Ye,Y0=(t,e)=>new X0(t,e).minor;var ep=Y0;const tp=Ye,rp=(t,e)=>new tp(t,e).patch;var np=rp;const sp=kr,ip=(t,e)=>{const r=sp(t,e);return r&&r.prerelease.length?r.prerelease:null};var op=ip;const Ea=Ye,ap=(t,e,r)=>new Ea(t,r).compare(new Ea(e,r));var ft=ap;const cp=ft,lp=(t,e,r)=>cp(e,t,r);var up=lp;const dp=ft,hp=(t,e)=>dp(t,e,!0);var fp=hp;const Sa=Ye,pp=(t,e,r)=>{const n=new Sa(t,r),i=new Sa(e,r);return n.compare(i)||n.compareBuild(i)};var Gi=pp;const gp=Gi,mp=(t,e)=>t.sort((r,n)=>gp(r,n,e));var _p=mp;const vp=Gi,yp=(t,e)=>t.sort((r,n)=>vp(n,r,e));var wp=yp;const bp=ft,Ep=(t,e,r)=>bp(t,e,r)>0;var cs=Ep;const Sp=ft,kp=(t,e,r)=>Sp(t,e,r)<0;var Zi=kp;const Cp=ft,Mp=(t,e,r)=>Cp(t,e,r)===0;var Il=Mp;const Rp=ft,Ip=(t,e,r)=>Rp(t,e,r)!==0;var Al=Ip;const Ap=ft,Np=(t,e,r)=>Ap(t,e,r)>=0;var Qi=Np;const xp=ft,Lp=(t,e,r)=>xp(t,e,r)<=0;var Ki=Lp;const Tp=Il,Pp=Al,Op=cs,$p=Qi,Bp=Zi,Fp=Ki,jp=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Tp(t,r,n);case"!=":return Pp(t,r,n);case">":return Op(t,r,n);case">=":return $p(t,r,n);case"<":return Bp(t,r,n);case"<=":return Fp(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var Nl=jp;const Dp=Ye,Hp=kr,{safeRe:gn,t:mn}=en,Up=(t,e)=>{if(t instanceof Dp)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?gn[mn.COERCEFULL]:gn[mn.COERCE]);else{const h=e.includePrerelease?gn[mn.COERCERTLFULL]:gn[mn.COERCERTL];let u;for(;(u=h.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),h.lastIndex=u.index+u[1].length+u[2].length;h.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",c=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Hp(`${n}.${i}.${s}${a}${c}`,e)};var Vp=Up;class Wp{constructor(){this.max=1e3,this.map=new Map}get(e){const r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}}var zp=Wp,Xs,ka;function pt(){if(ka)return Xs;ka=1;class t{constructor(o,d){if(d=n(d),o instanceof t)return o.loose===!!d.loose&&o.includePrerelease===!!d.includePrerelease?o:new t(o.raw,d);if(o instanceof i)return this.raw=o.value,this.set=[[o]],this.format(),this;if(this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease,this.raw=o.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(g=>this.parseRange(g.trim())).filter(g=>g.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const g=this.set[0];if(this.set=this.set.filter(m=>!C(m[0])),this.set.length===0)this.set=[g];else if(this.set.length>1){for(const m of this.set)if(m.length===1&&N(m[0])){this.set=[m];break}}}this.format()}format(){return this.range=this.set.map(o=>o.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(o){const g=((this.options.includePrerelease&&v)|(this.options.loose&&S))+":"+o,m=r.get(g);if(m)return m;const w=this.options.loose,E=w?c[h.HYPHENRANGELOOSE]:c[h.HYPHENRANGE];o=o.replace(E,U(this.options.includePrerelease)),s("hyphen replace",o),o=o.replace(c[h.COMPARATORTRIM],u),s("comparator trim",o),o=o.replace(c[h.TILDETRIM],p),s("tilde trim",o),o=o.replace(c[h.CARETTRIM],f),s("caret trim",o);let k=o.split(" ").map(L=>A(L,this.options)).join(" ").split(/\s+/).map(L=>G(L,this.options));w&&(k=k.filter(L=>(s("loose invalid filter",L,this.options),!!L.match(c[h.COMPARATORLOOSE])))),s("range list",k);const _=new Map,l=k.map(L=>new i(L,this.options));for(const L of l){if(C(L))return[L];_.set(L.value,L)}_.size>1&&_.has("")&&_.delete("");const b=[..._.values()];return r.set(g,b),b}intersects(o,d){if(!(o instanceof t))throw new TypeError("a Range is required");return this.set.some(g=>M(g,d)&&o.set.some(m=>M(m,d)&&g.every(w=>m.every(E=>w.intersects(E,d)))))}test(o){if(!o)return!1;if(typeof o=="string")try{o=new a(o,this.options)}catch{return!1}for(let d=0;dy.value==="<0.0.0-0",N=y=>y.value==="",M=(y,o)=>{let d=!0;const g=y.slice();let m=g.pop();for(;d&&g.length;)d=g.every(w=>m.intersects(w,o)),m=g.pop();return d},A=(y,o)=>(s("comp",y,o),y=x(y,o),s("caret",y),y=R(y,o),s("tildes",y),y=q(y,o),s("xrange",y),y=J(y,o),s("stars",y),y),I=y=>!y||y.toLowerCase()==="x"||y==="*",R=(y,o)=>y.trim().split(/\s+/).map(d=>j(d,o)).join(" "),j=(y,o)=>{const d=o.loose?c[h.TILDELOOSE]:c[h.TILDE];return y.replace(d,(g,m,w,E,k)=>{s("tilde",y,g,m,w,E,k);let _;return I(m)?_="":I(w)?_=`>=${m}.0.0 <${+m+1}.0.0-0`:I(E)?_=`>=${m}.${w}.0 <${m}.${+w+1}.0-0`:k?(s("replaceTilde pr",k),_=`>=${m}.${w}.${E}-${k} <${m}.${+w+1}.0-0`):_=`>=${m}.${w}.${E} <${m}.${+w+1}.0-0`,s("tilde return",_),_})},x=(y,o)=>y.trim().split(/\s+/).map(d=>P(d,o)).join(" "),P=(y,o)=>{s("caret",y,o);const d=o.loose?c[h.CARETLOOSE]:c[h.CARET],g=o.includePrerelease?"-0":"";return y.replace(d,(m,w,E,k,_)=>{s("caret",y,m,w,E,k,_);let l;return I(w)?l="":I(E)?l=`>=${w}.0.0${g} <${+w+1}.0.0-0`:I(k)?w==="0"?l=`>=${w}.${E}.0${g} <${w}.${+E+1}.0-0`:l=`>=${w}.${E}.0${g} <${+w+1}.0.0-0`:_?(s("replaceCaret pr",_),w==="0"?E==="0"?l=`>=${w}.${E}.${k}-${_} <${w}.${E}.${+k+1}-0`:l=`>=${w}.${E}.${k}-${_} <${w}.${+E+1}.0-0`:l=`>=${w}.${E}.${k}-${_} <${+w+1}.0.0-0`):(s("no pr"),w==="0"?E==="0"?l=`>=${w}.${E}.${k}${g} <${w}.${E}.${+k+1}-0`:l=`>=${w}.${E}.${k}${g} <${w}.${+E+1}.0-0`:l=`>=${w}.${E}.${k} <${+w+1}.0.0-0`),s("caret return",l),l})},q=(y,o)=>(s("replaceXRanges",y,o),y.split(/\s+/).map(d=>Y(d,o)).join(" ")),Y=(y,o)=>{y=y.trim();const d=o.loose?c[h.XRANGELOOSE]:c[h.XRANGE];return y.replace(d,(g,m,w,E,k,_)=>{s("xRange",y,g,m,w,E,k,_);const l=I(w),b=l||I(E),L=b||I(k),O=L;return m==="="&&O&&(m=""),_=o.includePrerelease?"-0":"",l?m===">"||m==="<"?g="<0.0.0-0":g="*":m&&O?(b&&(E=0),k=0,m===">"?(m=">=",b?(w=+w+1,E=0,k=0):(E=+E+1,k=0)):m==="<="&&(m="<",b?w=+w+1:E=+E+1),m==="<"&&(_="-0"),g=`${m+w}.${E}.${k}${_}`):b?g=`>=${w}.0.0${_} <${+w+1}.0.0-0`:L&&(g=`>=${w}.${E}.0${_} <${w}.${+E+1}.0-0`),s("xRange return",g),g})},J=(y,o)=>(s("replaceStars",y,o),y.trim().replace(c[h.STAR],"")),G=(y,o)=>(s("replaceGTE0",y,o),y.trim().replace(c[o.includePrerelease?h.GTE0PRE:h.GTE0],"")),U=y=>(o,d,g,m,w,E,k,_,l,b,L,O)=>(I(g)?d="":I(m)?d=`>=${g}.0.0${y?"-0":""}`:I(w)?d=`>=${g}.${m}.0${y?"-0":""}`:E?d=`>=${d}`:d=`>=${d}${y?"-0":""}`,I(l)?_="":I(b)?_=`<${+l+1}.0.0-0`:I(L)?_=`<${l}.${+b+1}.0-0`:O?_=`<=${l}.${b}.${L}-${O}`:y?_=`<${l}.${b}.${+L+1}-0`:_=`<=${_}`,`${d} ${_}`.trim()),Q=(y,o,d)=>{for(let g=0;g0){const m=y[g].semver;if(m.major===o.major&&m.minor===o.minor&&m.patch===o.patch)return!0}return!1}return!0};return Xs}var Ys,Ca;function ls(){if(Ca)return Ys;Ca=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(p,f){if(f=r(f),p instanceof e){if(p.loose===!!f.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),a("comparator",p,f),this.options=f,this.loose=!!f.loose,this.parse(p),this.semver===t?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(p){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],v=p.match(f);if(!v)throw new TypeError(`Invalid comparator: ${p}`);this.operator=v[1]!==void 0?v[1]:"",this.operator==="="&&(this.operator=""),v[2]?this.semver=new c(v[2],this.options.loose):this.semver=t}toString(){return this.value}test(p){if(a("Comparator.test",p,this.options.loose),this.semver===t||p===t)return!0;if(typeof p=="string")try{p=new c(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,f){if(!(p instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(p.value,f).test(this.value):p.operator===""?p.value===""?!0:new h(this.value,f).test(p.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,f)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,f)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}Ys=e;const r=Ji,{safeRe:n,t:i}=en,s=Nl,a=as,c=Ye,h=pt();return Ys}const qp=pt(),Jp=(t,e,r)=>{try{e=new qp(e,r)}catch{return!1}return e.test(t)};var us=Jp;const Gp=pt(),Zp=(t,e)=>new Gp(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Qp=Zp;const Kp=Ye,Xp=pt(),Yp=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Xp(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new Kp(n,r))}),n};var e1=Yp;const t1=Ye,r1=pt(),n1=(t,e,r)=>{let n=null,i=null,s=null;try{s=new r1(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new t1(n,r))}),n};var s1=n1;const ei=Ye,i1=pt(),Ma=cs,o1=(t,e)=>{t=new i1(t,e);let r=new ei("0.0.0");if(t.test(r)||(r=new ei("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{const c=new ei(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Ma(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||Ma(r,s))&&(r=s)}return r&&t.test(r)?r:null};var a1=o1;const c1=pt(),l1=(t,e)=>{try{return new c1(t,e).range||"*"}catch{return null}};var u1=l1;const d1=Ye,xl=ls(),{ANY:h1}=xl,f1=pt(),p1=us,Ra=cs,Ia=Zi,g1=Ki,m1=Qi,_1=(t,e,r,n)=>{t=new d1(t,n),e=new f1(e,n);let i,s,a,c,h;switch(r){case">":i=Ra,s=g1,a=Ia,c=">",h=">=";break;case"<":i=Ia,s=m1,a=Ra,c="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(p1(t,e,n))return!1;for(let u=0;u{S.semver===h1&&(S=new xl(">=0.0.0")),f=f||S,v=v||S,i(S.semver,f.semver,n)?f=S:a(S.semver,v.semver,n)&&(v=S)}),f.operator===c||f.operator===h||(!v.operator||v.operator===c)&&s(t,v.semver))return!1;if(v.operator===h&&a(t,v.semver))return!1}return!0};var Xi=_1;const v1=Xi,y1=(t,e,r)=>v1(t,e,">",r);var w1=y1;const b1=Xi,E1=(t,e,r)=>b1(t,e,"<",r);var S1=E1;const Aa=pt(),k1=(t,e,r)=>(t=new Aa(t,r),e=new Aa(e,r),t.intersects(e,r));var C1=k1;const M1=us,R1=ft;var I1=(t,e,r)=>{const n=[];let i=null,s=null;const a=t.sort((p,f)=>R1(p,f,r));for(const p of a)M1(p,e,r)?(s=p,i||(i=p)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const c=[];for(const[p,f]of n)p===f?c.push(p):!f&&p===a[0]?c.push("*"):f?p===a[0]?c.push(`<=${f}`):c.push(`${p} - ${f}`):c.push(`>=${p}`);const h=c.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return h.length{if(t===e)return!0;t=new Na(t,r),e=new Na(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const a=x1(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},N1=[new Yi(">=0.0.0-0")],xa=[new Yi(">=0.0.0")],x1=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===ti){if(e.length===1&&e[0].semver===ti)return!0;r.includePrerelease?t=N1:t=xa}if(e.length===1&&e[0].semver===ti){if(r.includePrerelease)return!0;e=xa}const n=new Set;let i,s;for(const S of t)S.operator===">"||S.operator===">="?i=La(i,S,r):S.operator==="<"||S.operator==="<="?s=Ta(s,S,r):n.add(S.semver);if(n.size>1)return null;let a;if(i&&s){if(a=eo(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const S of n){if(i&&!Mr(S,String(i),r)||s&&!Mr(S,String(s),r))return null;for(const C of e)if(!Mr(S,String(C),r))return!1;return!0}let c,h,u,p,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,v=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(const S of e){if(p=p||S.operator===">"||S.operator===">=",u=u||S.operator==="<"||S.operator==="<=",i){if(v&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===v.major&&S.semver.minor===v.minor&&S.semver.patch===v.patch&&(v=!1),S.operator===">"||S.operator===">="){if(c=La(i,S,r),c===S&&c!==i)return!1}else if(i.operator===">="&&!Mr(i.semver,String(S),r))return!1}if(s){if(f&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===f.major&&S.semver.minor===f.minor&&S.semver.patch===f.patch&&(f=!1),S.operator==="<"||S.operator==="<="){if(h=Ta(s,S,r),h===S&&h!==s)return!1}else if(s.operator==="<="&&!Mr(s.semver,String(S),r))return!1}if(!S.operator&&(s||i)&&a!==0)return!1}return!(i&&u&&!s&&a!==0||s&&p&&!i&&a!==0||v||f)},La=(t,e,r)=>{if(!t)return e;const n=eo(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Ta=(t,e,r)=>{if(!t)return e;const n=eo(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var L1=A1;const ri=en,Pa=os,T1=Ye,Oa=Rl,P1=kr,O1=H0,$1=W0,B1=q0,F1=G0,j1=K0,D1=ep,H1=np,U1=op,V1=ft,W1=up,z1=fp,q1=Gi,J1=_p,G1=wp,Z1=cs,Q1=Zi,K1=Il,X1=Al,Y1=Qi,eg=Ki,tg=Nl,rg=Vp,ng=ls(),sg=pt(),ig=us,og=Qp,ag=e1,cg=s1,lg=a1,ug=u1,dg=Xi,hg=w1,fg=S1,pg=C1,gg=I1,mg=L1;var _g={parse:P1,valid:O1,clean:$1,inc:B1,diff:F1,major:j1,minor:D1,patch:H1,prerelease:U1,compare:V1,rcompare:W1,compareLoose:z1,compareBuild:q1,sort:J1,rsort:G1,gt:Z1,lt:Q1,eq:K1,neq:X1,gte:Y1,lte:eg,cmp:tg,coerce:rg,Comparator:ng,Range:sg,satisfies:ig,toComparators:og,maxSatisfying:ag,minSatisfying:cg,minVersion:lg,validRange:ug,outside:dg,gtr:hg,ltr:fg,intersects:pg,simplifyRange:gg,subset:mg,SemVer:T1,re:ri.re,src:ri.src,tokens:ri.t,SEMVER_SPEC_VERSION:Pa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Pa.RELEASE_TYPES,compareIdentifiers:Oa.compareIdentifiers,rcompareIdentifiers:Oa.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=_g,r=Kt,n=Ge;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",f=>(0,e.valid)(f)===null?`Expected SemVer version, got "${f}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",f=>(0,e.validRange)(f)===null?`Expected SemVer range, got "${f}"`:!0);function i(f){return(0,r.is)(f,t.VersionStruct)}t.isValidSemVerVersion=i;function s(f){return(0,r.is)(f,t.VersionRangeStruct)}t.isValidSemVerRange=s;function a(f){(0,n.assertStruct)(f,t.VersionStruct)}t.assertIsSemVerVersion=a;function c(f){(0,n.assertStruct)(f,t.VersionRangeStruct)}t.assertIsSemVerRange=c;function h(f,v){return(0,e.gt)(f,v)}t.gtVersion=h;function u(f,v){return(0,e.gtr)(f,v)}t.gtRange=u;function p(f,v){return(0,e.satisfies)(f,v,{includePrerelease:!0})}t.satisfiesVersionRange=p})(kl);(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ge,t),r(Xr,t),r(z,t),r(ss,t),r(Et,t),r(gr,t),r(_l,t),r(Yr,t),r(vl,t),r(yl,t),r(mr,t),r(wl,t),r(St,t),r(bl,t),r(El,t),r(Sl,t),r(kl,t)})(Xc);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Xc;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Kc);var Ll=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rs,"__esModule",{value:!0});rs.PollingBlockTracker=void 0;const vg=Ll(Fi),yg=Ll(Vh),wg=Gr,$a=Kc,Ba=(0,$a.createModuleLogger)($a.projectLogger,"polling-block-tracker"),bg=(0,vg.default)(),Eg=1e3;class Sg extends wg.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},e),{blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval})),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*Eg,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=Fa(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
+${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Fa(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:bg(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),Ba("Making request",e);const r=await(0,yg.default)(n=>this._provider.sendAsync(e,n))();if(Ba("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
+${r.error.message}`);return r.result}}rs.PollingBlockTracker=Sg;function Fa(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var ds={},kg=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ds,"__esModule",{value:!0});ds.SubscribeBlockTracker=void 0;const Cg=kg(Fi),Mg=Gr,Rg=(0,Cg.default)();class Ig extends Mg.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:Rg(),method:e,params:r,jsonrpc:"2.0"},(s,a)=>{s?i(s):n(a.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}ds.SubscribeBlockTracker=Ig;(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(rs,t),r(ds,t)})(Qc);var to={},hs={},tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.getUniqueId=void 0;const Tl=4294967295;let ni=Math.floor(Math.random()*Tl);function Ag(){return ni=(ni+1)%Tl,ni}tn.getUniqueId=Ag;Object.defineProperty(hs,"__esModule",{value:!0});hs.createIdRemapMiddleware=void 0;const Ng=tn;function xg(){return(t,e,r,n)=>{const i=t.id,s=Ng.getUniqueId();t.id=s,e.id=s,r(a=>{t.id=i,e.id=i,a()})}}hs.createIdRemapMiddleware=xg;var fs={};Object.defineProperty(fs,"__esModule",{value:!0});fs.createAsyncMiddleware=void 0;function Lg(t){return async(e,r,n,i)=>{let s;const a=new Promise(p=>{s=p});let c=null,h=!1;const u=async()=>{h=!0,n(p=>{c=p,s()}),await a};try{await t(e,r,u),h?(await a,c(null)):i(null)}catch(p){c?c(p):i(p)}}}fs.createAsyncMiddleware=Lg;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.createScaffoldMiddleware=void 0;function Tg(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}ps.createScaffoldMiddleware=Tg;var rn={},ro={};Object.defineProperty(ro,"__esModule",{value:!0});const Pg=Xa;function ja(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function Og(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([a]=r),a instanceof Error)throw a;const c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")ja(s,this,r);else{const a=s.length,c=Og(s);for(let h=0;h"u"&&(n=$l()),yi(t,"",0,[],void 0,0,n);var i;try{Vt.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Fl(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Jt.length!==0;){var s=Jt.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function lr(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),Jt.push([n,r,e,i])):Vt.push([e,r,t]):(n[r]=t,Jt.push([n,r,e]))}function yi(t,e,r,n,i,s,a){s+=1;var c;if(typeof t=="object"&&t!==null){for(c=0;ca.depthLimit){lr(kn,t,e,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){lr(kn,t,e,i);return}if(n.push(t),Array.isArray(t))for(c=0;ce?1:0}function Bl(t,e,r,n){typeof n>"u"&&(n=$l());var i=wi(t,"",0,[],void 0,0,n)||t,s;try{Vt.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Fl(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Jt.length!==0;){var a=Jt.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return s}function wi(t,e,r,n,i,s,a){s+=1;var c;if(typeof t=="object"&&t!==null){for(c=0;ca.depthLimit){lr(kn,t,e,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){lr(kn,t,e,i);return}if(n.push(t),Array.isArray(t))for(c=0;c0)for(var n=0;n=1e3&&t<=4999}function Ug(t,e){if(e!=="[Circular]")return e}var no={},Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.errorValues=Pt.errorCodes=void 0;Pt.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Pt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Pt,r=Tt,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:a(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(v,S=i){if(Number.isInteger(v)){const C=v.toString();if(f(e.errorValues,C))return e.errorValues[C].message;if(u(v))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return S}t.getMessageFromCode=a;function c(v){if(!Number.isInteger(v))return!1;const S=v.toString();return!!(e.errorValues[S]||u(v))}t.isValidCode=c;function h(v,{fallbackError:S=s,shouldIncludeStack:C=!1}={}){var N,M;if(!S||!Number.isInteger(S.code)||typeof S.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(v instanceof r.EthereumRpcError)return v.serialize();const A={};if(v&&typeof v=="object"&&!Array.isArray(v)&&f(v,"code")&&c(v.code)){const R=v;A.code=R.code,R.message&&typeof R.message=="string"?(A.message=R.message,f(R,"data")&&(A.data=R.data)):(A.message=a(A.code),A.data={originalError:p(v)})}else{A.code=S.code;const R=(N=v)===null||N===void 0?void 0:N.message;A.message=R&&typeof R=="string"?R:S.message,A.data={originalError:p(v)}}const I=(M=v)===null||M===void 0?void 0:M.stack;return C&&v&&I&&typeof I=="string"&&(A.stack=I),A}t.serializeError=h;function u(v){return v>=-32099&&v<=-32e3}function p(v){return v&&typeof v=="object"&&!Array.isArray(v)?Object.assign({},v):v}function f(v,S){return Object.prototype.hasOwnProperty.call(v,S)}})(no);var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.ethErrors=void 0;const so=Tt,Dl=no,Qe=Pt;gs.ethErrors={rpc:{parse:t=>ot(Qe.errorCodes.rpc.parse,t),invalidRequest:t=>ot(Qe.errorCodes.rpc.invalidRequest,t),invalidParams:t=>ot(Qe.errorCodes.rpc.invalidParams,t),methodNotFound:t=>ot(Qe.errorCodes.rpc.methodNotFound,t),internal:t=>ot(Qe.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ot(e,t)},invalidInput:t=>ot(Qe.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>ot(Qe.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>ot(Qe.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>ot(Qe.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>ot(Qe.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>ot(Qe.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Rr(Qe.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Rr(Qe.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Rr(Qe.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Rr(Qe.errorCodes.provider.disconnected,t),chainDisconnected:t=>Rr(Qe.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new so.EthereumProviderError(e,r,n)}}};function ot(t,e){const[r,n]=Hl(e);return new so.EthereumRpcError(t,r||Dl.getMessageFromCode(t),n)}function Rr(t,e){const[r,n]=Hl(e);return new so.EthereumProviderError(t,r||Dl.getMessageFromCode(t),n)}function Hl(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Tt;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=no;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=gs;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Pt;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Pl);var Vg=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rn,"__esModule",{value:!0});rn.JsonRpcEngine=void 0;const Wg=Vg(ro),at=Pl;class kt extends Wg.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,a,c]=await kt._runAllMiddleware(e,r,this._middleware);return a?(await kt._runReturnHandlers(c),i(s)):n(async h=>{try{await kt._runReturnHandlers(c)}catch(u){return h(u)}return h()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const a=new at.EthereumRpcError(at.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof e.method!="string"){const a=new at.EthereumRpcError(at.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(a,{id:e.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(a){s=a}return s&&(delete i.result,i.error||(i.error=at.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await kt._runAllMiddleware(e,r,this._middleware);if(kt._checkForCompletion(e,r,i),await kt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,a=!1;for(const c of n)if([s,a]=await kt._runMiddleware(e,r,c,i),a)break;return[s,a,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const a=h=>{const u=h||r.error;u&&(r.error=at.serializeError(u)),s([u,!0])},c=h=>{r.error?a(r.error):(h&&(typeof h!="function"&&a(new at.EthereumRpcError(at.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof h}" for request:
+${si(e)}`,{request:e})),i.push(h)),s([null,!1]))};try{n(e,r,c,a)}catch(h){a(h)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new at.EthereumRpcError(at.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
+${si(e)}`,{request:e});if(!n)throw new at.EthereumRpcError(at.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
+${si(e)}`,{request:e})}}rn.JsonRpcEngine=kt;function si(t){return JSON.stringify(t,null,2)}var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.mergeMiddleware=void 0;const zg=rn;function qg(t){const e=new zg.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}ms.mergeMiddleware=qg;(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(hs,t),r(fs,t),r(ps,t),r(tn,t),r(rn,t),r(ms,t)})(to);var Ul={},io={},bi=function(t,e){return bi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},bi(t,e)};function Vl(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");bi(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Cn=function(){return Cn=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;c--)(a=t[c])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function ql(t,e){return function(r,n){e(r,n,t)}}function Jg(t,e,r,n,i,s){function a(A){if(A!==void 0&&typeof A!="function")throw new TypeError("Function expected");return A}for(var c=n.kind,h=c==="getter"?"get":c==="setter"?"set":"value",u=!e&&t?n.static?t:t.prototype:null,p=e||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),f,v=!1,S=r.length-1;S>=0;S--){var C={};for(var N in n)C[N]=N==="access"?{}:n[N];for(var N in n.access)C.access[N]=n.access[N];C.addInitializer=function(A){if(v)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(A||null))};var M=(0,r[S])(c==="accessor"?{get:p.get,set:p.set}:p[h],C);if(c==="accessor"){if(M===void 0)continue;if(M===null||typeof M!="object")throw new TypeError("Object expected");(f=a(M.get))&&(p.get=f),(f=a(M.set))&&(p.set=f),(f=a(M.init))&&i.unshift(f)}else(f=a(M))&&(c==="field"?i.unshift(f):p[h]=f)}u&&Object.defineProperty(u,n.name,p),v=!0}function Gg(t,e,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function oo(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s}function Kl(){for(var t=[],e=0;e1||c(v,S)})})}function c(v,S){try{h(n[v](S))}catch(C){f(s[0][3],C)}}function h(v){v.value instanceof _r?Promise.resolve(v.value.v).then(u,p):f(s[0][2],v)}function u(v){c("next",v)}function p(v){c("throw",v)}function f(v,S){v(S),s.shift(),s.length&&c(s[0][0],s[0][1])}}function tu(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(a){return(r=!r)?{value:_r(t[i](a)),done:!1}:s?s(a):a}:s}}function ru(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Mn=="function"?Mn(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(a){return new Promise(function(c,h){a=t[s](a),i(c,h,a.done,a.value)})}}function i(s,a,c,h){Promise.resolve(h).then(function(u){s({value:u,done:c})},a)}}function nu(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Kg=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function su(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&_s(e,t,r);return Kg(e,t),e}function iu(t){return t&&t.__esModule?t:{default:t}}function ou(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function au(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function cu(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function lu(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var Xg=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function uu(t){function e(n){t.error=t.hasError?new Xg(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}const Yg={__extends:Vl,__assign:Cn,__rest:Wl,__decorate:zl,__param:ql,__metadata:Jl,__awaiter:Gl,__generator:Zl,__createBinding:_s,__exportStar:Ql,__values:Mn,__read:oo,__spread:Kl,__spreadArrays:Xl,__spreadArray:Yl,__await:_r,__asyncGenerator:eu,__asyncDelegator:tu,__asyncValues:ru,__makeTemplateObject:nu,__importStar:su,__importDefault:iu,__classPrivateFieldGet:ou,__classPrivateFieldSet:au,__classPrivateFieldIn:cu,__addDisposableResource:lu,__disposeResources:uu},em=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:lu,get __assign(){return Cn},__asyncDelegator:tu,__asyncGenerator:eu,__asyncValues:ru,__await:_r,__awaiter:Gl,__classPrivateFieldGet:ou,__classPrivateFieldIn:cu,__classPrivateFieldSet:au,__createBinding:_s,__decorate:zl,__disposeResources:uu,__esDecorate:Jg,__exportStar:Ql,__extends:Vl,__generator:Zl,__importDefault:iu,__importStar:su,__makeTemplateObject:nu,__metadata:Jl,__param:ql,__propKey:Zg,__read:oo,__rest:Wl,__runInitializers:Gg,__setFunctionName:Qg,__spread:Kl,__spreadArray:Yl,__spreadArrays:Xl,__values:Mn,default:Yg},Symbol.toStringTag,{value:"Module"})),ao=In(em);var vs={};Object.defineProperty(vs,"__esModule",{value:!0});var Da=ao,tm=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return Da.__awaiter(this,void 0,void 0,function(){var r,n,i;return Da.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();vs.default=tm;Object.defineProperty(io,"__esModule",{value:!0});var Ha=ao,rm=vs,nm=function(){function t(){this._semaphore=new rm.default(1)}return t.prototype.acquire=function(){return Ha.__awaiter(this,void 0,void 0,function(){var e,r;return Ha.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();io.default=nm;var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.withTimeout=void 0;var _n=ao;function sm(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return _n.__awaiter(n,void 0,void 0,function(){var a,c,h;return _n.__generator(this,function(u){switch(u.label){case 0:return a=!1,setTimeout(function(){a=!0,s(r)},e),[4,t.acquire()];case 1:return c=u.sent(),a?(h=Array.isArray(c)?c[1]:c,h()):i(c),[2]}})})})},runExclusive:function(i){return _n.__awaiter(this,void 0,void 0,function(){var s,a;return _n.__generator(this,function(c){switch(c.label){case 0:s=function(){},c.label=1;case 1:return c.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=c.sent(),Array.isArray(a)?(s=a[1],[4,i(a[0])]):[3,4];case 3:return[2,c.sent()];case 4:return s=a,[4,i()];case 5:return[2,c.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}ys.withTimeout=sm;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=io;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=vs;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=ys;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Ul);var im=am,om=Object.prototype.hasOwnProperty;function am(){for(var t={},e=0;efunction(...i){const s=e.promiseModule;return new s((a,c)=>{e.multiArgs?i.push((...u)=>{e.errorFirst?u[0]?c(u):(u.shift(),a(u)):a(u)}):e.errorFirst?i.push((u,p)=>{u?c(u):a(p)}):i.push(a),Reflect.apply(t,this===r?n:this,i)})},Va=new WeakMap;var hm=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(a,c)=>{let h=Va.get(a);if(h||(h={},Va.set(a,h)),c in h)return h[c];const u=C=>typeof C=="string"||typeof c=="symbol"?c===C:C.test(c),p=Reflect.getOwnPropertyDescriptor(a,c),f=p===void 0||p.writable||p.configurable,S=(e.include?e.include.some(u):!e.exclude.some(u))&&f;return h[c]=S,S},i=new WeakMap,s=new Proxy(t,{apply(a,c,h){const u=i.get(a);if(u)return Reflect.apply(u,c,h);const p=e.excludeMain?a:Ua(a,e,s,a);return i.set(a,p),Reflect.apply(p,c,h)},get(a,c){const h=a[c];if(!n(a,c)||h===Function.prototype[c])return h;const u=i.get(h);if(u)return u;if(typeof h=="function"){const p=Ua(h,e,s,a);return i.set(h,p),p}return h}});return s};const fm=Zr.default;let pm=class extends fm{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var co=pm;const gm=co;let mm=class extends gm{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var _m=mm,sn={minBlockRef:vm,maxBlockRef:ym,sortBlockRefs:lo,bnToHex:wm,blockRefIsNumber:bm,hexToInt:Rn,incrementHexInt:Em,intToHex:du,unsafeRandomBytes:Sm};function vm(...t){return lo(t)[0]}function ym(...t){const e=lo(t);return e[e.length-1]}function lo(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:Rn(e)-Rn(r))}function wm(t){return"0x"+t.toString(16)}function bm(t){return t&&!["earliest","latest","pending"].includes(t)}function Rn(t){return t==null?t:Number.parseInt(t,16)}function Em(t){if(t==null)return t;const e=Rn(t);return du(e+1)}function du(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function Sm(t){let e="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=Im(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=Rm(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),c=(await this._fetchLogs(s)).filter(h=>this.matchLog(h));this.addResults(c)}async _fetchLogs(e){return await Cm(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(vn(this.params.fromBlock)>=vn(e.blockNumber)||Am(this.params.toBlock)&&vn(this.params.toBlock)<=vn(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let a=e.topics[s];if(!a)return!1;a=a.toLowerCase();let c=Array.isArray(i)?i:[i];return c.includes(null)?!0:(c=c.map(p=>p.toLowerCase()),c.includes(a))})}};var xm=Nm,uo=Lm;async function Lm({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=za(e),s=za(r)-n+1,a=Array(s).fill().map((h,u)=>n+u).map(Tm);let c=await Promise.all(a.map(h=>Om(t,"eth_getBlockByNumber",[h,!1])));return c=c.filter(h=>h!==null),c}function za(t){return t==null?t:Number.parseInt(t,16)}function Tm(t){return t==null?t:"0x"+t.toString(16)}function Pm(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function Om(t,e,r){for(let n=0;n<3;n++)try{return await Pm(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const $m=co,Bm=uo,{incrementHexInt:Fm}=sn;let jm=class extends $m{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=Fm(e),a=(await Bm({provider:this.provider,fromBlock:i,toBlock:n})).map(c=>c.hash);this.addResults(a)}};var Dm=jm;const Hm=co,Um=uo,{incrementHexInt:Vm}=sn;let Wm=class extends Hm{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=Vm(e),i=await Um({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const a of i)s.push(...a.transactions);this.addResults(s)}};var zm=Wm;const qm=Ul.Mutex,{createAsyncMiddleware:Jm,createScaffoldMiddleware:Gm}=to,Zm=xm,Qm=Dm,Km=zm,{intToHex:hu,hexToInt:ii}=sn;var Xm=Ym;function Ym({blockTracker:t,provider:e}){let r=0,n={};const i=new qm,s=e_({mutex:i}),a=Gm({eth_newFilter:s(oi(h)),eth_newBlockFilter:s(oi(u)),eth_newPendingTransactionFilter:s(oi(p)),eth_uninstallFilter:s(En(S)),eth_getFilterChanges:s(En(f)),eth_getFilterLogs:s(En(v))}),c=async({oldBlock:I,newBlock:R})=>{if(n.length===0)return;const j=await i.acquire();try{await Promise.all(nr(n).map(async x=>{try{await x.update({oldBlock:I,newBlock:R})}catch(P){console.error(P)}}))}catch(x){console.error(x)}j()};return a.newLogFilter=h,a.newBlockFilter=u,a.newPendingTransactionFilter=p,a.uninstallFilter=S,a.getFilterChanges=f,a.getFilterLogs=v,a.destroy=()=>{M()},a;async function h(I){const R=new Zm({provider:e,params:I});return await C(R),R}async function u(){const I=new Qm({provider:e});return await C(I),I}async function p(){const I=new Km({provider:e});return await C(I),I}async function f(I){const R=ii(I),j=n[R];if(!j)throw new Error(`No filter for index "${R}"`);return j.getChangesAndClear()}async function v(I){const R=ii(I),j=n[R];if(!j)throw new Error(`No filter for index "${R}"`);let x=[];return j.type==="log"&&(x=j.getAllResults()),x}async function S(I){const R=ii(I),x=!!n[R];return x&&await N(R),x}async function C(I){const R=nr(n).length,j=await t.getLatestBlock();await I.initialize({currentBlock:j}),r++,n[r]=I,I.id=r,I.idHex=hu(r);const x=nr(n).length;return A({prevFilterCount:R,newFilterCount:x}),r}async function N(I){const R=nr(n).length;delete n[I];const j=nr(n).length;A({prevFilterCount:R,newFilterCount:j})}async function M(){const I=nr(n).length;n={},A({prevFilterCount:I,newFilterCount:0})}function A({prevFilterCount:I,newFilterCount:R}){if(I===0&&R>0){t.on("sync",c);return}if(I>0&&R===0){t.removeListener("sync",c);return}}}function oi(t){return En(async(...e)=>{const r=await t(...e);return hu(r.id)})}function En(t){return Jm(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function e_({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function nr(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const t_=Zr.default,{createAsyncMiddleware:qa,createScaffoldMiddleware:r_}=to,n_=Xm,{unsafeRandomBytes:s_,incrementHexInt:i_}=sn,o_=uo;var a_=c_;function c_({blockTracker:t,provider:e}){const r={},n=n_({blockTracker:t,provider:e});let i=!1;const s=new t_,a=r_({eth_subscribe:qa(c),eth_unsubscribe:qa(h)});return a.destroy=p,{events:s,middleware:a};async function c(f,v){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const S=f.params[0],C=s_(16);let N;switch(S){case"newHeads":N=M({subId:C});break;case"logs":const I=f.params[1],R=await n.newLogFilter(I);N=A({subId:C,filter:R});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${S}"`)}r[C]=N,v.result=C;return;function M({subId:I}){const R={type:S,destroy:async()=>{t.removeListener("sync",R.update)},update:async({oldBlock:j,newBlock:x})=>{const P=x,q=i_(j);(await o_({provider:e,fromBlock:q,toBlock:P})).map(l_).filter(G=>G!==null).forEach(G=>{u(I,G)})}};return t.on("sync",R.update),R}function A({subId:I,filter:R}){return R.on("update",x=>u(I,x)),{type:S,destroy:async()=>await n.uninstallFilter(R.idHex)}}}async function h(f,v){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const S=f.params[0],C=r[S];if(!C){v.result=!1;return}delete r[S],await C.destroy(),v.result=!0}function u(f,v){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:f,result:v}})}function p(){s.removeAllListeners();for(const f in r)r[f].destroy(),delete r[f];i=!0}}function l_(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(ts,"__esModule",{value:!0});ts.SubscriptionManager=void 0;const u_=Qc,d_=a_,Ja=()=>{};class h_{constructor(e){const r=new u_.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=d_({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,Ja,Ja),r}destroy(){this.subscriptionMiddleware.destroy()}}ts.SubscriptionManager=h_;var fu=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ur,"__esModule",{value:!0});ur.CoinbaseWalletProvider=void 0;const f_=fu(xn),p_=Gu,V=Br,D=T,g_=Hr,Ga=ct,yn=br,rt=vr,ai=fu(Fh),Ir=wr,m_=pr,__=ts,Za="DefaultChainId",Qa="DefaultJsonRpcUrl";class v_ extends p_.EventEmitter{constructor(e){var r,n;super(),this._filterPolyfill=new m_.FilterPolyfill(this),this._subscriptionManager=new __.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl;const i=this.getChainId(),s=(0,D.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const a=this._storage.getItem(Ga.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const c=a.split(" ");c[0]!==""&&(this._addresses=c.map(h=>(0,D.ensureAddressString)(h)),this.emit("accountsChanged",c))}this._subscriptionManager.events.on("notification",c=>{this.emit("message",{type:c.method,data:c.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",c=>{var h;if(!(c.origin!==location.origin||c.source!==window)&&c.data.type==="walletLinkMessage"&&c.data.data.action==="dappChainSwitched"){const u=c.data.data.chainId,p=(h=c.data.data.jsonRpcUrl)!==null&&h!==void 0?h:this.jsonRpcUrl;this.updateProviderInfo(p,Number(u))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,D.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Qa))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(Qa,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(Za,r.toString(10)),((0,D.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,a){const h=await(await this.initializeRelay()).watchAsset(e,r,n,i,s,a==null?void 0:a.toString()).promise;return(0,rt.isErrorResponse)(h)?!1:!!h.result}async addEthereumChain(e,r,n,i,s,a){var c,h;if((0,D.ensureIntNumber)(e)===this.getChainId())return!1;const u=await this.initializeRelay(),p=u.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!p&&await u.requestEthereumAccounts().promise;const f=await u.addEthereumChain(e.toString(),r,s,n,i,a).promise;return(0,rt.isErrorResponse)(f)?!1:(((c=f.result)===null||c===void 0?void 0:c.isApproved)===!0&&this.updateProviderInfo(r[0],e),((h=f.result)===null||h===void 0?void 0:h.isApproved)===!0)}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,rt.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===V.standardErrorCodes.provider.unsupportedChain?V.standardErrors.provider.unsupportedChain():V.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(Ir.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?yn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,V.serializeError)(i,e)})}catch(n){throw(0,V.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],a={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(a).then(c=>c.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,V.serializeError)(n,e)})}catch(n){return Promise.reject((0,V.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,V.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,V.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw V.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw V.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw V.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){const n=await(await this.initializeRelay()).scanQRCode((0,D.ensureRegExpString)(e)).promise;if((0,rt.isErrorResponse)(n))throw(0,V.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,V.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(e,r){const i=await(await this.initializeRelay()).genericRequest(e,r).promise;if((0,rt.isErrorResponse)(i))throw(0,V.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,V.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(e){var r;(r=this.diagnostic)===null||r===void 0||r.log(Ir.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?yn.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof g_.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(e).promise,(0,rt.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(e){const n=await(await this.initializeRelay()).selectProvider(e).promise;if((0,rt.isErrorResponse)(n))throw(0,V.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,V.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,D.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Ga.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(c=>r(Object.assign(Object.assign({},c),{id:e.id}))).catch(c=>n(c));return}const a=this._handleSubscriptionMethods(e);if(a!==void 0){a.then(c=>r({jsonrpc:"2.0",id:e.id,result:c.result})).catch(c=>n(c));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl).catch(s=>{var a;throw(s.code===V.standardErrorCodes.rpc.methodNotFound||s.code===V.standardErrorCodes.rpc.methodNotSupported)&&((a=this.diagnostic)===null||a===void 0||a.log(Ir.EVENTS.METHOD_NOT_IMPLEMENTED,{method:e.method,sessionIdHash:this._relay?yn.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,D.ensureAddressString)(e);return this._addresses.map(i=>(0,D.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(Ir.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,D.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,D.ensureAddressString)(e.to):null,i=e.value!=null?(0,D.ensureBN)(e.value):new f_.default(0),s=e.data?(0,D.ensureBuffer)(e.data):Buffer.alloc(0),a=e.nonce!=null?(0,D.ensureIntNumber)(e.nonce):null,c=e.gasPrice!=null?(0,D.ensureBN)(e.gasPrice):null,h=e.maxFeePerGas!=null?(0,D.ensureBN)(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?(0,D.ensureBN)(e.maxPriorityFeePerGas):null,p=e.gas!=null?(0,D.ensureBN)(e.gas):null,f=e.chainId?(0,D.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:a,gasPriceInWei:c,maxFeePerGas:h,maxPriorityFeePerGas:u,gasLimit:p,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw V.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw V.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{const a=await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise;if((0,rt.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise;if((0,rt.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,D.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(Za);if(!e)return(0,D.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,D.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(Ir.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?yn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,rt.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,D.ensureAddressString)(e[0]),n=(0,D.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,D.ensureBuffer)(e[0]),n=(0,D.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,D.ensureBuffer)(e[0]),n=(0,D.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,D.ensureBuffer)(e[0]),n=(0,D.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,rt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,D.ensureBuffer)(e[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,rt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,rt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,D.ensureParsedJSONObject)(e[0]),n=(0,D.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=ai.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,D.ensureAddressString)(e[0]),n=(0,D.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=ai.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,D.ensureAddressString)(e[0]),n=(0,D.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=ai.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,s;const a=e[0];if(((r=a.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw V.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw V.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const c=parseInt(a.chainId,16);return await this.addEthereumChain(c,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(s=a.iconUrls)!==null&&s!==void 0?s:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw V.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw V.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw V.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw V.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:a,decimals:c}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,c,a,n)}}_eth_uninstallFilter(e){const r=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const r=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}ur.CoinbaseWalletProvider=v_;var ws={};Object.defineProperty(ws,"__esModule",{value:!0});ws.RelayEventManager=void 0;const y_=T;class w_{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,y_.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}ws.RelayEventManager=w_;Object.defineProperty(Lr,"__esModule",{value:!0});Lr.CoinbaseWalletSDK=void 0;const b_=An,E_=Nn,Ka=T,S_=$n,k_=ur,C_=Hr,M_=Jr,R_=ws,I_=Vr,A_=Ur,pu=yr;class bs{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||E_.LINK_API_URL;typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;if(this._storage=new S_.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",bs.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new R_.RelayEventManager;const h=(0,Ka.isMobileWeb)(),u=e.uiConstructor||(f=>h?new M_.MobileRelayUI(f):new I_.WalletLinkRelayUI(f)),p={linkAPIUrl:s,version:pu.LIB_VERSION,darkMode:!!e.darkMode,headlessMode:!!e.headlessMode,uiConstructor:u,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:e.enableMobileWalletLink};this._relay=h?new C_.MobileRelay(p):new A_.WalletLinkRelay(p),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI()}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new k_.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,Ka.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,b_.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}Lr.CoinbaseWalletSDK=bs;bs.VERSION=pu.LIB_VERSION;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=Lr,r=ur;var n=Lr;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=ur;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Ya);const N_=gu(Ya),W_=Object.freeze(Object.defineProperty({__proto__:null,default:N_},Symbol.toStringTag,{value:"Module"}));export{W_ as i};
diff --git a/kinode/src/register-ui/build/assets/index-C3h8FZ1j.js b/kinode/src/register-ui/build/assets/index-C3h8FZ1j.js
deleted file mode 100644
index 51e882d86..000000000
--- a/kinode/src/register-ui/build/assets/index-C3h8FZ1j.js
+++ /dev/null
@@ -1,114 +0,0 @@
-const __vite__fileDeps=["assets/index-gj1MhC63.js","assets/___vite-browser-external_commonjs-proxy-CQs3Tny8.js","assets/clsx.m-BnvdjbFk.js","assets/index-DRmNTW-M.js","assets/index.es-DLVXSpXp.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
-var e,t,n,r,o,a,u,i,s,l,c,d,f,h,p,m,g,y,b,v,w,A,C,E,B,F,D,x,k,j,I,S,P,U,O,N,T,M,R,_,z,L,W,q,Q,H,V,$,G,K,J,Y,Z,X,ee,te,ne,re,oe,ae,ue,ie,se,le,ce,de,fe,he,pe,me,ge,ye,be=e=>{throw TypeError(e)},ve=(e,t,n)=>t.has(e)||be("Cannot "+n),we=(e,t,n)=>(ve(e,t,"read from private field"),n?n.call(e):t.get(e)),Ae=(e,t,n)=>t.has(e)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ce=(e,t,n,r)=>(ve(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ee=(e,t,n)=>(ve(e,t,"access private method"),n),Be=(e,t,n,r)=>({set _(r){Ce(e,t,r,n)},get _(){return we(e,t,r)}});function Fe(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var De="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ke(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var je={exports:{}},Ie={},Se={exports:{}},Pe={},Ue=Symbol.for("react.element"),Oe=Symbol.for("react.portal"),Ne=Symbol.for("react.fragment"),Te=Symbol.for("react.strict_mode"),Me=Symbol.for("react.profiler"),Re=Symbol.for("react.provider"),_e=Symbol.for("react.context"),ze=Symbol.for("react.forward_ref"),Le=Symbol.for("react.suspense"),We=Symbol.for("react.memo"),qe=Symbol.for("react.lazy"),Qe=Symbol.iterator;var He={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ve=Object.assign,$e={};function Ge(e,t,n){this.props=e,this.context=t,this.refs=$e,this.updater=n||He}function Ke(){}function Je(e,t,n){this.props=e,this.context=t,this.refs=$e,this.updater=n||He}Ge.prototype.isReactComponent={},Ge.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},Ge.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},Ke.prototype=Ge.prototype;var Ye=Je.prototype=new Ke;Ye.constructor=Je,Ve(Ye,Ge.prototype),Ye.isPureReactComponent=!0;var Ze=Array.isArray,Xe=Object.prototype.hasOwnProperty,et={current:null},tt={key:!0,ref:!0,__self:!0,__source:!0};function nt(e,t,n){var r,o={},a=null,u=null;if(null!=t)for(r in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(a=""+t.key),t)Xe.call(t,r)&&!tt.hasOwnProperty(r)&&(o[r]=t[r]);var i=arguments.length-2;if(1===i)o.children=n;else if(1>>1,a=e[r];if(!(0>>1;ro(s,n))lo(c,s)?(e[r]=c,e[l]=n,r=l):(e[r]=s,e[i]=n,r=i);else{if(!(lo(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,i=u.now();e.unstable_now=function(){return u.now()-i}}var s=[],l=[],c=1,d=null,f=3,h=!1,p=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function v(e){for(var o=n(l);null!==o;){if(null===o.callback)r(l);else{if(!(o.startTime<=e))break;r(l),o.sortIndex=o.expirationTime,t(s,o)}o=n(l)}}function w(e){if(m=!1,v(e),!p)if(null!==n(s))p=!0,P(A);else{var t=n(l);null!==t&&U(w,t.startTime-e)}}function A(t,o){p=!1,m&&(m=!1,y(F),F=-1),h=!0;var a=f;try{for(v(o),d=n(s);null!==d&&(!(d.expirationTime>o)||t&&!k());){var u=d.callback;if("function"==typeof u){d.callback=null,f=d.priorityLevel;var i=u(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof i?d.callback=i:d===n(s)&&r(s),v(o)}else r(s);d=n(s)}if(null!==d)var c=!0;else{var g=n(l);null!==g&&U(w,g.startTime-o),c=!1}return c}finally{d=null,f=a,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var C,E=!1,B=null,F=-1,D=5,x=-1;function k(){return!(e.unstable_now()-xe||125u?(r.sortIndex=a,t(l,r),null===n(s)&&r===n(l)&&(m?(y(F),F=-1):m=!0,U(w,a-u))):(r.sortIndex=i,t(s,r),p||h||(p=!0,P(A))),r},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(xt),Dt.exports=xt;var kt=Dt.exports,jt=ft,It=kt;
-/**
- * @license React
- * react-dom.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */function St(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nt}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!Mt.call(zt,e)||!Mt.call(_t,e)&&(Rt.test(e)?zt[e]=!0:(_t[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(qt,Qt);Wt[t]=new Lt(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(qt,Qt);Wt[t]=new Lt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(qt,Qt);Wt[t]=new Lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){Wt[e]=new Lt(e,1,!1,e.toLowerCase(),null,!1,!1)})),Wt.xlinkHref=new Lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){Wt[e]=new Lt(e,1,!1,e.toLowerCase(),null,!0,!0)}));var Vt=jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$t=Symbol.for("react.element"),Gt=Symbol.for("react.portal"),Kt=Symbol.for("react.fragment"),Jt=Symbol.for("react.strict_mode"),Yt=Symbol.for("react.profiler"),Zt=Symbol.for("react.provider"),Xt=Symbol.for("react.context"),en=Symbol.for("react.forward_ref"),tn=Symbol.for("react.suspense"),nn=Symbol.for("react.suspense_list"),rn=Symbol.for("react.memo"),on=Symbol.for("react.lazy"),an=Symbol.for("react.offscreen"),un=Symbol.iterator;function sn(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=un&&e[un]||e["@@iterator"])?e:null}var ln,cn=Object.assign;function dn(e){if(void 0===ln)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ln=t&&t[1]||""}return"\n"+ln+e}var fn=!1;function hn(e,t){if(!e||fn)return"";fn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&"string"==typeof l.stack){for(var o=l.stack.split("\n"),a=r.stack.split("\n"),u=o.length-1,i=a.length-1;1<=u&&0<=i&&o[u]!==a[i];)i--;for(;1<=u&&0<=i;u--,i--)if(o[u]!==a[i]){if(1!==u||1!==i)do{if(u--,0>--i||o[u]!==a[i]){var s="\n"+o[u].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}}while(1<=u&&0<=i);break}}}finally{fn=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?dn(e):""}function pn(e){switch(e.tag){case 5:return dn(e.type);case 16:return dn("Lazy");case 13:return dn("Suspense");case 19:return dn("SuspenseList");case 0:case 2:case 15:return e=hn(e.type,!1);case 11:return e=hn(e.type.render,!1);case 1:return e=hn(e.type,!0);default:return""}}function mn(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case Kt:return"Fragment";case Gt:return"Portal";case Yt:return"Profiler";case Jt:return"StrictMode";case tn:return"Suspense";case nn:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case Xt:return(e.displayName||"Context")+".Consumer";case Zt:return(e._context.displayName||"Context")+".Provider";case en:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case rn:return null!==(t=e.displayName||null)?t:mn(e.type)||"Memo";case on:t=e._payload,e=e._init;try{return mn(e(t))}catch(n){}}return null}function gn(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mn(t);case 8:return t===Jt?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function yn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function bn(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function vn(e){e._valueTracker||(e._valueTracker=function(e){var t=bn(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function wn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=bn(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function An(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Cn(e,t){var n=t.checked;return cn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function En(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=yn(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Bn(e,t){null!=(t=t.checked)&&Ht(e,"checked",t,!1)}function Fn(e,t){Bn(e,t);var n=yn(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?xn(e,t.type,n):t.hasOwnProperty("defaultValue")&&xn(e,t.type,yn(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Dn(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function xn(e,t,n){"number"===t&&An(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var kn=Array.isArray;function jn(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Tn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return Mn(e,t)}))}:Mn);function _n(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var zn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ln=["Webkit","ms","Moz","O"];function Wn(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||zn.hasOwnProperty(e)&&zn[e]?(""+t).trim():t+"px"}function qn(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=Wn(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(zn).forEach((function(e){Ln.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zn[t]=zn[e]}))}));var Qn=cn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Hn(e,t){if(t){if(Qn[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(St(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(St(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(St(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(St(62))}}function Vn(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $n=null;function Gn(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Kn=null,Jn=null,Yn=null;function Zn(e){if(e=Vu(e)){if("function"!=typeof Kn)throw Error(St(280));var t=e.stateNode;t&&(t=Gu(t),Kn(e.stateNode,e.type,t))}}function Xn(e){Jn?Yn?Yn.push(e):Yn=[e]:Jn=e}function er(){if(Jn){var e=Jn,t=Yn;if(Yn=Jn=null,Zn(e),t)for(e=0;e>>=0,0===e?32:31-(Or(e)/Nr|0)|0},Or=Math.log,Nr=Math.LN2;var Tr=64,Mr=4194304;function Rr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function _r(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes,u=268435455&n;if(0!==u){var i=u&~o;0!==i?r=Rr(i):0!==(a&=u)&&(r=Rr(a))}else 0!==(u=n&~o)?r=Rr(u):0!==a&&(r=Rr(a));if(0===r)return 0;if(0!==t&&t!==r&&!(t&o)&&((o=r&-r)>=(a=t&-t)||16===o&&4194240&a))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Qr(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-Ur(t)]=n}function Hr(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ur(n),o=1<=sa),da=String.fromCharCode(32),fa=!1;function ha(e,t){switch(e){case"keyup":return-1!==ua.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pa(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var ma=!1;var ga={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ya(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ga[e.type]:"textarea"===t}function ba(e,t,n,r){Xn(r),0<(t=vu(t,"onChange")).length&&(n=new Mo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var va=null,wa=null;function Aa(e){du(e,0)}function Ca(e){if(wn($u(e)))return e}function Ea(e,t){if("change"===e)return t}var Ba=!1;if(Tt){var Fa;if(Tt){var Da="oninput"in document;if(!Da){var xa=document.createElement("div");xa.setAttribute("oninput","return;"),Da="function"==typeof xa.oninput}Fa=Da}else Fa=!1;Ba=Fa&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ta(r)}}function Ra(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Ra(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function _a(){for(var e=window,t=An();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=An((e=t.contentWindow).document)}return t}function za(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function La(e){var t=_a(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ra(n.ownerDocument.documentElement,n)){if(null!==r&&za(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,a=Math.min(r.start,o);r=void 0===r.end?a:Math.min(r.end,o),!e.extend&&a>r&&(o=r,r=a,a=o),o=Ma(n,a);var u=Ma(n,r);o&&u&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(u.node,u.offset)):(t.setEnd(u.node,u.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n=document.documentMode,qa=null,Qa=null,Ha=null,Va=!1;function $a(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;Va||null==qa||qa!==An(r)||("selectionStart"in(r=qa)&&za(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},Ha&&Na(Ha,r)||(Ha=r,0<(r=vu(Qa,"onSelect")).length&&(t=new Mo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=qa)))}function Ga(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ka={animationend:Ga("Animation","AnimationEnd"),animationiteration:Ga("Animation","AnimationIteration"),animationstart:Ga("Animation","AnimationStart"),transitionend:Ga("Transition","TransitionEnd")},Ja={},Ya={};function Za(e){if(Ja[e])return Ja[e];if(!Ka[e])return e;var t,n=Ka[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ya)return Ja[e]=n[t];return e}Tt&&(Ya=document.createElement("div").style,"AnimationEvent"in window||(delete Ka.animationend.animation,delete Ka.animationiteration.animation,delete Ka.animationstart.animation),"TransitionEvent"in window||delete Ka.transitionend.transition);var Xa=Za("animationend"),eu=Za("animationiteration"),tu=Za("animationstart"),nu=Za("transitionend"),ru=new Map,ou="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function au(e,t){ru.set(e,t),Ot(t,[e])}for(var uu=0;uuJu||(e.current=Ku[Ju],Ku[Ju]=null,Ju--)}function Xu(e,t){Ju++,Ku[Ju]=e.current,e.current=t}var ei={},ti=Yu(ei),ni=Yu(!1),ri=ei;function oi(e,t){var n=e.type.contextTypes;if(!n)return ei;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,a={};for(o in n)a[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ai(e){return null!=(e=e.childContextTypes)}function ui(){Zu(ni),Zu(ti)}function ii(e,t,n){if(ti.current!==ei)throw Error(St(168));Xu(ti,t),Xu(ni,n)}function si(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(St(108,gn(e)||"Unknown",o));return cn({},n,r)}function li(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ei,ri=ti.current,Xu(ti,e),Xu(ni,ni.current),!0}function ci(e,t,n){var r=e.stateNode;if(!r)throw Error(St(169));n?(e=si(e,t,ri),r.__reactInternalMemoizedMergedChildContext=e,Zu(ni),Zu(ti),Xu(ti,e)):Zu(ni),Xu(ni,n)}var di=null,fi=!1,hi=!1;function pi(e){null===di?di=[e]:di.push(e)}function mi(){if(!hi&&null!==di){hi=!0;var e=0,t=Vr;try{var n=di;for(Vr=1;e>=u,o-=u,Ei=1<<32-Ur(t)+o|n<m?(g=p,p=null):g=p.sibling;var y=f(o,p,i[m],s);if(null===y){null===p&&(p=g);break}e&&p&&null===y.alternate&&t(o,p),u=a(y,u,m),null===c?l=y:c.sibling=y,c=y,p=g}if(m===i.length)return n(o,p),Si&&Fi(o,m),l;if(null===p){for(;mm?(g=p,p=null):g=p.sibling;var b=f(o,p,y.value,s);if(null===b){null===p&&(p=g);break}e&&p&&null===b.alternate&&t(o,p),u=a(b,u,m),null===c?l=b:c.sibling=b,c=b,p=g}if(y.done)return n(o,p),Si&&Fi(o,m),l;if(null===p){for(;!y.done;m++,y=i.next())null!==(y=d(o,y.value,s))&&(u=a(y,u,m),null===c?l=y:c.sibling=y,c=y);return Si&&Fi(o,m),l}for(p=r(o,p);!y.done;m++,y=i.next())null!==(y=h(p,o,m,y.value,s))&&(e&&null!==y.alternate&&p.delete(null===y.key?m:y.key),u=a(y,u,m),null===c?l=y:c.sibling=y,c=y);return e&&p.forEach((function(e){return t(o,e)})),Si&&Fi(o,m),l}(s,l,c,p);ws(s,c)}return"string"==typeof c&&""!==c||"number"==typeof c?(c=""+c,null!==l&&6===l.tag?(n(s,l.sibling),(l=o(l,c)).return=s,s=l):(n(s,l),(l=df(c,s.mode,p)).return=s,s=l),u(s)):n(s,l)}}var Es=Cs(!0),Bs=Cs(!1),Fs={},Ds=Yu(Fs),xs=Yu(Fs),ks=Yu(Fs);function js(e){if(e===Fs)throw Error(St(174));return e}function Is(e,t){switch(Xu(ks,t),Xu(xs,e),Xu(Ds,Fs),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Nn(null,"");break;default:t=Nn(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Zu(Ds),Xu(Ds,t)}function Ss(){Zu(Ds),Zu(xs),Zu(ks)}function Ps(e){js(ks.current);var t=js(Ds.current),n=Nn(t,e.type);t!==n&&(Xu(xs,e),Xu(Ds,n))}function Us(e){xs.current===e&&(Zu(Ds),Zu(xs))}var Os=Yu(0);function Ns(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ts=[];function Ms(){for(var e=0;en?n:4,e(!0);var r=_s.transition;_s.transition={};try{e(!1),t()}finally{Vr=n,_s.transition=r}}function Dl(){return Xs().memoizedState}function xl(e,t,n){var r=kd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},jl(e))Il(t,n);else if(null!==(n=ts(e,t,n,r))){jd(n,e,r,xd()),Sl(n,t,r)}}function kl(e,t,n){var r=kd(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(jl(e))Il(t,o);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var u=t.lastRenderedState,i=a(u,n);if(o.hasEagerState=!0,o.eagerState=i,Oa(i,u)){var s=t.interleaved;return null===s?(o.next=o,es(t)):(o.next=s.next,s.next=o),void(t.interleaved=o)}}catch(l){}null!==(n=ts(e,t,o,r))&&(jd(n,e,r,o=xd()),Sl(n,t,r))}}function jl(e){var t=e.alternate;return e===Ls||null!==t&&t===Ls}function Il(e,t){Hs=Qs=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sl(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Hr(e,n)}}var Pl={readContext:Zi,useCallback:Gs,useContext:Gs,useEffect:Gs,useImperativeHandle:Gs,useInsertionEffect:Gs,useLayoutEffect:Gs,useMemo:Gs,useReducer:Gs,useRef:Gs,useState:Gs,useDebugValue:Gs,useDeferredValue:Gs,useTransition:Gs,useMutableSource:Gs,useSyncExternalStore:Gs,useId:Gs,unstable_isNewReconciler:!1},Ul={readContext:Zi,useCallback:function(e,t){return Zs().memoizedState=[e,void 0===t?null:t],e},useContext:Zi,useEffect:ml,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,hl(4194308,4,vl.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hl(4194308,4,e,t)},useInsertionEffect:function(e,t){return hl(4,2,e,t)},useMemo:function(e,t){var n=Zs();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Zs();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xl.bind(null,Ls,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Zs().memoizedState=e},useState:cl,useDebugValue:Al,useDeferredValue:function(e){return Zs().memoizedState=e},useTransition:function(){var e=cl(!1),t=e[0];return e=Fl.bind(null,e[1]),Zs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ls,o=Zs();if(Si){if(void 0===n)throw Error(St(407));n=n()}else{if(n=t(),null===nd)throw Error(St(349));30&zs||al(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,ml(il.bind(null,r,a,e),[e]),r.flags|=2048,dl(9,ul.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Zs(),t=nd.identifierPrefix;if(Si){var n=Bi;t=":"+t+"R"+(n=(Ei&~(1<<32-Ur(Ei)-1)).toString(32)+n),0<(n=Vs++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=$s++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ol={readContext:Zi,useCallback:Cl,useContext:Zi,useEffect:gl,useImperativeHandle:wl,useInsertionEffect:yl,useLayoutEffect:bl,useMemo:El,useReducer:tl,useRef:fl,useState:function(){return tl(el)},useDebugValue:Al,useDeferredValue:function(e){return Bl(Xs(),Ws.memoizedState,e)},useTransition:function(){return[tl(el)[0],Xs().memoizedState]},useMutableSource:rl,useSyncExternalStore:ol,useId:Dl,unstable_isNewReconciler:!1},Nl={readContext:Zi,useCallback:Cl,useContext:Zi,useEffect:gl,useImperativeHandle:wl,useInsertionEffect:yl,useLayoutEffect:bl,useMemo:El,useReducer:nl,useRef:fl,useState:function(){return nl(el)},useDebugValue:Al,useDeferredValue:function(e){var t=Xs();return null===Ws?t.memoizedState=e:Bl(t,Ws.memoizedState,e)},useTransition:function(){return[nl(el)[0],Xs().memoizedState]},useMutableSource:rl,useSyncExternalStore:ol,useId:Dl,unstable_isNewReconciler:!1};function Tl(e,t){try{var n="",r=t;do{n+=pn(r),r=r.return}while(r);var o=n}catch(a){o="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:o,digest:null}}function Ml(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Rl(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var _l="function"==typeof WeakMap?WeakMap:Map;function zl(e,t,n){(n=us(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){yd||(yd=!0,bd=r),Rl(0,t)},n}function Ll(e,t,n){(n=us(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Rl(0,t)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){Rl(0,t),"function"!=typeof r&&(null===vd?vd=new Set([this]):vd.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Wl(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new _l;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Zd.bind(null,e,t,n),t.then(e,e))}function ql(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function Ql(e,t,n,r,o){return 1&e.mode?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=us(-1,1)).tag=2,is(n,t,1))),n.lanes|=1),e)}var Hl=Vt.ReactCurrentOwner,Vl=!1;function $l(e,t,n,r){t.child=null===e?Bs(t,null,n,r):Es(t,e.child,n,r)}function Gl(e,t,n,r,o){n=n.render;var a=t.ref;return Yi(t,o),r=Js(e,t,n,r,a,o),n=Ys(),null===e||Vl?(Si&&n&&xi(t),t.flags|=1,$l(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,yc(e,t,o))}function Kl(e,t,n,r,o){if(null===e){var a=n.type;return"function"!=typeof a||af(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=sf(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Jl(e,t,a,r,o))}if(a=e.child,!(e.lanes&o)){var u=a.memoizedProps;if((n=null!==(n=n.compare)?n:Na)(u,r)&&e.ref===t.ref)return yc(e,t,o)}return t.flags|=1,(e=uf(a,r)).ref=t.ref,e.return=t,t.child=e}function Jl(e,t,n,r,o){if(null!==e){var a=e.memoizedProps;if(Na(a,r)&&e.ref===t.ref){if(Vl=!1,t.pendingProps=r=a,!(e.lanes&o))return t.lanes=e.lanes,yc(e,t,o);131072&e.flags&&(Vl=!0)}}return Xl(e,t,n,r,o)}function Yl(e,t,n){var r=t.pendingProps,o=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Xu(ud,ad),ad|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,Xu(ud,ad),ad|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xu(ud,ad),ad|=n;else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,Xu(ud,ad),ad|=r;return $l(e,t,o,n),t.child}function Zl(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Xl(e,t,n,r,o){var a=ai(n)?ri:ti.current;return a=oi(t,a),Yi(t,o),n=Js(e,t,n,r,a,o),r=Ys(),null===e||Vl?(Si&&r&&xi(t),t.flags|=1,$l(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,yc(e,t,o))}function ec(e,t,n,r,o){if(ai(n)){var a=!0;li(t)}else a=!1;if(Yi(t,o),null===t.stateNode)gc(e,t),gs(t,n,r),bs(t,n,r,o),r=!0;else if(null===e){var u=t.stateNode,i=t.memoizedProps;u.props=i;var s=u.context,l=n.contextType;"object"==typeof l&&null!==l?l=Zi(l):l=oi(t,l=ai(n)?ri:ti.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof u.getSnapshotBeforeUpdate;d||"function"!=typeof u.UNSAFE_componentWillReceiveProps&&"function"!=typeof u.componentWillReceiveProps||(i!==r||s!==l)&&ys(t,u,r,l),rs=!1;var f=t.memoizedState;u.state=f,cs(t,r,u,o),s=t.memoizedState,i!==r||f!==s||ni.current||rs?("function"==typeof c&&(hs(t,n,c,r),s=t.memoizedState),(i=rs||ms(t,n,i,r,f,s,l))?(d||"function"!=typeof u.UNSAFE_componentWillMount&&"function"!=typeof u.componentWillMount||("function"==typeof u.componentWillMount&&u.componentWillMount(),"function"==typeof u.UNSAFE_componentWillMount&&u.UNSAFE_componentWillMount()),"function"==typeof u.componentDidMount&&(t.flags|=4194308)):("function"==typeof u.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),u.props=r,u.state=s,u.context=l,r=i):("function"==typeof u.componentDidMount&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,as(e,t),i=t.memoizedProps,l=t.type===t.elementType?i:qi(t.type,i),u.props=l,d=t.pendingProps,f=u.context,"object"==typeof(s=n.contextType)&&null!==s?s=Zi(s):s=oi(t,s=ai(n)?ri:ti.current);var h=n.getDerivedStateFromProps;(c="function"==typeof h||"function"==typeof u.getSnapshotBeforeUpdate)||"function"!=typeof u.UNSAFE_componentWillReceiveProps&&"function"!=typeof u.componentWillReceiveProps||(i!==d||f!==s)&&ys(t,u,r,s),rs=!1,f=t.memoizedState,u.state=f,cs(t,r,u,o);var p=t.memoizedState;i!==d||f!==p||ni.current||rs?("function"==typeof h&&(hs(t,n,h,r),p=t.memoizedState),(l=rs||ms(t,n,l,r,f,p,s)||!1)?(c||"function"!=typeof u.UNSAFE_componentWillUpdate&&"function"!=typeof u.componentWillUpdate||("function"==typeof u.componentWillUpdate&&u.componentWillUpdate(r,p,s),"function"==typeof u.UNSAFE_componentWillUpdate&&u.UNSAFE_componentWillUpdate(r,p,s)),"function"==typeof u.componentDidUpdate&&(t.flags|=4),"function"==typeof u.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof u.componentDidUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof u.getSnapshotBeforeUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),u.props=r,u.state=p,u.context=s,r=l):("function"!=typeof u.componentDidUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof u.getSnapshotBeforeUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return tc(e,t,n,r,a,o)}function tc(e,t,n,r,o,a){Zl(e,t);var u=!!(128&t.flags);if(!r&&!u)return o&&ci(t,n,!1),yc(e,t,a);r=t.stateNode,Hl.current=t;var i=u&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&u?(t.child=Es(t,e.child,null,a),t.child=Es(t,null,i,a)):$l(e,t,i,a),t.memoizedState=r.state,o&&ci(t,n,!0),t.child}function nc(e){var t=e.stateNode;t.pendingContext?ii(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ii(0,t.context,!1),Is(e,t.containerInfo)}function rc(e,t,n,r,o){return zi(),Li(o),t.flags|=256,$l(e,t,n,r),t.child}var oc,ac,uc,ic,sc={dehydrated:null,treeContext:null,retryLane:0};function lc(e){return{baseLanes:e,cachePool:null,transitions:null}}function cc(e,t,n){var r,o=t.pendingProps,a=Os.current,u=!1,i=!!(128&t.flags);if((r=i)||(r=(null===e||null!==e.memoizedState)&&!!(2&a)),r?(u=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Xu(Os,1&a),null===e)return Ti(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=o.children,e=o.fallback,u?(o=t.mode,u=t.child,i={mode:"hidden",children:i},1&o||null===u?u=cf(i,o,0,null):(u.childLanes=0,u.pendingProps=i),e=lf(e,o,n,null),u.return=t,e.return=t,u.sibling=e,t.child=u,t.child.memoizedState=lc(n),t.memoizedState=sc,e):dc(t,i));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,u){if(n)return 256&t.flags?(t.flags&=-257,fc(e,t,u,r=Ml(Error(St(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=cf({mode:"visible",children:r.children},o,0,null),(a=lf(a,o,u,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,1&t.mode&&Es(t,e.child,null,u),t.child.memoizedState=lc(u),t.memoizedState=sc,a);if(!(1&t.mode))return fc(e,t,u,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var i=r.dgst;return r=i,fc(e,t,u,r=Ml(a=Error(St(419)),r,void 0))}if(i=!!(u&e.childLanes),Vl||i){if(null!==(r=nd)){switch(u&-u){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=o&(r.suspendedLanes|u)?0:o)&&o!==a.retryLane&&(a.retryLane=o,ns(e,o),jd(r,e,o,-1))}return Wd(),fc(e,t,u,r=Ml(Error(St(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=ef.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,Ii=Tu(o.nextSibling),ji=t,Si=!0,Pi=null,null!==e&&(wi[Ai++]=Ei,wi[Ai++]=Bi,wi[Ai++]=Ci,Ei=e.id,Bi=e.overflow,Ci=t),t=dc(t,r.children),t.flags|=4096,t)}(e,t,i,o,r,a,n);if(u){u=o.fallback,i=t.mode,r=(a=e.child).sibling;var s={mode:"hidden",children:o.children};return 1&i||t.child===a?(o=uf(a,s)).subtreeFlags=14680064&a.subtreeFlags:((o=t.child).childLanes=0,o.pendingProps=s,t.deletions=null),null!==r?u=uf(r,u):(u=lf(u,i,n,null)).flags|=2,u.return=t,o.return=t,o.sibling=u,t.child=o,o=u,u=t.child,i=null===(i=e.child.memoizedState)?lc(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},u.memoizedState=i,u.childLanes=e.childLanes&~n,t.memoizedState=sc,o}return e=(u=e.child).sibling,o=uf(u,{mode:"visible",children:o.children}),!(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function dc(e,t){return(t=cf({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function fc(e,t,n,r){return null!==r&&Li(r),Es(t,e.child,null,n),(e=dc(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function hc(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ji(e.return,t,n)}function pc(e,t,n,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o)}function mc(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;if($l(e,t,r.children,n),2&(r=Os.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&hc(e,n,t);else if(19===e.tag)hc(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Xu(Os,r),1&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Ns(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),pc(t,!1,o,n,a);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Ns(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}pc(t,!0,n,null,a);break;case"together":pc(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function gc(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yc(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),ld|=t.lanes,!(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(St(153));if(null!==t.child){for(n=uf(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=uf(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function bc(e,t){if(!Si)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function vc(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function wc(e,t,n){var r=t.pendingProps;switch(ki(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vc(t),null;case 1:case 17:return ai(t.type)&&ui(),vc(t),null;case 3:return r=t.stateNode,Ss(),Zu(ni),Zu(ti),Ms(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Ri(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==Pi&&(Ud(Pi),Pi=null))),ac(e,t),vc(t),null;case 5:Us(t);var o=js(ks.current);if(n=t.type,null!==e&&null!=t.stateNode)uc(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(St(166));return vc(t),null}if(e=js(Ds.current),Ri(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[_u]=t,r[zu]=a,e=!!(1&t.mode),n){case"dialog":fu("cancel",r),fu("close",r);break;case"iframe":case"object":case"embed":fu("load",r);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),"select"===n&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[_u]=t,e[zu]=r,oc(e,t,!1,!1),t.stateNode=e;e:{switch(u=Vn(n,r),n){case"dialog":fu("cancel",e),fu("close",e),o=r;break;case"iframe":case"object":case"embed":fu("load",e),o=r;break;case"video":case"audio":for(o=0;omd&&(t.flags|=128,r=!0,bc(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=Ns(u))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),bc(a,!0),null===a.tail&&"hidden"===a.tailMode&&!u.alternate&&!Si)return vc(t),null}else 2*Br()-a.renderingStartTime>md&&1073741824!==n&&(t.flags|=128,r=!0,bc(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(null!==(n=a.last)?n.sibling=u:t.child=u,a.last=u)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Br(),t.sibling=null,n=Os.current,Xu(Os,r?1&n|2:1&n),t):(vc(t),null);case 22:case 23:return Rd(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&1&t.mode?!!(1073741824&ad)&&(vc(t),6&t.subtreeFlags&&(t.flags|=8192)):vc(t),null;case 24:case 25:return null}throw Error(St(156,t.tag))}function Ac(e,t){switch(ki(t),t.tag){case 1:return ai(t.type)&&ui(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Ss(),Zu(ni),Zu(ti),Ms(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Us(t),null;case 13:if(Zu(Os),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(St(340));zi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Zu(Os),null;case 4:return Ss(),null;case 10:return Ki(t.type._context),null;case 22:case 23:return Rd(),null;default:return null}}oc=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ac=function(){},uc=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,js(Ds.current);var a,u=null;switch(n){case"input":o=Cn(e,o),r=Cn(e,r),u=[];break;case"select":o=cn({},o,{value:void 0}),r=cn({},r,{value:void 0}),u=[];break;case"textarea":o=In(e,o),r=In(e,r),u=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=Du)}for(l in Hn(n,r),n=null,o)if(!r.hasOwnProperty(l)&&o.hasOwnProperty(l)&&null!=o[l])if("style"===l){var i=o[l];for(a in i)i.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(Ut.hasOwnProperty(l)?u||(u=[]):(u=u||[]).push(l,null));for(l in r){var s=r[l];if(i=null!=o?o[l]:void 0,r.hasOwnProperty(l)&&s!==i&&(null!=s||null!=i))if("style"===l)if(i){for(a in i)!i.hasOwnProperty(a)||s&&s.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in s)s.hasOwnProperty(a)&&i[a]!==s[a]&&(n||(n={}),n[a]=s[a])}else n||(u||(u=[]),u.push(l,n)),n=s;else"dangerouslySetInnerHTML"===l?(s=s?s.__html:void 0,i=i?i.__html:void 0,null!=s&&i!==s&&(u=u||[]).push(l,s)):"children"===l?"string"!=typeof s&&"number"!=typeof s||(u=u||[]).push(l,""+s):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(Ut.hasOwnProperty(l)?(null!=s&&"onScroll"===l&&fu("scroll",e),u||i===s||(u=[])):(u=u||[]).push(l,s))}n&&(u=u||[]).push("style",n);var l=u;(t.updateQueue=l)&&(t.flags|=4)}},ic=function(e,t,n,r){n!==r&&(t.flags|=4)};var Cc=!1,Ec=!1,Bc="function"==typeof WeakSet?WeakSet:Set,Fc=null;function Dc(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(r){Yd(e,t,r)}else n.current=null}function xc(e,t,n){try{n()}catch(r){Yd(e,t,r)}}var kc=!1;function jc(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,void 0!==a&&xc(t,n,a)}o=o.next}while(o!==r)}}function Ic(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Sc(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function Pc(e){var t=e.alternate;null!==t&&(e.alternate=null,Pc(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[_u],delete t[zu],delete t[Wu],delete t[qu],delete t[Qu])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Uc(e){return 5===e.tag||3===e.tag||4===e.tag}function Oc(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Uc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Nc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Du));else if(4!==r&&null!==(e=e.child))for(Nc(e,t,n),e=e.sibling;null!==e;)Nc(e,t,n),e=e.sibling}function Tc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Tc(e,t,n),e=e.sibling;null!==e;)Tc(e,t,n),e=e.sibling}var Mc=null,Rc=!1;function _c(e,t,n){for(n=n.child;null!==n;)zc(e,t,n),n=n.sibling}function zc(e,t,n){if(Pr&&"function"==typeof Pr.onCommitFiberUnmount)try{Pr.onCommitFiberUnmount(Sr,n)}catch(i){}switch(n.tag){case 5:Ec||Dc(n,t);case 6:var r=Mc,o=Rc;Mc=null,_c(e,t,n),Rc=o,null!==(Mc=r)&&(Rc?(e=Mc,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):Mc.removeChild(n.stateNode));break;case 18:null!==Mc&&(Rc?(e=Mc,n=n.stateNode,8===e.nodeType?Nu(e.parentNode,n):1===e.nodeType&&Nu(e,n),go(e)):Nu(Mc,n.stateNode));break;case 4:r=Mc,o=Rc,Mc=n.stateNode.containerInfo,Rc=!0,_c(e,t,n),Mc=r,Rc=o;break;case 0:case 11:case 14:case 15:if(!Ec&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var a=o,u=a.destroy;a=a.tag,void 0!==u&&(2&a||4&a)&&xc(n,t,u),o=o.next}while(o!==r)}_c(e,t,n);break;case 1:if(!Ec&&(Dc(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(i){Yd(n,t,i)}_c(e,t,n);break;case 21:_c(e,t,n);break;case 22:1&n.mode?(Ec=(r=Ec)||null!==n.memoizedState,_c(e,t,n),Ec=r):_c(e,t,n);break;default:_c(e,t,n)}}function Lc(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Bc),t.forEach((function(t){var r=tf.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Wc(e,t){var n=t.deletions;if(null!==n)for(var r=0;ro&&(o=u),r&=~a}if(r=o,10<(r=(120>(r=Br()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Yc(r/1960))-r)){e.timeoutHandle=Iu(Gd.bind(null,e,hd,gd),r);break}Gd(e,hd,gd);break;default:throw Error(St(329))}}}return Id(e,Br()),e.callbackNode===n?Sd.bind(null,e):null}function Pd(e,t){var n=fd;return e.current.memoizedState.isDehydrated&&(_d(e,t).flags|=256),2!==(e=qd(e,t))&&(t=hd,hd=n,null!==t&&Ud(t)),e}function Ud(e){null===hd?hd=e:hd.push.apply(hd,e)}function Od(e,t){for(t&=~dd,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===Ad)var r=!1;else{if(e=Ad,Ad=null,Cd=0,6&td)throw Error(St(331));var o=td;for(td|=4,Fc=e.current;null!==Fc;){var a=Fc,u=a.child;if(16&Fc.flags){var i=a.deletions;if(null!==i){for(var s=0;sBr()-pd?_d(e,0):dd|=n),Id(e,t)}function Xd(e,t){0===t&&(1&e.mode?(t=Mr,!(130023424&(Mr<<=1))&&(Mr=4194304)):t=1);var n=xd();null!==(e=ns(e,t))&&(Qr(e,t,n),Id(e,n))}function ef(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Xd(e,n)}function tf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(St(314))}null!==r&&r.delete(t),Xd(e,n)}function nf(e,t){return wr(e,t)}function rf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function of(e,t,n,r){return new rf(e,t,n,r)}function af(e){return!(!(e=e.prototype)||!e.isReactComponent)}function uf(e,t){var n=e.alternate;return null===n?((n=of(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function sf(e,t,n,r,o,a){var u=2;if(r=e,"function"==typeof e)af(e)&&(u=1);else if("string"==typeof e)u=5;else e:switch(e){case Kt:return lf(n.children,o,a,t);case Jt:u=8,o|=8;break;case Yt:return(e=of(12,n,t,2|o)).elementType=Yt,e.lanes=a,e;case tn:return(e=of(13,n,t,o)).elementType=tn,e.lanes=a,e;case nn:return(e=of(19,n,t,o)).elementType=nn,e.lanes=a,e;case an:return cf(n,o,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case Zt:u=10;break e;case Xt:u=9;break e;case en:u=11;break e;case rn:u=14;break e;case on:u=16,r=null;break e}throw Error(St(130,null==e?e:typeof e,""))}return(t=of(u,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function lf(e,t,n,r){return(e=of(7,e,r,t)).lanes=n,e}function cf(e,t,n,r){return(e=of(22,e,r,t)).elementType=an,e.lanes=n,e.stateNode={isHidden:!1},e}function df(e,t,n){return(e=of(6,e,null,t)).lanes=n,e}function ff(e,t,n){return(t=of(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function hf(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qr(0),this.expirationTimes=qr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qr(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function pf(e,t,n,r,o,a,u,i,s){return e=new hf(e,t,n,i,s),1===t?(t=1,!0===a&&(t|=8)):t=0,a=of(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},os(a),e}function mf(e){if(!e)return ei;e:{if(mr(e=e._reactInternals)!==e||1!==e.tag)throw Error(St(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ai(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(St(171))}if(1===e.tag){var n=e.type;if(ai(n))return si(e,n,t)}return t}function gf(e,t,n,r,o,a,u,i,s){return(e=pf(n,r,!0,e,0,a,0,i,s)).context=mf(null),n=e.current,(a=us(r=xd(),o=kd(n))).callback=null!=t?t:null,is(n,a,o),e.current.lanes=o,Qr(e,o,r),Id(e,r),e}function yf(e,t,n,r){var o=t.current,a=xd(),u=kd(o);return n=mf(n),null===t.context?t.context=n:t.pendingContext=n,(t=us(a,u)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=is(o,t,u))&&(jd(e,o,u,a),ss(e,o,u)),u}function bf(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function vf(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n{o.removeEventListener(Mf,d),s=null}},createHref:e=>t(o,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:h,go:e=>u.go(e)};return m}((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return Wf("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:qf(t)}),0,e)}function _f(e,t){if(!1===e||null==e)throw new Error(t)}function zf(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function Lf(e,t){return{usr:e.state,key:e.key,idx:t}}function Wf(e,t,n,r){return void 0===n&&(n=null),Tf({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?Qf(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function qf(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function Qf(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var Hf,Vf;function $f(e,t,n){void 0===n&&(n="/");let r=ih(("string"==typeof t?Qf(t):t).pathname||"/",n);if(null==r)return null;let o=Gf(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let a=null;for(let u=0;null==a&&u{let u={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};u.relativePath.startsWith("/")&&(_f(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),u.relativePath=u.relativePath.slice(r.length));let i=dh([r,u.relativePath]),s=n.concat(u);e.children&&e.children.length>0&&(_f(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+i+'".'),Gf(e.children,t,s,i)),(null!=e.path||e.index)&&t.push({path:i,score:rh(i,e.index),routesMeta:s})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let r of Kf(e.path))o(e,t,r);else o(e,t)})),t}function Kf(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===r.length)return o?[a,""]:[a];let u=Kf(r.join("/")),i=[];return i.push(...u.map((e=>""===e?a:[a,e].join("/")))),o&&i.push(...u),i.map((t=>e.startsWith("/")&&""===t?"/":t))}(Vf=Hf||(Hf={})).data="data",Vf.deferred="deferred",Vf.redirect="redirect",Vf.error="error";const Jf=/^:[\w-]+$/,Yf=3,Zf=2,Xf=1,eh=10,th=-2,nh=e=>"*"===e;function rh(e,t){let n=e.split("/"),r=n.length;return n.some(nh)&&(r+=th),t&&(r+=Zf),n.filter((e=>!nh(e))).reduce(((e,t)=>e+(Jf.test(t)?Yf:""===t?Xf:eh)),r)}function oh(e,t){let{routesMeta:n}=e,r={},o="/",a=[];for(let u=0;u(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let a=new RegExp(o,t?void 0:"i");return[a,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],u=a.replace(/(.)\/+$/,"$1"),i=o.slice(1);return{params:r.reduce(((e,t,n)=>{let{paramName:r,isOptional:o}=t;if("*"===r){let e=i[n]||"";u=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const s=i[n];return e[r]=o&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{}),pathname:a,pathnameBase:u,pattern:e}}function uh(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return zf(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function ih(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function sh(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function lh(e,t){let n=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function ch(e,t,n,r){let o;void 0===r&&(r=!1),"string"==typeof e?o=Qf(e):(o=Tf({},e),_f(!o.pathname||!o.pathname.includes("?"),sh("?","pathname","search",o)),_f(!o.pathname||!o.pathname.includes("#"),sh("#","pathname","hash",o)),_f(!o.search||!o.search.includes("#"),sh("#","search","hash",o)));let a,u=""===e||""===o.pathname,i=u?"/":o.pathname;if(null==i)a=n;else{let e=t.length-1;if(!r&&i.startsWith("..")){let t=i.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let s=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:o=""}="string"==typeof e?Qf(e):e,a=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:a,search:hh(r),hash:ph(o)}}(o,a),l=i&&"/"!==i&&i.endsWith("/"),c=(u||"."===i)&&n.endsWith("/");return s.pathname.endsWith("/")||!l&&!c||(s.pathname+="/"),s}const dh=e=>e.join("/").replace(/\/\/+/g,"/"),fh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hh=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ph=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";const mh=["post","put","patch","delete"];new Set(mh);const gh=["get",...mh];
-/**
- * React Router v6.22.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */
-function yh(){return yh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current=!0}));let r=ft.useCallback((function(r,o){void 0===o&&(o={}),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,yh({fromRouteId:t},o)))}),[e,t]);return r}():function(){Bh()||_f(!1);let e=ft.useContext(bh),{basename:t,future:n,navigator:r}=ft.useContext(wh),{matches:o}=ft.useContext(Ch),{pathname:a}=Fh(),u=JSON.stringify(lh(o,n.v7_relativeSplatPath)),i=ft.useRef(!1);Dh((()=>{i.current=!0}));let s=ft.useCallback((function(n,o){if(void 0===o&&(o={}),!i.current)return;if("number"==typeof n)return void r.go(n);let s=ch(n,JSON.parse(u),a,"path"===o.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:dh([t,s.pathname])),(o.replace?r.replace:r.push)(s,o.state,o)}),[t,r,u,a,e]);return s}()}function kh(e,t){let{relative:n}=void 0===t?{}:t,{future:r}=ft.useContext(wh),{matches:o}=ft.useContext(Ch),{pathname:a}=Fh(),u=JSON.stringify(lh(o,r.v7_relativeSplatPath));return ft.useMemo((()=>ch(e,JSON.parse(u),a,"path"===n)),[e,u,a,n])}function jh(e,t){return function(e,t,n,r){Bh()||_f(!1);let{navigator:o}=ft.useContext(wh),{matches:a}=ft.useContext(Ch),u=a[a.length-1],i=u?u.params:{};!u||u.pathname;let s=u?u.pathnameBase:"/";u&&u.route;let l,c=Fh();if(t){var d;let e="string"==typeof t?Qf(t):t;"/"===s||(null==(d=e.pathname)?void 0:d.startsWith(s))||_f(!1),l=e}else l=c;let f=l.pathname||"/",h=f;if("/"!==s){let e=s.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let p=$f(e,{pathname:h}),m=function(e,t,n,r){var o,a;void 0===t&&(t=[]);void 0===n&&(n=null);void 0===r&&(r=null);if(null==e){if(null==(a=n)||!a.errors)return null;e=n.matches}let u=e,i=null==(o=n)?void 0:o.errors;if(null!=i){let e=u.findIndex((e=>e.route.id&&(null==i?void 0:i[e.route.id])));e>=0||_f(!1),u=u.slice(0,Math.min(u.length,e+1))}let s=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?u.slice(0,l+1):[u[0]];break}}}return u.reduceRight(((e,r,o)=>{let a,c=!1,d=null,f=null;n&&(a=i&&r.route.id?i[r.route.id]:void 0,d=r.route.errorElement||Sh,s&&(l<0&&0===o?(c=!0,f=null):l===o&&(c=!0,f=r.route.hydrateFallbackElement||null)));let h=t.concat(u.slice(0,o+1)),p=()=>{let t;return t=a?d:c?f:r.route.Component?ft.createElement(r.route.Component,null):r.route.element?r.route.element:e,ft.createElement(Uh,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?ft.createElement(Ph,{location:n.location,revalidation:n.revalidation,component:d,error:a,children:p(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):p()}),null)}(p&&p.map((e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:dh([s,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?s:dh([s,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n,r);if(t&&m)return ft.createElement(Ah.Provider,{value:{location:yh({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:Pf.Pop}},m);return m}(e,t)}function Ih(){let e=function(){var e;let t=ft.useContext(Eh),n=function(e){let t=ft.useContext(vh);return t||_f(!1),t}(Nh.UseRouteError),r=Th(Nh.UseRouteError);if(void 0!==t)return t;return null==(e=n.errors)?void 0:e[r]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return ft.createElement(ft.Fragment,null,ft.createElement("h2",null,"Unexpected Application Error!"),ft.createElement("h3",{style:{fontStyle:"italic"}},t),n?ft.createElement("pre",{style:r},n):null,null)}const Sh=ft.createElement(Ih,null);class Ph extends ft.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?ft.createElement(Ch.Provider,{value:this.props.routeContext},ft.createElement(Eh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Uh(e){let{routeContext:t,match:n,children:r}=e,o=ft.useContext(bh);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),ft.createElement(Ch.Provider,{value:t},r)}var Oh=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Oh||{}),Nh=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Nh||{});function Th(e){let t=function(e){let t=ft.useContext(Ch);return t||_f(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||_f(!1),n.route.id}function Mh(e){let{to:t,replace:n,state:r,relative:o}=e;Bh()||_f(!1);let{future:a,static:u}=ft.useContext(wh),{matches:i}=ft.useContext(Ch),{pathname:s}=Fh(),l=xh(),c=ch(t,lh(i,a.v7_relativeSplatPath),s,"path"===o),d=JSON.stringify(c);return ft.useEffect((()=>l(JSON.parse(d),{replace:n,state:r,relative:o})),[l,d,o,n,r]),null}function Rh(e){_f(!1)}function _h(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Pf.Pop,navigator:a,static:u=!1,future:i}=e;Bh()&&_f(!1);let s=t.replace(/^\/*/,"/"),l=ft.useMemo((()=>({basename:s,navigator:a,static:u,future:yh({v7_relativeSplatPath:!1},i)})),[s,i,a,u]);"string"==typeof r&&(r=Qf(r));let{pathname:c="/",search:d="",hash:f="",state:h=null,key:p="default"}=r,m=ft.useMemo((()=>{let e=ih(c,s);return null==e?null:{location:{pathname:e,search:d,hash:f,state:h,key:p},navigationType:o}}),[s,c,d,f,h,p,o]);return null==m?null:ft.createElement(wh.Provider,{value:l},ft.createElement(Ah.Provider,{children:n,value:m}))}function zh(e){let{children:t,location:n}=e;return jh(Lh(t),n)}function Lh(e,t){void 0===t&&(t=[]);let n=[];return ft.Children.forEach(e,((e,r)=>{if(!ft.isValidElement(e))return;let o=[...t,r];if(e.type===ft.Fragment)return void n.push.apply(n,Lh(e.props.children,o));e.type!==Rh&&_f(!1),e.props.index&&e.props.children&&_f(!1);let a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Lh(e.props.children,o)),n.push(a)})),n}
-/**
- * React Router DOM v6.22.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function Wh(){return Wh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{}));const qh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(UM){}const Qh=pt.startTransition;function Hh(e){let{basename:t,children:n,future:r,window:o}=e,a=ft.useRef();null==a.current&&(a.current=Rf({window:o,v5Compat:!0}));let u=a.current,[i,s]=ft.useState({action:u.action,location:u.location}),{v7_startTransition:l}=r||{},c=ft.useCallback((e=>{l&&Qh?Qh((()=>s(e))):s(e)}),[s,l]);return ft.useLayoutEffect((()=>u.listen(c)),[u,c]),ft.createElement(_h,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:u,future:r})}const Vh="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,$h=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gh=ft.forwardRef((function(e,t){let n,{onClick:r,relative:o,reloadDocument:a,replace:u,state:i,target:s,to:l,preventScrollReset:c,unstable_viewTransition:d}=e,f=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,qh),{basename:h}=ft.useContext(wh),p=!1;if("string"==typeof l&&$h.test(l)&&(n=l,Vh))try{let e=new URL(window.location.href),t=l.startsWith("//")?new URL(e.protocol+l):new URL(l),n=ih(t.pathname,h);t.origin===e.origin&&null!=n?l=n+t.search+t.hash:p=!0}catch(UM){}let m=function(e,t){let{relative:n}=void 0===t?{}:t;Bh()||_f(!1);let{basename:r,navigator:o}=ft.useContext(wh),{hash:a,pathname:u,search:i}=kh(e,{relative:n}),s=u;return"/"!==r&&(s="/"===u?r:dh([r,u])),o.createHref({pathname:s,search:i,hash:a})}(l,{relative:o}),g=function(e,t){let{target:n,replace:r,state:o,preventScrollReset:a,relative:u,unstable_viewTransition:i}=void 0===t?{}:t,s=xh(),l=Fh(),c=kh(e,{relative:u});return ft.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==r?r:qf(l)===qf(c);s(e,{replace:n,state:o,preventScrollReset:a,relative:u,unstable_viewTransition:i})}}),[l,s,c,r,o,n,e,a,u,i])}(l,{replace:u,state:i,target:s,preventScrollReset:c,relative:o,unstable_viewTransition:d});return ft.createElement("a",Wh({},f,{href:n||m,onClick:p||a?r:function(e){r&&r(e),e.defaultPrevented||g(e)},ref:t,target:s}))}));var Kh,Jh,Yh,Zh;(Jh=Kh||(Kh={})).UseScrollRestoration="useScrollRestoration",Jh.UseSubmit="useSubmit",Jh.UseSubmitFetcher="useSubmitFetcher",Jh.UseFetcher="useFetcher",Jh.useViewTransitionState="useViewTransitionState",(Zh=Yh||(Yh={})).UseFetcher="useFetcher",Zh.UseFetchers="useFetchers",Zh.UseScrollRestoration="useScrollRestoration";const Xh={},ep=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),n=(null==e?void 0:e.nonce)||(null==e?void 0:e.getAttribute("nonce"));r=Promise.all(t.map((e=>{if((e=function(e){return"/"+e}(e))in Xh)return;Xh[e]=!0;const t=e.endsWith(".css"),r=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${r}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":"modulepreload",t||(o.as="script",o.crossOrigin=""),o.href=e,n&&o.setAttribute("nonce",n),document.head.appendChild(o),t?new Promise(((t,n)=>{o.addEventListener("load",t),o.addEventListener("error",(()=>n(new Error(`Unable to preload CSS for ${e}`))))})):void 0})))}return r.then((()=>e())).catch((e=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}))};var tp='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',np={rounded:`SFRounded, ui-rounded, "SF Pro Rounded", ${tp}`,system:tp},rp={large:{actionButton:"9999px",connectButton:"12px",modal:"24px",modalMobile:"28px"},medium:{actionButton:"10px",connectButton:"8px",modal:"16px",modalMobile:"18px"},none:{actionButton:"0px",connectButton:"0px",modal:"0px",modalMobile:"0px"},small:{actionButton:"4px",connectButton:"4px",modal:"8px",modalMobile:"8px"}},op={large:{modalOverlay:"blur(20px)"},none:{modalOverlay:"blur(0px)"},small:{modalOverlay:"blur(4px)"}},ap=({borderRadius:e="large",fontStack:t="rounded",overlayBlur:n="none"})=>({blurs:{modalOverlay:op[n].modalOverlay},fonts:{body:np[t]},radii:{actionButton:rp[e].actionButton,connectButton:rp[e].connectButton,menuButton:rp[e].connectButton,modal:rp[e].modal,modalMobile:rp[e].modalMobile}}),up={blue:{accentColor:"#0E76FD",accentColorForeground:"#FFF"},green:{accentColor:"#1DB847",accentColorForeground:"#FFF"},orange:{accentColor:"#FF801F",accentColorForeground:"#FFF"},pink:{accentColor:"#FF5CA0",accentColorForeground:"#FFF"},purple:{accentColor:"#5F5AFA",accentColorForeground:"#FFF"},red:{accentColor:"#FA423C",accentColorForeground:"#FFF"}},ip=up.blue,sp=({accentColor:e=ip.accentColor,accentColorForeground:t=ip.accentColorForeground,...n}={})=>({...ap(n),colors:{accentColor:e,accentColorForeground:t,actionButtonBorder:"rgba(0, 0, 0, 0.04)",actionButtonBorderMobile:"rgba(0, 0, 0, 0.06)",actionButtonSecondaryBackground:"rgba(0, 0, 0, 0.06)",closeButton:"rgba(60, 66, 66, 0.8)",closeButtonBackground:"rgba(0, 0, 0, 0.06)",connectButtonBackground:"#FFF",connectButtonBackgroundError:"#FF494A",connectButtonInnerBackground:"linear-gradient(0deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.06))",connectButtonText:"#25292E",connectButtonTextError:"#FFF",connectionIndicator:"#30E000",downloadBottomCardBackground:"linear-gradient(126deg, rgba(255, 255, 255, 0) 9.49%, rgba(171, 171, 171, 0.04) 71.04%), #FFFFFF",downloadTopCardBackground:"linear-gradient(126deg, rgba(171, 171, 171, 0.2) 9.49%, rgba(255, 255, 255, 0) 71.04%), #FFFFFF",error:"#FF494A",generalBorder:"rgba(0, 0, 0, 0.06)",generalBorderDim:"rgba(0, 0, 0, 0.03)",menuItemBackground:"rgba(60, 66, 66, 0.1)",modalBackdrop:"rgba(0, 0, 0, 0.3)",modalBackground:"#FFF",modalBorder:"transparent",modalText:"#25292E",modalTextDim:"rgba(60, 66, 66, 0.3)",modalTextSecondary:"rgba(60, 66, 66, 0.6)",profileAction:"#FFF",profileActionHover:"rgba(255, 255, 255, 0.5)",profileForeground:"rgba(60, 66, 66, 0.06)",selectedOptionBorder:"rgba(60, 66, 66, 0.1)",standby:"#FFD641"},shadows:{connectButton:"0px 4px 12px rgba(0, 0, 0, 0.1)",dialog:"0px 8px 32px rgba(0, 0, 0, 0.32)",profileDetailsAction:"0px 2px 6px rgba(37, 41, 46, 0.04)",selectedOption:"0px 2px 6px rgba(0, 0, 0, 0.24)",selectedWallet:"0px 2px 6px rgba(0, 0, 0, 0.12)",walletLogo:"0px 2px 16px rgba(0, 0, 0, 0.16)"}});sp.accentColors=up;var lp='{\n "connect_wallet": {\n "label": "Connect Wallet",\n "wrong_network": {\n "label": "Wrong network"\n }\n },\n\n "intro": {\n "title": "What is a Wallet?",\n "description": "A wallet is used to send, receive, store, and display digital assets. It\'s also a new way to log in, without needing to create new accounts and passwords on every website.",\n "digital_asset": {\n "title": "A Home for your Digital Assets",\n "description": "Wallets are used to send, receive, store, and display digital assets like Ethereum and NFTs."\n },\n "login": {\n "title": "A New Way to Log In",\n "description": "Instead of creating new accounts and passwords on every website, just connect your wallet."\n },\n "get": {\n "label": "Get a Wallet"\n },\n "learn_more": {\n "label": "Learn More"\n }\n },\n\n "sign_in": {\n "label": "Verify your account",\n "description": "To finish connecting, you must sign a message in your wallet to verify that you are the owner of this account.",\n "message": {\n "send": "Sign message",\n "preparing": "Preparing message...",\n "cancel": "Cancel",\n "preparing_error": "Error preparing message, please retry!"\n },\n "signature": {\n "waiting": "Waiting for signature...",\n "verifying": "Verifying signature...",\n "signing_error": "Error signing message, please retry!",\n "verifying_error": "Error verifying signature, please retry!",\n "oops_error": "Oops, something went wrong!"\n }\n },\n\n "connect": {\n "label": "Connect",\n "title": "Connect a Wallet",\n "new_to_ethereum": {\n "description": "New to Ethereum wallets?",\n "learn_more": {\n "label": "Learn More"\n }\n },\n "learn_more": {\n "label": "Learn more"\n },\n "recent": "Recent",\n "status": {\n "opening": "Opening %{wallet}...",\n "connecting": "Connecting",\n "connect_mobile": "Continue in %{wallet}",\n "not_installed": "%{wallet} is not installed",\n "not_available": "%{wallet} is not available",\n "confirm": "Confirm connection in the extension",\n "confirm_mobile": "Accept connection request in the wallet"\n },\n "secondary_action": {\n "get": {\n "description": "Don\'t have %{wallet}?",\n "label": "GET"\n },\n "install": {\n "label": "INSTALL"\n },\n "retry": {\n "label": "RETRY"\n }\n },\n "walletconnect": {\n "description": {\n "full": "Need the official WalletConnect modal?",\n "compact": "Need the WalletConnect modal?"\n },\n "open": {\n "label": "OPEN"\n }\n }\n },\n\n "connect_scan": {\n "title": "Scan with %{wallet}",\n "fallback_title": "Scan with your phone"\n },\n\n "connector_group": {\n "installed": "Installed",\n "recommended": "Recommended",\n "other": "Other",\n "popular": "Popular",\n "more": "More",\n "others": "Others"\n },\n\n "get": {\n "title": "Get a Wallet",\n "action": {\n "label": "GET"\n },\n "mobile": {\n "description": "Mobile Wallet"\n },\n "extension": {\n "description": "Browser Extension"\n },\n "mobile_and_extension": {\n "description": "Mobile Wallet and Extension"\n },\n "mobile_and_desktop": {\n "description": "Mobile and Desktop Wallet"\n },\n "looking_for": {\n "title": "Not what you\'re looking for?",\n "mobile": {\n "description": "Select a wallet on the main screen to get started with a different wallet provider."\n },\n "desktop": {\n "compact_description": "Select a wallet on the main screen to get started with a different wallet provider.",\n "wide_description": "Select a wallet on the left to get started with a different wallet provider."\n }\n }\n },\n\n "get_options": {\n "title": "Get started with %{wallet}",\n "short_title": "Get %{wallet}",\n "mobile": {\n "title": "%{wallet} for Mobile",\n "description": "Use the mobile wallet to explore the world of Ethereum.",\n "download": {\n "label": "Get the app"\n }\n },\n "extension": {\n "title": "%{wallet} for %{browser}",\n "description": "Access your wallet right from your favorite web browser.",\n "download": {\n "label": "Add to %{browser}"\n }\n },\n "desktop": {\n "title": "%{wallet} for %{platform}",\n "description": "Access your wallet natively from your powerful desktop.",\n "download": {\n "label": "Add to %{platform}"\n }\n }\n },\n\n "get_mobile": {\n "title": "Install %{wallet}",\n "description": "Scan with your phone to download on iOS or Android",\n "continue": {\n "label": "Continue"\n }\n },\n\n "get_instructions": {\n "mobile": {\n "connect": {\n "label": "Connect"\n },\n "learn_more": {\n "label": "Learn More"\n }\n },\n "extension": {\n "refresh": {\n "label": "Refresh"\n },\n "learn_more": {\n "label": "Learn More"\n }\n },\n "desktop": {\n "connect": {\n "label": "Connect"\n },\n "learn_more": {\n "label": "Learn More"\n }\n }\n },\n\n "chains": {\n "title": "Switch Networks",\n "wrong_network": "Wrong network detected, switch or disconnect to continue.",\n "confirm": "Confirm in Wallet",\n "switching_not_supported": "Your wallet does not support switching networks from %{appName}. Try switching networks from within your wallet instead.",\n "switching_not_supported_fallback": "Your wallet does not support switching networks from this app. Try switching networks from within your wallet instead.",\n "disconnect": "Disconnect",\n "connected": "Connected"\n },\n\n "profile": {\n "disconnect": {\n "label": "Disconnect"\n },\n "copy_address": {\n "label": "Copy Address",\n "copied": "Copied!"\n },\n "explorer": {\n "label": "View more on explorer"\n },\n "transactions": {\n "description": "%{appName} transactions will appear here...",\n "description_fallback": "Your transactions will appear here...",\n "recent": {\n "title": "Recent Transactions"\n },\n "clear": {\n "label": "Clear All"\n }\n }\n },\n\n "wallet_connectors": {\n "argent": {\n "qr_code": {\n "step1": {\n "description": "Put Argent on your home screen for faster access to your wallet.",\n "title": "Open the Argent app"\n },\n "step2": {\n "description": "Create a wallet and username, or import an existing wallet.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the Scan QR button"\n }\n }\n },\n\n "bifrost": {\n "qr_code": {\n "step1": {\n "description": "We recommend putting Bifrost Wallet on your home screen for quicker access.",\n "title": "Open the Bifrost Wallet app"\n },\n "step2": {\n "description": "Create or import a wallet using your recovery phrase.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the scan button"\n }\n }\n },\n\n "bitget": {\n "qr_code": {\n "step1": {\n "description": "We recommend putting Bitget Wallet on your home screen for quicker access.",\n "title": "Open the Bitget Wallet app"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the scan button"\n }\n },\n\n "extension": {\n "step1": {\n "description": "We recommend pinning Bitget Wallet to your taskbar for quicker access to your wallet.",\n "title": "Install the Bitget Wallet extension"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "bitski": {\n "extension": {\n "step1": {\n "description": "We recommend pinning Bitski to your taskbar for quicker access to your wallet.",\n "title": "Install the Bitski extension"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "bitverse": {\n "qr_code": {\n "step1": {\n "title": "Open the Bitverse Wallet app",\n "description": "Add Bitverse Wallet to your home screen for faster access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Tap the QR icon and scan",\n "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."\n }\n }\n },\n\n "bloom": {\n "desktop": {\n "step1": {\n "title": "Open the Bloom Wallet app",\n "description": "We recommend putting Bloom Wallet on your home screen for quicker access."\n },\n "step2": {\n "description": "Create or import a wallet using your recovery phrase.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you have a wallet, click on Connect to connect via Bloom. A connection prompt in the app will appear for you to confirm the connection.",\n "title": "Click on Connect"\n }\n },\n "qr_code": {\n "step1": {\n "title": "Open the Bloom Wallet app",\n "description": "We recommend putting Bloom Wallet on your home screen for quicker access."\n },\n "step2": {\n "description": "Create or import a wallet using your recovery phrase.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you have a wallet, click on Connect to connect via Bloom. A connection prompt in the app will appear for you to confirm the connection.",\n "title": "Click on Connect"\n }\n }\n },\n\n "bybit": {\n "qr_code": {\n "step1": {\n "description": "We recommend putting Bybit on your home screen for faster access to your wallet.",\n "title": "Open the Bybit app"\n },\n "step2": {\n "description": "You can easily backup your wallet using our backup feature on your phone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the scan button"\n }\n },\n\n "extension": {\n "step1": {\n "description": "Click at the top right of your browser and pin Bybit Wallet for easy access.",\n "title": "Install the Bybit Wallet extension"\n },\n "step2": {\n "description": "Create a new wallet or import an existing one.",\n "title": "Create or Import a wallet"\n },\n "step3": {\n "description": "Once you set up Bybit Wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "coin98": {\n "qr_code": {\n "step1": {\n "description": "We recommend putting Coin98 Wallet on your home screen for faster access to your wallet.",\n "title": "Open the Coin98 Wallet app"\n },\n "step2": {\n "description": "You can easily backup your wallet using our backup feature on your phone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the WalletConnect button"\n }\n },\n\n "extension": {\n "step1": {\n "description": "Click at the top right of your browser and pin Coin98 Wallet for easy access.",\n "title": "Install the Coin98 Wallet extension"\n },\n "step2": {\n "description": "Create a new wallet or import an existing one.",\n "title": "Create or Import a wallet"\n },\n "step3": {\n "description": "Once you set up Coin98 Wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "coinbase": {\n "qr_code": {\n "step1": {\n "description": "We recommend putting Coinbase Wallet on your home screen for quicker access.",\n "title": "Open the Coinbase Wallet app"\n },\n "step2": {\n "description": "You can easily backup your wallet using the cloud backup feature.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the scan button"\n }\n },\n\n "extension": {\n "step1": {\n "description": "We recommend pinning Coinbase Wallet to your taskbar for quicker access to your wallet.",\n "title": "Install the Coinbase Wallet extension"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "compass": {\n "extension": {\n "step1": {\n "description": "We recommend pinning Compass Wallet to your taskbar for quicker access to your wallet.",\n "title": "Install the Compass Wallet extension"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "core": {\n "qr_code": {\n "step1": {\n "description": "We recommend putting Core on your home screen for faster access to your wallet.",\n "title": "Open the Core app"\n },\n "step2": {\n "description": "You can easily backup your wallet using our backup feature on your phone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the WalletConnect button"\n }\n },\n\n "extension": {\n "step1": {\n "description": "We recommend pinning Core to your taskbar for quicker access to your wallet.",\n "title": "Install the Core extension"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "fox": {\n "qr_code": {\n "step1": {\n "description": "We recommend putting FoxWallet on your home screen for quicker access.",\n "title": "Open the FoxWallet app"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the scan button"\n }\n }\n },\n\n "frontier": {\n "qr_code": {\n "step1": {\n "description": "We recommend putting Frontier Wallet on your home screen for quicker access.",\n "title": "Open the Frontier Wallet app"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the scan button"\n }\n },\n\n "extension": {\n "step1": {\n "description": "We recommend pinning Frontier Wallet to your taskbar for quicker access to your wallet.",\n "title": "Install the Frontier Wallet extension"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "im_token": {\n "qr_code": {\n "step1": {\n "title": "Open the imToken app",\n "description": "Put imToken app on your home screen for faster access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Tap Scanner Icon in top right corner",\n "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."\n }\n }\n },\n\n "kaikas": {\n "extension": {\n "step1": {\n "description": "We recommend pinning Kaikas to your taskbar for quicker access to your wallet.",\n "title": "Install the Kaikas extension"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n },\n "qr_code": {\n "step1": {\n "title": "Open the Kaikas app",\n "description": "Put Kaikas app on your home screen for faster access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Tap Scanner Icon in top right corner",\n "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."\n }\n }\n },\n\n "kraken": {\n "qr_code": {\n "step1": {\n "title": "Open the Kraken Wallet app",\n "description": "Add Kraken Wallet to your home screen for faster access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Tap the QR icon and scan",\n "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."\n }\n }\n },\n\n "kresus": {\n "qr_code": {\n "step1": {\n "title": "Open the Kresus Wallet app",\n "description": "Add Kresus Wallet to your home screen for faster access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Tap the QR icon and scan",\n "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."\n }\n }\n },\n\n "magicEden": {\n "extension": {\n "step1": {\n "title": "Install the Magic Eden extension",\n "description": "We recommend pinning Magic Eden to your taskbar for easier access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "metamask": {\n "qr_code": {\n "step1": {\n "title": "Open the MetaMask app",\n "description": "We recommend putting MetaMask on your home screen for quicker access."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Tap the scan button",\n "description": "After you scan, a connection prompt will appear for you to connect your wallet."\n }\n },\n\n "extension": {\n "step1": {\n "title": "Install the MetaMask extension",\n "description": "We recommend pinning MetaMask to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "nestwallet": {\n "extension": {\n "step1": {\n "title": "Install the NestWallet extension",\n "description": "We recommend pinning NestWallet to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "okx": {\n "qr_code": {\n "step1": {\n "title": "Open the OKX Wallet app",\n "description": "We recommend putting OKX Wallet on your home screen for quicker access."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Tap the scan button",\n "description": "After you scan, a connection prompt will appear for you to connect your wallet."\n }\n },\n\n "extension": {\n "step1": {\n "title": "Install the OKX Wallet extension",\n "description": "We recommend pinning OKX Wallet to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "omni": {\n "qr_code": {\n "step1": {\n "title": "Open the Omni app",\n "description": "Add Omni to your home screen for faster access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Tap the QR icon and scan",\n "description": "Tap the QR icon on your home screen, scan the code and confirm the prompt to connect."\n }\n }\n },\n\n "1inch": {\n "qr_code": {\n "step1": {\n "description": "Put 1inch Wallet on your home screen for faster access to your wallet.",\n "title": "Open the 1inch Wallet app"\n },\n "step2": {\n "description": "Create a wallet and username, or import an existing wallet.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the Scan QR button"\n }\n }\n },\n\n "token_pocket": {\n "qr_code": {\n "step1": {\n "title": "Open the TokenPocket app",\n "description": "We recommend putting TokenPocket on your home screen for quicker access."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Tap the scan button",\n "description": "After you scan, a connection prompt will appear for you to connect your wallet."\n }\n },\n\n "extension": {\n "step1": {\n "title": "Install the TokenPocket extension",\n "description": "We recommend pinning TokenPocket to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "trust": {\n "qr_code": {\n "step1": {\n "title": "Open the Trust Wallet app",\n "description": "Put Trust Wallet on your home screen for faster access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Tap WalletConnect in Settings",\n "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."\n }\n },\n\n "extension": {\n "step1": {\n "title": "Install the Trust Wallet extension",\n "description": "Click at the top right of your browser and pin Trust Wallet for easy access."\n },\n "step2": {\n "title": "Create or Import a wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up Trust Wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "uniswap": {\n "qr_code": {\n "step1": {\n "title": "Open the Uniswap app",\n "description": "Add Uniswap Wallet to your home screen for faster access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Tap the QR icon and scan",\n "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."\n }\n }\n },\n\n "zerion": {\n "qr_code": {\n "step1": {\n "title": "Open the Zerion app",\n "description": "We recommend putting Zerion on your home screen for quicker access."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Tap the scan button",\n "description": "After you scan, a connection prompt will appear for you to connect your wallet."\n }\n },\n\n "extension": {\n "step1": {\n "title": "Install the Zerion extension",\n "description": "We recommend pinning Zerion to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "rainbow": {\n "qr_code": {\n "step1": {\n "title": "Open the Rainbow app",\n "description": "We recommend putting Rainbow on your home screen for faster access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "You can easily backup your wallet using our backup feature on your phone."\n },\n "step3": {\n "title": "Tap the scan button",\n "description": "After you scan, a connection prompt will appear for you to connect your wallet."\n }\n }\n },\n\n "enkrypt": {\n "extension": {\n "step1": {\n "description": "We recommend pinning Enkrypt Wallet to your taskbar for quicker access to your wallet.",\n "title": "Install the Enkrypt Wallet extension"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "frame": {\n "extension": {\n "step1": {\n "description": "We recommend pinning Frame to your taskbar for quicker access to your wallet.",\n "title": "Install Frame & the companion extension"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "one_key": {\n "extension": {\n "step1": {\n "title": "Install the OneKey Wallet extension",\n "description": "We recommend pinning OneKey Wallet to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "phantom": {\n "extension": {\n "step1": {\n "title": "Install the Phantom extension",\n "description": "We recommend pinning Phantom to your taskbar for easier access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "rabby": {\n "extension": {\n "step1": {\n "title": "Install the Rabby extension",\n "description": "We recommend pinning Rabby to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "ronin": {\n "qr_code": {\n "step1": {\n "description": "We recommend putting Ronin Wallet on your home screen for quicker access.",\n "title": "Open the Ronin Wallet app"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "After you scan, a connection prompt will appear for you to connect your wallet.",\n "title": "Tap the scan button"\n }\n },\n\n "extension": {\n "step1": {\n "description": "We recommend pinning Ronin Wallet to your taskbar for quicker access to your wallet.",\n "title": "Install the Ronin Wallet extension"\n },\n "step2": {\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",\n "title": "Create or Import a Wallet"\n },\n "step3": {\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",\n "title": "Refresh your browser"\n }\n }\n },\n\n "ramper": {\n "extension": {\n "step1": {\n "title": "Install the Ramper extension",\n "description": "We recommend pinning Ramper to your taskbar for easier access to your wallet."\n },\n "step2": {\n "title": "Create a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "safeheron": {\n "extension": {\n "step1": {\n "title": "Install the Core extension",\n "description": "We recommend pinning Safeheron to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "taho": {\n "extension": {\n "step1": {\n "title": "Install the Taho extension",\n "description": "We recommend pinning Taho to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "talisman": {\n "extension": {\n "step1": {\n "title": "Install the Talisman extension",\n "description": "We recommend pinning Talisman to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import an Ethereum Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your recovery phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "xdefi": {\n "extension": {\n "step1": {\n "title": "Install the XDEFI Wallet extension",\n "description": "We recommend pinning XDEFI Wallet to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "zeal": {\n "extension": {\n "step1": {\n "title": "Install the Zeal extension",\n "description": "We recommend pinning Zeal to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "safepal": {\n "extension": {\n "step1": {\n "title": "Install the SafePal Wallet extension",\n "description": "Click at the top right of your browser and pin SafePal Wallet for easy access."\n },\n "step2": {\n "title": "Create or Import a wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up SafePal Wallet, click below to refresh the browser and load up the extension."\n }\n },\n "qr_code": {\n "step1": {\n "title": "Open the SafePal Wallet app",\n "description": "Put SafePal Wallet on your home screen for faster access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Create a new wallet or import an existing one."\n },\n "step3": {\n "title": "Tap WalletConnect in Settings",\n "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."\n }\n }\n },\n\n "desig": {\n "extension": {\n "step1": {\n "title": "Install the Desig extension",\n "description": "We recommend pinning Desig to your taskbar for easier access to your wallet."\n },\n "step2": {\n "title": "Create a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n }\n },\n\n "subwallet": {\n "extension": {\n "step1": {\n "title": "Install the SubWallet extension",\n "description": "We recommend pinning SubWallet to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your recovery phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n },\n "qr_code": {\n "step1": {\n "title": "Open the SubWallet app",\n "description": "We recommend putting SubWallet on your home screen for quicker access."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Tap the scan button",\n "description": "After you scan, a connection prompt will appear for you to connect your wallet."\n }\n }\n },\n\n "clv": {\n "extension": {\n "step1": {\n "title": "Install the CLV Wallet extension",\n "description": "We recommend pinning CLV Wallet to your taskbar for quicker access to your wallet."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Refresh your browser",\n "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."\n }\n },\n "qr_code": {\n "step1": {\n "title": "Open the CLV Wallet app",\n "description": "We recommend putting CLV Wallet on your home screen for quicker access."\n },\n "step2": {\n "title": "Create or Import a Wallet",\n "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."\n },\n "step3": {\n "title": "Tap the scan button",\n "description": "After you scan, a connection prompt will appear for you to connect your wallet."\n }\n }\n },\n\n "okto": {\n "qr_code": {\n "step1": {\n "title": "Open the Okto app",\n "description": "Add Okto to your home screen for quick access"\n },\n "step2": {\n "title": "Create an MPC Wallet",\n "description": "Create an account and generate a wallet"\n },\n "step3": {\n "title": "Tap WalletConnect in Settings",\n "description": "Tap the Scan QR icon at the top right and confirm the prompt to connect."\n }\n }\n },\n\n "ledger": {\n "desktop": {\n "step1": {\n "title": "Open the Ledger Live app",\n "description": "We recommend putting Ledger Live on your home screen for quicker access."\n },\n "step2": {\n "title": "Set up your Ledger",\n "description": "Set up a new Ledger or connect to an existing one."\n },\n "step3": {\n "title": "Connect",\n "description": "A connection prompt will appear for you to connect your wallet."\n }\n },\n "qr_code": {\n "step1": {\n "title": "Open the Ledger Live app",\n "description": "We recommend putting Ledger Live on your home screen for quicker access."\n },\n "step2": {\n "title": "Set up your Ledger",\n "description": "You can either sync with the desktop app or connect your Ledger."\n },\n "step3": {\n "title": "Scan the code",\n "description": "Tap WalletConnect then Switch to Scanner. After you scan, a connection prompt will appear for you to connect your wallet."\n }\n }\n }\n }\n}\n';var cp=function(e,t){return Object.defineProperty(e,"__recipe__",{value:t,writable:!1}),e};function dp(e){var{conditions:t}=e;if(!t)throw new Error("Styles have no conditions");return cp((function(e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){if(!t.defaultCondition)throw new Error("No default condition");return{[t.defaultCondition]:e}}if(Array.isArray(e)){if(!("responsiveArray"in t))throw new Error("Responsive arrays are not supported");var n={};for(var r in t.responsiveArray)null!=e[r]&&(n[t.responsiveArray[r]]=e[r]);return n}return e}),{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createNormalizeValueFn",args:[{conditions:e.conditions}]})}function fp(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function hp(e,t,n){return(t=fp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mp(e){for(var t=1;te;const yp=e=>e;let bp=class e extends Error{constructor(t,n={}){var r;super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"viem@2.16.2"});const o=n.cause instanceof e?n.cause.details:(null==(r=n.cause)?void 0:r.message)?n.cause.message:n.details,a=n.cause instanceof e&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${n.docsBaseUrl??"https://viem.sh"}${a}${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...o?[`Details: ${o}`]:[],`Version: ${this.version}`].join("\n"),n.cause&&(this.cause=n.cause),this.details=o,this.docsPath=a,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(e){return vp(this,e)}};function vp(e,t){return(null==t?void 0:t(e))?e:e&&"object"==typeof e&&"cause"in e?vp(e.cause,t):t?null:e}class wp extends bp{constructor({max:e,min:t,signed:n,size:r,value:o}){super(`Number "${o}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class Ap extends bp{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class Cp extends bp{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}class Ep extends bp{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class Bp extends bp{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class Fp extends bp{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function Dp(e,{dir:t,size:n=32}={}){return"string"==typeof e?xp(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new Bp({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let o=0;o2*n)throw new Bp({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}function kp(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function jp(e){return kp(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Ip(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,r=0;for(let o=0;o=Up.zero&&e<=Up.nine?e-Up.zero:e>=Up.A&&e<=Up.F?e-(Up.A-10):e>=Up.a&&e<=Up.f?e-(Up.a-10):void 0}function Np(e,t={}){let n=e;t.size&&(Mp(n,{size:t.size}),n=Dp(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const o=r.length/2,a=new Uint8Array(o);for(let u=0,i=0;ut)throw new Cp({givenSize:jp(e),maxSize:t})}function Rp(e,t={}){const{signed:n}=t;t.size&&Mp(e,{size:t.size});const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2;return r<=(1n<<8n*BigInt(o)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*o,"f")}`)-1n}function _p(e,t={}){return Number(Rp(e,t))}function zp(e,t={}){let n=Np(e);return t.size&&(Mp(n,{size:t.size}),n=Ip(n,{dir:"right"})),(new TextDecoder).decode(n)}const Lp=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Wp(e,t={}){return"number"==typeof e||"bigint"==typeof e?Hp(e,t):"string"==typeof e?$p(e,t):"boolean"==typeof e?qp(e,t):Qp(e,t)}function qp(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(Mp(n,{size:t.size}),Dp(n,{size:t.size})):n}function Qp(e,t={}){let n="";for(let o=0;oa||ofunction(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${Kp(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}class Jp extends bp{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class Yp extends bp{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class Zp extends bp{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${Kp(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=n}}class Xp extends bp{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class em extends bp{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class tm extends bp{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${jp(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class nm extends bp{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class rm extends bp{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class om extends bp{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class am extends bp{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class um extends bp{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class im extends bp{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class sm extends bp{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class lm extends bp{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Gp(e.abiItem)}\`, and`,`\`${t.type}\` in \`${Gp(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class cm extends bp{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class dm extends bp{constructor({abiItem:e,data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for non-indexed event parameters.`].join("\n"),{metaMessages:[`Params: (${Kp(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=n,this.size=r}}class fm extends bp{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${Gp(e,{includeName:!0})}".`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class hm extends bp{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class pm extends bp{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class mm extends bp{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class gm extends bp{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class ym extends bp{constructor(e){super(`Type "${e}" is not supported for packed encoding.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedPackedAbiType"})}}function bm(e){return"string"==typeof e[0]?vm(e):function(e){let t=0;for(const o of e)t+=o.length;const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}(e)}function vm(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}class wm extends bp{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class Am extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,t){return super.set(e,t),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}function Cm(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Em(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Bm(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Fm(e,t){Em(e);const n=t.outputLen;if(e.length>xm&Dm)}:{h:0|Number(e>>xm&Dm),l:0|Number(e&Dm)}}function jm(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oe instanceof Uint8Array,Pm=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Um=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function Om(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!Sm(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class Nm{clone(){return this._cloneInto()}}function Tm(e){const t=t=>e().update(Om(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Mm(e=32){if(Im&&"function"==typeof Im.getRandomValues)return Im.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const[Rm,_m,zm]=[[],[],[]],Lm=BigInt(0),Wm=BigInt(1),qm=BigInt(2),Qm=BigInt(7),Hm=BigInt(256),Vm=BigInt(113);for(let NM=0,TM=Wm,MM=1,RM=0;NM<24;NM++){[MM,RM]=[RM,(2*MM+3*RM)%5],Rm.push(2*(5*RM+MM)),_m.push((NM+1)*(NM+2)/2%64);let e=Lm;for(let t=0;t<7;t++)TM=(TM<>Qm)*Vm)%Hm,TM&qm&&(e^=Wm<<(Wm<n>32?((e,t,n)=>t<>>64-n)(e,t,n):((e,t,n)=>e<>>32-n)(e,t,n),Jm=(e,t,n)=>n>32?((e,t,n)=>e<>>64-n)(e,t,n):((e,t,n)=>t<>>32-n)(e,t,n);class Ym extends Nm{constructor(e,t,n,r=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Cm(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var a;this.state=new Uint8Array(200),this.state32=(a=this.state,new Uint32Array(a.buffer,a.byteOffset,Math.floor(a.byteLength/4)))}keccak(){!function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let r=0;r<10;r++)n[r]=e[r]^e[r+10]^e[r+20]^e[r+30]^e[r+40];for(let r=0;r<10;r+=2){const t=(r+8)%10,o=(r+2)%10,a=n[o],u=n[o+1],i=Km(a,u,1)^n[t],s=Jm(a,u,1)^n[t+1];for(let n=0;n<50;n+=10)e[r+n]^=i,e[r+n+1]^=s}let t=e[2],o=e[3];for(let n=0;n<24;n++){const r=_m[n],a=Km(t,o,r),u=Jm(t,o,r),i=Rm[n];t=e[i],o=e[i+1],e[i]=a,e[i+1]=u}for(let r=0;r<50;r+=10){for(let t=0;t<10;t++)n[t]=e[r+t];for(let t=0;t<10;t++)e[r+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=$m[r],e[1]^=Gm[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Bm(this);const{blockLen:t,state:n}=this,r=(e=Om(e)).length;for(let o=0;o=n&&this.keccak();const a=Math.min(n-this.posOut,o-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Cm(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Fm(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:o,enableXOF:a}=this;return e||(e=new Ym(t,n,r,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=n,e.outputLen=r,e.enableXOF=a,e.destroyed=this.destroyed,e}}const Zm=((e,t,n)=>Tm((()=>new Ym(t,e,n))))(1,136,32);function Xm(e,t){const n=t||"hex",r=Zm(kp(e,{strict:!1})?Pp(e):e);return"bytes"===n?r:Wp(r)}const eg=new Am(8192);function tg(e,t){if(eg.has(`${e}.${t}`))return eg.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Xm(Tp(n),"bytes"),o=n.split("");for(let u=0;u<40;u+=2)r[u>>1]>>4>=8&&o[u]&&(o[u]=o[u].toUpperCase()),(15&r[u>>1])>=8&&o[u+1]&&(o[u+1]=o[u+1].toUpperCase());const a=`0x${o.join("")}`;return eg.set(`${e}.${t}`,a),a}function ng(e,t){if(!ag(e,{strict:!1}))throw new wm({address:e});return tg(e,t)}const rg=/^0x[a-fA-F0-9]{40}$/,og=new Am(8192);function ag(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(og.has(r))return og.get(r);const o=!(!rg.test(e)||e.toLowerCase()!==e&&n&&tg(e)!==e);return og.set(r,o),o}function ug(e,t,n,{strict:r}={}){return kp(e,{strict:!1})?cg(e,t,n,{strict:r}):lg(e,t,n,{strict:r})}function ig(e,t){if("number"==typeof t&&t>0&&t>jp(e)-1)throw new Ep({offset:t,position:"start",size:jp(e)})}function sg(e,t,n){if("number"==typeof t&&"number"==typeof n&&jp(e)!==n-t)throw new Ep({offset:n,position:"end",size:jp(e)})}function lg(e,t,n,{strict:r}={}){ig(e,t);const o=e.slice(t,n);return r&&sg(o,t,n),o}function cg(e,t,n,{strict:r}={}){ig(e,t);const o=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;return r&&sg(o,t,n),o}function dg(e,t){if(e.length!==t.length)throw new nm({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r0?bm([t,e]):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:bm(a.map((({encoded:e})=>e)))}}(t,{length:r,param:{...e,type:o}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let o=0;oe)))}}(t,{param:e});if("address"===e.type)return function(e){if(!ag(e))throw new wm({address:e});return{dynamic:!1,encoded:xp(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new bp(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:xp(qp(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:Hp(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=jp(e);if(!n){let t=e;return r%32!=0&&(t=xp(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:bm([xp(Hp(r,{size:32})),t])}}if(r!==Number.parseInt(n))throw new tm({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:xp(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=$p(e),n=Math.ceil(jp(t)/32),r=[];for(let o=0;o"type"in e&&"constructor"===e.type));if(!o)throw new Jp({docsPath:mg});if(!("inputs"in o))throw new Yp({docsPath:mg});if(!o.inputs||0===o.inputs.length)throw new Yp({docsPath:mg});return vm([r,dg(o.inputs,n)])}function yg(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}class bg extends bp{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join("\n"),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class vg extends bp{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class wg extends bp{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class Ag extends bp{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class Cg extends bp{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class Eg extends bp{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}const Bg={gwei:9,wei:18},Fg={ether:-9,wei:9},Dg={ether:-18,gwei:-9};function xg(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,a]=[n.slice(0,n.length-t),n.slice(n.length-t)];return a=a.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${a?`.${a}`:""}`}function kg(e,t="wei"){return xg(e,Fg[t])}class jg extends bp{constructor({cause:e,message:t}={}){var n;const r=null==(n=null==t?void 0:t.replace("execution reverted: ",""))?void 0:n.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(jg,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(jg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Ig extends bp{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${kg(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(Ig,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Sg extends bp{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${kg(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(Sg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Pg extends bp{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(Pg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Ug extends bp{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(Ug,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Og extends bp{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(Og,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Ng extends bp{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(Ng,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class Tg extends bp{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(Tg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Mg extends bp{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(Mg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Rg extends bp{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Rg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class _g extends bp{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${kg(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${kg(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(_g,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class zg extends bp{constructor({cause:e}){super(`An error occurred while executing: ${null==e?void 0:e.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function Lg(e,t="wei"){return xg(e,Bg[t])}function Wg(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}class qg extends bp{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class Qg extends bp{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class Hg extends bp{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Wg(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class Vg extends bp{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}class $g extends bp{constructor(e,{account:t,docsPath:n,chain:r,data:o,gas:a,gasPrice:u,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:l,to:c,value:d}){var f;const h=Wg({chain:r&&`${null==r?void 0:r.name} (id: ${null==r?void 0:r.id})`,from:null==t?void 0:t.address,to:c,value:void 0!==d&&`${Lg(d)} ${(null==(f=null==r?void 0:r.nativeCurrency)?void 0:f.symbol)||"ETH"}`,data:o,gas:a,gasPrice:void 0!==u&&`${kg(u)} gwei`,maxFeePerGas:void 0!==i&&`${kg(i)} gwei`,maxPriorityFeePerGas:void 0!==s&&`${kg(s)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class Gg extends bp{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:r,index:o}){let a="Transaction";n&&void 0!==o&&(a=`Transaction at block time "${n}" at index "${o}"`),e&&void 0!==o&&(a=`Transaction at block hash "${e}" at index "${o}"`),t&&void 0!==o&&(a=`Transaction at block number "${t}" at index "${o}"`),r&&(a=`Transaction with hash "${r}"`),super(`${a} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class Kg extends bp{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class Jg extends bp{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}const Yg=(e,t,n)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),n);class Zg extends bp{constructor({body:e,details:t,headers:n,status:r,url:o}){super("HTTP request failed.",{details:t,metaMessages:[r&&`Status: ${r}`,`URL: ${o}`,e&&`Request body: ${Yg(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=r,this.url=o}}class Xg extends bp{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${Yg(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}}class ey extends bp{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${Yg(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}class ty extends bp{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:o}){super(o,{cause:e,docsPath:n,metaMessages:r||(null==e?void 0:e.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof Xg?e.code:t??-1}}class ny extends ty{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class ry extends ty{constructor(e){super(e,{code:ry.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(ry,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class oy extends ty{constructor(e){super(e,{code:oy.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(oy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class ay extends ty{constructor(e){super(e,{code:ay.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(ay,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class uy extends ty{constructor(e){super(e,{code:uy.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(uy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class iy extends ty{constructor(e){super(e,{code:iy.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(iy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class sy extends ty{constructor(e){super(e,{code:sy.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(sy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ly extends ty{constructor(e){super(e,{code:ly.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ly,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class cy extends ty{constructor(e){super(e,{code:cy.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(cy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class dy extends ty{constructor(e){super(e,{code:dy.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(dy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class fy extends ty{constructor(e){super(e,{code:fy.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(fy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class hy extends ty{constructor(e){super(e,{code:hy.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(hy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class py extends ty{constructor(e){super(e,{code:py.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(py,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class my extends ny{constructor(e){super(e,{code:my.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(my,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class gy extends ny{constructor(e){super(e,{code:gy.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(gy,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class yy extends ny{constructor(e){super(e,{code:yy.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(yy,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class by extends ny{constructor(e){super(e,{code:by.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(by,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class vy extends ny{constructor(e){super(e,{code:vy.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(vy,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class wy extends ny{constructor(e){super(e,{code:wy.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(wy,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Ay extends ty{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}function Cy(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof bp?e.walk((e=>e.code===jg.code)):e;return r instanceof bp?new jg({cause:e,message:r.details}):jg.nodeMessage.test(n)?new jg({cause:e,message:e.details}):Ig.nodeMessage.test(n)?new Ig({cause:e,maxFeePerGas:null==t?void 0:t.maxFeePerGas}):Sg.nodeMessage.test(n)?new Sg({cause:e,maxFeePerGas:null==t?void 0:t.maxFeePerGas}):Pg.nodeMessage.test(n)?new Pg({cause:e,nonce:null==t?void 0:t.nonce}):Ug.nodeMessage.test(n)?new Ug({cause:e,nonce:null==t?void 0:t.nonce}):Og.nodeMessage.test(n)?new Og({cause:e,nonce:null==t?void 0:t.nonce}):Ng.nodeMessage.test(n)?new Ng({cause:e}):Tg.nodeMessage.test(n)?new Tg({cause:e,gas:null==t?void 0:t.gas}):Mg.nodeMessage.test(n)?new Mg({cause:e,gas:null==t?void 0:t.gas}):Rg.nodeMessage.test(n)?new Rg({cause:e}):_g.nodeMessage.test(n)?new _g({cause:e,maxFeePerGas:null==t?void 0:t.maxFeePerGas,maxPriorityFeePerGas:null==t?void 0:t.maxPriorityFeePerGas}):new zg({cause:e})}function Ey(e,{format:t}){if(!t)return{};const n={};return function t(r){const o=Object.keys(r);for(const a of o)a in e&&(n[a]=e[a]),r[a]&&"object"==typeof r[a]&&!Array.isArray(r[a])&&t(r[a])}(t(e||{})),n}function By(e,t){return({exclude:n,format:r})=>({exclude:n,format:e=>{const o=t(e);if(n)for(const t of n)delete o[t];return{...o,...r(e)}},type:e})}const Fy={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function Dy(e){const t={};return void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?t.blobs=e.blobs.map((e=>Qp(e))):t.blobs=e.blobs),void 0!==e.data&&(t.data=e.data),void 0!==e.from&&(t.from=e.from),void 0!==e.gas&&(t.gas=Hp(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=Hp(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=Hp(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=Hp(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=Hp(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=Hp(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=Fy[e.type]),void 0!==e.value&&(t.value=Hp(e.value)),t}function xy(e,t,n){const r=e[t.name];if("function"==typeof r)return r;const o=e[n];return"function"==typeof o?o:n=>t(e,n)}function ky(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:o,to:a}=e,u=t?yg(t):void 0;if(u&&!ag(u.address))throw new wm({address:u.address});if(a&&!ag(a))throw new wm({address:a});if(void 0!==n&&(void 0!==r||void 0!==o))throw new qg;if(r&&r>2n**256n-1n)throw new Ig({maxFeePerGas:r});if(o&&r&&o>r)throw new _g({maxFeePerGas:r,maxPriorityFeePerGas:o})}async function jy(e){return _p(await e.request({method:"eth_chainId"},{dedupe:!0}))}class Iy extends bp{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class Sy extends bp{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Py extends bp{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${kg(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class Uy extends bp{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const Oy={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function Ny(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?_p(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?_p(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Oy[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}const Ty=By("transaction",Ny);function My(e){var t;const n=null==(t=e.transactions)?void 0:t.map((e=>"string"==typeof e?e:Ny(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Ry=By("block",My);async function _y(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:o}={}){var a,u,i;const s=r??"latest",l=o??!1,c=void 0!==n?Hp(n):void 0;let d=null;if(d=t?await e.request({method:"eth_getBlockByHash",params:[t,l]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[c||s,l]},{dedupe:Boolean(c)}),!d)throw new Uy({blockHash:t,blockNumber:n});return((null==(i=null==(u=null==(a=e.chain)?void 0:a.formatters)?void 0:u.block)?void 0:i.format)||My)(d)}async function zy(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Ly(e,t){var n,r,o;const{block:a,chain:u=e.chain,request:i}=t||{};if("function"==typeof(null==(n=null==u?void 0:u.fees)?void 0:n.defaultPriorityFee)){const t=a||await xy(e,_y,"getBlock")({});return u.fees.defaultPriorityFee({block:t,client:e,request:i})}if(void 0!==(null==(r=null==u?void 0:u.fees)?void 0:r.defaultPriorityFee))return null==(o=null==u?void 0:u.fees)?void 0:o.defaultPriorityFee;try{return Rp(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,n]=await Promise.all([a?Promise.resolve(a):xy(e,_y,"getBlock")({}),xy(e,zy,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new Sy;const r=n-t.baseFeePerGas;return r<0n?0n:r}}async function Wy(e,t){var n,r;const{block:o,chain:a=e.chain,request:u,type:i="eip1559"}=t||{},s=await(async()=>{var t,n;return"function"==typeof(null==(t=null==a?void 0:a.fees)?void 0:t.baseFeeMultiplier)?a.fees.baseFeeMultiplier({block:o,client:e,request:u}):(null==(n=null==a?void 0:a.fees)?void 0:n.baseFeeMultiplier)??1.2})();if(s<1)throw new Iy;const l=10**((null==(n=s.toString().split(".")[1])?void 0:n.length)??0),c=e=>e*BigInt(Math.ceil(s*l))/BigInt(l),d=o||await xy(e,_y,"getBlock")({});if("function"==typeof(null==(r=null==a?void 0:a.fees)?void 0:r.estimateFeesPerGas)){const t=await a.fees.estimateFeesPerGas({block:o,client:e,multiply:c,request:u,type:i});if(null!==t)return t}if("eip1559"===i){if("bigint"!=typeof d.baseFeePerGas)throw new Sy;const t="bigint"==typeof(null==u?void 0:u.maxPriorityFeePerGas)?u.maxPriorityFeePerGas:await Ly(e,{block:d,chain:a,request:u}),n=c(d.baseFeePerGas);return{maxFeePerGas:(null==u?void 0:u.maxFeePerGas)??n+t,maxPriorityFeePerGas:t}}return{gasPrice:(null==u?void 0:u.gasPrice)??c(await xy(e,zy,"getGasPrice")({}))}}class qy extends bp{constructor(e,{account:t,docsPath:n,chain:r,data:o,gas:a,gasPrice:u,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:l,to:c,value:d}){var f;const h=Wg({from:null==t?void 0:t.address,to:c,value:void 0!==d&&`${Lg(d)} ${(null==(f=null==r?void 0:r.nativeCurrency)?void 0:f.symbol)||"ETH"}`,data:o,gas:a,gasPrice:void 0!==u&&`${kg(u)} gwei`,maxFeePerGas:void 0!==i&&`${kg(i)} gwei`,maxPriorityFeePerGas:void 0!==s&&`${kg(s)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}class Qy extends bp{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class Hy extends bp{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function Vy(e){return e.reduce(((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`),"")}function $y(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new Fp({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new Fp({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function Gy(e){const{balance:t,nonce:n,state:r,stateDiff:o,code:a}=e,u={};if(void 0!==a&&(u.code=a),void 0!==t&&(u.balance=Hp(t)),void 0!==n&&(u.nonce=Hp(n)),void 0!==r&&(u.state=$y(r)),void 0!==o){if(u.state)throw new Hy;u.stateDiff=$y(o)}return u}function Ky(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ag(n,{strict:!1}))throw new wm({address:n});if(t[n])throw new Qy({address:n});t[n]=Gy(r)}return t}async function Jy(e,t){var n,r,o;const a=t.account??e.account,u=a?yg(a):void 0;try{const{accessList:a,blobs:i,blobVersionedHashes:s,blockNumber:l,blockTag:c,data:d,gas:f,gasPrice:h,maxFeePerBlobGas:p,maxFeePerGas:m,maxPriorityFeePerGas:g,nonce:y,to:b,value:v,stateOverride:w,...A}=await kb(e,{...t,parameters:"local"===(null==u?void 0:u.type)?void 0:["blobVersionedHashes"]}),C=(l?Hp(l):void 0)||c,E=Ky(w);ky(t);const B=null==(o=null==(r=null==(n=e.chain)?void 0:n.formatters)?void 0:r.transactionRequest)?void 0:o.format,F=(B||Dy)({...Ey(A,{format:B}),from:null==u?void 0:u.address,accessList:a,blobs:i,blobVersionedHashes:s,data:d,gas:f,gasPrice:h,maxFeePerBlobGas:p,maxFeePerGas:m,maxPriorityFeePerGas:g,nonce:y,to:b,value:v}),D=await e.request({method:"eth_estimateGas",params:E?[F,C??"latest",E]:C?[F,C]:[F]});return BigInt(D)}catch(i){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=Cy(e,n);return t instanceof zg?e:t})();return new qy(r,{docsPath:t,...n})}(i,{...t,account:u,chain:e.chain})}}async function Yy(e,{address:t,blockTag:n="latest",blockNumber:r}){return _p(await e.request({method:"eth_getTransactionCount",params:[t,r?Hp(r):n]},{dedupe:Boolean(r)}))}function Zy(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>Np(e))):e.blobs,o=[];for(const a of r)o.push(Uint8Array.from(t.blobToKzgCommitment(a)));return"bytes"===n?o:o.map((e=>Qp(e)))}function Xy(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>Np(e))):e.blobs,o="string"==typeof e.commitments[0]?e.commitments.map((e=>Np(e))):e.commitments,a=[];for(let u=0;uQp(e)))}class eb extends Nm{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Pm(this.buffer)}update(e){Bm(this);const{view:t,buffer:n,blockLen:r}=this,o=(e=Om(e)).length;for(let a=0;ar-a&&(this.process(n,0),a=0);for(let c=a;c>o&a),i=Number(n&a),s=r?4:0,l=r?0:4;e.setUint32(t+s,u,r),e.setUint32(t+l,i,r)}(n,r-8,BigInt(8*this.length),o),this.process(n,0);const u=Pm(e),i=this.outputLen;if(i%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const s=i/4,l=this.get();if(s>l.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;ce&t^~e&n,nb=(e,t,n)=>e&t^e&n^t&n,rb=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ob=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ab=new Uint32Array(64);class ub extends eb{constructor(){super(64,32,8,!1),this.A=0|ob[0],this.B=0|ob[1],this.C=0|ob[2],this.D=0|ob[3],this.E=0|ob[4],this.F=0|ob[5],this.G=0|ob[6],this.H=0|ob[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:a,G:u,H:i}=this;return[e,t,n,r,o,a,u,i]}set(e,t,n,r,o,a,u,i){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|a,this.G=0|u,this.H=0|i}process(e,t){for(let c=0;c<16;c++,t+=4)ab[c]=e.getUint32(t,!1);for(let c=16;c<64;c++){const e=ab[c-15],t=ab[c-2],n=Um(e,7)^Um(e,18)^e>>>3,r=Um(t,17)^Um(t,19)^t>>>10;ab[c]=r+ab[c-7]+n+ab[c-16]|0}let{A:n,B:r,C:o,D:a,E:u,F:i,G:s,H:l}=this;for(let c=0;c<64;c++){const e=l+(Um(u,6)^Um(u,11)^Um(u,25))+tb(u,i,s)+rb[c]+ab[c]|0,t=(Um(n,2)^Um(n,13)^Um(n,22))+nb(n,r,o)|0;l=s,s=i,i=u,u=a+e|0,a=o,o=r,r=n,n=e+t|0}n=n+this.A|0,r=r+this.B|0,o=o+this.C|0,a=a+this.D|0,u=u+this.E|0,i=i+this.F|0,s=s+this.G|0,l=l+this.H|0,this.set(n,r,o,a,u,i,s,l)}roundClean(){ab.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const ib=Tm((()=>new ub));function sb(e,t){const n=t||"hex",r=ib(kp(e,{strict:!1})?Pp(e):e);return"bytes"===n?r:Wp(r)}function lb(e){const{commitment:t,version:n=1}=e,r=e.to??("string"==typeof t?"hex":"bytes"),o=sb(t,"bytes");return o.set([n],0),"bytes"===r?o:Qp(o)}function cb(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),o=[];for(const a of t)o.push(lb({commitment:a,to:r,version:n}));return o}const db=32,fb=4096,hb=db*fb,pb=6*hb-1-1*fb*6,mb=1;class gb extends bp{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class yb extends bp{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class bb extends bp{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class vb extends bp{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${mb}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}class wb extends bp{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class Ab extends bp{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class Cb extends bp{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const Eb={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Cb({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Ab({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new wb({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new wb({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Bb(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Eb);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Fb(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??function(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?Np(e.data):e.data,r=jp(n);if(!r)throw new yb;if(r>pb)throw new gb({maxSize:pb,size:r});const o=[];let a=!0,u=0;for(;a;){const e=Bb(new Uint8Array(hb));let t=0;for(;te.bytes)):o.map((e=>Qp(e.bytes)))}({data:t,to:r}),a=e.commitments??Zy({blobs:o,kzg:n,to:r}),u=e.proofs??Xy({blobs:o,commitments:a,kzg:n,to:r}),i=[];for(let s=0;s{const t=Cy(e,n);return t instanceof zg?e:t})();return new $g(r,{docsPath:t,...n})}(A,{...t,account:w,chain:t.chain||void 0})}}const Sb=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],Pb=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Ub=[...Pb,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Ob=[...Pb,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],Nb=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Tb=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Mb=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}];function Rb(e,t={}){void 0!==t.size&&Mp(e,{size:t.size});return Rp(Qp(e,t),t)}function _b(e,t={}){let n=e;if(void 0!==t.size&&(Mp(n,{size:t.size}),n=Ip(n)),n.length>1||n[0]>1)throw new Ap(n);return Boolean(n[0])}function zb(e,t={}){void 0!==t.size&&Mp(e,{size:t.size});return _p(Qp(e,t),t)}function Lb(e,t){const n="string"==typeof t?Np(t):t,r=Bb(n);if(0===jp(n)&&e.length>0)throw new Xp;if(jp(t)&&jp(t)<32)throw new Zp({data:"string"==typeof t?t:Qp(t),params:e,size:jp(t)});let o=0;const a=[];for(let u=0;u!e)),o=r?[]:{};let a=0;if(Hb(t)){const u=n+zb(e.readBytes(Qb));for(let n=0;n48?Rb(o,{signed:n}):zb(o,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=zb(e.readBytes(32)),r=t+n;e.setPosition(r);const o=zb(e.readBytes(32));if(0===o)return e.setPosition(t+32),["",32];const a=e.readBytes(o,32),u=function(e,t={}){let n=e;return void 0!==t.size&&(Mp(n,{size:t.size}),n=Ip(n,{dir:"right"})),(new TextDecoder).decode(n)}(Ip(a));return e.setPosition(t+32),[u,32]}(e,{staticPosition:n});throw new pm(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const qb=32,Qb=32;function Hb(e){var t;const{type:n}=e;if("string"===n)return!0;if("bytes"===n)return!0;if(n.endsWith("[]"))return!0;if("tuple"===n)return null==(t=e.components)?void 0:t.some(Hb);const r=pg(e.type);return!(!r||!Hb({...e,type:r[1]}))}const Vb=e=>Xm(Pp(e));let $b=class e extends Error{constructor(t,n={}){var r;const o=n.cause instanceof e?n.cause.details:(null==(r=n.cause)?void 0:r.message)?n.cause.message:n.details,a=n.cause instanceof e&&n.cause.docsPath||n.docsPath;super([t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: https://abitype.dev${a}`]:[],...o?[`Details: ${o}`]:[],"Version: abitype@1.0.4"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=o,this.docsPath=a,this.metaMessages=n.metaMessages,this.shortMessage=t}};function Gb(e,t){const n=e.exec(t);return null==n?void 0:n.groups}const Kb=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Jb=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Yb=/^\(.+?\).*?$/,Zb=/^tuple(?(\[(\d*)\])*)$/;function Xb(e){let t=e.type;if(Zb.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let o=0;o[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;const nv=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;const rv=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;const ov=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function av(e){return ov.test(e)}function uv(e){return Gb(ov,e)}const iv=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;const sv=/^fallback\(\) external(?:\s(?payable{1}))?$/;const lv=/^receive\(\) external payable$/;const cv=new Set(["indexed"]),dv=new Set(["calldata","memory","storage"]);class fv extends $b{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class hv extends $b{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class pv extends $b{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class mv extends $b{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class gv extends $b{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class yv extends $b{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class bv extends $b{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class vv extends $b{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class wv extends $b{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Av extends $b{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class Cv extends $b{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class Ev extends $b{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}const Bv=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Fv(e,t={}){if(function(e){return rv.test(e)}(e)){const n=function(e){return Gb(rv,e)}(e);if(!n)throw new vv({signature:e,type:"function"});const r=Iv(n.parameters),o=[],a=r.length;for(let e=0;e[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,xv=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,kv=/^u?int$/;function jv(e,t){var n,r;const o=function(e,t){return t?`${t}:${e}`:e}(e,null==t?void 0:t.type);if(Bv.has(o))return Bv.get(o);const a=Yb.test(e),u=Gb(a?xv:Dv,e);if(!u)throw new pv({param:e});if(u.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||Kb.test(e)||Jb.test(e)||Pv.test(e)}(u.name))throw new mv({param:e,name:u.name});const i=u.name?{name:u.name}:{},s="indexed"===u.modifier?{indexed:!0}:{},l=(null==t?void 0:t.structs)??{};let c,d={};if(a){c="tuple";const e=Iv(u.type),t=[],n=e.length;for(let r=0;r[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function Ov(e,t,n=new Set){const r=[],o=e.length;for(let a=0;a{var t;return function(e){let t=!0,n="",r=0,o="",a=!1;for(let u=0;uug(Mv(e),0,4);function zv(e){const{abi:t,args:n=[],name:r}=e,o=kp(r,{strict:!1}),a=t.filter((e=>o?"function"===e.type?_v(e)===r:"event"===e.type&&Rv(e)===r:"name"in e&&e.name===r));if(0===a.length)return;if(1===a.length)return a[0];let u;for(const i of a){if(!("inputs"in i))continue;if(!n||0===n.length){if(!i.inputs||0===i.inputs.length)return i;continue}if(!i.inputs)continue;if(0===i.inputs.length)continue;if(i.inputs.length!==n.length)continue;if(n.every(((e,t)=>{const n="inputs"in i&&i.inputs[t];return!!n&&Lv(e,n)}))){if(u&&"inputs"in u&&u.inputs){const e=Wv(i.inputs,u.inputs,n);if(e)throw new lm({abiItem:i,type:e[0]},{abiItem:u,type:e[1]})}u=i}}return u||a[0]}function Lv(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ag(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every(((t,n)=>Lv(Object.values(e)[n],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every((e=>Lv(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function Wv(e,t,n){for(const r in e){const o=e[r],a=t[r];if("tuple"===o.type&&"tuple"===a.type&&"components"in o&&"components"in a)return Wv(o.components,a.components,n[r]);const u=[o.type,a.type];if(!(!u.includes("address")||!u.includes("bytes20"))||(u.includes("address")&&u.includes("string")||!(!u.includes("address")||!u.includes("bytes")))&&ag(n[r],{strict:!1}))return u}}const qv="/docs/contract/decodeFunctionResult";function Qv(e){const{abi:t,args:n,functionName:r,data:o}=e;let a=t[0];if(r){const e=zv({abi:t,args:n,name:r});if(!e)throw new im(r,{docsPath:qv});a=e}if("function"!==a.type)throw new im(void 0,{docsPath:qv});if(!a.outputs)throw new sm(a.name,{docsPath:qv});const u=Lb(a.outputs,o);return u&&u.length>1?u:u&&1===u.length?u[0]:void 0}const Hv="/docs/contract/encodeFunctionData";function Vv(e){const{args:t}=e,{abi:n,functionName:r}=1===e.abi.length&&(null==(o=e.functionName)?void 0:o.startsWith("0x"))?e:function(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const e=zv({abi:t,args:n,name:r});if(!e)throw new im(r,{docsPath:Hv});o=e}if("function"!==o.type)throw new im(void 0,{docsPath:Hv});return{abi:[o],functionName:_v(Gp(o))}}(e);var o;const a=n[0];return vm([r,("inputs"in a&&a.inputs?dg(a.inputs,t??[]):void 0)??"0x"])}function $v({blockNumber:e,chain:t,contract:n}){var r;const o=null==(r=null==t?void 0:t.contracts)?void 0:r[n];if(!o)throw new vg({chain:t,contract:{name:n}});if(e&&o.blockCreated&&o.blockCreated>e)throw new vg({blockNumber:e,chain:t,contract:{name:n,blockCreated:o.blockCreated}});return o.address}const Gv={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Kv={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Jv={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function Yv(e){const{abi:t,data:n}=e,r=ug(n,0,4);if("0x"===r)throw new Xp;const o=[...t||[],Kv,Jv].find((e=>"error"===e.type&&r===_v(Gp(e))));if(!o)throw new rm(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Lb(o.inputs,ug(n,4)):void 0,errorName:o.name}}function Zv({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map(((e,n)=>`${r&&e.name?`${e.name}: `:""}${"object"==typeof t[n]?Yg(t[n]):t[n]}`)).join(", ")})`}class Xv extends bp{constructor(e,{account:t,docsPath:n,chain:r,data:o,gas:a,gasPrice:u,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:l,to:c,value:d,stateOverride:f}){var h;const p=t?yg(t):void 0;let m=Wg({from:null==p?void 0:p.address,to:c,value:void 0!==d&&`${Lg(d)} ${(null==(h=null==r?void 0:r.nativeCurrency)?void 0:h.symbol)||"ETH"}`,data:o,gas:a,gasPrice:void 0!==u&&`${kg(u)} gwei`,maxFeePerGas:void 0!==i&&`${kg(i)} gwei`,maxPriorityFeePerGas:void 0!==s&&`${kg(s)} gwei`,nonce:l});f&&(m+=`\n${function(e){return e.reduce(((e,{address:t,...n})=>{let r=`${e} ${t}:\n`;return n.nonce&&(r+=` nonce: ${n.nonce}\n`),n.balance&&(r+=` balance: ${n.balance}\n`),n.code&&(r+=` code: ${n.code}\n`),n.state&&(r+=" state:\n",r+=Vy(n.state)),n.stateDiff&&(r+=" stateDiff:\n",r+=Vy(n.stateDiff)),r})," State Override:\n").slice(0,-1)}(f)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class ew extends bp{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:o,functionName:a,sender:u}){const i=zv({abi:t,args:n,name:a}),s=i?Zv({abiItem:i,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=Wg({address:r&&r,function:i?Gp(i,{includeName:!0}):void 0,args:s&&"()"!==s&&`${[...Array((null==a?void 0:a.length)??0).keys()].map((()=>" ")).join("")}${s}`,sender:u});super(e.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:e,docsPath:o,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",l].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=a,this.sender=u}}class tw extends bp{constructor({abi:e,data:t,functionName:n,message:r}){let o,a,u,i,s;if(t&&"0x"!==t)try{a=Yv({abi:e,data:t});const{abiItem:n,errorName:r,args:o}=a;if("Error"===r)i=o[0];else if("Panic"===r){const[e]=o;i=Gv[e]}else{const e=n?Gp(n,{includeName:!0}):void 0,t=n&&o?Zv({abiItem:n,args:o,includeFunctionName:!1,includeName:!1}):void 0;u=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array((null==r?void 0:r.length)??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(l){o=l}else r&&(i=r);o instanceof rm&&(s=o.signature,u=[`Unable to decode signature "${s}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${s}.`]),super(i&&"execution reverted"!==i||s?[`The contract function "${n}" reverted with the following ${s?"signature":"reason"}:`,i||s].join("\n"):`The contract function "${n}" reverted.`,{cause:o,metaMessages:u}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a,this.reason=i,this.signature=s}}class nw extends bp{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class rw extends bp{constructor({factory:e}){super("Deployment for counterfactual contract call failed"+(e?` for factory "${e}".`:""),{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CounterfactualDeploymentFailedError"})}}class ow extends bp{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}function aw(e,t){var n,r,o,a,u,i;if(!(e instanceof bp))return!1;const s=e.walk((e=>e instanceof tw));return s instanceof tw&&("ResolverNotFound"===(null==(n=s.data)?void 0:n.errorName)||("ResolverWildcardNotSupported"===(null==(r=s.data)?void 0:r.errorName)||("ResolverNotContract"===(null==(o=s.data)?void 0:o.errorName)||("ResolverError"===(null==(a=s.data)?void 0:a.errorName)||("HttpError"===(null==(u=s.data)?void 0:u.errorName)||(!!(null==(i=s.reason)?void 0:i.includes("Wildcard on non-extended resolvers is not supported"))||"reverse"===t&&s.reason===Gv[50]))))))}function uw(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t=`0x${e.slice(1,65)}`;return kp(t)?t:null}function iw(e){let t=new Uint8Array(32).fill(0);if(!e)return Qp(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const e=uw(n[r]),o=e?Pp(e):Xm(Tp(n[r]),"bytes");t=Xm(bm([t,o]),"bytes")}return Qp(t)}function sw(e){const t=new Uint8Array(32).fill(0);return e?uw(e)||Xm(Tp(e)):Qp(t)}function lw(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(Tp(t).byteLength+2);let r=0;const o=t.split(".");for(let a=0;a255&&(e=Tp(`[${sw(o[a]).slice(2)}]`)),n[r]=e.length,n.set(e,r+1),r+=e.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}const cw=3;function dw(e,{abi:t,address:n,args:r,docsPath:o,functionName:a,sender:u}){const{code:i,data:s,message:l,shortMessage:c}=e instanceof ow?e:e instanceof bp?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof Xp?new nw({functionName:a}):[cw,iy.code].includes(i)&&(s||l||c)?new tw({abi:t,data:"object"==typeof s?s.data:s,functionName:a,message:c??l}):e;return new ew(d,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:a,sender:u})}const fw="0x82ad56cb",hw="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",pw="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",mw="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";const gw=new Map;function yw({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const a=async()=>{const t=i();u();const n=t.map((({args:e})=>e));0!==n.length&&e(n).then((e=>{var n;o&&Array.isArray(e)&&e.sort(o);for(let r=0;r{var n;for(let r=0;rgw.delete(t),i=()=>gw.get(t)||[],s=e=>gw.set(t,[...i(),e]);return{flush:u,async schedule(e){const t={},o=new Promise(((e,n)=>{t.resolve=e,t.reject=n}));(null==n?void 0:n([...i().map((({args:e})=>e)),e]))&&a();return i().length>0?(s({args:e,pendingPromise:t}),o):(s({args:e,pendingPromise:t}),setTimeout(a,r),o)}}}async function bw(e,t){var n,r,o,a;const{account:u=e.account,batch:i=Boolean(null==(n=e.batch)?void 0:n.multicall),blockNumber:s,blockTag:l="latest",accessList:c,blobs:d,code:f,data:h,factory:p,factoryData:m,gas:g,gasPrice:y,maxFeePerBlobGas:b,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:A,to:C,value:E,stateOverride:B,...F}=t,D=u?yg(u):void 0;if(f&&(p||m))throw new bp("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(f&&C)throw new bp("Cannot provide both `code` & `to` as parameters.");const x=f&&h,k=p&&m&&C&&h,j=x||k,I=x?function(e){const{code:t,data:n}=e;return gg({abi:Nv(["constructor(bytes, bytes)"]),bytecode:hw,args:[t,n]})}({code:f,data:h}):k?function(e){const{data:t,factory:n,factoryData:r,to:o}=e;return gg({abi:Nv(["constructor(address, bytes, address, bytes)"]),bytecode:pw,args:[o,t,n,r]})}({data:h,factory:p,factoryData:m,to:C}):h;try{ky(t);const n=(s?Hp(s):void 0)||l,u=Ky(B),f=null==(a=null==(o=null==(r=e.chain)?void 0:r.formatters)?void 0:o.transactionRequest)?void 0:a.format,h=(f||Dy)({...Ey(F,{format:f}),from:null==D?void 0:D.address,accessList:c,blobs:d,data:I,gas:g,gasPrice:y,maxFeePerBlobGas:b,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:A,to:j?void 0:C,value:E});if(i&&function({request:e}){const{data:t,to:n,...r}=e;return!!t&&(!t.startsWith(fw)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:h})&&!u)try{return await async function(e,t){var n;const{batchSize:r=1024,wait:o=0}="object"==typeof(null==(n=e.batch)?void 0:n.multicall)?e.batch.multicall:{},{blockNumber:a,blockTag:u="latest",data:i,multicallAddress:s,to:l}=t;let c=s;if(!c){if(!e.chain)throw new Cg;c=$v({blockNumber:a,chain:e.chain,contract:"multicall3"})}const d=a?Hp(a):void 0,f=d||u,{schedule:h}=yw({id:`${e.uid}.${f}`,wait:o,shouldSplitBatch:e=>e.reduce(((e,{data:t})=>e+(t.length-2)),0)>2*r,fn:async t=>{const n=t.map((e=>({allowFailure:!0,callData:e.data,target:e.to}))),r=Vv({abi:Sb,args:[n],functionName:"aggregate3"}),o=await e.request({method:"eth_call",params:[{data:r,to:c},f]});return Qv({abi:Sb,args:[n],functionName:"aggregate3",data:o||"0x"})}}),[{returnData:p,success:m}]=await h({data:i,to:l});if(!m)throw new ow({data:p});return"0x"===p?{data:void 0}:{data:p}}(e,{...h,blockNumber:s,blockTag:l})}catch(S){if(!(S instanceof Cg||S instanceof vg))throw S}const p=await e.request({method:"eth_call",params:u?[h,n,u]:[h,n]});return"0x"===p?{data:void 0}:{data:p}}catch(S){const n=function(e){var t;if(!(e instanceof bp))return;const n=e.walk();return"object"==typeof(null==n?void 0:n.data)?null==(t=n.data)?void 0:t.data:n.data}(S),{offchainLookup:r,offchainLookupSignature:o}=await ep((async()=>{const{offchainLookup:e,offchainLookupSignature:t}=await import("./ccip-CqyhqZTu.js");return{offchainLookup:e,offchainLookupSignature:t}}),[]);if(!1!==e.ccipRead&&(null==n?void 0:n.slice(0,10))===o&&C)return{data:await r(e,{data:n,to:C})};if(j&&"0x101bb98d"===(null==n?void 0:n.slice(0,10)))throw new rw({factory:p});throw function(e,{docsPath:t,...n}){const r=(()=>{const t=Cy(e,n);return t instanceof zg?e:t})();return new Xv(r,{docsPath:t,...n})}(S,{...t,account:D,chain:e.chain})}}async function vw(e,t){const{abi:n,address:r,args:o,functionName:a,...u}=t,i=Vv({abi:n,args:o,functionName:a});try{const{data:t}=await xy(e,bw,"call")({...u,data:i,to:r});return Qv({abi:n,args:o,functionName:a,data:t||"0x"})}catch(s){throw dw(s,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:a})}}class ww extends bp{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class Aw extends bp{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class Cw extends bp{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class Ew extends bp{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const Bw=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,Fw=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,Dw=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,xw=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function kw(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function jw({uri:e,gatewayUrls:t}){const n=Dw.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=kw(null==t?void 0:t.ipfs,"https://ipfs.io"),o=kw(null==t?void 0:t.arweave,"https://arweave.net"),a=e.match(Bw),{protocol:u,subpath:i,target:s,subtarget:l=""}=(null==a?void 0:a.groups)||{},c="ipns:/"===u||"ipns/"===i,d="ipfs:/"===u||"ipfs/"===i||Fw.test(e);if(e.startsWith("http")&&!c&&!d){let n=e;return(null==t?void 0:t.arweave)&&(n=e.replace(/https:\/\/arweave.net/g,null==t?void 0:t.arweave)),{uri:n,isOnChain:!1,isEncoded:!1}}if((c||d)&&s)return{uri:`${r}/${c?"ipns":"ipfs"}/${s}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===u&&s)return{uri:`${o}/${s}${l||""}`,isOnChain:!1,isEncoded:!1};let f=e.replace(xw,"");if(f.startsWith("