@walletconnect/ethereum-provider 2.5.2 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +24 -24
- package/dist/index.umd.js.map +1 -1
- package/package.json +7 -7
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Xt,dt){typeof exports=="object"&&typeof module<"u"?dt(exports):typeof define=="function"&&define.amd?define(["exports"],dt):(Xt=typeof globalThis<"u"?globalThis:Xt||self,dt(Xt["@walletconnect/ethereum-provider"]={}))})(this,function(Xt){"use strict";var dt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Tr(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var xt={exports:{}},un=typeof Reflect=="object"?Reflect:null,Kc=un&&typeof un.apply=="function"?un.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Ki;un&&typeof un.ownKeys=="function"?Ki=un.ownKeys:Object.getOwnPropertySymbols?Ki=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ki=function(e){return Object.getOwnPropertyNames(e)};function nf(t){console&&console.warn&&console.warn(t)}var Gc=Number.isNaN||function(e){return e!==e};function ke(){ke.init.call(this)}xt.exports=ke,xt.exports.once=cf,ke.EventEmitter=ke,ke.prototype._events=void 0,ke.prototype._eventsCount=0,ke.prototype._maxListeners=void 0;var Zc=10;function Gi(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(ke,"defaultMaxListeners",{enumerable:!0,get:function(){return Zc},set:function(t){if(typeof t!="number"||t<0||Gc(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Zc=t}}),ke.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ke.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Gc(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Yc(t){return t._maxListeners===void 0?ke.defaultMaxListeners:t._maxListeners}ke.prototype.getMaxListeners=function(){return Yc(this)},ke.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")Kc(c,this,r);else for(var l=c.length,p=tl(c,l),n=0;n<l;++n)Kc(p[n],this,r);return!0};function Jc(t,e,r,n){var i,s,o;if(Gi(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),i=Yc(t),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,nf(a)}return t}ke.prototype.addListener=function(e,r){return Jc(this,e,r,!1)},ke.prototype.on=ke.prototype.addListener,ke.prototype.prependListener=function(e,r){return Jc(this,e,r,!0)};function sf(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Xc(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=sf.bind(n);return i.listener=r,n.wrapFn=i,i}ke.prototype.once=function(e,r){return Gi(r),this.on(e,Xc(this,e,r)),this},ke.prototype.prependOnceListener=function(e,r){return Gi(r),this.prependListener(e,Xc(this,e,r)),this},ke.prototype.removeListener=function(e,r){var n,i,s,o,a;if(Gi(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():of(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this},ke.prototype.off=ke.prototype.removeListener,ke.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function Qc(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?af(i):tl(i,i.length)}ke.prototype.listeners=function(e){return Qc(this,e,!0)},ke.prototype.rawListeners=function(e){return Qc(this,e,!1)},ke.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):el.call(t,e)},ke.prototype.listenerCount=el;function el(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}ke.prototype.eventNames=function(){return this._eventsCount>0?Ki(this._events):[]};function tl(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function of(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function af(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function cf(t,e){return new Promise(function(r,n){function i(o){t.removeListener(e,s),n(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}rl(t,e,s,{once:!0}),e!=="error"&&lf(t,i,{once:!0})})}function lf(t,e,r){typeof t.on=="function"&&rl(t,"error",e,r)}function rl(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(s){n.once&&t.removeEventListener(e,i),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var uo={},Zi={},_e={},nl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,p=a&65535,m=c>>>16&65535,w=c&65535;return p*w+(l*w+p*m<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<<c|a>>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(nl),Object.defineProperty(_e,"__esModule",{value:!0});var il=nl;function hf(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}_e.readInt16BE=hf;function uf(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}_e.readUint16BE=uf;function df(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}_e.readInt16LE=df;function ff(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}_e.readUint16LE=ff;function sl(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}_e.writeUint16BE=sl,_e.writeInt16BE=sl;function ol(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}_e.writeUint16LE=ol,_e.writeInt16LE=ol;function fo(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}_e.readInt32BE=fo;function po(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}_e.readUint32BE=po;function go(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}_e.readInt32LE=go;function mo(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}_e.readUint32LE=mo;function Yi(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}_e.writeUint32BE=Yi,_e.writeInt32BE=Yi;function Ji(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}_e.writeUint32LE=Ji,_e.writeInt32LE=Ji;function pf(t,e){e===void 0&&(e=0);var r=fo(t,e),n=fo(t,e+4);return r*4294967296+n-(n>>31)*4294967296}_e.readInt64BE=pf;function gf(t,e){e===void 0&&(e=0);var r=po(t,e),n=po(t,e+4);return r*4294967296+n}_e.readUint64BE=gf;function mf(t,e){e===void 0&&(e=0);var r=go(t,e),n=go(t,e+4);return n*4294967296+r-(r>>31)*4294967296}_e.readInt64LE=mf;function wf(t,e){e===void 0&&(e=0);var r=mo(t,e),n=mo(t,e+4);return n*4294967296+r}_e.readUint64LE=wf;function al(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Yi(t/4294967296>>>0,e,r),Yi(t>>>0,e,r+4),e}_e.writeUint64BE=al,_e.writeInt64BE=al;function cl(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ji(t>>>0,e,r),Ji(t/4294967296>>>0,e,r+4),e}_e.writeUint64LE=cl,_e.writeInt64LE=cl;function yf(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}_e.readUintBE=yf;function bf(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s<r+t/8;s++)n+=e[s]*i,i*=256;return n}_e.readUintLE=bf;function vf(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!il.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,s=t/8+n-1;s>=n;s--)r[s]=e/i&255,i*=256;return r}_e.writeUintBE=vf;function _f(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!il.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s<n+t/8;s++)r[s]=e/i&255,i*=256;return r}_e.writeUintLE=_f;function Ef(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}_e.readFloat32BE=Ef;function xf(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}_e.readFloat32LE=xf;function Cf(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}_e.readFloat64BE=Cf;function If(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}_e.readFloat64LE=If;function Sf(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}_e.writeFloat32BE=Sf;function Df(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}_e.writeFloat32LE=Df;function Of(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}_e.writeFloat64BE=Of;function $f(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}_e.writeFloat64LE=$f;var kt={};Object.defineProperty(kt,"__esModule",{value:!0});function Af(t){for(var e=0;e<t.length;e++)t[e]=0;return t}kt.wipe=Af,Object.defineProperty(Zi,"__esModule",{value:!0});var Dt=_e,wo=kt,Pf=20;function Tf(t,e,r){for(var n=1634760805,i=857760878,s=2036477234,o=1797285236,a=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],l=r[11]<<24|r[10]<<16|r[9]<<8|r[8],p=r[15]<<24|r[14]<<16|r[13]<<8|r[12],m=r[19]<<24|r[18]<<16|r[17]<<8|r[16],w=r[23]<<24|r[22]<<16|r[21]<<8|r[20],y=r[27]<<24|r[26]<<16|r[25]<<8|r[24],E=r[31]<<24|r[30]<<16|r[29]<<8|r[28],T=e[3]<<24|e[2]<<16|e[1]<<8|e[0],N=e[7]<<24|e[6]<<16|e[5]<<8|e[4],L=e[11]<<24|e[10]<<16|e[9]<<8|e[8],C=e[15]<<24|e[14]<<16|e[13]<<8|e[12],D=n,b=i,S=s,O=o,u=a,_=c,H=l,B=p,q=m,X=w,te=y,x=E,$=T,K=N,Y=L,W=C,z=0;z<Pf;z+=2)D=D+u|0,$^=D,$=$>>>32-16|$<<16,q=q+$|0,u^=q,u=u>>>32-12|u<<12,b=b+_|0,K^=b,K=K>>>32-16|K<<16,X=X+K|0,_^=X,_=_>>>32-12|_<<12,S=S+H|0,Y^=S,Y=Y>>>32-16|Y<<16,te=te+Y|0,H^=te,H=H>>>32-12|H<<12,O=O+B|0,W^=O,W=W>>>32-16|W<<16,x=x+W|0,B^=x,B=B>>>32-12|B<<12,S=S+H|0,Y^=S,Y=Y>>>32-8|Y<<8,te=te+Y|0,H^=te,H=H>>>32-7|H<<7,O=O+B|0,W^=O,W=W>>>32-8|W<<8,x=x+W|0,B^=x,B=B>>>32-7|B<<7,b=b+_|0,K^=b,K=K>>>32-8|K<<8,X=X+K|0,_^=X,_=_>>>32-7|_<<7,D=D+u|0,$^=D,$=$>>>32-8|$<<8,q=q+$|0,u^=q,u=u>>>32-7|u<<7,D=D+_|0,W^=D,W=W>>>32-16|W<<16,te=te+W|0,_^=te,_=_>>>32-12|_<<12,b=b+H|0,$^=b,$=$>>>32-16|$<<16,x=x+$|0,H^=x,H=H>>>32-12|H<<12,S=S+B|0,K^=S,K=K>>>32-16|K<<16,q=q+K|0,B^=q,B=B>>>32-12|B<<12,O=O+u|0,Y^=O,Y=Y>>>32-16|Y<<16,X=X+Y|0,u^=X,u=u>>>32-12|u<<12,S=S+B|0,K^=S,K=K>>>32-8|K<<8,q=q+K|0,B^=q,B=B>>>32-7|B<<7,O=O+u|0,Y^=O,Y=Y>>>32-8|Y<<8,X=X+Y|0,u^=X,u=u>>>32-7|u<<7,b=b+H|0,$^=b,$=$>>>32-8|$<<8,x=x+$|0,H^=x,H=H>>>32-7|H<<7,D=D+_|0,W^=D,W=W>>>32-8|W<<8,te=te+W|0,_^=te,_=_>>>32-7|_<<7;Dt.writeUint32LE(D+n|0,t,0),Dt.writeUint32LE(b+i|0,t,4),Dt.writeUint32LE(S+s|0,t,8),Dt.writeUint32LE(O+o|0,t,12),Dt.writeUint32LE(u+a|0,t,16),Dt.writeUint32LE(_+c|0,t,20),Dt.writeUint32LE(H+l|0,t,24),Dt.writeUint32LE(B+p|0,t,28),Dt.writeUint32LE(q+m|0,t,32),Dt.writeUint32LE(X+w|0,t,36),Dt.writeUint32LE(te+y|0,t,40),Dt.writeUint32LE(x+E|0,t,44),Dt.writeUint32LE($+T|0,t,48),Dt.writeUint32LE(K+N|0,t,52),Dt.writeUint32LE(Y+L|0,t,56),Dt.writeUint32LE(W+C|0,t,60)}function ll(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var s,o;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),o=s.length-e.length,s.set(e,o)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,o=i}for(var a=new Uint8Array(64),c=0;c<r.length;c+=64){Tf(a,s,t);for(var l=c;l<c+64&&l<r.length;l++)n[l]=r[l]^a[l-c];Rf(s,0,o)}return wo.wipe(a),i===0&&wo.wipe(s),n}Zi.streamXOR=ll;function Nf(t,e,r,n){return n===void 0&&(n=0),wo.wipe(r),ll(t,e,r,r,n)}Zi.stream=Nf;function Rf(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var hl={},br={};Object.defineProperty(br,"__esModule",{value:!0});function Mf(t,e,r){return~(t-1)&e|t-1&r}br.select=Mf;function Lf(t,e){return(t|0)-(e|0)-1>>>31&1}br.lessOrEqual=Lf;function ul(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}br.compare=ul;function Uf(t,e){return t.length===0||e.length===0?!1:ul(t,e)!==0}br.equal=Uf,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=br,r=kt;t.DIGEST_LENGTH=16;var n=function(){function o(a){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var p=a[4]|a[5]<<8;this._r[2]=(l>>>10|p<<6)&7939;var m=a[6]|a[7]<<8;this._r[3]=(p>>>7|m<<9)&8191;var w=a[8]|a[9]<<8;this._r[4]=(m>>>4|w<<12)&255,this._r[5]=w>>>1&8190;var y=a[10]|a[11]<<8;this._r[6]=(w>>>14|y<<2)&8191;var E=a[12]|a[13]<<8;this._r[7]=(y>>>11|E<<5)&8065;var T=a[14]|a[15]<<8;this._r[8]=(E>>>8|T<<8)&8191,this._r[9]=T>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var p=this._fin?0:2048,m=this._h[0],w=this._h[1],y=this._h[2],E=this._h[3],T=this._h[4],N=this._h[5],L=this._h[6],C=this._h[7],D=this._h[8],b=this._h[9],S=this._r[0],O=this._r[1],u=this._r[2],_=this._r[3],H=this._r[4],B=this._r[5],q=this._r[6],X=this._r[7],te=this._r[8],x=this._r[9];l>=16;){var $=a[c+0]|a[c+1]<<8;m+=$&8191;var K=a[c+2]|a[c+3]<<8;w+=($>>>13|K<<3)&8191;var Y=a[c+4]|a[c+5]<<8;y+=(K>>>10|Y<<6)&8191;var W=a[c+6]|a[c+7]<<8;E+=(Y>>>7|W<<9)&8191;var z=a[c+8]|a[c+9]<<8;T+=(W>>>4|z<<12)&8191,N+=z>>>1&8191;var J=a[c+10]|a[c+11]<<8;L+=(z>>>14|J<<2)&8191;var G=a[c+12]|a[c+13]<<8;C+=(J>>>11|G<<5)&8191;var ce=a[c+14]|a[c+15]<<8;D+=(G>>>8|ce<<8)&8191,b+=ce>>>5|p;var Q=0,pe=Q;pe+=m*S,pe+=w*(5*x),pe+=y*(5*te),pe+=E*(5*X),pe+=T*(5*q),Q=pe>>>13,pe&=8191,pe+=N*(5*B),pe+=L*(5*H),pe+=C*(5*_),pe+=D*(5*u),pe+=b*(5*O),Q+=pe>>>13,pe&=8191;var oe=Q;oe+=m*O,oe+=w*S,oe+=y*(5*x),oe+=E*(5*te),oe+=T*(5*X),Q=oe>>>13,oe&=8191,oe+=N*(5*q),oe+=L*(5*B),oe+=C*(5*H),oe+=D*(5*_),oe+=b*(5*u),Q+=oe>>>13,oe&=8191;var Ce=Q;Ce+=m*u,Ce+=w*O,Ce+=y*S,Ce+=E*(5*x),Ce+=T*(5*te),Q=Ce>>>13,Ce&=8191,Ce+=N*(5*X),Ce+=L*(5*q),Ce+=C*(5*B),Ce+=D*(5*H),Ce+=b*(5*_),Q+=Ce>>>13,Ce&=8191;var F=Q;F+=m*_,F+=w*u,F+=y*O,F+=E*S,F+=T*(5*x),Q=F>>>13,F&=8191,F+=N*(5*te),F+=L*(5*X),F+=C*(5*q),F+=D*(5*B),F+=b*(5*H),Q+=F>>>13,F&=8191;var j=Q;j+=m*H,j+=w*_,j+=y*u,j+=E*O,j+=T*S,Q=j>>>13,j&=8191,j+=N*(5*x),j+=L*(5*te),j+=C*(5*X),j+=D*(5*q),j+=b*(5*B),Q+=j>>>13,j&=8191;var R=Q;R+=m*B,R+=w*H,R+=y*_,R+=E*u,R+=T*O,Q=R>>>13,R&=8191,R+=N*S,R+=L*(5*x),R+=C*(5*te),R+=D*(5*X),R+=b*(5*q),Q+=R>>>13,R&=8191;var f=Q;f+=m*q,f+=w*B,f+=y*H,f+=E*_,f+=T*u,Q=f>>>13,f&=8191,f+=N*O,f+=L*S,f+=C*(5*x),f+=D*(5*te),f+=b*(5*X),Q+=f>>>13,f&=8191;var A=Q;A+=m*X,A+=w*q,A+=y*B,A+=E*H,A+=T*_,Q=A>>>13,A&=8191,A+=N*u,A+=L*O,A+=C*S,A+=D*(5*x),A+=b*(5*te),Q+=A>>>13,A&=8191;var ee=Q;ee+=m*te,ee+=w*X,ee+=y*q,ee+=E*B,ee+=T*H,Q=ee>>>13,ee&=8191,ee+=N*_,ee+=L*u,ee+=C*O,ee+=D*S,ee+=b*(5*x),Q+=ee>>>13,ee&=8191;var ne=Q;ne+=m*x,ne+=w*te,ne+=y*X,ne+=E*q,ne+=T*B,Q=ne>>>13,ne&=8191,ne+=N*H,ne+=L*_,ne+=C*u,ne+=D*O,ne+=b*S,Q+=ne>>>13,ne&=8191,Q=(Q<<2)+Q|0,Q=Q+pe|0,pe=Q&8191,Q=Q>>>13,oe+=Q,m=pe,w=oe,y=Ce,E=F,T=j,N=R,L=f,C=A,D=ee,b=ne,c+=16,l-=16}this._h[0]=m,this._h[1]=w,this._h[2]=y,this._h[3]=E,this._h[4]=T,this._h[5]=N,this._h[6]=L,this._h[7]=C,this._h[8]=D,this._h[9]=b},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),p,m,w,y;if(this._leftover){for(y=this._leftover,this._buffer[y++]=1;y<16;y++)this._buffer[y]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(p=this._h[1]>>>13,this._h[1]&=8191,y=2;y<10;y++)this._h[y]+=p,p=this._h[y]>>>13,this._h[y]&=8191;for(this._h[0]+=p*5,p=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=p,p=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=p,l[0]=this._h[0]+5,p=l[0]>>>13,l[0]&=8191,y=1;y<10;y++)l[y]=this._h[y]+p,p=l[y]>>>13,l[y]&=8191;for(l[9]-=1<<13,m=(p^1)-1,y=0;y<10;y++)l[y]&=m;for(m=~m,y=0;y<10;y++)this._h[y]=this._h[y]&m|l[y];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,w=this._h[0]+this._pad[0],this._h[0]=w&65535,y=1;y<8;y++)w=(this._h[y]+this._pad[y]|0)+(w>>>16)|0,this._h[y]=w&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,p;if(this._leftover){p=16-this._leftover,p>l&&(p=l);for(var m=0;m<p;m++)this._buffer[this._leftover+m]=a[c+m];if(l-=p,c+=p,this._leftover+=p,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(l>=16&&(p=l-l%16,this._blocks(a,c,p),c+=p,l-=p),l){for(var m=0;m<l;m++)this._buffer[this._leftover+m]=a[c+m];this._leftover+=l}return this},o.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var a=new Uint8Array(16);return this.finish(a),a},o.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},o}();t.Poly1305=n;function i(o,a){var c=new n(o);c.update(a);var l=c.digest();return c.clean(),l}t.oneTimeAuth=i;function s(o,a){return o.length!==t.DIGEST_LENGTH||a.length!==t.DIGEST_LENGTH?!1:e.equal(o,a)}t.equal=s}(hl),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Zi,r=hl,n=kt,i=_e,s=br;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var o=new Uint8Array(16),a=function(){function c(l){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,l.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(l)}return c.prototype.seal=function(l,p,m,w){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var y=new Uint8Array(16);y.set(l,y.length-l.length);var E=new Uint8Array(32);e.stream(this._key,y,E,4);var T=p.length+this.tagLength,N;if(w){if(w.length!==T)throw new Error("ChaCha20Poly1305: incorrect destination length");N=w}else N=new Uint8Array(T);return e.streamXOR(this._key,y,p,N,4),this._authenticate(N.subarray(N.length-this.tagLength,N.length),E,N.subarray(0,N.length-this.tagLength),m),n.wipe(y),N},c.prototype.open=function(l,p,m,w){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(p.length<this.tagLength)return null;var y=new Uint8Array(16);y.set(l,y.length-l.length);var E=new Uint8Array(32);e.stream(this._key,y,E,4);var T=new Uint8Array(this.tagLength);if(this._authenticate(T,E,p.subarray(0,p.length-this.tagLength),m),!s.equal(T,p.subarray(p.length-this.tagLength,p.length)))return null;var N=p.length-this.tagLength,L;if(w){if(w.length!==N)throw new Error("ChaCha20Poly1305: incorrect destination length");L=w}else L=new Uint8Array(N);return e.streamXOR(this._key,y,p.subarray(0,p.length-this.tagLength),L,4),n.wipe(y),L},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(l,p,m,w){var y=new r.Poly1305(p);w&&(y.update(w),w.length%16>0&&y.update(o.subarray(w.length%16))),y.update(m),m.length%16>0&&y.update(o.subarray(m.length%16));var E=new Uint8Array(8);w&&i.writeUint64LE(w.length,E),y.update(E),i.writeUint64LE(m.length,E),y.update(E);for(var T=y.digest(),N=0;N<T.length;N++)l[N]=T[N];y.clean(),n.wipe(T),n.wipe(E)},c}();t.ChaCha20Poly1305=a}(uo);var dl={},Wn={},yo={};Object.defineProperty(yo,"__esModule",{value:!0});function jf(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}yo.isSerializableHash=jf,Object.defineProperty(Wn,"__esModule",{value:!0});var tr=yo,Ff=br,Bf=kt,fl=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),tr.isSerializableHash(this._inner)&&tr.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Bf.wipe(n)}return t.prototype.reset=function(){if(!tr.isSerializableHash(this._inner)||!tr.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){tr.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),tr.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!tr.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!tr.isSerializableHash(this._inner)||!tr.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!tr.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Wn.HMAC=fl;function kf(t,e,r){var n=new fl(t,e);n.update(r);var i=n.digest();return n.clean(),i}Wn.hmac=kf,Wn.equal=Ff.equal,Object.defineProperty(dl,"__esModule",{value:!0});var pl=Wn,gl=kt,Hf=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var s=pl.hmac(this._hash,n,r);this._hmac=new pl.HMAC(e,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),gl.wipe(this._buffer),gl.wipe(this._counter),this._bufpos=0},t}(),zf=dl.HKDF=Hf,dn={},Xi={},Qi={};Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.BrowserRandomSource=void 0;const ml=65536;class Wf{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=ml)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,ml)));return r}}Qi.BrowserRandomSource=Wf;function qf(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var es={},Vf={},Kf=Object.freeze({__proto__:null,default:Vf}),Gf=Tr(Kf);Object.defineProperty(es,"__esModule",{value:!0}),es.NodeRandomSource=void 0;const Zf=kt;class Yf{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof qf<"u"){const e=Gf;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,Zf.wipe)(r),n}}es.NodeRandomSource=Yf,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.SystemRandomSource=void 0;const Jf=Qi,Xf=es;class Qf{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Jf.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Xf.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}Xi.SystemRandomSource=Qf,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Xi,r=_e,n=kt;t.defaultRandomSource=new e.SystemRandomSource;function i(l,p=t.defaultRandomSource){return p.randomBytes(l)}t.randomBytes=i;function s(l=t.defaultRandomSource){const p=i(4,l),m=(0,r.readUint32LE)(p);return(0,n.wipe)(p),m}t.randomUint32=s;const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(l,p=o,m=t.defaultRandomSource){if(p.length<2)throw new Error("randomString charset is too short");if(p.length>256)throw new Error("randomString charset is too long");let w="";const y=p.length,E=256-256%y;for(;l>0;){const T=i(Math.ceil(l*256/E),m);for(let N=0;N<T.length&&l>0;N++){const L=T[N];L<E&&(w+=p.charAt(L%y),l--)}(0,n.wipe)(T)}return w}t.randomString=a;function c(l,p=o,m=t.defaultRandomSource){const w=Math.ceil(l/(Math.log(p.length)/Math.LN2));return a(w,p,m)}t.randomStringForEntropy=c}(dn);var ts={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_e,r=kt;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function a(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return a.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},a.prototype.update=function(c,l){if(l===void 0&&(l=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var p=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&l>0;)this._buffer[this._bufferLength++]=c[p++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(p=s(this._temp,this._state,c,p,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[p++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,p=this._bufferLength,m=l/536870912|0,w=l<<3,y=l%64<56?64:128;this._buffer[p]=128;for(var E=p+1;E<y-8;E++)this._buffer[E]=0;e.writeUint32BE(m,this._buffer,y-8),e.writeUint32BE(w,this._buffer,y-4),s(this._temp,this._state,this._buffer,0,y),this._finished=!0}for(var E=0;E<this.digestLength/4;E++)e.writeUint32BE(this._state[E],c,E*4);return this},a.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([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]);function s(a,c,l,p,m){for(;m>=64;){for(var w=c[0],y=c[1],E=c[2],T=c[3],N=c[4],L=c[5],C=c[6],D=c[7],b=0;b<16;b++){var S=p+b*4;a[b]=e.readUint32BE(l,S)}for(var b=16;b<64;b++){var O=a[b-2],u=(O>>>17|O<<32-17)^(O>>>19|O<<32-19)^O>>>10;O=a[b-15];var _=(O>>>7|O<<32-7)^(O>>>18|O<<32-18)^O>>>3;a[b]=(u+a[b-7]|0)+(_+a[b-16]|0)}for(var b=0;b<64;b++){var u=(((N>>>6|N<<26)^(N>>>11|N<<21)^(N>>>25|N<<7))+(N&L^~N&C)|0)+(D+(i[b]+a[b]|0)|0)|0,_=((w>>>2|w<<32-2)^(w>>>13|w<<32-13)^(w>>>22|w<<32-22))+(w&y^w&E^y&E)|0;D=C,C=L,L=N,N=T+u|0,T=E,E=y,y=w,w=u+_|0}c[0]+=w,c[1]+=y,c[2]+=E,c[3]+=T,c[4]+=N,c[5]+=L,c[6]+=C,c[7]+=D,p+=64,m-=64}return p}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(ts);var bo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=dn,r=kt;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(b){const S=new Float64Array(16);if(b)for(let O=0;O<b.length;O++)S[O]=b[O];return S}const i=new Uint8Array(32);i[0]=9;const s=n([56129,1]);function o(b){let S=1;for(let O=0;O<16;O++){let u=b[O]+S+65535;S=Math.floor(u/65536),b[O]=u-S*65536}b[0]+=S-1+37*(S-1)}function a(b,S,O){const u=~(O-1);for(let _=0;_<16;_++){const H=u&(b[_]^S[_]);b[_]^=H,S[_]^=H}}function c(b,S){const O=n(),u=n();for(let _=0;_<16;_++)u[_]=S[_];o(u),o(u),o(u);for(let _=0;_<2;_++){O[0]=u[0]-65517;for(let B=1;B<15;B++)O[B]=u[B]-65535-(O[B-1]>>16&1),O[B-1]&=65535;O[15]=u[15]-32767-(O[14]>>16&1);const H=O[15]>>16&1;O[14]&=65535,a(u,O,1-H)}for(let _=0;_<16;_++)b[2*_]=u[_]&255,b[2*_+1]=u[_]>>8}function l(b,S){for(let O=0;O<16;O++)b[O]=S[2*O]+(S[2*O+1]<<8);b[15]&=32767}function p(b,S,O){for(let u=0;u<16;u++)b[u]=S[u]+O[u]}function m(b,S,O){for(let u=0;u<16;u++)b[u]=S[u]-O[u]}function w(b,S,O){let u,_,H=0,B=0,q=0,X=0,te=0,x=0,$=0,K=0,Y=0,W=0,z=0,J=0,G=0,ce=0,Q=0,pe=0,oe=0,Ce=0,F=0,j=0,R=0,f=0,A=0,ee=0,ne=0,Ee=0,Le=0,Pe=0,Ue=0,Ge=0,Ve=0,Te=O[0],Oe=O[1],me=O[2],Ie=O[3],$e=O[4],ge=O[5],xe=O[6],g=O[7],h=O[8],d=O[9],v=O[10],P=O[11],U=O[12],k=O[13],se=O[14],he=O[15];u=S[0],H+=u*Te,B+=u*Oe,q+=u*me,X+=u*Ie,te+=u*$e,x+=u*ge,$+=u*xe,K+=u*g,Y+=u*h,W+=u*d,z+=u*v,J+=u*P,G+=u*U,ce+=u*k,Q+=u*se,pe+=u*he,u=S[1],B+=u*Te,q+=u*Oe,X+=u*me,te+=u*Ie,x+=u*$e,$+=u*ge,K+=u*xe,Y+=u*g,W+=u*h,z+=u*d,J+=u*v,G+=u*P,ce+=u*U,Q+=u*k,pe+=u*se,oe+=u*he,u=S[2],q+=u*Te,X+=u*Oe,te+=u*me,x+=u*Ie,$+=u*$e,K+=u*ge,Y+=u*xe,W+=u*g,z+=u*h,J+=u*d,G+=u*v,ce+=u*P,Q+=u*U,pe+=u*k,oe+=u*se,Ce+=u*he,u=S[3],X+=u*Te,te+=u*Oe,x+=u*me,$+=u*Ie,K+=u*$e,Y+=u*ge,W+=u*xe,z+=u*g,J+=u*h,G+=u*d,ce+=u*v,Q+=u*P,pe+=u*U,oe+=u*k,Ce+=u*se,F+=u*he,u=S[4],te+=u*Te,x+=u*Oe,$+=u*me,K+=u*Ie,Y+=u*$e,W+=u*ge,z+=u*xe,J+=u*g,G+=u*h,ce+=u*d,Q+=u*v,pe+=u*P,oe+=u*U,Ce+=u*k,F+=u*se,j+=u*he,u=S[5],x+=u*Te,$+=u*Oe,K+=u*me,Y+=u*Ie,W+=u*$e,z+=u*ge,J+=u*xe,G+=u*g,ce+=u*h,Q+=u*d,pe+=u*v,oe+=u*P,Ce+=u*U,F+=u*k,j+=u*se,R+=u*he,u=S[6],$+=u*Te,K+=u*Oe,Y+=u*me,W+=u*Ie,z+=u*$e,J+=u*ge,G+=u*xe,ce+=u*g,Q+=u*h,pe+=u*d,oe+=u*v,Ce+=u*P,F+=u*U,j+=u*k,R+=u*se,f+=u*he,u=S[7],K+=u*Te,Y+=u*Oe,W+=u*me,z+=u*Ie,J+=u*$e,G+=u*ge,ce+=u*xe,Q+=u*g,pe+=u*h,oe+=u*d,Ce+=u*v,F+=u*P,j+=u*U,R+=u*k,f+=u*se,A+=u*he,u=S[8],Y+=u*Te,W+=u*Oe,z+=u*me,J+=u*Ie,G+=u*$e,ce+=u*ge,Q+=u*xe,pe+=u*g,oe+=u*h,Ce+=u*d,F+=u*v,j+=u*P,R+=u*U,f+=u*k,A+=u*se,ee+=u*he,u=S[9],W+=u*Te,z+=u*Oe,J+=u*me,G+=u*Ie,ce+=u*$e,Q+=u*ge,pe+=u*xe,oe+=u*g,Ce+=u*h,F+=u*d,j+=u*v,R+=u*P,f+=u*U,A+=u*k,ee+=u*se,ne+=u*he,u=S[10],z+=u*Te,J+=u*Oe,G+=u*me,ce+=u*Ie,Q+=u*$e,pe+=u*ge,oe+=u*xe,Ce+=u*g,F+=u*h,j+=u*d,R+=u*v,f+=u*P,A+=u*U,ee+=u*k,ne+=u*se,Ee+=u*he,u=S[11],J+=u*Te,G+=u*Oe,ce+=u*me,Q+=u*Ie,pe+=u*$e,oe+=u*ge,Ce+=u*xe,F+=u*g,j+=u*h,R+=u*d,f+=u*v,A+=u*P,ee+=u*U,ne+=u*k,Ee+=u*se,Le+=u*he,u=S[12],G+=u*Te,ce+=u*Oe,Q+=u*me,pe+=u*Ie,oe+=u*$e,Ce+=u*ge,F+=u*xe,j+=u*g,R+=u*h,f+=u*d,A+=u*v,ee+=u*P,ne+=u*U,Ee+=u*k,Le+=u*se,Pe+=u*he,u=S[13],ce+=u*Te,Q+=u*Oe,pe+=u*me,oe+=u*Ie,Ce+=u*$e,F+=u*ge,j+=u*xe,R+=u*g,f+=u*h,A+=u*d,ee+=u*v,ne+=u*P,Ee+=u*U,Le+=u*k,Pe+=u*se,Ue+=u*he,u=S[14],Q+=u*Te,pe+=u*Oe,oe+=u*me,Ce+=u*Ie,F+=u*$e,j+=u*ge,R+=u*xe,f+=u*g,A+=u*h,ee+=u*d,ne+=u*v,Ee+=u*P,Le+=u*U,Pe+=u*k,Ue+=u*se,Ge+=u*he,u=S[15],pe+=u*Te,oe+=u*Oe,Ce+=u*me,F+=u*Ie,j+=u*$e,R+=u*ge,f+=u*xe,A+=u*g,ee+=u*h,ne+=u*d,Ee+=u*v,Le+=u*P,Pe+=u*U,Ue+=u*k,Ge+=u*se,Ve+=u*he,H+=38*oe,B+=38*Ce,q+=38*F,X+=38*j,te+=38*R,x+=38*f,$+=38*A,K+=38*ee,Y+=38*ne,W+=38*Ee,z+=38*Le,J+=38*Pe,G+=38*Ue,ce+=38*Ge,Q+=38*Ve,_=1,u=H+_+65535,_=Math.floor(u/65536),H=u-_*65536,u=B+_+65535,_=Math.floor(u/65536),B=u-_*65536,u=q+_+65535,_=Math.floor(u/65536),q=u-_*65536,u=X+_+65535,_=Math.floor(u/65536),X=u-_*65536,u=te+_+65535,_=Math.floor(u/65536),te=u-_*65536,u=x+_+65535,_=Math.floor(u/65536),x=u-_*65536,u=$+_+65535,_=Math.floor(u/65536),$=u-_*65536,u=K+_+65535,_=Math.floor(u/65536),K=u-_*65536,u=Y+_+65535,_=Math.floor(u/65536),Y=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=z+_+65535,_=Math.floor(u/65536),z=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=ce+_+65535,_=Math.floor(u/65536),ce=u-_*65536,u=Q+_+65535,_=Math.floor(u/65536),Q=u-_*65536,u=pe+_+65535,_=Math.floor(u/65536),pe=u-_*65536,H+=_-1+37*(_-1),_=1,u=H+_+65535,_=Math.floor(u/65536),H=u-_*65536,u=B+_+65535,_=Math.floor(u/65536),B=u-_*65536,u=q+_+65535,_=Math.floor(u/65536),q=u-_*65536,u=X+_+65535,_=Math.floor(u/65536),X=u-_*65536,u=te+_+65535,_=Math.floor(u/65536),te=u-_*65536,u=x+_+65535,_=Math.floor(u/65536),x=u-_*65536,u=$+_+65535,_=Math.floor(u/65536),$=u-_*65536,u=K+_+65535,_=Math.floor(u/65536),K=u-_*65536,u=Y+_+65535,_=Math.floor(u/65536),Y=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=z+_+65535,_=Math.floor(u/65536),z=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=ce+_+65535,_=Math.floor(u/65536),ce=u-_*65536,u=Q+_+65535,_=Math.floor(u/65536),Q=u-_*65536,u=pe+_+65535,_=Math.floor(u/65536),pe=u-_*65536,H+=_-1+37*(_-1),b[0]=H,b[1]=B,b[2]=q,b[3]=X,b[4]=te,b[5]=x,b[6]=$,b[7]=K,b[8]=Y,b[9]=W,b[10]=z,b[11]=J,b[12]=G,b[13]=ce,b[14]=Q,b[15]=pe}function y(b,S){w(b,S,S)}function E(b,S){const O=n();for(let u=0;u<16;u++)O[u]=S[u];for(let u=253;u>=0;u--)y(O,O),u!==2&&u!==4&&w(O,O,S);for(let u=0;u<16;u++)b[u]=O[u]}function T(b,S){const O=new Uint8Array(32),u=new Float64Array(80),_=n(),H=n(),B=n(),q=n(),X=n(),te=n();for(let Y=0;Y<31;Y++)O[Y]=b[Y];O[31]=b[31]&127|64,O[0]&=248,l(u,S);for(let Y=0;Y<16;Y++)H[Y]=u[Y];_[0]=q[0]=1;for(let Y=254;Y>=0;--Y){const W=O[Y>>>3]>>>(Y&7)&1;a(_,H,W),a(B,q,W),p(X,_,B),m(_,_,B),p(B,H,q),m(H,H,q),y(q,X),y(te,_),w(_,B,_),w(B,H,X),p(X,_,B),m(_,_,B),y(H,_),m(B,q,te),w(_,B,s),p(_,_,q),w(B,B,_),w(_,q,te),w(q,H,u),y(H,X),a(_,H,W),a(B,q,W)}for(let Y=0;Y<16;Y++)u[Y+16]=_[Y],u[Y+32]=B[Y],u[Y+48]=H[Y],u[Y+64]=q[Y];const x=u.subarray(32),$=u.subarray(16);E(x,x),w($,$,x);const K=new Uint8Array(32);return c(K,$),K}t.scalarMult=T;function N(b){return T(b,i)}t.scalarMultBase=N;function L(b){if(b.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const S=new Uint8Array(b);return{publicKey:N(S),secretKey:S}}t.generateKeyPairFromSeed=L;function C(b){const S=(0,e.randomBytes)(32,b),O=L(S);return(0,r.wipe)(S),O}t.generateKeyPair=C;function D(b,S,O=!1){if(b.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(S.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const u=T(b,S);if(O){let _=0;for(let H=0;H<u.length;H++)_|=u[H];if(_===0)throw new Error("X25519: invalid shared key")}return u}t.sharedKey=D})(bo);function wl(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function vo(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=wl(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function e1(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function m(E){if(E instanceof Uint8Array||(ArrayBuffer.isView(E)?E=new Uint8Array(E.buffer,E.byteOffset,E.byteLength):Array.isArray(E)&&(E=Uint8Array.from(E))),!(E instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(E.length===0)return"";for(var T=0,N=0,L=0,C=E.length;L!==C&&E[L]===0;)L++,T++;for(var D=(C-L)*p+1>>>0,b=new Uint8Array(D);L!==C;){for(var S=E[L],O=0,u=D-1;(S!==0||O<N)&&u!==-1;u--,O++)S+=256*b[u]>>>0,b[u]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");N=O,L++}for(var _=D-N;_!==D&&b[_]===0;)_++;for(var H=c.repeat(T);_<D;++_)H+=t.charAt(b[_]);return H}function w(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return new Uint8Array;var T=0;if(E[T]!==" "){for(var N=0,L=0;E[T]===c;)N++,T++;for(var C=(E.length-T)*l+1>>>0,D=new Uint8Array(C);E[T];){var b=r[E.charCodeAt(T)];if(b===255)return;for(var S=0,O=C-1;(b!==0||S<L)&&O!==-1;O--,S++)b+=a*D[O]>>>0,D[O]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");L=S,T++}if(E[T]!==" "){for(var u=C-L;u!==C&&D[u]===0;)u++;for(var _=new Uint8Array(N+(C-u)),H=N;u!==C;)_[H++]=D[u++];return _}}}function y(E){var T=w(E);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:m,decodeUnsafe:w,decode:y}}var t1=e1,r1=t1;const yl=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},n1=t=>new TextEncoder().encode(t),i1=t=>new TextDecoder().decode(t);class s1{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class o1{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return bl(this,e)}}class a1{constructor(e){this.decoders=e}or(e){return bl(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const bl=(t,e)=>new a1({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class c1{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new s1(e,r,n),this.decoder=new o1(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const rs=({name:t,prefix:e,encode:r,decode:n})=>new c1(t,e,r,n),qn=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=r1(r,e);return rs({prefix:t,name:e,encode:n,decode:s=>yl(i(s))})},l1=(t,e,r,n)=>{const i={};for(let p=0;p<e.length;++p)i[e[p]]=p;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let p=0;p<s;++p){const m=i[t[p]];if(m===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|m,a+=r,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},h1=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},Ct=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>rs({prefix:e,name:t,encode(i){return h1(i,n,r)},decode(i){return l1(i,n,r,t)}}),u1=rs({prefix:"\0",name:"identity",encode:t=>i1(t),decode:t=>n1(t)});var d1=Object.freeze({__proto__:null,identity:u1});const f1=Ct({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var p1=Object.freeze({__proto__:null,base2:f1});const g1=Ct({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var m1=Object.freeze({__proto__:null,base8:g1});const w1=qn({prefix:"9",name:"base10",alphabet:"0123456789"});var y1=Object.freeze({__proto__:null,base10:w1});const b1=Ct({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),v1=Ct({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var _1=Object.freeze({__proto__:null,base16:b1,base16upper:v1});const E1=Ct({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),x1=Ct({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),C1=Ct({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),I1=Ct({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),S1=Ct({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),D1=Ct({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O1=Ct({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),$1=Ct({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),A1=Ct({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var P1=Object.freeze({__proto__:null,base32:E1,base32upper:x1,base32pad:C1,base32padupper:I1,base32hex:S1,base32hexupper:D1,base32hexpad:O1,base32hexpadupper:$1,base32z:A1});const T1=qn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),N1=qn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var R1=Object.freeze({__proto__:null,base36:T1,base36upper:N1});const M1=qn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),L1=qn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var U1=Object.freeze({__proto__:null,base58btc:M1,base58flickr:L1});const j1=Ct({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),F1=Ct({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),B1=Ct({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),k1=Ct({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var H1=Object.freeze({__proto__:null,base64:j1,base64pad:F1,base64url:B1,base64urlpad:k1});const vl=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),z1=vl.reduce((t,e,r)=>(t[r]=e,t),[]),W1=vl.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function q1(t){return t.reduce((e,r)=>(e+=z1[r],e),"")}function V1(t){const e=[];for(const r of t){const n=W1[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const K1=rs({prefix:"\u{1F680}",name:"base256emoji",encode:q1,decode:V1});var G1=Object.freeze({__proto__:null,base256emoji:K1}),Z1=El,_l=128,Y1=127,J1=~Y1,X1=Math.pow(2,31);function El(t,e,r){e=e||[],r=r||0;for(var n=r;t>=X1;)e[r++]=t&255|_l,t/=128;for(;t&J1;)e[r++]=t&255|_l,t>>>=7;return e[r]=t|0,El.bytes=r-n+1,e}var Q1=_o,ep=128,xl=127;function _o(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw _o.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&xl)<<i:(o&xl)*Math.pow(2,i),i+=7}while(o>=ep);return _o.bytes=s-n,r}var tp=Math.pow(2,7),rp=Math.pow(2,14),np=Math.pow(2,21),ip=Math.pow(2,28),sp=Math.pow(2,35),op=Math.pow(2,42),ap=Math.pow(2,49),cp=Math.pow(2,56),lp=Math.pow(2,63),hp=function(t){return t<tp?1:t<rp?2:t<np?3:t<ip?4:t<sp?5:t<op?6:t<ap?7:t<cp?8:t<lp?9:10},up={encode:Z1,decode:Q1,encodingLength:hp},Cl=up;const Il=(t,e,r=0)=>(Cl.encode(t,e,r),e),Sl=t=>Cl.encodingLength(t),Eo=(t,e)=>{const r=e.byteLength,n=Sl(t),i=n+Sl(r),s=new Uint8Array(i+r);return Il(t,s,0),Il(r,s,n),s.set(e,i),new dp(t,r,e,s)};class dp{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Dl=({name:t,code:e,encode:r})=>new fp(t,e,r);class fp{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Eo(this.code,r):r.then(n=>Eo(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Ol=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),pp=Dl({name:"sha2-256",code:18,encode:Ol("SHA-256")}),gp=Dl({name:"sha2-512",code:19,encode:Ol("SHA-512")});var mp=Object.freeze({__proto__:null,sha256:pp,sha512:gp});const $l=0,wp="identity",Al=yl;var yp=Object.freeze({__proto__:null,identity:{code:$l,name:wp,encode:Al,digest:t=>Eo($l,Al(t))}});new TextEncoder,new TextDecoder;const Pl={...d1,...p1,...m1,...y1,..._1,...P1,...R1,...U1,...H1,...G1};({...mp,...yp});function Tl(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Nl=Tl("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),xo=Tl("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=wl(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Rl={utf8:Nl,"utf-8":Nl,hex:Pl.base16,latin1:xo,ascii:xo,binary:xo,...Pl};function Mt(t,e="utf8"){const r=Rl[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function Lt(t,e="utf8"){const r=Rl[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var Ml=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))},bp=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),vp=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),_p=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),Ep=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),xp=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Cp=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Ip=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Ll=3,Sp=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Cp]],Ul=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Dp(t){return t?jl(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new xp:typeof navigator<"u"?jl(navigator.userAgent):Ap()}function Op(t){return t!==""&&Sp.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function jl(t){var e=Op(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new Ep;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Ll&&(i=Ml(Ml([],i,!0),Pp(Ll-i.length),!0)):i=[];var s=i.join("."),o=$p(t),a=Ip.exec(t);return a&&a[1]?new _p(r,s,o,a[1]):new bp(r,s,o)}function $p(t){for(var e=0,r=Ul.length;e<r;e++){var n=Ul[e],i=n[0],s=n[1],o=s.exec(t);if(o)return i}return null}function Ap(){var t=typeof process<"u"&&process.version;return t?new vp(process.version.slice(1)):null}function Pp(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var fe={};/*! *****************************************************************************
|
|
1
|
+
(function(Xt,dt){typeof exports=="object"&&typeof module<"u"?dt(exports):typeof define=="function"&&define.amd?define(["exports"],dt):(Xt=typeof globalThis<"u"?globalThis:Xt||self,dt(Xt["@walletconnect/ethereum-provider"]={}))})(this,function(Xt){"use strict";var dt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Tr(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var ft={exports:{}},ln=typeof Reflect=="object"?Reflect:null,Gc=ln&&typeof ln.apply=="function"?ln.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Zi;ln&&typeof ln.ownKeys=="function"?Zi=ln.ownKeys:Object.getOwnPropertySymbols?Zi=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Zi=function(e){return Object.getOwnPropertyNames(e)};function _f(t){console&&console.warn&&console.warn(t)}var Zc=Number.isNaN||function(e){return e!==e};function ke(){ke.init.call(this)}ft.exports=ke,ft.exports.once=If,ke.EventEmitter=ke,ke.prototype._events=void 0,ke.prototype._eventsCount=0,ke.prototype._maxListeners=void 0;var Yc=10;function Yi(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(ke,"defaultMaxListeners",{enumerable:!0,get:function(){return Yc},set:function(t){if(typeof t!="number"||t<0||Zc(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Yc=t}}),ke.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ke.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Zc(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Jc(t){return t._maxListeners===void 0?ke.defaultMaxListeners:t._maxListeners}ke.prototype.getMaxListeners=function(){return Jc(this)},ke.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")Gc(c,this,r);else for(var l=c.length,p=rl(c,l),n=0;n<l;++n)Gc(p[n],this,r);return!0};function Xc(t,e,r,n){var i,s,o;if(Yi(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),i=Jc(t),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,_f(a)}return t}ke.prototype.addListener=function(e,r){return Xc(this,e,r,!1)},ke.prototype.on=ke.prototype.addListener,ke.prototype.prependListener=function(e,r){return Xc(this,e,r,!0)};function Ef(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Qc(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Ef.bind(n);return i.listener=r,n.wrapFn=i,i}ke.prototype.once=function(e,r){return Yi(r),this.on(e,Qc(this,e,r)),this},ke.prototype.prependOnceListener=function(e,r){return Yi(r),this.prependListener(e,Qc(this,e,r)),this},ke.prototype.removeListener=function(e,r){var n,i,s,o,a;if(Yi(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():xf(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this},ke.prototype.off=ke.prototype.removeListener,ke.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function el(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Cf(i):rl(i,i.length)}ke.prototype.listeners=function(e){return el(this,e,!0)},ke.prototype.rawListeners=function(e){return el(this,e,!1)},ke.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):tl.call(t,e)},ke.prototype.listenerCount=tl;function tl(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}ke.prototype.eventNames=function(){return this._eventsCount>0?Zi(this._events):[]};function rl(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function xf(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Cf(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function If(t,e){return new Promise(function(r,n){function i(o){t.removeListener(e,s),n(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}nl(t,e,s,{once:!0}),e!=="error"&&Sf(t,i,{once:!0})})}function Sf(t,e,r){typeof t.on=="function"&&nl(t,"error",e,r)}function nl(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(s){n.once&&t.removeEventListener(e,i),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var po={},Ji={},_e={},il={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,p=a&65535,m=c>>>16&65535,w=c&65535;return p*w+(l*w+p*m<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<<c|a>>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(il),Object.defineProperty(_e,"__esModule",{value:!0});var sl=il;function Df(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}_e.readInt16BE=Df;function Of(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}_e.readUint16BE=Of;function $f(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}_e.readInt16LE=$f;function Af(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}_e.readUint16LE=Af;function ol(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}_e.writeUint16BE=ol,_e.writeInt16BE=ol;function al(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}_e.writeUint16LE=al,_e.writeInt16LE=al;function go(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}_e.readInt32BE=go;function mo(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}_e.readUint32BE=mo;function wo(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}_e.readInt32LE=wo;function yo(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}_e.readUint32LE=yo;function Xi(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}_e.writeUint32BE=Xi,_e.writeInt32BE=Xi;function Qi(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}_e.writeUint32LE=Qi,_e.writeInt32LE=Qi;function Pf(t,e){e===void 0&&(e=0);var r=go(t,e),n=go(t,e+4);return r*4294967296+n-(n>>31)*4294967296}_e.readInt64BE=Pf;function Tf(t,e){e===void 0&&(e=0);var r=mo(t,e),n=mo(t,e+4);return r*4294967296+n}_e.readUint64BE=Tf;function Rf(t,e){e===void 0&&(e=0);var r=wo(t,e),n=wo(t,e+4);return n*4294967296+r-(r>>31)*4294967296}_e.readInt64LE=Rf;function Nf(t,e){e===void 0&&(e=0);var r=yo(t,e),n=yo(t,e+4);return n*4294967296+r}_e.readUint64LE=Nf;function cl(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Xi(t/4294967296>>>0,e,r),Xi(t>>>0,e,r+4),e}_e.writeUint64BE=cl,_e.writeInt64BE=cl;function ll(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Qi(t>>>0,e,r),Qi(t/4294967296>>>0,e,r+4),e}_e.writeUint64LE=ll,_e.writeInt64LE=ll;function Mf(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}_e.readUintBE=Mf;function Lf(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s<r+t/8;s++)n+=e[s]*i,i*=256;return n}_e.readUintLE=Lf;function Uf(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!sl.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,s=t/8+n-1;s>=n;s--)r[s]=e/i&255,i*=256;return r}_e.writeUintBE=Uf;function jf(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!sl.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s<n+t/8;s++)r[s]=e/i&255,i*=256;return r}_e.writeUintLE=jf;function Ff(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}_e.readFloat32BE=Ff;function Bf(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}_e.readFloat32LE=Bf;function kf(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}_e.readFloat64BE=kf;function Hf(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}_e.readFloat64LE=Hf;function zf(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}_e.writeFloat32BE=zf;function Wf(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}_e.writeFloat32LE=Wf;function qf(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}_e.writeFloat64BE=qf;function Vf(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}_e.writeFloat64LE=Vf;var kt={};Object.defineProperty(kt,"__esModule",{value:!0});function Kf(t){for(var e=0;e<t.length;e++)t[e]=0;return t}kt.wipe=Kf,Object.defineProperty(Ji,"__esModule",{value:!0});var Dt=_e,bo=kt,Gf=20;function Zf(t,e,r){for(var n=1634760805,i=857760878,s=2036477234,o=1797285236,a=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],l=r[11]<<24|r[10]<<16|r[9]<<8|r[8],p=r[15]<<24|r[14]<<16|r[13]<<8|r[12],m=r[19]<<24|r[18]<<16|r[17]<<8|r[16],w=r[23]<<24|r[22]<<16|r[21]<<8|r[20],y=r[27]<<24|r[26]<<16|r[25]<<8|r[24],E=r[31]<<24|r[30]<<16|r[29]<<8|r[28],T=e[3]<<24|e[2]<<16|e[1]<<8|e[0],R=e[7]<<24|e[6]<<16|e[5]<<8|e[4],L=e[11]<<24|e[10]<<16|e[9]<<8|e[8],C=e[15]<<24|e[14]<<16|e[13]<<8|e[12],O=n,b=i,S=s,D=o,u=a,_=c,H=l,B=p,q=m,X=w,te=y,x=E,$=T,K=R,Y=L,W=C,z=0;z<Gf;z+=2)O=O+u|0,$^=O,$=$>>>32-16|$<<16,q=q+$|0,u^=q,u=u>>>32-12|u<<12,b=b+_|0,K^=b,K=K>>>32-16|K<<16,X=X+K|0,_^=X,_=_>>>32-12|_<<12,S=S+H|0,Y^=S,Y=Y>>>32-16|Y<<16,te=te+Y|0,H^=te,H=H>>>32-12|H<<12,D=D+B|0,W^=D,W=W>>>32-16|W<<16,x=x+W|0,B^=x,B=B>>>32-12|B<<12,S=S+H|0,Y^=S,Y=Y>>>32-8|Y<<8,te=te+Y|0,H^=te,H=H>>>32-7|H<<7,D=D+B|0,W^=D,W=W>>>32-8|W<<8,x=x+W|0,B^=x,B=B>>>32-7|B<<7,b=b+_|0,K^=b,K=K>>>32-8|K<<8,X=X+K|0,_^=X,_=_>>>32-7|_<<7,O=O+u|0,$^=O,$=$>>>32-8|$<<8,q=q+$|0,u^=q,u=u>>>32-7|u<<7,O=O+_|0,W^=O,W=W>>>32-16|W<<16,te=te+W|0,_^=te,_=_>>>32-12|_<<12,b=b+H|0,$^=b,$=$>>>32-16|$<<16,x=x+$|0,H^=x,H=H>>>32-12|H<<12,S=S+B|0,K^=S,K=K>>>32-16|K<<16,q=q+K|0,B^=q,B=B>>>32-12|B<<12,D=D+u|0,Y^=D,Y=Y>>>32-16|Y<<16,X=X+Y|0,u^=X,u=u>>>32-12|u<<12,S=S+B|0,K^=S,K=K>>>32-8|K<<8,q=q+K|0,B^=q,B=B>>>32-7|B<<7,D=D+u|0,Y^=D,Y=Y>>>32-8|Y<<8,X=X+Y|0,u^=X,u=u>>>32-7|u<<7,b=b+H|0,$^=b,$=$>>>32-8|$<<8,x=x+$|0,H^=x,H=H>>>32-7|H<<7,O=O+_|0,W^=O,W=W>>>32-8|W<<8,te=te+W|0,_^=te,_=_>>>32-7|_<<7;Dt.writeUint32LE(O+n|0,t,0),Dt.writeUint32LE(b+i|0,t,4),Dt.writeUint32LE(S+s|0,t,8),Dt.writeUint32LE(D+o|0,t,12),Dt.writeUint32LE(u+a|0,t,16),Dt.writeUint32LE(_+c|0,t,20),Dt.writeUint32LE(H+l|0,t,24),Dt.writeUint32LE(B+p|0,t,28),Dt.writeUint32LE(q+m|0,t,32),Dt.writeUint32LE(X+w|0,t,36),Dt.writeUint32LE(te+y|0,t,40),Dt.writeUint32LE(x+E|0,t,44),Dt.writeUint32LE($+T|0,t,48),Dt.writeUint32LE(K+R|0,t,52),Dt.writeUint32LE(Y+L|0,t,56),Dt.writeUint32LE(W+C|0,t,60)}function hl(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var s,o;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),o=s.length-e.length,s.set(e,o)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,o=i}for(var a=new Uint8Array(64),c=0;c<r.length;c+=64){Zf(a,s,t);for(var l=c;l<c+64&&l<r.length;l++)n[l]=r[l]^a[l-c];Jf(s,0,o)}return bo.wipe(a),i===0&&bo.wipe(s),n}Ji.streamXOR=hl;function Yf(t,e,r,n){return n===void 0&&(n=0),bo.wipe(r),hl(t,e,r,r,n)}Ji.stream=Yf;function Jf(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var ul={},wr={};Object.defineProperty(wr,"__esModule",{value:!0});function Xf(t,e,r){return~(t-1)&e|t-1&r}wr.select=Xf;function Qf(t,e){return(t|0)-(e|0)-1>>>31&1}wr.lessOrEqual=Qf;function dl(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}wr.compare=dl;function e1(t,e){return t.length===0||e.length===0?!1:dl(t,e)!==0}wr.equal=e1,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=wr,r=kt;t.DIGEST_LENGTH=16;var n=function(){function o(a){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var p=a[4]|a[5]<<8;this._r[2]=(l>>>10|p<<6)&7939;var m=a[6]|a[7]<<8;this._r[3]=(p>>>7|m<<9)&8191;var w=a[8]|a[9]<<8;this._r[4]=(m>>>4|w<<12)&255,this._r[5]=w>>>1&8190;var y=a[10]|a[11]<<8;this._r[6]=(w>>>14|y<<2)&8191;var E=a[12]|a[13]<<8;this._r[7]=(y>>>11|E<<5)&8065;var T=a[14]|a[15]<<8;this._r[8]=(E>>>8|T<<8)&8191,this._r[9]=T>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var p=this._fin?0:2048,m=this._h[0],w=this._h[1],y=this._h[2],E=this._h[3],T=this._h[4],R=this._h[5],L=this._h[6],C=this._h[7],O=this._h[8],b=this._h[9],S=this._r[0],D=this._r[1],u=this._r[2],_=this._r[3],H=this._r[4],B=this._r[5],q=this._r[6],X=this._r[7],te=this._r[8],x=this._r[9];l>=16;){var $=a[c+0]|a[c+1]<<8;m+=$&8191;var K=a[c+2]|a[c+3]<<8;w+=($>>>13|K<<3)&8191;var Y=a[c+4]|a[c+5]<<8;y+=(K>>>10|Y<<6)&8191;var W=a[c+6]|a[c+7]<<8;E+=(Y>>>7|W<<9)&8191;var z=a[c+8]|a[c+9]<<8;T+=(W>>>4|z<<12)&8191,R+=z>>>1&8191;var J=a[c+10]|a[c+11]<<8;L+=(z>>>14|J<<2)&8191;var G=a[c+12]|a[c+13]<<8;C+=(J>>>11|G<<5)&8191;var ce=a[c+14]|a[c+15]<<8;O+=(G>>>8|ce<<8)&8191,b+=ce>>>5|p;var Q=0,pe=Q;pe+=m*S,pe+=w*(5*x),pe+=y*(5*te),pe+=E*(5*X),pe+=T*(5*q),Q=pe>>>13,pe&=8191,pe+=R*(5*B),pe+=L*(5*H),pe+=C*(5*_),pe+=O*(5*u),pe+=b*(5*D),Q+=pe>>>13,pe&=8191;var oe=Q;oe+=m*D,oe+=w*S,oe+=y*(5*x),oe+=E*(5*te),oe+=T*(5*X),Q=oe>>>13,oe&=8191,oe+=R*(5*q),oe+=L*(5*B),oe+=C*(5*H),oe+=O*(5*_),oe+=b*(5*u),Q+=oe>>>13,oe&=8191;var Ce=Q;Ce+=m*u,Ce+=w*D,Ce+=y*S,Ce+=E*(5*x),Ce+=T*(5*te),Q=Ce>>>13,Ce&=8191,Ce+=R*(5*X),Ce+=L*(5*q),Ce+=C*(5*B),Ce+=O*(5*H),Ce+=b*(5*_),Q+=Ce>>>13,Ce&=8191;var F=Q;F+=m*_,F+=w*u,F+=y*D,F+=E*S,F+=T*(5*x),Q=F>>>13,F&=8191,F+=R*(5*te),F+=L*(5*X),F+=C*(5*q),F+=O*(5*B),F+=b*(5*H),Q+=F>>>13,F&=8191;var j=Q;j+=m*H,j+=w*_,j+=y*u,j+=E*D,j+=T*S,Q=j>>>13,j&=8191,j+=R*(5*x),j+=L*(5*te),j+=C*(5*X),j+=O*(5*q),j+=b*(5*B),Q+=j>>>13,j&=8191;var N=Q;N+=m*B,N+=w*H,N+=y*_,N+=E*u,N+=T*D,Q=N>>>13,N&=8191,N+=R*S,N+=L*(5*x),N+=C*(5*te),N+=O*(5*X),N+=b*(5*q),Q+=N>>>13,N&=8191;var f=Q;f+=m*q,f+=w*B,f+=y*H,f+=E*_,f+=T*u,Q=f>>>13,f&=8191,f+=R*D,f+=L*S,f+=C*(5*x),f+=O*(5*te),f+=b*(5*X),Q+=f>>>13,f&=8191;var A=Q;A+=m*X,A+=w*q,A+=y*B,A+=E*H,A+=T*_,Q=A>>>13,A&=8191,A+=R*u,A+=L*D,A+=C*S,A+=O*(5*x),A+=b*(5*te),Q+=A>>>13,A&=8191;var ee=Q;ee+=m*te,ee+=w*X,ee+=y*q,ee+=E*B,ee+=T*H,Q=ee>>>13,ee&=8191,ee+=R*_,ee+=L*u,ee+=C*D,ee+=O*S,ee+=b*(5*x),Q+=ee>>>13,ee&=8191;var ne=Q;ne+=m*x,ne+=w*te,ne+=y*X,ne+=E*q,ne+=T*B,Q=ne>>>13,ne&=8191,ne+=R*H,ne+=L*_,ne+=C*u,ne+=O*D,ne+=b*S,Q+=ne>>>13,ne&=8191,Q=(Q<<2)+Q|0,Q=Q+pe|0,pe=Q&8191,Q=Q>>>13,oe+=Q,m=pe,w=oe,y=Ce,E=F,T=j,R=N,L=f,C=A,O=ee,b=ne,c+=16,l-=16}this._h[0]=m,this._h[1]=w,this._h[2]=y,this._h[3]=E,this._h[4]=T,this._h[5]=R,this._h[6]=L,this._h[7]=C,this._h[8]=O,this._h[9]=b},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),p,m,w,y;if(this._leftover){for(y=this._leftover,this._buffer[y++]=1;y<16;y++)this._buffer[y]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(p=this._h[1]>>>13,this._h[1]&=8191,y=2;y<10;y++)this._h[y]+=p,p=this._h[y]>>>13,this._h[y]&=8191;for(this._h[0]+=p*5,p=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=p,p=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=p,l[0]=this._h[0]+5,p=l[0]>>>13,l[0]&=8191,y=1;y<10;y++)l[y]=this._h[y]+p,p=l[y]>>>13,l[y]&=8191;for(l[9]-=1<<13,m=(p^1)-1,y=0;y<10;y++)l[y]&=m;for(m=~m,y=0;y<10;y++)this._h[y]=this._h[y]&m|l[y];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,w=this._h[0]+this._pad[0],this._h[0]=w&65535,y=1;y<8;y++)w=(this._h[y]+this._pad[y]|0)+(w>>>16)|0,this._h[y]=w&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,p;if(this._leftover){p=16-this._leftover,p>l&&(p=l);for(var m=0;m<p;m++)this._buffer[this._leftover+m]=a[c+m];if(l-=p,c+=p,this._leftover+=p,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(l>=16&&(p=l-l%16,this._blocks(a,c,p),c+=p,l-=p),l){for(var m=0;m<l;m++)this._buffer[this._leftover+m]=a[c+m];this._leftover+=l}return this},o.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var a=new Uint8Array(16);return this.finish(a),a},o.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},o}();t.Poly1305=n;function i(o,a){var c=new n(o);c.update(a);var l=c.digest();return c.clean(),l}t.oneTimeAuth=i;function s(o,a){return o.length!==t.DIGEST_LENGTH||a.length!==t.DIGEST_LENGTH?!1:e.equal(o,a)}t.equal=s}(ul),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ji,r=ul,n=kt,i=_e,s=wr;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var o=new Uint8Array(16),a=function(){function c(l){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,l.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(l)}return c.prototype.seal=function(l,p,m,w){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var y=new Uint8Array(16);y.set(l,y.length-l.length);var E=new Uint8Array(32);e.stream(this._key,y,E,4);var T=p.length+this.tagLength,R;if(w){if(w.length!==T)throw new Error("ChaCha20Poly1305: incorrect destination length");R=w}else R=new Uint8Array(T);return e.streamXOR(this._key,y,p,R,4),this._authenticate(R.subarray(R.length-this.tagLength,R.length),E,R.subarray(0,R.length-this.tagLength),m),n.wipe(y),R},c.prototype.open=function(l,p,m,w){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(p.length<this.tagLength)return null;var y=new Uint8Array(16);y.set(l,y.length-l.length);var E=new Uint8Array(32);e.stream(this._key,y,E,4);var T=new Uint8Array(this.tagLength);if(this._authenticate(T,E,p.subarray(0,p.length-this.tagLength),m),!s.equal(T,p.subarray(p.length-this.tagLength,p.length)))return null;var R=p.length-this.tagLength,L;if(w){if(w.length!==R)throw new Error("ChaCha20Poly1305: incorrect destination length");L=w}else L=new Uint8Array(R);return e.streamXOR(this._key,y,p.subarray(0,p.length-this.tagLength),L,4),n.wipe(y),L},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(l,p,m,w){var y=new r.Poly1305(p);w&&(y.update(w),w.length%16>0&&y.update(o.subarray(w.length%16))),y.update(m),m.length%16>0&&y.update(o.subarray(m.length%16));var E=new Uint8Array(8);w&&i.writeUint64LE(w.length,E),y.update(E),i.writeUint64LE(m.length,E),y.update(E);for(var T=y.digest(),R=0;R<T.length;R++)l[R]=T[R];y.clean(),n.wipe(T),n.wipe(E)},c}();t.ChaCha20Poly1305=a}(po);var fl={},Wn={},vo={};Object.defineProperty(vo,"__esModule",{value:!0});function t1(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}vo.isSerializableHash=t1,Object.defineProperty(Wn,"__esModule",{value:!0});var er=vo,r1=wr,n1=kt,pl=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),er.isSerializableHash(this._inner)&&er.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),n1.wipe(n)}return t.prototype.reset=function(){if(!er.isSerializableHash(this._inner)||!er.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){er.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),er.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!er.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!er.isSerializableHash(this._inner)||!er.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!er.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Wn.HMAC=pl;function i1(t,e,r){var n=new pl(t,e);n.update(r);var i=n.digest();return n.clean(),i}Wn.hmac=i1,Wn.equal=r1.equal,Object.defineProperty(fl,"__esModule",{value:!0});var gl=Wn,ml=kt,s1=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var s=gl.hmac(this._hash,n,r);this._hmac=new gl.HMAC(e,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),ml.wipe(this._buffer),ml.wipe(this._counter),this._bufpos=0},t}(),o1=fl.HKDF=s1,hn={},es={},ts={};Object.defineProperty(ts,"__esModule",{value:!0}),ts.BrowserRandomSource=void 0;const wl=65536;class a1{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=wl)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,wl)));return r}}ts.BrowserRandomSource=a1;function c1(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var rs={},l1={},h1=Object.freeze({__proto__:null,default:l1}),u1=Tr(h1);Object.defineProperty(rs,"__esModule",{value:!0}),rs.NodeRandomSource=void 0;const d1=kt;class f1{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof c1<"u"){const e=u1;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,d1.wipe)(r),n}}rs.NodeRandomSource=f1,Object.defineProperty(es,"__esModule",{value:!0}),es.SystemRandomSource=void 0;const p1=ts,g1=rs;class m1{constructor(){if(this.isAvailable=!1,this.name="",this._source=new p1.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new g1.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}es.SystemRandomSource=m1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=es,r=_e,n=kt;t.defaultRandomSource=new e.SystemRandomSource;function i(l,p=t.defaultRandomSource){return p.randomBytes(l)}t.randomBytes=i;function s(l=t.defaultRandomSource){const p=i(4,l),m=(0,r.readUint32LE)(p);return(0,n.wipe)(p),m}t.randomUint32=s;const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(l,p=o,m=t.defaultRandomSource){if(p.length<2)throw new Error("randomString charset is too short");if(p.length>256)throw new Error("randomString charset is too long");let w="";const y=p.length,E=256-256%y;for(;l>0;){const T=i(Math.ceil(l*256/E),m);for(let R=0;R<T.length&&l>0;R++){const L=T[R];L<E&&(w+=p.charAt(L%y),l--)}(0,n.wipe)(T)}return w}t.randomString=a;function c(l,p=o,m=t.defaultRandomSource){const w=Math.ceil(l/(Math.log(p.length)/Math.LN2));return a(w,p,m)}t.randomStringForEntropy=c}(hn);var ns={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_e,r=kt;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function a(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return a.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},a.prototype.update=function(c,l){if(l===void 0&&(l=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var p=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&l>0;)this._buffer[this._bufferLength++]=c[p++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(p=s(this._temp,this._state,c,p,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[p++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,p=this._bufferLength,m=l/536870912|0,w=l<<3,y=l%64<56?64:128;this._buffer[p]=128;for(var E=p+1;E<y-8;E++)this._buffer[E]=0;e.writeUint32BE(m,this._buffer,y-8),e.writeUint32BE(w,this._buffer,y-4),s(this._temp,this._state,this._buffer,0,y),this._finished=!0}for(var E=0;E<this.digestLength/4;E++)e.writeUint32BE(this._state[E],c,E*4);return this},a.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([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]);function s(a,c,l,p,m){for(;m>=64;){for(var w=c[0],y=c[1],E=c[2],T=c[3],R=c[4],L=c[5],C=c[6],O=c[7],b=0;b<16;b++){var S=p+b*4;a[b]=e.readUint32BE(l,S)}for(var b=16;b<64;b++){var D=a[b-2],u=(D>>>17|D<<32-17)^(D>>>19|D<<32-19)^D>>>10;D=a[b-15];var _=(D>>>7|D<<32-7)^(D>>>18|D<<32-18)^D>>>3;a[b]=(u+a[b-7]|0)+(_+a[b-16]|0)}for(var b=0;b<64;b++){var u=(((R>>>6|R<<26)^(R>>>11|R<<21)^(R>>>25|R<<7))+(R&L^~R&C)|0)+(O+(i[b]+a[b]|0)|0)|0,_=((w>>>2|w<<32-2)^(w>>>13|w<<32-13)^(w>>>22|w<<32-22))+(w&y^w&E^y&E)|0;O=C,C=L,L=R,R=T+u|0,T=E,E=y,y=w,w=u+_|0}c[0]+=w,c[1]+=y,c[2]+=E,c[3]+=T,c[4]+=R,c[5]+=L,c[6]+=C,c[7]+=O,p+=64,m-=64}return p}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(ns);var _o={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=hn,r=kt;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(b){const S=new Float64Array(16);if(b)for(let D=0;D<b.length;D++)S[D]=b[D];return S}const i=new Uint8Array(32);i[0]=9;const s=n([56129,1]);function o(b){let S=1;for(let D=0;D<16;D++){let u=b[D]+S+65535;S=Math.floor(u/65536),b[D]=u-S*65536}b[0]+=S-1+37*(S-1)}function a(b,S,D){const u=~(D-1);for(let _=0;_<16;_++){const H=u&(b[_]^S[_]);b[_]^=H,S[_]^=H}}function c(b,S){const D=n(),u=n();for(let _=0;_<16;_++)u[_]=S[_];o(u),o(u),o(u);for(let _=0;_<2;_++){D[0]=u[0]-65517;for(let B=1;B<15;B++)D[B]=u[B]-65535-(D[B-1]>>16&1),D[B-1]&=65535;D[15]=u[15]-32767-(D[14]>>16&1);const H=D[15]>>16&1;D[14]&=65535,a(u,D,1-H)}for(let _=0;_<16;_++)b[2*_]=u[_]&255,b[2*_+1]=u[_]>>8}function l(b,S){for(let D=0;D<16;D++)b[D]=S[2*D]+(S[2*D+1]<<8);b[15]&=32767}function p(b,S,D){for(let u=0;u<16;u++)b[u]=S[u]+D[u]}function m(b,S,D){for(let u=0;u<16;u++)b[u]=S[u]-D[u]}function w(b,S,D){let u,_,H=0,B=0,q=0,X=0,te=0,x=0,$=0,K=0,Y=0,W=0,z=0,J=0,G=0,ce=0,Q=0,pe=0,oe=0,Ce=0,F=0,j=0,N=0,f=0,A=0,ee=0,ne=0,Ee=0,Le=0,Pe=0,Ue=0,Ge=0,Ve=0,Te=D[0],Oe=D[1],me=D[2],Ie=D[3],$e=D[4],ge=D[5],xe=D[6],g=D[7],h=D[8],d=D[9],v=D[10],P=D[11],U=D[12],k=D[13],se=D[14],he=D[15];u=S[0],H+=u*Te,B+=u*Oe,q+=u*me,X+=u*Ie,te+=u*$e,x+=u*ge,$+=u*xe,K+=u*g,Y+=u*h,W+=u*d,z+=u*v,J+=u*P,G+=u*U,ce+=u*k,Q+=u*se,pe+=u*he,u=S[1],B+=u*Te,q+=u*Oe,X+=u*me,te+=u*Ie,x+=u*$e,$+=u*ge,K+=u*xe,Y+=u*g,W+=u*h,z+=u*d,J+=u*v,G+=u*P,ce+=u*U,Q+=u*k,pe+=u*se,oe+=u*he,u=S[2],q+=u*Te,X+=u*Oe,te+=u*me,x+=u*Ie,$+=u*$e,K+=u*ge,Y+=u*xe,W+=u*g,z+=u*h,J+=u*d,G+=u*v,ce+=u*P,Q+=u*U,pe+=u*k,oe+=u*se,Ce+=u*he,u=S[3],X+=u*Te,te+=u*Oe,x+=u*me,$+=u*Ie,K+=u*$e,Y+=u*ge,W+=u*xe,z+=u*g,J+=u*h,G+=u*d,ce+=u*v,Q+=u*P,pe+=u*U,oe+=u*k,Ce+=u*se,F+=u*he,u=S[4],te+=u*Te,x+=u*Oe,$+=u*me,K+=u*Ie,Y+=u*$e,W+=u*ge,z+=u*xe,J+=u*g,G+=u*h,ce+=u*d,Q+=u*v,pe+=u*P,oe+=u*U,Ce+=u*k,F+=u*se,j+=u*he,u=S[5],x+=u*Te,$+=u*Oe,K+=u*me,Y+=u*Ie,W+=u*$e,z+=u*ge,J+=u*xe,G+=u*g,ce+=u*h,Q+=u*d,pe+=u*v,oe+=u*P,Ce+=u*U,F+=u*k,j+=u*se,N+=u*he,u=S[6],$+=u*Te,K+=u*Oe,Y+=u*me,W+=u*Ie,z+=u*$e,J+=u*ge,G+=u*xe,ce+=u*g,Q+=u*h,pe+=u*d,oe+=u*v,Ce+=u*P,F+=u*U,j+=u*k,N+=u*se,f+=u*he,u=S[7],K+=u*Te,Y+=u*Oe,W+=u*me,z+=u*Ie,J+=u*$e,G+=u*ge,ce+=u*xe,Q+=u*g,pe+=u*h,oe+=u*d,Ce+=u*v,F+=u*P,j+=u*U,N+=u*k,f+=u*se,A+=u*he,u=S[8],Y+=u*Te,W+=u*Oe,z+=u*me,J+=u*Ie,G+=u*$e,ce+=u*ge,Q+=u*xe,pe+=u*g,oe+=u*h,Ce+=u*d,F+=u*v,j+=u*P,N+=u*U,f+=u*k,A+=u*se,ee+=u*he,u=S[9],W+=u*Te,z+=u*Oe,J+=u*me,G+=u*Ie,ce+=u*$e,Q+=u*ge,pe+=u*xe,oe+=u*g,Ce+=u*h,F+=u*d,j+=u*v,N+=u*P,f+=u*U,A+=u*k,ee+=u*se,ne+=u*he,u=S[10],z+=u*Te,J+=u*Oe,G+=u*me,ce+=u*Ie,Q+=u*$e,pe+=u*ge,oe+=u*xe,Ce+=u*g,F+=u*h,j+=u*d,N+=u*v,f+=u*P,A+=u*U,ee+=u*k,ne+=u*se,Ee+=u*he,u=S[11],J+=u*Te,G+=u*Oe,ce+=u*me,Q+=u*Ie,pe+=u*$e,oe+=u*ge,Ce+=u*xe,F+=u*g,j+=u*h,N+=u*d,f+=u*v,A+=u*P,ee+=u*U,ne+=u*k,Ee+=u*se,Le+=u*he,u=S[12],G+=u*Te,ce+=u*Oe,Q+=u*me,pe+=u*Ie,oe+=u*$e,Ce+=u*ge,F+=u*xe,j+=u*g,N+=u*h,f+=u*d,A+=u*v,ee+=u*P,ne+=u*U,Ee+=u*k,Le+=u*se,Pe+=u*he,u=S[13],ce+=u*Te,Q+=u*Oe,pe+=u*me,oe+=u*Ie,Ce+=u*$e,F+=u*ge,j+=u*xe,N+=u*g,f+=u*h,A+=u*d,ee+=u*v,ne+=u*P,Ee+=u*U,Le+=u*k,Pe+=u*se,Ue+=u*he,u=S[14],Q+=u*Te,pe+=u*Oe,oe+=u*me,Ce+=u*Ie,F+=u*$e,j+=u*ge,N+=u*xe,f+=u*g,A+=u*h,ee+=u*d,ne+=u*v,Ee+=u*P,Le+=u*U,Pe+=u*k,Ue+=u*se,Ge+=u*he,u=S[15],pe+=u*Te,oe+=u*Oe,Ce+=u*me,F+=u*Ie,j+=u*$e,N+=u*ge,f+=u*xe,A+=u*g,ee+=u*h,ne+=u*d,Ee+=u*v,Le+=u*P,Pe+=u*U,Ue+=u*k,Ge+=u*se,Ve+=u*he,H+=38*oe,B+=38*Ce,q+=38*F,X+=38*j,te+=38*N,x+=38*f,$+=38*A,K+=38*ee,Y+=38*ne,W+=38*Ee,z+=38*Le,J+=38*Pe,G+=38*Ue,ce+=38*Ge,Q+=38*Ve,_=1,u=H+_+65535,_=Math.floor(u/65536),H=u-_*65536,u=B+_+65535,_=Math.floor(u/65536),B=u-_*65536,u=q+_+65535,_=Math.floor(u/65536),q=u-_*65536,u=X+_+65535,_=Math.floor(u/65536),X=u-_*65536,u=te+_+65535,_=Math.floor(u/65536),te=u-_*65536,u=x+_+65535,_=Math.floor(u/65536),x=u-_*65536,u=$+_+65535,_=Math.floor(u/65536),$=u-_*65536,u=K+_+65535,_=Math.floor(u/65536),K=u-_*65536,u=Y+_+65535,_=Math.floor(u/65536),Y=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=z+_+65535,_=Math.floor(u/65536),z=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=ce+_+65535,_=Math.floor(u/65536),ce=u-_*65536,u=Q+_+65535,_=Math.floor(u/65536),Q=u-_*65536,u=pe+_+65535,_=Math.floor(u/65536),pe=u-_*65536,H+=_-1+37*(_-1),_=1,u=H+_+65535,_=Math.floor(u/65536),H=u-_*65536,u=B+_+65535,_=Math.floor(u/65536),B=u-_*65536,u=q+_+65535,_=Math.floor(u/65536),q=u-_*65536,u=X+_+65535,_=Math.floor(u/65536),X=u-_*65536,u=te+_+65535,_=Math.floor(u/65536),te=u-_*65536,u=x+_+65535,_=Math.floor(u/65536),x=u-_*65536,u=$+_+65535,_=Math.floor(u/65536),$=u-_*65536,u=K+_+65535,_=Math.floor(u/65536),K=u-_*65536,u=Y+_+65535,_=Math.floor(u/65536),Y=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=z+_+65535,_=Math.floor(u/65536),z=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=ce+_+65535,_=Math.floor(u/65536),ce=u-_*65536,u=Q+_+65535,_=Math.floor(u/65536),Q=u-_*65536,u=pe+_+65535,_=Math.floor(u/65536),pe=u-_*65536,H+=_-1+37*(_-1),b[0]=H,b[1]=B,b[2]=q,b[3]=X,b[4]=te,b[5]=x,b[6]=$,b[7]=K,b[8]=Y,b[9]=W,b[10]=z,b[11]=J,b[12]=G,b[13]=ce,b[14]=Q,b[15]=pe}function y(b,S){w(b,S,S)}function E(b,S){const D=n();for(let u=0;u<16;u++)D[u]=S[u];for(let u=253;u>=0;u--)y(D,D),u!==2&&u!==4&&w(D,D,S);for(let u=0;u<16;u++)b[u]=D[u]}function T(b,S){const D=new Uint8Array(32),u=new Float64Array(80),_=n(),H=n(),B=n(),q=n(),X=n(),te=n();for(let Y=0;Y<31;Y++)D[Y]=b[Y];D[31]=b[31]&127|64,D[0]&=248,l(u,S);for(let Y=0;Y<16;Y++)H[Y]=u[Y];_[0]=q[0]=1;for(let Y=254;Y>=0;--Y){const W=D[Y>>>3]>>>(Y&7)&1;a(_,H,W),a(B,q,W),p(X,_,B),m(_,_,B),p(B,H,q),m(H,H,q),y(q,X),y(te,_),w(_,B,_),w(B,H,X),p(X,_,B),m(_,_,B),y(H,_),m(B,q,te),w(_,B,s),p(_,_,q),w(B,B,_),w(_,q,te),w(q,H,u),y(H,X),a(_,H,W),a(B,q,W)}for(let Y=0;Y<16;Y++)u[Y+16]=_[Y],u[Y+32]=B[Y],u[Y+48]=H[Y],u[Y+64]=q[Y];const x=u.subarray(32),$=u.subarray(16);E(x,x),w($,$,x);const K=new Uint8Array(32);return c(K,$),K}t.scalarMult=T;function R(b){return T(b,i)}t.scalarMultBase=R;function L(b){if(b.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const S=new Uint8Array(b);return{publicKey:R(S),secretKey:S}}t.generateKeyPairFromSeed=L;function C(b){const S=(0,e.randomBytes)(32,b),D=L(S);return(0,r.wipe)(S),D}t.generateKeyPair=C;function O(b,S,D=!1){if(b.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(S.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const u=T(b,S);if(D){let _=0;for(let H=0;H<u.length;H++)_|=u[H];if(_===0)throw new Error("X25519: invalid shared key")}return u}t.sharedKey=O})(_o);function yl(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Eo(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=yl(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function w1(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function m(E){if(E instanceof Uint8Array||(ArrayBuffer.isView(E)?E=new Uint8Array(E.buffer,E.byteOffset,E.byteLength):Array.isArray(E)&&(E=Uint8Array.from(E))),!(E instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(E.length===0)return"";for(var T=0,R=0,L=0,C=E.length;L!==C&&E[L]===0;)L++,T++;for(var O=(C-L)*p+1>>>0,b=new Uint8Array(O);L!==C;){for(var S=E[L],D=0,u=O-1;(S!==0||D<R)&&u!==-1;u--,D++)S+=256*b[u]>>>0,b[u]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");R=D,L++}for(var _=O-R;_!==O&&b[_]===0;)_++;for(var H=c.repeat(T);_<O;++_)H+=t.charAt(b[_]);return H}function w(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return new Uint8Array;var T=0;if(E[T]!==" "){for(var R=0,L=0;E[T]===c;)R++,T++;for(var C=(E.length-T)*l+1>>>0,O=new Uint8Array(C);E[T];){var b=r[E.charCodeAt(T)];if(b===255)return;for(var S=0,D=C-1;(b!==0||S<L)&&D!==-1;D--,S++)b+=a*O[D]>>>0,O[D]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");L=S,T++}if(E[T]!==" "){for(var u=C-L;u!==C&&O[u]===0;)u++;for(var _=new Uint8Array(R+(C-u)),H=R;u!==C;)_[H++]=O[u++];return _}}}function y(E){var T=w(E);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:m,decodeUnsafe:w,decode:y}}var y1=w1,b1=y1;const bl=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},v1=t=>new TextEncoder().encode(t),_1=t=>new TextDecoder().decode(t);class E1{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class x1{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return vl(this,e)}}class C1{constructor(e){this.decoders=e}or(e){return vl(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const vl=(t,e)=>new C1({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class I1{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new E1(e,r,n),this.decoder=new x1(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const is=({name:t,prefix:e,encode:r,decode:n})=>new I1(t,e,r,n),qn=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=b1(r,e);return is({prefix:t,name:e,encode:n,decode:s=>bl(i(s))})},S1=(t,e,r,n)=>{const i={};for(let p=0;p<e.length;++p)i[e[p]]=p;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let p=0;p<s;++p){const m=i[t[p]];if(m===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|m,a+=r,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},D1=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},Ct=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>is({prefix:e,name:t,encode(i){return D1(i,n,r)},decode(i){return S1(i,n,r,t)}}),O1=is({prefix:"\0",name:"identity",encode:t=>_1(t),decode:t=>v1(t)});var $1=Object.freeze({__proto__:null,identity:O1});const A1=Ct({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var P1=Object.freeze({__proto__:null,base2:A1});const T1=Ct({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var R1=Object.freeze({__proto__:null,base8:T1});const N1=qn({prefix:"9",name:"base10",alphabet:"0123456789"});var M1=Object.freeze({__proto__:null,base10:N1});const L1=Ct({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),U1=Ct({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var j1=Object.freeze({__proto__:null,base16:L1,base16upper:U1});const F1=Ct({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),B1=Ct({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),k1=Ct({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),H1=Ct({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),z1=Ct({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),W1=Ct({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),q1=Ct({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),V1=Ct({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),K1=Ct({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var G1=Object.freeze({__proto__:null,base32:F1,base32upper:B1,base32pad:k1,base32padupper:H1,base32hex:z1,base32hexupper:W1,base32hexpad:q1,base32hexpadupper:V1,base32z:K1});const Z1=qn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Y1=qn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var J1=Object.freeze({__proto__:null,base36:Z1,base36upper:Y1});const X1=qn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Q1=qn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var ep=Object.freeze({__proto__:null,base58btc:X1,base58flickr:Q1});const tp=Ct({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),rp=Ct({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),np=Ct({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ip=Ct({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var sp=Object.freeze({__proto__:null,base64:tp,base64pad:rp,base64url:np,base64urlpad:ip});const _l=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),op=_l.reduce((t,e,r)=>(t[r]=e,t),[]),ap=_l.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function cp(t){return t.reduce((e,r)=>(e+=op[r],e),"")}function lp(t){const e=[];for(const r of t){const n=ap[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const hp=is({prefix:"\u{1F680}",name:"base256emoji",encode:cp,decode:lp});var up=Object.freeze({__proto__:null,base256emoji:hp}),dp=xl,El=128,fp=127,pp=~fp,gp=Math.pow(2,31);function xl(t,e,r){e=e||[],r=r||0;for(var n=r;t>=gp;)e[r++]=t&255|El,t/=128;for(;t&pp;)e[r++]=t&255|El,t>>>=7;return e[r]=t|0,xl.bytes=r-n+1,e}var mp=xo,wp=128,Cl=127;function xo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw xo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&Cl)<<i:(o&Cl)*Math.pow(2,i),i+=7}while(o>=wp);return xo.bytes=s-n,r}var yp=Math.pow(2,7),bp=Math.pow(2,14),vp=Math.pow(2,21),_p=Math.pow(2,28),Ep=Math.pow(2,35),xp=Math.pow(2,42),Cp=Math.pow(2,49),Ip=Math.pow(2,56),Sp=Math.pow(2,63),Dp=function(t){return t<yp?1:t<bp?2:t<vp?3:t<_p?4:t<Ep?5:t<xp?6:t<Cp?7:t<Ip?8:t<Sp?9:10},Op={encode:dp,decode:mp,encodingLength:Dp},Il=Op;const Sl=(t,e,r=0)=>(Il.encode(t,e,r),e),Dl=t=>Il.encodingLength(t),Co=(t,e)=>{const r=e.byteLength,n=Dl(t),i=n+Dl(r),s=new Uint8Array(i+r);return Sl(t,s,0),Sl(r,s,n),s.set(e,i),new $p(t,r,e,s)};class $p{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Ol=({name:t,code:e,encode:r})=>new Ap(t,e,r);class Ap{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Co(this.code,r):r.then(n=>Co(this.code,n))}else throw Error("Unknown type, must be binary type")}}const $l=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Pp=Ol({name:"sha2-256",code:18,encode:$l("SHA-256")}),Tp=Ol({name:"sha2-512",code:19,encode:$l("SHA-512")});var Rp=Object.freeze({__proto__:null,sha256:Pp,sha512:Tp});const Al=0,Np="identity",Pl=bl;var Mp=Object.freeze({__proto__:null,identity:{code:Al,name:Np,encode:Pl,digest:t=>Co(Al,Pl(t))}});new TextEncoder,new TextDecoder;const Tl={...$1,...P1,...R1,...M1,...j1,...G1,...J1,...ep,...sp,...up};({...Rp,...Mp});function Rl(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Nl=Rl("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Io=Rl("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=yl(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Ml={utf8:Nl,"utf-8":Nl,hex:Tl.base16,latin1:Io,ascii:Io,binary:Io,...Tl};function Ut(t,e="utf8"){const r=Ml[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function At(t,e="utf8"){const r=Ml[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var Ll=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))},Lp=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),Up=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),jp=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),Fp=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Bp=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),kp=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Hp=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Ul=3,zp=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",kp]],jl=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Wp(t){return t?Fl(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Bp:typeof navigator<"u"?Fl(navigator.userAgent):Kp()}function qp(t){return t!==""&&zp.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function Fl(t){var e=qp(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new Fp;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Ul&&(i=Ll(Ll([],i,!0),Gp(Ul-i.length),!0)):i=[];var s=i.join("."),o=Vp(t),a=Hp.exec(t);return a&&a[1]?new jp(r,s,o,a[1]):new Lp(r,s,o)}function Vp(t){for(var e=0,r=jl.length;e<r;e++){var n=jl[e],i=n[0],s=n[1],o=s.exec(t);if(o)return i}return null}function Kp(){var t=typeof process<"u"&&process.version;return t?new Up(process.version.slice(1)):null}function Gp(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var fe={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */var Co=function(t,e){return Co=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Co(t,e)};function Tp(t,e){Co(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Io=function(){return Io=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Io.apply(this,arguments)};function Np(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Rp(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Mp(t,e){return function(r,n){e(r,n,t)}}function Lp(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Up(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(m){o(m)}}function c(p){try{l(n.throw(p))}catch(m){o(m)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function jp(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Fp(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Bp(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function So(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 Fl(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function kp(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Fl(arguments[e]));return t}function Hp(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Vn(t){return this instanceof Vn?(this.v=t,this):new Vn(t)}function zp(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(w){n[w]&&(i[w]=function(y){return new Promise(function(E,T){s.push([w,y,E,T])>1||a(w,y)})})}function a(w,y){try{c(n[w](y))}catch(E){m(s[0][3],E)}}function c(w){w.value instanceof Vn?Promise.resolve(w.value.v).then(l,p):m(s[0][2],w)}function l(w){a("next",w)}function p(w){a("throw",w)}function m(w,y){w(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Wp(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(o){return(r=!r)?{value:Vn(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function qp(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 So=="function"?So(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(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Vp(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Kp(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Gp(t){return t&&t.__esModule?t:{default:t}}function Zp(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Yp(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var Jp=Object.freeze({__proto__:null,__extends:Tp,get __assign(){return Io},__rest:Np,__decorate:Rp,__param:Mp,__metadata:Lp,__awaiter:Up,__generator:jp,__createBinding:Fp,__exportStar:Bp,__values:So,__read:Fl,__spread:kp,__spreadArrays:Hp,__await:Vn,__asyncGenerator:zp,__asyncDelegator:Wp,__asyncValues:qp,__makeTemplateObject:Vp,__importStar:Kp,__importDefault:Gp,__classPrivateFieldGet:Zp,__classPrivateFieldSet:Yp}),ns=Tr(Jp),Do={},Kn={},Bl;function Xp(){if(Bl)return Kn;Bl=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Kn.delay=t,Kn}var Nr={},Oo={},Rr={},kl;function Qp(){return kl||(kl=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.ONE_THOUSAND=Rr.ONE_HUNDRED=void 0,Rr.ONE_HUNDRED=100,Rr.ONE_THOUSAND=1e3),Rr}var $o={},Hl;function eg(){return Hl||(Hl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}($o)),$o}var zl;function Wl(){return zl||(zl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ns;e.__exportStar(Qp(),t),e.__exportStar(eg(),t)}(Oo)),Oo}var ql;function tg(){if(ql)return Nr;ql=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.fromMiliseconds=Nr.toMiliseconds=void 0;const t=Wl();function e(n){return n*t.ONE_THOUSAND}Nr.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Nr.fromMiliseconds=r,Nr}var Vl;function rg(){return Vl||(Vl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ns;e.__exportStar(Xp(),t),e.__exportStar(tg(),t)}(Do)),Do}var fn={},Kl;function ng(){if(Kl)return fn;Kl=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return fn.Watch=t,fn.default=t,fn}var Ao={},Gn={},Gl;function ig(){if(Gl)return Gn;Gl=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.IWatch=void 0;class t{}return Gn.IWatch=t,Gn}var Zl;function sg(){return Zl||(Zl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ns.__exportStar(ig(),t)}(Ao)),Ao}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ns;e.__exportStar(rg(),t),e.__exportStar(ng(),t),e.__exportStar(sg(),t),e.__exportStar(Wl(),t)})(fe);var ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.getLocalStorage=ze.getLocalStorageOrThrow=ze.getCrypto=ze.getCryptoOrThrow=Jl=ze.getLocation=ze.getLocationOrThrow=Po=ze.getNavigator=ze.getNavigatorOrThrow=Yl=ze.getDocument=ze.getDocumentOrThrow=ze.getFromWindowOrThrow=ze.getFromWindow=void 0;function Mr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}ze.getFromWindow=Mr;function pn(t){const e=Mr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}ze.getFromWindowOrThrow=pn;function og(){return pn("document")}ze.getDocumentOrThrow=og;function ag(){return Mr("document")}var Yl=ze.getDocument=ag;function cg(){return pn("navigator")}ze.getNavigatorOrThrow=cg;function lg(){return Mr("navigator")}var Po=ze.getNavigator=lg;function hg(){return pn("location")}ze.getLocationOrThrow=hg;function ug(){return Mr("location")}var Jl=ze.getLocation=ug;function dg(){return pn("crypto")}ze.getCryptoOrThrow=dg;function fg(){return Mr("crypto")}ze.getCrypto=fg;function pg(){return pn("localStorage")}ze.getLocalStorageOrThrow=pg;function gg(){return Mr("localStorage")}ze.getLocalStorage=gg;var To={};Object.defineProperty(To,"__esModule",{value:!0});var Xl=To.getWindowMetadata=void 0;const Ql=ze;function mg(){let t,e;try{t=Ql.getDocumentOrThrow(),e=Ql.getLocationOrThrow()}catch{return null}function r(){const m=t.getElementsByTagName("link"),w=[];for(let y=0;y<m.length;y++){const E=m[y],T=E.getAttribute("rel");if(T&&T.toLowerCase().indexOf("icon")>-1){const N=E.getAttribute("href");if(N)if(N.toLowerCase().indexOf("https:")===-1&&N.toLowerCase().indexOf("http:")===-1&&N.indexOf("//")!==0){let L=e.protocol+"//"+e.host;if(N.indexOf("/")===0)L+=N;else{const C=e.pathname.split("/");C.pop();const D=C.join("/");L+=D+"/"+N}w.push(L)}else if(N.indexOf("//")===0){const L=e.protocol+N;w.push(L)}else w.push(N)}}return w}function n(...m){const w=t.getElementsByTagName("meta");for(let y=0;y<w.length;y++){const E=w[y],T=["itemprop","property","name"].map(N=>E.getAttribute(N)).filter(N=>N?m.includes(N):!1);if(T.length&&T){const N=E.getAttribute("content");if(N)return N}}return""}function i(){let m=n("name","og:site_name","og:title","twitter:title");return m||(m=t.title),m}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}Xl=To.getWindowMetadata=mg;var Zn={},wg=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),eh="%[a-f0-9]{2}",th=new RegExp("("+eh+")|([^%]+?)","gi"),rh=new RegExp("("+eh+")+","gi");function No(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],No(r),No(n))}function yg(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(th)||[],r=1;r<e.length;r++)t=No(e,r).join(""),e=t.match(th)||[];return t}}function bg(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=rh.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=yg(r[0]);n!==r[0]&&(e[r[0]]=n)}r=rh.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),s=0;s<i.length;s++){var o=i[s];t=t.replace(new RegExp(o,"g"),e[o])}return t}var vg=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return bg(t)}},_g=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},Eg=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;s<n.length;s++){var o=n[s],a=t[o];(i?e.indexOf(o)!==-1:e(o,a,t))&&(r[o]=a)}return r};(function(t){const e=wg,r=vg,n=_g,i=Eg,s=C=>C==null,o=Symbol("encodeFragmentIdentifier");function a(C){switch(C.arrayFormat){case"index":return D=>(b,S)=>{const O=b.length;return S===void 0||C.skipNull&&S===null||C.skipEmptyString&&S===""?b:S===null?[...b,[p(D,C),"[",O,"]"].join("")]:[...b,[p(D,C),"[",p(O,C),"]=",p(S,C)].join("")]};case"bracket":return D=>(b,S)=>S===void 0||C.skipNull&&S===null||C.skipEmptyString&&S===""?b:S===null?[...b,[p(D,C),"[]"].join("")]:[...b,[p(D,C),"[]=",p(S,C)].join("")];case"colon-list-separator":return D=>(b,S)=>S===void 0||C.skipNull&&S===null||C.skipEmptyString&&S===""?b:S===null?[...b,[p(D,C),":list="].join("")]:[...b,[p(D,C),":list=",p(S,C)].join("")];case"comma":case"separator":case"bracket-separator":{const D=C.arrayFormat==="bracket-separator"?"[]=":"=";return b=>(S,O)=>O===void 0||C.skipNull&&O===null||C.skipEmptyString&&O===""?S:(O=O===null?"":O,S.length===0?[[p(b,C),D,p(O,C)].join("")]:[[S,p(O,C)].join(C.arrayFormatSeparator)])}default:return D=>(b,S)=>S===void 0||C.skipNull&&S===null||C.skipEmptyString&&S===""?b:S===null?[...b,p(D,C)]:[...b,[p(D,C),"=",p(S,C)].join("")]}}function c(C){let D;switch(C.arrayFormat){case"index":return(b,S,O)=>{if(D=/\[(\d*)\]$/.exec(b),b=b.replace(/\[\d*\]$/,""),!D){O[b]=S;return}O[b]===void 0&&(O[b]={}),O[b][D[1]]=S};case"bracket":return(b,S,O)=>{if(D=/(\[\])$/.exec(b),b=b.replace(/\[\]$/,""),!D){O[b]=S;return}if(O[b]===void 0){O[b]=[S];return}O[b]=[].concat(O[b],S)};case"colon-list-separator":return(b,S,O)=>{if(D=/(:list)$/.exec(b),b=b.replace(/:list$/,""),!D){O[b]=S;return}if(O[b]===void 0){O[b]=[S];return}O[b]=[].concat(O[b],S)};case"comma":case"separator":return(b,S,O)=>{const u=typeof S=="string"&&S.includes(C.arrayFormatSeparator),_=typeof S=="string"&&!u&&m(S,C).includes(C.arrayFormatSeparator);S=_?m(S,C):S;const H=u||_?S.split(C.arrayFormatSeparator).map(B=>m(B,C)):S===null?S:m(S,C);O[b]=H};case"bracket-separator":return(b,S,O)=>{const u=/(\[\])$/.test(b);if(b=b.replace(/\[\]$/,""),!u){O[b]=S&&m(S,C);return}const _=S===null?[]:S.split(C.arrayFormatSeparator).map(H=>m(H,C));if(O[b]===void 0){O[b]=_;return}O[b]=[].concat(O[b],_)};default:return(b,S,O)=>{if(O[b]===void 0){O[b]=S;return}O[b]=[].concat(O[b],S)}}}function l(C){if(typeof C!="string"||C.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function p(C,D){return D.encode?D.strict?e(C):encodeURIComponent(C):C}function m(C,D){return D.decode?r(C):C}function w(C){return Array.isArray(C)?C.sort():typeof C=="object"?w(Object.keys(C)).sort((D,b)=>Number(D)-Number(b)).map(D=>C[D]):C}function y(C){const D=C.indexOf("#");return D!==-1&&(C=C.slice(0,D)),C}function E(C){let D="";const b=C.indexOf("#");return b!==-1&&(D=C.slice(b)),D}function T(C){C=y(C);const D=C.indexOf("?");return D===-1?"":C.slice(D+1)}function N(C,D){return D.parseNumbers&&!Number.isNaN(Number(C))&&typeof C=="string"&&C.trim()!==""?C=Number(C):D.parseBooleans&&C!==null&&(C.toLowerCase()==="true"||C.toLowerCase()==="false")&&(C=C.toLowerCase()==="true"),C}function L(C,D){D=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},D),l(D.arrayFormatSeparator);const b=c(D),S=Object.create(null);if(typeof C!="string"||(C=C.trim().replace(/^[?#&]/,""),!C))return S;for(const O of C.split("&")){if(O==="")continue;let[u,_]=n(D.decode?O.replace(/\+/g," "):O,"=");_=_===void 0?null:["comma","separator","bracket-separator"].includes(D.arrayFormat)?_:m(_,D),b(m(u,D),_,S)}for(const O of Object.keys(S)){const u=S[O];if(typeof u=="object"&&u!==null)for(const _ of Object.keys(u))u[_]=N(u[_],D);else S[O]=N(u,D)}return D.sort===!1?S:(D.sort===!0?Object.keys(S).sort():Object.keys(S).sort(D.sort)).reduce((O,u)=>{const _=S[u];return Boolean(_)&&typeof _=="object"&&!Array.isArray(_)?O[u]=w(_):O[u]=_,O},Object.create(null))}t.extract=T,t.parse=L,t.stringify=(C,D)=>{if(!C)return"";D=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},D),l(D.arrayFormatSeparator);const b=_=>D.skipNull&&s(C[_])||D.skipEmptyString&&C[_]==="",S=a(D),O={};for(const _ of Object.keys(C))b(_)||(O[_]=C[_]);const u=Object.keys(O);return D.sort!==!1&&u.sort(D.sort),u.map(_=>{const H=C[_];return H===void 0?"":H===null?p(_,D):Array.isArray(H)?H.length===0&&D.arrayFormat==="bracket-separator"?p(_,D)+"[]":H.reduce(S(_),[]).join("&"):p(_,D)+"="+p(H,D)}).filter(_=>_.length>0).join("&")},t.parseUrl=(C,D)=>{D=Object.assign({decode:!0},D);const[b,S]=n(C,"#");return Object.assign({url:b.split("?")[0]||"",query:L(T(C),D)},D&&D.parseFragmentIdentifier&&S?{fragmentIdentifier:m(S,D)}:{})},t.stringifyUrl=(C,D)=>{D=Object.assign({encode:!0,strict:!0,[o]:!0},D);const b=y(C.url).split("?")[0]||"",S=t.extract(C.url),O=t.parse(S,{sort:!1}),u=Object.assign(O,C.query);let _=t.stringify(u,D);_&&(_=`?${_}`);let H=E(C.url);return C.fragmentIdentifier&&(H=`#${D[o]?p(C.fragmentIdentifier,D):C.fragmentIdentifier}`),`${b}${_}${H}`},t.pick=(C,D,b)=>{b=Object.assign({parseFragmentIdentifier:!0,[o]:!1},b);const{url:S,query:O,fragmentIdentifier:u}=t.parseUrl(C,b);return t.stringifyUrl({url:S,query:i(O,D),fragmentIdentifier:u},b)},t.exclude=(C,D,b)=>{const S=Array.isArray(D)?O=>!D.includes(O):(O,u)=>!D(O,u);return t.pick(C,S,b)}})(Zn);const xg={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function Cg(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function nh(t,e){return t.includes(":")?[t]:e.chains||[]}const ih="base10",Ut="base16",Ro="base64pad",Mo="utf8",sh=0,Lr=1,Ig=0,oh=1,Lo=12,Uo=32;function Sg(){const t=bo.generateKeyPair();return{privateKey:Lt(t.secretKey,Ut),publicKey:Lt(t.publicKey,Ut)}}function jo(){const t=dn.randomBytes(Uo);return Lt(t,Ut)}function Dg(t,e){const r=bo.sharedKey(Mt(t,Ut),Mt(e,Ut)),n=new zf(ts.SHA256,r).expand(Uo);return Lt(n,Ut)}function Og(t){const e=ts.hash(Mt(t,Ut));return Lt(e,Ut)}function is(t){const e=ts.hash(Mt(t,Mo));return Lt(e,Ut)}function $g(t){return Mt(`${t}`,ih)}function Yn(t){return Number(Lt(t,ih))}function Ag(t){const e=$g(typeof t.type<"u"?t.type:sh);if(Yn(e)===Lr&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Mt(t.senderPublicKey,Ut):void 0,n=typeof t.iv<"u"?Mt(t.iv,Ut):dn.randomBytes(Lo),i=new uo.ChaCha20Poly1305(Mt(t.symKey,Ut)).seal(n,Mt(t.message,Mo));return Tg({type:e,sealed:i,iv:n,senderPublicKey:r})}function Pg(t){const e=new uo.ChaCha20Poly1305(Mt(t.symKey,Ut)),{sealed:r,iv:n}=Fo(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Lt(i,Mo)}function Tg(t){if(Yn(t.type)===Lr){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Lt(vo([t.type,t.senderPublicKey,t.iv,t.sealed]),Ro)}return Lt(vo([t.type,t.iv,t.sealed]),Ro)}function Fo(t){const e=Mt(t,Ro),r=e.slice(Ig,oh),n=oh;if(Yn(r)===Lr){const a=n+Uo,c=a+Lo,l=e.slice(n,a),p=e.slice(a,c),m=e.slice(c);return{type:r,sealed:m,iv:p,senderPublicKey:l}}const i=n+Lo,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function Ng(t,e){const r=Fo(t);return ah({type:Yn(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Lt(r.senderPublicKey,Ut):void 0,receiverPublicKey:e?.receiverPublicKey})}function ah(t){const e=t?.type||sh;if(e===Lr){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function ch(t){return t.type===Lr&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var Rg=Object.defineProperty,lh=Object.getOwnPropertySymbols,Mg=Object.prototype.hasOwnProperty,Lg=Object.prototype.propertyIsEnumerable,hh=(t,e,r)=>e in t?Rg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,uh=(t,e)=>{for(var r in e||(e={}))Mg.call(e,r)&&hh(t,r,e[r]);if(lh)for(var r of lh(e))Lg.call(e,r)&&hh(t,r,e[r]);return t};const Ug="ReactNative",Jn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},jg="js";function dh(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Fg(){return!Yl()&&!!Po()&&navigator.product===Ug}function Bg(){return!dh()&&!!Po()}function kg(){return Fg()?Jn.reactNative:dh()?Jn.node:Bg()?Jn.browser:Jn.unknown}function Hg(t,e){let r=Zn.parse(t);return r=uh(uh({},r),e),t=Zn.stringify(r),t}function zg(){return Xl()||{name:"",description:"",url:"",icons:[""]}}function Wg(){const t=Dp();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function qg(){var t;const e=kg();return e===Jn.browser?[e,((t=Jl())==null?void 0:t.host)||"unknown"].join(":"):e}function Vg(t,e,r){const n=Wg(),i=qg();return[[t,e].join("-"),[jg,r].join("-"),n,i].join("/")}function Kg({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o}){const a=r.split("?"),c=Vg(t,e,n),l={auth:i,ua:c,projectId:s,useOnCloseEvent:o||void 0},p=Hg(a[1]||"",l);return a[0]+"?"+p}function Ur(t,e){return t.filter(r=>e.includes(r)).length===t.length}function fh(t){return Object.fromEntries(t.entries())}function ph(t){return new Map(Object.entries(t))}function jr(t=fe.FIVE_MINUTES,e){const r=fe.toMiliseconds(t||fe.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function ss(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function gh(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function Gg(t){return gh("topic",t)}function Zg(t){return gh("id",t)}function mh(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function rr(t,e){return fe.fromMiliseconds((e||Date.now())+fe.toMiliseconds(t))}function vr(t){return Date.now()>=fe.toMiliseconds(t)}function et(t,e){return`${t}${e?`:${e}`:""}`}const Yg="irn";function Bo(t){return t?.relay||{protocol:Yg}}function os(t){const e=xg[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Jg=Object.defineProperty,wh=Object.getOwnPropertySymbols,Xg=Object.prototype.hasOwnProperty,Qg=Object.prototype.propertyIsEnumerable,yh=(t,e,r)=>e in t?Jg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,e3=(t,e)=>{for(var r in e||(e={}))Xg.call(e,r)&&yh(t,r,e[r]);if(wh)for(var r of wh(e))Qg.call(e,r)&&yh(t,r,e[r]);return t};function t3(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function r3(t){const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=Zn.parse(s);return{protocol:n,topic:i[0],version:parseInt(i[1],10),symKey:o.symKey,relay:t3(o)}}function n3(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function i3(t){return`${t.protocol}:${t.topic}@${t.version}?`+Zn.stringify(e3({symKey:t.symKey},n3(t.relay)))}function gn(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function s3(t){const e=[];return Object.values(t).forEach(r=>{e.push(...gn(r.accounts))}),e}function o3(t,e){const r=[];return Object.values(t).forEach(n=>{gn(n.accounts).includes(e)&&r.push(...n.methods)}),r}function a3(t,e){const r=[];return Object.values(t).forEach(n=>{gn(n.accounts).includes(e)&&r.push(...n.events)}),r}function c3(t,e){const r=as(t,e);if(r)throw new Error(r.message);const n={};for(const[i,s]of Object.entries(t))n[i]={methods:s.methods,events:s.events,chains:s.accounts.map(o=>`${o.split(":")[0]}:${o.split(":")[1]}`)};return n}const l3={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},h3={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ie(t,e){const{message:r,code:n}=h3[t];return{message:e?`${r} ${e}`:r,code:n}}function tt(t,e){const{message:r,code:n}=l3[t];return{message:e?`${r} ${e}`:r,code:n}}function ur(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function mn(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function At(t){return typeof t>"u"}function ft(t,e){return e&&At(t)?!0:typeof t=="string"&&Boolean(t.trim().length)}function ko(t,e){return e&&At(t)?!0:typeof t=="number"&&!isNaN(t)}function u3(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return Ur(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],p=gn(a),m=r[o];(!Ur(nh(o,m),p)||!Ur(m.methods,c)||!Ur(m.events,l))&&(s=!1)}),s):!1}function Ho(t){return ft(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function d3(t){if(ft(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Ho(r)}}return!1}function f3(t){if(ft(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function p3(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function g3(t){return t?.topic}function m3(t,e){let r=null;return ft(t?.publicKey,!1)||(r=ie("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function bh(t){let e=!0;return ur(t)?t.length&&(e=t.every(r=>ft(r,!1))):e=!1,e}function w3(t,e,r){let n=null;return ur(e)?e.forEach(i=>{n||(!Ho(i)||!i.includes(t))&&(n=tt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=tt("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function y3(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;const s=w3(n,nh(n,i),`${e} requiredNamespace`);s&&(r=s)}),r}function b3(t,e){let r=null;return ur(t)?t.forEach(n=>{r||d3(n)||(r=tt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=tt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function v3(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=b3(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function _3(t,e){let r=null;return bh(t?.methods)?bh(t?.events)||(r=tt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=tt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function vh(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=_3(n,`${e}, namespace`);i&&(r=i)}),r}function E3(t,e,r){let n=null;if(t&&mn(t)){const i=vh(t,e);i&&(n=i);const s=y3(t,e);s&&(n=s)}else n=ie("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function as(t,e){let r=null;if(t&&mn(t)){const n=vh(t,e);n&&(r=n);const i=v3(t,e);i&&(r=i)}else r=ie("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function _h(t){return ft(t.protocol,!0)}function x3(t,e){let r=!1;return e&&!t?r=!0:t&&ur(t)&&t.length&&t.forEach(n=>{r=_h(n)}),r}function C3(t){return typeof t=="number"}function jt(t){return typeof t<"u"&&typeof t!==null}function I3(t){return!(!t||typeof t!="object"||!t.code||!ko(t.code,!1)||!t.message||!ft(t.message,!1))}function S3(t){return!(At(t)||!ft(t.method,!1))}function D3(t){return!(At(t)||At(t.result)&&At(t.error)||!ko(t.id,!1)||!ft(t.jsonrpc,!1))}function O3(t){return!(At(t)||!ft(t.name,!1))}function Eh(t,e){return!(!Ho(e)||!s3(t).includes(e))}function $3(t,e,r){return ft(r,!1)?o3(t,e).includes(r):!1}function A3(t,e,r){return ft(r,!1)?a3(t,e).includes(r):!1}function xh(t,e,r){let n=null;const i=P3(t),s=T3(e),o=Object.keys(i),a=Object.keys(s),c=Ch(Object.keys(t)),l=Ch(Object.keys(e)),p=c.filter(m=>!l.includes(m));return p.length&&(n=ie("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
14
|
+
***************************************************************************** */var So=function(t,e){return So=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},So(t,e)};function Zp(t,e){So(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Do=function(){return Do=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Do.apply(this,arguments)};function Yp(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Jp(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Xp(t,e){return function(r,n){e(r,n,t)}}function Qp(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function eg(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(m){o(m)}}function c(p){try{l(n.throw(p))}catch(m){o(m)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function tg(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function rg(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function ng(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Oo(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 Bl(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function ig(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Bl(arguments[e]));return t}function sg(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Vn(t){return this instanceof Vn?(this.v=t,this):new Vn(t)}function og(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(w){n[w]&&(i[w]=function(y){return new Promise(function(E,T){s.push([w,y,E,T])>1||a(w,y)})})}function a(w,y){try{c(n[w](y))}catch(E){m(s[0][3],E)}}function c(w){w.value instanceof Vn?Promise.resolve(w.value.v).then(l,p):m(s[0][2],w)}function l(w){a("next",w)}function p(w){a("throw",w)}function m(w,y){w(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function ag(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(o){return(r=!r)?{value:Vn(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function cg(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 Oo=="function"?Oo(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(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function lg(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function hg(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function ug(t){return t&&t.__esModule?t:{default:t}}function dg(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function fg(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var pg=Object.freeze({__proto__:null,__extends:Zp,get __assign(){return Do},__rest:Yp,__decorate:Jp,__param:Xp,__metadata:Qp,__awaiter:eg,__generator:tg,__createBinding:rg,__exportStar:ng,__values:Oo,__read:Bl,__spread:ig,__spreadArrays:sg,__await:Vn,__asyncGenerator:og,__asyncDelegator:ag,__asyncValues:cg,__makeTemplateObject:lg,__importStar:hg,__importDefault:ug,__classPrivateFieldGet:dg,__classPrivateFieldSet:fg}),ss=Tr(pg),$o={},Kn={},kl;function gg(){if(kl)return Kn;kl=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Kn.delay=t,Kn}var Rr={},Ao={},Nr={},Hl;function mg(){return Hl||(Hl=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.ONE_THOUSAND=Nr.ONE_HUNDRED=void 0,Nr.ONE_HUNDRED=100,Nr.ONE_THOUSAND=1e3),Nr}var Po={},zl;function wg(){return zl||(zl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(Po)),Po}var Wl;function ql(){return Wl||(Wl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ss;e.__exportStar(mg(),t),e.__exportStar(wg(),t)}(Ao)),Ao}var Vl;function yg(){if(Vl)return Rr;Vl=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.fromMiliseconds=Rr.toMiliseconds=void 0;const t=ql();function e(n){return n*t.ONE_THOUSAND}Rr.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Rr.fromMiliseconds=r,Rr}var Kl;function bg(){return Kl||(Kl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ss;e.__exportStar(gg(),t),e.__exportStar(yg(),t)}($o)),$o}var un={},Gl;function vg(){if(Gl)return un;Gl=1,Object.defineProperty(un,"__esModule",{value:!0}),un.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return un.Watch=t,un.default=t,un}var To={},Gn={},Zl;function _g(){if(Zl)return Gn;Zl=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.IWatch=void 0;class t{}return Gn.IWatch=t,Gn}var Yl;function Eg(){return Yl||(Yl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ss.__exportStar(_g(),t)}(To)),To}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ss;e.__exportStar(bg(),t),e.__exportStar(vg(),t),e.__exportStar(Eg(),t),e.__exportStar(ql(),t)})(fe);var ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.getLocalStorage=ze.getLocalStorageOrThrow=ze.getCrypto=ze.getCryptoOrThrow=Xl=ze.getLocation=ze.getLocationOrThrow=Ro=ze.getNavigator=ze.getNavigatorOrThrow=Jl=ze.getDocument=ze.getDocumentOrThrow=ze.getFromWindowOrThrow=ze.getFromWindow=void 0;function Mr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}ze.getFromWindow=Mr;function dn(t){const e=Mr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}ze.getFromWindowOrThrow=dn;function xg(){return dn("document")}ze.getDocumentOrThrow=xg;function Cg(){return Mr("document")}var Jl=ze.getDocument=Cg;function Ig(){return dn("navigator")}ze.getNavigatorOrThrow=Ig;function Sg(){return Mr("navigator")}var Ro=ze.getNavigator=Sg;function Dg(){return dn("location")}ze.getLocationOrThrow=Dg;function Og(){return Mr("location")}var Xl=ze.getLocation=Og;function $g(){return dn("crypto")}ze.getCryptoOrThrow=$g;function Ag(){return Mr("crypto")}ze.getCrypto=Ag;function Pg(){return dn("localStorage")}ze.getLocalStorageOrThrow=Pg;function Tg(){return Mr("localStorage")}ze.getLocalStorage=Tg;var No={};Object.defineProperty(No,"__esModule",{value:!0});var Ql=No.getWindowMetadata=void 0;const eh=ze;function Rg(){let t,e;try{t=eh.getDocumentOrThrow(),e=eh.getLocationOrThrow()}catch{return null}function r(){const m=t.getElementsByTagName("link"),w=[];for(let y=0;y<m.length;y++){const E=m[y],T=E.getAttribute("rel");if(T&&T.toLowerCase().indexOf("icon")>-1){const R=E.getAttribute("href");if(R)if(R.toLowerCase().indexOf("https:")===-1&&R.toLowerCase().indexOf("http:")===-1&&R.indexOf("//")!==0){let L=e.protocol+"//"+e.host;if(R.indexOf("/")===0)L+=R;else{const C=e.pathname.split("/");C.pop();const O=C.join("/");L+=O+"/"+R}w.push(L)}else if(R.indexOf("//")===0){const L=e.protocol+R;w.push(L)}else w.push(R)}}return w}function n(...m){const w=t.getElementsByTagName("meta");for(let y=0;y<w.length;y++){const E=w[y],T=["itemprop","property","name"].map(R=>E.getAttribute(R)).filter(R=>R?m.includes(R):!1);if(T.length&&T){const R=E.getAttribute("content");if(R)return R}}return""}function i(){let m=n("name","og:site_name","og:title","twitter:title");return m||(m=t.title),m}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}Ql=No.getWindowMetadata=Rg;var Zn={},Ng=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),th="%[a-f0-9]{2}",rh=new RegExp("("+th+")|([^%]+?)","gi"),nh=new RegExp("("+th+")+","gi");function Mo(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],Mo(r),Mo(n))}function Mg(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(rh)||[],r=1;r<e.length;r++)t=Mo(e,r).join(""),e=t.match(rh)||[];return t}}function Lg(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=nh.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=Mg(r[0]);n!==r[0]&&(e[r[0]]=n)}r=nh.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),s=0;s<i.length;s++){var o=i[s];t=t.replace(new RegExp(o,"g"),e[o])}return t}var Ug=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return Lg(t)}},jg=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},Fg=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;s<n.length;s++){var o=n[s],a=t[o];(i?e.indexOf(o)!==-1:e(o,a,t))&&(r[o]=a)}return r};(function(t){const e=Ng,r=Ug,n=jg,i=Fg,s=C=>C==null,o=Symbol("encodeFragmentIdentifier");function a(C){switch(C.arrayFormat){case"index":return O=>(b,S)=>{const D=b.length;return S===void 0||C.skipNull&&S===null||C.skipEmptyString&&S===""?b:S===null?[...b,[p(O,C),"[",D,"]"].join("")]:[...b,[p(O,C),"[",p(D,C),"]=",p(S,C)].join("")]};case"bracket":return O=>(b,S)=>S===void 0||C.skipNull&&S===null||C.skipEmptyString&&S===""?b:S===null?[...b,[p(O,C),"[]"].join("")]:[...b,[p(O,C),"[]=",p(S,C)].join("")];case"colon-list-separator":return O=>(b,S)=>S===void 0||C.skipNull&&S===null||C.skipEmptyString&&S===""?b:S===null?[...b,[p(O,C),":list="].join("")]:[...b,[p(O,C),":list=",p(S,C)].join("")];case"comma":case"separator":case"bracket-separator":{const O=C.arrayFormat==="bracket-separator"?"[]=":"=";return b=>(S,D)=>D===void 0||C.skipNull&&D===null||C.skipEmptyString&&D===""?S:(D=D===null?"":D,S.length===0?[[p(b,C),O,p(D,C)].join("")]:[[S,p(D,C)].join(C.arrayFormatSeparator)])}default:return O=>(b,S)=>S===void 0||C.skipNull&&S===null||C.skipEmptyString&&S===""?b:S===null?[...b,p(O,C)]:[...b,[p(O,C),"=",p(S,C)].join("")]}}function c(C){let O;switch(C.arrayFormat){case"index":return(b,S,D)=>{if(O=/\[(\d*)\]$/.exec(b),b=b.replace(/\[\d*\]$/,""),!O){D[b]=S;return}D[b]===void 0&&(D[b]={}),D[b][O[1]]=S};case"bracket":return(b,S,D)=>{if(O=/(\[\])$/.exec(b),b=b.replace(/\[\]$/,""),!O){D[b]=S;return}if(D[b]===void 0){D[b]=[S];return}D[b]=[].concat(D[b],S)};case"colon-list-separator":return(b,S,D)=>{if(O=/(:list)$/.exec(b),b=b.replace(/:list$/,""),!O){D[b]=S;return}if(D[b]===void 0){D[b]=[S];return}D[b]=[].concat(D[b],S)};case"comma":case"separator":return(b,S,D)=>{const u=typeof S=="string"&&S.includes(C.arrayFormatSeparator),_=typeof S=="string"&&!u&&m(S,C).includes(C.arrayFormatSeparator);S=_?m(S,C):S;const H=u||_?S.split(C.arrayFormatSeparator).map(B=>m(B,C)):S===null?S:m(S,C);D[b]=H};case"bracket-separator":return(b,S,D)=>{const u=/(\[\])$/.test(b);if(b=b.replace(/\[\]$/,""),!u){D[b]=S&&m(S,C);return}const _=S===null?[]:S.split(C.arrayFormatSeparator).map(H=>m(H,C));if(D[b]===void 0){D[b]=_;return}D[b]=[].concat(D[b],_)};default:return(b,S,D)=>{if(D[b]===void 0){D[b]=S;return}D[b]=[].concat(D[b],S)}}}function l(C){if(typeof C!="string"||C.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function p(C,O){return O.encode?O.strict?e(C):encodeURIComponent(C):C}function m(C,O){return O.decode?r(C):C}function w(C){return Array.isArray(C)?C.sort():typeof C=="object"?w(Object.keys(C)).sort((O,b)=>Number(O)-Number(b)).map(O=>C[O]):C}function y(C){const O=C.indexOf("#");return O!==-1&&(C=C.slice(0,O)),C}function E(C){let O="";const b=C.indexOf("#");return b!==-1&&(O=C.slice(b)),O}function T(C){C=y(C);const O=C.indexOf("?");return O===-1?"":C.slice(O+1)}function R(C,O){return O.parseNumbers&&!Number.isNaN(Number(C))&&typeof C=="string"&&C.trim()!==""?C=Number(C):O.parseBooleans&&C!==null&&(C.toLowerCase()==="true"||C.toLowerCase()==="false")&&(C=C.toLowerCase()==="true"),C}function L(C,O){O=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},O),l(O.arrayFormatSeparator);const b=c(O),S=Object.create(null);if(typeof C!="string"||(C=C.trim().replace(/^[?#&]/,""),!C))return S;for(const D of C.split("&")){if(D==="")continue;let[u,_]=n(O.decode?D.replace(/\+/g," "):D,"=");_=_===void 0?null:["comma","separator","bracket-separator"].includes(O.arrayFormat)?_:m(_,O),b(m(u,O),_,S)}for(const D of Object.keys(S)){const u=S[D];if(typeof u=="object"&&u!==null)for(const _ of Object.keys(u))u[_]=R(u[_],O);else S[D]=R(u,O)}return O.sort===!1?S:(O.sort===!0?Object.keys(S).sort():Object.keys(S).sort(O.sort)).reduce((D,u)=>{const _=S[u];return Boolean(_)&&typeof _=="object"&&!Array.isArray(_)?D[u]=w(_):D[u]=_,D},Object.create(null))}t.extract=T,t.parse=L,t.stringify=(C,O)=>{if(!C)return"";O=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},O),l(O.arrayFormatSeparator);const b=_=>O.skipNull&&s(C[_])||O.skipEmptyString&&C[_]==="",S=a(O),D={};for(const _ of Object.keys(C))b(_)||(D[_]=C[_]);const u=Object.keys(D);return O.sort!==!1&&u.sort(O.sort),u.map(_=>{const H=C[_];return H===void 0?"":H===null?p(_,O):Array.isArray(H)?H.length===0&&O.arrayFormat==="bracket-separator"?p(_,O)+"[]":H.reduce(S(_),[]).join("&"):p(_,O)+"="+p(H,O)}).filter(_=>_.length>0).join("&")},t.parseUrl=(C,O)=>{O=Object.assign({decode:!0},O);const[b,S]=n(C,"#");return Object.assign({url:b.split("?")[0]||"",query:L(T(C),O)},O&&O.parseFragmentIdentifier&&S?{fragmentIdentifier:m(S,O)}:{})},t.stringifyUrl=(C,O)=>{O=Object.assign({encode:!0,strict:!0,[o]:!0},O);const b=y(C.url).split("?")[0]||"",S=t.extract(C.url),D=t.parse(S,{sort:!1}),u=Object.assign(D,C.query);let _=t.stringify(u,O);_&&(_=`?${_}`);let H=E(C.url);return C.fragmentIdentifier&&(H=`#${O[o]?p(C.fragmentIdentifier,O):C.fragmentIdentifier}`),`${b}${_}${H}`},t.pick=(C,O,b)=>{b=Object.assign({parseFragmentIdentifier:!0,[o]:!1},b);const{url:S,query:D,fragmentIdentifier:u}=t.parseUrl(C,b);return t.stringifyUrl({url:S,query:i(D,O),fragmentIdentifier:u},b)},t.exclude=(C,O,b)=>{const S=Array.isArray(O)?D=>!O.includes(D):(D,u)=>!O(D,u);return t.pick(C,S,b)}})(Zn);const Bg={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function kg(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function ih(t,e){return t.includes(":")?[t]:e.chains||[]}const sh="base10",Pt="base16",Lo="base64pad",Uo="utf8",oh=0,Lr=1,Hg=0,ah=1,jo=12,Fo=32;function zg(){const t=_o.generateKeyPair();return{privateKey:At(t.secretKey,Pt),publicKey:At(t.publicKey,Pt)}}function Bo(){const t=hn.randomBytes(Fo);return At(t,Pt)}function Wg(t,e){const r=_o.sharedKey(Ut(t,Pt),Ut(e,Pt)),n=new o1(ns.SHA256,r).expand(Fo);return At(n,Pt)}function qg(t){const e=ns.hash(Ut(t,Pt));return At(e,Pt)}function os(t){const e=ns.hash(Ut(t,Uo));return At(e,Pt)}function Vg(t){return Ut(`${t}`,sh)}function Yn(t){return Number(At(t,sh))}function Kg(t){const e=Vg(typeof t.type<"u"?t.type:oh);if(Yn(e)===Lr&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Ut(t.senderPublicKey,Pt):void 0,n=typeof t.iv<"u"?Ut(t.iv,Pt):hn.randomBytes(jo),i=new po.ChaCha20Poly1305(Ut(t.symKey,Pt)).seal(n,Ut(t.message,Uo));return Zg({type:e,sealed:i,iv:n,senderPublicKey:r})}function Gg(t){const e=new po.ChaCha20Poly1305(Ut(t.symKey,Pt)),{sealed:r,iv:n}=as(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return At(i,Uo)}function Zg(t){if(Yn(t.type)===Lr){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return At(Eo([t.type,t.senderPublicKey,t.iv,t.sealed]),Lo)}return At(Eo([t.type,t.iv,t.sealed]),Lo)}function as(t){const e=Ut(t,Lo),r=e.slice(Hg,ah),n=ah;if(Yn(r)===Lr){const a=n+Fo,c=a+jo,l=e.slice(n,a),p=e.slice(a,c),m=e.slice(c);return{type:r,sealed:m,iv:p,senderPublicKey:l}}const i=n+jo,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function Yg(t,e){const r=as(t);return ch({type:Yn(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?At(r.senderPublicKey,Pt):void 0,receiverPublicKey:e?.receiverPublicKey})}function ch(t){const e=t?.type||oh;if(e===Lr){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function lh(t){return t.type===Lr&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var Jg=Object.defineProperty,hh=Object.getOwnPropertySymbols,Xg=Object.prototype.hasOwnProperty,Qg=Object.prototype.propertyIsEnumerable,uh=(t,e,r)=>e in t?Jg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dh=(t,e)=>{for(var r in e||(e={}))Xg.call(e,r)&&uh(t,r,e[r]);if(hh)for(var r of hh(e))Qg.call(e,r)&&uh(t,r,e[r]);return t};const e3="ReactNative",Jn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},t3="js";function fh(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function r3(){return!Jl()&&!!Ro()&&navigator.product===e3}function n3(){return!fh()&&!!Ro()}function i3(){return r3()?Jn.reactNative:fh()?Jn.node:n3()?Jn.browser:Jn.unknown}function s3(t,e){let r=Zn.parse(t);return r=dh(dh({},r),e),t=Zn.stringify(r),t}function o3(){return Ql()||{name:"",description:"",url:"",icons:[""]}}function a3(){const t=Wp();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function c3(){var t;const e=i3();return e===Jn.browser?[e,((t=Xl())==null?void 0:t.host)||"unknown"].join(":"):e}function l3(t,e,r){const n=a3(),i=c3();return[[t,e].join("-"),[t3,r].join("-"),n,i].join("/")}function h3({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o}){const a=r.split("?"),c=l3(t,e,n),l={auth:i,ua:c,projectId:s,useOnCloseEvent:o||void 0},p=s3(a[1]||"",l);return a[0]+"?"+p}function Ur(t,e){return t.filter(r=>e.includes(r)).length===t.length}function ph(t){return Object.fromEntries(t.entries())}function gh(t){return new Map(Object.entries(t))}function fn(t=fe.FIVE_MINUTES,e){const r=fe.toMiliseconds(t||fe.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function cs(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function mh(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function u3(t){return mh("topic",t)}function d3(t){return mh("id",t)}function wh(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function tr(t,e){return fe.fromMiliseconds((e||Date.now())+fe.toMiliseconds(t))}function yr(t){return Date.now()>=fe.toMiliseconds(t)}function tt(t,e){return`${t}${e?`:${e}`:""}`}const f3="irn";function ko(t){return t?.relay||{protocol:f3}}function ls(t){const e=Bg[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var p3=Object.defineProperty,yh=Object.getOwnPropertySymbols,g3=Object.prototype.hasOwnProperty,m3=Object.prototype.propertyIsEnumerable,bh=(t,e,r)=>e in t?p3(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w3=(t,e)=>{for(var r in e||(e={}))g3.call(e,r)&&bh(t,r,e[r]);if(yh)for(var r of yh(e))m3.call(e,r)&&bh(t,r,e[r]);return t};function y3(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function b3(t){const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=Zn.parse(s);return{protocol:n,topic:i[0],version:parseInt(i[1],10),symKey:o.symKey,relay:y3(o)}}function v3(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function _3(t){return`${t.protocol}:${t.topic}@${t.version}?`+Zn.stringify(w3({symKey:t.symKey},v3(t.relay)))}function pn(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function E3(t){const e=[];return Object.values(t).forEach(r=>{e.push(...pn(r.accounts))}),e}function x3(t,e){const r=[];return Object.values(t).forEach(n=>{pn(n.accounts).includes(e)&&r.push(...n.methods)}),r}function C3(t,e){const r=[];return Object.values(t).forEach(n=>{pn(n.accounts).includes(e)&&r.push(...n.events)}),r}function I3(t,e){const r=hs(t,e);if(r)throw new Error(r.message);const n={};for(const[i,s]of Object.entries(t))n[i]={methods:s.methods,events:s.events,chains:s.accounts.map(o=>`${o.split(":")[0]}:${o.split(":")[1]}`)};return n}const S3={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},D3={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ie(t,e){const{message:r,code:n}=D3[t];return{message:e?`${r} ${e}`:r,code:n}}function et(t,e){const{message:r,code:n}=S3[t];return{message:e?`${r} ${e}`:r,code:n}}function hr(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function gn(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Tt(t){return typeof t>"u"}function pt(t,e){return e&&Tt(t)?!0:typeof t=="string"&&Boolean(t.trim().length)}function Ho(t,e){return e&&Tt(t)?!0:typeof t=="number"&&!isNaN(t)}function O3(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return Ur(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],p=pn(a),m=r[o];(!Ur(ih(o,m),p)||!Ur(m.methods,c)||!Ur(m.events,l))&&(s=!1)}),s):!1}function zo(t){return pt(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function $3(t){if(pt(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&zo(r)}}return!1}function A3(t){if(pt(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function P3(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function T3(t){return t?.topic}function R3(t,e){let r=null;return pt(t?.publicKey,!1)||(r=ie("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function vh(t){let e=!0;return hr(t)?t.length&&(e=t.every(r=>pt(r,!1))):e=!1,e}function N3(t,e,r){let n=null;return hr(e)?e.forEach(i=>{n||(!zo(i)||!i.includes(t))&&(n=et("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=et("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function M3(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;const s=N3(n,ih(n,i),`${e} requiredNamespace`);s&&(r=s)}),r}function L3(t,e){let r=null;return hr(t)?t.forEach(n=>{r||$3(n)||(r=et("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=et("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function U3(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=L3(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function j3(t,e){let r=null;return vh(t?.methods)?vh(t?.events)||(r=et("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=et("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function _h(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=j3(n,`${e}, namespace`);i&&(r=i)}),r}function F3(t,e,r){let n=null;if(t&&gn(t)){const i=_h(t,e);i&&(n=i);const s=M3(t,e);s&&(n=s)}else n=ie("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function hs(t,e){let r=null;if(t&&gn(t)){const n=_h(t,e);n&&(r=n);const i=U3(t,e);i&&(r=i)}else r=ie("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Eh(t){return pt(t.protocol,!0)}function B3(t,e){let r=!1;return e&&!t?r=!0:t&&hr(t)&&t.length&&t.forEach(n=>{r=Eh(n)}),r}function k3(t){return typeof t=="number"}function jt(t){return typeof t<"u"&&typeof t!==null}function H3(t){return!(!t||typeof t!="object"||!t.code||!Ho(t.code,!1)||!t.message||!pt(t.message,!1))}function z3(t){return!(Tt(t)||!pt(t.method,!1))}function W3(t){return!(Tt(t)||Tt(t.result)&&Tt(t.error)||!Ho(t.id,!1)||!pt(t.jsonrpc,!1))}function q3(t){return!(Tt(t)||!pt(t.name,!1))}function xh(t,e){return!(!zo(e)||!E3(t).includes(e))}function V3(t,e,r){return pt(r,!1)?x3(t,e).includes(r):!1}function K3(t,e,r){return pt(r,!1)?C3(t,e).includes(r):!1}function Ch(t,e,r){let n=null;const i=G3(t),s=Z3(e),o=Object.keys(i),a=Object.keys(s),c=Ih(Object.keys(t)),l=Ih(Object.keys(e)),p=c.filter(m=>!l.includes(m));return p.length&&(n=ie("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
15
15
|
Required: ${p.toString()}
|
|
16
16
|
Received: ${Object.keys(e).toString()}`)),Ur(o,a)||(n=ie("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
|
|
17
17
|
Required: ${o.toString()}
|
|
18
|
-
Approved: ${a.toString()}`)),Object.keys(e).forEach(m=>{if(!m.includes(":")||n)return;const w=
|
|
18
|
+
Approved: ${a.toString()}`)),Object.keys(e).forEach(m=>{if(!m.includes(":")||n)return;const w=pn(e[m].accounts);w.includes(m)||(n=ie("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${m}
|
|
19
19
|
Required: ${m}
|
|
20
|
-
Approved: ${w.toString()}`))}),o.forEach(m=>{n||(Ur(i[m].methods,s[m].methods)?Ur(i[m].events,s[m].events)||(n=ie("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${m}`)):n=ie("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${m}`))}),n}function
|
|
20
|
+
Approved: ${w.toString()}`))}),o.forEach(m=>{n||(Ur(i[m].methods,s[m].methods)?Ur(i[m].events,s[m].events)||(n=ie("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${m}`)):n=ie("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${m}`))}),n}function G3(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function Ih(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function Z3(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=pn(t[r].accounts);n?.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function Y3(t,e){return Ho(t,!1)&&t<=e.max&&t>=e.min}function J3(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var X3=Q3;function Q3(t,e,r){var n=r&&r.stringify||J3,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a<s;a++)o[a]=n(e[a]);return o.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var l="",p=1-i,m=-1,w=t&&t.length||0,y=0;y<w;){if(t.charCodeAt(y)===37&&y+1<w){switch(m=m>-1?m:0,t.charCodeAt(y+1)){case 100:case 102:if(p>=c||e[p]==null)break;m<y&&(l+=t.slice(m,y)),l+=Number(e[p]),m=y+2,y++;break;case 105:if(p>=c||e[p]==null)break;m<y&&(l+=t.slice(m,y)),l+=Math.floor(Number(e[p])),m=y+2,y++;break;case 79:case 111:case 106:if(p>=c||e[p]===void 0)break;m<y&&(l+=t.slice(m,y));var E=typeof e[p];if(E==="string"){l+="'"+e[p]+"'",m=y+2,y++;break}if(E==="function"){l+=e[p].name||"<anonymous>",m=y+2,y++;break}l+=n(e[p]),m=y+2,y++;break;case 115:if(p>=c)break;m<y&&(l+=t.slice(m,y)),l+=String(e[p]),m=y+2,y++;break;case 37:m<y&&(l+=t.slice(m,y)),l+="%",m=y+2,y++,p--;break}++p}++y}return m===-1?t:(m<w&&(l+=t.slice(m)),l)}const Sh=X3;var Xn=rr;const Qn=l2().console||{},e2={mapHttpRequest:ds,mapHttpResponse:ds,wrapRequestSerializer:qo,wrapResponseSerializer:qo,wrapErrorSerializer:qo,req:ds,res:ds,err:s2};function t2(t,e){return Array.isArray(t)?t.filter(function(n){return n!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function rr(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const r=t.browser.write||Qn;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=t2(t.browser.serialize,n);let s=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const o=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const a=t.level||"info",c=Object.create(r);c.log||(c.log=ei),Object.defineProperty(c,"levelVal",{get:p}),Object.defineProperty(c,"level",{get:m,set:w});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:o2(t)};c.levels=rr.levels,c.level=a,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=ei,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=y,e&&(c._logEvent=Wo());function p(){return this.level==="silent"?1/0:this.levels.values[this.level]}function m(){return this._level}function w(E){if(E!=="silent"&&!this.levels.values[E])throw Error("unknown level "+E);this._level=E,mn(l,c,"error","log"),mn(l,c,"fatal","error"),mn(l,c,"warn","error"),mn(l,c,"info","log"),mn(l,c,"debug","log"),mn(l,c,"trace","log")}function y(E,T){if(!E)throw new Error("missing bindings for child Pino");T=T||{},i&&E.serializers&&(T.serializers=E.serializers);const R=T.serializers;if(i&&R){var L=Object.assign({},n,R),C=t.browser.serialize===!0?Object.keys(L):i;delete E.serializers,us([E],C,L,this._stdErrSerialize)}function O(b){this._childLevel=(b._childLevel|0)+1,this.error=wn(b,E,"error"),this.fatal=wn(b,E,"fatal"),this.warn=wn(b,E,"warn"),this.info=wn(b,E,"info"),this.debug=wn(b,E,"debug"),this.trace=wn(b,E,"trace"),L&&(this.serializers=L,this._serialize=C),e&&(this._logEvent=Wo([].concat(b._logEvent.bindings,E)))}return O.prototype=this,new O(this)}return c}rr.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},rr.stdSerializers=e2,rr.stdTimeFunctions=Object.assign({},{nullTime:Dh,epochTime:Oh,unixTime:a2,isoTime:c2});function mn(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?ei:i[r]?i[r]:Qn[r]||Qn[n]||ei,r2(t,e,r)}function r2(t,e,r){!t.transmit&&e[r]===ei||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Qn?Qn:this;for(var c=0;c<o.length;c++)o[c]=arguments[c];if(t.serialize&&!t.asObject&&us(o,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?n.call(a,n2(this,r,o,s)):n.apply(a,o),t.transmit){const l=t.transmit.level||e.level,p=rr.levels.values[l],m=rr.levels.values[r];if(m<p)return;i2(this,{ts:s,methodLevel:r,methodValue:m,transmitLevel:l,transmitValue:rr.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},o)}}}(e[r]))}function n2(t,e,r,n){t._serialize&&us(r,t._serialize,t.serializers,t._stdErrSerialize);const i=r.slice();let s=i[0];const o={};n&&(o.time=n),o.level=rr.levels.values[e];let a=(t._childLevel|0)+1;if(a<1&&(a=1),s!==null&&typeof s=="object"){for(;a--&&typeof i[0]=="object";)Object.assign(o,i.shift());s=i.length?Sh(i.shift(),i):void 0}else typeof s=="string"&&(s=Sh(i.shift(),i));return s!==void 0&&(o.msg=s),o}function us(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=rr.stdSerializers.err(t[i]);else if(typeof t[i]=="object"&&!Array.isArray(t[i]))for(const s in t[i])e&&e.indexOf(s)>-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function wn(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return t[r].apply(this,n)}}function i2(t,e,r){const n=e.send,i=e.ts,s=e.methodLevel,o=e.methodValue,a=e.val,c=t._logEvent.bindings;us(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=i,t._logEvent.messages=r.filter(function(l){return c.indexOf(l)===-1}),t._logEvent.level.label=s,t._logEvent.level.value=o,n(s,t._logEvent,a),t._logEvent=Wo(c)}function Wo(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function s2(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)e[r]===void 0&&(e[r]=t[r]);return e}function o2(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?Dh:Oh}function ds(){return{}}function qo(t){return t}function ei(){}function Dh(){return!1}function Oh(){return Date.now()}function a2(){return Math.round(Date.now()/1e3)}function c2(){return new Date(Date.now()).toISOString()}function l2(){function t(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}var fs={};/*! *****************************************************************************
|
|
21
21
|
Copyright (c) Microsoft Corporation.
|
|
22
22
|
|
|
23
23
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
31
31
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
32
32
|
PERFORMANCE OF THIS SOFTWARE.
|
|
33
|
-
***************************************************************************** */var
|
|
33
|
+
***************************************************************************** */var Vo=function(t,e){return Vo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Vo(t,e)};function h2(t,e){Vo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Ko=function(){return Ko=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Ko.apply(this,arguments)};function u2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function d2(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function f2(t,e){return function(r,n){e(r,n,t)}}function p2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function g2(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(m){o(m)}}function c(p){try{l(n.throw(p))}catch(m){o(m)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function m2(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function w2(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function y2(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Go(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 $h(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function b2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat($h(arguments[e]));return t}function v2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function ti(t){return this instanceof ti?(this.v=t,this):new ti(t)}function _2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(w){n[w]&&(i[w]=function(y){return new Promise(function(E,T){s.push([w,y,E,T])>1||a(w,y)})})}function a(w,y){try{c(n[w](y))}catch(E){m(s[0][3],E)}}function c(w){w.value instanceof ti?Promise.resolve(w.value.v).then(l,p):m(s[0][2],w)}function l(w){a("next",w)}function p(w){a("throw",w)}function m(w,y){w(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function E2(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(o){return(r=!r)?{value:ti(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function x2(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 Go=="function"?Go(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(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function C2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function I2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function S2(t){return t&&t.__esModule?t:{default:t}}function D2(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function O2(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var $2=Object.freeze({__proto__:null,__extends:h2,get __assign(){return Ko},__rest:u2,__decorate:d2,__param:f2,__metadata:p2,__awaiter:g2,__generator:m2,__createBinding:w2,__exportStar:y2,__values:Go,__read:$h,__spread:b2,__spreadArrays:v2,__await:ti,__asyncGenerator:_2,__asyncDelegator:E2,__asyncValues:x2,__makeTemplateObject:C2,__importStar:I2,__importDefault:S2,__classPrivateFieldGet:D2,__classPrivateFieldSet:O2}),Ah=Tr($2),ri={};Object.defineProperty(ri,"__esModule",{value:!0});function A2(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}ri.safeJsonParse=A2;function P2(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}ri.safeJsonStringify=P2;var ni={exports:{}},Ph;function T2(){return Ph||(Ph=1,function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof dt<"u"&&dt.localStorage?ni.exports=dt.localStorage:typeof window<"u"&&window.localStorage?ni.exports=window.localStorage:ni.exports=new e}()),ni.exports}var Zo={},ii={},Th;function R2(){if(Th)return ii;Th=1,Object.defineProperty(ii,"__esModule",{value:!0}),ii.IKeyValueStorage=void 0;class t{}return ii.IKeyValueStorage=t,ii}var si={},Rh;function N2(){if(Rh)return si;Rh=1,Object.defineProperty(si,"__esModule",{value:!0}),si.parseEntry=void 0;const t=ri;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return si.parseEntry=e,si}var Nh;function M2(){return Nh||(Nh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Ah;e.__exportStar(R2(),t),e.__exportStar(N2(),t)}(Zo)),Zo}Object.defineProperty(fs,"__esModule",{value:!0}),fs.KeyValueStorage=void 0;const yn=Ah,Mh=ri,L2=yn.__importDefault(T2()),U2=M2();class Lh{constructor(){this.localStorage=L2.default}getKeys(){return yn.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return yn.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(U2.parseEntry)})}getItem(e){return yn.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return Mh.safeJsonParse(r)})}setItem(e,r){return yn.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,Mh.safeJsonStringify(r))})}removeItem(e){return yn.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}fs.KeyValueStorage=Lh;var j2=fs.default=Lh,oi={};/*! *****************************************************************************
|
|
34
34
|
Copyright (c) Microsoft Corporation.
|
|
35
35
|
|
|
36
36
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
44
44
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
45
45
|
PERFORMANCE OF THIS SOFTWARE.
|
|
46
|
-
***************************************************************************** */var
|
|
46
|
+
***************************************************************************** */var Yo=function(t,e){return Yo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Yo(t,e)};function F2(t,e){Yo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Jo=function(){return Jo=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Jo.apply(this,arguments)};function B2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function k2(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function H2(t,e){return function(r,n){e(r,n,t)}}function z2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function W2(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(m){o(m)}}function c(p){try{l(n.throw(p))}catch(m){o(m)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function q2(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function V2(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function K2(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Xo(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 Uh(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function G2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Uh(arguments[e]));return t}function Z2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function ai(t){return this instanceof ai?(this.v=t,this):new ai(t)}function Y2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(w){n[w]&&(i[w]=function(y){return new Promise(function(E,T){s.push([w,y,E,T])>1||a(w,y)})})}function a(w,y){try{c(n[w](y))}catch(E){m(s[0][3],E)}}function c(w){w.value instanceof ai?Promise.resolve(w.value.v).then(l,p):m(s[0][2],w)}function l(w){a("next",w)}function p(w){a("throw",w)}function m(w,y){w(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function J2(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(o){return(r=!r)?{value:ai(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function X2(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 Xo=="function"?Xo(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(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Q2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function em(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function tm(t){return t&&t.__esModule?t:{default:t}}function rm(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function nm(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var im=Object.freeze({__proto__:null,__extends:F2,get __assign(){return Jo},__rest:B2,__decorate:k2,__param:H2,__metadata:z2,__awaiter:W2,__generator:q2,__createBinding:V2,__exportStar:K2,__values:Xo,__read:Uh,__spread:G2,__spreadArrays:Z2,__await:ai,__asyncGenerator:Y2,__asyncDelegator:J2,__asyncValues:X2,__makeTemplateObject:Q2,__importStar:em,__importDefault:tm,__classPrivateFieldGet:rm,__classPrivateFieldSet:nm}),ps=Tr(im),ci={},Qo={},li={};class jr{}var sm=Object.freeze({__proto__:null,IEvents:jr}),om=Tr(sm),jh;function am(){if(jh)return li;jh=1,Object.defineProperty(li,"__esModule",{value:!0}),li.IHeartBeat=void 0;const t=om;class e extends t.IEvents{constructor(n){super()}}return li.IHeartBeat=e,li}var Fh;function Bh(){return Fh||(Fh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ps.__exportStar(am(),t)}(Qo)),Qo}var ea={},Fr={},kh;function cm(){if(kh)return Fr;kh=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.HEARTBEAT_EVENTS=Fr.HEARTBEAT_INTERVAL=void 0;const t=fe;return Fr.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Fr.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Fr}var Hh;function zh(){return Hh||(Hh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ps.__exportStar(cm(),t)}(ea)),ea}var Wh;function lm(){if(Wh)return ci;Wh=1,Object.defineProperty(ci,"__esModule",{value:!0}),ci.HeartBeat=void 0;const t=ps,e=ft.exports,r=fe,n=Bh(),i=zh();class s extends n.IHeartBeat{constructor(a){super(a),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=a?.interval||i.HEARTBEAT_INTERVAL}static init(a){return t.__awaiter(this,void 0,void 0,function*(){const c=new s(a);return yield c.init(),c})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(a,c){this.events.on(a,c)}once(a,c){this.events.once(a,c)}off(a,c){this.events.off(a,c)}removeListener(a,c){this.events.removeListener(a,c)}initialize(){return t.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return ci.HeartBeat=s,ci}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ps;e.__exportStar(lm(),t),e.__exportStar(Bh(),t),e.__exportStar(zh(),t)})(oi);var Be={};/*! *****************************************************************************
|
|
47
47
|
Copyright (c) Microsoft Corporation.
|
|
48
48
|
|
|
49
49
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
57
57
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
58
58
|
PERFORMANCE OF THIS SOFTWARE.
|
|
59
|
-
***************************************************************************** */var ea=function(t,e){return ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},ea(t,e)};function K2(t,e){ea(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ta=function(){return ta=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},ta.apply(this,arguments)};function G2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Z2(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Y2(t,e){return function(r,n){e(r,n,t)}}function J2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function X2(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(m){o(m)}}function c(p){try{l(n.throw(p))}catch(m){o(m)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function Q2(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function em(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function tm(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ra(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 Wh(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function rm(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Wh(arguments[e]));return t}function nm(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function hi(t){return this instanceof hi?(this.v=t,this):new hi(t)}function im(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(w){n[w]&&(i[w]=function(y){return new Promise(function(E,T){s.push([w,y,E,T])>1||a(w,y)})})}function a(w,y){try{c(n[w](y))}catch(E){m(s[0][3],E)}}function c(w){w.value instanceof hi?Promise.resolve(w.value.v).then(l,p):m(s[0][2],w)}function l(w){a("next",w)}function p(w){a("throw",w)}function m(w,y){w(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function sm(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(o){return(r=!r)?{value:hi(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function om(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 ra=="function"?ra(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(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function am(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function cm(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function lm(t){return t&&t.__esModule?t:{default:t}}function hm(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function um(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var dm=Object.freeze({__proto__:null,__extends:K2,get __assign(){return ta},__rest:G2,__decorate:Z2,__param:Y2,__metadata:J2,__awaiter:X2,__generator:Q2,__createBinding:em,__exportStar:tm,__values:ra,__read:Wh,__spread:rm,__spreadArrays:nm,__await:hi,__asyncGenerator:im,__asyncDelegator:sm,__asyncValues:om,__makeTemplateObject:am,__importStar:cm,__importDefault:lm,__classPrivateFieldGet:hm,__classPrivateFieldSet:um}),fm=Tr(dm),kr={},qh;function Vh(){return qh||(qh=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.PINO_CUSTOM_CONTEXT_KEY=kr.PINO_LOGGER_DEFAULTS=void 0,kr.PINO_LOGGER_DEFAULTS={level:"info"},kr.PINO_CUSTOM_CONTEXT_KEY="custom_context"),kr}var Pt={},Kh;function pm(){if(Kh)return Pt;Kh=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.generateChildLogger=Pt.formatChildLoggerContext=Pt.getLoggerContext=Pt.setBrowserLoggerContext=Pt.getBrowserLoggerContext=Pt.getDefaultLoggerOptions=void 0;const t=Vh();function e(a){return Object.assign(Object.assign({},a),{level:a?.level||t.PINO_LOGGER_DEFAULTS.level})}Pt.getDefaultLoggerOptions=e;function r(a,c=t.PINO_CUSTOM_CONTEXT_KEY){return a[c]||""}Pt.getBrowserLoggerContext=r;function n(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){return a[l]=c,a}Pt.setBrowserLoggerContext=n;function i(a,c=t.PINO_CUSTOM_CONTEXT_KEY){let l="";return typeof a.bindings>"u"?l=r(a,c):l=a.bindings().context||"",l}Pt.getLoggerContext=i;function s(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=i(a,l);return p.trim()?`${p}/${c}`:c}Pt.formatChildLoggerContext=s;function o(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=s(a,c,l),m=a.child({context:p});return n(m,p,l)}return Pt.generateChildLogger=o,Pt}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=fm,r=e.__importDefault(Xn);Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(Vh(),t),e.__exportStar(pm(),t)})(Be);class gm extends Fr{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class mm extends Fr{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class wm{constructor(e,r){this.logger=e,this.core=r}}class ym extends Fr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class bm extends Fr{constructor(e){super()}}class vm{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class _m extends Fr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class Em extends Fr{constructor(e,r){super(),this.core=e,this.logger=r}}class xm{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class Cm{constructor(e){this.client=e}}function na(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function ui(t){return typeof t=="string"?t:JSON.stringify(t)}var ia={},Gh={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_e,r=kt;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function a(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return a.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},a.prototype.update=function(c,l){if(l===void 0&&(l=c.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var p=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&l>0;)this._buffer[this._bufferLength++]=c[p++],l--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(p=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,p,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[p++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,p=this._bufferLength,m=l/536870912|0,w=l<<3,y=l%128<112?128:256;this._buffer[p]=128;for(var E=p+1;E<y-8;E++)this._buffer[E]=0;e.writeUint32BE(m,this._buffer,y-8),e.writeUint32BE(w,this._buffer,y-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,y),this._finished=!0}for(var E=0;E<this.digestLength/8;E++)e.writeUint32BE(this._stateHi[E],c,E*8),e.writeUint32BE(this._stateLo[E],c,E*8+4);return this},a.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._stateHi.set(c.stateHi),this._stateLo.set(c.stateLo),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.stateHi),r.wipe(c.stateLo),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA512=n;var i=new Int32Array([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]);function s(a,c,l,p,m,w,y){for(var E=l[0],T=l[1],N=l[2],L=l[3],C=l[4],D=l[5],b=l[6],S=l[7],O=p[0],u=p[1],_=p[2],H=p[3],B=p[4],q=p[5],X=p[6],te=p[7],x,$,K,Y,W,z,J,G;y>=128;){for(var ce=0;ce<16;ce++){var Q=8*ce+w;a[ce]=e.readUint32BE(m,Q),c[ce]=e.readUint32BE(m,Q+4)}for(var ce=0;ce<80;ce++){var pe=E,oe=T,Ce=N,F=L,j=C,R=D,f=b,A=S,ee=O,ne=u,Ee=_,Le=H,Pe=B,Ue=q,Ge=X,Ve=te;if(x=S,$=te,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=(C>>>14|B<<32-14)^(C>>>18|B<<32-18)^(B>>>41-32|C<<32-(41-32)),$=(B>>>14|C<<32-14)^(B>>>18|C<<32-18)^(C>>>41-32|B<<32-(41-32)),W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,x=C&D^~C&b,$=B&q^~B&X,W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,x=i[ce*2],$=i[ce*2+1],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,x=a[ce%16],$=c[ce%16],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,K=J&65535|G<<16,Y=W&65535|z<<16,x=K,$=Y,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=(E>>>28|O<<32-28)^(O>>>34-32|E<<32-(34-32))^(O>>>39-32|E<<32-(39-32)),$=(O>>>28|E<<32-28)^(E>>>34-32|O<<32-(34-32))^(E>>>39-32|O<<32-(39-32)),W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,x=E&T^E&N^T&N,$=O&u^O&_^u&_,W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,A=J&65535|G<<16,Ve=W&65535|z<<16,x=F,$=Le,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=K,$=Y,W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,F=J&65535|G<<16,Le=W&65535|z<<16,T=pe,N=oe,L=Ce,C=F,D=j,b=R,S=f,E=A,u=ee,_=ne,H=Ee,B=Le,q=Pe,X=Ue,te=Ge,O=Ve,ce%16===15)for(var Q=0;Q<16;Q++)x=a[Q],$=c[Q],W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=a[(Q+9)%16],$=c[(Q+9)%16],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,K=a[(Q+1)%16],Y=c[(Q+1)%16],x=(K>>>1|Y<<32-1)^(K>>>8|Y<<32-8)^K>>>7,$=(Y>>>1|K<<32-1)^(Y>>>8|K<<32-8)^(Y>>>7|K<<32-7),W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,K=a[(Q+14)%16],Y=c[(Q+14)%16],x=(K>>>19|Y<<32-19)^(Y>>>61-32|K<<32-(61-32))^K>>>6,$=(Y>>>19|K<<32-19)^(K>>>61-32|Y<<32-(61-32))^(Y>>>6|K<<32-6),W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,a[Q]=J&65535|G<<16,c[Q]=W&65535|z<<16}x=E,$=O,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[0],$=p[0],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[0]=E=J&65535|G<<16,p[0]=O=W&65535|z<<16,x=T,$=u,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[1],$=p[1],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[1]=T=J&65535|G<<16,p[1]=u=W&65535|z<<16,x=N,$=_,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[2],$=p[2],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[2]=N=J&65535|G<<16,p[2]=_=W&65535|z<<16,x=L,$=H,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[3],$=p[3],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[3]=L=J&65535|G<<16,p[3]=H=W&65535|z<<16,x=C,$=B,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[4],$=p[4],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[4]=C=J&65535|G<<16,p[4]=B=W&65535|z<<16,x=D,$=q,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[5],$=p[5],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[5]=D=J&65535|G<<16,p[5]=q=W&65535|z<<16,x=b,$=X,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[6],$=p[6],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[6]=b=J&65535|G<<16,p[6]=X=W&65535|z<<16,x=S,$=te,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[7],$=p[7],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[7]=S=J&65535|G<<16,p[7]=te=W&65535|z<<16,w+=128,y-=128}return w}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Gh),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=dn,r=Gh,n=kt;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(F){const j=new Float64Array(16);if(F)for(let R=0;R<F.length;R++)j[R]=F[R];return j}const s=new Uint8Array(32);s[0]=9;const o=i(),a=i([1]),c=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),p=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),w=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function y(F,j){for(let R=0;R<16;R++)F[R]=j[R]|0}function E(F){let j=1;for(let R=0;R<16;R++){let f=F[R]+j+65535;j=Math.floor(f/65536),F[R]=f-j*65536}F[0]+=j-1+37*(j-1)}function T(F,j,R){const f=~(R-1);for(let A=0;A<16;A++){const ee=f&(F[A]^j[A]);F[A]^=ee,j[A]^=ee}}function N(F,j){const R=i(),f=i();for(let A=0;A<16;A++)f[A]=j[A];E(f),E(f),E(f);for(let A=0;A<2;A++){R[0]=f[0]-65517;for(let ne=1;ne<15;ne++)R[ne]=f[ne]-65535-(R[ne-1]>>16&1),R[ne-1]&=65535;R[15]=f[15]-32767-(R[14]>>16&1);const ee=R[15]>>16&1;R[14]&=65535,T(f,R,1-ee)}for(let A=0;A<16;A++)F[2*A]=f[A]&255,F[2*A+1]=f[A]>>8}function L(F,j){let R=0;for(let f=0;f<32;f++)R|=F[f]^j[f];return(1&R-1>>>8)-1}function C(F,j){const R=new Uint8Array(32),f=new Uint8Array(32);return N(R,F),N(f,j),L(R,f)}function D(F){const j=new Uint8Array(32);return N(j,F),j[0]&1}function b(F,j){for(let R=0;R<16;R++)F[R]=j[2*R]+(j[2*R+1]<<8);F[15]&=32767}function S(F,j,R){for(let f=0;f<16;f++)F[f]=j[f]+R[f]}function O(F,j,R){for(let f=0;f<16;f++)F[f]=j[f]-R[f]}function u(F,j,R){let f,A,ee=0,ne=0,Ee=0,Le=0,Pe=0,Ue=0,Ge=0,Ve=0,Te=0,Oe=0,me=0,Ie=0,$e=0,ge=0,xe=0,g=0,h=0,d=0,v=0,P=0,U=0,k=0,se=0,he=0,Re=0,je=0,Me=0,Wt=0,an=0,Wi=0,io=0,rt=R[0],Je=R[1],nt=R[2],it=R[3],st=R[4],Xe=R[5],gt=R[6],mt=R[7],wt=R[8],yt=R[9],bt=R[10],ut=R[11],ot=R[12],Ke=R[13],vt=R[14],_t=R[15];f=j[0],ee+=f*rt,ne+=f*Je,Ee+=f*nt,Le+=f*it,Pe+=f*st,Ue+=f*Xe,Ge+=f*gt,Ve+=f*mt,Te+=f*wt,Oe+=f*yt,me+=f*bt,Ie+=f*ut,$e+=f*ot,ge+=f*Ke,xe+=f*vt,g+=f*_t,f=j[1],ne+=f*rt,Ee+=f*Je,Le+=f*nt,Pe+=f*it,Ue+=f*st,Ge+=f*Xe,Ve+=f*gt,Te+=f*mt,Oe+=f*wt,me+=f*yt,Ie+=f*bt,$e+=f*ut,ge+=f*ot,xe+=f*Ke,g+=f*vt,h+=f*_t,f=j[2],Ee+=f*rt,Le+=f*Je,Pe+=f*nt,Ue+=f*it,Ge+=f*st,Ve+=f*Xe,Te+=f*gt,Oe+=f*mt,me+=f*wt,Ie+=f*yt,$e+=f*bt,ge+=f*ut,xe+=f*ot,g+=f*Ke,h+=f*vt,d+=f*_t,f=j[3],Le+=f*rt,Pe+=f*Je,Ue+=f*nt,Ge+=f*it,Ve+=f*st,Te+=f*Xe,Oe+=f*gt,me+=f*mt,Ie+=f*wt,$e+=f*yt,ge+=f*bt,xe+=f*ut,g+=f*ot,h+=f*Ke,d+=f*vt,v+=f*_t,f=j[4],Pe+=f*rt,Ue+=f*Je,Ge+=f*nt,Ve+=f*it,Te+=f*st,Oe+=f*Xe,me+=f*gt,Ie+=f*mt,$e+=f*wt,ge+=f*yt,xe+=f*bt,g+=f*ut,h+=f*ot,d+=f*Ke,v+=f*vt,P+=f*_t,f=j[5],Ue+=f*rt,Ge+=f*Je,Ve+=f*nt,Te+=f*it,Oe+=f*st,me+=f*Xe,Ie+=f*gt,$e+=f*mt,ge+=f*wt,xe+=f*yt,g+=f*bt,h+=f*ut,d+=f*ot,v+=f*Ke,P+=f*vt,U+=f*_t,f=j[6],Ge+=f*rt,Ve+=f*Je,Te+=f*nt,Oe+=f*it,me+=f*st,Ie+=f*Xe,$e+=f*gt,ge+=f*mt,xe+=f*wt,g+=f*yt,h+=f*bt,d+=f*ut,v+=f*ot,P+=f*Ke,U+=f*vt,k+=f*_t,f=j[7],Ve+=f*rt,Te+=f*Je,Oe+=f*nt,me+=f*it,Ie+=f*st,$e+=f*Xe,ge+=f*gt,xe+=f*mt,g+=f*wt,h+=f*yt,d+=f*bt,v+=f*ut,P+=f*ot,U+=f*Ke,k+=f*vt,se+=f*_t,f=j[8],Te+=f*rt,Oe+=f*Je,me+=f*nt,Ie+=f*it,$e+=f*st,ge+=f*Xe,xe+=f*gt,g+=f*mt,h+=f*wt,d+=f*yt,v+=f*bt,P+=f*ut,U+=f*ot,k+=f*Ke,se+=f*vt,he+=f*_t,f=j[9],Oe+=f*rt,me+=f*Je,Ie+=f*nt,$e+=f*it,ge+=f*st,xe+=f*Xe,g+=f*gt,h+=f*mt,d+=f*wt,v+=f*yt,P+=f*bt,U+=f*ut,k+=f*ot,se+=f*Ke,he+=f*vt,Re+=f*_t,f=j[10],me+=f*rt,Ie+=f*Je,$e+=f*nt,ge+=f*it,xe+=f*st,g+=f*Xe,h+=f*gt,d+=f*mt,v+=f*wt,P+=f*yt,U+=f*bt,k+=f*ut,se+=f*ot,he+=f*Ke,Re+=f*vt,je+=f*_t,f=j[11],Ie+=f*rt,$e+=f*Je,ge+=f*nt,xe+=f*it,g+=f*st,h+=f*Xe,d+=f*gt,v+=f*mt,P+=f*wt,U+=f*yt,k+=f*bt,se+=f*ut,he+=f*ot,Re+=f*Ke,je+=f*vt,Me+=f*_t,f=j[12],$e+=f*rt,ge+=f*Je,xe+=f*nt,g+=f*it,h+=f*st,d+=f*Xe,v+=f*gt,P+=f*mt,U+=f*wt,k+=f*yt,se+=f*bt,he+=f*ut,Re+=f*ot,je+=f*Ke,Me+=f*vt,Wt+=f*_t,f=j[13],ge+=f*rt,xe+=f*Je,g+=f*nt,h+=f*it,d+=f*st,v+=f*Xe,P+=f*gt,U+=f*mt,k+=f*wt,se+=f*yt,he+=f*bt,Re+=f*ut,je+=f*ot,Me+=f*Ke,Wt+=f*vt,an+=f*_t,f=j[14],xe+=f*rt,g+=f*Je,h+=f*nt,d+=f*it,v+=f*st,P+=f*Xe,U+=f*gt,k+=f*mt,se+=f*wt,he+=f*yt,Re+=f*bt,je+=f*ut,Me+=f*ot,Wt+=f*Ke,an+=f*vt,Wi+=f*_t,f=j[15],g+=f*rt,h+=f*Je,d+=f*nt,v+=f*it,P+=f*st,U+=f*Xe,k+=f*gt,se+=f*mt,he+=f*wt,Re+=f*yt,je+=f*bt,Me+=f*ut,Wt+=f*ot,an+=f*Ke,Wi+=f*vt,io+=f*_t,ee+=38*h,ne+=38*d,Ee+=38*v,Le+=38*P,Pe+=38*U,Ue+=38*k,Ge+=38*se,Ve+=38*he,Te+=38*Re,Oe+=38*je,me+=38*Me,Ie+=38*Wt,$e+=38*an,ge+=38*Wi,xe+=38*io,A=1,f=ee+A+65535,A=Math.floor(f/65536),ee=f-A*65536,f=ne+A+65535,A=Math.floor(f/65536),ne=f-A*65536,f=Ee+A+65535,A=Math.floor(f/65536),Ee=f-A*65536,f=Le+A+65535,A=Math.floor(f/65536),Le=f-A*65536,f=Pe+A+65535,A=Math.floor(f/65536),Pe=f-A*65536,f=Ue+A+65535,A=Math.floor(f/65536),Ue=f-A*65536,f=Ge+A+65535,A=Math.floor(f/65536),Ge=f-A*65536,f=Ve+A+65535,A=Math.floor(f/65536),Ve=f-A*65536,f=Te+A+65535,A=Math.floor(f/65536),Te=f-A*65536,f=Oe+A+65535,A=Math.floor(f/65536),Oe=f-A*65536,f=me+A+65535,A=Math.floor(f/65536),me=f-A*65536,f=Ie+A+65535,A=Math.floor(f/65536),Ie=f-A*65536,f=$e+A+65535,A=Math.floor(f/65536),$e=f-A*65536,f=ge+A+65535,A=Math.floor(f/65536),ge=f-A*65536,f=xe+A+65535,A=Math.floor(f/65536),xe=f-A*65536,f=g+A+65535,A=Math.floor(f/65536),g=f-A*65536,ee+=A-1+37*(A-1),A=1,f=ee+A+65535,A=Math.floor(f/65536),ee=f-A*65536,f=ne+A+65535,A=Math.floor(f/65536),ne=f-A*65536,f=Ee+A+65535,A=Math.floor(f/65536),Ee=f-A*65536,f=Le+A+65535,A=Math.floor(f/65536),Le=f-A*65536,f=Pe+A+65535,A=Math.floor(f/65536),Pe=f-A*65536,f=Ue+A+65535,A=Math.floor(f/65536),Ue=f-A*65536,f=Ge+A+65535,A=Math.floor(f/65536),Ge=f-A*65536,f=Ve+A+65535,A=Math.floor(f/65536),Ve=f-A*65536,f=Te+A+65535,A=Math.floor(f/65536),Te=f-A*65536,f=Oe+A+65535,A=Math.floor(f/65536),Oe=f-A*65536,f=me+A+65535,A=Math.floor(f/65536),me=f-A*65536,f=Ie+A+65535,A=Math.floor(f/65536),Ie=f-A*65536,f=$e+A+65535,A=Math.floor(f/65536),$e=f-A*65536,f=ge+A+65535,A=Math.floor(f/65536),ge=f-A*65536,f=xe+A+65535,A=Math.floor(f/65536),xe=f-A*65536,f=g+A+65535,A=Math.floor(f/65536),g=f-A*65536,ee+=A-1+37*(A-1),F[0]=ee,F[1]=ne,F[2]=Ee,F[3]=Le,F[4]=Pe,F[5]=Ue,F[6]=Ge,F[7]=Ve,F[8]=Te,F[9]=Oe,F[10]=me,F[11]=Ie,F[12]=$e,F[13]=ge,F[14]=xe,F[15]=g}function _(F,j){u(F,j,j)}function H(F,j){const R=i();let f;for(f=0;f<16;f++)R[f]=j[f];for(f=253;f>=0;f--)_(R,R),f!==2&&f!==4&&u(R,R,j);for(f=0;f<16;f++)F[f]=R[f]}function B(F,j){const R=i();let f;for(f=0;f<16;f++)R[f]=j[f];for(f=250;f>=0;f--)_(R,R),f!==1&&u(R,R,j);for(f=0;f<16;f++)F[f]=R[f]}function q(F,j){const R=i(),f=i(),A=i(),ee=i(),ne=i(),Ee=i(),Le=i(),Pe=i(),Ue=i();O(R,F[1],F[0]),O(Ue,j[1],j[0]),u(R,R,Ue),S(f,F[0],F[1]),S(Ue,j[0],j[1]),u(f,f,Ue),u(A,F[3],j[3]),u(A,A,l),u(ee,F[2],j[2]),S(ee,ee,ee),O(ne,f,R),O(Ee,ee,A),S(Le,ee,A),S(Pe,f,R),u(F[0],ne,Ee),u(F[1],Pe,Le),u(F[2],Le,Ee),u(F[3],ne,Pe)}function X(F,j,R){for(let f=0;f<4;f++)T(F[f],j[f],R)}function te(F,j){const R=i(),f=i(),A=i();H(A,j[2]),u(R,j[0],A),u(f,j[1],A),N(F,f),F[31]^=D(R)<<7}function x(F,j,R){y(F[0],o),y(F[1],a),y(F[2],a),y(F[3],o);for(let f=255;f>=0;--f){const A=R[f/8|0]>>(f&7)&1;X(F,j,A),q(j,F),q(F,F),X(F,j,A)}}function $(F,j){const R=[i(),i(),i(),i()];y(R[0],p),y(R[1],m),y(R[2],a),u(R[3],p,m),x(F,R,j)}function K(F){if(F.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const j=(0,r.hash)(F);j[0]&=248,j[31]&=127,j[31]|=64;const R=new Uint8Array(32),f=[i(),i(),i(),i()];$(f,j),te(R,f);const A=new Uint8Array(64);return A.set(F),A.set(R,32),{publicKey:R,secretKey:A}}t.generateKeyPairFromSeed=K;function Y(F){const j=(0,e.randomBytes)(32,F),R=K(j);return(0,n.wipe)(j),R}t.generateKeyPair=Y;function W(F){if(F.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(F.subarray(32))}t.extractPublicKeyFromSecretKey=W;const z=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function J(F,j){let R,f,A,ee;for(f=63;f>=32;--f){for(R=0,A=f-32,ee=f-12;A<ee;++A)j[A]+=R-16*j[f]*z[A-(f-32)],R=Math.floor((j[A]+128)/256),j[A]-=R*256;j[A]+=R,j[f]=0}for(R=0,A=0;A<32;A++)j[A]+=R-(j[31]>>4)*z[A],R=j[A]>>8,j[A]&=255;for(A=0;A<32;A++)j[A]-=R*z[A];for(f=0;f<32;f++)j[f+1]+=j[f]>>8,F[f]=j[f]&255}function G(F){const j=new Float64Array(64);for(let R=0;R<64;R++)j[R]=F[R];for(let R=0;R<64;R++)F[R]=0;J(F,j)}function ce(F,j){const R=new Float64Array(64),f=[i(),i(),i(),i()],A=(0,r.hash)(F.subarray(0,32));A[0]&=248,A[31]&=127,A[31]|=64;const ee=new Uint8Array(64);ee.set(A.subarray(32),32);const ne=new r.SHA512;ne.update(ee.subarray(32)),ne.update(j);const Ee=ne.digest();ne.clean(),G(Ee),$(f,Ee),te(ee,f),ne.reset(),ne.update(ee.subarray(0,32)),ne.update(F.subarray(32)),ne.update(j);const Le=ne.digest();G(Le);for(let Pe=0;Pe<32;Pe++)R[Pe]=Ee[Pe];for(let Pe=0;Pe<32;Pe++)for(let Ue=0;Ue<32;Ue++)R[Pe+Ue]+=Le[Pe]*A[Ue];return J(ee.subarray(32),R),ee}t.sign=ce;function Q(F,j){const R=i(),f=i(),A=i(),ee=i(),ne=i(),Ee=i(),Le=i();return y(F[2],a),b(F[1],j),_(A,F[1]),u(ee,A,c),O(A,A,F[2]),S(ee,F[2],ee),_(ne,ee),_(Ee,ne),u(Le,Ee,ne),u(R,Le,A),u(R,R,ee),B(R,R),u(R,R,A),u(R,R,ee),u(R,R,ee),u(F[0],R,ee),_(f,F[0]),u(f,f,ee),C(f,A)&&u(F[0],F[0],w),_(f,F[0]),u(f,f,ee),C(f,A)?-1:(D(F[0])===j[31]>>7&&O(F[0],o,F[0]),u(F[3],F[0],F[1]),0)}function pe(F,j,R){const f=new Uint8Array(32),A=[i(),i(),i(),i()],ee=[i(),i(),i(),i()];if(R.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(Q(ee,F))return!1;const ne=new r.SHA512;ne.update(R.subarray(0,32)),ne.update(F),ne.update(j);const Ee=ne.digest();return G(Ee),x(A,ee,Ee),$(ee,R.subarray(32)),q(A,ee),te(f,A),!L(R,f)}t.verify=pe;function oe(F){let j=[i(),i(),i(),i()];if(Q(j,F))throw new Error("Ed25519: invalid public key");let R=i(),f=i(),A=j[1];S(R,a,A),O(f,a,A),H(f,f),u(R,R,f);let ee=new Uint8Array(32);return N(ee,R),ee}t.convertPublicKeyToX25519=oe;function Ce(F){const j=(0,r.hash)(F.subarray(0,32));j[0]&=248,j[31]&=127,j[31]|=64;const R=new Uint8Array(j.subarray(0,32));return(0,n.wipe)(j),R}t.convertSecretKeyToX25519=Ce}(ia);const Im="EdDSA",Sm="JWT",Zh=".",Yh="base64url",Dm="utf8",Om="utf8",$m=":",Am="did",Pm="key",Jh="base58btc",Tm="z",Nm="K36",Rm=32;function ds(t){return Lt(Mt(ui(t),Dm),Yh)}function Xh(t){const e=Mt(Nm,Jh),r=Tm+Lt(vo([e,t]),Jh);return[Am,Pm,r].join($m)}function Mm(t){return Lt(t,Yh)}function Lm(t){return Mt([ds(t.header),ds(t.payload)].join(Zh),Om)}function Um(t){return[ds(t.header),ds(t.payload),Mm(t.signature)].join(Zh)}function Qh(t=dn.randomBytes(Rm)){return ia.generateKeyPairFromSeed(t)}async function jm(t,e,r,n,i=fe.fromMiliseconds(Date.now())){const s={alg:Im,typ:Sm},o=Xh(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=Lm({header:s,payload:c}),p=ia.sign(n.secretKey,l);return Um({header:s,payload:c,signature:p})}const Fm="PARSE_ERROR",Bm="INVALID_REQUEST",km="METHOD_NOT_FOUND",Hm="INVALID_PARAMS",eu="INTERNAL_ERROR",sa="SERVER_ERROR",zm=[-32700,-32600,-32601,-32602,-32603],di={[Fm]:{code:-32700,message:"Parse error"},[Bm]:{code:-32600,message:"Invalid Request"},[km]:{code:-32601,message:"Method not found"},[Hm]:{code:-32602,message:"Invalid params"},[eu]:{code:-32603,message:"Internal error"},[sa]:{code:-32e3,message:"Server error"}},tu=sa;function Wm(t){return zm.includes(t)}function ru(t){return Object.keys(di).includes(t)?di[t]:di[tu]}function qm(t){const e=Object.values(di).find(r=>r.code===t);return e||di[tu]}function nu(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var iu={};/*! *****************************************************************************
|
|
59
|
+
***************************************************************************** */var ta=function(t,e){return ta=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},ta(t,e)};function hm(t,e){ta(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ra=function(){return ra=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},ra.apply(this,arguments)};function um(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function dm(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function fm(t,e){return function(r,n){e(r,n,t)}}function pm(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function gm(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(m){o(m)}}function c(p){try{l(n.throw(p))}catch(m){o(m)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function mm(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function wm(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function ym(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function na(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 qh(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function bm(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(qh(arguments[e]));return t}function vm(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function hi(t){return this instanceof hi?(this.v=t,this):new hi(t)}function _m(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(w){n[w]&&(i[w]=function(y){return new Promise(function(E,T){s.push([w,y,E,T])>1||a(w,y)})})}function a(w,y){try{c(n[w](y))}catch(E){m(s[0][3],E)}}function c(w){w.value instanceof hi?Promise.resolve(w.value.v).then(l,p):m(s[0][2],w)}function l(w){a("next",w)}function p(w){a("throw",w)}function m(w,y){w(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Em(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(o){return(r=!r)?{value:hi(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function xm(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 na=="function"?na(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(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Cm(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Im(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Sm(t){return t&&t.__esModule?t:{default:t}}function Dm(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Om(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var $m=Object.freeze({__proto__:null,__extends:hm,get __assign(){return ra},__rest:um,__decorate:dm,__param:fm,__metadata:pm,__awaiter:gm,__generator:mm,__createBinding:wm,__exportStar:ym,__values:na,__read:qh,__spread:bm,__spreadArrays:vm,__await:hi,__asyncGenerator:_m,__asyncDelegator:Em,__asyncValues:xm,__makeTemplateObject:Cm,__importStar:Im,__importDefault:Sm,__classPrivateFieldGet:Dm,__classPrivateFieldSet:Om}),Am=Tr($m),Br={},Vh;function Kh(){return Vh||(Vh=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.PINO_CUSTOM_CONTEXT_KEY=Br.PINO_LOGGER_DEFAULTS=void 0,Br.PINO_LOGGER_DEFAULTS={level:"info"},Br.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Br}var Rt={},Gh;function Pm(){if(Gh)return Rt;Gh=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.generateChildLogger=Rt.formatChildLoggerContext=Rt.getLoggerContext=Rt.setBrowserLoggerContext=Rt.getBrowserLoggerContext=Rt.getDefaultLoggerOptions=void 0;const t=Kh();function e(a){return Object.assign(Object.assign({},a),{level:a?.level||t.PINO_LOGGER_DEFAULTS.level})}Rt.getDefaultLoggerOptions=e;function r(a,c=t.PINO_CUSTOM_CONTEXT_KEY){return a[c]||""}Rt.getBrowserLoggerContext=r;function n(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){return a[l]=c,a}Rt.setBrowserLoggerContext=n;function i(a,c=t.PINO_CUSTOM_CONTEXT_KEY){let l="";return typeof a.bindings>"u"?l=r(a,c):l=a.bindings().context||"",l}Rt.getLoggerContext=i;function s(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=i(a,l);return p.trim()?`${p}/${c}`:c}Rt.formatChildLoggerContext=s;function o(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=s(a,c,l),m=a.child({context:p});return n(m,p,l)}return Rt.generateChildLogger=o,Rt}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=Am,r=e.__importDefault(Xn);Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(Kh(),t),e.__exportStar(Pm(),t)})(Be);class Tm extends jr{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class Rm extends jr{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class Nm{constructor(e,r){this.logger=e,this.core=r}}class Mm extends jr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class Lm extends jr{constructor(e){super()}}class Um{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class jm extends jr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class Fm extends jr{constructor(e,r){super(),this.core=e,this.logger=r}}class Bm{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class km{constructor(e){this.client=e}}const Hm=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),zm=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function ia(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return zm(t)}catch{return t}}function ui(t){return typeof t=="string"?t:Hm(t)||""}var sa={},Zh={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_e,r=kt;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function a(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return a.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},a.prototype.update=function(c,l){if(l===void 0&&(l=c.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var p=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&l>0;)this._buffer[this._bufferLength++]=c[p++],l--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(p=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,p,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[p++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,p=this._bufferLength,m=l/536870912|0,w=l<<3,y=l%128<112?128:256;this._buffer[p]=128;for(var E=p+1;E<y-8;E++)this._buffer[E]=0;e.writeUint32BE(m,this._buffer,y-8),e.writeUint32BE(w,this._buffer,y-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,y),this._finished=!0}for(var E=0;E<this.digestLength/8;E++)e.writeUint32BE(this._stateHi[E],c,E*8),e.writeUint32BE(this._stateLo[E],c,E*8+4);return this},a.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._stateHi.set(c.stateHi),this._stateLo.set(c.stateLo),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.stateHi),r.wipe(c.stateLo),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA512=n;var i=new Int32Array([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]);function s(a,c,l,p,m,w,y){for(var E=l[0],T=l[1],R=l[2],L=l[3],C=l[4],O=l[5],b=l[6],S=l[7],D=p[0],u=p[1],_=p[2],H=p[3],B=p[4],q=p[5],X=p[6],te=p[7],x,$,K,Y,W,z,J,G;y>=128;){for(var ce=0;ce<16;ce++){var Q=8*ce+w;a[ce]=e.readUint32BE(m,Q),c[ce]=e.readUint32BE(m,Q+4)}for(var ce=0;ce<80;ce++){var pe=E,oe=T,Ce=R,F=L,j=C,N=O,f=b,A=S,ee=D,ne=u,Ee=_,Le=H,Pe=B,Ue=q,Ge=X,Ve=te;if(x=S,$=te,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=(C>>>14|B<<32-14)^(C>>>18|B<<32-18)^(B>>>41-32|C<<32-(41-32)),$=(B>>>14|C<<32-14)^(B>>>18|C<<32-18)^(C>>>41-32|B<<32-(41-32)),W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,x=C&O^~C&b,$=B&q^~B&X,W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,x=i[ce*2],$=i[ce*2+1],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,x=a[ce%16],$=c[ce%16],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,K=J&65535|G<<16,Y=W&65535|z<<16,x=K,$=Y,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=(E>>>28|D<<32-28)^(D>>>34-32|E<<32-(34-32))^(D>>>39-32|E<<32-(39-32)),$=(D>>>28|E<<32-28)^(E>>>34-32|D<<32-(34-32))^(E>>>39-32|D<<32-(39-32)),W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,x=E&T^E&R^T&R,$=D&u^D&_^u&_,W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,A=J&65535|G<<16,Ve=W&65535|z<<16,x=F,$=Le,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=K,$=Y,W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,F=J&65535|G<<16,Le=W&65535|z<<16,T=pe,R=oe,L=Ce,C=F,O=j,b=N,S=f,E=A,u=ee,_=ne,H=Ee,B=Le,q=Pe,X=Ue,te=Ge,D=Ve,ce%16===15)for(var Q=0;Q<16;Q++)x=a[Q],$=c[Q],W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=a[(Q+9)%16],$=c[(Q+9)%16],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,K=a[(Q+1)%16],Y=c[(Q+1)%16],x=(K>>>1|Y<<32-1)^(K>>>8|Y<<32-8)^K>>>7,$=(Y>>>1|K<<32-1)^(Y>>>8|K<<32-8)^(Y>>>7|K<<32-7),W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,K=a[(Q+14)%16],Y=c[(Q+14)%16],x=(K>>>19|Y<<32-19)^(Y>>>61-32|K<<32-(61-32))^K>>>6,$=(Y>>>19|K<<32-19)^(K>>>61-32|Y<<32-(61-32))^(Y>>>6|K<<32-6),W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,a[Q]=J&65535|G<<16,c[Q]=W&65535|z<<16}x=E,$=D,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[0],$=p[0],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[0]=E=J&65535|G<<16,p[0]=D=W&65535|z<<16,x=T,$=u,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[1],$=p[1],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[1]=T=J&65535|G<<16,p[1]=u=W&65535|z<<16,x=R,$=_,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[2],$=p[2],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[2]=R=J&65535|G<<16,p[2]=_=W&65535|z<<16,x=L,$=H,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[3],$=p[3],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[3]=L=J&65535|G<<16,p[3]=H=W&65535|z<<16,x=C,$=B,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[4],$=p[4],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[4]=C=J&65535|G<<16,p[4]=B=W&65535|z<<16,x=O,$=q,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[5],$=p[5],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[5]=O=J&65535|G<<16,p[5]=q=W&65535|z<<16,x=b,$=X,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[6],$=p[6],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[6]=b=J&65535|G<<16,p[6]=X=W&65535|z<<16,x=S,$=te,W=$&65535,z=$>>>16,J=x&65535,G=x>>>16,x=l[7],$=p[7],W+=$&65535,z+=$>>>16,J+=x&65535,G+=x>>>16,z+=W>>>16,J+=z>>>16,G+=J>>>16,l[7]=S=J&65535|G<<16,p[7]=te=W&65535|z<<16,w+=128,y-=128}return w}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Zh),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=hn,r=Zh,n=kt;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(F){const j=new Float64Array(16);if(F)for(let N=0;N<F.length;N++)j[N]=F[N];return j}const s=new Uint8Array(32);s[0]=9;const o=i(),a=i([1]),c=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),p=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),w=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function y(F,j){for(let N=0;N<16;N++)F[N]=j[N]|0}function E(F){let j=1;for(let N=0;N<16;N++){let f=F[N]+j+65535;j=Math.floor(f/65536),F[N]=f-j*65536}F[0]+=j-1+37*(j-1)}function T(F,j,N){const f=~(N-1);for(let A=0;A<16;A++){const ee=f&(F[A]^j[A]);F[A]^=ee,j[A]^=ee}}function R(F,j){const N=i(),f=i();for(let A=0;A<16;A++)f[A]=j[A];E(f),E(f),E(f);for(let A=0;A<2;A++){N[0]=f[0]-65517;for(let ne=1;ne<15;ne++)N[ne]=f[ne]-65535-(N[ne-1]>>16&1),N[ne-1]&=65535;N[15]=f[15]-32767-(N[14]>>16&1);const ee=N[15]>>16&1;N[14]&=65535,T(f,N,1-ee)}for(let A=0;A<16;A++)F[2*A]=f[A]&255,F[2*A+1]=f[A]>>8}function L(F,j){let N=0;for(let f=0;f<32;f++)N|=F[f]^j[f];return(1&N-1>>>8)-1}function C(F,j){const N=new Uint8Array(32),f=new Uint8Array(32);return R(N,F),R(f,j),L(N,f)}function O(F){const j=new Uint8Array(32);return R(j,F),j[0]&1}function b(F,j){for(let N=0;N<16;N++)F[N]=j[2*N]+(j[2*N+1]<<8);F[15]&=32767}function S(F,j,N){for(let f=0;f<16;f++)F[f]=j[f]+N[f]}function D(F,j,N){for(let f=0;f<16;f++)F[f]=j[f]-N[f]}function u(F,j,N){let f,A,ee=0,ne=0,Ee=0,Le=0,Pe=0,Ue=0,Ge=0,Ve=0,Te=0,Oe=0,me=0,Ie=0,$e=0,ge=0,xe=0,g=0,h=0,d=0,v=0,P=0,U=0,k=0,se=0,he=0,Ne=0,je=0,Me=0,Wt=0,sn=0,Vi=0,oo=0,rt=N[0],Je=N[1],nt=N[2],it=N[3],st=N[4],Xe=N[5],mt=N[6],wt=N[7],yt=N[8],bt=N[9],vt=N[10],ut=N[11],ot=N[12],Ke=N[13],_t=N[14],Et=N[15];f=j[0],ee+=f*rt,ne+=f*Je,Ee+=f*nt,Le+=f*it,Pe+=f*st,Ue+=f*Xe,Ge+=f*mt,Ve+=f*wt,Te+=f*yt,Oe+=f*bt,me+=f*vt,Ie+=f*ut,$e+=f*ot,ge+=f*Ke,xe+=f*_t,g+=f*Et,f=j[1],ne+=f*rt,Ee+=f*Je,Le+=f*nt,Pe+=f*it,Ue+=f*st,Ge+=f*Xe,Ve+=f*mt,Te+=f*wt,Oe+=f*yt,me+=f*bt,Ie+=f*vt,$e+=f*ut,ge+=f*ot,xe+=f*Ke,g+=f*_t,h+=f*Et,f=j[2],Ee+=f*rt,Le+=f*Je,Pe+=f*nt,Ue+=f*it,Ge+=f*st,Ve+=f*Xe,Te+=f*mt,Oe+=f*wt,me+=f*yt,Ie+=f*bt,$e+=f*vt,ge+=f*ut,xe+=f*ot,g+=f*Ke,h+=f*_t,d+=f*Et,f=j[3],Le+=f*rt,Pe+=f*Je,Ue+=f*nt,Ge+=f*it,Ve+=f*st,Te+=f*Xe,Oe+=f*mt,me+=f*wt,Ie+=f*yt,$e+=f*bt,ge+=f*vt,xe+=f*ut,g+=f*ot,h+=f*Ke,d+=f*_t,v+=f*Et,f=j[4],Pe+=f*rt,Ue+=f*Je,Ge+=f*nt,Ve+=f*it,Te+=f*st,Oe+=f*Xe,me+=f*mt,Ie+=f*wt,$e+=f*yt,ge+=f*bt,xe+=f*vt,g+=f*ut,h+=f*ot,d+=f*Ke,v+=f*_t,P+=f*Et,f=j[5],Ue+=f*rt,Ge+=f*Je,Ve+=f*nt,Te+=f*it,Oe+=f*st,me+=f*Xe,Ie+=f*mt,$e+=f*wt,ge+=f*yt,xe+=f*bt,g+=f*vt,h+=f*ut,d+=f*ot,v+=f*Ke,P+=f*_t,U+=f*Et,f=j[6],Ge+=f*rt,Ve+=f*Je,Te+=f*nt,Oe+=f*it,me+=f*st,Ie+=f*Xe,$e+=f*mt,ge+=f*wt,xe+=f*yt,g+=f*bt,h+=f*vt,d+=f*ut,v+=f*ot,P+=f*Ke,U+=f*_t,k+=f*Et,f=j[7],Ve+=f*rt,Te+=f*Je,Oe+=f*nt,me+=f*it,Ie+=f*st,$e+=f*Xe,ge+=f*mt,xe+=f*wt,g+=f*yt,h+=f*bt,d+=f*vt,v+=f*ut,P+=f*ot,U+=f*Ke,k+=f*_t,se+=f*Et,f=j[8],Te+=f*rt,Oe+=f*Je,me+=f*nt,Ie+=f*it,$e+=f*st,ge+=f*Xe,xe+=f*mt,g+=f*wt,h+=f*yt,d+=f*bt,v+=f*vt,P+=f*ut,U+=f*ot,k+=f*Ke,se+=f*_t,he+=f*Et,f=j[9],Oe+=f*rt,me+=f*Je,Ie+=f*nt,$e+=f*it,ge+=f*st,xe+=f*Xe,g+=f*mt,h+=f*wt,d+=f*yt,v+=f*bt,P+=f*vt,U+=f*ut,k+=f*ot,se+=f*Ke,he+=f*_t,Ne+=f*Et,f=j[10],me+=f*rt,Ie+=f*Je,$e+=f*nt,ge+=f*it,xe+=f*st,g+=f*Xe,h+=f*mt,d+=f*wt,v+=f*yt,P+=f*bt,U+=f*vt,k+=f*ut,se+=f*ot,he+=f*Ke,Ne+=f*_t,je+=f*Et,f=j[11],Ie+=f*rt,$e+=f*Je,ge+=f*nt,xe+=f*it,g+=f*st,h+=f*Xe,d+=f*mt,v+=f*wt,P+=f*yt,U+=f*bt,k+=f*vt,se+=f*ut,he+=f*ot,Ne+=f*Ke,je+=f*_t,Me+=f*Et,f=j[12],$e+=f*rt,ge+=f*Je,xe+=f*nt,g+=f*it,h+=f*st,d+=f*Xe,v+=f*mt,P+=f*wt,U+=f*yt,k+=f*bt,se+=f*vt,he+=f*ut,Ne+=f*ot,je+=f*Ke,Me+=f*_t,Wt+=f*Et,f=j[13],ge+=f*rt,xe+=f*Je,g+=f*nt,h+=f*it,d+=f*st,v+=f*Xe,P+=f*mt,U+=f*wt,k+=f*yt,se+=f*bt,he+=f*vt,Ne+=f*ut,je+=f*ot,Me+=f*Ke,Wt+=f*_t,sn+=f*Et,f=j[14],xe+=f*rt,g+=f*Je,h+=f*nt,d+=f*it,v+=f*st,P+=f*Xe,U+=f*mt,k+=f*wt,se+=f*yt,he+=f*bt,Ne+=f*vt,je+=f*ut,Me+=f*ot,Wt+=f*Ke,sn+=f*_t,Vi+=f*Et,f=j[15],g+=f*rt,h+=f*Je,d+=f*nt,v+=f*it,P+=f*st,U+=f*Xe,k+=f*mt,se+=f*wt,he+=f*yt,Ne+=f*bt,je+=f*vt,Me+=f*ut,Wt+=f*ot,sn+=f*Ke,Vi+=f*_t,oo+=f*Et,ee+=38*h,ne+=38*d,Ee+=38*v,Le+=38*P,Pe+=38*U,Ue+=38*k,Ge+=38*se,Ve+=38*he,Te+=38*Ne,Oe+=38*je,me+=38*Me,Ie+=38*Wt,$e+=38*sn,ge+=38*Vi,xe+=38*oo,A=1,f=ee+A+65535,A=Math.floor(f/65536),ee=f-A*65536,f=ne+A+65535,A=Math.floor(f/65536),ne=f-A*65536,f=Ee+A+65535,A=Math.floor(f/65536),Ee=f-A*65536,f=Le+A+65535,A=Math.floor(f/65536),Le=f-A*65536,f=Pe+A+65535,A=Math.floor(f/65536),Pe=f-A*65536,f=Ue+A+65535,A=Math.floor(f/65536),Ue=f-A*65536,f=Ge+A+65535,A=Math.floor(f/65536),Ge=f-A*65536,f=Ve+A+65535,A=Math.floor(f/65536),Ve=f-A*65536,f=Te+A+65535,A=Math.floor(f/65536),Te=f-A*65536,f=Oe+A+65535,A=Math.floor(f/65536),Oe=f-A*65536,f=me+A+65535,A=Math.floor(f/65536),me=f-A*65536,f=Ie+A+65535,A=Math.floor(f/65536),Ie=f-A*65536,f=$e+A+65535,A=Math.floor(f/65536),$e=f-A*65536,f=ge+A+65535,A=Math.floor(f/65536),ge=f-A*65536,f=xe+A+65535,A=Math.floor(f/65536),xe=f-A*65536,f=g+A+65535,A=Math.floor(f/65536),g=f-A*65536,ee+=A-1+37*(A-1),A=1,f=ee+A+65535,A=Math.floor(f/65536),ee=f-A*65536,f=ne+A+65535,A=Math.floor(f/65536),ne=f-A*65536,f=Ee+A+65535,A=Math.floor(f/65536),Ee=f-A*65536,f=Le+A+65535,A=Math.floor(f/65536),Le=f-A*65536,f=Pe+A+65535,A=Math.floor(f/65536),Pe=f-A*65536,f=Ue+A+65535,A=Math.floor(f/65536),Ue=f-A*65536,f=Ge+A+65535,A=Math.floor(f/65536),Ge=f-A*65536,f=Ve+A+65535,A=Math.floor(f/65536),Ve=f-A*65536,f=Te+A+65535,A=Math.floor(f/65536),Te=f-A*65536,f=Oe+A+65535,A=Math.floor(f/65536),Oe=f-A*65536,f=me+A+65535,A=Math.floor(f/65536),me=f-A*65536,f=Ie+A+65535,A=Math.floor(f/65536),Ie=f-A*65536,f=$e+A+65535,A=Math.floor(f/65536),$e=f-A*65536,f=ge+A+65535,A=Math.floor(f/65536),ge=f-A*65536,f=xe+A+65535,A=Math.floor(f/65536),xe=f-A*65536,f=g+A+65535,A=Math.floor(f/65536),g=f-A*65536,ee+=A-1+37*(A-1),F[0]=ee,F[1]=ne,F[2]=Ee,F[3]=Le,F[4]=Pe,F[5]=Ue,F[6]=Ge,F[7]=Ve,F[8]=Te,F[9]=Oe,F[10]=me,F[11]=Ie,F[12]=$e,F[13]=ge,F[14]=xe,F[15]=g}function _(F,j){u(F,j,j)}function H(F,j){const N=i();let f;for(f=0;f<16;f++)N[f]=j[f];for(f=253;f>=0;f--)_(N,N),f!==2&&f!==4&&u(N,N,j);for(f=0;f<16;f++)F[f]=N[f]}function B(F,j){const N=i();let f;for(f=0;f<16;f++)N[f]=j[f];for(f=250;f>=0;f--)_(N,N),f!==1&&u(N,N,j);for(f=0;f<16;f++)F[f]=N[f]}function q(F,j){const N=i(),f=i(),A=i(),ee=i(),ne=i(),Ee=i(),Le=i(),Pe=i(),Ue=i();D(N,F[1],F[0]),D(Ue,j[1],j[0]),u(N,N,Ue),S(f,F[0],F[1]),S(Ue,j[0],j[1]),u(f,f,Ue),u(A,F[3],j[3]),u(A,A,l),u(ee,F[2],j[2]),S(ee,ee,ee),D(ne,f,N),D(Ee,ee,A),S(Le,ee,A),S(Pe,f,N),u(F[0],ne,Ee),u(F[1],Pe,Le),u(F[2],Le,Ee),u(F[3],ne,Pe)}function X(F,j,N){for(let f=0;f<4;f++)T(F[f],j[f],N)}function te(F,j){const N=i(),f=i(),A=i();H(A,j[2]),u(N,j[0],A),u(f,j[1],A),R(F,f),F[31]^=O(N)<<7}function x(F,j,N){y(F[0],o),y(F[1],a),y(F[2],a),y(F[3],o);for(let f=255;f>=0;--f){const A=N[f/8|0]>>(f&7)&1;X(F,j,A),q(j,F),q(F,F),X(F,j,A)}}function $(F,j){const N=[i(),i(),i(),i()];y(N[0],p),y(N[1],m),y(N[2],a),u(N[3],p,m),x(F,N,j)}function K(F){if(F.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const j=(0,r.hash)(F);j[0]&=248,j[31]&=127,j[31]|=64;const N=new Uint8Array(32),f=[i(),i(),i(),i()];$(f,j),te(N,f);const A=new Uint8Array(64);return A.set(F),A.set(N,32),{publicKey:N,secretKey:A}}t.generateKeyPairFromSeed=K;function Y(F){const j=(0,e.randomBytes)(32,F),N=K(j);return(0,n.wipe)(j),N}t.generateKeyPair=Y;function W(F){if(F.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(F.subarray(32))}t.extractPublicKeyFromSecretKey=W;const z=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function J(F,j){let N,f,A,ee;for(f=63;f>=32;--f){for(N=0,A=f-32,ee=f-12;A<ee;++A)j[A]+=N-16*j[f]*z[A-(f-32)],N=Math.floor((j[A]+128)/256),j[A]-=N*256;j[A]+=N,j[f]=0}for(N=0,A=0;A<32;A++)j[A]+=N-(j[31]>>4)*z[A],N=j[A]>>8,j[A]&=255;for(A=0;A<32;A++)j[A]-=N*z[A];for(f=0;f<32;f++)j[f+1]+=j[f]>>8,F[f]=j[f]&255}function G(F){const j=new Float64Array(64);for(let N=0;N<64;N++)j[N]=F[N];for(let N=0;N<64;N++)F[N]=0;J(F,j)}function ce(F,j){const N=new Float64Array(64),f=[i(),i(),i(),i()],A=(0,r.hash)(F.subarray(0,32));A[0]&=248,A[31]&=127,A[31]|=64;const ee=new Uint8Array(64);ee.set(A.subarray(32),32);const ne=new r.SHA512;ne.update(ee.subarray(32)),ne.update(j);const Ee=ne.digest();ne.clean(),G(Ee),$(f,Ee),te(ee,f),ne.reset(),ne.update(ee.subarray(0,32)),ne.update(F.subarray(32)),ne.update(j);const Le=ne.digest();G(Le);for(let Pe=0;Pe<32;Pe++)N[Pe]=Ee[Pe];for(let Pe=0;Pe<32;Pe++)for(let Ue=0;Ue<32;Ue++)N[Pe+Ue]+=Le[Pe]*A[Ue];return J(ee.subarray(32),N),ee}t.sign=ce;function Q(F,j){const N=i(),f=i(),A=i(),ee=i(),ne=i(),Ee=i(),Le=i();return y(F[2],a),b(F[1],j),_(A,F[1]),u(ee,A,c),D(A,A,F[2]),S(ee,F[2],ee),_(ne,ee),_(Ee,ne),u(Le,Ee,ne),u(N,Le,A),u(N,N,ee),B(N,N),u(N,N,A),u(N,N,ee),u(N,N,ee),u(F[0],N,ee),_(f,F[0]),u(f,f,ee),C(f,A)&&u(F[0],F[0],w),_(f,F[0]),u(f,f,ee),C(f,A)?-1:(O(F[0])===j[31]>>7&&D(F[0],o,F[0]),u(F[3],F[0],F[1]),0)}function pe(F,j,N){const f=new Uint8Array(32),A=[i(),i(),i(),i()],ee=[i(),i(),i(),i()];if(N.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(Q(ee,F))return!1;const ne=new r.SHA512;ne.update(N.subarray(0,32)),ne.update(F),ne.update(j);const Ee=ne.digest();return G(Ee),x(A,ee,Ee),$(ee,N.subarray(32)),q(A,ee),te(f,A),!L(N,f)}t.verify=pe;function oe(F){let j=[i(),i(),i(),i()];if(Q(j,F))throw new Error("Ed25519: invalid public key");let N=i(),f=i(),A=j[1];S(N,a,A),D(f,a,A),H(f,f),u(N,N,f);let ee=new Uint8Array(32);return R(ee,N),ee}t.convertPublicKeyToX25519=oe;function Ce(F){const j=(0,r.hash)(F.subarray(0,32));j[0]&=248,j[31]&=127,j[31]|=64;const N=new Uint8Array(j.subarray(0,32));return(0,n.wipe)(j),N}t.convertSecretKeyToX25519=Ce}(sa);const Wm="EdDSA",qm="JWT",Yh=".",Jh="base64url",Vm="utf8",Km="utf8",Gm=":",Zm="did",Ym="key",Xh="base58btc",Jm="z",Xm="K36",Qm=32;function gs(t){return At(Ut(ui(t),Vm),Jh)}function Qh(t){const e=Ut(Xm,Xh),r=Jm+At(Eo([e,t]),Xh);return[Zm,Ym,r].join(Gm)}function ew(t){return At(t,Jh)}function tw(t){return Ut([gs(t.header),gs(t.payload)].join(Yh),Km)}function rw(t){return[gs(t.header),gs(t.payload),ew(t.signature)].join(Yh)}function eu(t=hn.randomBytes(Qm)){return sa.generateKeyPairFromSeed(t)}async function nw(t,e,r,n,i=fe.fromMiliseconds(Date.now())){const s={alg:Wm,typ:qm},o=Qh(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=tw({header:s,payload:c}),p=sa.sign(n.secretKey,l);return rw({header:s,payload:c,signature:p})}const iw="PARSE_ERROR",sw="INVALID_REQUEST",ow="METHOD_NOT_FOUND",aw="INVALID_PARAMS",tu="INTERNAL_ERROR",oa="SERVER_ERROR",cw=[-32700,-32600,-32601,-32602,-32603],di={[iw]:{code:-32700,message:"Parse error"},[sw]:{code:-32600,message:"Invalid Request"},[ow]:{code:-32601,message:"Method not found"},[aw]:{code:-32602,message:"Invalid params"},[tu]:{code:-32603,message:"Internal error"},[oa]:{code:-32e3,message:"Server error"}},ru=oa;function lw(t){return cw.includes(t)}function nu(t){return Object.keys(di).includes(t)?di[t]:di[ru]}function hw(t){const e=Object.values(di).find(r=>r.code===t);return e||di[ru]}var iu={};/*! *****************************************************************************
|
|
60
60
|
Copyright (c) Microsoft Corporation.
|
|
61
61
|
|
|
62
62
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -69,32 +69,32 @@
|
|
|
69
69
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
70
70
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
71
71
|
PERFORMANCE OF THIS SOFTWARE.
|
|
72
|
-
***************************************************************************** */var oa=function(t,e){return oa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},oa(t,e)};function Vm(t,e){oa(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var aa=function(){return aa=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},aa.apply(this,arguments)};function Km(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Gm(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Zm(t,e){return function(r,n){e(r,n,t)}}function Ym(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Jm(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(m){o(m)}}function c(p){try{l(n.throw(p))}catch(m){o(m)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function Xm(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Qm(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function ew(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ca(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 su(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function tw(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(su(arguments[e]));return t}function rw(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function fi(t){return this instanceof fi?(this.v=t,this):new fi(t)}function nw(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(w){n[w]&&(i[w]=function(y){return new Promise(function(E,T){s.push([w,y,E,T])>1||a(w,y)})})}function a(w,y){try{c(n[w](y))}catch(E){m(s[0][3],E)}}function c(w){w.value instanceof fi?Promise.resolve(w.value.v).then(l,p):m(s[0][2],w)}function l(w){a("next",w)}function p(w){a("throw",w)}function m(w,y){w(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function iw(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(o){return(r=!r)?{value:fi(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function sw(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 ca=="function"?ca(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(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function ow(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function aw(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function cw(t){return t&&t.__esModule?t:{default:t}}function lw(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function hw(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var uw=Object.freeze({__proto__:null,__extends:Vm,get __assign(){return aa},__rest:Km,__decorate:Gm,__param:Zm,__metadata:Ym,__awaiter:Jm,__generator:Xm,__createBinding:Qm,__exportStar:ew,__values:ca,__read:su,__spread:tw,__spreadArrays:rw,__await:fi,__asyncGenerator:nw,__asyncDelegator:iw,__asyncValues:sw,__makeTemplateObject:ow,__importStar:aw,__importDefault:cw,__classPrivateFieldGet:lw,__classPrivateFieldSet:hw}),dw=Tr(uw),dr={},ou;function fw(){if(ou)return dr;ou=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.isBrowserCryptoAvailable=dr.getSubtleCrypto=dr.getBrowerCrypto=void 0;function t(){return dt?.crypto||dt?.msCrypto||{}}dr.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}dr.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return dr.isBrowserCryptoAvailable=r,dr}var fr={},au;function pw(){if(au)return fr;au=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.isBrowser=fr.isNode=fr.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}fr.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}fr.isNode=e;function r(){return!t()&&!e()}return fr.isBrowser=r,fr}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=dw;e.__exportStar(fw(),t),e.__exportStar(pw(),t)})(iu);function gw(){const t=Date.now()*Math.pow(10,3),e=Math.floor(Math.random()*Math.pow(10,3));return t+e}function fs(t,e,r){return{id:r||gw(),jsonrpc:"2.0",method:t,params:e}}function la(t,e){return{id:t,jsonrpc:"2.0",result:e}}function ps(t,e,r){return{id:t,jsonrpc:"2.0",error:mw(e,r)}}function mw(t,e){return typeof t>"u"?ru(eu):(typeof t=="string"&&(t=Object.assign(Object.assign({},ru(sa)),{message:t})),typeof e<"u"&&(t.data=e),Wm(t.code)&&(t=qm(t.code)),t)}class ww{}class yw extends ww{constructor(){super()}}class bw extends yw{constructor(e){super()}}const vw="^https?:",_w="^wss?:";function Ew(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function cu(t,e){const r=Ew(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function lu(t){return cu(t,vw)}function hu(t){return cu(t,_w)}function xw(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function uu(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function ha(t){return uu(t)&&"method"in t}function ua(t){return uu(t)&&(pr(t)||Qt(t))}function pr(t){return"result"in t}function Qt(t){return"error"in t}class Hr extends bw{constructor(e){super(e),this.events=new xt.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(fs(e.method,e.params||[]),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{Qt(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),ua(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const du=10,Cw=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),Iw=()=>typeof window<"u",Sw=Cw();class Dw{constructor(e){if(this.url=e,this.events=new xt.exports.EventEmitter,this.registering=!1,!hu(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ui(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!hu(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=iu.isReactNative()?void 0:{rejectUnauthorized:!xw(e)},s=new Sw(e,[],i);Iw()?s.onerror=o=>{const a=o;n(this.emitError(a.error))}:s.on("error",o=>{n(this.emitError(o))}),s.onopen=()=>{this.onOpen(s),r(s)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?na(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=ps(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return nu(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>du&&this.events.setMaxListeners(du)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for URL: ${this.url}`));return this.events.emit("register_error",r),r}}var da={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",p="[object Boolean]",m="[object Date]",w="[object Error]",y="[object Function]",E="[object GeneratorFunction]",T="[object Map]",N="[object Number]",L="[object Null]",C="[object Object]",D="[object Promise]",b="[object Proxy]",S="[object RegExp]",O="[object Set]",u="[object String]",_="[object Symbol]",H="[object Undefined]",B="[object WeakMap]",q="[object ArrayBuffer]",X="[object DataView]",te="[object Float32Array]",x="[object Float64Array]",$="[object Int8Array]",K="[object Int16Array]",Y="[object Int32Array]",W="[object Uint8Array]",z="[object Uint8ClampedArray]",J="[object Uint16Array]",G="[object Uint32Array]",ce=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,pe=/^(?:0|[1-9]\d*)$/,oe={};oe[te]=oe[x]=oe[$]=oe[K]=oe[Y]=oe[W]=oe[z]=oe[J]=oe[G]=!0,oe[a]=oe[c]=oe[q]=oe[p]=oe[X]=oe[m]=oe[w]=oe[y]=oe[T]=oe[N]=oe[C]=oe[S]=oe[O]=oe[u]=oe[B]=!1;var Ce=typeof dt=="object"&&dt&&dt.Object===Object&&dt,F=typeof self=="object"&&self&&self.Object===Object&&self,j=Ce||F||Function("return this")(),R=e&&!e.nodeType&&e,f=R&&!0&&t&&!t.nodeType&&t,A=f&&f.exports===R,ee=A&&Ce.process,ne=function(){try{return ee&&ee.binding&&ee.binding("util")}catch{}}(),Ee=ne&&ne.isTypedArray;function Le(I,M){for(var Z=-1,ae=I==null?0:I.length,We=0,Se=[];++Z<ae;){var Qe=I[Z];M(Qe,Z,I)&&(Se[We++]=Qe)}return Se}function Pe(I,M){for(var Z=-1,ae=M.length,We=I.length;++Z<ae;)I[We+Z]=M[Z];return I}function Ue(I,M){for(var Z=-1,ae=I==null?0:I.length;++Z<ae;)if(M(I[Z],Z,I))return!0;return!1}function Ge(I,M){for(var Z=-1,ae=Array(I);++Z<I;)ae[Z]=M(Z);return ae}function Ve(I){return function(M){return I(M)}}function Te(I,M){return I.has(M)}function Oe(I,M){return I?.[M]}function me(I){var M=-1,Z=Array(I.size);return I.forEach(function(ae,We){Z[++M]=[We,ae]}),Z}function Ie(I,M){return function(Z){return I(M(Z))}}function $e(I){var M=-1,Z=Array(I.size);return I.forEach(function(ae){Z[++M]=ae}),Z}var ge=Array.prototype,xe=Function.prototype,g=Object.prototype,h=j["__core-js_shared__"],d=xe.toString,v=g.hasOwnProperty,P=function(){var I=/[^.]+$/.exec(h&&h.keys&&h.keys.IE_PROTO||"");return I?"Symbol(src)_1."+I:""}(),U=g.toString,k=RegExp("^"+d.call(v).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),se=A?j.Buffer:void 0,he=j.Symbol,Re=j.Uint8Array,je=g.propertyIsEnumerable,Me=ge.splice,Wt=he?he.toStringTag:void 0,an=Object.getOwnPropertySymbols,Wi=se?se.isBuffer:void 0,io=Ie(Object.keys,Object),rt=zn(j,"DataView"),Je=zn(j,"Map"),nt=zn(j,"Promise"),it=zn(j,"Set"),st=zn(j,"WeakMap"),Xe=zn(Object,"create"),gt=ln(rt),mt=ln(Je),wt=ln(nt),yt=ln(it),bt=ln(st),ut=he?he.prototype:void 0,ot=ut?ut.valueOf:void 0;function Ke(I){var M=-1,Z=I==null?0:I.length;for(this.clear();++M<Z;){var ae=I[M];this.set(ae[0],ae[1])}}function vt(){this.__data__=Xe?Xe(null):{},this.size=0}function _t(I){var M=this.has(I)&&delete this.__data__[I];return this.size-=M?1:0,M}function P7(I){var M=this.__data__;if(Xe){var Z=M[I];return Z===n?void 0:Z}return v.call(M,I)?M[I]:void 0}function T7(I){var M=this.__data__;return Xe?M[I]!==void 0:v.call(M,I)}function N7(I,M){var Z=this.__data__;return this.size+=this.has(I)?0:1,Z[I]=Xe&&M===void 0?n:M,this}Ke.prototype.clear=vt,Ke.prototype.delete=_t,Ke.prototype.get=P7,Ke.prototype.has=T7,Ke.prototype.set=N7;function wr(I){var M=-1,Z=I==null?0:I.length;for(this.clear();++M<Z;){var ae=I[M];this.set(ae[0],ae[1])}}function R7(){this.__data__=[],this.size=0}function M7(I){var M=this.__data__,Z=oo(M,I);if(Z<0)return!1;var ae=M.length-1;return Z==ae?M.pop():Me.call(M,Z,1),--this.size,!0}function L7(I){var M=this.__data__,Z=oo(M,I);return Z<0?void 0:M[Z][1]}function U7(I){return oo(this.__data__,I)>-1}function j7(I,M){var Z=this.__data__,ae=oo(Z,I);return ae<0?(++this.size,Z.push([I,M])):Z[ae][1]=M,this}wr.prototype.clear=R7,wr.prototype.delete=M7,wr.prototype.get=L7,wr.prototype.has=U7,wr.prototype.set=j7;function cn(I){var M=-1,Z=I==null?0:I.length;for(this.clear();++M<Z;){var ae=I[M];this.set(ae[0],ae[1])}}function F7(){this.size=0,this.__data__={hash:new Ke,map:new(Je||wr),string:new Ke}}function B7(I){var M=ao(this,I).delete(I);return this.size-=M?1:0,M}function k7(I){return ao(this,I).get(I)}function H7(I){return ao(this,I).has(I)}function z7(I,M){var Z=ao(this,I),ae=Z.size;return Z.set(I,M),this.size+=Z.size==ae?0:1,this}cn.prototype.clear=F7,cn.prototype.delete=B7,cn.prototype.get=k7,cn.prototype.has=H7,cn.prototype.set=z7;function so(I){var M=-1,Z=I==null?0:I.length;for(this.__data__=new cn;++M<Z;)this.add(I[M])}function W7(I){return this.__data__.set(I,n),this}function q7(I){return this.__data__.has(I)}so.prototype.add=so.prototype.push=W7,so.prototype.has=q7;function $r(I){var M=this.__data__=new wr(I);this.size=M.size}function V7(){this.__data__=new wr,this.size=0}function K7(I){var M=this.__data__,Z=M.delete(I);return this.size=M.size,Z}function G7(I){return this.__data__.get(I)}function Z7(I){return this.__data__.has(I)}function Y7(I,M){var Z=this.__data__;if(Z instanceof wr){var ae=Z.__data__;if(!Je||ae.length<r-1)return ae.push([I,M]),this.size=++Z.size,this;Z=this.__data__=new cn(ae)}return Z.set(I,M),this.size=Z.size,this}$r.prototype.clear=V7,$r.prototype.delete=K7,$r.prototype.get=G7,$r.prototype.has=Z7,$r.prototype.set=Y7;function J7(I,M){var Z=co(I),ae=!Z&&dE(I),We=!Z&&!ae&&Vc(I),Se=!Z&&!ae&&!We&&ef(I),Qe=Z||ae||We||Se,Et=Qe?Ge(I.length,String):[],St=Et.length;for(var Ze in I)(M||v.call(I,Ze))&&!(Qe&&(Ze=="length"||We&&(Ze=="offset"||Ze=="parent")||Se&&(Ze=="buffer"||Ze=="byteLength"||Ze=="byteOffset")||aE(Ze,St)))&&Et.push(Ze);return Et}function oo(I,M){for(var Z=I.length;Z--;)if(Yd(I[Z][0],M))return Z;return-1}function X7(I,M,Z){var ae=M(I);return co(I)?ae:Pe(ae,Z(I))}function qi(I){return I==null?I===void 0?H:L:Wt&&Wt in Object(I)?sE(I):uE(I)}function Vd(I){return Vi(I)&&qi(I)==a}function Kd(I,M,Z,ae,We){return I===M?!0:I==null||M==null||!Vi(I)&&!Vi(M)?I!==I&&M!==M:Q7(I,M,Z,ae,Kd,We)}function Q7(I,M,Z,ae,We,Se){var Qe=co(I),Et=co(M),St=Qe?c:Ar(I),Ze=Et?c:Ar(M);St=St==a?C:St,Ze=Ze==a?C:Ze;var qt=St==C,er=Ze==C,$t=St==Ze;if($t&&Vc(I)){if(!Vc(M))return!1;Qe=!0,qt=!1}if($t&&!qt)return Se||(Se=new $r),Qe||ef(I)?Gd(I,M,Z,ae,We,Se):nE(I,M,St,Z,ae,We,Se);if(!(Z&i)){var Yt=qt&&v.call(I,"__wrapped__"),Jt=er&&v.call(M,"__wrapped__");if(Yt||Jt){var Pr=Yt?I.value():I,yr=Jt?M.value():M;return Se||(Se=new $r),We(Pr,yr,Z,ae,Se)}}return $t?(Se||(Se=new $r),iE(I,M,Z,ae,We,Se)):!1}function eE(I){if(!Qd(I)||lE(I))return!1;var M=Jd(I)?k:Q;return M.test(ln(I))}function tE(I){return Vi(I)&&Xd(I.length)&&!!oe[qi(I)]}function rE(I){if(!hE(I))return io(I);var M=[];for(var Z in Object(I))v.call(I,Z)&&Z!="constructor"&&M.push(Z);return M}function Gd(I,M,Z,ae,We,Se){var Qe=Z&i,Et=I.length,St=M.length;if(Et!=St&&!(Qe&&St>Et))return!1;var Ze=Se.get(I);if(Ze&&Se.get(M))return Ze==M;var qt=-1,er=!0,$t=Z&s?new so:void 0;for(Se.set(I,M),Se.set(M,I);++qt<Et;){var Yt=I[qt],Jt=M[qt];if(ae)var Pr=Qe?ae(Jt,Yt,qt,M,I,Se):ae(Yt,Jt,qt,I,M,Se);if(Pr!==void 0){if(Pr)continue;er=!1;break}if($t){if(!Ue(M,function(yr,hn){if(!Te($t,hn)&&(Yt===yr||We(Yt,yr,Z,ae,Se)))return $t.push(hn)})){er=!1;break}}else if(!(Yt===Jt||We(Yt,Jt,Z,ae,Se))){er=!1;break}}return Se.delete(I),Se.delete(M),er}function nE(I,M,Z,ae,We,Se,Qe){switch(Z){case X:if(I.byteLength!=M.byteLength||I.byteOffset!=M.byteOffset)return!1;I=I.buffer,M=M.buffer;case q:return!(I.byteLength!=M.byteLength||!Se(new Re(I),new Re(M)));case p:case m:case N:return Yd(+I,+M);case w:return I.name==M.name&&I.message==M.message;case S:case u:return I==M+"";case T:var Et=me;case O:var St=ae&i;if(Et||(Et=$e),I.size!=M.size&&!St)return!1;var Ze=Qe.get(I);if(Ze)return Ze==M;ae|=s,Qe.set(I,M);var qt=Gd(Et(I),Et(M),ae,We,Se,Qe);return Qe.delete(I),qt;case _:if(ot)return ot.call(I)==ot.call(M)}return!1}function iE(I,M,Z,ae,We,Se){var Qe=Z&i,Et=Zd(I),St=Et.length,Ze=Zd(M),qt=Ze.length;if(St!=qt&&!Qe)return!1;for(var er=St;er--;){var $t=Et[er];if(!(Qe?$t in M:v.call(M,$t)))return!1}var Yt=Se.get(I);if(Yt&&Se.get(M))return Yt==M;var Jt=!0;Se.set(I,M),Se.set(M,I);for(var Pr=Qe;++er<St;){$t=Et[er];var yr=I[$t],hn=M[$t];if(ae)var tf=Qe?ae(hn,yr,$t,M,I,Se):ae(yr,hn,$t,I,M,Se);if(!(tf===void 0?yr===hn||We(yr,hn,Z,ae,Se):tf)){Jt=!1;break}Pr||(Pr=$t=="constructor")}if(Jt&&!Pr){var lo=I.constructor,ho=M.constructor;lo!=ho&&"constructor"in I&&"constructor"in M&&!(typeof lo=="function"&&lo instanceof lo&&typeof ho=="function"&&ho instanceof ho)&&(Jt=!1)}return Se.delete(I),Se.delete(M),Jt}function Zd(I){return X7(I,gE,oE)}function ao(I,M){var Z=I.__data__;return cE(M)?Z[typeof M=="string"?"string":"hash"]:Z.map}function zn(I,M){var Z=Oe(I,M);return eE(Z)?Z:void 0}function sE(I){var M=v.call(I,Wt),Z=I[Wt];try{I[Wt]=void 0;var ae=!0}catch{}var We=U.call(I);return ae&&(M?I[Wt]=Z:delete I[Wt]),We}var oE=an?function(I){return I==null?[]:(I=Object(I),Le(an(I),function(M){return je.call(I,M)}))}:mE,Ar=qi;(rt&&Ar(new rt(new ArrayBuffer(1)))!=X||Je&&Ar(new Je)!=T||nt&&Ar(nt.resolve())!=D||it&&Ar(new it)!=O||st&&Ar(new st)!=B)&&(Ar=function(I){var M=qi(I),Z=M==C?I.constructor:void 0,ae=Z?ln(Z):"";if(ae)switch(ae){case gt:return X;case mt:return T;case wt:return D;case yt:return O;case bt:return B}return M});function aE(I,M){return M=M??o,!!M&&(typeof I=="number"||pe.test(I))&&I>-1&&I%1==0&&I<M}function cE(I){var M=typeof I;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?I!=="__proto__":I===null}function lE(I){return!!P&&P in I}function hE(I){var M=I&&I.constructor,Z=typeof M=="function"&&M.prototype||g;return I===Z}function uE(I){return U.call(I)}function ln(I){if(I!=null){try{return d.call(I)}catch{}try{return I+""}catch{}}return""}function Yd(I,M){return I===M||I!==I&&M!==M}var dE=Vd(function(){return arguments}())?Vd:function(I){return Vi(I)&&v.call(I,"callee")&&!je.call(I,"callee")},co=Array.isArray;function fE(I){return I!=null&&Xd(I.length)&&!Jd(I)}var Vc=Wi||wE;function pE(I,M){return Kd(I,M)}function Jd(I){if(!Qd(I))return!1;var M=qi(I);return M==y||M==E||M==l||M==b}function Xd(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=o}function Qd(I){var M=typeof I;return I!=null&&(M=="object"||M=="function")}function Vi(I){return I!=null&&typeof I=="object"}var ef=Ee?Ve(Ee):tE;function gE(I){return fE(I)?J7(I):rE(I)}function mE(){return[]}function wE(){return!1}t.exports=pE})(da,da.exports);var Ow=da.exports,$w=Object.defineProperty,fu=Object.getOwnPropertySymbols,Aw=Object.prototype.hasOwnProperty,Pw=Object.prototype.propertyIsEnumerable,pu=(t,e,r)=>e in t?$w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Tt=(t,e)=>{for(var r in e||(e={}))Aw.call(e,r)&&pu(t,r,e[r]);if(fu)for(var r of fu(e))Pw.call(e,r)&&pu(t,r,e[r]);return t};function Tw(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function m(E){if(E instanceof Uint8Array||(ArrayBuffer.isView(E)?E=new Uint8Array(E.buffer,E.byteOffset,E.byteLength):Array.isArray(E)&&(E=Uint8Array.from(E))),!(E instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(E.length===0)return"";for(var T=0,N=0,L=0,C=E.length;L!==C&&E[L]===0;)L++,T++;for(var D=(C-L)*p+1>>>0,b=new Uint8Array(D);L!==C;){for(var S=E[L],O=0,u=D-1;(S!==0||O<N)&&u!==-1;u--,O++)S+=256*b[u]>>>0,b[u]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");N=O,L++}for(var _=D-N;_!==D&&b[_]===0;)_++;for(var H=c.repeat(T);_<D;++_)H+=t.charAt(b[_]);return H}function w(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return new Uint8Array;var T=0;if(E[T]!==" "){for(var N=0,L=0;E[T]===c;)N++,T++;for(var C=(E.length-T)*l+1>>>0,D=new Uint8Array(C);E[T];){var b=r[E.charCodeAt(T)];if(b===255)return;for(var S=0,O=C-1;(b!==0||S<L)&&O!==-1;O--,S++)b+=a*D[O]>>>0,D[O]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");L=S,T++}if(E[T]!==" "){for(var u=C-L;u!==C&&D[u]===0;)u++;for(var _=new Uint8Array(N+(C-u)),H=N;u!==C;)_[H++]=D[u++];return _}}}function y(E){var T=w(E);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:m,decodeUnsafe:w,decode:y}}var Nw=Tw,Rw=Nw;const gu=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Mw=t=>new TextEncoder().encode(t),Lw=t=>new TextDecoder().decode(t);class Uw{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class jw{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return mu(this,e)}}class Fw{constructor(e){this.decoders=e}or(e){return mu(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const mu=(t,e)=>new Fw(Tt(Tt({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class Bw{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Uw(e,r,n),this.decoder=new jw(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const gs=({name:t,prefix:e,encode:r,decode:n})=>new Bw(t,e,r,n),pi=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Rw(r,e);return gs({prefix:t,name:e,encode:n,decode:s=>gu(i(s))})},kw=(t,e,r,n)=>{const i={};for(let p=0;p<e.length;++p)i[e[p]]=p;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let p=0;p<s;++p){const m=i[t[p]];if(m===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|m,a+=r,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Hw=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},It=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>gs({prefix:e,name:t,encode(i){return Hw(i,n,r)},decode(i){return kw(i,n,r,t)}}),zw=gs({prefix:"\0",name:"identity",encode:t=>Lw(t),decode:t=>Mw(t)});var Ww=Object.freeze({__proto__:null,identity:zw});const qw=It({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Vw=Object.freeze({__proto__:null,base2:qw});const Kw=It({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Gw=Object.freeze({__proto__:null,base8:Kw});const Zw=pi({prefix:"9",name:"base10",alphabet:"0123456789"});var Yw=Object.freeze({__proto__:null,base10:Zw});const Jw=It({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Xw=It({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Qw=Object.freeze({__proto__:null,base16:Jw,base16upper:Xw});const e5=It({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),t5=It({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),r5=It({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),n5=It({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),i5=It({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),s5=It({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),o5=It({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),a5=It({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),c5=It({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var l5=Object.freeze({__proto__:null,base32:e5,base32upper:t5,base32pad:r5,base32padupper:n5,base32hex:i5,base32hexupper:s5,base32hexpad:o5,base32hexpadupper:a5,base32z:c5});const h5=pi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),u5=pi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var d5=Object.freeze({__proto__:null,base36:h5,base36upper:u5});const f5=pi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),p5=pi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var g5=Object.freeze({__proto__:null,base58btc:f5,base58flickr:p5});const m5=It({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),w5=It({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),y5=It({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),b5=It({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var v5=Object.freeze({__proto__:null,base64:m5,base64pad:w5,base64url:y5,base64urlpad:b5});const wu=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),_5=wu.reduce((t,e,r)=>(t[r]=e,t),[]),E5=wu.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function x5(t){return t.reduce((e,r)=>(e+=_5[r],e),"")}function C5(t){const e=[];for(const r of t){const n=E5[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const I5=gs({prefix:"\u{1F680}",name:"base256emoji",encode:x5,decode:C5});var S5=Object.freeze({__proto__:null,base256emoji:I5}),D5=bu,yu=128,O5=127,$5=~O5,A5=Math.pow(2,31);function bu(t,e,r){e=e||[],r=r||0;for(var n=r;t>=A5;)e[r++]=t&255|yu,t/=128;for(;t&$5;)e[r++]=t&255|yu,t>>>=7;return e[r]=t|0,bu.bytes=r-n+1,e}var P5=fa,T5=128,vu=127;function fa(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw fa.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&vu)<<i:(o&vu)*Math.pow(2,i),i+=7}while(o>=T5);return fa.bytes=s-n,r}var N5=Math.pow(2,7),R5=Math.pow(2,14),M5=Math.pow(2,21),L5=Math.pow(2,28),U5=Math.pow(2,35),j5=Math.pow(2,42),F5=Math.pow(2,49),B5=Math.pow(2,56),k5=Math.pow(2,63),H5=function(t){return t<N5?1:t<R5?2:t<M5?3:t<L5?4:t<U5?5:t<j5?6:t<F5?7:t<B5?8:t<k5?9:10},z5={encode:D5,decode:P5,encodingLength:H5},_u=z5;const Eu=(t,e,r=0)=>(_u.encode(t,e,r),e),xu=t=>_u.encodingLength(t),pa=(t,e)=>{const r=e.byteLength,n=xu(t),i=n+xu(r),s=new Uint8Array(i+r);return Eu(t,s,0),Eu(r,s,n),s.set(e,i),new W5(t,r,e,s)};class W5{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Cu=({name:t,code:e,encode:r})=>new q5(t,e,r);class q5{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?pa(this.code,r):r.then(n=>pa(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Iu=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),V5=Cu({name:"sha2-256",code:18,encode:Iu("SHA-256")}),K5=Cu({name:"sha2-512",code:19,encode:Iu("SHA-512")});var G5=Object.freeze({__proto__:null,sha256:V5,sha512:K5});const Su=0,Z5="identity",Du=gu;var Y5=Object.freeze({__proto__:null,identity:{code:Su,name:Z5,encode:Du,digest:t=>pa(Su,Du(t))}});new TextEncoder,new TextDecoder;const Ou=Tt(Tt(Tt(Tt(Tt(Tt(Tt(Tt(Tt(Tt({},Ww),Vw),Gw),Yw),Qw),l5),d5),g5),v5),S5);Tt(Tt({},G5),Y5);function J5(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function $u(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Au=$u("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),ga=$u("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=J5(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),X5=Tt({utf8:Au,"utf-8":Au,hex:Ou.base16,latin1:ga,ascii:ga,binary:ga},Ou);function Q5(t,e="utf8"){const r=X5[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}const Pu="wc",ey=2,ma="core",_r=`${Pu}@${2}:${ma}:`,ty={name:ma,logger:"error"},ry={database:":memory:"},ny="crypto",Tu="client_ed25519_seed",iy=fe.ONE_DAY,sy="keychain",oy="0.3",ay="messages",cy="0.3",ly=fe.SIX_HOURS,hy="publisher",Nu="irn",uy="error",Ru="wss://relay.walletconnect.com",dy="relayer",pt={message:"relayer_message",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},fy="_subscription",ms={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},py=fe.ONE_SECOND,gy="2.5.2",my="0.3",ir={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},wy="subscription",yy="0.3",by=fe.FIVE_SECONDS*1e3,vy="pairing",_y="0.3",gi={wc_pairingDelete:{req:{ttl:fe.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:fe.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:fe.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:fe.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:fe.ONE_DAY,prompt:!1,tag:0},res:{ttl:fe.ONE_DAY,prompt:!1,tag:0}}},sr={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Ey="history",xy="0.3",Cy="expirer",Vt={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},Iy="0.3";class Sy{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=sy,this.version=oy,this.initialized=!1,this.storagePrefix=_r,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=ie("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=Be.generateChildLogger(r,this.name)}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,fh(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?ph(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Dy{constructor(e,r,n){this.core=e,this.logger=r,this.name=ny,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),s=Qh(i);return Xh(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=Sg();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=Qh(s),a=jo();return await jm(a,i,iy,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=Dg(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||Og(i);return await this.keychain.set(o,i),o},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,s,o)=>{this.isInitialized();const a=ah(o),c=ui(s);if(ch(a)){const w=a.senderPublicKey,y=a.receiverPublicKey;i=await this.generateSharedKey(w,y)}const l=this.getSymKey(i),{type:p,senderPublicKey:m}=a;return Ag({type:p,symKey:l,message:c,senderPublicKey:m})},this.decode=async(i,s,o)=>{this.isInitialized();const a=Ng(s,o);if(ch(a)){const p=a.receiverPublicKey,m=a.senderPublicKey;i=await this.generateSharedKey(p,m)}const c=this.getSymKey(i),l=Pg({symKey:c,encoded:s});return na(l)},this.core=e,this.logger=Be.generateChildLogger(r,this.name),this.keychain=n||new Sy(this.core,this.logger)}get context(){return Be.getLoggerContext(this.logger)}getPayloadType(e){const r=Fo(e);return Yn(r.type)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Tu)}catch{e=jo(),await this.keychain.set(Tu,e)}return Q5(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Oy extends wm{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=ay,this.version=cy,this.initialized=!1,this.storagePrefix=_r,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const s=is(i);let o=this.messages.get(n);return typeof o>"u"&&(o={}),typeof o[s]<"u"||(o[s]=i,this.messages.set(n,o),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),o=is(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=Be.generateChildLogger(e,this.name),this.core=r}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,fh(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?ph(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}class $y extends ym{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new xt.exports.EventEmitter,this.name=hy,this.queue=new Map,this.publishTimeout=1e4,this.publish=async(n,i,s)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});try{const o=s?.ttl||ly,a=Bo(s),c=s?.prompt||!1,l=s?.tag||0,p={topic:n,message:i,opts:{ttl:o,relay:a,prompt:c,tag:l}},m=is(i);this.queue.set(m,p);try{await await ss(this.rpcPublish(n,i,o,a,c,l),this.publishTimeout),this.relayer.events.emit(pt.publish,p)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(pt.connection_stalled);return}this.onPublish(m,p),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}})}catch(o){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(o),o}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=Be.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return Be.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,s,o){var a,c,l,p;const m={method:os(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o}};return At((a=m.params)==null?void 0:a.prompt)&&((c=m.params)==null||delete c.prompt),At((l=m.params)==null?void 0:l.tag)&&((p=m.params)==null||delete p.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:m}),this.relayer.request(m)}onPublish(e,r){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(oi.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()})}}class Ay{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var Py=Object.defineProperty,Ty=Object.defineProperties,Ny=Object.getOwnPropertyDescriptors,Mu=Object.getOwnPropertySymbols,Ry=Object.prototype.hasOwnProperty,My=Object.prototype.propertyIsEnumerable,Lu=(t,e,r)=>e in t?Py(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mi=(t,e)=>{for(var r in e||(e={}))Ry.call(e,r)&&Lu(t,r,e[r]);if(Mu)for(var r of Mu(e))My.call(e,r)&&Lu(t,r,e[r]);return t},wa=(t,e)=>Ty(t,Ny(e));class Ly extends _m{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new Ay,this.events=new xt.exports.EventEmitter,this.name=wy,this.version=yy,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=_r,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=Bo(i),o={topic:n,relay:s};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s);return this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,s)=>{const o=new fe.Watch;o.start(this.pendingSubscriptionWatchLabel);const a=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),i(!0)),o.elapsed(this.pendingSubscriptionWatchLabel)>=by&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),s(!1))},this.pollingInterval)}),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Be.generateChildLogger(r,this.name),this.clientId=""}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=Bo(n);await this.rpcUnsubscribe(e,r,i);const s=tt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:os(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await ss(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(pt.connection_stalled)}return is(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:os(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await ss(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(pt.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:os(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,wa(mi({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,mi({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,mi({},r)),this.topicMap.set(r.topic,e),this.events.emit(ir.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=ie("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(ir.deleted,wa(mi({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(ir.sync)}async reset(){if(!this.cached.length)return;const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}this.events.emit(ir.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=ie("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);ur(r)&&this.onBatchSubscribe(r.map((n,i)=>wa(mi({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(oi.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(pt.connect,async()=>{await this.onConnect()}),this.relayer.on(pt.disconnect,()=>{this.onDisconnect()}),this.events.on(ir.created,async e=>{const r=ir.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(ir.deleted,async e=>{const r=ir.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var Uy=Object.defineProperty,Uu=Object.getOwnPropertySymbols,jy=Object.prototype.hasOwnProperty,Fy=Object.prototype.propertyIsEnumerable,ju=(t,e,r)=>e in t?Uy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,By=(t,e)=>{for(var r in e||(e={}))jy.call(e,r)&&ju(t,r,e[r]);if(Uu)for(var r of Uu(e))Fy.call(e,r)&&ju(t,r,e[r]);return t};class ky extends bm{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new xt.exports.EventEmitter,this.name=dy,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Be.generateChildLogger(e.logger,this.name):Xn(Be.getDefaultLoggerOptions({level:e.logger||uy})),this.messages=new Oy(this.logger,e.core),this.subscriber=new Ly(this,this.logger),this.publisher=new $y(this,this.logger),this.relayUrl=e?.relayUrl||Ru,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0}get context(){return Be.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){this.isInitialized();let n="";return await Promise.all([new Promise(i=>{this.subscriber.once(ir.created,s=>{s.topic===e&&i()})}),new Promise(async i=>{n=await this.subscriber.subscribe(e,r),i()})]),n}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(pt.transport_closed))}async transportOpen(e){if(!this.reconnecting){this.relayUrl=e||this.relayUrl,this.transportExplicitlyClosed=!1,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(ir.resubscribed,()=>{r()})}),await Promise.race([new Promise(async(r,n)=>{await ss(this.provider.connect(),5e3,"socket stalled").catch(i=>n(i)).then(()=>r()).finally(()=>this.removeListener(pt.transport_closed,this.rejectTransportOpen))}),new Promise(r=>this.once(pt.transport_closed,this.rejectTransportOpen))])])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.events.emit(pt.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}rejectTransportOpen(){throw new Error("closeTransport called before connection was established")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Hr(new Dw(Kg({sdkVersion:gy,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;return await this.subscriber.isSubscribed(r)?this.messages.has(r,n):!0}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),ha(e)){if(!e.method.endsWith(fy))return;const r=e.params,{topic:n,message:i,publishedAt:s}=r.data,o={topic:n,message:i,publishedAt:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(By({type:"event",event:r.id},o)),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(pt.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=la(e.id,!0);await this.provider.connection.send(r)}registerProviderListeners(){this.provider.on(ms.payload,e=>this.onProviderPayload(e)),this.provider.on(ms.connect,()=>{this.events.emit(pt.connect)}),this.provider.on(ms.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(ms.error,e=>{this.logger.error(e),this.events.emit(pt.error,e)})}registerEventListeners(){this.events.on(pt.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(pt.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},fe.toMiliseconds(py))}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var Hy=Object.defineProperty,Fu=Object.getOwnPropertySymbols,zy=Object.prototype.hasOwnProperty,Wy=Object.prototype.propertyIsEnumerable,Bu=(t,e,r)=>e in t?Hy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ku=(t,e)=>{for(var r in e||(e={}))zy.call(e,r)&&Bu(t,r,e[r]);if(Fu)for(var r of Fu(e))Wy.call(e,r)&&Bu(t,r,e[r]);return t};class ws extends vm{constructor(e,r,n,i=_r,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=my,this.cached=[],this.initialized=!1,this.storagePrefix=_r,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!At(o)?this.map.set(this.getKey(o),o):p3(o)?this.map.set(o.id,o):g3(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)},this.set=async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())},this.get=o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>Ow(a[c],o[c]))):this.values),this.update=async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=ku(ku({},this.getData(o)),a);this.map.set(o,c),await this.persist()},this.delete=async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),await this.persist())},this.logger=Be.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=ie("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=ie("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}class qy{constructor(e,r){this.core=e,this.logger=r,this.name=vy,this.version=_y,this.events=new xt.exports,this.initialized=!1,this.storagePrefix=_r,this.ignoredPayloadTypes=[Lr],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=jo(),i=await this.core.crypto.setSymKey(n),s=rr(fe.FIVE_MINUTES),o={protocol:Nu},a={topic:i,expiry:s,relay:o,active:!1},c=i3({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:o});return await this.pairings.set(i,a),await this.core.relayer.subscribe(i),this.core.expirer.set(i,s),{topic:i,uri:c}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:s,relay:o}=r3(n.uri);if(this.pairings.keys.includes(i))throw new Error(`Pairing already exists: ${i}`);if(this.core.crypto.hasKeys(i))throw new Error(`Keychain already exists: ${i}`);const a=rr(fe.FIVE_MINUTES),c={topic:i,relay:o,expiry:a,active:!1};return await this.pairings.set(i,c),await this.core.crypto.setSymKey(s,i),await this.core.relayer.subscribe(i,{relay:o}),this.core.expirer.set(i,a),n.activatePairing&&await this.activate({topic:i}),c},this.activate=async({topic:n})=>{this.isInitialized();const i=rr(fe.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=jr();this.events.once(et("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",tt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const o=fs(i,s),a=await this.core.crypto.encode(n,o),c=gi[i].req;return this.core.history.set(n,o),await this.core.relayer.publish(n,a,c),o.id},this.sendResult=async(n,i,s)=>{const o=la(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=gi[c.request.method].res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.sendError=async(n,i,s)=>{const o=ps(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=gi[c.request.method]?gi[c.request.method].res:gi.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,tt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>vr(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n,o=s.method;if(this.pairings.keys.includes(i))switch(o){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,o=(await this.core.history.get(i,s.id)).request.method;if(this.pairings.keys.includes(i))switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit("pairing_ping",{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{pr(i)?this.events.emit(et("pairing_ping",s),{}):Qt(i)&&this.events.emit(et("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=tt("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(tt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!jt(n)){const{message:i}=ie("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!f3(n.uri)){const{message:i}=ie("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!jt(n)){const{message:s}=ie("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!jt(n)){const{message:s}=ie("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ft(n,!1)){const{message:i}=ie("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=ie("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(vr(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=ie("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=Be.generateChildLogger(r,this.name),this.pairings=new ws(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Be.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(pt.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);ha(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):ua(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(Vt.expired,async e=>{const{topic:r}=mh(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class Vy extends mm{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new xt.exports.EventEmitter,this.name=Ey,this.version=xy,this.cached=[],this.initialized=!1,this.storagePrefix=_r,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s};this.records.set(o.id,o),this.events.emit(sr.created,o)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=Qt(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(sr.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(sr.deleted,s)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=Be.generateChildLogger(r,this.name)}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:fs(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=ie("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(sr.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=ie("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(sr.created,e=>{const r=sr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(sr.updated,e=>{const r=sr.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(sr.deleted,e=>{const r=sr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Ky extends Em{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new xt.exports.EventEmitter,this.name=Cy,this.version=Iy,this.cached=[],this.initialized=!1,this.storagePrefix=_r,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Vt.created,{target:s,expiration:o})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Vt.deleted,{target:i,expiration:s})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=Be.generateChildLogger(r,this.name)}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return Gg(e);if(typeof e=="number")return Zg(e);const{message:r}=ie("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Vt.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=ie("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=ie("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;fe.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Vt.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(oi.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Vt.created,e=>{const r=Vt.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Vt.expired,e=>{const r=Vt.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Vt.deleted,e=>{const r=Vt.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Gy=Object.defineProperty,Hu=Object.getOwnPropertySymbols,Zy=Object.prototype.hasOwnProperty,Yy=Object.prototype.propertyIsEnumerable,zu=(t,e,r)=>e in t?Gy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wu=(t,e)=>{for(var r in e||(e={}))Zy.call(e,r)&&zu(t,r,e[r]);if(Hu)for(var r of Hu(e))Yy.call(e,r)&&zu(t,r,e[r]);return t};class ya extends gm{constructor(e){super(e),this.protocol=Pu,this.version=ey,this.name=ma,this.events=new xt.exports.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||Ru;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xn(Be.getDefaultLoggerOptions({level:e?.logger||ty.logger}));this.logger=Be.generateChildLogger(r,this.name),this.heartbeat=new oi.HeartBeat,this.crypto=new Dy(this,this.logger,e?.keychain),this.history=new Vy(this,this.logger),this.expirer=new Ky(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new _2(Wu(Wu({},ry),e?.storageOptions)),this.relayer=new ky({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new qy(this,this.logger)}static async init(e){const r=new ya(e);return await r.initialize(),r}get context(){return Be.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const Jy=ya,qu="wc",Vu=2,Ku="client",ba=`${qu}@${Vu}:${Ku}:`,va={name:Ku,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Xy="proposal",Gu="Proposal expired",Qy="session",ys=fe.SEVEN_DAYS,eb="engine",wi={wc_sessionPropose:{req:{ttl:fe.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:fe.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:fe.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:fe.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:fe.ONE_DAY,prompt:!1,tag:1104},res:{ttl:fe.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:fe.ONE_DAY,prompt:!1,tag:1106},res:{ttl:fe.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:fe.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:fe.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:fe.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:fe.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:fe.ONE_DAY,prompt:!1,tag:1112},res:{ttl:fe.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:fe.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:fe.THIRTY_SECONDS,prompt:!1,tag:1115}}},_a={min:fe.FIVE_MINUTES,max:fe.SEVEN_DAYS},tb="request";var rb=Object.defineProperty,nb=Object.defineProperties,ib=Object.getOwnPropertyDescriptors,Zu=Object.getOwnPropertySymbols,sb=Object.prototype.hasOwnProperty,ob=Object.prototype.propertyIsEnumerable,Yu=(t,e,r)=>e in t?rb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kt=(t,e)=>{for(var r in e||(e={}))sb.call(e,r)&&Yu(t,r,e[r]);if(Zu)for(var r of Zu(e))ob.call(e,r)&&Yu(t,r,e[r]);return t},Ea=(t,e)=>nb(t,ib(e));class ab extends Cm{constructor(e){super(e),this.name=eb,this.events=new xt.exports,this.initialized=!1,this.ignoredPayloadTypes=[Lr],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(wi)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized();const n=Ea(Kt({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:c}=n;let l=i,p,m=!1;if(l&&(m=this.client.core.pairing.pairings.get(l).active),!l||!m){const{topic:D,uri:b}=await this.client.core.pairing.create();l=D,p=b}const w=await this.client.core.crypto.generateKeyPair(),y=Kt({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:Nu}],proposer:{publicKey:w,metadata:this.client.metadata}},a&&{sessionProperties:a}),{reject:E,resolve:T,done:N}=jr(fe.FIVE_MINUTES,Gu);if(this.events.once(et("session_connect"),async({error:D,session:b})=>{if(D)E(D);else if(b){b.self.publicKey=w;const S=Ea(Kt({},b),{requiredNamespaces:b.requiredNamespaces,optionalNamespaces:b.optionalNamespaces});await this.client.session.set(b.topic,S),await this.setExpiry(b.topic,b.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:b.peer.metadata}),T(S)}}),!l){const{message:D}=ie("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(D)}const L=await this.sendRequest(l,"wc_sessionPropose",y),C=rr(fe.FIVE_MINUTES);return await this.setProposal(L,Kt({id:L,expiry:C},y)),{uri:p,approval:N}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:s,sessionProperties:o}=r,a=this.client.proposal.get(n);let{pairingTopic:c,proposer:l,requiredNamespaces:p,optionalNamespaces:m}=a;mn(p)||(p=c3(s,"approve()"));const w=await this.client.core.crypto.generateKeyPair(),y=l.publicKey,E=await this.client.core.crypto.generateSharedKey(w,y);c&&n&&(await this.client.core.pairing.updateMetadata({topic:c,metadata:l.metadata}),await this.sendResult(n,c,{relay:{protocol:i??"irn"},responderPublicKey:w}),await this.client.proposal.delete(n,tt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:c}));const T=Kt({relay:{protocol:i??"irn"},namespaces:s,requiredNamespaces:p,optionalNamespaces:m,controller:{publicKey:w,metadata:this.client.metadata},expiry:rr(ys)},o&&{sessionProperties:o});await this.client.core.relayer.subscribe(E);const N=await this.sendRequest(E,"wc_sessionSettle",T),{done:L,resolve:C,reject:D}=jr();this.events.once(et("session_approve",N),({error:S})=>{S?D(S):C(this.client.session.get(E))});const b=Ea(Kt({},T),{topic:E,acknowledged:!1,self:T.controller,peer:{publicKey:l.publicKey,metadata:l.metadata},controller:w});return await this.client.session.set(E,b),await this.setExpiry(E,rr(ys)),{topic:E,acknowledged:L}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:s}=this.client.proposal.get(n);s&&(await this.sendError(n,s,i),await this.client.proposal.delete(n,tt("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,s=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:o,resolve:a,reject:c}=jr();return this.events.once(et("session_update",s),({error:l})=>{l?c(l):a()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:o}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:s,resolve:o,reject:a}=jr();return this.events.once(et("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,rr(ys)),{acknowledged:s}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:s,expiry:o}=r,a=await this.sendRequest(s,"wc_sessionRequest",{request:i,chainId:n},o),{done:c,resolve:l,reject:p}=jr(o);return this.events.once(et("session_request",a),({error:m,result:w})=>{m?p(m):l(w)}),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:a}),await c()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i;pr(i)?await this.sendResult(s,n,i.result):Qt(i)&&await this.sendError(s,n,i.error),this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0})},this.ping=async r=>{this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest(n,"wc_sessionPing",{}),{done:s,resolve:o,reject:a}=jr();this.events.once(et("session_ping",i),({error:c})=>{c?a(c):o()}),await s()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:s})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest(n,"wc_sessionDelete",tt("USER_DISCONNECTED")),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>u3(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await Promise.all([this.client.session.delete(r,tt("USER_DISCONNECTED")),this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.deleteSymKey(r),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,tt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=wi.wc_sessionRequest.req.ttl,{id:i,topic:s,params:o}=r;await this.client.pendingRequest.set(i,{id:i,topic:s,params:o}),n&&this.client.core.expirer.set(i,rr(n))},this.sendRequest=async(r,n,i,s)=>{const o=fs(n,i),a=await this.client.core.crypto.encode(r,o),c=wi[n].req;return s&&(c.ttl=s),this.client.core.history.set(r,o),this.client.core.relayer.publish(r,a,c),o.id},this.sendResult=async(r,n,i)=>{const s=la(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=wi[a.request.method].res;this.client.core.relayer.publish(n,o,c),await this.client.core.history.resolve(s)},this.sendError=async(r,n,i)=>{const s=ps(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=wi[a.request.method].res;this.client.core.relayer.publish(n,o,c),await this.client.core.history.resolve(s)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{vr(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{vr(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=r=>{const{topic:n,payload:i}=r,s=i.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${s}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,s=(await this.client.core.history.get(n,i.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidConnect(Kt({},n.params));const o=rr(fe.FIVE_MINUTES),a=Kt({id:s,pairingTopic:r,expiry:o},i);await this.setProposal(s,a),this.client.events.emit("session_proposal",{id:s,params:a})}catch(o){await this.sendError(s,r,o),this.client.logger.error(o)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(pr(n)){const{result:s}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const o=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});const a=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:a});const c=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const l=await this.client.core.crypto.generateSharedKey(a,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:l});const p=await this.client.core.relayer.subscribe(l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:p}),await this.client.core.pairing.activate({topic:r})}else Qt(n)&&(await this.client.proposal.delete(i,tt("USER_DISCONNECTED")),this.events.emit(et("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,requiredNamespaces:p,optionalNamespaces:m,sessionProperties:w}=n.params,y=Kt({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,requiredNamespaces:p,optionalNamespaces:m,controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},w&&{sessionProperties:w});await this.sendResult(n.id,r,!0),this.events.emit(et("session_connect"),{session:y})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;pr(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(et("session_approve",i),{})):Qt(n)&&(await this.client.session.delete(r,tt("USER_DISCONNECTED")),this.events.emit(et("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidUpdate(Kt({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(s,r,!0),this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(o){await this.sendError(s,r,o),this.client.logger.error(o)}},this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;pr(n)?this.events.emit(et("session_update",i),{}):Qt(n)&&this.events.emit(et("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,rr(ys)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;pr(n)?this.events.emit(et("session_extend",i),{}):Qt(n)&&this.events.emit(et("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{pr(n)?this.events.emit(et("session_ping",i),{}):Qt(n)&&this.events.emit(et("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),this.client.core.relayer.once(pt.publish,async()=>{await this.deleteSession(r)}),await this.sendResult(i,r,!0),this.client.events.emit("session_delete",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidRequest(Kt({topic:r},s)),await this.setPendingSessionRequest({id:i,topic:r,params:s}),this.client.events.emit("session_request",{id:i,topic:r,params:s})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;pr(n)?this.events.emit(et("session_request",i),{result:n.result}):Qt(n)&&this.events.emit(et("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidEmit(Kt({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.isValidConnect=async r=>{if(!jt(r)){const{message:c}=ie("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(At(n)||await this.isValidPairingTopic(n),!x3(a,!0)){const{message:c}=ie("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!At(i)&&mn(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!At(s)&&mn(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),At(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=E3(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!jt(r))throw new Error(ie("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o}=r;await this.isValidProposalId(n);const a=this.client.proposal.get(n),c=as(i,"approve()");if(c)throw new Error(c.message);const l=xh(a.requiredNamespaces,i,"approve()");if(l)throw new Error(l.message);if(!ft(s,!0)){const{message:p}=ie("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(p)}At(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!jt(r)){const{message:s}=ie("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!I3(i)){const{message:s}=ie("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!jt(r)){const{message:l}=ie("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!_h(n)){const{message:l}=ie("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=m3(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=as(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(vr(o)){const{message:l}=ie("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!jt(r)){const{message:c}=ie("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const s=this.client.session.get(n),o=as(i,"update()");if(o)throw new Error(o.message);const a=xh(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!jt(r)){const{message:i}=ie("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!jt(r)){const{message:c}=ie("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:o}=r;await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!Eh(a,s)){const{message:c}=ie("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!S3(i)){const{message:c}=ie("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!$3(a,s,i.method)){const{message:c}=ie("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!N3(o,_a)){const{message:c}=ie("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${_a.min} and ${_a.max}`);throw new Error(c)}},this.isValidRespond=async r=>{if(!jt(r)){const{message:s}=ie("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(s)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!D3(i)){const{message:s}=ie("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidPing=async r=>{if(!jt(r)){const{message:i}=ie("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!jt(r)){const{message:a}=ie("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!Eh(o,s)){const{message:a}=ie("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!O3(i)){const{message:a}=ie("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!A3(o,s,i.name)){const{message:a}=ie("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!jt(r)){const{message:i}=ie("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!ft(i,!1)){const{message:s}=ie("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})}}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(pt.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);ha(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):ua(i)&&(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.client.core.expirer.on(Vt.expired,async e=>{const{topic:r,id:n}=mh(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ie("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}isValidPairingTopic(e){if(!ft(e,!1)){const{message:r}=ie("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=ie("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(vr(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=ie("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!ft(e,!1)){const{message:r}=ie("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=ie("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(vr(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=ie("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(ft(e,!1)){const{message:r}=ie("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=ie("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!C3(e)){const{message:r}=ie("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=ie("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(vr(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=ie("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class cb extends ws{constructor(e,r){super(e,r,Xy,ba),this.core=e,this.logger=r}}class lb extends ws{constructor(e,r){super(e,r,Qy,ba),this.core=e,this.logger=r}}class hb extends ws{constructor(e,r){super(e,r,tb,ba,n=>n.id),this.core=e,this.logger=r}}class xa extends xm{constructor(e){super(e),this.protocol=qu,this.version=Vu,this.name=va.name,this.events=new xt.exports.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||va.name,this.metadata=e?.metadata||zg();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xn(Be.getDefaultLoggerOptions({level:e?.logger||va.logger}));this.core=e?.core||new Jy(e),this.logger=Be.generateChildLogger(r,this.name),this.session=new lb(this.core,this.logger),this.proposal=new cb(this.core,this.logger),this.pendingRequest=new hb(this.core,this.logger),this.engine=new ab(this)}static async init(e){const r=new xa(e);return await r.initialize(),r}get context(){return Be.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var Ca={exports:{}};(function(t,e){var r=typeof self<"u"?self:dt,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(x){return x&&DataView.prototype.isPrototypeOf(x)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],p=ArrayBuffer.isView||function(x){return x&&l.indexOf(Object.prototype.toString.call(x))>-1};function m(x){if(typeof x!="string"&&(x=String(x)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(x))throw new TypeError("Invalid character in header field name");return x.toLowerCase()}function w(x){return typeof x!="string"&&(x=String(x)),x}function y(x){var $={next:function(){var K=x.shift();return{done:K===void 0,value:K}}};return a.iterable&&($[Symbol.iterator]=function(){return $}),$}function E(x){this.map={},x instanceof E?x.forEach(function($,K){this.append(K,$)},this):Array.isArray(x)?x.forEach(function($){this.append($[0],$[1])},this):x&&Object.getOwnPropertyNames(x).forEach(function($){this.append($,x[$])},this)}E.prototype.append=function(x,$){x=m(x),$=w($);var K=this.map[x];this.map[x]=K?K+", "+$:$},E.prototype.delete=function(x){delete this.map[m(x)]},E.prototype.get=function(x){return x=m(x),this.has(x)?this.map[x]:null},E.prototype.has=function(x){return this.map.hasOwnProperty(m(x))},E.prototype.set=function(x,$){this.map[m(x)]=w($)},E.prototype.forEach=function(x,$){for(var K in this.map)this.map.hasOwnProperty(K)&&x.call($,this.map[K],K,this)},E.prototype.keys=function(){var x=[];return this.forEach(function($,K){x.push(K)}),y(x)},E.prototype.values=function(){var x=[];return this.forEach(function($){x.push($)}),y(x)},E.prototype.entries=function(){var x=[];return this.forEach(function($,K){x.push([K,$])}),y(x)},a.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function T(x){if(x.bodyUsed)return Promise.reject(new TypeError("Already read"));x.bodyUsed=!0}function N(x){return new Promise(function($,K){x.onload=function(){$(x.result)},x.onerror=function(){K(x.error)}})}function L(x){var $=new FileReader,K=N($);return $.readAsArrayBuffer(x),K}function C(x){var $=new FileReader,K=N($);return $.readAsText(x),K}function D(x){for(var $=new Uint8Array(x),K=new Array($.length),Y=0;Y<$.length;Y++)K[Y]=String.fromCharCode($[Y]);return K.join("")}function b(x){if(x.slice)return x.slice(0);var $=new Uint8Array(x.byteLength);return $.set(new Uint8Array(x)),$.buffer}function S(){return this.bodyUsed=!1,this._initBody=function(x){this._bodyInit=x,x?typeof x=="string"?this._bodyText=x:a.blob&&Blob.prototype.isPrototypeOf(x)?this._bodyBlob=x:a.formData&&FormData.prototype.isPrototypeOf(x)?this._bodyFormData=x:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(x)?this._bodyText=x.toString():a.arrayBuffer&&a.blob&&c(x)?(this._bodyArrayBuffer=b(x.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(x)||p(x))?this._bodyArrayBuffer=b(x):this._bodyText=x=Object.prototype.toString.call(x):this._bodyText="",this.headers.get("content-type")||(typeof x=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(x)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var x=T(this);if(x)return x;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?T(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(L)}),this.text=function(){var x=T(this);if(x)return x;if(this._bodyBlob)return C(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(D(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(H)}),this.json=function(){return this.text().then(JSON.parse)},this}var O=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function u(x){var $=x.toUpperCase();return O.indexOf($)>-1?$:x}function _(x,$){$=$||{};var K=$.body;if(x instanceof _){if(x.bodyUsed)throw new TypeError("Already read");this.url=x.url,this.credentials=x.credentials,$.headers||(this.headers=new E(x.headers)),this.method=x.method,this.mode=x.mode,this.signal=x.signal,!K&&x._bodyInit!=null&&(K=x._bodyInit,x.bodyUsed=!0)}else this.url=String(x);if(this.credentials=$.credentials||this.credentials||"same-origin",($.headers||!this.headers)&&(this.headers=new E($.headers)),this.method=u($.method||this.method||"GET"),this.mode=$.mode||this.mode||null,this.signal=$.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&K)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(K)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})};function H(x){var $=new FormData;return x.trim().split("&").forEach(function(K){if(K){var Y=K.split("="),W=Y.shift().replace(/\+/g," "),z=Y.join("=").replace(/\+/g," ");$.append(decodeURIComponent(W),decodeURIComponent(z))}}),$}function B(x){var $=new E,K=x.replace(/\r?\n[\t ]+/g," ");return K.split(/\r?\n/).forEach(function(Y){var W=Y.split(":"),z=W.shift().trim();if(z){var J=W.join(":").trim();$.append(z,J)}}),$}S.call(_.prototype);function q(x,$){$||($={}),this.type="default",this.status=$.status===void 0?200:$.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in $?$.statusText:"OK",this.headers=new E($.headers),this.url=$.url||"",this._initBody(x)}S.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new E(this.headers),url:this.url})},q.error=function(){var x=new q(null,{status:0,statusText:""});return x.type="error",x};var X=[301,302,303,307,308];q.redirect=function(x,$){if(X.indexOf($)===-1)throw new RangeError("Invalid status code");return new q(null,{status:$,headers:{location:x}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function($,K){this.message=$,this.name=K;var Y=Error($);this.stack=Y.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function te(x,$){return new Promise(function(K,Y){var W=new _(x,$);if(W.signal&&W.signal.aborted)return Y(new o.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function J(){z.abort()}z.onload=function(){var G={status:z.status,statusText:z.statusText,headers:B(z.getAllResponseHeaders()||"")};G.url="responseURL"in z?z.responseURL:G.headers.get("X-Request-URL");var ce="response"in z?z.response:z.responseText;K(new q(ce,G))},z.onerror=function(){Y(new TypeError("Network request failed"))},z.ontimeout=function(){Y(new TypeError("Network request failed"))},z.onabort=function(){Y(new o.DOMException("Aborted","AbortError"))},z.open(W.method,W.url,!0),W.credentials==="include"?z.withCredentials=!0:W.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&a.blob&&(z.responseType="blob"),W.headers.forEach(function(G,ce){z.setRequestHeader(ce,G)}),W.signal&&(W.signal.addEventListener("abort",J),z.onreadystatechange=function(){z.readyState===4&&W.signal.removeEventListener("abort",J)}),z.send(typeof W._bodyInit>"u"?null:W._bodyInit)})}return te.polyfill=!0,s.fetch||(s.fetch=te,s.Headers=E,s.Request=_,s.Response=q),o.Headers=E,o.Request=_,o.Response=q,o.fetch=te,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(Ca,Ca.exports);var Ju=rf(Ca.exports);const Xu={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Qu=10;class vn{constructor(e){if(this.url=e,this.events=new xt.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!lu(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,r){this.isAvailable||await this.register();try{const n=ui(e),s=await(await Ju(this.url,Object.assign(Object.assign({},Xu),{body:n}))).json();this.onPayload({data:s})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!lu(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{const r=ui({id:1,jsonrpc:"2.0",method:"test",params:[]});await Ju(e,Object.assign(Object.assign({},Xu),{body:r})),this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?na(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=ps(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return nu(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Qu&&this.events.setMaxListeners(Qu)}}const e0="error",ub="wss://relay.walletconnect.com",db="wc",fb="universal_provider",t0=`${db}@${2}:${fb}:`,pb="https://rpc.walletconnect.com/v1",zr={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var gb=Object.defineProperty,r0=Object.getOwnPropertySymbols,mb=Object.prototype.hasOwnProperty,wb=Object.prototype.propertyIsEnumerable,n0=(t,e,r)=>e in t?gb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ia=(t,e)=>{for(var r in e||(e={}))mb.call(e,r)&&n0(t,r,e[r]);if(r0)for(var r of r0(e))wb.call(e,r)&&n0(t,r,e[r]);return t};function or(t,e,r){let n;const i=Sa(t);return e.rpcMap&&(n=e.rpcMap[i]),n||(n=`${pb}?chainId=eip155:${i}&projectId=${r}`),n}function Sa(t){return t.includes("eip155")?Number(t.split(":")[1]):Number(t)}function yb(t,e){if(!e.includes(t))throw new Error(`Chain '${t}' not approved. Please use one of the following: ${e.toString()}`)}function bb(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function vb(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function _b(t,e={}){const r=i0(t),n=i0(e);return Ia({},Object.assign(r,n))}function i0(t){var e,r,n,i;const s={};if(!mn(t))return s;for(const[o,a]of Object.entries(t)){const c=s0(o)?[o]:a.chains,l=a.methods||[],p=a.events||[],m=o0(o);s[m]={chains:Da(c,(e=s[m])==null?void 0:e.chains),methods:Da(l,(r=s[m])==null?void 0:r.methods),events:Da(p,(n=s[m])==null?void 0:n.events),rpcMap:Ia(Ia({},(i=s[m])==null?void 0:i.rpcMap),a.rpcMap)}}return s}function s0(t){return t.includes(":")}function o0(t){return s0(t)?t.split(":")[0]:t}function Da(t=[],e=[]){return[...new Set([...t,...e])]}const _n=(t,e)=>{const r=n=>{n.request!==e.request||n.topic!==e.topic||(t.events.removeListener("session_request_sent",r),Eb(e))};t.on("session_request_sent",r)};function Eb(t){if(typeof window<"u")try{const e=window.localStorage.getItem("WALLETCONNECT_DEEPLINK_CHOICE");if(e){const r=JSON.parse(e),n=r?.href;if(typeof n=="string"){n.endsWith("/")&&n.slice(0,-1);const i=`${n}/wc?requestId=${t.id}&sessionTopic=${t.topic}`;window.open(i,"_self","noreferrer noopener")}}}catch(e){console.error(e)}}class xb{constructor(e){this.name="eip155",this.namespace=e.namespace,this.client=e.client,this.events=e.events,this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){var r;switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return this.handleSwitchChain(e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0"),null;case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),await this.client.request(e)):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){const n=Sa(e);if(!this.httpProviders[n]){const i=r||or(`${this.name}:${n}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${n}`);this.setHttpProvider(n,i)}this.chainId=n,this.events.emit(zr.DEFAULT_CHAIN_CHANGED,`${this.name}:${n}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||or(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Hr(new vn(n))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Sa(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}handleSwitchChain(e){const r=parseInt(e,16),n=`${this.name}:${r}`;yb(n,this.namespace.chains),this.setDefaultChain(`${r}`)}}class Cb{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||or(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(zr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||or(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Hr(new vn(n))}}class Ib{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||or(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(zr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||or(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Hr(new vn(n))}}class Sb{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(zr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r);e[r]=this.createHttpProvider(r,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new Hr(new vn(n))}}class Db{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||or(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(zr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||or(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Hr(new vn(n))}}class Ob{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||or(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(zr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||or(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Hr(new vn(n))}}var $b=Object.defineProperty,Ab=Object.defineProperties,Pb=Object.getOwnPropertyDescriptors,a0=Object.getOwnPropertySymbols,Tb=Object.prototype.hasOwnProperty,Nb=Object.prototype.propertyIsEnumerable,c0=(t,e,r)=>e in t?$b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bs=(t,e)=>{for(var r in e||(e={}))Tb.call(e,r)&&c0(t,r,e[r]);if(a0)for(var r of a0(e))Nb.call(e,r)&&c0(t,r,e[r]);return t},Oa=(t,e)=>Ab(t,Pb(e));class $a{constructor(e){this.events=new xt.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xn(Be.getDefaultLoggerOptions({level:e?.logger||e0}))}static async init(e){const r=new $a(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:bs({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:tt("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s}).catch(s=>{if(s.message!==Gu)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(ur(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await xa.init({logger:this.providerOpts.logger||e0,relayUrl:this.providerOpts.relayUrl||ub,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");[...new Set(Object.keys(this.session.namespaces).map(e=>o0(e)))].forEach(e=>{if(!this.session)return;const r=vb(e,this.session),n=bb(r),i=_b(this.namespaces,this.optionalNamespaces),s=Oa(bs({},i[e]),{accounts:r,chains:n});switch(e){case"eip155":this.rpcProviders[e]=new xb({client:this.client,namespace:s,events:this.events});break;case"solana":this.rpcProviders[e]=new Cb({client:this.client,namespace:s,events:this.events});break;case"cosmos":this.rpcProviders[e]=new Ib({client:this.client,namespace:s,events:this.events});break;case"polkadot":break;case"cip34":this.rpcProviders[e]=new Sb({client:this.client,namespace:s,events:this.events});break;case"elrond":this.rpcProviders[e]=new Db({client:this.client,namespace:s,events:this.events});break;case"multiversx":this.rpcProviders[e]=new Ob({client:this.client,namespace:s,events:this.events});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?this.events.emit("accountsChanged",n.data):n.name==="chainChanged"?this.onChainChanged(r.chainId):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=Oa(bs({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Oa(bs({},tt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(zr.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;if(!r||!Object.keys(r).length)throw new Error("Namespaces must be not empty");this.namespaces=r,this.optionalNamespaces=n,this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(r&&!Object.keys(this.namespaces).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Object.keys(this.namespaces)[0],s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){const[n,i]=this.validateChain(e);r||this.getProvider(n).setDefaultChain(i),this.namespaces[n].defaultChain=i,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${t0}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${t0}/${e}`)}}const Rb=$a,Mb="wc",Lb="ethereum_provider",Ub=`${Mb}@${2}:${Lb}:`,jb="https://rpc.walletconnect.com/v1/",vs=["eth_sendTransaction","personal_sign"],Fb=["eth_accounts","eth_requestAccounts","eth_call","eth_getBalance","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],_s=["chainChanged","accountsChanged"],Bb=["message","disconnect","connect"];var kb=Object.defineProperty,Hb=Object.defineProperties,zb=Object.getOwnPropertyDescriptors,l0=Object.getOwnPropertySymbols,Wb=Object.prototype.hasOwnProperty,qb=Object.prototype.propertyIsEnumerable,h0=(t,e,r)=>e in t?kb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Aa=(t,e)=>{for(var r in e||(e={}))Wb.call(e,r)&&h0(t,r,e[r]);if(l0)for(var r of l0(e))qb.call(e,r)&&h0(t,r,e[r]);return t},u0=(t,e)=>Hb(t,zb(e));function Pa(t){return Number(t[0].split(":")[1])}function Ta(t){return`0x${t.toString(16)}`}function Vb(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!ur(e))throw new Error("Invalid chains");const c=e,l=n||vs,p=s||_s,m={[Pa(c)]:a[Pa(c)]},w={chains:c,methods:l,events:p,rpcMap:m},y=s?.filter(L=>!_s.includes(L)),E=n?.filter(L=>!vs.includes(L));if(!r&&!o&&!i&&!(y!=null&&y.length)&&!(E!=null&&E.length))return{required:w};const T=y?.length&&E?.length||!r,N={chains:[...new Set(T?c.concat(r||[]):r)],methods:[...new Set(l.concat(i||[]))],events:[...new Set(p.concat(o||[]))],rpcMap:a};return{required:w,optional:N}}class Es{constructor(){this.events=new xt.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Ub,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Es;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=Vb(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(u0(Aa({namespaces:{[this.namespace]:r}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;this.setChainIds(this.rpc.chains);const s=Cg(i.namespaces,[this.namespace]);this.setAccounts(s),this.events.emit("connect",{chainId:Ta(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Ta(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",u0(Aa({},tt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}setHttpProvider(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Ta(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.setHttpProvider(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;return{chains:((r=e.chains)==null?void 0:r.map(i=>this.formatChainId(i)))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map(i=>this.formatChainId(i)):void 0,methods:e?.methods||vs,events:e?.events||_s,optionalMethods:e?.optionalMethods||[],optionalEvents:e?.optionalEvents||[],rpcMap:e?.rpcMap||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),showQrModal:Boolean(e?.showQrModal),qrModalOptions:(n=e?.qrModalOptions)!=null?n:void 0,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=Pa(this.rpc.chains),this.signer=await Rb.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal)try{const{Web3Modal:r}=await Promise.resolve().then(function(){return yv});this.modal=new r(Aa({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch{throw new Error("To use QR modal, please install @web3modal/standalone package")}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&ur(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=i?.[s]||this.getRpcUrl(s)})),n&&ur(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=i?.[s]||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${jb}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`);this.setChainIds(e?[this.formatChainId(e)]:this.session.namespaces[this.namespace].accounts),this.setAccounts(this.session.namespaces[this.namespace].accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const Kb=Es,Gb=Symbol(),d0=Object.getPrototypeOf,Na=new WeakMap,Zb=t=>t&&(Na.has(t)?Na.get(t):d0(t)===Object.prototype||d0(t)===Array.prototype),Yb=t=>Zb(t)&&t[Gb]||null,f0=(t,e=!0)=>{Na.set(t,e)},Ra=t=>typeof t=="object"&&t!==null,Wr=new WeakMap,xs=new WeakSet,Jb=(t=Object.is,e=(l,p)=>new Proxy(l,p),r=l=>Ra(l)&&!xs.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},i=new WeakMap,s=(l,p,m=n)=>{const w=i.get(l);if(w?.[0]===p)return w[1];const y=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return f0(y,!0),i.set(l,[p,y]),Reflect.ownKeys(l).forEach(E=>{if(Object.getOwnPropertyDescriptor(y,E))return;const T=Reflect.get(l,E),N={value:T,enumerable:!0,configurable:!0};if(xs.has(T))f0(T,!1);else if(T instanceof Promise)delete N.value,N.get=()=>m(T);else if(Wr.has(T)){const[L,C]=Wr.get(T);N.value=s(L,C(),m)}Object.defineProperty(y,E,N)}),y},o=new WeakMap,a=[1,1],c=l=>{if(!Ra(l))throw new Error("object required");const p=o.get(l);if(p)return p;let m=a[0];const w=new Set,y=(H,B=++a[0])=>{m!==B&&(m=B,w.forEach(q=>q(H,B)))};let E=a[1];const T=(H=++a[1])=>(E!==H&&!w.size&&(E=H,L.forEach(([B])=>{const q=B[1](H);q>m&&(m=q)})),m),N=H=>(B,q)=>{const X=[...B];X[1]=[H,...X[1]],y(X,q)},L=new Map,C=(H,B)=>{if(void 0!=="production"&&L.has(H))throw new Error("prop listener already exists");if(w.size){const q=B[3](N(H));L.set(H,[B,q])}else L.set(H,[B])},D=H=>{var B;const q=L.get(H);q&&(L.delete(H),(B=q[1])==null||B.call(q))},b=H=>(w.add(H),w.size===1&&L.forEach(([q,X],te)=>{if(void 0!=="production"&&X)throw new Error("remove already exists");const x=q[3](N(te));L.set(te,[q,x])}),()=>{w.delete(H),w.size===0&&L.forEach(([q,X],te)=>{X&&(X(),L.set(te,[q]))})}),S=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),u=e(S,{deleteProperty(H,B){const q=Reflect.get(H,B);D(B);const X=Reflect.deleteProperty(H,B);return X&&y(["delete",[B],q]),X},set(H,B,q,X){const te=Reflect.has(H,B),x=Reflect.get(H,B,X);if(te&&(t(x,q)||o.has(q)&&t(x,o.get(q))))return!0;D(B),Ra(q)&&(q=Yb(q)||q);let $=q;if(q instanceof Promise)q.then(K=>{q.status="fulfilled",q.value=K,y(["resolve",[B],K])}).catch(K=>{q.status="rejected",q.reason=K,y(["reject",[B],K])});else{!Wr.has(q)&&r(q)&&($=c(q));const K=!xs.has($)&&Wr.get($);K&&C(B,K)}return Reflect.set(H,B,$,X),y(["set",[B],q,x]),!0}});o.set(l,u);const _=[S,T,s,b];return Wr.set(u,_),Reflect.ownKeys(l).forEach(H=>{const B=Object.getOwnPropertyDescriptor(l,H);"value"in B&&(u[H]=l[H],delete B.value,delete B.writable),Object.defineProperty(S,H,B)}),u})=>[c,Wr,xs,t,e,r,n,i,s,o,a],[Xb]=Jb();function Er(t={}){return Xb(t)}function qr(t,e,r){const n=Wr.get(t);void 0!=="production"&&!n&&console.warn("Please use proxy object");let i;const s=[],o=n[3];let a=!1;const l=o(p=>{if(s.push(p),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,l()}}var p0={},Cs={};Cs.byteLength=tv,Cs.toByteArray=nv,Cs.fromByteArray=ov;for(var ar=[],Gt=[],Qb=typeof Uint8Array<"u"?Uint8Array:Array,Ma="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",En=0,ev=Ma.length;En<ev;++En)ar[En]=Ma[En],Gt[Ma.charCodeAt(En)]=En;Gt["-".charCodeAt(0)]=62,Gt["_".charCodeAt(0)]=63;function g0(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function tv(t){var e=g0(t),r=e[0],n=e[1];return(r+n)*3/4-n}function rv(t,e,r){return(e+r)*3/4-r}function nv(t){var e,r=g0(t),n=r[0],i=r[1],s=new Qb(rv(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=Gt[t.charCodeAt(c)]<<18|Gt[t.charCodeAt(c+1)]<<12|Gt[t.charCodeAt(c+2)]<<6|Gt[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Gt[t.charCodeAt(c)]<<2|Gt[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Gt[t.charCodeAt(c)]<<10|Gt[t.charCodeAt(c+1)]<<4|Gt[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function iv(t){return ar[t>>18&63]+ar[t>>12&63]+ar[t>>6&63]+ar[t&63]}function sv(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(iv(n));return i.join("")}function ov(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(sv(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(ar[e>>2]+ar[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ar[e>>10]+ar[e>>4&63]+ar[e<<2&63]+"=")),i.join("")}var La={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */La.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<<a)-1,l=c>>1,p=-7,m=r?i-1:0,w=r?-1:1,y=t[e+m];for(m+=w,s=y&(1<<-p)-1,y>>=-p,p+=a;p>0;s=s*256+t[e+m],m+=w,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+m],m+=w,p-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(y?-1:1)*o*Math.pow(2,s-n)},La.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,p=(1<<l)-1,m=p>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:s-1,E=n?1:-1,T=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+m>=1?e+=w/c:e+=w*Math.pow(2,1-m),e*c>=2&&(o++,c/=2),o+m>=p?(a=0,o=p):o+m>=1?(a=(e*c-1)*Math.pow(2,i),o=o+m):(a=e*Math.pow(2,m-1)*Math.pow(2,i),o=0));i>=8;t[r+y]=a&255,y+=E,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[r+y]=o&255,y+=E,o/=256,l-=8);t[r+y-E]|=T*128};/*!
|
|
72
|
+
***************************************************************************** */var aa=function(t,e){return aa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},aa(t,e)};function uw(t,e){aa(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ca=function(){return ca=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},ca.apply(this,arguments)};function dw(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function fw(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function pw(t,e){return function(r,n){e(r,n,t)}}function gw(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function mw(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(m){o(m)}}function c(p){try{l(n.throw(p))}catch(m){o(m)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function ww(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function yw(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function bw(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function la(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=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 su(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function vw(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(su(arguments[e]));return t}function _w(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function fi(t){return this instanceof fi?(this.v=t,this):new fi(t)}function Ew(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(w){n[w]&&(i[w]=function(y){return new Promise(function(E,T){s.push([w,y,E,T])>1||a(w,y)})})}function a(w,y){try{c(n[w](y))}catch(E){m(s[0][3],E)}}function c(w){w.value instanceof fi?Promise.resolve(w.value.v).then(l,p):m(s[0][2],w)}function l(w){a("next",w)}function p(w){a("throw",w)}function m(w,y){w(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function xw(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(o){return(r=!r)?{value:fi(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function Cw(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 la=="function"?la(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(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Iw(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Sw(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Dw(t){return t&&t.__esModule?t:{default:t}}function Ow(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function $w(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var Aw=Object.freeze({__proto__:null,__extends:uw,get __assign(){return ca},__rest:dw,__decorate:fw,__param:pw,__metadata:gw,__awaiter:mw,__generator:ww,__createBinding:yw,__exportStar:bw,__values:la,__read:su,__spread:vw,__spreadArrays:_w,__await:fi,__asyncGenerator:Ew,__asyncDelegator:xw,__asyncValues:Cw,__makeTemplateObject:Iw,__importStar:Sw,__importDefault:Dw,__classPrivateFieldGet:Ow,__classPrivateFieldSet:$w}),Pw=Tr(Aw),ur={},ou;function Tw(){if(ou)return ur;ou=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.isBrowserCryptoAvailable=ur.getSubtleCrypto=ur.getBrowerCrypto=void 0;function t(){return dt?.crypto||dt?.msCrypto||{}}ur.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}ur.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return ur.isBrowserCryptoAvailable=r,ur}var dr={},au;function Rw(){if(au)return dr;au=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.isBrowser=dr.isNode=dr.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}dr.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}dr.isNode=e;function r(){return!t()&&!e()}return dr.isBrowser=r,dr}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Pw;e.__exportStar(Tw(),t),e.__exportStar(Rw(),t)})(iu);function cu(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Nw(t=6){return BigInt(cu(t))}function ha(t,e,r){return{id:r||cu(),jsonrpc:"2.0",method:t,params:e}}function lu(t,e){return{id:t,jsonrpc:"2.0",result:e}}function Mw(t,e,r){return{id:t,jsonrpc:"2.0",error:Lw(e,r)}}function Lw(t,e){return typeof t>"u"?nu(tu):(typeof t=="string"&&(t=Object.assign(Object.assign({},nu(oa)),{message:t})),typeof e<"u"&&(t.data=e),lw(t.code)&&(t=hw(t.code)),t)}class Uw{}class jw extends Uw{constructor(){super()}}class hu extends jw{constructor(e){super()}}function uu(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function du(t){return uu(t)&&"method"in t}function fu(t){return uu(t)&&(pu(t)||ms(t))}function pu(t){return"result"in t}function ms(t){return"error"in t}class Fw extends hu{constructor(e){super(e),this.events=new ft.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(ha(e.method,e.params||[],Nw().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{ms(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),fu(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const Bw="PARSE_ERROR",kw="INVALID_REQUEST",Hw="METHOD_NOT_FOUND",zw="INVALID_PARAMS",gu="INTERNAL_ERROR",ua="SERVER_ERROR",Ww=[-32700,-32600,-32601,-32602,-32603],pi={[Bw]:{code:-32700,message:"Parse error"},[kw]:{code:-32600,message:"Invalid Request"},[Hw]:{code:-32601,message:"Method not found"},[zw]:{code:-32602,message:"Invalid params"},[gu]:{code:-32603,message:"Internal error"},[ua]:{code:-32e3,message:"Server error"}},mu=ua;function qw(t){return Ww.includes(t)}function wu(t){return Object.keys(pi).includes(t)?pi[t]:pi[mu]}function Vw(t){const e=Object.values(pi).find(r=>r.code===t);return e||pi[mu]}function yu(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}function bu(t,e,r){return{id:t,jsonrpc:"2.0",error:Kw(e,r)}}function Kw(t,e){return typeof t>"u"?wu(gu):(typeof t=="string"&&(t=Object.assign(Object.assign({},wu(ua)),{message:t})),typeof e<"u"&&(t.data=e),qw(t.code)&&(t=Vw(t.code)),t)}const Gw="^https?:",Zw="^wss?:";function Yw(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function vu(t,e){const r=Yw(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function _u(t){return vu(t,Gw)}function Eu(t){return vu(t,Zw)}function Jw(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}const xu=10,Xw=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),Qw=()=>typeof window<"u",e5=Xw();class t5{constructor(e){if(this.url=e,this.events=new ft.exports.EventEmitter,this.registering=!1,!Eu(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ui(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!Eu(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=iu.isReactNative()?void 0:{rejectUnauthorized:!Jw(e)},s=new e5(e,[],i);Qw()?s.onerror=o=>{const a=o;n(this.emitError(a.error))}:s.on("error",o=>{n(this.emitError(o))}),s.onopen=()=>{this.onOpen(s),r(s)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?ia(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=bu(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return yu(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>xu&&this.events.setMaxListeners(xu)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for URL: ${this.url}`));return this.events.emit("register_error",r),r}}var da={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",p="[object Boolean]",m="[object Date]",w="[object Error]",y="[object Function]",E="[object GeneratorFunction]",T="[object Map]",R="[object Number]",L="[object Null]",C="[object Object]",O="[object Promise]",b="[object Proxy]",S="[object RegExp]",D="[object Set]",u="[object String]",_="[object Symbol]",H="[object Undefined]",B="[object WeakMap]",q="[object ArrayBuffer]",X="[object DataView]",te="[object Float32Array]",x="[object Float64Array]",$="[object Int8Array]",K="[object Int16Array]",Y="[object Int32Array]",W="[object Uint8Array]",z="[object Uint8ClampedArray]",J="[object Uint16Array]",G="[object Uint32Array]",ce=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,pe=/^(?:0|[1-9]\d*)$/,oe={};oe[te]=oe[x]=oe[$]=oe[K]=oe[Y]=oe[W]=oe[z]=oe[J]=oe[G]=!0,oe[a]=oe[c]=oe[q]=oe[p]=oe[X]=oe[m]=oe[w]=oe[y]=oe[T]=oe[R]=oe[C]=oe[S]=oe[D]=oe[u]=oe[B]=!1;var Ce=typeof dt=="object"&&dt&&dt.Object===Object&&dt,F=typeof self=="object"&&self&&self.Object===Object&&self,j=Ce||F||Function("return this")(),N=e&&!e.nodeType&&e,f=N&&!0&&t&&!t.nodeType&&t,A=f&&f.exports===N,ee=A&&Ce.process,ne=function(){try{return ee&&ee.binding&&ee.binding("util")}catch{}}(),Ee=ne&&ne.isTypedArray;function Le(I,M){for(var Z=-1,ae=I==null?0:I.length,We=0,Se=[];++Z<ae;){var Qe=I[Z];M(Qe,Z,I)&&(Se[We++]=Qe)}return Se}function Pe(I,M){for(var Z=-1,ae=M.length,We=I.length;++Z<ae;)I[We+Z]=M[Z];return I}function Ue(I,M){for(var Z=-1,ae=I==null?0:I.length;++Z<ae;)if(M(I[Z],Z,I))return!0;return!1}function Ge(I,M){for(var Z=-1,ae=Array(I);++Z<I;)ae[Z]=M(Z);return ae}function Ve(I){return function(M){return I(M)}}function Te(I,M){return I.has(M)}function Oe(I,M){return I?.[M]}function me(I){var M=-1,Z=Array(I.size);return I.forEach(function(ae,We){Z[++M]=[We,ae]}),Z}function Ie(I,M){return function(Z){return I(M(Z))}}function $e(I){var M=-1,Z=Array(I.size);return I.forEach(function(ae){Z[++M]=ae}),Z}var ge=Array.prototype,xe=Function.prototype,g=Object.prototype,h=j["__core-js_shared__"],d=xe.toString,v=g.hasOwnProperty,P=function(){var I=/[^.]+$/.exec(h&&h.keys&&h.keys.IE_PROTO||"");return I?"Symbol(src)_1."+I:""}(),U=g.toString,k=RegExp("^"+d.call(v).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),se=A?j.Buffer:void 0,he=j.Symbol,Ne=j.Uint8Array,je=g.propertyIsEnumerable,Me=ge.splice,Wt=he?he.toStringTag:void 0,sn=Object.getOwnPropertySymbols,Vi=se?se.isBuffer:void 0,oo=Ie(Object.keys,Object),rt=zn(j,"DataView"),Je=zn(j,"Map"),nt=zn(j,"Promise"),it=zn(j,"Set"),st=zn(j,"WeakMap"),Xe=zn(Object,"create"),mt=an(rt),wt=an(Je),yt=an(nt),bt=an(it),vt=an(st),ut=he?he.prototype:void 0,ot=ut?ut.valueOf:void 0;function Ke(I){var M=-1,Z=I==null?0:I.length;for(this.clear();++M<Z;){var ae=I[M];this.set(ae[0],ae[1])}}function _t(){this.__data__=Xe?Xe(null):{},this.size=0}function Et(I){var M=this.has(I)&&delete this.__data__[I];return this.size-=M?1:0,M}function C7(I){var M=this.__data__;if(Xe){var Z=M[I];return Z===n?void 0:Z}return v.call(M,I)?M[I]:void 0}function I7(I){var M=this.__data__;return Xe?M[I]!==void 0:v.call(M,I)}function S7(I,M){var Z=this.__data__;return this.size+=this.has(I)?0:1,Z[I]=Xe&&M===void 0?n:M,this}Ke.prototype.clear=_t,Ke.prototype.delete=Et,Ke.prototype.get=C7,Ke.prototype.has=I7,Ke.prototype.set=S7;function gr(I){var M=-1,Z=I==null?0:I.length;for(this.clear();++M<Z;){var ae=I[M];this.set(ae[0],ae[1])}}function D7(){this.__data__=[],this.size=0}function O7(I){var M=this.__data__,Z=co(M,I);if(Z<0)return!1;var ae=M.length-1;return Z==ae?M.pop():Me.call(M,Z,1),--this.size,!0}function $7(I){var M=this.__data__,Z=co(M,I);return Z<0?void 0:M[Z][1]}function A7(I){return co(this.__data__,I)>-1}function P7(I,M){var Z=this.__data__,ae=co(Z,I);return ae<0?(++this.size,Z.push([I,M])):Z[ae][1]=M,this}gr.prototype.clear=D7,gr.prototype.delete=O7,gr.prototype.get=$7,gr.prototype.has=A7,gr.prototype.set=P7;function on(I){var M=-1,Z=I==null?0:I.length;for(this.clear();++M<Z;){var ae=I[M];this.set(ae[0],ae[1])}}function T7(){this.size=0,this.__data__={hash:new Ke,map:new(Je||gr),string:new Ke}}function R7(I){var M=lo(this,I).delete(I);return this.size-=M?1:0,M}function N7(I){return lo(this,I).get(I)}function M7(I){return lo(this,I).has(I)}function L7(I,M){var Z=lo(this,I),ae=Z.size;return Z.set(I,M),this.size+=Z.size==ae?0:1,this}on.prototype.clear=T7,on.prototype.delete=R7,on.prototype.get=N7,on.prototype.has=M7,on.prototype.set=L7;function ao(I){var M=-1,Z=I==null?0:I.length;for(this.__data__=new on;++M<Z;)this.add(I[M])}function U7(I){return this.__data__.set(I,n),this}function j7(I){return this.__data__.has(I)}ao.prototype.add=ao.prototype.push=U7,ao.prototype.has=j7;function $r(I){var M=this.__data__=new gr(I);this.size=M.size}function F7(){this.__data__=new gr,this.size=0}function B7(I){var M=this.__data__,Z=M.delete(I);return this.size=M.size,Z}function k7(I){return this.__data__.get(I)}function H7(I){return this.__data__.has(I)}function z7(I,M){var Z=this.__data__;if(Z instanceof gr){var ae=Z.__data__;if(!Je||ae.length<r-1)return ae.push([I,M]),this.size=++Z.size,this;Z=this.__data__=new on(ae)}return Z.set(I,M),this.size=Z.size,this}$r.prototype.clear=F7,$r.prototype.delete=B7,$r.prototype.get=k7,$r.prototype.has=H7,$r.prototype.set=z7;function W7(I,M){var Z=ho(I),ae=!Z&&s9(I),We=!Z&&!ae&&Kc(I),Se=!Z&&!ae&&!We&&yf(I),Qe=Z||ae||We||Se,xt=Qe?Ge(I.length,String):[],St=xt.length;for(var Ze in I)(M||v.call(I,Ze))&&!(Qe&&(Ze=="length"||We&&(Ze=="offset"||Ze=="parent")||Se&&(Ze=="buffer"||Ze=="byteLength"||Ze=="byteOffset")||e9(Ze,St)))&&xt.push(Ze);return xt}function co(I,M){for(var Z=I.length;Z--;)if(pf(I[Z][0],M))return Z;return-1}function q7(I,M,Z){var ae=M(I);return ho(I)?ae:Pe(ae,Z(I))}function Ki(I){return I==null?I===void 0?H:L:Wt&&Wt in Object(I)?X7(I):i9(I)}function hf(I){return Gi(I)&&Ki(I)==a}function uf(I,M,Z,ae,We){return I===M?!0:I==null||M==null||!Gi(I)&&!Gi(M)?I!==I&&M!==M:V7(I,M,Z,ae,uf,We)}function V7(I,M,Z,ae,We,Se){var Qe=ho(I),xt=ho(M),St=Qe?c:Ar(I),Ze=xt?c:Ar(M);St=St==a?C:St,Ze=Ze==a?C:Ze;var qt=St==C,Qt=Ze==C,$t=St==Ze;if($t&&Kc(I)){if(!Kc(M))return!1;Qe=!0,qt=!1}if($t&&!qt)return Se||(Se=new $r),Qe||yf(I)?df(I,M,Z,ae,We,Se):Y7(I,M,St,Z,ae,We,Se);if(!(Z&i)){var Yt=qt&&v.call(I,"__wrapped__"),Jt=Qt&&v.call(M,"__wrapped__");if(Yt||Jt){var Pr=Yt?I.value():I,mr=Jt?M.value():M;return Se||(Se=new $r),We(Pr,mr,Z,ae,Se)}}return $t?(Se||(Se=new $r),J7(I,M,Z,ae,We,Se)):!1}function K7(I){if(!wf(I)||r9(I))return!1;var M=gf(I)?k:Q;return M.test(an(I))}function G7(I){return Gi(I)&&mf(I.length)&&!!oe[Ki(I)]}function Z7(I){if(!n9(I))return oo(I);var M=[];for(var Z in Object(I))v.call(I,Z)&&Z!="constructor"&&M.push(Z);return M}function df(I,M,Z,ae,We,Se){var Qe=Z&i,xt=I.length,St=M.length;if(xt!=St&&!(Qe&&St>xt))return!1;var Ze=Se.get(I);if(Ze&&Se.get(M))return Ze==M;var qt=-1,Qt=!0,$t=Z&s?new ao:void 0;for(Se.set(I,M),Se.set(M,I);++qt<xt;){var Yt=I[qt],Jt=M[qt];if(ae)var Pr=Qe?ae(Jt,Yt,qt,M,I,Se):ae(Yt,Jt,qt,I,M,Se);if(Pr!==void 0){if(Pr)continue;Qt=!1;break}if($t){if(!Ue(M,function(mr,cn){if(!Te($t,cn)&&(Yt===mr||We(Yt,mr,Z,ae,Se)))return $t.push(cn)})){Qt=!1;break}}else if(!(Yt===Jt||We(Yt,Jt,Z,ae,Se))){Qt=!1;break}}return Se.delete(I),Se.delete(M),Qt}function Y7(I,M,Z,ae,We,Se,Qe){switch(Z){case X:if(I.byteLength!=M.byteLength||I.byteOffset!=M.byteOffset)return!1;I=I.buffer,M=M.buffer;case q:return!(I.byteLength!=M.byteLength||!Se(new Ne(I),new Ne(M)));case p:case m:case R:return pf(+I,+M);case w:return I.name==M.name&&I.message==M.message;case S:case u:return I==M+"";case T:var xt=me;case D:var St=ae&i;if(xt||(xt=$e),I.size!=M.size&&!St)return!1;var Ze=Qe.get(I);if(Ze)return Ze==M;ae|=s,Qe.set(I,M);var qt=df(xt(I),xt(M),ae,We,Se,Qe);return Qe.delete(I),qt;case _:if(ot)return ot.call(I)==ot.call(M)}return!1}function J7(I,M,Z,ae,We,Se){var Qe=Z&i,xt=ff(I),St=xt.length,Ze=ff(M),qt=Ze.length;if(St!=qt&&!Qe)return!1;for(var Qt=St;Qt--;){var $t=xt[Qt];if(!(Qe?$t in M:v.call(M,$t)))return!1}var Yt=Se.get(I);if(Yt&&Se.get(M))return Yt==M;var Jt=!0;Se.set(I,M),Se.set(M,I);for(var Pr=Qe;++Qt<St;){$t=xt[Qt];var mr=I[$t],cn=M[$t];if(ae)var bf=Qe?ae(cn,mr,$t,M,I,Se):ae(mr,cn,$t,I,M,Se);if(!(bf===void 0?mr===cn||We(mr,cn,Z,ae,Se):bf)){Jt=!1;break}Pr||(Pr=$t=="constructor")}if(Jt&&!Pr){var uo=I.constructor,fo=M.constructor;uo!=fo&&"constructor"in I&&"constructor"in M&&!(typeof uo=="function"&&uo instanceof uo&&typeof fo=="function"&&fo instanceof fo)&&(Jt=!1)}return Se.delete(I),Se.delete(M),Jt}function ff(I){return q7(I,c9,Q7)}function lo(I,M){var Z=I.__data__;return t9(M)?Z[typeof M=="string"?"string":"hash"]:Z.map}function zn(I,M){var Z=Oe(I,M);return K7(Z)?Z:void 0}function X7(I){var M=v.call(I,Wt),Z=I[Wt];try{I[Wt]=void 0;var ae=!0}catch{}var We=U.call(I);return ae&&(M?I[Wt]=Z:delete I[Wt]),We}var Q7=sn?function(I){return I==null?[]:(I=Object(I),Le(sn(I),function(M){return je.call(I,M)}))}:l9,Ar=Ki;(rt&&Ar(new rt(new ArrayBuffer(1)))!=X||Je&&Ar(new Je)!=T||nt&&Ar(nt.resolve())!=O||it&&Ar(new it)!=D||st&&Ar(new st)!=B)&&(Ar=function(I){var M=Ki(I),Z=M==C?I.constructor:void 0,ae=Z?an(Z):"";if(ae)switch(ae){case mt:return X;case wt:return T;case yt:return O;case bt:return D;case vt:return B}return M});function e9(I,M){return M=M??o,!!M&&(typeof I=="number"||pe.test(I))&&I>-1&&I%1==0&&I<M}function t9(I){var M=typeof I;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?I!=="__proto__":I===null}function r9(I){return!!P&&P in I}function n9(I){var M=I&&I.constructor,Z=typeof M=="function"&&M.prototype||g;return I===Z}function i9(I){return U.call(I)}function an(I){if(I!=null){try{return d.call(I)}catch{}try{return I+""}catch{}}return""}function pf(I,M){return I===M||I!==I&&M!==M}var s9=hf(function(){return arguments}())?hf:function(I){return Gi(I)&&v.call(I,"callee")&&!je.call(I,"callee")},ho=Array.isArray;function o9(I){return I!=null&&mf(I.length)&&!gf(I)}var Kc=Vi||h9;function a9(I,M){return uf(I,M)}function gf(I){if(!wf(I))return!1;var M=Ki(I);return M==y||M==E||M==l||M==b}function mf(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=o}function wf(I){var M=typeof I;return I!=null&&(M=="object"||M=="function")}function Gi(I){return I!=null&&typeof I=="object"}var yf=Ee?Ve(Ee):G7;function c9(I){return o9(I)?W7(I):Z7(I)}function l9(){return[]}function h9(){return!1}t.exports=a9})(da,da.exports);var r5=da.exports,n5=Object.defineProperty,Cu=Object.getOwnPropertySymbols,i5=Object.prototype.hasOwnProperty,s5=Object.prototype.propertyIsEnumerable,Iu=(t,e,r)=>e in t?n5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nt=(t,e)=>{for(var r in e||(e={}))i5.call(e,r)&&Iu(t,r,e[r]);if(Cu)for(var r of Cu(e))s5.call(e,r)&&Iu(t,r,e[r]);return t};function o5(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function m(E){if(E instanceof Uint8Array||(ArrayBuffer.isView(E)?E=new Uint8Array(E.buffer,E.byteOffset,E.byteLength):Array.isArray(E)&&(E=Uint8Array.from(E))),!(E instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(E.length===0)return"";for(var T=0,R=0,L=0,C=E.length;L!==C&&E[L]===0;)L++,T++;for(var O=(C-L)*p+1>>>0,b=new Uint8Array(O);L!==C;){for(var S=E[L],D=0,u=O-1;(S!==0||D<R)&&u!==-1;u--,D++)S+=256*b[u]>>>0,b[u]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");R=D,L++}for(var _=O-R;_!==O&&b[_]===0;)_++;for(var H=c.repeat(T);_<O;++_)H+=t.charAt(b[_]);return H}function w(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return new Uint8Array;var T=0;if(E[T]!==" "){for(var R=0,L=0;E[T]===c;)R++,T++;for(var C=(E.length-T)*l+1>>>0,O=new Uint8Array(C);E[T];){var b=r[E.charCodeAt(T)];if(b===255)return;for(var S=0,D=C-1;(b!==0||S<L)&&D!==-1;D--,S++)b+=a*O[D]>>>0,O[D]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");L=S,T++}if(E[T]!==" "){for(var u=C-L;u!==C&&O[u]===0;)u++;for(var _=new Uint8Array(R+(C-u)),H=R;u!==C;)_[H++]=O[u++];return _}}}function y(E){var T=w(E);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:m,decodeUnsafe:w,decode:y}}var a5=o5,c5=a5;const Su=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},l5=t=>new TextEncoder().encode(t),h5=t=>new TextDecoder().decode(t);class u5{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class d5{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Du(this,e)}}class f5{constructor(e){this.decoders=e}or(e){return Du(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Du=(t,e)=>new f5(Nt(Nt({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class p5{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new u5(e,r,n),this.decoder=new d5(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ws=({name:t,prefix:e,encode:r,decode:n})=>new p5(t,e,r,n),gi=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=c5(r,e);return ws({prefix:t,name:e,encode:n,decode:s=>Su(i(s))})},g5=(t,e,r,n)=>{const i={};for(let p=0;p<e.length;++p)i[e[p]]=p;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let p=0;p<s;++p){const m=i[t[p]];if(m===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|m,a+=r,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},m5=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},It=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>ws({prefix:e,name:t,encode(i){return m5(i,n,r)},decode(i){return g5(i,n,r,t)}}),w5=ws({prefix:"\0",name:"identity",encode:t=>h5(t),decode:t=>l5(t)});var y5=Object.freeze({__proto__:null,identity:w5});const b5=It({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var v5=Object.freeze({__proto__:null,base2:b5});const _5=It({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var E5=Object.freeze({__proto__:null,base8:_5});const x5=gi({prefix:"9",name:"base10",alphabet:"0123456789"});var C5=Object.freeze({__proto__:null,base10:x5});const I5=It({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),S5=It({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var D5=Object.freeze({__proto__:null,base16:I5,base16upper:S5});const O5=It({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$5=It({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),A5=It({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),P5=It({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),T5=It({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),R5=It({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),N5=It({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),M5=It({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),L5=It({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var U5=Object.freeze({__proto__:null,base32:O5,base32upper:$5,base32pad:A5,base32padupper:P5,base32hex:T5,base32hexupper:R5,base32hexpad:N5,base32hexpadupper:M5,base32z:L5});const j5=gi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),F5=gi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var B5=Object.freeze({__proto__:null,base36:j5,base36upper:F5});const k5=gi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),H5=gi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var z5=Object.freeze({__proto__:null,base58btc:k5,base58flickr:H5});const W5=It({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),q5=It({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),V5=It({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),K5=It({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var G5=Object.freeze({__proto__:null,base64:W5,base64pad:q5,base64url:V5,base64urlpad:K5});const Ou=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Z5=Ou.reduce((t,e,r)=>(t[r]=e,t),[]),Y5=Ou.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function J5(t){return t.reduce((e,r)=>(e+=Z5[r],e),"")}function X5(t){const e=[];for(const r of t){const n=Y5[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Q5=ws({prefix:"\u{1F680}",name:"base256emoji",encode:J5,decode:X5});var ey=Object.freeze({__proto__:null,base256emoji:Q5}),ty=Au,$u=128,ry=127,ny=~ry,iy=Math.pow(2,31);function Au(t,e,r){e=e||[],r=r||0;for(var n=r;t>=iy;)e[r++]=t&255|$u,t/=128;for(;t&ny;)e[r++]=t&255|$u,t>>>=7;return e[r]=t|0,Au.bytes=r-n+1,e}var sy=fa,oy=128,Pu=127;function fa(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw fa.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&Pu)<<i:(o&Pu)*Math.pow(2,i),i+=7}while(o>=oy);return fa.bytes=s-n,r}var ay=Math.pow(2,7),cy=Math.pow(2,14),ly=Math.pow(2,21),hy=Math.pow(2,28),uy=Math.pow(2,35),dy=Math.pow(2,42),fy=Math.pow(2,49),py=Math.pow(2,56),gy=Math.pow(2,63),my=function(t){return t<ay?1:t<cy?2:t<ly?3:t<hy?4:t<uy?5:t<dy?6:t<fy?7:t<py?8:t<gy?9:10},wy={encode:ty,decode:sy,encodingLength:my},Tu=wy;const Ru=(t,e,r=0)=>(Tu.encode(t,e,r),e),Nu=t=>Tu.encodingLength(t),pa=(t,e)=>{const r=e.byteLength,n=Nu(t),i=n+Nu(r),s=new Uint8Array(i+r);return Ru(t,s,0),Ru(r,s,n),s.set(e,i),new yy(t,r,e,s)};class yy{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Mu=({name:t,code:e,encode:r})=>new by(t,e,r);class by{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?pa(this.code,r):r.then(n=>pa(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Lu=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),vy=Mu({name:"sha2-256",code:18,encode:Lu("SHA-256")}),_y=Mu({name:"sha2-512",code:19,encode:Lu("SHA-512")});var Ey=Object.freeze({__proto__:null,sha256:vy,sha512:_y});const Uu=0,xy="identity",ju=Su;var Cy=Object.freeze({__proto__:null,identity:{code:Uu,name:xy,encode:ju,digest:t=>pa(Uu,ju(t))}});new TextEncoder,new TextDecoder;const Fu=Nt(Nt(Nt(Nt(Nt(Nt(Nt(Nt(Nt(Nt({},y5),v5),E5),C5),D5),U5),B5),z5),G5),ey);Nt(Nt({},Ey),Cy);function Iy(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Bu(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const ku=Bu("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),ga=Bu("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Iy(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Sy=Nt({utf8:ku,"utf-8":ku,hex:Fu.base16,latin1:ga,ascii:ga,binary:ga},Fu);function Dy(t,e="utf8"){const r=Sy[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}const Hu="wc",Oy=2,ma="core",br=`${Hu}@${2}:${ma}:`,$y={name:ma,logger:"error"},Ay={database:":memory:"},Py="crypto",zu="client_ed25519_seed",Ty=fe.ONE_DAY,Ry="keychain",Ny="0.3",My="messages",Ly="0.3",Uy=fe.SIX_HOURS,jy="publisher",Wu="irn",Fy="error",qu="wss://relay.walletconnect.com",By="relayer",gt={message:"relayer_message",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},ky="_subscription",ys={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},Hy=fe.ONE_SECOND,zy="2.6.1",Wy="0.3",nr={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},qy="subscription",Vy="0.3",Ky=fe.FIVE_SECONDS*1e3,Gy="pairing",Zy="0.3",mi={wc_pairingDelete:{req:{ttl:fe.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:fe.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:fe.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:fe.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:fe.ONE_DAY,prompt:!1,tag:0},res:{ttl:fe.ONE_DAY,prompt:!1,tag:0}}},ir={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Yy="history",Jy="0.3",Xy="expirer",Vt={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},Qy="0.3";class eb{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=Ry,this.version=Ny,this.initialized=!1,this.storagePrefix=br,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=ie("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=Be.generateChildLogger(r,this.name)}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,ph(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?gh(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}class tb{constructor(e,r,n){this.core=e,this.logger=r,this.name=Py,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),s=eu(i);return Qh(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=zg();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=eu(s),a=Bo();return await nw(a,i,Ty,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=Wg(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||qg(i);return await this.keychain.set(o,i),o},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,s,o)=>{this.isInitialized();const a=ch(o),c=ui(s);if(lh(a)){const w=a.senderPublicKey,y=a.receiverPublicKey;i=await this.generateSharedKey(w,y)}const l=this.getSymKey(i),{type:p,senderPublicKey:m}=a;return Kg({type:p,symKey:l,message:c,senderPublicKey:m})},this.decode=async(i,s,o)=>{this.isInitialized();const a=Yg(s,o);if(lh(a)){const p=a.receiverPublicKey,m=a.senderPublicKey;i=await this.generateSharedKey(p,m)}const c=this.getSymKey(i),l=Gg({symKey:c,encoded:s});return ia(l)},this.getPayloadType=i=>{const s=as(i);return Yn(s.type)},this.getPayloadSenderPublicKey=i=>{const s=as(i);return s.senderPublicKey?At(s.senderPublicKey,Pt):void 0},this.core=e,this.logger=Be.generateChildLogger(r,this.name),this.keychain=n||new eb(this.core,this.logger)}get context(){return Be.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(zu)}catch{e=Bo(),await this.keychain.set(zu,e)}return Dy(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}class rb extends Nm{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=My,this.version=Ly,this.initialized=!1,this.storagePrefix=br,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const s=os(i);let o=this.messages.get(n);return typeof o>"u"&&(o={}),typeof o[s]<"u"||(o[s]=i,this.messages.set(n,o),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),o=os(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=Be.generateChildLogger(e,this.name),this.core=r}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,ph(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?gh(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}class nb extends Mm{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new ft.exports.EventEmitter,this.name=jy,this.queue=new Map,this.publishTimeout=1e4,this.publish=async(n,i,s)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});try{const o=s?.ttl||Uy,a=ko(s),c=s?.prompt||!1,l=s?.tag||0,p={topic:n,message:i,opts:{ttl:o,relay:a,prompt:c,tag:l}},m=os(i);this.queue.set(m,p);try{await await cs(this.rpcPublish(n,i,o,a,c,l),this.publishTimeout),this.relayer.events.emit(gt.publish,p)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(gt.connection_stalled);return}this.onPublish(m,p),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}})}catch(o){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(o),o}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=Be.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return Be.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,s,o){var a,c,l,p;const m={method:ls(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o}};return Tt((a=m.params)==null?void 0:a.prompt)&&((c=m.params)==null||delete c.prompt),Tt((l=m.params)==null?void 0:l.tag)&&((p=m.params)==null||delete p.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:m}),this.relayer.request(m)}onPublish(e,r){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(oi.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()})}}class ib{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var sb=Object.defineProperty,ob=Object.defineProperties,ab=Object.getOwnPropertyDescriptors,Vu=Object.getOwnPropertySymbols,cb=Object.prototype.hasOwnProperty,lb=Object.prototype.propertyIsEnumerable,Ku=(t,e,r)=>e in t?sb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wi=(t,e)=>{for(var r in e||(e={}))cb.call(e,r)&&Ku(t,r,e[r]);if(Vu)for(var r of Vu(e))lb.call(e,r)&&Ku(t,r,e[r]);return t},wa=(t,e)=>ob(t,ab(e));class hb extends jm{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new ib,this.events=new ft.exports.EventEmitter,this.name=qy,this.version=Vy,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=br,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=ko(i),o={topic:n,relay:s};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s);return this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,s)=>{const o=new fe.Watch;o.start(this.pendingSubscriptionWatchLabel);const a=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),i(!0)),o.elapsed(this.pendingSubscriptionWatchLabel)>=Ky&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),s(!1))},this.pollingInterval)}),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Be.generateChildLogger(r,this.name),this.clientId=""}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=ko(n);await this.rpcUnsubscribe(e,r,i);const s=et("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:ls(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await cs(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(gt.connection_stalled)}return os(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:ls(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await cs(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(gt.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:ls(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,wa(wi({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,wi({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,wi({},r)),this.topicMap.set(r.topic,e),this.events.emit(nr.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=ie("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(nr.deleted,wa(wi({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(nr.sync)}async reset(){if(!this.cached.length)return;const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}this.events.emit(nr.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=ie("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);hr(r)&&this.onBatchSubscribe(r.map((n,i)=>wa(wi({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(oi.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(gt.connect,async()=>{await this.onConnect()}),this.relayer.on(gt.disconnect,()=>{this.onDisconnect()}),this.events.on(nr.created,async e=>{const r=nr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(nr.deleted,async e=>{const r=nr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var ub=Object.defineProperty,Gu=Object.getOwnPropertySymbols,db=Object.prototype.hasOwnProperty,fb=Object.prototype.propertyIsEnumerable,Zu=(t,e,r)=>e in t?ub(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pb=(t,e)=>{for(var r in e||(e={}))db.call(e,r)&&Zu(t,r,e[r]);if(Gu)for(var r of Gu(e))fb.call(e,r)&&Zu(t,r,e[r]);return t};class gb extends Lm{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new ft.exports.EventEmitter,this.name=By,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Be.generateChildLogger(e.logger,this.name):Xn(Be.getDefaultLoggerOptions({level:e.logger||Fy})),this.messages=new rb(this.logger,e.core),this.subscriber=new hb(this,this.logger),this.publisher=new nb(this,this.logger),this.relayUrl=e?.relayUrl||qu,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0}get context(){return Be.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){this.isInitialized();let n="";return await Promise.all([new Promise(i=>{this.subscriber.once(nr.created,s=>{s.topic===e&&i()})}),new Promise(async i=>{n=await this.subscriber.subscribe(e,r),i()})]),n}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(gt.transport_closed))}async transportOpen(e){if(!this.reconnecting){this.relayUrl=e||this.relayUrl,this.transportExplicitlyClosed=!1,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(nr.resubscribed,()=>{r()})}),await Promise.race([new Promise(async(r,n)=>{await cs(this.provider.connect(),5e3,"socket stalled").catch(i=>n(i)).then(()=>r()).finally(()=>this.removeListener(gt.transport_closed,this.rejectTransportOpen))}),new Promise(r=>this.once(gt.transport_closed,this.rejectTransportOpen))])])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.events.emit(gt.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||(this.relayUrl=e||this.relayUrl,await this.transportClose(),await new Promise(r=>setTimeout(r,500)),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}rejectTransportOpen(){throw new Error("closeTransport called before connection was established")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Fw(new t5(h3({sdkVersion:zy,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;return await this.subscriber.isSubscribed(r)?this.messages.has(r,n):!0}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),du(e)){if(!e.method.endsWith(ky))return;const r=e.params,{topic:n,message:i,publishedAt:s}=r.data,o={topic:n,message:i,publishedAt:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(pb({type:"event",event:r.id},o)),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(gt.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=lu(e.id,!0);await this.provider.connection.send(r)}registerProviderListeners(){this.provider.on(ys.payload,e=>this.onProviderPayload(e)),this.provider.on(ys.connect,()=>{this.events.emit(gt.connect)}),this.provider.on(ys.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(ys.error,e=>{this.logger.error(e),this.events.emit(gt.error,e)})}registerEventListeners(){this.events.on(gt.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(gt.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},fe.toMiliseconds(Hy))}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var mb=Object.defineProperty,Yu=Object.getOwnPropertySymbols,wb=Object.prototype.hasOwnProperty,yb=Object.prototype.propertyIsEnumerable,Ju=(t,e,r)=>e in t?mb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xu=(t,e)=>{for(var r in e||(e={}))wb.call(e,r)&&Ju(t,r,e[r]);if(Yu)for(var r of Yu(e))yb.call(e,r)&&Ju(t,r,e[r]);return t};class bs extends Um{constructor(e,r,n,i=br,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=Wy,this.cached=[],this.initialized=!1,this.storagePrefix=br,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!Tt(o)?this.map.set(this.getKey(o),o):P3(o)?this.map.set(o.id,o):T3(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)},this.set=async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())},this.get=o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>r5(a[c],o[c]))):this.values),this.update=async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=Xu(Xu({},this.getData(o)),a);this.map.set(o,c),await this.persist()},this.delete=async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),await this.persist())},this.logger=Be.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=ie("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=ie("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}class bb{constructor(e,r){this.core=e,this.logger=r,this.name=Gy,this.version=Zy,this.events=new ft.exports,this.initialized=!1,this.storagePrefix=br,this.ignoredPayloadTypes=[Lr],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=Bo(),i=await this.core.crypto.setSymKey(n),s=tr(fe.FIVE_MINUTES),o={protocol:Wu},a={topic:i,expiry:s,relay:o,active:!1},c=_3({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:o});return await this.pairings.set(i,a),await this.core.relayer.subscribe(i),this.core.expirer.set(i,s),{topic:i,uri:c}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:s,relay:o}=b3(n.uri);if(this.pairings.keys.includes(i))throw new Error(`Pairing already exists: ${i}`);if(this.core.crypto.hasKeys(i))throw new Error(`Keychain already exists: ${i}`);const a=tr(fe.FIVE_MINUTES),c={topic:i,relay:o,expiry:a,active:!1};return await this.pairings.set(i,c),await this.core.crypto.setSymKey(s,i),await this.core.relayer.subscribe(i,{relay:o}),this.core.expirer.set(i,a),n.activatePairing&&await this.activate({topic:i}),c},this.activate=async({topic:n})=>{this.isInitialized();const i=tr(fe.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=fn();this.events.once(tt("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",et("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const o=ha(i,s),a=await this.core.crypto.encode(n,o),c=mi[i].req;return this.core.history.set(n,o),await this.core.relayer.publish(n,a,c),o.id},this.sendResult=async(n,i,s)=>{const o=lu(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=mi[c.request.method].res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.sendError=async(n,i,s)=>{const o=Mw(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=mi[c.request.method]?mi[c.request.method].res:mi.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,et("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>yr(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n,o=s.method;if(this.pairings.keys.includes(i))switch(o){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,o=(await this.core.history.get(i,s.id)).request.method;if(this.pairings.keys.includes(i))switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit("pairing_ping",{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{pu(i)?this.events.emit(tt("pairing_ping",s),{}):ms(i)&&this.events.emit(tt("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=et("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(et("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!jt(n)){const{message:i}=ie("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!A3(n.uri)){const{message:i}=ie("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!jt(n)){const{message:s}=ie("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!jt(n)){const{message:s}=ie("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!pt(n,!1)){const{message:i}=ie("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=ie("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(yr(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=ie("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=Be.generateChildLogger(r,this.name),this.pairings=new bs(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Be.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(gt.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);du(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):fu(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(Vt.expired,async e=>{const{topic:r}=wh(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class vb extends Rm{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new ft.exports.EventEmitter,this.name=Yy,this.version=Jy,this.cached=[],this.initialized=!1,this.storagePrefix=br,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s};this.records.set(o.id,o),this.events.emit(ir.created,o)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=ms(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(ir.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(ir.deleted,s)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=Be.generateChildLogger(r,this.name)}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:ha(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=ie("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(ir.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=ie("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(ir.created,e=>{const r=ir.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(ir.updated,e=>{const r=ir.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(ir.deleted,e=>{const r=ir.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}class _b extends Fm{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new ft.exports.EventEmitter,this.name=Xy,this.version=Qy,this.cached=[],this.initialized=!1,this.storagePrefix=br,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Vt.created,{target:s,expiration:o})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Vt.deleted,{target:i,expiration:s})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=Be.generateChildLogger(r,this.name)}get context(){return Be.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return u3(e);if(typeof e=="number")return d3(e);const{message:r}=ie("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Vt.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=ie("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=ie("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;fe.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Vt.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(oi.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Vt.created,e=>{const r=Vt.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Vt.expired,e=>{const r=Vt.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Vt.deleted,e=>{const r=Vt.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Eb=Object.defineProperty,Qu=Object.getOwnPropertySymbols,xb=Object.prototype.hasOwnProperty,Cb=Object.prototype.propertyIsEnumerable,e0=(t,e,r)=>e in t?Eb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,t0=(t,e)=>{for(var r in e||(e={}))xb.call(e,r)&&e0(t,r,e[r]);if(Qu)for(var r of Qu(e))Cb.call(e,r)&&e0(t,r,e[r]);return t};class ya extends Tm{constructor(e){super(e),this.protocol=Hu,this.version=Oy,this.name=ma,this.events=new ft.exports.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||qu;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xn(Be.getDefaultLoggerOptions({level:e?.logger||$y.logger}));this.logger=Be.generateChildLogger(r,this.name),this.heartbeat=new oi.HeartBeat,this.crypto=new tb(this,this.logger,e?.keychain),this.history=new vb(this,this.logger),this.expirer=new _b(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new j2(t0(t0({},Ay),e?.storageOptions)),this.relayer=new gb({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new bb(this,this.logger)}static async init(e){const r=new ya(e);return await r.initialize(),r}get context(){return Be.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const Ib=ya,Sb="PARSE_ERROR",Db="INVALID_REQUEST",Ob="METHOD_NOT_FOUND",$b="INVALID_PARAMS",r0="INTERNAL_ERROR",ba="SERVER_ERROR",Ab=[-32700,-32600,-32601,-32602,-32603],yi={[Sb]:{code:-32700,message:"Parse error"},[Db]:{code:-32600,message:"Invalid Request"},[Ob]:{code:-32601,message:"Method not found"},[$b]:{code:-32602,message:"Invalid params"},[r0]:{code:-32603,message:"Internal error"},[ba]:{code:-32e3,message:"Server error"}},n0=ba;function Pb(t){return Ab.includes(t)}function i0(t){return Object.keys(yi).includes(t)?yi[t]:yi[n0]}function Tb(t){const e=Object.values(yi).find(r=>r.code===t);return e||yi[n0]}function Rb(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Nb(t,e,r){return{id:r||Rb(),jsonrpc:"2.0",method:t,params:e}}function Mb(t,e){return{id:t,jsonrpc:"2.0",result:e}}function Lb(t,e,r){return{id:t,jsonrpc:"2.0",error:Ub(e,r)}}function Ub(t,e){return typeof t>"u"?i0(r0):(typeof t=="string"&&(t=Object.assign(Object.assign({},i0(ba)),{message:t})),typeof e<"u"&&(t.data=e),Pb(t.code)&&(t=Tb(t.code)),t)}function s0(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function jb(t){return s0(t)&&"method"in t}function Fb(t){return s0(t)&&(vr(t)||_r(t))}function vr(t){return"result"in t}function _r(t){return"error"in t}const o0="wc",a0=2,c0="client",va=`${o0}@${a0}:${c0}:`,_a={name:c0,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Bb="proposal",l0="Proposal expired",kb="session",vs=fe.SEVEN_DAYS,Hb="engine",bi={wc_sessionPropose:{req:{ttl:fe.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:fe.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:fe.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:fe.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:fe.ONE_DAY,prompt:!1,tag:1104},res:{ttl:fe.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:fe.ONE_DAY,prompt:!1,tag:1106},res:{ttl:fe.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:fe.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:fe.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:fe.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:fe.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:fe.ONE_DAY,prompt:!1,tag:1112},res:{ttl:fe.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:fe.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:fe.THIRTY_SECONDS,prompt:!1,tag:1115}}},Ea={min:fe.FIVE_MINUTES,max:fe.SEVEN_DAYS},zb="request";var Wb=Object.defineProperty,qb=Object.defineProperties,Vb=Object.getOwnPropertyDescriptors,h0=Object.getOwnPropertySymbols,Kb=Object.prototype.hasOwnProperty,Gb=Object.prototype.propertyIsEnumerable,u0=(t,e,r)=>e in t?Wb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kt=(t,e)=>{for(var r in e||(e={}))Kb.call(e,r)&&u0(t,r,e[r]);if(h0)for(var r of h0(e))Gb.call(e,r)&&u0(t,r,e[r]);return t},xa=(t,e)=>qb(t,Vb(e));class Zb extends km{constructor(e){super(e),this.name=Hb,this.events=new ft.exports,this.initialized=!1,this.ignoredPayloadTypes=[Lr],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(bi)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized();const n=xa(Kt({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:c}=n;let l=i,p,m=!1;if(l&&(m=this.client.core.pairing.pairings.get(l).active),!l||!m){const{topic:O,uri:b}=await this.client.core.pairing.create();l=O,p=b}const w=await this.client.core.crypto.generateKeyPair(),y=Kt({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:Wu}],proposer:{publicKey:w,metadata:this.client.metadata}},a&&{sessionProperties:a}),{reject:E,resolve:T,done:R}=fn(fe.FIVE_MINUTES,l0);if(this.events.once(tt("session_connect"),async({error:O,session:b})=>{if(O)E(O);else if(b){b.self.publicKey=w;const S=xa(Kt({},b),{requiredNamespaces:b.requiredNamespaces,optionalNamespaces:b.optionalNamespaces});await this.client.session.set(b.topic,S),await this.setExpiry(b.topic,b.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:b.peer.metadata}),T(S)}}),!l){const{message:O}=ie("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(O)}const L=await this.sendRequest(l,"wc_sessionPropose",y),C=tr(fe.FIVE_MINUTES);return await this.setProposal(L,Kt({id:L,expiry:C},y)),{uri:p,approval:R}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:s,sessionProperties:o}=r,a=this.client.proposal.get(n);let{pairingTopic:c,proposer:l,requiredNamespaces:p,optionalNamespaces:m}=a;c=c||"",gn(p)||(p=I3(s,"approve()"));const w=await this.client.core.crypto.generateKeyPair(),y=l.publicKey,E=await this.client.core.crypto.generateSharedKey(w,y);c&&n&&(await this.client.core.pairing.updateMetadata({topic:c,metadata:l.metadata}),await this.sendResult(n,c,{relay:{protocol:i??"irn"},responderPublicKey:w}),await this.client.proposal.delete(n,et("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:c}));const T=Kt({relay:{protocol:i??"irn"},namespaces:s,requiredNamespaces:p,optionalNamespaces:m,pairingTopic:c,controller:{publicKey:w,metadata:this.client.metadata},expiry:tr(vs)},o&&{sessionProperties:o});await this.client.core.relayer.subscribe(E),await this.sendRequest(E,"wc_sessionSettle",T);const R=xa(Kt({},T),{topic:E,pairingTopic:c,acknowledged:!1,self:T.controller,peer:{publicKey:l.publicKey,metadata:l.metadata},controller:w});return await this.client.session.set(E,R),await this.setExpiry(E,tr(vs)),{topic:E,acknowledged:()=>new Promise(L=>L(this.client.session.get(E)))}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:s}=this.client.proposal.get(n);s&&(await this.sendError(n,s,i),await this.client.proposal.delete(n,et("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,s=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:o,resolve:a,reject:c}=fn();return this.events.once(tt("session_update",s),({error:l})=>{l?c(l):a()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:o}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:s,resolve:o,reject:a}=fn();return this.events.once(tt("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,tr(vs)),{acknowledged:s}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:s,expiry:o}=r,a=await this.sendRequest(s,"wc_sessionRequest",{request:i,chainId:n},o),{done:c,resolve:l,reject:p}=fn(o);return this.events.once(tt("session_request",a),({error:m,result:w})=>{m?p(m):l(w)}),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:a}),await c()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i;vr(i)?await this.sendResult(s,n,i.result):_r(i)&&await this.sendError(s,n,i.error),this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0})},this.ping=async r=>{this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest(n,"wc_sessionPing",{}),{done:s,resolve:o,reject:a}=fn();this.events.once(tt("session_ping",i),({error:c})=>{c?a(c):o()}),await s()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:s})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest(n,"wc_sessionDelete",et("USER_DISCONNECTED")),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>O3(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await Promise.all([this.client.session.delete(r,et("USER_DISCONNECTED")),this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.deleteSymKey(r),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,et("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=bi.wc_sessionRequest.req.ttl,{id:i,topic:s,params:o}=r;await this.client.pendingRequest.set(i,{id:i,topic:s,params:o}),n&&this.client.core.expirer.set(i,tr(n))},this.sendRequest=async(r,n,i,s)=>{const o=Nb(n,i),a=await this.client.core.crypto.encode(r,o),c=bi[n].req;return s&&(c.ttl=s),this.client.core.history.set(r,o),this.client.core.relayer.publish(r,a,c),o.id},this.sendResult=async(r,n,i)=>{const s=Mb(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=bi[a.request.method].res;this.client.core.relayer.publish(n,o,c),await this.client.core.history.resolve(s)},this.sendError=async(r,n,i)=>{const s=Lb(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=bi[a.request.method].res;this.client.core.relayer.publish(n,o,c),await this.client.core.history.resolve(s)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{yr(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{yr(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=r=>{const{topic:n,payload:i}=r,s=i.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${s}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,s=(await this.client.core.history.get(n,i.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidConnect(Kt({},n.params));const o=tr(fe.FIVE_MINUTES),a=Kt({id:s,pairingTopic:r,expiry:o},i);await this.setProposal(s,a),this.client.events.emit("session_proposal",{id:s,params:a})}catch(o){await this.sendError(s,r,o),this.client.logger.error(o)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(vr(n)){const{result:s}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const o=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});const a=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:a});const c=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const l=await this.client.core.crypto.generateSharedKey(a,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:l});const p=await this.client.core.relayer.subscribe(l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:p}),await this.client.core.pairing.activate({topic:r})}else _r(n)&&(await this.client.proposal.delete(i,et("USER_DISCONNECTED")),this.events.emit(tt("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,requiredNamespaces:p,optionalNamespaces:m,sessionProperties:w,pairingTopic:y}=n.params,E=Kt({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:y,requiredNamespaces:p,optionalNamespaces:m,controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},w&&{sessionProperties:w});await this.sendResult(n.id,r,!0),this.events.emit(tt("session_connect"),{session:E})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;vr(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(tt("session_approve",i),{})):_r(n)&&(await this.client.session.delete(r,et("USER_DISCONNECTED")),this.events.emit(tt("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidUpdate(Kt({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(s,r,!0),this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(o){await this.sendError(s,r,o),this.client.logger.error(o)}},this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;vr(n)?this.events.emit(tt("session_update",i),{}):_r(n)&&this.events.emit(tt("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,tr(vs)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;vr(n)?this.events.emit(tt("session_extend",i),{}):_r(n)&&this.events.emit(tt("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{vr(n)?this.events.emit(tt("session_ping",i),{}):_r(n)&&this.events.emit(tt("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),this.client.core.relayer.once(gt.publish,async()=>{await this.deleteSession(r)}),await this.sendResult(i,r,!0),this.client.events.emit("session_delete",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidRequest(Kt({topic:r},s)),await this.setPendingSessionRequest({id:i,topic:r,params:s}),this.client.events.emit("session_request",{id:i,topic:r,params:s})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;vr(n)?this.events.emit(tt("session_request",i),{result:n.result}):_r(n)&&this.events.emit(tt("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidEmit(Kt({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.isValidConnect=async r=>{if(!jt(r)){const{message:c}=ie("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(Tt(n)||await this.isValidPairingTopic(n),!B3(a,!0)){const{message:c}=ie("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!Tt(i)&&gn(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Tt(s)&&gn(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Tt(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=F3(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!jt(r))throw new Error(ie("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o}=r;await this.isValidProposalId(n);const a=this.client.proposal.get(n),c=hs(i,"approve()");if(c)throw new Error(c.message);const l=Ch(a.requiredNamespaces,i,"approve()");if(l)throw new Error(l.message);if(!pt(s,!0)){const{message:p}=ie("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(p)}Tt(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!jt(r)){const{message:s}=ie("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!H3(i)){const{message:s}=ie("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!jt(r)){const{message:l}=ie("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!Eh(n)){const{message:l}=ie("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=R3(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=hs(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(yr(o)){const{message:l}=ie("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!jt(r)){const{message:c}=ie("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const s=this.client.session.get(n),o=hs(i,"update()");if(o)throw new Error(o.message);const a=Ch(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!jt(r)){const{message:i}=ie("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!jt(r)){const{message:c}=ie("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:o}=r;await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!xh(a,s)){const{message:c}=ie("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!z3(i)){const{message:c}=ie("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!V3(a,s,i.method)){const{message:c}=ie("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!Y3(o,Ea)){const{message:c}=ie("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${Ea.min} and ${Ea.max}`);throw new Error(c)}},this.isValidRespond=async r=>{if(!jt(r)){const{message:s}=ie("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(s)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!W3(i)){const{message:s}=ie("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidPing=async r=>{if(!jt(r)){const{message:i}=ie("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!jt(r)){const{message:a}=ie("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!xh(o,s)){const{message:a}=ie("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!q3(i)){const{message:a}=ie("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!K3(o,s,i.name)){const{message:a}=ie("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!jt(r)){const{message:i}=ie("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!pt(i,!1)){const{message:s}=ie("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})}}isInitialized(){if(!this.initialized){const{message:e}=ie("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(gt.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);jb(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):Fb(i)&&(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.client.core.expirer.on(Vt.expired,async e=>{const{topic:r,id:n}=wh(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ie("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}isValidPairingTopic(e){if(!pt(e,!1)){const{message:r}=ie("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=ie("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(yr(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=ie("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!pt(e,!1)){const{message:r}=ie("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=ie("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(yr(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=ie("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(pt(e,!1)){const{message:r}=ie("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=ie("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!k3(e)){const{message:r}=ie("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=ie("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(yr(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=ie("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class Yb extends bs{constructor(e,r){super(e,r,Bb,va),this.core=e,this.logger=r}}class Jb extends bs{constructor(e,r){super(e,r,kb,va),this.core=e,this.logger=r}}class Xb extends bs{constructor(e,r){super(e,r,zb,va,n=>n.id),this.core=e,this.logger=r}}class Ca extends Bm{constructor(e){super(e),this.protocol=o0,this.version=a0,this.name=_a.name,this.events=new ft.exports.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||_a.name,this.metadata=e?.metadata||o3();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xn(Be.getDefaultLoggerOptions({level:e?.logger||_a.logger}));this.core=e?.core||new Ib(e),this.logger=Be.generateChildLogger(r,this.name),this.session=new Jb(this.core,this.logger),this.proposal=new Yb(this.core,this.logger),this.pendingRequest=new Xb(this.core,this.logger),this.engine=new Zb(this)}static async init(e){const r=new Ca(e);return await r.initialize(),r}get context(){return Be.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}function d0(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Qb(t=6){return BigInt(d0(t))}function ev(t,e,r){return{id:r||d0(),jsonrpc:"2.0",method:t,params:e}}function tv(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function rv(t){return tv(t)&&(nv(t)||f0(t))}function nv(t){return"result"in t}function f0(t){return"error"in t}class bn extends hu{constructor(e){super(e),this.events=new ft.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(ev(e.method,e.params||[],Qb().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{f0(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),rv(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}var Ia={exports:{}};(function(t,e){var r=typeof self<"u"?self:dt,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(x){return x&&DataView.prototype.isPrototypeOf(x)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],p=ArrayBuffer.isView||function(x){return x&&l.indexOf(Object.prototype.toString.call(x))>-1};function m(x){if(typeof x!="string"&&(x=String(x)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(x))throw new TypeError("Invalid character in header field name");return x.toLowerCase()}function w(x){return typeof x!="string"&&(x=String(x)),x}function y(x){var $={next:function(){var K=x.shift();return{done:K===void 0,value:K}}};return a.iterable&&($[Symbol.iterator]=function(){return $}),$}function E(x){this.map={},x instanceof E?x.forEach(function($,K){this.append(K,$)},this):Array.isArray(x)?x.forEach(function($){this.append($[0],$[1])},this):x&&Object.getOwnPropertyNames(x).forEach(function($){this.append($,x[$])},this)}E.prototype.append=function(x,$){x=m(x),$=w($);var K=this.map[x];this.map[x]=K?K+", "+$:$},E.prototype.delete=function(x){delete this.map[m(x)]},E.prototype.get=function(x){return x=m(x),this.has(x)?this.map[x]:null},E.prototype.has=function(x){return this.map.hasOwnProperty(m(x))},E.prototype.set=function(x,$){this.map[m(x)]=w($)},E.prototype.forEach=function(x,$){for(var K in this.map)this.map.hasOwnProperty(K)&&x.call($,this.map[K],K,this)},E.prototype.keys=function(){var x=[];return this.forEach(function($,K){x.push(K)}),y(x)},E.prototype.values=function(){var x=[];return this.forEach(function($){x.push($)}),y(x)},E.prototype.entries=function(){var x=[];return this.forEach(function($,K){x.push([K,$])}),y(x)},a.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function T(x){if(x.bodyUsed)return Promise.reject(new TypeError("Already read"));x.bodyUsed=!0}function R(x){return new Promise(function($,K){x.onload=function(){$(x.result)},x.onerror=function(){K(x.error)}})}function L(x){var $=new FileReader,K=R($);return $.readAsArrayBuffer(x),K}function C(x){var $=new FileReader,K=R($);return $.readAsText(x),K}function O(x){for(var $=new Uint8Array(x),K=new Array($.length),Y=0;Y<$.length;Y++)K[Y]=String.fromCharCode($[Y]);return K.join("")}function b(x){if(x.slice)return x.slice(0);var $=new Uint8Array(x.byteLength);return $.set(new Uint8Array(x)),$.buffer}function S(){return this.bodyUsed=!1,this._initBody=function(x){this._bodyInit=x,x?typeof x=="string"?this._bodyText=x:a.blob&&Blob.prototype.isPrototypeOf(x)?this._bodyBlob=x:a.formData&&FormData.prototype.isPrototypeOf(x)?this._bodyFormData=x:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(x)?this._bodyText=x.toString():a.arrayBuffer&&a.blob&&c(x)?(this._bodyArrayBuffer=b(x.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(x)||p(x))?this._bodyArrayBuffer=b(x):this._bodyText=x=Object.prototype.toString.call(x):this._bodyText="",this.headers.get("content-type")||(typeof x=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(x)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var x=T(this);if(x)return x;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?T(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(L)}),this.text=function(){var x=T(this);if(x)return x;if(this._bodyBlob)return C(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(O(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(H)}),this.json=function(){return this.text().then(JSON.parse)},this}var D=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function u(x){var $=x.toUpperCase();return D.indexOf($)>-1?$:x}function _(x,$){$=$||{};var K=$.body;if(x instanceof _){if(x.bodyUsed)throw new TypeError("Already read");this.url=x.url,this.credentials=x.credentials,$.headers||(this.headers=new E(x.headers)),this.method=x.method,this.mode=x.mode,this.signal=x.signal,!K&&x._bodyInit!=null&&(K=x._bodyInit,x.bodyUsed=!0)}else this.url=String(x);if(this.credentials=$.credentials||this.credentials||"same-origin",($.headers||!this.headers)&&(this.headers=new E($.headers)),this.method=u($.method||this.method||"GET"),this.mode=$.mode||this.mode||null,this.signal=$.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&K)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(K)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})};function H(x){var $=new FormData;return x.trim().split("&").forEach(function(K){if(K){var Y=K.split("="),W=Y.shift().replace(/\+/g," "),z=Y.join("=").replace(/\+/g," ");$.append(decodeURIComponent(W),decodeURIComponent(z))}}),$}function B(x){var $=new E,K=x.replace(/\r?\n[\t ]+/g," ");return K.split(/\r?\n/).forEach(function(Y){var W=Y.split(":"),z=W.shift().trim();if(z){var J=W.join(":").trim();$.append(z,J)}}),$}S.call(_.prototype);function q(x,$){$||($={}),this.type="default",this.status=$.status===void 0?200:$.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in $?$.statusText:"OK",this.headers=new E($.headers),this.url=$.url||"",this._initBody(x)}S.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new E(this.headers),url:this.url})},q.error=function(){var x=new q(null,{status:0,statusText:""});return x.type="error",x};var X=[301,302,303,307,308];q.redirect=function(x,$){if(X.indexOf($)===-1)throw new RangeError("Invalid status code");return new q(null,{status:$,headers:{location:x}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function($,K){this.message=$,this.name=K;var Y=Error($);this.stack=Y.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function te(x,$){return new Promise(function(K,Y){var W=new _(x,$);if(W.signal&&W.signal.aborted)return Y(new o.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function J(){z.abort()}z.onload=function(){var G={status:z.status,statusText:z.statusText,headers:B(z.getAllResponseHeaders()||"")};G.url="responseURL"in z?z.responseURL:G.headers.get("X-Request-URL");var ce="response"in z?z.response:z.responseText;K(new q(ce,G))},z.onerror=function(){Y(new TypeError("Network request failed"))},z.ontimeout=function(){Y(new TypeError("Network request failed"))},z.onabort=function(){Y(new o.DOMException("Aborted","AbortError"))},z.open(W.method,W.url,!0),W.credentials==="include"?z.withCredentials=!0:W.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&a.blob&&(z.responseType="blob"),W.headers.forEach(function(G,ce){z.setRequestHeader(ce,G)}),W.signal&&(W.signal.addEventListener("abort",J),z.onreadystatechange=function(){z.readyState===4&&W.signal.removeEventListener("abort",J)}),z.send(typeof W._bodyInit>"u"?null:W._bodyInit)})}return te.polyfill=!0,s.fetch||(s.fetch=te,s.Headers=E,s.Request=_,s.Response=q),o.Headers=E,o.Request=_,o.Response=q,o.fetch=te,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(Ia,Ia.exports);var p0=vf(Ia.exports);const g0={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},m0=10;class vn{constructor(e){if(this.url=e,this.events=new ft.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!_u(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,r){this.isAvailable||await this.register();try{const n=ui(e),s=await(await p0(this.url,Object.assign(Object.assign({},g0),{body:n}))).json();this.onPayload({data:s})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!_u(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{const r=ui({id:1,jsonrpc:"2.0",method:"test",params:[]});await p0(e,Object.assign(Object.assign({},g0),{body:r})),this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?ia(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=bu(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return yu(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>m0&&this.events.setMaxListeners(m0)}}const w0="error",iv="wss://relay.walletconnect.com",sv="wc",ov="universal_provider",y0=`${sv}@${2}:${ov}:`,av="https://rpc.walletconnect.com/v1",kr={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var cv=Object.defineProperty,b0=Object.getOwnPropertySymbols,lv=Object.prototype.hasOwnProperty,hv=Object.prototype.propertyIsEnumerable,v0=(t,e,r)=>e in t?cv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sa=(t,e)=>{for(var r in e||(e={}))lv.call(e,r)&&v0(t,r,e[r]);if(b0)for(var r of b0(e))hv.call(e,r)&&v0(t,r,e[r]);return t};function sr(t,e,r){let n;const i=Da(t);return e.rpcMap&&(n=e.rpcMap[i]),n||(n=`${av}?chainId=eip155:${i}&projectId=${r}`),n}function Da(t){return t.includes("eip155")?Number(t.split(":")[1]):Number(t)}function uv(t,e){if(!e.includes(t))throw new Error(`Chain '${t}' not approved. Please use one of the following: ${e.toString()}`)}function dv(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function fv(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function pv(t,e={}){const r=_0(t),n=_0(e);return Sa({},Object.assign(r,n))}function _0(t){var e,r,n,i;const s={};if(!gn(t))return s;for(const[o,a]of Object.entries(t)){const c=E0(o)?[o]:a.chains,l=a.methods||[],p=a.events||[],m=x0(o);s[m]={chains:Oa(c,(e=s[m])==null?void 0:e.chains),methods:Oa(l,(r=s[m])==null?void 0:r.methods),events:Oa(p,(n=s[m])==null?void 0:n.events),rpcMap:Sa(Sa({},(i=s[m])==null?void 0:i.rpcMap),a.rpcMap)}}return s}function E0(t){return t.includes(":")}function x0(t){return E0(t)?t.split(":")[0]:t}function Oa(t=[],e=[]){return[...new Set([...t,...e])]}const _n=(t,e)=>{const r=n=>{n.request!==e.request||n.topic!==e.topic||(t.events.removeListener("session_request_sent",r),gv(e))};t.on("session_request_sent",r)};function gv(t){if(typeof window<"u")try{const e=window.localStorage.getItem("WALLETCONNECT_DEEPLINK_CHOICE");if(e){const r=JSON.parse(e),n=r?.href;if(typeof n=="string"){n.endsWith("/")&&n.slice(0,-1);const i=`${n}/wc?requestId=${t.id}&sessionTopic=${t.topic}`;window.open(i,"_self","noreferrer noopener")}}}catch(e){console.error(e)}}class mv{constructor(e){this.name="eip155",this.namespace=e.namespace,this.client=e.client,this.events=e.events,this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){var r;switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return this.handleSwitchChain(e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0"),null;case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),await this.client.request(e)):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){const n=Da(e);if(!this.httpProviders[n]){const i=r||sr(`${this.name}:${n}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${n}`);this.setHttpProvider(n,i)}this.chainId=n,this.events.emit(kr.DEFAULT_CHAIN_CHANGED,`${this.name}:${n}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||sr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new bn(new vn(n))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Da(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}handleSwitchChain(e){const r=parseInt(e,16),n=`${this.name}:${r}`;uv(n,this.namespace.chains),this.setDefaultChain(`${r}`)}}class wv{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||sr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(kr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||sr(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new bn(new vn(n))}}class yv{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||sr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(kr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||sr(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new bn(new vn(n))}}class bv{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(kr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r);e[r]=this.createHttpProvider(r,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new bn(new vn(n))}}class vv{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||sr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(kr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||sr(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new bn(new vn(n))}}class _v{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?(_n(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||sr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(kr.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||sr(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new bn(new vn(n))}}var Ev=Object.defineProperty,xv=Object.defineProperties,Cv=Object.getOwnPropertyDescriptors,C0=Object.getOwnPropertySymbols,Iv=Object.prototype.hasOwnProperty,Sv=Object.prototype.propertyIsEnumerable,I0=(t,e,r)=>e in t?Ev(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_s=(t,e)=>{for(var r in e||(e={}))Iv.call(e,r)&&I0(t,r,e[r]);if(C0)for(var r of C0(e))Sv.call(e,r)&&I0(t,r,e[r]);return t},$a=(t,e)=>xv(t,Cv(e));class Aa{constructor(e){this.events=new ft.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xn(Be.getDefaultLoggerOptions({level:e?.logger||w0}))}static async init(e){const r=new Aa(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:_s({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:et("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s}).catch(s=>{if(s.message!==l0)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(hr(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Ca.init({logger:this.providerOpts.logger||w0,relayUrl:this.providerOpts.relayUrl||iv,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");[...new Set(Object.keys(this.session.namespaces).map(e=>x0(e)))].forEach(e=>{if(!this.session)return;const r=fv(e,this.session),n=dv(r),i=pv(this.namespaces,this.optionalNamespaces),s=$a(_s({},i[e]),{accounts:r,chains:n});switch(e){case"eip155":this.rpcProviders[e]=new mv({client:this.client,namespace:s,events:this.events});break;case"solana":this.rpcProviders[e]=new wv({client:this.client,namespace:s,events:this.events});break;case"cosmos":this.rpcProviders[e]=new yv({client:this.client,namespace:s,events:this.events});break;case"polkadot":break;case"cip34":this.rpcProviders[e]=new bv({client:this.client,namespace:s,events:this.events});break;case"elrond":this.rpcProviders[e]=new vv({client:this.client,namespace:s,events:this.events});break;case"multiversx":this.rpcProviders[e]=new _v({client:this.client,namespace:s,events:this.events});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?this.events.emit("accountsChanged",n.data):n.name==="chainChanged"?this.onChainChanged(r.chainId):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=$a(_s({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",$a(_s({},et("USER_DISCONNECTED")),{data:e.topic}))}),this.on(kr.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;if(!r||!Object.keys(r).length)throw new Error("Namespaces must be not empty");this.namespaces=r,this.optionalNamespaces=n,this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(r&&!Object.keys(this.namespaces).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Object.keys(this.namespaces)[0],s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){const[n,i]=this.validateChain(e);r||this.getProvider(n).setDefaultChain(i),this.namespaces[n].defaultChain=i,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${y0}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${y0}/${e}`)}}const Dv=Aa,Ov="wc",$v="ethereum_provider",Av=`${Ov}@${2}:${$v}:`,Pv="https://rpc.walletconnect.com/v1/",Es=["eth_sendTransaction","personal_sign"],Tv=["eth_accounts","eth_requestAccounts","eth_call","eth_getBalance","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],xs=["chainChanged","accountsChanged"],Rv=["message","disconnect","connect"];var Nv=Object.defineProperty,Mv=Object.defineProperties,Lv=Object.getOwnPropertyDescriptors,S0=Object.getOwnPropertySymbols,Uv=Object.prototype.hasOwnProperty,jv=Object.prototype.propertyIsEnumerable,D0=(t,e,r)=>e in t?Nv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pa=(t,e)=>{for(var r in e||(e={}))Uv.call(e,r)&&D0(t,r,e[r]);if(S0)for(var r of S0(e))jv.call(e,r)&&D0(t,r,e[r]);return t},O0=(t,e)=>Mv(t,Lv(e));function Ta(t){return Number(t[0].split(":")[1])}function Ra(t){return`0x${t.toString(16)}`}function Fv(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!hr(e))throw new Error("Invalid chains");const c=e,l=n||Es,p=s||xs,m={[Ta(c)]:a[Ta(c)]},w={chains:c,methods:l,events:p,rpcMap:m},y=s?.filter(L=>!xs.includes(L)),E=n?.filter(L=>!Es.includes(L));if(!r&&!o&&!i&&!(y!=null&&y.length)&&!(E!=null&&E.length))return{required:w};const T=y?.length&&E?.length||!r,R={chains:[...new Set(T?c.concat(r||[]):r)],methods:[...new Set(l.concat(i||[]))],events:[...new Set(p.concat(o||[]))],rpcMap:a};return{required:w,optional:R}}class Cs{constructor(){this.events=new ft.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Av,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Cs;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=Fv(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(O0(Pa({namespaces:{[this.namespace]:r}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;this.setChainIds(this.rpc.chains);const s=kg(i.namespaces,[this.namespace]);this.setAccounts(s),this.events.emit("connect",{chainId:Ra(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Ra(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",O0(Pa({},et("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}setHttpProvider(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Ra(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.setHttpProvider(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;return{chains:((r=e.chains)==null?void 0:r.map(i=>this.formatChainId(i)))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map(i=>this.formatChainId(i)):void 0,methods:e?.methods||Es,events:e?.events||xs,optionalMethods:e?.optionalMethods||[],optionalEvents:e?.optionalEvents||[],rpcMap:e?.rpcMap||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),showQrModal:Boolean(e?.showQrModal),qrModalOptions:(n=e?.qrModalOptions)!=null?n:void 0,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=Ta(this.rpc.chains),this.signer=await Dv.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal)try{const{Web3Modal:r}=await Promise.resolve().then(function(){return u6});this.modal=new r(Pa({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch{throw new Error("To use QR modal, please install @web3modal/standalone package")}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&hr(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=i?.[s]||this.getRpcUrl(s)})),n&&hr(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=i?.[s]||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${Pv}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`);this.setChainIds(e?[this.formatChainId(e)]:this.session.namespaces[this.namespace].accounts),this.setAccounts(this.session.namespaces[this.namespace].accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const Bv=Cs,kv=Symbol(),$0=Object.getPrototypeOf,Na=new WeakMap,Hv=t=>t&&(Na.has(t)?Na.get(t):$0(t)===Object.prototype||$0(t)===Array.prototype),zv=t=>Hv(t)&&t[kv]||null,A0=(t,e=!0)=>{Na.set(t,e)},Ma=t=>typeof t=="object"&&t!==null,Hr=new WeakMap,Is=new WeakSet,Wv=(t=Object.is,e=(l,p)=>new Proxy(l,p),r=l=>Ma(l)&&!Is.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},i=new WeakMap,s=(l,p,m=n)=>{const w=i.get(l);if(w?.[0]===p)return w[1];const y=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return A0(y,!0),i.set(l,[p,y]),Reflect.ownKeys(l).forEach(E=>{if(Object.getOwnPropertyDescriptor(y,E))return;const T=Reflect.get(l,E),R={value:T,enumerable:!0,configurable:!0};if(Is.has(T))A0(T,!1);else if(T instanceof Promise)delete R.value,R.get=()=>m(T);else if(Hr.has(T)){const[L,C]=Hr.get(T);R.value=s(L,C(),m)}Object.defineProperty(y,E,R)}),y},o=new WeakMap,a=[1,1],c=l=>{if(!Ma(l))throw new Error("object required");const p=o.get(l);if(p)return p;let m=a[0];const w=new Set,y=(H,B=++a[0])=>{m!==B&&(m=B,w.forEach(q=>q(H,B)))};let E=a[1];const T=(H=++a[1])=>(E!==H&&!w.size&&(E=H,L.forEach(([B])=>{const q=B[1](H);q>m&&(m=q)})),m),R=H=>(B,q)=>{const X=[...B];X[1]=[H,...X[1]],y(X,q)},L=new Map,C=(H,B)=>{if(void 0!=="production"&&L.has(H))throw new Error("prop listener already exists");if(w.size){const q=B[3](R(H));L.set(H,[B,q])}else L.set(H,[B])},O=H=>{var B;const q=L.get(H);q&&(L.delete(H),(B=q[1])==null||B.call(q))},b=H=>(w.add(H),w.size===1&&L.forEach(([q,X],te)=>{if(void 0!=="production"&&X)throw new Error("remove already exists");const x=q[3](R(te));L.set(te,[q,x])}),()=>{w.delete(H),w.size===0&&L.forEach(([q,X],te)=>{X&&(X(),L.set(te,[q]))})}),S=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),u=e(S,{deleteProperty(H,B){const q=Reflect.get(H,B);O(B);const X=Reflect.deleteProperty(H,B);return X&&y(["delete",[B],q]),X},set(H,B,q,X){const te=Reflect.has(H,B),x=Reflect.get(H,B,X);if(te&&(t(x,q)||o.has(q)&&t(x,o.get(q))))return!0;O(B),Ma(q)&&(q=zv(q)||q);let $=q;if(q instanceof Promise)q.then(K=>{q.status="fulfilled",q.value=K,y(["resolve",[B],K])}).catch(K=>{q.status="rejected",q.reason=K,y(["reject",[B],K])});else{!Hr.has(q)&&r(q)&&($=c(q));const K=!Is.has($)&&Hr.get($);K&&C(B,K)}return Reflect.set(H,B,$,X),y(["set",[B],q,x]),!0}});o.set(l,u);const _=[S,T,s,b];return Hr.set(u,_),Reflect.ownKeys(l).forEach(H=>{const B=Object.getOwnPropertyDescriptor(l,H);"value"in B&&(u[H]=l[H],delete B.value,delete B.writable),Object.defineProperty(S,H,B)}),u})=>[c,Hr,Is,t,e,r,n,i,s,o,a],[qv]=Wv();function Er(t={}){return qv(t)}function zr(t,e,r){const n=Hr.get(t);void 0!=="production"&&!n&&console.warn("Please use proxy object");let i;const s=[],o=n[3];let a=!1;const l=o(p=>{if(s.push(p),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,l()}}var P0={},Ss={};Ss.byteLength=Gv,Ss.toByteArray=Yv,Ss.fromByteArray=Qv;for(var or=[],Gt=[],Vv=typeof Uint8Array<"u"?Uint8Array:Array,La="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",En=0,Kv=La.length;En<Kv;++En)or[En]=La[En],Gt[La.charCodeAt(En)]=En;Gt["-".charCodeAt(0)]=62,Gt["_".charCodeAt(0)]=63;function T0(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Gv(t){var e=T0(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Zv(t,e,r){return(e+r)*3/4-r}function Yv(t){var e,r=T0(t),n=r[0],i=r[1],s=new Vv(Zv(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=Gt[t.charCodeAt(c)]<<18|Gt[t.charCodeAt(c+1)]<<12|Gt[t.charCodeAt(c+2)]<<6|Gt[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Gt[t.charCodeAt(c)]<<2|Gt[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Gt[t.charCodeAt(c)]<<10|Gt[t.charCodeAt(c+1)]<<4|Gt[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Jv(t){return or[t>>18&63]+or[t>>12&63]+or[t>>6&63]+or[t&63]}function Xv(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(Jv(n));return i.join("")}function Qv(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(Xv(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(or[e>>2]+or[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(or[e>>10]+or[e>>4&63]+or[e<<2&63]+"=")),i.join("")}var Ua={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ua.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<<a)-1,l=c>>1,p=-7,m=r?i-1:0,w=r?-1:1,y=t[e+m];for(m+=w,s=y&(1<<-p)-1,y>>=-p,p+=a;p>0;s=s*256+t[e+m],m+=w,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+m],m+=w,p-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(y?-1:1)*o*Math.pow(2,s-n)},Ua.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,p=(1<<l)-1,m=p>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:s-1,E=n?1:-1,T=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+m>=1?e+=w/c:e+=w*Math.pow(2,1-m),e*c>=2&&(o++,c/=2),o+m>=p?(a=0,o=p):o+m>=1?(a=(e*c-1)*Math.pow(2,i),o=o+m):(a=e*Math.pow(2,m-1)*Math.pow(2,i),o=0));i>=8;t[r+y]=a&255,y+=E,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[r+y]=o&255,y+=E,o/=256,l-=8);t[r+y-E]|=T*128};/*!
|
|
73
73
|
* The buffer module from node.js, for the browser.
|
|
74
74
|
*
|
|
75
75
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
76
76
|
* @license MIT
|
|
77
|
-
*/(function(t){const e=Cs,r=La,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=C,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const g=new Uint8Array(1),h={foo:function(){return 42}};return Object.setPrototypeOf(h,Uint8Array.prototype),Object.setPrototypeOf(g,h),g.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(g){if(g>i)throw new RangeError('The value "'+g+'" is invalid for option "size"');const h=new Uint8Array(g);return Object.setPrototypeOf(h,a.prototype),h}function a(g,h,d){if(typeof g=="number"){if(typeof h=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(g)}return c(g,h,d)}a.poolSize=8192;function c(g,h,d){if(typeof g=="string")return w(g,h);if(ArrayBuffer.isView(g))return E(g);if(g==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g);if(me(g,ArrayBuffer)||g&&me(g.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(g,SharedArrayBuffer)||g&&me(g.buffer,SharedArrayBuffer)))return T(g,h,d);if(typeof g=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const v=g.valueOf&&g.valueOf();if(v!=null&&v!==g)return a.from(v,h,d);const P=N(g);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof g[Symbol.toPrimitive]=="function")return a.from(g[Symbol.toPrimitive]("string"),h,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g)}a.from=function(g,h,d){return c(g,h,d)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(g){if(typeof g!="number")throw new TypeError('"size" argument must be of type number');if(g<0)throw new RangeError('The value "'+g+'" is invalid for option "size"')}function p(g,h,d){return l(g),g<=0?o(g):h!==void 0?typeof d=="string"?o(g).fill(h,d):o(g).fill(h):o(g)}a.alloc=function(g,h,d){return p(g,h,d)};function m(g){return l(g),o(g<0?0:L(g)|0)}a.allocUnsafe=function(g){return m(g)},a.allocUnsafeSlow=function(g){return m(g)};function w(g,h){if((typeof h!="string"||h==="")&&(h="utf8"),!a.isEncoding(h))throw new TypeError("Unknown encoding: "+h);const d=D(g,h)|0;let v=o(d);const P=v.write(g,h);return P!==d&&(v=v.slice(0,P)),v}function y(g){const h=g.length<0?0:L(g.length)|0,d=o(h);for(let v=0;v<h;v+=1)d[v]=g[v]&255;return d}function E(g){if(me(g,Uint8Array)){const h=new Uint8Array(g);return T(h.buffer,h.byteOffset,h.byteLength)}return y(g)}function T(g,h,d){if(h<0||g.byteLength<h)throw new RangeError('"offset" is outside of buffer bounds');if(g.byteLength<h+(d||0))throw new RangeError('"length" is outside of buffer bounds');let v;return h===void 0&&d===void 0?v=new Uint8Array(g):d===void 0?v=new Uint8Array(g,h):v=new Uint8Array(g,h,d),Object.setPrototypeOf(v,a.prototype),v}function N(g){if(a.isBuffer(g)){const h=L(g.length)|0,d=o(h);return d.length===0||g.copy(d,0,0,h),d}if(g.length!==void 0)return typeof g.length!="number"||Ie(g.length)?o(0):y(g);if(g.type==="Buffer"&&Array.isArray(g.data))return y(g.data)}function L(g){if(g>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return g|0}function C(g){return+g!=g&&(g=0),a.alloc(+g)}a.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==a.prototype},a.compare=function(h,d){if(me(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),me(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(h)||!a.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===d)return 0;let v=h.length,P=d.length;for(let U=0,k=Math.min(v,P);U<k;++U)if(h[U]!==d[U]){v=h[U],P=d[U];break}return v<P?-1:P<v?1:0},a.isEncoding=function(h){switch(String(h).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(h,d){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return a.alloc(0);let v;if(d===void 0)for(d=0,v=0;v<h.length;++v)d+=h[v].length;const P=a.allocUnsafe(d);let U=0;for(v=0;v<h.length;++v){let k=h[v];if(me(k,Uint8Array))U+k.length>P.length?(a.isBuffer(k)||(k=a.from(k)),k.copy(P,U)):Uint8Array.prototype.set.call(P,k,U);else if(a.isBuffer(k))k.copy(P,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=k.length}return P};function D(g,h){if(a.isBuffer(g))return g.length;if(ArrayBuffer.isView(g)||me(g,ArrayBuffer))return g.byteLength;if(typeof g!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof g);const d=g.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&d===0)return 0;let P=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return Ue(g).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d*2;case"hex":return d>>>1;case"base64":return Te(g).length;default:if(P)return v?-1:Ue(g).length;h=(""+h).toLowerCase(),P=!0}}a.byteLength=D;function b(g,h,d){let v=!1;if((h===void 0||h<0)&&(h=0),h>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,h>>>=0,d<=h))return"";for(g||(g="utf8");;)switch(g){case"hex":return z(this,h,d);case"utf8":case"utf-8":return x(this,h,d);case"ascii":return Y(this,h,d);case"latin1":case"binary":return W(this,h,d);case"base64":return te(this,h,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,h,d);default:if(v)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),v=!0}}a.prototype._isBuffer=!0;function S(g,h,d){const v=g[h];g[h]=g[d],g[d]=v}a.prototype.swap16=function(){const h=this.length;if(h%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let d=0;d<h;d+=2)S(this,d,d+1);return this},a.prototype.swap32=function(){const h=this.length;if(h%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let d=0;d<h;d+=4)S(this,d,d+3),S(this,d+1,d+2);return this},a.prototype.swap64=function(){const h=this.length;if(h%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let d=0;d<h;d+=8)S(this,d,d+7),S(this,d+1,d+6),S(this,d+2,d+5),S(this,d+3,d+4);return this},a.prototype.toString=function(){const h=this.length;return h===0?"":arguments.length===0?x(this,0,h):b.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(h){if(!a.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h?!0:a.compare(this,h)===0},a.prototype.inspect=function(){let h="";const d=t.INSPECT_MAX_BYTES;return h=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(h+=" ... "),"<Buffer "+h+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(h,d,v,P,U){if(me(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(d===void 0&&(d=0),v===void 0&&(v=h?h.length:0),P===void 0&&(P=0),U===void 0&&(U=this.length),d<0||v>h.length||P<0||U>this.length)throw new RangeError("out of range index");if(P>=U&&d>=v)return 0;if(P>=U)return-1;if(d>=v)return 1;if(d>>>=0,v>>>=0,P>>>=0,U>>>=0,this===h)return 0;let k=U-P,se=v-d;const he=Math.min(k,se),Re=this.slice(P,U),je=h.slice(d,v);for(let Me=0;Me<he;++Me)if(Re[Me]!==je[Me]){k=Re[Me],se=je[Me];break}return k<se?-1:se<k?1:0};function O(g,h,d,v,P){if(g.length===0)return-1;if(typeof d=="string"?(v=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,Ie(d)&&(d=P?0:g.length-1),d<0&&(d=g.length+d),d>=g.length){if(P)return-1;d=g.length-1}else if(d<0)if(P)d=0;else return-1;if(typeof h=="string"&&(h=a.from(h,v)),a.isBuffer(h))return h.length===0?-1:u(g,h,d,v,P);if(typeof h=="number")return h=h&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(g,h,d):Uint8Array.prototype.lastIndexOf.call(g,h,d):u(g,[h],d,v,P);throw new TypeError("val must be string, number or Buffer")}function u(g,h,d,v,P){let U=1,k=g.length,se=h.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(g.length<2||h.length<2)return-1;U=2,k/=2,se/=2,d/=2}function he(je,Me){return U===1?je[Me]:je.readUInt16BE(Me*U)}let Re;if(P){let je=-1;for(Re=d;Re<k;Re++)if(he(g,Re)===he(h,je===-1?0:Re-je)){if(je===-1&&(je=Re),Re-je+1===se)return je*U}else je!==-1&&(Re-=Re-je),je=-1}else for(d+se>k&&(d=k-se),Re=d;Re>=0;Re--){let je=!0;for(let Me=0;Me<se;Me++)if(he(g,Re+Me)!==he(h,Me)){je=!1;break}if(je)return Re}return-1}a.prototype.includes=function(h,d,v){return this.indexOf(h,d,v)!==-1},a.prototype.indexOf=function(h,d,v){return O(this,h,d,v,!0)},a.prototype.lastIndexOf=function(h,d,v){return O(this,h,d,v,!1)};function _(g,h,d,v){d=Number(d)||0;const P=g.length-d;v?(v=Number(v),v>P&&(v=P)):v=P;const U=h.length;v>U/2&&(v=U/2);let k;for(k=0;k<v;++k){const se=parseInt(h.substr(k*2,2),16);if(Ie(se))return k;g[d+k]=se}return k}function H(g,h,d,v){return Oe(Ue(h,g.length-d),g,d,v)}function B(g,h,d,v){return Oe(Ge(h),g,d,v)}function q(g,h,d,v){return Oe(Te(h),g,d,v)}function X(g,h,d,v){return Oe(Ve(h,g.length-d),g,d,v)}a.prototype.write=function(h,d,v,P){if(d===void 0)P="utf8",v=this.length,d=0;else if(v===void 0&&typeof d=="string")P=d,v=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(v)?(v=v>>>0,P===void 0&&(P="utf8")):(P=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-d;if((v===void 0||v>U)&&(v=U),h.length>0&&(v<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let k=!1;for(;;)switch(P){case"hex":return _(this,h,d,v);case"utf8":case"utf-8":return H(this,h,d,v);case"ascii":case"latin1":case"binary":return B(this,h,d,v);case"base64":return q(this,h,d,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,h,d,v);default:if(k)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),k=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function te(g,h,d){return h===0&&d===g.length?e.fromByteArray(g):e.fromByteArray(g.slice(h,d))}function x(g,h,d){d=Math.min(g.length,d);const v=[];let P=h;for(;P<d;){const U=g[P];let k=null,se=U>239?4:U>223?3:U>191?2:1;if(P+se<=d){let he,Re,je,Me;switch(se){case 1:U<128&&(k=U);break;case 2:he=g[P+1],(he&192)===128&&(Me=(U&31)<<6|he&63,Me>127&&(k=Me));break;case 3:he=g[P+1],Re=g[P+2],(he&192)===128&&(Re&192)===128&&(Me=(U&15)<<12|(he&63)<<6|Re&63,Me>2047&&(Me<55296||Me>57343)&&(k=Me));break;case 4:he=g[P+1],Re=g[P+2],je=g[P+3],(he&192)===128&&(Re&192)===128&&(je&192)===128&&(Me=(U&15)<<18|(he&63)<<12|(Re&63)<<6|je&63,Me>65535&&Me<1114112&&(k=Me))}}k===null?(k=65533,se=1):k>65535&&(k-=65536,v.push(k>>>10&1023|55296),k=56320|k&1023),v.push(k),P+=se}return K(v)}const $=4096;function K(g){const h=g.length;if(h<=$)return String.fromCharCode.apply(String,g);let d="",v=0;for(;v<h;)d+=String.fromCharCode.apply(String,g.slice(v,v+=$));return d}function Y(g,h,d){let v="";d=Math.min(g.length,d);for(let P=h;P<d;++P)v+=String.fromCharCode(g[P]&127);return v}function W(g,h,d){let v="";d=Math.min(g.length,d);for(let P=h;P<d;++P)v+=String.fromCharCode(g[P]);return v}function z(g,h,d){const v=g.length;(!h||h<0)&&(h=0),(!d||d<0||d>v)&&(d=v);let P="";for(let U=h;U<d;++U)P+=$e[g[U]];return P}function J(g,h,d){const v=g.slice(h,d);let P="";for(let U=0;U<v.length-1;U+=2)P+=String.fromCharCode(v[U]+v[U+1]*256);return P}a.prototype.slice=function(h,d){const v=this.length;h=~~h,d=d===void 0?v:~~d,h<0?(h+=v,h<0&&(h=0)):h>v&&(h=v),d<0?(d+=v,d<0&&(d=0)):d>v&&(d=v),d<h&&(d=h);const P=this.subarray(h,d);return Object.setPrototypeOf(P,a.prototype),P};function G(g,h,d){if(g%1!==0||g<0)throw new RangeError("offset is not uint");if(g+h>d)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(h,d,v){h=h>>>0,d=d>>>0,v||G(h,d,this.length);let P=this[h],U=1,k=0;for(;++k<d&&(U*=256);)P+=this[h+k]*U;return P},a.prototype.readUintBE=a.prototype.readUIntBE=function(h,d,v){h=h>>>0,d=d>>>0,v||G(h,d,this.length);let P=this[h+--d],U=1;for(;d>0&&(U*=256);)P+=this[h+--d]*U;return P},a.prototype.readUint8=a.prototype.readUInt8=function(h,d){return h=h>>>0,d||G(h,1,this.length),this[h]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(h,d){return h=h>>>0,d||G(h,2,this.length),this[h]|this[h+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(h,d){return h=h>>>0,d||G(h,2,this.length),this[h]<<8|this[h+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(h,d){return h=h>>>0,d||G(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(h,d){return h=h>>>0,d||G(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},a.prototype.readBigUInt64LE=ge(function(h){h=h>>>0,ne(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const P=d+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,U=this[++h]+this[++h]*2**8+this[++h]*2**16+v*2**24;return BigInt(P)+(BigInt(U)<<BigInt(32))}),a.prototype.readBigUInt64BE=ge(function(h){h=h>>>0,ne(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const P=d*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],U=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+v;return(BigInt(P)<<BigInt(32))+BigInt(U)}),a.prototype.readIntLE=function(h,d,v){h=h>>>0,d=d>>>0,v||G(h,d,this.length);let P=this[h],U=1,k=0;for(;++k<d&&(U*=256);)P+=this[h+k]*U;return U*=128,P>=U&&(P-=Math.pow(2,8*d)),P},a.prototype.readIntBE=function(h,d,v){h=h>>>0,d=d>>>0,v||G(h,d,this.length);let P=d,U=1,k=this[h+--P];for(;P>0&&(U*=256);)k+=this[h+--P]*U;return U*=128,k>=U&&(k-=Math.pow(2,8*d)),k},a.prototype.readInt8=function(h,d){return h=h>>>0,d||G(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},a.prototype.readInt16LE=function(h,d){h=h>>>0,d||G(h,2,this.length);const v=this[h]|this[h+1]<<8;return v&32768?v|4294901760:v},a.prototype.readInt16BE=function(h,d){h=h>>>0,d||G(h,2,this.length);const v=this[h+1]|this[h]<<8;return v&32768?v|4294901760:v},a.prototype.readInt32LE=function(h,d){return h=h>>>0,d||G(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},a.prototype.readInt32BE=function(h,d){return h=h>>>0,d||G(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},a.prototype.readBigInt64LE=ge(function(h){h=h>>>0,ne(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const P=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(v<<24);return(BigInt(P)<<BigInt(32))+BigInt(d+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),a.prototype.readBigInt64BE=ge(function(h){h=h>>>0,ne(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const P=(d<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(P)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+v)}),a.prototype.readFloatLE=function(h,d){return h=h>>>0,d||G(h,4,this.length),r.read(this,h,!0,23,4)},a.prototype.readFloatBE=function(h,d){return h=h>>>0,d||G(h,4,this.length),r.read(this,h,!1,23,4)},a.prototype.readDoubleLE=function(h,d){return h=h>>>0,d||G(h,8,this.length),r.read(this,h,!0,52,8)},a.prototype.readDoubleBE=function(h,d){return h=h>>>0,d||G(h,8,this.length),r.read(this,h,!1,52,8)};function ce(g,h,d,v,P,U){if(!a.isBuffer(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(h>P||h<U)throw new RangeError('"value" argument is out of bounds');if(d+v>g.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(h,d,v,P){if(h=+h,d=d>>>0,v=v>>>0,!P){const se=Math.pow(2,8*v)-1;ce(this,h,d,v,se,0)}let U=1,k=0;for(this[d]=h&255;++k<v&&(U*=256);)this[d+k]=h/U&255;return d+v},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(h,d,v,P){if(h=+h,d=d>>>0,v=v>>>0,!P){const se=Math.pow(2,8*v)-1;ce(this,h,d,v,se,0)}let U=v-1,k=1;for(this[d+U]=h&255;--U>=0&&(k*=256);)this[d+U]=h/k&255;return d+v},a.prototype.writeUint8=a.prototype.writeUInt8=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,1,255,0),this[d]=h&255,d+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,2,65535,0),this[d]=h&255,this[d+1]=h>>>8,d+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,2,65535,0),this[d]=h>>>8,this[d+1]=h&255,d+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,4,4294967295,0),this[d+3]=h>>>24,this[d+2]=h>>>16,this[d+1]=h>>>8,this[d]=h&255,d+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,4,4294967295,0),this[d]=h>>>24,this[d+1]=h>>>16,this[d+2]=h>>>8,this[d+3]=h&255,d+4};function Q(g,h,d,v,P){ee(h,v,P,g,d,7);let U=Number(h&BigInt(4294967295));g[d++]=U,U=U>>8,g[d++]=U,U=U>>8,g[d++]=U,U=U>>8,g[d++]=U;let k=Number(h>>BigInt(32)&BigInt(4294967295));return g[d++]=k,k=k>>8,g[d++]=k,k=k>>8,g[d++]=k,k=k>>8,g[d++]=k,d}function pe(g,h,d,v,P){ee(h,v,P,g,d,7);let U=Number(h&BigInt(4294967295));g[d+7]=U,U=U>>8,g[d+6]=U,U=U>>8,g[d+5]=U,U=U>>8,g[d+4]=U;let k=Number(h>>BigInt(32)&BigInt(4294967295));return g[d+3]=k,k=k>>8,g[d+2]=k,k=k>>8,g[d+1]=k,k=k>>8,g[d]=k,d+8}a.prototype.writeBigUInt64LE=ge(function(h,d=0){return Q(this,h,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ge(function(h,d=0){return pe(this,h,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(h,d,v,P){if(h=+h,d=d>>>0,!P){const he=Math.pow(2,8*v-1);ce(this,h,d,v,he-1,-he)}let U=0,k=1,se=0;for(this[d]=h&255;++U<v&&(k*=256);)h<0&&se===0&&this[d+U-1]!==0&&(se=1),this[d+U]=(h/k>>0)-se&255;return d+v},a.prototype.writeIntBE=function(h,d,v,P){if(h=+h,d=d>>>0,!P){const he=Math.pow(2,8*v-1);ce(this,h,d,v,he-1,-he)}let U=v-1,k=1,se=0;for(this[d+U]=h&255;--U>=0&&(k*=256);)h<0&&se===0&&this[d+U+1]!==0&&(se=1),this[d+U]=(h/k>>0)-se&255;return d+v},a.prototype.writeInt8=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,1,127,-128),h<0&&(h=255+h+1),this[d]=h&255,d+1},a.prototype.writeInt16LE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,2,32767,-32768),this[d]=h&255,this[d+1]=h>>>8,d+2},a.prototype.writeInt16BE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,2,32767,-32768),this[d]=h>>>8,this[d+1]=h&255,d+2},a.prototype.writeInt32LE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,4,2147483647,-2147483648),this[d]=h&255,this[d+1]=h>>>8,this[d+2]=h>>>16,this[d+3]=h>>>24,d+4},a.prototype.writeInt32BE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[d]=h>>>24,this[d+1]=h>>>16,this[d+2]=h>>>8,this[d+3]=h&255,d+4},a.prototype.writeBigInt64LE=ge(function(h,d=0){return Q(this,h,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ge(function(h,d=0){return pe(this,h,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function oe(g,h,d,v,P,U){if(d+v>g.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function Ce(g,h,d,v,P){return h=+h,d=d>>>0,P||oe(g,h,d,4),r.write(g,h,d,v,23,4),d+4}a.prototype.writeFloatLE=function(h,d,v){return Ce(this,h,d,!0,v)},a.prototype.writeFloatBE=function(h,d,v){return Ce(this,h,d,!1,v)};function F(g,h,d,v,P){return h=+h,d=d>>>0,P||oe(g,h,d,8),r.write(g,h,d,v,52,8),d+8}a.prototype.writeDoubleLE=function(h,d,v){return F(this,h,d,!0,v)},a.prototype.writeDoubleBE=function(h,d,v){return F(this,h,d,!1,v)},a.prototype.copy=function(h,d,v,P){if(!a.isBuffer(h))throw new TypeError("argument should be a Buffer");if(v||(v=0),!P&&P!==0&&(P=this.length),d>=h.length&&(d=h.length),d||(d=0),P>0&&P<v&&(P=v),P===v||h.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),h.length-d<P-v&&(P=h.length-d+v);const U=P-v;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(d,v,P):Uint8Array.prototype.set.call(h,this.subarray(v,P),d),U},a.prototype.fill=function(h,d,v,P){if(typeof h=="string"){if(typeof d=="string"?(P=d,d=0,v=this.length):typeof v=="string"&&(P=v,v=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!a.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(h.length===1){const k=h.charCodeAt(0);(P==="utf8"&&k<128||P==="latin1")&&(h=k)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(d<0||this.length<d||this.length<v)throw new RangeError("Out of range index");if(v<=d)return this;d=d>>>0,v=v===void 0?this.length:v>>>0,h||(h=0);let U;if(typeof h=="number")for(U=d;U<v;++U)this[U]=h;else{const k=a.isBuffer(h)?h:a.from(h,P),se=k.length;if(se===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(U=0;U<v-d;++U)this[U+d]=k[U%se]}return this};const j={};function R(g,h,d){j[g]=class extends d{constructor(){super(),Object.defineProperty(this,"message",{value:h.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${g}]`,this.stack,delete this.name}get code(){return g}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${g}]: ${this.message}`}}}R("ERR_BUFFER_OUT_OF_BOUNDS",function(g){return g?`${g} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),R("ERR_INVALID_ARG_TYPE",function(g,h){return`The "${g}" argument must be of type number. Received type ${typeof h}`},TypeError),R("ERR_OUT_OF_RANGE",function(g,h,d){let v=`The value of "${g}" is out of range.`,P=d;return Number.isInteger(d)&&Math.abs(d)>2**32?P=f(String(d)):typeof d=="bigint"&&(P=String(d),(d>BigInt(2)**BigInt(32)||d<-(BigInt(2)**BigInt(32)))&&(P=f(P)),P+="n"),v+=` It must be ${h}. Received ${P}`,v},RangeError);function f(g){let h="",d=g.length;const v=g[0]==="-"?1:0;for(;d>=v+4;d-=3)h=`_${g.slice(d-3,d)}${h}`;return`${g.slice(0,d)}${h}`}function A(g,h,d){ne(h,"offset"),(g[h]===void 0||g[h+d]===void 0)&&Ee(h,g.length-(d+1))}function ee(g,h,d,v,P,U){if(g>d||g<h){const k=typeof h=="bigint"?"n":"";let se;throw U>3?h===0||h===BigInt(0)?se=`>= 0${k} and < 2${k} ** ${(U+1)*8}${k}`:se=`>= -(2${k} ** ${(U+1)*8-1}${k}) and < 2 ** ${(U+1)*8-1}${k}`:se=`>= ${h}${k} and <= ${d}${k}`,new j.ERR_OUT_OF_RANGE("value",se,g)}A(v,P,U)}function ne(g,h){if(typeof g!="number")throw new j.ERR_INVALID_ARG_TYPE(h,"number",g)}function Ee(g,h,d){throw Math.floor(g)!==g?(ne(g,d),new j.ERR_OUT_OF_RANGE(d||"offset","an integer",g)):h<0?new j.ERR_BUFFER_OUT_OF_BOUNDS:new j.ERR_OUT_OF_RANGE(d||"offset",`>= ${d?1:0} and <= ${h}`,g)}const Le=/[^+/0-9A-Za-z-_]/g;function Pe(g){if(g=g.split("=")[0],g=g.trim().replace(Le,""),g.length<2)return"";for(;g.length%4!==0;)g=g+"=";return g}function Ue(g,h){h=h||1/0;let d;const v=g.length;let P=null;const U=[];for(let k=0;k<v;++k){if(d=g.charCodeAt(k),d>55295&&d<57344){if(!P){if(d>56319){(h-=3)>-1&&U.push(239,191,189);continue}else if(k+1===v){(h-=3)>-1&&U.push(239,191,189);continue}P=d;continue}if(d<56320){(h-=3)>-1&&U.push(239,191,189),P=d;continue}d=(P-55296<<10|d-56320)+65536}else P&&(h-=3)>-1&&U.push(239,191,189);if(P=null,d<128){if((h-=1)<0)break;U.push(d)}else if(d<2048){if((h-=2)<0)break;U.push(d>>6|192,d&63|128)}else if(d<65536){if((h-=3)<0)break;U.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((h-=4)<0)break;U.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return U}function Ge(g){const h=[];for(let d=0;d<g.length;++d)h.push(g.charCodeAt(d)&255);return h}function Ve(g,h){let d,v,P;const U=[];for(let k=0;k<g.length&&!((h-=2)<0);++k)d=g.charCodeAt(k),v=d>>8,P=d%256,U.push(P),U.push(v);return U}function Te(g){return e.toByteArray(Pe(g))}function Oe(g,h,d,v){let P;for(P=0;P<v&&!(P+d>=h.length||P>=g.length);++P)h[P+d]=g[P];return P}function me(g,h){return g instanceof h||g!=null&&g.constructor!=null&&g.constructor.name!=null&&g.constructor.name===h.name}function Ie(g){return g!==g}const $e=function(){const g="0123456789abcdef",h=new Array(256);for(let d=0;d<16;++d){const v=d*16;for(let P=0;P<16;++P)h[v+P]=g[d]+g[P]}return h}();function ge(g){return typeof BigInt>"u"?xe:g}function xe(){throw new Error("BigInt not supported")}})(p0);let Ua;const qe={ethereumClient:void 0,setEthereumClient(t){Ua=t},client(){if(Ua)return Ua;throw new Error("ClientCtrl has no client set")}},Ye=Er({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),He={state:Ye,subscribe(t){return qr(Ye,()=>t(Ye))},getAccount(){const t=qe.client().getAccount();Ye.address=t.address,Ye.isConnected=t.isConnected},async fetchProfile(t,e){try{Ye.profileLoading=!0;const r=e??Ye.address,{id:n}=qe.client().getDefaultChain();if(r&&n===1){const[i,s]=await Promise.all([qe.client().fetchEnsName({address:r,chainId:1}),qe.client().fetchEnsAvatar({address:r,chainId:1})]);s&&await t(s),Ye.profileName=i,Ye.profileAvatar=s}}finally{Ye.profileLoading=!1}},async fetchBalance(t){try{Ye.balanceLoading=!0;const e=t??Ye.address;if(e){const r=await qe.client().fetchBalance({address:e});Ye.balance={amount:r.formatted,symbol:r.symbol}}}finally{Ye.balanceLoading=!1}},setAddress(t){Ye.address=t},setIsConnected(t){Ye.isConnected=t},resetBalance(){Ye.balance=void 0},resetAccount(){Ye.address=void 0,Ye.isConnected=!1,Ye.profileName=void 0,Ye.profileAvatar=void 0,Ye.balance=void 0}},De={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return De.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isEmptyObject(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.getOwnPropertyNames(t).length===0&&Object.getOwnPropertySymbols(t).length===0},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e,r){if(De.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!De.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;t.endsWith("/")&&(n=t.slice(0,-1)),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}/wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(De.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(De.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(De.WALLETCONNECT_DEEPLINK_CHOICE)},isNull(t){return t===null},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(De.W3M_VERSION,"2.2.2")}},Nt=Er({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,isStandalone:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,walletConnectVersion:1}),le={state:Nt,subscribe(t){return qr(Nt,()=>t(Nt))},setChains(t){Nt.chains=t},setStandaloneChains(t){Nt.standaloneChains=t},setStandaloneUri(t){Nt.standaloneUri=t},getSelectedChain(){const t=qe.client().getNetwork().chain;return t&&(Nt.selectedChain=t),Nt.selectedChain},setSelectedChain(t){Nt.selectedChain=t},setIsStandalone(t){Nt.isStandalone=t},setIsCustomDesktop(t){Nt.isCustomDesktop=t},setIsCustomMobile(t){Nt.isCustomMobile=t},setIsDataLoaded(t){Nt.isDataLoaded=t},setIsUiLoaded(t){Nt.isUiLoaded=t},setWalletConnectVersion(t){Nt.walletConnectVersion=t}},Is=Er({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerAllowList:void 0,explorerDenyList:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),at={state:Is,subscribe(t){return qr(Is,()=>t(Is))},setConfig(t){var e,r,n,i;if(le.setStandaloneChains(t.standaloneChains),le.setIsStandalone(!!((e=t.standaloneChains)!=null&&e.length)||!!t.enableStandaloneMode),le.setIsCustomMobile(!!((r=t.mobileWallets)!=null&&r.length)),le.setIsCustomDesktop(!!((n=t.desktopWallets)!=null&&n.length)),le.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),!le.state.isStandalone){const s=qe.client().getDefaultChain();le.setSelectedChain(s),le.setChains(qe.client().chains)}t.defaultChain&&le.setSelectedChain(t.defaultChain),De.setWeb3ModalVersionInStorage(),Object.assign(Is,t)}},m0="https://explorer-api.walletconnect.com";function av(t){const e=Object.fromEntries(Object.entries(t).filter(([r,n])=>typeof n<"u"&&n!==null&&n!=="").map(([r,n])=>[r,n.toString()]));return new URLSearchParams(e).toString()}const Ss={async fetchWallets(t,e){const r=av(e),n=`${m0}/v3/wallets?projectId=${t}&${r}`;return(await fetch(n)).json()},formatImageUrl(t,e){return`${m0}/v3/logo/lg/${e}?projectId=${t}`}},Vr=Er({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},previewWallets:[],recomendedWallets:[]});function Ds(){const{projectId:t}=at.state;if(!t)throw new Error("projectId is required to work with explorer api");return t}const ct={state:Vr,async getPreviewWallets(t){const{listings:e}=await Ss.fetchWallets(Ds(),t);return Vr.previewWallets=Object.values(e),Vr.previewWallets},async getRecomendedWallets(){const{listings:t}=await Ss.fetchWallets(Ds(),{page:1,entries:6});Vr.recomendedWallets=Object.values(t)},async getPaginatedWallets(t){const{page:e,search:r}=t,{listings:n,total:i}=await Ss.fetchWallets(Ds(),t),s=Object.values(n),o=r?"search":"wallets";return Vr[o]={listings:[...Vr[o].listings,...s],total:i,page:e??1},{listings:s,total:i}},getImageUrl(t){return Ss.formatImageUrl(Ds(),t)},resetSearch(){Vr.search={listings:[],total:0,page:1}}},Ht=Er({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Ae={state:Ht,subscribe(t){return qr(Ht,()=>t(Ht))},push(t,e){t!==Ht.view&&(Ht.view=t,e&&(Ht.data=e),Ht.history.push(t))},replace(t){Ht.view=t,Ht.history=[t]},goBack(){if(Ht.history.length>1){Ht.history.pop();const[t]=Ht.history.slice(-1);Ht.view=t}}},xn=Er({open:!1}),lt={state:xn,subscribe(t){return qr(xn,()=>t(xn))},async open(t){return new Promise(e=>{const{isStandalone:r,isUiLoaded:n,isDataLoaded:i}=le.state,{isConnected:s}=He.state,{enableNetworkView:o}=at.state;if(r?(le.setStandaloneUri(t?.uri),le.setStandaloneChains(t?.standaloneChains),Ae.replace("ConnectWallet")):t!=null&&t.route?Ae.replace(t.route):s?Ae.replace("Account"):o?Ae.replace("SelectNetwork"):Ae.replace("ConnectWallet"),n&&i)xn.open=!0,e();else{const a=setInterval(()=>{le.state.isUiLoaded&&le.state.isDataLoaded&&(clearInterval(a),xn.open=!0,e())},200)}})},close(){xn.open=!1}};var cv=Object.defineProperty,w0=Object.getOwnPropertySymbols,lv=Object.prototype.hasOwnProperty,hv=Object.prototype.propertyIsEnumerable,y0=(t,e,r)=>e in t?cv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,uv=(t,e)=>{for(var r in e||(e={}))lv.call(e,r)&&y0(t,r,e[r]);if(w0)for(var r of w0(e))hv.call(e,r)&&y0(t,r,e[r]);return t};function dv(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const yi=Er({themeMode:dv()?"dark":"light"}),gr={state:yi,subscribe(t){return qr(yi,()=>t(yi))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(yi.themeMode=e),r&&(yi.themeVariables=uv({},r))}},Kr=Er({open:!1,message:"",variant:"success"}),Ot={state:Kr,subscribe(t){return qr(Kr,()=>t(Kr))},openToast(t,e){Kr.open=!0,Kr.message=t,Kr.variant=e},closeToast(){Kr.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=p0.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var fv=Object.defineProperty,b0=Object.getOwnPropertySymbols,pv=Object.prototype.hasOwnProperty,gv=Object.prototype.propertyIsEnumerable,v0=(t,e,r)=>e in t?fv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mv=(t,e)=>{for(var r in e||(e={}))pv.call(e,r)&&v0(t,r,e[r]);if(b0)for(var r of b0(e))gv.call(e,r)&&v0(t,r,e[r]);return t};class wv{constructor(e){this.openModal=lt.open,this.closeModal=lt.close,this.subscribeModal=lt.subscribe,this.setTheme=gr.setThemeConfig,gr.setThemeConfig(e),at.setConfig(mv({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return A7});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),le.setIsUiLoaded(!0)}}}var yv=Object.freeze({__proto__:null,Web3Modal:wv});/**
|
|
77
|
+
*/(function(t){const e=Ss,r=Ua,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=C,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const g=new Uint8Array(1),h={foo:function(){return 42}};return Object.setPrototypeOf(h,Uint8Array.prototype),Object.setPrototypeOf(g,h),g.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(g){if(g>i)throw new RangeError('The value "'+g+'" is invalid for option "size"');const h=new Uint8Array(g);return Object.setPrototypeOf(h,a.prototype),h}function a(g,h,d){if(typeof g=="number"){if(typeof h=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(g)}return c(g,h,d)}a.poolSize=8192;function c(g,h,d){if(typeof g=="string")return w(g,h);if(ArrayBuffer.isView(g))return E(g);if(g==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g);if(me(g,ArrayBuffer)||g&&me(g.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(g,SharedArrayBuffer)||g&&me(g.buffer,SharedArrayBuffer)))return T(g,h,d);if(typeof g=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const v=g.valueOf&&g.valueOf();if(v!=null&&v!==g)return a.from(v,h,d);const P=R(g);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof g[Symbol.toPrimitive]=="function")return a.from(g[Symbol.toPrimitive]("string"),h,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g)}a.from=function(g,h,d){return c(g,h,d)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(g){if(typeof g!="number")throw new TypeError('"size" argument must be of type number');if(g<0)throw new RangeError('The value "'+g+'" is invalid for option "size"')}function p(g,h,d){return l(g),g<=0?o(g):h!==void 0?typeof d=="string"?o(g).fill(h,d):o(g).fill(h):o(g)}a.alloc=function(g,h,d){return p(g,h,d)};function m(g){return l(g),o(g<0?0:L(g)|0)}a.allocUnsafe=function(g){return m(g)},a.allocUnsafeSlow=function(g){return m(g)};function w(g,h){if((typeof h!="string"||h==="")&&(h="utf8"),!a.isEncoding(h))throw new TypeError("Unknown encoding: "+h);const d=O(g,h)|0;let v=o(d);const P=v.write(g,h);return P!==d&&(v=v.slice(0,P)),v}function y(g){const h=g.length<0?0:L(g.length)|0,d=o(h);for(let v=0;v<h;v+=1)d[v]=g[v]&255;return d}function E(g){if(me(g,Uint8Array)){const h=new Uint8Array(g);return T(h.buffer,h.byteOffset,h.byteLength)}return y(g)}function T(g,h,d){if(h<0||g.byteLength<h)throw new RangeError('"offset" is outside of buffer bounds');if(g.byteLength<h+(d||0))throw new RangeError('"length" is outside of buffer bounds');let v;return h===void 0&&d===void 0?v=new Uint8Array(g):d===void 0?v=new Uint8Array(g,h):v=new Uint8Array(g,h,d),Object.setPrototypeOf(v,a.prototype),v}function R(g){if(a.isBuffer(g)){const h=L(g.length)|0,d=o(h);return d.length===0||g.copy(d,0,0,h),d}if(g.length!==void 0)return typeof g.length!="number"||Ie(g.length)?o(0):y(g);if(g.type==="Buffer"&&Array.isArray(g.data))return y(g.data)}function L(g){if(g>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return g|0}function C(g){return+g!=g&&(g=0),a.alloc(+g)}a.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==a.prototype},a.compare=function(h,d){if(me(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),me(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(h)||!a.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===d)return 0;let v=h.length,P=d.length;for(let U=0,k=Math.min(v,P);U<k;++U)if(h[U]!==d[U]){v=h[U],P=d[U];break}return v<P?-1:P<v?1:0},a.isEncoding=function(h){switch(String(h).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(h,d){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return a.alloc(0);let v;if(d===void 0)for(d=0,v=0;v<h.length;++v)d+=h[v].length;const P=a.allocUnsafe(d);let U=0;for(v=0;v<h.length;++v){let k=h[v];if(me(k,Uint8Array))U+k.length>P.length?(a.isBuffer(k)||(k=a.from(k)),k.copy(P,U)):Uint8Array.prototype.set.call(P,k,U);else if(a.isBuffer(k))k.copy(P,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=k.length}return P};function O(g,h){if(a.isBuffer(g))return g.length;if(ArrayBuffer.isView(g)||me(g,ArrayBuffer))return g.byteLength;if(typeof g!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof g);const d=g.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&d===0)return 0;let P=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return Ue(g).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d*2;case"hex":return d>>>1;case"base64":return Te(g).length;default:if(P)return v?-1:Ue(g).length;h=(""+h).toLowerCase(),P=!0}}a.byteLength=O;function b(g,h,d){let v=!1;if((h===void 0||h<0)&&(h=0),h>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,h>>>=0,d<=h))return"";for(g||(g="utf8");;)switch(g){case"hex":return z(this,h,d);case"utf8":case"utf-8":return x(this,h,d);case"ascii":return Y(this,h,d);case"latin1":case"binary":return W(this,h,d);case"base64":return te(this,h,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,h,d);default:if(v)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),v=!0}}a.prototype._isBuffer=!0;function S(g,h,d){const v=g[h];g[h]=g[d],g[d]=v}a.prototype.swap16=function(){const h=this.length;if(h%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let d=0;d<h;d+=2)S(this,d,d+1);return this},a.prototype.swap32=function(){const h=this.length;if(h%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let d=0;d<h;d+=4)S(this,d,d+3),S(this,d+1,d+2);return this},a.prototype.swap64=function(){const h=this.length;if(h%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let d=0;d<h;d+=8)S(this,d,d+7),S(this,d+1,d+6),S(this,d+2,d+5),S(this,d+3,d+4);return this},a.prototype.toString=function(){const h=this.length;return h===0?"":arguments.length===0?x(this,0,h):b.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(h){if(!a.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h?!0:a.compare(this,h)===0},a.prototype.inspect=function(){let h="";const d=t.INSPECT_MAX_BYTES;return h=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(h+=" ... "),"<Buffer "+h+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(h,d,v,P,U){if(me(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(d===void 0&&(d=0),v===void 0&&(v=h?h.length:0),P===void 0&&(P=0),U===void 0&&(U=this.length),d<0||v>h.length||P<0||U>this.length)throw new RangeError("out of range index");if(P>=U&&d>=v)return 0;if(P>=U)return-1;if(d>=v)return 1;if(d>>>=0,v>>>=0,P>>>=0,U>>>=0,this===h)return 0;let k=U-P,se=v-d;const he=Math.min(k,se),Ne=this.slice(P,U),je=h.slice(d,v);for(let Me=0;Me<he;++Me)if(Ne[Me]!==je[Me]){k=Ne[Me],se=je[Me];break}return k<se?-1:se<k?1:0};function D(g,h,d,v,P){if(g.length===0)return-1;if(typeof d=="string"?(v=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,Ie(d)&&(d=P?0:g.length-1),d<0&&(d=g.length+d),d>=g.length){if(P)return-1;d=g.length-1}else if(d<0)if(P)d=0;else return-1;if(typeof h=="string"&&(h=a.from(h,v)),a.isBuffer(h))return h.length===0?-1:u(g,h,d,v,P);if(typeof h=="number")return h=h&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(g,h,d):Uint8Array.prototype.lastIndexOf.call(g,h,d):u(g,[h],d,v,P);throw new TypeError("val must be string, number or Buffer")}function u(g,h,d,v,P){let U=1,k=g.length,se=h.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(g.length<2||h.length<2)return-1;U=2,k/=2,se/=2,d/=2}function he(je,Me){return U===1?je[Me]:je.readUInt16BE(Me*U)}let Ne;if(P){let je=-1;for(Ne=d;Ne<k;Ne++)if(he(g,Ne)===he(h,je===-1?0:Ne-je)){if(je===-1&&(je=Ne),Ne-je+1===se)return je*U}else je!==-1&&(Ne-=Ne-je),je=-1}else for(d+se>k&&(d=k-se),Ne=d;Ne>=0;Ne--){let je=!0;for(let Me=0;Me<se;Me++)if(he(g,Ne+Me)!==he(h,Me)){je=!1;break}if(je)return Ne}return-1}a.prototype.includes=function(h,d,v){return this.indexOf(h,d,v)!==-1},a.prototype.indexOf=function(h,d,v){return D(this,h,d,v,!0)},a.prototype.lastIndexOf=function(h,d,v){return D(this,h,d,v,!1)};function _(g,h,d,v){d=Number(d)||0;const P=g.length-d;v?(v=Number(v),v>P&&(v=P)):v=P;const U=h.length;v>U/2&&(v=U/2);let k;for(k=0;k<v;++k){const se=parseInt(h.substr(k*2,2),16);if(Ie(se))return k;g[d+k]=se}return k}function H(g,h,d,v){return Oe(Ue(h,g.length-d),g,d,v)}function B(g,h,d,v){return Oe(Ge(h),g,d,v)}function q(g,h,d,v){return Oe(Te(h),g,d,v)}function X(g,h,d,v){return Oe(Ve(h,g.length-d),g,d,v)}a.prototype.write=function(h,d,v,P){if(d===void 0)P="utf8",v=this.length,d=0;else if(v===void 0&&typeof d=="string")P=d,v=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(v)?(v=v>>>0,P===void 0&&(P="utf8")):(P=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-d;if((v===void 0||v>U)&&(v=U),h.length>0&&(v<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let k=!1;for(;;)switch(P){case"hex":return _(this,h,d,v);case"utf8":case"utf-8":return H(this,h,d,v);case"ascii":case"latin1":case"binary":return B(this,h,d,v);case"base64":return q(this,h,d,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,h,d,v);default:if(k)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),k=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function te(g,h,d){return h===0&&d===g.length?e.fromByteArray(g):e.fromByteArray(g.slice(h,d))}function x(g,h,d){d=Math.min(g.length,d);const v=[];let P=h;for(;P<d;){const U=g[P];let k=null,se=U>239?4:U>223?3:U>191?2:1;if(P+se<=d){let he,Ne,je,Me;switch(se){case 1:U<128&&(k=U);break;case 2:he=g[P+1],(he&192)===128&&(Me=(U&31)<<6|he&63,Me>127&&(k=Me));break;case 3:he=g[P+1],Ne=g[P+2],(he&192)===128&&(Ne&192)===128&&(Me=(U&15)<<12|(he&63)<<6|Ne&63,Me>2047&&(Me<55296||Me>57343)&&(k=Me));break;case 4:he=g[P+1],Ne=g[P+2],je=g[P+3],(he&192)===128&&(Ne&192)===128&&(je&192)===128&&(Me=(U&15)<<18|(he&63)<<12|(Ne&63)<<6|je&63,Me>65535&&Me<1114112&&(k=Me))}}k===null?(k=65533,se=1):k>65535&&(k-=65536,v.push(k>>>10&1023|55296),k=56320|k&1023),v.push(k),P+=se}return K(v)}const $=4096;function K(g){const h=g.length;if(h<=$)return String.fromCharCode.apply(String,g);let d="",v=0;for(;v<h;)d+=String.fromCharCode.apply(String,g.slice(v,v+=$));return d}function Y(g,h,d){let v="";d=Math.min(g.length,d);for(let P=h;P<d;++P)v+=String.fromCharCode(g[P]&127);return v}function W(g,h,d){let v="";d=Math.min(g.length,d);for(let P=h;P<d;++P)v+=String.fromCharCode(g[P]);return v}function z(g,h,d){const v=g.length;(!h||h<0)&&(h=0),(!d||d<0||d>v)&&(d=v);let P="";for(let U=h;U<d;++U)P+=$e[g[U]];return P}function J(g,h,d){const v=g.slice(h,d);let P="";for(let U=0;U<v.length-1;U+=2)P+=String.fromCharCode(v[U]+v[U+1]*256);return P}a.prototype.slice=function(h,d){const v=this.length;h=~~h,d=d===void 0?v:~~d,h<0?(h+=v,h<0&&(h=0)):h>v&&(h=v),d<0?(d+=v,d<0&&(d=0)):d>v&&(d=v),d<h&&(d=h);const P=this.subarray(h,d);return Object.setPrototypeOf(P,a.prototype),P};function G(g,h,d){if(g%1!==0||g<0)throw new RangeError("offset is not uint");if(g+h>d)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(h,d,v){h=h>>>0,d=d>>>0,v||G(h,d,this.length);let P=this[h],U=1,k=0;for(;++k<d&&(U*=256);)P+=this[h+k]*U;return P},a.prototype.readUintBE=a.prototype.readUIntBE=function(h,d,v){h=h>>>0,d=d>>>0,v||G(h,d,this.length);let P=this[h+--d],U=1;for(;d>0&&(U*=256);)P+=this[h+--d]*U;return P},a.prototype.readUint8=a.prototype.readUInt8=function(h,d){return h=h>>>0,d||G(h,1,this.length),this[h]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(h,d){return h=h>>>0,d||G(h,2,this.length),this[h]|this[h+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(h,d){return h=h>>>0,d||G(h,2,this.length),this[h]<<8|this[h+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(h,d){return h=h>>>0,d||G(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(h,d){return h=h>>>0,d||G(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},a.prototype.readBigUInt64LE=ge(function(h){h=h>>>0,ne(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const P=d+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,U=this[++h]+this[++h]*2**8+this[++h]*2**16+v*2**24;return BigInt(P)+(BigInt(U)<<BigInt(32))}),a.prototype.readBigUInt64BE=ge(function(h){h=h>>>0,ne(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const P=d*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],U=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+v;return(BigInt(P)<<BigInt(32))+BigInt(U)}),a.prototype.readIntLE=function(h,d,v){h=h>>>0,d=d>>>0,v||G(h,d,this.length);let P=this[h],U=1,k=0;for(;++k<d&&(U*=256);)P+=this[h+k]*U;return U*=128,P>=U&&(P-=Math.pow(2,8*d)),P},a.prototype.readIntBE=function(h,d,v){h=h>>>0,d=d>>>0,v||G(h,d,this.length);let P=d,U=1,k=this[h+--P];for(;P>0&&(U*=256);)k+=this[h+--P]*U;return U*=128,k>=U&&(k-=Math.pow(2,8*d)),k},a.prototype.readInt8=function(h,d){return h=h>>>0,d||G(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},a.prototype.readInt16LE=function(h,d){h=h>>>0,d||G(h,2,this.length);const v=this[h]|this[h+1]<<8;return v&32768?v|4294901760:v},a.prototype.readInt16BE=function(h,d){h=h>>>0,d||G(h,2,this.length);const v=this[h+1]|this[h]<<8;return v&32768?v|4294901760:v},a.prototype.readInt32LE=function(h,d){return h=h>>>0,d||G(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},a.prototype.readInt32BE=function(h,d){return h=h>>>0,d||G(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},a.prototype.readBigInt64LE=ge(function(h){h=h>>>0,ne(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const P=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(v<<24);return(BigInt(P)<<BigInt(32))+BigInt(d+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),a.prototype.readBigInt64BE=ge(function(h){h=h>>>0,ne(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const P=(d<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(P)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+v)}),a.prototype.readFloatLE=function(h,d){return h=h>>>0,d||G(h,4,this.length),r.read(this,h,!0,23,4)},a.prototype.readFloatBE=function(h,d){return h=h>>>0,d||G(h,4,this.length),r.read(this,h,!1,23,4)},a.prototype.readDoubleLE=function(h,d){return h=h>>>0,d||G(h,8,this.length),r.read(this,h,!0,52,8)},a.prototype.readDoubleBE=function(h,d){return h=h>>>0,d||G(h,8,this.length),r.read(this,h,!1,52,8)};function ce(g,h,d,v,P,U){if(!a.isBuffer(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(h>P||h<U)throw new RangeError('"value" argument is out of bounds');if(d+v>g.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(h,d,v,P){if(h=+h,d=d>>>0,v=v>>>0,!P){const se=Math.pow(2,8*v)-1;ce(this,h,d,v,se,0)}let U=1,k=0;for(this[d]=h&255;++k<v&&(U*=256);)this[d+k]=h/U&255;return d+v},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(h,d,v,P){if(h=+h,d=d>>>0,v=v>>>0,!P){const se=Math.pow(2,8*v)-1;ce(this,h,d,v,se,0)}let U=v-1,k=1;for(this[d+U]=h&255;--U>=0&&(k*=256);)this[d+U]=h/k&255;return d+v},a.prototype.writeUint8=a.prototype.writeUInt8=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,1,255,0),this[d]=h&255,d+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,2,65535,0),this[d]=h&255,this[d+1]=h>>>8,d+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,2,65535,0),this[d]=h>>>8,this[d+1]=h&255,d+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,4,4294967295,0),this[d+3]=h>>>24,this[d+2]=h>>>16,this[d+1]=h>>>8,this[d]=h&255,d+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,4,4294967295,0),this[d]=h>>>24,this[d+1]=h>>>16,this[d+2]=h>>>8,this[d+3]=h&255,d+4};function Q(g,h,d,v,P){ee(h,v,P,g,d,7);let U=Number(h&BigInt(4294967295));g[d++]=U,U=U>>8,g[d++]=U,U=U>>8,g[d++]=U,U=U>>8,g[d++]=U;let k=Number(h>>BigInt(32)&BigInt(4294967295));return g[d++]=k,k=k>>8,g[d++]=k,k=k>>8,g[d++]=k,k=k>>8,g[d++]=k,d}function pe(g,h,d,v,P){ee(h,v,P,g,d,7);let U=Number(h&BigInt(4294967295));g[d+7]=U,U=U>>8,g[d+6]=U,U=U>>8,g[d+5]=U,U=U>>8,g[d+4]=U;let k=Number(h>>BigInt(32)&BigInt(4294967295));return g[d+3]=k,k=k>>8,g[d+2]=k,k=k>>8,g[d+1]=k,k=k>>8,g[d]=k,d+8}a.prototype.writeBigUInt64LE=ge(function(h,d=0){return Q(this,h,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ge(function(h,d=0){return pe(this,h,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(h,d,v,P){if(h=+h,d=d>>>0,!P){const he=Math.pow(2,8*v-1);ce(this,h,d,v,he-1,-he)}let U=0,k=1,se=0;for(this[d]=h&255;++U<v&&(k*=256);)h<0&&se===0&&this[d+U-1]!==0&&(se=1),this[d+U]=(h/k>>0)-se&255;return d+v},a.prototype.writeIntBE=function(h,d,v,P){if(h=+h,d=d>>>0,!P){const he=Math.pow(2,8*v-1);ce(this,h,d,v,he-1,-he)}let U=v-1,k=1,se=0;for(this[d+U]=h&255;--U>=0&&(k*=256);)h<0&&se===0&&this[d+U+1]!==0&&(se=1),this[d+U]=(h/k>>0)-se&255;return d+v},a.prototype.writeInt8=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,1,127,-128),h<0&&(h=255+h+1),this[d]=h&255,d+1},a.prototype.writeInt16LE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,2,32767,-32768),this[d]=h&255,this[d+1]=h>>>8,d+2},a.prototype.writeInt16BE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,2,32767,-32768),this[d]=h>>>8,this[d+1]=h&255,d+2},a.prototype.writeInt32LE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,4,2147483647,-2147483648),this[d]=h&255,this[d+1]=h>>>8,this[d+2]=h>>>16,this[d+3]=h>>>24,d+4},a.prototype.writeInt32BE=function(h,d,v){return h=+h,d=d>>>0,v||ce(this,h,d,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[d]=h>>>24,this[d+1]=h>>>16,this[d+2]=h>>>8,this[d+3]=h&255,d+4},a.prototype.writeBigInt64LE=ge(function(h,d=0){return Q(this,h,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ge(function(h,d=0){return pe(this,h,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function oe(g,h,d,v,P,U){if(d+v>g.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function Ce(g,h,d,v,P){return h=+h,d=d>>>0,P||oe(g,h,d,4),r.write(g,h,d,v,23,4),d+4}a.prototype.writeFloatLE=function(h,d,v){return Ce(this,h,d,!0,v)},a.prototype.writeFloatBE=function(h,d,v){return Ce(this,h,d,!1,v)};function F(g,h,d,v,P){return h=+h,d=d>>>0,P||oe(g,h,d,8),r.write(g,h,d,v,52,8),d+8}a.prototype.writeDoubleLE=function(h,d,v){return F(this,h,d,!0,v)},a.prototype.writeDoubleBE=function(h,d,v){return F(this,h,d,!1,v)},a.prototype.copy=function(h,d,v,P){if(!a.isBuffer(h))throw new TypeError("argument should be a Buffer");if(v||(v=0),!P&&P!==0&&(P=this.length),d>=h.length&&(d=h.length),d||(d=0),P>0&&P<v&&(P=v),P===v||h.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),h.length-d<P-v&&(P=h.length-d+v);const U=P-v;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(d,v,P):Uint8Array.prototype.set.call(h,this.subarray(v,P),d),U},a.prototype.fill=function(h,d,v,P){if(typeof h=="string"){if(typeof d=="string"?(P=d,d=0,v=this.length):typeof v=="string"&&(P=v,v=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!a.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(h.length===1){const k=h.charCodeAt(0);(P==="utf8"&&k<128||P==="latin1")&&(h=k)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(d<0||this.length<d||this.length<v)throw new RangeError("Out of range index");if(v<=d)return this;d=d>>>0,v=v===void 0?this.length:v>>>0,h||(h=0);let U;if(typeof h=="number")for(U=d;U<v;++U)this[U]=h;else{const k=a.isBuffer(h)?h:a.from(h,P),se=k.length;if(se===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(U=0;U<v-d;++U)this[U+d]=k[U%se]}return this};const j={};function N(g,h,d){j[g]=class extends d{constructor(){super(),Object.defineProperty(this,"message",{value:h.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${g}]`,this.stack,delete this.name}get code(){return g}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${g}]: ${this.message}`}}}N("ERR_BUFFER_OUT_OF_BOUNDS",function(g){return g?`${g} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),N("ERR_INVALID_ARG_TYPE",function(g,h){return`The "${g}" argument must be of type number. Received type ${typeof h}`},TypeError),N("ERR_OUT_OF_RANGE",function(g,h,d){let v=`The value of "${g}" is out of range.`,P=d;return Number.isInteger(d)&&Math.abs(d)>2**32?P=f(String(d)):typeof d=="bigint"&&(P=String(d),(d>BigInt(2)**BigInt(32)||d<-(BigInt(2)**BigInt(32)))&&(P=f(P)),P+="n"),v+=` It must be ${h}. Received ${P}`,v},RangeError);function f(g){let h="",d=g.length;const v=g[0]==="-"?1:0;for(;d>=v+4;d-=3)h=`_${g.slice(d-3,d)}${h}`;return`${g.slice(0,d)}${h}`}function A(g,h,d){ne(h,"offset"),(g[h]===void 0||g[h+d]===void 0)&&Ee(h,g.length-(d+1))}function ee(g,h,d,v,P,U){if(g>d||g<h){const k=typeof h=="bigint"?"n":"";let se;throw U>3?h===0||h===BigInt(0)?se=`>= 0${k} and < 2${k} ** ${(U+1)*8}${k}`:se=`>= -(2${k} ** ${(U+1)*8-1}${k}) and < 2 ** ${(U+1)*8-1}${k}`:se=`>= ${h}${k} and <= ${d}${k}`,new j.ERR_OUT_OF_RANGE("value",se,g)}A(v,P,U)}function ne(g,h){if(typeof g!="number")throw new j.ERR_INVALID_ARG_TYPE(h,"number",g)}function Ee(g,h,d){throw Math.floor(g)!==g?(ne(g,d),new j.ERR_OUT_OF_RANGE(d||"offset","an integer",g)):h<0?new j.ERR_BUFFER_OUT_OF_BOUNDS:new j.ERR_OUT_OF_RANGE(d||"offset",`>= ${d?1:0} and <= ${h}`,g)}const Le=/[^+/0-9A-Za-z-_]/g;function Pe(g){if(g=g.split("=")[0],g=g.trim().replace(Le,""),g.length<2)return"";for(;g.length%4!==0;)g=g+"=";return g}function Ue(g,h){h=h||1/0;let d;const v=g.length;let P=null;const U=[];for(let k=0;k<v;++k){if(d=g.charCodeAt(k),d>55295&&d<57344){if(!P){if(d>56319){(h-=3)>-1&&U.push(239,191,189);continue}else if(k+1===v){(h-=3)>-1&&U.push(239,191,189);continue}P=d;continue}if(d<56320){(h-=3)>-1&&U.push(239,191,189),P=d;continue}d=(P-55296<<10|d-56320)+65536}else P&&(h-=3)>-1&&U.push(239,191,189);if(P=null,d<128){if((h-=1)<0)break;U.push(d)}else if(d<2048){if((h-=2)<0)break;U.push(d>>6|192,d&63|128)}else if(d<65536){if((h-=3)<0)break;U.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((h-=4)<0)break;U.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return U}function Ge(g){const h=[];for(let d=0;d<g.length;++d)h.push(g.charCodeAt(d)&255);return h}function Ve(g,h){let d,v,P;const U=[];for(let k=0;k<g.length&&!((h-=2)<0);++k)d=g.charCodeAt(k),v=d>>8,P=d%256,U.push(P),U.push(v);return U}function Te(g){return e.toByteArray(Pe(g))}function Oe(g,h,d,v){let P;for(P=0;P<v&&!(P+d>=h.length||P>=g.length);++P)h[P+d]=g[P];return P}function me(g,h){return g instanceof h||g!=null&&g.constructor!=null&&g.constructor.name!=null&&g.constructor.name===h.name}function Ie(g){return g!==g}const $e=function(){const g="0123456789abcdef",h=new Array(256);for(let d=0;d<16;++d){const v=d*16;for(let P=0;P<16;++P)h[v+P]=g[d]+g[P]}return h}();function ge(g){return typeof BigInt>"u"?xe:g}function xe(){throw new Error("BigInt not supported")}})(P0);let ja;const qe={ethereumClient:void 0,setEthereumClient(t){ja=t},client(){if(ja)return ja;throw new Error("ClientCtrl has no client set")}},Ye=Er({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),He={state:Ye,subscribe(t){return zr(Ye,()=>t(Ye))},getAccount(){const t=qe.client().getAccount();Ye.address=t.address,Ye.isConnected=t.isConnected},async fetchProfile(t,e){try{Ye.profileLoading=!0;const r=e??Ye.address,{id:n}=qe.client().getDefaultChain();if(r&&n===1){const[i,s]=await Promise.all([qe.client().fetchEnsName({address:r,chainId:1}),qe.client().fetchEnsAvatar({address:r,chainId:1})]);s&&await t(s),Ye.profileName=i,Ye.profileAvatar=s}}finally{Ye.profileLoading=!1}},async fetchBalance(t){try{Ye.balanceLoading=!0;const e=t??Ye.address;if(e){const r=await qe.client().fetchBalance({address:e});Ye.balance={amount:r.formatted,symbol:r.symbol}}}finally{Ye.balanceLoading=!1}},setAddress(t){Ye.address=t},setIsConnected(t){Ye.isConnected=t},resetBalance(){Ye.balance=void 0},resetAccount(){Ye.address=void 0,Ye.isConnected=!1,Ye.profileName=void 0,Ye.profileAvatar=void 0,Ye.balance=void 0}},De={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return De.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isEmptyObject(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.getOwnPropertyNames(t).length===0&&Object.getOwnPropertySymbols(t).length===0},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e,r){if(De.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!De.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;t.endsWith("/")&&(n=t.slice(0,-1)),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}/wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(De.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(De.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(De.WALLETCONNECT_DEEPLINK_CHOICE)},isNull(t){return t===null},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(De.W3M_VERSION,"2.2.2")}},Mt=Er({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,isStandalone:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,walletConnectVersion:1}),le={state:Mt,subscribe(t){return zr(Mt,()=>t(Mt))},setChains(t){Mt.chains=t},setStandaloneChains(t){Mt.standaloneChains=t},setStandaloneUri(t){Mt.standaloneUri=t},getSelectedChain(){const t=qe.client().getNetwork().chain;return t&&(Mt.selectedChain=t),Mt.selectedChain},setSelectedChain(t){Mt.selectedChain=t},setIsStandalone(t){Mt.isStandalone=t},setIsCustomDesktop(t){Mt.isCustomDesktop=t},setIsCustomMobile(t){Mt.isCustomMobile=t},setIsDataLoaded(t){Mt.isDataLoaded=t},setIsUiLoaded(t){Mt.isUiLoaded=t},setWalletConnectVersion(t){Mt.walletConnectVersion=t}},Ds=Er({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerAllowList:void 0,explorerDenyList:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),at={state:Ds,subscribe(t){return zr(Ds,()=>t(Ds))},setConfig(t){var e,r,n,i;if(le.setStandaloneChains(t.standaloneChains),le.setIsStandalone(!!((e=t.standaloneChains)!=null&&e.length)||!!t.enableStandaloneMode),le.setIsCustomMobile(!!((r=t.mobileWallets)!=null&&r.length)),le.setIsCustomDesktop(!!((n=t.desktopWallets)!=null&&n.length)),le.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),!le.state.isStandalone){const s=qe.client().getDefaultChain();le.setSelectedChain(s),le.setChains(qe.client().chains)}t.defaultChain&&le.setSelectedChain(t.defaultChain),De.setWeb3ModalVersionInStorage(),Object.assign(Ds,t)}},R0="https://explorer-api.walletconnect.com";function e6(t){const e=Object.fromEntries(Object.entries(t).filter(([r,n])=>typeof n<"u"&&n!==null&&n!=="").map(([r,n])=>[r,n.toString()]));return new URLSearchParams(e).toString()}const Os={async fetchWallets(t,e){const r=e6(e),n=`${R0}/v3/wallets?projectId=${t}&${r}`;return(await fetch(n)).json()},formatImageUrl(t,e){return`${R0}/v3/logo/lg/${e}?projectId=${t}`}},Wr=Er({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},previewWallets:[],recomendedWallets:[]});function $s(){const{projectId:t}=at.state;if(!t)throw new Error("projectId is required to work with explorer api");return t}const ct={state:Wr,async getPreviewWallets(t){const{listings:e}=await Os.fetchWallets($s(),t);return Wr.previewWallets=Object.values(e),Wr.previewWallets},async getRecomendedWallets(){const{listings:t}=await Os.fetchWallets($s(),{page:1,entries:6});Wr.recomendedWallets=Object.values(t)},async getPaginatedWallets(t){const{page:e,search:r}=t,{listings:n,total:i}=await Os.fetchWallets($s(),t),s=Object.values(n),o=r?"search":"wallets";return Wr[o]={listings:[...Wr[o].listings,...s],total:i,page:e??1},{listings:s,total:i}},getImageUrl(t){return Os.formatImageUrl($s(),t)},resetSearch(){Wr.search={listings:[],total:0,page:1}}},Ht=Er({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Ae={state:Ht,subscribe(t){return zr(Ht,()=>t(Ht))},push(t,e){t!==Ht.view&&(Ht.view=t,e&&(Ht.data=e),Ht.history.push(t))},replace(t){Ht.view=t,Ht.history=[t]},goBack(){if(Ht.history.length>1){Ht.history.pop();const[t]=Ht.history.slice(-1);Ht.view=t}}},xn=Er({open:!1}),lt={state:xn,subscribe(t){return zr(xn,()=>t(xn))},async open(t){return new Promise(e=>{const{isStandalone:r,isUiLoaded:n,isDataLoaded:i}=le.state,{isConnected:s}=He.state,{enableNetworkView:o}=at.state;if(r?(le.setStandaloneUri(t?.uri),le.setStandaloneChains(t?.standaloneChains),Ae.replace("ConnectWallet")):t!=null&&t.route?Ae.replace(t.route):s?Ae.replace("Account"):o?Ae.replace("SelectNetwork"):Ae.replace("ConnectWallet"),n&&i)xn.open=!0,e();else{const a=setInterval(()=>{le.state.isUiLoaded&&le.state.isDataLoaded&&(clearInterval(a),xn.open=!0,e())},200)}})},close(){xn.open=!1}};var t6=Object.defineProperty,N0=Object.getOwnPropertySymbols,r6=Object.prototype.hasOwnProperty,n6=Object.prototype.propertyIsEnumerable,M0=(t,e,r)=>e in t?t6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,i6=(t,e)=>{for(var r in e||(e={}))r6.call(e,r)&&M0(t,r,e[r]);if(N0)for(var r of N0(e))n6.call(e,r)&&M0(t,r,e[r]);return t};function s6(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const vi=Er({themeMode:s6()?"dark":"light"}),fr={state:vi,subscribe(t){return zr(vi,()=>t(vi))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(vi.themeMode=e),r&&(vi.themeVariables=i6({},r))}},qr=Er({open:!1,message:"",variant:"success"}),Ot={state:qr,subscribe(t){return zr(qr,()=>t(qr))},openToast(t,e){qr.open=!0,qr.message=t,qr.variant=e},closeToast(){qr.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=P0.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var o6=Object.defineProperty,L0=Object.getOwnPropertySymbols,a6=Object.prototype.hasOwnProperty,c6=Object.prototype.propertyIsEnumerable,U0=(t,e,r)=>e in t?o6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,l6=(t,e)=>{for(var r in e||(e={}))a6.call(e,r)&&U0(t,r,e[r]);if(L0)for(var r of L0(e))c6.call(e,r)&&U0(t,r,e[r]);return t};class h6{constructor(e){this.openModal=lt.open,this.closeModal=lt.close,this.subscribeModal=lt.subscribe,this.setTheme=fr.setThemeConfig,fr.setThemeConfig(e),at.setConfig(l6({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return x7});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),le.setIsUiLoaded(!0)}}}var u6=Object.freeze({__proto__:null,Web3Modal:h6});/**
|
|
78
78
|
* @license
|
|
79
79
|
* Copyright 2019 Google LLC
|
|
80
80
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
|
-
*/const
|
|
81
|
+
*/const As=window,Fa=As.ShadowRoot&&(As.ShadyCSS===void 0||As.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ba=Symbol(),j0=new WeakMap;class F0{constructor(e,r,n){if(this._$cssResult$=!0,n!==Ba)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Fa&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=j0.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&j0.set(r,e))}return e}toString(){return this.cssText}}const d6=t=>new F0(typeof t=="string"?t:t+"",void 0,Ba),be=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new F0(r,t,Ba)},f6=(t,e)=>{Fa?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=As.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},B0=Fa?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return d6(r)})(t):t;/**
|
|
82
82
|
* @license
|
|
83
83
|
* Copyright 2017 Google LLC
|
|
84
84
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
85
|
-
*/var
|
|
85
|
+
*/var ka;const Ps=window,k0=Ps.trustedTypes,p6=k0?k0.emptyScript:"",H0=Ps.reactiveElementPolyfillSupport,Ha={toAttribute(t,e){switch(e){case Boolean:t=t?p6:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},z0=(t,e)=>e!==t&&(e==e||t==t),za={attribute:!0,type:String,converter:Ha,reflect:!1,hasChanged:z0};class Cn extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,n)=>{const i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=za){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){const s=this[e];this[r]=i,this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||za}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(B0(i))}else e!==void 0&&r.push(B0(e));return r}static _$Ep(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return f6(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=za){var i;const s=this.constructor._$Ep(e,n);if(s!==void 0&&n.reflect===!0){const o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:Ha).toAttribute(r,n.type);this._$El=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$El=null}}_$AK(e,r){var n;const i=this.constructor,s=i._$Ev.get(e);if(s!==void 0&&this._$El!==s){const o=i.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:Ha;this._$El=s,this[s]=a.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||z0)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,s)=>this[s]=i),this._$Ei=void 0);let r=!1;const n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdate)===null||s===void 0?void 0:s.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}Cn.finalized=!0,Cn.elementProperties=new Map,Cn.elementStyles=[],Cn.shadowRootOptions={mode:"open"},H0?.({ReactiveElement:Cn}),((ka=Ps.reactiveElementVersions)!==null&&ka!==void 0?ka:Ps.reactiveElementVersions=[]).push("1.6.1");/**
|
|
86
86
|
* @license
|
|
87
87
|
* Copyright 2017 Google LLC
|
|
88
88
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
89
|
-
*/var
|
|
89
|
+
*/var Wa;const Ts=window,In=Ts.trustedTypes,W0=In?In.createPolicy("lit-html",{createHTML:t=>t}):void 0,xr=`lit$${(Math.random()+"").slice(9)}$`,q0="?"+xr,g6=`<${q0}>`,Sn=document,_i=(t="")=>Sn.createComment(t),Ei=t=>t===null||typeof t!="object"&&typeof t!="function",V0=Array.isArray,m6=t=>V0(t)||typeof t?.[Symbol.iterator]=="function",xi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,K0=/-->/g,G0=/>/g,Vr=RegExp(`>|[
|
|
90
90
|
\f\r](?:([^\\s"'>=/]+)([
|
|
91
91
|
\f\r]*=[
|
|
92
92
|
\f\r]*(?:[^
|
|
93
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
93
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Z0=/'/g,Y0=/"/g,J0=/^(?:script|style|textarea|title)$/i,X0=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),V=X0(1),Re=X0(2),Kr=Symbol.for("lit-noChange"),ht=Symbol.for("lit-nothing"),Q0=new WeakMap,Dn=Sn.createTreeWalker(Sn,129,null,!1),w6=(t,e)=>{const r=t.length-1,n=[];let i,s=e===2?"<svg>":"",o=xi;for(let c=0;c<r;c++){const l=t[c];let p,m,w=-1,y=0;for(;y<l.length&&(o.lastIndex=y,m=o.exec(l),m!==null);)y=o.lastIndex,o===xi?m[1]==="!--"?o=K0:m[1]!==void 0?o=G0:m[2]!==void 0?(J0.test(m[2])&&(i=RegExp("</"+m[2],"g")),o=Vr):m[3]!==void 0&&(o=Vr):o===Vr?m[0]===">"?(o=i??xi,w=-1):m[1]===void 0?w=-2:(w=o.lastIndex-m[2].length,p=m[1],o=m[3]===void 0?Vr:m[3]==='"'?Y0:Z0):o===Y0||o===Z0?o=Vr:o===K0||o===G0?o=xi:(o=Vr,i=void 0);const E=o===Vr&&t[c+1].startsWith("/>")?" ":"";s+=o===xi?l+g6:w>=0?(n.push(p),l.slice(0,w)+"$lit$"+l.slice(w)+xr+E):l+xr+(w===-2?(n.push(void 0),c):E)}const a=s+(t[r]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[W0!==void 0?W0.createHTML(a):a,n]};class Ci{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[l,p]=w6(e,r);if(this.el=Ci.createElement(l,n),Dn.currentNode=this.el.content,r===2){const m=this.el.content,w=m.firstChild;w.remove(),m.append(...w.childNodes)}for(;(i=Dn.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes()){const m=[];for(const w of i.getAttributeNames())if(w.endsWith("$lit$")||w.startsWith(xr)){const y=p[o++];if(m.push(w),y!==void 0){const E=i.getAttribute(y.toLowerCase()+"$lit$").split(xr),T=/([.?@])?(.*)/.exec(y);c.push({type:1,index:s,name:T[2],strings:E,ctor:T[1]==="."?b6:T[1]==="?"?_6:T[1]==="@"?E6:Rs})}else c.push({type:6,index:s})}for(const w of m)i.removeAttribute(w)}if(J0.test(i.tagName)){const m=i.textContent.split(xr),w=m.length-1;if(w>0){i.textContent=In?In.emptyScript:"";for(let y=0;y<w;y++)i.append(m[y],_i()),Dn.nextNode(),c.push({type:2,index:++s});i.append(m[w],_i())}}}else if(i.nodeType===8)if(i.data===q0)c.push({type:2,index:s});else{let m=-1;for(;(m=i.data.indexOf(xr,m+1))!==-1;)c.push({type:7,index:s}),m+=xr.length-1}s++}}static createElement(e,r){const n=Sn.createElement("template");return n.innerHTML=e,n}}function On(t,e,r=t,n){var i,s,o,a;if(e===Kr)return e;let c=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const l=Ei(e)?void 0:e._$litDirective$;return c?.constructor!==l&&((s=c?._$AO)===null||s===void 0||s.call(c,!1),l===void 0?c=void 0:(c=new l(t),c._$AT(t,r,n)),n!==void 0?((o=(a=r)._$Co)!==null&&o!==void 0?o:a._$Co=[])[n]=c:r._$Cl=c),c!==void 0&&(e=On(t,c._$AS(t,e.values),c,n)),e}class y6{constructor(e,r){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var r;const{el:{content:n},parts:i}=this._$AD,s=((r=e?.creationScope)!==null&&r!==void 0?r:Sn).importNode(n,!0);Dn.currentNode=s;let o=Dn.nextNode(),a=0,c=0,l=i[0];for(;l!==void 0;){if(a===l.index){let p;l.type===2?p=new Ii(o,o.nextSibling,this,e):l.type===1?p=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(p=new x6(o,this,e)),this.u.push(p),l=i[++c]}a!==l?.index&&(o=Dn.nextNode(),a++)}return s}p(e){let r=0;for(const n of this.u)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class Ii{constructor(e,r,n,i){var s;this.type=2,this._$AH=ht,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cm=(s=i?.isConnected)===null||s===void 0||s}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cm}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&e.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=On(this,e,r),Ei(e)?e===ht||e==null||e===""?(this._$AH!==ht&&this._$AR(),this._$AH=ht):e!==this._$AH&&e!==Kr&&this.g(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):m6(e)?this.k(e):this.g(e)}O(e,r=this._$AB){return this._$AA.parentNode.insertBefore(e,r)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==ht&&Ei(this._$AH)?this._$AA.nextSibling.data=e:this.T(Sn.createTextNode(e)),this._$AH=e}$(e){var r;const{values:n,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ci.createElement(i.h,this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===s)this._$AH.p(n);else{const o=new y6(s,this),a=o.v(this.options);o.p(n),this.T(a),this._$AH=o}}_$AC(e){let r=Q0.get(e.strings);return r===void 0&&Q0.set(e.strings,r=new Ci(e)),r}k(e){V0(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const s of e)i===r.length?r.push(n=new Ii(this.O(_i()),this.O(_i()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cm=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class Rs{constructor(e,r,n,i,s){this.type=1,this._$AH=ht,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=ht}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){const s=this.strings;let o=!1;if(s===void 0)e=On(this,e,r,0),o=!Ei(e)||e!==this._$AH&&e!==Kr,o&&(this._$AH=e);else{const a=e;let c,l;for(e=s[0],c=0;c<s.length-1;c++)l=On(this,a[n+c],r,c),l===Kr&&(l=this._$AH[c]),o||(o=!Ei(l)||l!==this._$AH[c]),l===ht?e=ht:e!==ht&&(e+=(l??"")+s[c+1]),this._$AH[c]=l}o&&!i&&this.j(e)}j(e){e===ht?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class b6 extends Rs{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ht?void 0:e}}const v6=In?In.emptyScript:"";class _6 extends Rs{constructor(){super(...arguments),this.type=4}j(e){e&&e!==ht?this.element.setAttribute(this.name,v6):this.element.removeAttribute(this.name)}}class E6 extends Rs{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){var n;if((e=(n=On(this,e,r,0))!==null&&n!==void 0?n:ht)===Kr)return;const i=this._$AH,s=e===ht&&i!==ht||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==ht&&(i===ht||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class x6{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){On(this,e)}}const ed=Ts.litHtmlPolyfillSupport;ed?.(Ci,Ii),((Wa=Ts.litHtmlVersions)!==null&&Wa!==void 0?Wa:Ts.litHtmlVersions=[]).push("2.6.1");const C6=(t,e,r)=>{var n,i;const s=(n=r?.renderBefore)!==null&&n!==void 0?n:e;let o=s._$litPart$;if(o===void 0){const a=(i=r?.renderBefore)!==null&&i!==void 0?i:null;s._$litPart$=o=new Ii(e.insertBefore(_i(),a),a,void 0,r??{})}return o._$AI(t),o};/**
|
|
94
94
|
* @license
|
|
95
95
|
* Copyright 2017 Google LLC
|
|
96
96
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
97
|
-
*/var
|
|
97
|
+
*/var qa,Va;class ue extends Cn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=C6(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Kr}}ue.finalized=!0,ue._$litElement$=!0,(qa=globalThis.litElementHydrateSupport)===null||qa===void 0||qa.call(globalThis,{LitElement:ue});const td=globalThis.litElementPolyfillSupport;td?.({LitElement:ue}),((Va=globalThis.litElementVersions)!==null&&Va!==void 0?Va:globalThis.litElementVersions=[]).push("3.2.2");/**
|
|
98
98
|
* @license
|
|
99
99
|
* Copyright 2017 Google LLC
|
|
100
100
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
* @license
|
|
103
103
|
* Copyright 2017 Google LLC
|
|
104
104
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
105
|
-
*/const
|
|
105
|
+
*/const I6=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}};function ye(t){return(e,r)=>r!==void 0?((n,i,s)=>{i.constructor.createProperty(s,n)})(t,e,r):I6(t,e)}/**
|
|
106
106
|
* @license
|
|
107
107
|
* Copyright 2017 Google LLC
|
|
108
108
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -110,24 +110,24 @@
|
|
|
110
110
|
* @license
|
|
111
111
|
* Copyright 2021 Google LLC
|
|
112
112
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
113
|
-
*/var
|
|
113
|
+
*/var Ka;((Ka=window.HTMLSlotElement)===null||Ka===void 0?void 0:Ka.prototype.assignedElements)!=null;/**
|
|
114
114
|
* @license
|
|
115
115
|
* Copyright 2017 Google LLC
|
|
116
116
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
117
|
-
*/const
|
|
117
|
+
*/const S6={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},D6=t=>(...e)=>({_$litDirective$:t,values:e});class O6{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
|
|
118
118
|
* @license
|
|
119
119
|
* Copyright 2018 Google LLC
|
|
120
120
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
121
|
-
*/const Ft=Rv(class extends Mv{constructor(t){var e;if(super(t),t.type!==Nv.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.nt===void 0){this.nt=new Set,t.strings!==void 0&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!(!((r=this.st)===null||r===void 0)&&r.has(s))&&this.nt.add(s);return this.render(e)}const i=t.element.classList;this.nt.forEach(s=>{s in e||(i.remove(s),this.nt.delete(s))});for(const s in e){const o=!!e[s];o===this.nt.has(s)||!((n=this.st)===null||n===void 0)&&n.has(s)||(o?(i.add(s),this.nt.add(s)):(i.remove(s),this.nt.delete(s)))}return Zr}});function Lv(t,e){t.indexOf(e)===-1&&t.push(e)}const F0=(t,e,r)=>Math.min(Math.max(r,t),e),Zt={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Ci=t=>typeof t=="number",$n=t=>Array.isArray(t)&&!Ci(t[0]),Uv=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function jv(t,e){return $n(t)?t[Uv(0,t.length,e)]:t}const B0=(t,e,r)=>-r*t+r*e+t,k0=()=>{},cr=t=>t,Ka=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function H0(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Ka(0,e,n);t.push(B0(r,1,i))}}function Fv(t){const e=[0];return H0(e,t-1),e}function Bv(t,e=Fv(t.length),r=cr){const n=t.length,i=n-e.length;return i>0&&H0(e,i),s=>{let o=0;for(;o<n-2&&!(s<e[o+1]);o++);let a=F0(0,1,Ka(e[o],e[o+1],s));return a=jv(r,o)(a),B0(t[o],t[o+1],a)}}const z0=t=>Array.isArray(t)&&Ci(t[0]),Ga=t=>typeof t=="object"&&Boolean(t.createAnimation),Yr=t=>typeof t=="function",W0=t=>typeof t=="string",An={ms:t=>t*1e3,s:t=>t/1e3};function kv(t,e){return e?t*(1e3/e):0}const q0=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,Hv=1e-7,zv=12;function Wv(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=q0(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>Hv&&++a<zv);return o}function Ii(t,e,r,n){if(t===e&&r===n)return cr;const i=s=>Wv(s,0,1,t,r);return s=>s===0||s===1?s:q0(i(s),e,n)}const qv=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return F0(0,1,i/t)},V0={ease:Ii(.25,.1,.25,1),"ease-in":Ii(.42,0,1,1),"ease-in-out":Ii(.42,0,.58,1),"ease-out":Ii(0,0,.58,1)},Vv=/\((.*?)\)/;function K0(t){if(Yr(t))return t;if(z0(t))return Ii(...t);if(V0[t])return V0[t];if(t.startsWith("steps")){const e=Vv.exec(t);if(e){const r=e[1].split(",");return qv(parseFloat(r[0]),r[1].trim())}}return cr}class G0{constructor(e,r=[0,1],{easing:n,duration:i=Zt.duration,delay:s=Zt.delay,endDelay:o=Zt.endDelay,repeat:a=Zt.repeat,offset:c,direction:l="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=cr,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((m,w)=>{this.resolve=m,this.reject=w}),n=n||Zt.easing,Ga(n)){const m=n.createAnimation(r);n=m.easing,r=m.keyframes||r,i=m.duration||i}this.repeat=a,this.easing=$n(n)?cr:K0(n),this.updateDuration(i);const p=Bv(r,c,$n(n)?n.map(K0):cr);this.tick=m=>{var w;s=s;let y=0;this.pauseTime!==void 0?y=this.pauseTime:y=(m-this.startTime)*this.rate,this.t=y,y/=1e3,y=Math.max(y-s,0),this.playState==="finished"&&this.pauseTime===void 0&&(y=this.totalDuration);const E=y/this.duration;let T=Math.floor(E),N=E%1;!N&&E>=1&&(N=1),N===1&&T--;const L=T%2;(l==="reverse"||l==="alternate"&&L||l==="alternate-reverse"&&!L)&&(N=1-N);const C=y>=this.totalDuration?1:Math.min(N,1),D=p(this.easing(C));e(D),this.pauseTime===void 0&&(this.playState==="finished"||y>=this.totalDuration+o)?(this.playState="finished",(w=this.resolve)===null||w===void 0||w.call(this,D)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var Za=function(){};process.env.NODE_ENV!=="production"&&(Za=function(t,e){if(!t)throw new Error(e)});class Kv{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ya=new WeakMap;function Z0(t){return Ya.has(t)||Ya.set(t,{transforms:[],values:new Map}),Ya.get(t)}function Gv(t,e){return t.has(e)||t.set(e,new Kv),t.get(e)}const Zv=["","X","Y","Z"],Yv=["translate","scale","rotate","skew"],Ts={x:"translateX",y:"translateY",z:"translateZ"},Y0={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},Jv={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:Y0,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:cr},skew:Y0},Pn=new Map,Ja=t=>`--motion-${t}`,Ns=["x","y","z"];Yv.forEach(t=>{Zv.forEach(e=>{Ns.push(t+e),Pn.set(Ja(t+e),Jv[t])})});const Xv=(t,e)=>Ns.indexOf(t)-Ns.indexOf(e),Qv=new Set(Ns),J0=t=>Qv.has(t),e6=(t,e)=>{Ts[e]&&(e=Ts[e]);const{transforms:r}=Z0(t);Lv(r,e),t.style.transform=t6(r)},t6=t=>t.sort(Xv).reduce(r6,"").trim(),r6=(t,e)=>`${t} ${e}(var(${Ja(e)}))`,Xa=t=>t.startsWith("--"),X0=new Set;function n6(t){if(!X0.has(t)){X0.add(t);try{const{syntax:e,initialValue:r}=Pn.has(t)?Pn.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const Qa=(t,e)=>document.createElement("div").animate(t,e),Q0={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Qa({opacity:[1]})}catch{return!1}return!0},finished:()=>Boolean(Qa({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{Qa({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},ec={},Tn={};for(const t in Q0)Tn[t]=()=>(ec[t]===void 0&&(ec[t]=Q0[t]()),ec[t]);const i6=.015,s6=(t,e)=>{let r="";const n=Math.round(e/i6);for(let i=0;i<n;i++)r+=t(Ka(0,n-1,i))+", ";return r.substring(0,r.length-2)},ed=(t,e)=>Yr(t)?Tn.linearEasing()?`linear(${s6(t,e)})`:Zt.easing:z0(t)?o6(t):t,o6=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function a6(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const c6=t=>Array.isArray(t)?t:[t];function Rs(t){return Ts[t]&&(t=Ts[t]),J0(t)?Ja(t):t}const Ms={get:(t,e)=>{e=Rs(e);let r=Xa(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=Pn.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=Rs(e),Xa(e)?t.style.setProperty(e,r):t.style[e]=r}};function td(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function rd(t,e){var r;let n=e?.toDefaultUnit||cr;const i=t[t.length-1];if(W0(i)){const s=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";s&&(n=o=>o+s)}return n}function l6(){return window.__MOTION_DEV_TOOLS_RECORD}function h6(t,e,r,n={},i){const s=l6(),o=n.record!==!1&&s;let a,{duration:c=Zt.duration,delay:l=Zt.delay,endDelay:p=Zt.endDelay,repeat:m=Zt.repeat,easing:w=Zt.easing,persist:y=!1,direction:E,offset:T,allowWebkitAcceleration:N=!1}=n;const L=Z0(t),C=J0(e);let D=Tn.waapi();C&&e6(t,e);const b=Rs(e),S=Gv(L.values,b),O=Pn.get(b);return td(S.animation,!(Ga(w)&&S.generator)&&n.record!==!1),()=>{const u=()=>{var B,q;return(q=(B=Ms.get(t,b))!==null&&B!==void 0?B:O?.initialValue)!==null&&q!==void 0?q:0};let _=a6(c6(r),u);const H=rd(_,O);if(Ga(w)){const B=w.createAnimation(_,e!=="opacity",u,b,S);w=B.easing,_=B.keyframes||_,c=B.duration||c}if(Xa(b)&&(Tn.cssRegisterProperty()?n6(b):D=!1),C&&!Tn.linearEasing()&&(Yr(w)||$n(w)&&w.some(Yr))&&(D=!1),D){O&&(_=_.map(X=>Ci(X)?O.toDefaultUnit(X):X)),_.length===1&&(!Tn.partialKeyframes()||o)&&_.unshift(u());const B={delay:An.ms(l),duration:An.ms(c),endDelay:An.ms(p),easing:$n(w)?void 0:ed(w,c),direction:E,iterations:m+1,fill:"both"};a=t.animate({[b]:_,offset:T,easing:$n(w)?w.map(X=>ed(X,c)):void 0},B),a.finished||(a.finished=new Promise((X,te)=>{a.onfinish=X,a.oncancel=te}));const q=_[_.length-1];a.finished.then(()=>{y||(Ms.set(t,b,q),a.cancel())}).catch(k0),N||(a.playbackRate=1.000001)}else if(i&&C)_=_.map(B=>typeof B=="string"?parseFloat(B):B),_.length===1&&_.unshift(parseFloat(u())),a=new i(B=>{Ms.set(t,b,H?H(B):B)},_,Object.assign(Object.assign({},n),{duration:c,easing:w}));else{const B=_[_.length-1];Ms.set(t,b,O&&Ci(B)?O.toDefaultUnit(B):B)}return o&&s(t,e,_,{duration:c,delay:l,easing:w,repeat:m,offset:T},"motion-one"),S.setAnimation(a),a}}const u6=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function nd(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const d6=t=>t(),id=(t,e,r=Zt.duration)=>new Proxy({animations:t.map(d6).filter(Boolean),duration:r,options:e},p6),f6=t=>t.animations[0],p6={get:(t,e)=>{const r=f6(t);switch(e){case"duration":return t.duration;case"currentTime":return An.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(g6)).catch(k0)),t.finished;case"stop":return()=>{t.animations.forEach(n=>td(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=An.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},g6=t=>t.finished;function m6(t,e,r){return Yr(t)?t(e,r):t}function w6(t){return function(r,n,i={}){r=nd(r);const s=r.length;Za(Boolean(s),"No valid element provided."),Za(Boolean(n),"No keyframes defined.");const o=[];for(let a=0;a<s;a++){const c=r[a];for(const l in n){const p=u6(i,l);p.delay=m6(p.delay,a,s);const m=h6(c,l,n[l],p,t);o.push(m)}}return id(o,i,i.duration)}}const y6=w6(G0);function b6(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}const v6=5;function sd(t,e,r){const n=Math.max(e-v6,0);return kv(r-t(n),e-n)}const Nn={stiffness:100,damping:10,mass:1},_6=(t=Nn.stiffness,e=Nn.damping,r=Nn.mass)=>e/(2*Math.sqrt(t*r));function E6(t,e,r){return t<e&&r>=e||t>e&&r<=e}const x6=({stiffness:t=Nn.stiffness,damping:e=Nn.damping,mass:r=Nn.mass,from:n=0,to:i=1,velocity:s=0,restSpeed:o=2,restDistance:a=.5}={})=>{s=s?An.s(s):0;const c={done:!1,hasReachedTarget:!1,current:n,target:i},l=i-n,p=Math.sqrt(t/r)/1e3,m=_6(t,e,r);let w;if(m<1){const y=p*Math.sqrt(1-m*m);w=E=>i-Math.exp(-m*p*E)*((-s+m*p*l)/y*Math.sin(y*E)+l*Math.cos(y*E))}else w=y=>i-Math.exp(-p*y)*(l+(-s+p*l)*y);return y=>{c.current=w(y);const E=y===0?s:sd(w,y,c.current),T=Math.abs(E)<=o,N=Math.abs(i-c.current)<=a;return c.done=T&&N,c.hasReachedTarget=E6(n,i,c.current),c}},tc=10,C6=1e4;function I6(t,e=cr){let r,n=tc,i=t(0);const s=[e(i.current)];for(;!i.done&&n<C6;)i=t(n),s.push(e(i.done?i.target:i.current)),r===void 0&&i.hasReachedTarget&&(r=n),n+=tc;const o=n-tc;return s.length===1&&s.push(i.current),{keyframes:s,duration:o/1e3,overshootDuration:(r??o)/1e3}}function od(t){return Ci(t)&&!isNaN(t)}function rc(t){return W0(t)?parseFloat(t):t}function S6(t){const e=new WeakMap;return(r={})=>{const n=new Map,i=(o=0,a=100,c=0,l=!1)=>{const p=`${o}-${a}-${c}-${l}`;return n.has(p)||n.set(p,t(Object.assign({from:o,to:a,velocity:c,restSpeed:l?.05:2,restDistance:l?.01:.5},r))),n.get(p)},s=(o,a)=>(e.has(o)||e.set(o,I6(o,a)),e.get(o));return{createAnimation:(o,a=!0,c,l,p)=>{let m,w,y,E=0,T=cr;const N=o.length;if(a){T=rd(o,l?Pn.get(Rs(l)):void 0);const L=o[N-1];if(y=rc(L),N>1&&o[0]!==null)w=rc(o[0]);else{const C=p?.generator;if(C){const{animation:D,generatorStartTime:b}=p,S=D?.startTime||b||0,O=D?.currentTime||performance.now()-S,u=C(O).current;w=u,E=sd(_=>C(_).current,O,u)}else c&&(w=rc(c()))}}if(od(w)&&od(y)){const L=i(w,y,E,l?.includes("scale"));m=Object.assign(Object.assign({},s(L,T)),{easing:"linear"}),p&&(p.generator=L,p.generatorStartTime=performance.now())}return m||(m={easing:"ease",duration:s(i(0,100)).overshootDuration}),m}}}}const Ls=S6(x6),D6={any:0,all:1};function O6(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const s=nd(t),o=new WeakMap,a=l=>{l.forEach(p=>{const m=o.get(p.target);if(p.isIntersecting!==Boolean(m))if(p.isIntersecting){const w=e(p);Yr(w)?o.set(p.target,w):c.unobserve(p.target)}else m&&(m(p),o.delete(p.target))})},c=new IntersectionObserver(a,{root:r,rootMargin:n,threshold:typeof i=="number"?i:D6[i]});return s.forEach(l=>c.observe(l)),()=>c.disconnect()}function nc(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function ad(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const $6={isActive:t=>Boolean(t.inView),subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,s=b6(n,["once"]);return O6(t,o=>{if(e(),ad(t,"viewenter",o),!i)return a=>{r(),ad(t,"viewleave",a)}},s)}},cd=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),nc(t,e,n))};[...Object.keys({inView:$6,hover:{isActive:t=>Boolean(t.hover),subscribe:(t,{enable:e,disable:r})=>{const n=cd(t,"hoverstart",e),i=cd(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>Boolean(t.press),subscribe:(t,{enable:e,disable:r})=>{const n=s=>{r(),nc(t,"pressend",s),window.removeEventListener("pointerup",n)},i=s=>{e(),nc(t,"pressstart",s),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function A6(t,e={}){return id([()=>{const r=new G0(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function Cr(t,e,r){return(Yr(t)?A6:y6)(t,e,r)}/**
|
|
121
|
+
*/const Ft=D6(class extends O6{constructor(t){var e;if(super(t),t.type!==S6.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.nt===void 0){this.nt=new Set,t.strings!==void 0&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!(!((r=this.st)===null||r===void 0)&&r.has(s))&&this.nt.add(s);return this.render(e)}const i=t.element.classList;this.nt.forEach(s=>{s in e||(i.remove(s),this.nt.delete(s))});for(const s in e){const o=!!e[s];o===this.nt.has(s)||!((n=this.st)===null||n===void 0)&&n.has(s)||(o?(i.add(s),this.nt.add(s)):(i.remove(s),this.nt.delete(s)))}return Kr}});function $6(t,e){t.indexOf(e)===-1&&t.push(e)}const rd=(t,e,r)=>Math.min(Math.max(r,t),e),Zt={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Si=t=>typeof t=="number",$n=t=>Array.isArray(t)&&!Si(t[0]),A6=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function P6(t,e){return $n(t)?t[A6(0,t.length,e)]:t}const nd=(t,e,r)=>-r*t+r*e+t,id=()=>{},ar=t=>t,Ga=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function sd(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Ga(0,e,n);t.push(nd(r,1,i))}}function T6(t){const e=[0];return sd(e,t-1),e}function R6(t,e=T6(t.length),r=ar){const n=t.length,i=n-e.length;return i>0&&sd(e,i),s=>{let o=0;for(;o<n-2&&!(s<e[o+1]);o++);let a=rd(0,1,Ga(e[o],e[o+1],s));return a=P6(r,o)(a),nd(t[o],t[o+1],a)}}const od=t=>Array.isArray(t)&&Si(t[0]),Za=t=>typeof t=="object"&&Boolean(t.createAnimation),Gr=t=>typeof t=="function",ad=t=>typeof t=="string",An={ms:t=>t*1e3,s:t=>t/1e3};function N6(t,e){return e?t*(1e3/e):0}const cd=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,M6=1e-7,L6=12;function U6(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=cd(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>M6&&++a<L6);return o}function Di(t,e,r,n){if(t===e&&r===n)return ar;const i=s=>U6(s,0,1,t,r);return s=>s===0||s===1?s:cd(i(s),e,n)}const j6=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return rd(0,1,i/t)},ld={ease:Di(.25,.1,.25,1),"ease-in":Di(.42,0,1,1),"ease-in-out":Di(.42,0,.58,1),"ease-out":Di(0,0,.58,1)},F6=/\((.*?)\)/;function hd(t){if(Gr(t))return t;if(od(t))return Di(...t);if(ld[t])return ld[t];if(t.startsWith("steps")){const e=F6.exec(t);if(e){const r=e[1].split(",");return j6(parseFloat(r[0]),r[1].trim())}}return ar}class ud{constructor(e,r=[0,1],{easing:n,duration:i=Zt.duration,delay:s=Zt.delay,endDelay:o=Zt.endDelay,repeat:a=Zt.repeat,offset:c,direction:l="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=ar,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((m,w)=>{this.resolve=m,this.reject=w}),n=n||Zt.easing,Za(n)){const m=n.createAnimation(r);n=m.easing,r=m.keyframes||r,i=m.duration||i}this.repeat=a,this.easing=$n(n)?ar:hd(n),this.updateDuration(i);const p=R6(r,c,$n(n)?n.map(hd):ar);this.tick=m=>{var w;s=s;let y=0;this.pauseTime!==void 0?y=this.pauseTime:y=(m-this.startTime)*this.rate,this.t=y,y/=1e3,y=Math.max(y-s,0),this.playState==="finished"&&this.pauseTime===void 0&&(y=this.totalDuration);const E=y/this.duration;let T=Math.floor(E),R=E%1;!R&&E>=1&&(R=1),R===1&&T--;const L=T%2;(l==="reverse"||l==="alternate"&&L||l==="alternate-reverse"&&!L)&&(R=1-R);const C=y>=this.totalDuration?1:Math.min(R,1),O=p(this.easing(C));e(O),this.pauseTime===void 0&&(this.playState==="finished"||y>=this.totalDuration+o)?(this.playState="finished",(w=this.resolve)===null||w===void 0||w.call(this,O)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var Ya=function(){};process.env.NODE_ENV!=="production"&&(Ya=function(t,e){if(!t)throw new Error(e)});class B6{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ja=new WeakMap;function dd(t){return Ja.has(t)||Ja.set(t,{transforms:[],values:new Map}),Ja.get(t)}function k6(t,e){return t.has(e)||t.set(e,new B6),t.get(e)}const H6=["","X","Y","Z"],z6=["translate","scale","rotate","skew"],Ns={x:"translateX",y:"translateY",z:"translateZ"},fd={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},W6={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:fd,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:ar},skew:fd},Pn=new Map,Xa=t=>`--motion-${t}`,Ms=["x","y","z"];z6.forEach(t=>{H6.forEach(e=>{Ms.push(t+e),Pn.set(Xa(t+e),W6[t])})});const q6=(t,e)=>Ms.indexOf(t)-Ms.indexOf(e),V6=new Set(Ms),pd=t=>V6.has(t),K6=(t,e)=>{Ns[e]&&(e=Ns[e]);const{transforms:r}=dd(t);$6(r,e),t.style.transform=G6(r)},G6=t=>t.sort(q6).reduce(Z6,"").trim(),Z6=(t,e)=>`${t} ${e}(var(${Xa(e)}))`,Qa=t=>t.startsWith("--"),gd=new Set;function Y6(t){if(!gd.has(t)){gd.add(t);try{const{syntax:e,initialValue:r}=Pn.has(t)?Pn.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const ec=(t,e)=>document.createElement("div").animate(t,e),md={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{ec({opacity:[1]})}catch{return!1}return!0},finished:()=>Boolean(ec({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{ec({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},tc={},Tn={};for(const t in md)Tn[t]=()=>(tc[t]===void 0&&(tc[t]=md[t]()),tc[t]);const J6=.015,X6=(t,e)=>{let r="";const n=Math.round(e/J6);for(let i=0;i<n;i++)r+=t(Ga(0,n-1,i))+", ";return r.substring(0,r.length-2)},wd=(t,e)=>Gr(t)?Tn.linearEasing()?`linear(${X6(t,e)})`:Zt.easing:od(t)?Q6(t):t,Q6=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function e4(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const t4=t=>Array.isArray(t)?t:[t];function Ls(t){return Ns[t]&&(t=Ns[t]),pd(t)?Xa(t):t}const Us={get:(t,e)=>{e=Ls(e);let r=Qa(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=Pn.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=Ls(e),Qa(e)?t.style.setProperty(e,r):t.style[e]=r}};function yd(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function bd(t,e){var r;let n=e?.toDefaultUnit||ar;const i=t[t.length-1];if(ad(i)){const s=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";s&&(n=o=>o+s)}return n}function r4(){return window.__MOTION_DEV_TOOLS_RECORD}function n4(t,e,r,n={},i){const s=r4(),o=n.record!==!1&&s;let a,{duration:c=Zt.duration,delay:l=Zt.delay,endDelay:p=Zt.endDelay,repeat:m=Zt.repeat,easing:w=Zt.easing,persist:y=!1,direction:E,offset:T,allowWebkitAcceleration:R=!1}=n;const L=dd(t),C=pd(e);let O=Tn.waapi();C&&K6(t,e);const b=Ls(e),S=k6(L.values,b),D=Pn.get(b);return yd(S.animation,!(Za(w)&&S.generator)&&n.record!==!1),()=>{const u=()=>{var B,q;return(q=(B=Us.get(t,b))!==null&&B!==void 0?B:D?.initialValue)!==null&&q!==void 0?q:0};let _=e4(t4(r),u);const H=bd(_,D);if(Za(w)){const B=w.createAnimation(_,e!=="opacity",u,b,S);w=B.easing,_=B.keyframes||_,c=B.duration||c}if(Qa(b)&&(Tn.cssRegisterProperty()?Y6(b):O=!1),C&&!Tn.linearEasing()&&(Gr(w)||$n(w)&&w.some(Gr))&&(O=!1),O){D&&(_=_.map(X=>Si(X)?D.toDefaultUnit(X):X)),_.length===1&&(!Tn.partialKeyframes()||o)&&_.unshift(u());const B={delay:An.ms(l),duration:An.ms(c),endDelay:An.ms(p),easing:$n(w)?void 0:wd(w,c),direction:E,iterations:m+1,fill:"both"};a=t.animate({[b]:_,offset:T,easing:$n(w)?w.map(X=>wd(X,c)):void 0},B),a.finished||(a.finished=new Promise((X,te)=>{a.onfinish=X,a.oncancel=te}));const q=_[_.length-1];a.finished.then(()=>{y||(Us.set(t,b,q),a.cancel())}).catch(id),R||(a.playbackRate=1.000001)}else if(i&&C)_=_.map(B=>typeof B=="string"?parseFloat(B):B),_.length===1&&_.unshift(parseFloat(u())),a=new i(B=>{Us.set(t,b,H?H(B):B)},_,Object.assign(Object.assign({},n),{duration:c,easing:w}));else{const B=_[_.length-1];Us.set(t,b,D&&Si(B)?D.toDefaultUnit(B):B)}return o&&s(t,e,_,{duration:c,delay:l,easing:w,repeat:m,offset:T},"motion-one"),S.setAnimation(a),a}}const i4=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function vd(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const s4=t=>t(),_d=(t,e,r=Zt.duration)=>new Proxy({animations:t.map(s4).filter(Boolean),duration:r,options:e},a4),o4=t=>t.animations[0],a4={get:(t,e)=>{const r=o4(t);switch(e){case"duration":return t.duration;case"currentTime":return An.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(c4)).catch(id)),t.finished;case"stop":return()=>{t.animations.forEach(n=>yd(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=An.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},c4=t=>t.finished;function l4(t,e,r){return Gr(t)?t(e,r):t}function h4(t){return function(r,n,i={}){r=vd(r);const s=r.length;Ya(Boolean(s),"No valid element provided."),Ya(Boolean(n),"No keyframes defined.");const o=[];for(let a=0;a<s;a++){const c=r[a];for(const l in n){const p=i4(i,l);p.delay=l4(p.delay,a,s);const m=n4(c,l,n[l],p,t);o.push(m)}}return _d(o,i,i.duration)}}const u4=h4(ud);function d4(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}const f4=5;function Ed(t,e,r){const n=Math.max(e-f4,0);return N6(r-t(n),e-n)}const Rn={stiffness:100,damping:10,mass:1},p4=(t=Rn.stiffness,e=Rn.damping,r=Rn.mass)=>e/(2*Math.sqrt(t*r));function g4(t,e,r){return t<e&&r>=e||t>e&&r<=e}const m4=({stiffness:t=Rn.stiffness,damping:e=Rn.damping,mass:r=Rn.mass,from:n=0,to:i=1,velocity:s=0,restSpeed:o=2,restDistance:a=.5}={})=>{s=s?An.s(s):0;const c={done:!1,hasReachedTarget:!1,current:n,target:i},l=i-n,p=Math.sqrt(t/r)/1e3,m=p4(t,e,r);let w;if(m<1){const y=p*Math.sqrt(1-m*m);w=E=>i-Math.exp(-m*p*E)*((-s+m*p*l)/y*Math.sin(y*E)+l*Math.cos(y*E))}else w=y=>i-Math.exp(-p*y)*(l+(-s+p*l)*y);return y=>{c.current=w(y);const E=y===0?s:Ed(w,y,c.current),T=Math.abs(E)<=o,R=Math.abs(i-c.current)<=a;return c.done=T&&R,c.hasReachedTarget=g4(n,i,c.current),c}},rc=10,w4=1e4;function y4(t,e=ar){let r,n=rc,i=t(0);const s=[e(i.current)];for(;!i.done&&n<w4;)i=t(n),s.push(e(i.done?i.target:i.current)),r===void 0&&i.hasReachedTarget&&(r=n),n+=rc;const o=n-rc;return s.length===1&&s.push(i.current),{keyframes:s,duration:o/1e3,overshootDuration:(r??o)/1e3}}function xd(t){return Si(t)&&!isNaN(t)}function nc(t){return ad(t)?parseFloat(t):t}function b4(t){const e=new WeakMap;return(r={})=>{const n=new Map,i=(o=0,a=100,c=0,l=!1)=>{const p=`${o}-${a}-${c}-${l}`;return n.has(p)||n.set(p,t(Object.assign({from:o,to:a,velocity:c,restSpeed:l?.05:2,restDistance:l?.01:.5},r))),n.get(p)},s=(o,a)=>(e.has(o)||e.set(o,y4(o,a)),e.get(o));return{createAnimation:(o,a=!0,c,l,p)=>{let m,w,y,E=0,T=ar;const R=o.length;if(a){T=bd(o,l?Pn.get(Ls(l)):void 0);const L=o[R-1];if(y=nc(L),R>1&&o[0]!==null)w=nc(o[0]);else{const C=p?.generator;if(C){const{animation:O,generatorStartTime:b}=p,S=O?.startTime||b||0,D=O?.currentTime||performance.now()-S,u=C(D).current;w=u,E=Ed(_=>C(_).current,D,u)}else c&&(w=nc(c()))}}if(xd(w)&&xd(y)){const L=i(w,y,E,l?.includes("scale"));m=Object.assign(Object.assign({},s(L,T)),{easing:"linear"}),p&&(p.generator=L,p.generatorStartTime=performance.now())}return m||(m={easing:"ease",duration:s(i(0,100)).overshootDuration}),m}}}}const js=b4(m4),v4={any:0,all:1};function _4(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const s=vd(t),o=new WeakMap,a=l=>{l.forEach(p=>{const m=o.get(p.target);if(p.isIntersecting!==Boolean(m))if(p.isIntersecting){const w=e(p);Gr(w)?o.set(p.target,w):c.unobserve(p.target)}else m&&(m(p),o.delete(p.target))})},c=new IntersectionObserver(a,{root:r,rootMargin:n,threshold:typeof i=="number"?i:v4[i]});return s.forEach(l=>c.observe(l)),()=>c.disconnect()}function ic(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function Cd(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const E4={isActive:t=>Boolean(t.inView),subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,s=d4(n,["once"]);return _4(t,o=>{if(e(),Cd(t,"viewenter",o),!i)return a=>{r(),Cd(t,"viewleave",a)}},s)}},Id=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),ic(t,e,n))};[...Object.keys({inView:E4,hover:{isActive:t=>Boolean(t.hover),subscribe:(t,{enable:e,disable:r})=>{const n=Id(t,"hoverstart",e),i=Id(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>Boolean(t.press),subscribe:(t,{enable:e,disable:r})=>{const n=s=>{r(),ic(t,"pressend",s),window.removeEventListener("pointerup",n)},i=s=>{e(),ic(t,"pressstart",s),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function x4(t,e={}){return _d([()=>{const r=new ud(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function Cr(t,e,r){return(Gr(t)?x4:u4)(t,e,r)}/**
|
|
122
122
|
* @license
|
|
123
123
|
* Copyright 2018 Google LLC
|
|
124
124
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
125
|
-
*/const Bt=t=>t??ht;var
|
|
126
|
-
]))+`;
|
|
127
|
-
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var
|
|
128
|
-
Suggested mode is: `+e.toString(b));switch(
|
|
125
|
+
*/const Bt=t=>t??ht;var Oi={},C4=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Sd={},zt={};let sc;const I4=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];zt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},zt.getSymbolTotalCodewords=function(e){return I4[e]},zt.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},zt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');sc=e},zt.isKanjiModeEnabled=function(){return typeof sc<"u"},zt.toSJIS=function(e){return sc(e)};var Fs={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(Fs);function Dd(){this.buffer=[],this.length=0}Dd.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const 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 S4=Dd;function $i(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}$i.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},$i.prototype.get=function(t,e){return this.data[t*this.size+e]},$i.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},$i.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var D4=$i,Od={};(function(t){const e=zt.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,s=e(n),o=s===145?26:Math.ceil((s-13)/(2*i-2))*2,a=[s-7];for(let c=1;c<i-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},t.getPositions=function(n){const i=[],s=t.getRowColCoords(n),o=s.length;for(let a=0;a<o;a++)for(let c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||i.push([s[a],s[c]]);return i}})(Od);var $d={};const O4=zt.getSymbolSize,Ad=7;$d.getPositions=function(e){const r=O4(e);return[[0,0],[r-Ad,0],[0,r-Ad]]};var Pd={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const s=i.size;let o=0,a=0,c=0,l=null,p=null;for(let m=0;m<s;m++){a=c=0,l=p=null;for(let w=0;w<s;w++){let y=i.get(m,w);y===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=y,a=1),y=i.get(w,m),y===p?c++:(c>=5&&(o+=e.N1+(c-5)),p=y,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},t.getPenaltyN2=function(i){const s=i.size;let o=0;for(let a=0;a<s-1;a++)for(let c=0;c<s-1;c++){const l=i.get(a,c)+i.get(a,c+1)+i.get(a+1,c)+i.get(a+1,c+1);(l===4||l===0)&&o++}return o*e.N2},t.getPenaltyN3=function(i){const s=i.size;let o=0,a=0,c=0;for(let l=0;l<s;l++){a=c=0;for(let p=0;p<s;p++)a=a<<1&2047|i.get(l,p),p>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|i.get(p,l),p>=10&&(c===1488||c===93)&&o++}return o*e.N3},t.getPenaltyN4=function(i){let s=0;const o=i.data.length;for(let c=0;c<o;c++)s+=i.data[c];return Math.abs(Math.ceil(s*100/o/5)-10)*e.N4};function r(n,i,s){switch(n){case t.Patterns.PATTERN000:return(i+s)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(i+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return i*s%2+i*s%3===0;case t.Patterns.PATTERN110:return(i*s%2+i*s%3)%2===0;case t.Patterns.PATTERN111:return(i*s%3+(i+s)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,s){const o=s.size;for(let a=0;a<o;a++)for(let c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,r(i,c,a))},t.getBestMask=function(i,s){const o=Object.keys(t.Patterns).length;let a=0,c=1/0;for(let l=0;l<o;l++){s(l),t.applyMask(l,i);const p=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(l,i),p<c&&(c=p,a=l)}return a}})(Pd);var Bs={};const Ir=Fs,ks=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Hs=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Bs.getBlocksCount=function(e,r){switch(r){case Ir.L:return ks[(e-1)*4+0];case Ir.M:return ks[(e-1)*4+1];case Ir.Q:return ks[(e-1)*4+2];case Ir.H:return ks[(e-1)*4+3];default:return}},Bs.getTotalCodewordsCount=function(e,r){switch(r){case Ir.L:return Hs[(e-1)*4+0];case Ir.M:return Hs[(e-1)*4+1];case Ir.Q:return Hs[(e-1)*4+2];case Ir.H:return Hs[(e-1)*4+3];default:return}};var Td={},zs={};const Ai=new Uint8Array(512),Ws=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)Ai[r]=e,Ws[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)Ai[r]=Ai[r-255]})(),zs.log=function(e){if(e<1)throw new Error("log("+e+")");return Ws[e]},zs.exp=function(e){return Ai[e]},zs.mul=function(e,r){return e===0||r===0?0:Ai[Ws[e]+Ws[r]]},function(t){const e=zs;t.mul=function(n,i){const s=new Uint8Array(n.length+i.length-1);for(let o=0;o<n.length;o++)for(let a=0;a<i.length;a++)s[o+a]^=e.mul(n[o],i[a]);return s},t.mod=function(n,i){let s=new Uint8Array(n);for(;s.length-i.length>=0;){const o=s[0];for(let c=0;c<i.length;c++)s[c]^=e.mul(i[c],o);let a=0;for(;a<s.length&&s[a]===0;)a++;s=s.slice(a)}return s},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let s=0;s<n;s++)i=t.mul(i,new Uint8Array([1,e.exp(s)]));return i}}(Td);const Rd=Td;function oc(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}oc.prototype.initialize=function(e){this.degree=e,this.genPoly=Rd.generateECPolynomial(this.degree)},oc.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const n=Rd.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const s=new Uint8Array(this.degree);return s.set(n,i),s}return n};var $4=oc,Nd={},Sr={},ac={};ac.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var cr={};const Md="[0-9]+",A4="[A-Z $%*+\\-./:]+";let Pi="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Pi=Pi.replace(/u/g,"\\u");const P4="(?:(?![A-Z0-9 $%*+\\-./:]|"+Pi+`)(?:.|[\r
|
|
126
|
+
]))+`;cr.KANJI=new RegExp(Pi,"g"),cr.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),cr.BYTE=new RegExp(P4,"g"),cr.NUMERIC=new RegExp(Md,"g"),cr.ALPHANUMERIC=new RegExp(A4,"g");const T4=new RegExp("^"+Pi+"$"),R4=new RegExp("^"+Md+"$"),N4=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");cr.testKanji=function(e){return T4.test(e)},cr.testNumeric=function(e){return R4.test(e)},cr.testAlphanumeric=function(e){return N4.test(e)},function(t){const e=ac,r=cr;t.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(s,o){if(t.isValid(s))return s;try{return n(s)}catch{return o}}}(Sr),function(t){const e=zt,r=Bs,n=Fs,i=Sr,s=ac,o=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,a=e.getBCHDigit(o);function c(w,y,E){for(let T=1;T<=40;T++)if(y<=t.getCapacity(T,E,w))return T}function l(w,y){return i.getCharCountIndicator(w,y)+4}function p(w,y){let E=0;return w.forEach(function(T){const R=l(T.mode,y);E+=R+T.getBitsLength()}),E}function m(w,y){for(let E=1;E<=40;E++)if(p(w,E)<=t.getCapacity(E,y,i.MIXED))return E}t.from=function(y,E){return s.isValid(y)?parseInt(y,10):E},t.getCapacity=function(y,E,T){if(!s.isValid(y))throw new Error("Invalid QR Code version");typeof T>"u"&&(T=i.BYTE);const R=e.getSymbolTotalCodewords(y),L=r.getTotalCodewordsCount(y,E),C=(R-L)*8;if(T===i.MIXED)return C;const O=C-l(T,y);switch(T){case i.NUMERIC:return Math.floor(O/10*3);case i.ALPHANUMERIC:return Math.floor(O/11*2);case i.KANJI:return Math.floor(O/13);case i.BYTE:default:return Math.floor(O/8)}},t.getBestVersionForData=function(y,E){let T;const R=n.from(E,n.M);if(Array.isArray(y)){if(y.length>1)return m(y,R);if(y.length===0)return 1;T=y[0]}else T=y;return c(T.mode,T.getLength(),R)},t.getEncodedBits=function(y){if(!s.isValid(y)||y<7)throw new Error("Invalid QR Code version");let E=y<<12;for(;e.getBCHDigit(E)-a>=0;)E^=o<<e.getBCHDigit(E)-a;return y<<12|E}}(Nd);var Ld={};const cc=zt,Ud=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,M4=1<<14|1<<12|1<<10|1<<4|1<<1,jd=cc.getBCHDigit(Ud);Ld.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;cc.getBCHDigit(i)-jd>=0;)i^=Ud<<cc.getBCHDigit(i)-jd;return(n<<10|i)^M4};var Fd={};const L4=Sr;function Nn(t){this.mode=L4.NUMERIC,this.data=t.toString()}Nn.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Nn.prototype.getLength=function(){return this.data.length},Nn.prototype.getBitsLength=function(){return Nn.getBitsLength(this.data.length)},Nn.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const s=this.data.length-r;s>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,s*3+1))};var U4=Nn;const j4=Sr,lc=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Mn(t){this.mode=j4.ALPHANUMERIC,this.data=t}Mn.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Mn.prototype.getLength=function(){return this.data.length},Mn.prototype.getBitsLength=function(){return Mn.getBitsLength(this.data.length)},Mn.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=lc.indexOf(this.data[r])*45;n+=lc.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(lc.indexOf(this.data[r]),6)};var F4=Mn,B4=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var s=e.charCodeAt(i);if(s>=55296&&s<=56319&&n>i+1){var o=e.charCodeAt(i+1);o>=56320&&o<=57343&&(s=(s-55296)*1024+o-56320+65536,i+=1)}if(s<128){r.push(s);continue}if(s<2048){r.push(s>>6|192),r.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);continue}if(s>=65536&&s<=1114111){r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const k4=B4,H4=Sr;function Ln(t){this.mode=H4.BYTE,typeof t=="string"&&(t=k4(t)),this.data=new Uint8Array(t)}Ln.getBitsLength=function(e){return e*8},Ln.prototype.getLength=function(){return this.data.length},Ln.prototype.getBitsLength=function(){return Ln.getBitsLength(this.data.length)},Ln.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var z4=Ln;const W4=Sr,q4=zt;function Un(t){this.mode=W4.KANJI,this.data=t}Un.getBitsLength=function(e){return e*13},Un.prototype.getLength=function(){return this.data.length},Un.prototype.getBitsLength=function(){return Un.getBitsLength(this.data.length)},Un.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=q4.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
127
|
+
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var V4=Un,Bd={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var s={},o={};o[n]=0;var a=e.PriorityQueue.make();a.push(n,0);for(var c,l,p,m,w,y,E,T,R;!a.empty();){c=a.pop(),l=c.value,m=c.cost,w=r[l]||{};for(p in w)w.hasOwnProperty(p)&&(y=w[p],E=m+y,T=o[p],R=typeof o[p]>"u",(R||T>E)&&(o[p]=E,a.push(p,E),s[p]=l))}if(typeof i<"u"&&typeof o[i]>"u"){var L=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(L)}return s},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],s=n;s;)i.push(s),r[s],s=r[s];return i.reverse(),i},find_path:function(r,n,i){var s=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(s,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},s;r=r||{};for(s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Bd),function(t){const e=Sr,r=U4,n=F4,i=z4,s=V4,o=cr,a=zt,c=Bd.exports;function l(L){return unescape(encodeURIComponent(L)).length}function p(L,C,O){const b=[];let S;for(;(S=L.exec(O))!==null;)b.push({data:S[0],index:S.index,mode:C,length:S[0].length});return b}function m(L){const C=p(o.NUMERIC,e.NUMERIC,L),O=p(o.ALPHANUMERIC,e.ALPHANUMERIC,L);let b,S;return a.isKanjiModeEnabled()?(b=p(o.BYTE,e.BYTE,L),S=p(o.KANJI,e.KANJI,L)):(b=p(o.BYTE_KANJI,e.BYTE,L),S=[]),C.concat(O,b,S).sort(function(u,_){return u.index-_.index}).map(function(u){return{data:u.data,mode:u.mode,length:u.length}})}function w(L,C){switch(C){case e.NUMERIC:return r.getBitsLength(L);case e.ALPHANUMERIC:return n.getBitsLength(L);case e.KANJI:return s.getBitsLength(L);case e.BYTE:return i.getBitsLength(L)}}function y(L){return L.reduce(function(C,O){const b=C.length-1>=0?C[C.length-1]:null;return b&&b.mode===O.mode?(C[C.length-1].data+=O.data,C):(C.push(O),C)},[])}function E(L){const C=[];for(let O=0;O<L.length;O++){const b=L[O];switch(b.mode){case e.NUMERIC:C.push([b,{data:b.data,mode:e.ALPHANUMERIC,length:b.length},{data:b.data,mode:e.BYTE,length:b.length}]);break;case e.ALPHANUMERIC:C.push([b,{data:b.data,mode:e.BYTE,length:b.length}]);break;case e.KANJI:C.push([b,{data:b.data,mode:e.BYTE,length:l(b.data)}]);break;case e.BYTE:C.push([{data:b.data,mode:e.BYTE,length:l(b.data)}])}}return C}function T(L,C){const O={},b={start:{}};let S=["start"];for(let D=0;D<L.length;D++){const u=L[D],_=[];for(let H=0;H<u.length;H++){const B=u[H],q=""+D+H;_.push(q),O[q]={node:B,lastCount:0},b[q]={};for(let X=0;X<S.length;X++){const te=S[X];O[te]&&O[te].node.mode===B.mode?(b[te][q]=w(O[te].lastCount+B.length,B.mode)-w(O[te].lastCount,B.mode),O[te].lastCount+=B.length):(O[te]&&(O[te].lastCount=B.length),b[te][q]=w(B.length,B.mode)+4+e.getCharCountIndicator(B.mode,C))}}S=_}for(let D=0;D<S.length;D++)b[S[D]].end=0;return{map:b,table:O}}function R(L,C){let O;const b=e.getBestModeForData(L);if(O=e.from(C,b),O!==e.BYTE&&O.bit<b.bit)throw new Error('"'+L+'" cannot be encoded with mode '+e.toString(O)+`.
|
|
128
|
+
Suggested mode is: `+e.toString(b));switch(O===e.KANJI&&!a.isKanjiModeEnabled()&&(O=e.BYTE),O){case e.NUMERIC:return new r(L);case e.ALPHANUMERIC:return new n(L);case e.KANJI:return new s(L);case e.BYTE:return new i(L)}}t.fromArray=function(C){return C.reduce(function(O,b){return typeof b=="string"?O.push(R(b,null)):b.data&&O.push(R(b.data,b.mode)),O},[])},t.fromString=function(C,O){const b=m(C,a.isKanjiModeEnabled()),S=E(b),D=T(S,O),u=c.find_path(D.map,"start","end"),_=[];for(let H=1;H<u.length-1;H++)_.push(D.table[u[H]].node);return t.fromArray(y(_))},t.rawSplit=function(C){return t.fromArray(m(C,a.isKanjiModeEnabled()))}}(Fd);const qs=zt,hc=Fs,K4=S4,G4=D4,Z4=Od,Y4=$d,uc=Pd,dc=Bs,J4=$4,Vs=Nd,X4=Ld,Q4=Sr,fc=Fd;function e8(t,e){const r=t.size,n=Y4.getPositions(e);for(let i=0;i<n.length;i++){const s=n[i][0],o=n[i][1];for(let a=-1;a<=7;a++)if(!(s+a<=-1||r<=s+a))for(let c=-1;c<=7;c++)o+c<=-1||r<=o+c||(a>=0&&a<=6&&(c===0||c===6)||c>=0&&c<=6&&(a===0||a===6)||a>=2&&a<=4&&c>=2&&c<=4?t.set(s+a,o+c,!0,!0):t.set(s+a,o+c,!1,!0))}}function t8(t){const e=t.size;for(let r=8;r<e-8;r++){const n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function r8(t,e){const r=Z4.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],s=r[n][1];for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++)o===-2||o===2||a===-2||a===2||o===0&&a===0?t.set(i+o,s+a,!0,!0):t.set(i+o,s+a,!1,!0)}}function n8(t,e){const r=t.size,n=Vs.getEncodedBits(e);let i,s,o;for(let a=0;a<18;a++)i=Math.floor(a/3),s=a%3+r-8-3,o=(n>>a&1)===1,t.set(i,s,o,!0),t.set(s,i,o,!0)}function pc(t,e,r){const n=t.size,i=X4.getEncodedBits(e,r);let s,o;for(s=0;s<15;s++)o=(i>>s&1)===1,s<6?t.set(s,8,o,!0):s<8?t.set(s+1,8,o,!0):t.set(n-15+s,8,o,!0),s<8?t.set(8,n-s-1,o,!0):s<9?t.set(8,15-s-1+1,o,!0):t.set(8,15-s-1,o,!0);t.set(n-8,8,1,!0)}function i8(t,e){const r=t.size;let n=-1,i=r-1,s=7,o=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let c=0;c<2;c++)if(!t.isReserved(i,a-c)){let l=!1;o<e.length&&(l=(e[o]>>>s&1)===1),t.set(i,a-c,l),s--,s===-1&&(o++,s=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function s8(t,e,r){const n=new K4;r.forEach(function(c){n.put(c.mode.bit,4),n.put(c.getLength(),Q4.getCharCountIndicator(c.mode,t)),c.write(n)});const i=qs.getSymbolTotalCodewords(t),s=dc.getTotalCodewordsCount(t,e),o=(i-s)*8;for(n.getLengthInBits()+4<=o&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const a=(o-n.getLengthInBits())/8;for(let c=0;c<a;c++)n.put(c%2?17:236,8);return o8(n,t,e)}function o8(t,e,r){const n=qs.getSymbolTotalCodewords(e),i=dc.getTotalCodewordsCount(e,r),s=n-i,o=dc.getBlocksCount(e,r),a=n%o,c=o-a,l=Math.floor(n/o),p=Math.floor(s/o),m=p+1,w=l-p,y=new J4(w);let E=0;const T=new Array(o),R=new Array(o);let L=0;const C=new Uint8Array(t.buffer);for(let u=0;u<o;u++){const _=u<c?p:m;T[u]=C.slice(E,E+_),R[u]=y.encode(T[u]),E+=_,L=Math.max(L,_)}const O=new Uint8Array(n);let b=0,S,D;for(S=0;S<L;S++)for(D=0;D<o;D++)S<T[D].length&&(O[b++]=T[D][S]);for(S=0;S<w;S++)for(D=0;D<o;D++)O[b++]=R[D][S];return O}function a8(t,e,r,n){let i;if(Array.isArray(t))i=fc.fromArray(t);else if(typeof t=="string"){let l=e;if(!l){const p=fc.rawSplit(t);l=Vs.getBestVersionForData(p,r)}i=fc.fromString(t,l||40)}else throw new Error("Invalid data");const s=Vs.getBestVersionForData(i,r);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=s;else if(e<s)throw new Error(`
|
|
129
129
|
The chosen QR Code version cannot contain this amount of data.
|
|
130
130
|
Minimum version required to store current data is: `+s+`.
|
|
131
|
-
`);const o=
|
|
132
|
-
`;return typeof n=="function"&&n(null,w),w};const w4=P6,mc=ld,Dd=Cd,y4=Id;function wc(t,e,r,n,i){const s=[].slice.call(arguments,1),o=s.length,a=typeof s[o-1]=="function";if(!a&&!w4())throw new Error("Callback required as last argument");if(a){if(o<2)throw new Error("Too few arguments provided");o===2?(i=r,r=e,e=n=void 0):o===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(r=e,e=n=void 0):o===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(c,l){try{const p=mc.create(r,n);c(t(p,e,n))}catch(p){l(p)}})}try{const c=mc.create(r,n);i(null,t(c,e,n))}catch(c){i(c)}}Si.create=mc.create,Si.toCanvas=wc.bind(null,Dd.render),Si.toDataURL=wc.bind(null,Dd.renderToDataURL),Si.toString=wc.bind(null,function(t,e,r){return y4.render(t,r)});var b4=Object.defineProperty,Od=Object.getOwnPropertySymbols,v4=Object.prototype.hasOwnProperty,_4=Object.prototype.propertyIsEnumerable,$d=(t,e,r)=>e in t?b4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qs=(t,e)=>{for(var r in e||(e={}))v4.call(e,r)&&$d(t,r,e[r]);if(Od)for(var r of Od(e))_4.call(e,r)&&$d(t,r,e[r]);return t};function E4(){var t;const e=(t=gr.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--w3m-color-fg-1":r.foreground[1],"--w3m-color-fg-2":r.foreground[2],"--w3m-color-fg-3":r.foreground[3],"--w3m-color-bg-1":r.background[1],"--w3m-color-bg-2":r.background[2],"--w3m-color-bg-3":r.background[3],"--w3m-color-overlay":r.overlay}}function x4(){return{"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)"}}function C4(){const{themeVariables:t}=gr.state;return{"--w3m-background-image-url":t!=null&&t["--w3m-background-image-url"]?`url(${t["--w3m-background-image-url"]})`:"none"}}const we={setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=gr.state;if(t){const r=qs(qs(qs(qs({},E4()),x4()),e),C4());Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:be`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent}button::after{content:'';position:absolute;inset:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-accent-fill-color);background:var(--w3m-accent-color)}`},I4=be`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--w3m-color-overlay)}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-accent-color);border-radius:var(--w3m-icon-button-border-radius);margin-bottom:4px}button path{fill:var(--w3m-accent-fill-color)}`;var S4=Object.defineProperty,D4=Object.getOwnPropertyDescriptor,Vs=(t,e,r,n)=>{for(var i=n>1?void 0:n?D4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&S4(e,r,i),i};let jn=class extends ue{constructor(){super(...arguments),this.icon=void 0,this.label="",this.onClick=()=>null}render(){return V`<button @click="${this.onClick}"><div>${this.icon}</div><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};jn.styles=[we.globalCss,I4],Vs([ye()],jn.prototype,"icon",2),Vs([ye()],jn.prototype,"label",2),Vs([ye()],jn.prototype,"onClick",2),jn=Vs([de("w3m-box-button")],jn);const O4=be`button{border-radius:var(--w3m-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--w3m-accent-color)}button path{fill:var(--w3m-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{background-color:var(--w3m-color-bg-3)}`;var $4=Object.defineProperty,A4=Object.getOwnPropertyDescriptor,Ai=(t,e,r,n)=>{for(var i=n>1?void 0:n?A4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&$4(e,r,i),i};let Jr=class extends ue{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null}render(){const t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0};return V`<button class="${Ft(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-regular" color="inverse"><slot></slot></w3m-text>${this.iconRight}</button>`}};Jr.styles=[we.globalCss,O4],Ai([ye()],Jr.prototype,"disabled",2),Ai([ye()],Jr.prototype,"iconLeft",2),Ai([ye()],Jr.prototype,"iconRight",2),Ai([ye()],Jr.prototype,"onClick",2),Jr=Ai([de("w3m-button")],Jr);const P4=be`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--w3m-button-border-radius);color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-accent-color);background-color:transparent}.w3m-secondary::after{display:none}`;var T4=Object.defineProperty,N4=Object.getOwnPropertyDescriptor,yc=(t,e,r,n)=>{for(var i=n>1?void 0:n?N4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&T4(e,r,i),i};let Pi=class extends ue{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return V`<button ?disabled="${this.disabled}" class="${Ft(t)}"><slot></slot></button>`}};Pi.styles=[we.globalCss,P4],yc([ye()],Pi.prototype,"disabled",2),yc([ye()],Pi.prototype,"variant",2),Pi=yc([de("w3m-button-big")],Pi);const ve={CROSS_ICON:Ne`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:Ne`<svg width="178" height="29" viewBox="0 0 178 29" id="w3m-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:Ne`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:Ne`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:Ne`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:Ne`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:Ne`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:Ne`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:Ne`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:Ne`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:Ne`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:Ne`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:Ne`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:Ne`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:Ne`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,HELP_ETH_IMG:Ne`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#j)"><rect width="60" height="60" rx="30" fill="#987DE8"/><path fill-rule="evenodd" clip-rule="evenodd" d="m15.48 28.367 11.966-19.3c1.174-1.892 3.927-1.892 5.1 0l11.97 19.306a6 6 0 0 1 .9 3.142v.028a6 6 0 0 1-1.154 3.56L33.227 50.208c-1.599 2.188-4.864 2.188-6.461 0L15.733 35.095a6 6 0 0 1-1.154-3.538v-.029a6 6 0 0 1 .9-3.161Z" fill="#fff"/><path d="M30.84 10.112a.992.992 0 0 0-.844-.464V24.5l12.598 5.53c.081-.466-.001-.963-.27-1.398L30.84 10.112Z" fill="#643CDD"/><path d="M29.996 9.648a.991.991 0 0 0-.845.465l-11.489 18.53a1.991 1.991 0 0 0-.264 1.387l12.598-5.53V9.648Z" fill="#BDADEB"/><path d="M29.996 50.544a.994.994 0 0 0 .808-.41l11.235-15.38c.307-.434-.193-.988-.658-.72L31.49 39.71a2.998 2.998 0 0 1-1.494.398v10.437Z" fill="#643CDD"/><path d="M17.966 34.762 29.19 50.134c.2.274.503.41.807.41V40.108a2.998 2.998 0 0 1-1.493-.398l-9.884-5.676c-.468-.27-.971.292-.653.728Z" fill="#BDADEB"/><path d="M42.594 30.03 29.996 24.5v13.138a3 3 0 0 0 1.495-.399l10.149-5.83c.525-.31.856-.823.954-1.38Z" fill="#401AB3"/><path d="M29.996 37.638V24.462l-12.598 5.566c.098.564.437 1.083.974 1.392l10.13 5.82c.462.265.978.398 1.494.398Z" fill="#7C5AE2"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="29.5"/><defs><clipPath id="j"><rect width="60" height="60" rx="30" fill="#fff"/></clipPath></defs></svg>`,HELP_PAINTING_IMG:Ne`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#k)"><rect width="60" height="60" rx="3" fill="#C653C6"/><path d="M52.094 47.344c0-4.246-1.436-9.557-5.885-12.4a2.876 2.876 0 0 0-1.615-3.891v-.819a4.037 4.037 0 0 0-1.34-3.007 4.75 4.75 0 0 0-2.41-6.252v-5.506c0-6.248-5.065-11.313-11.313-11.313-6.247 0-11.312 5.065-11.312 11.313v2.152a3.343 3.343 0 0 0-1.18 5.045 4.738 4.738 0 0 0-1.633 3.584 4.73 4.73 0 0 0 .956 2.858 5.218 5.218 0 0 0-2.358 6.815c-3.06 4.129-6.098 8.298-6.098 15.64 0 2.668.364 4.856.731 6.385.184.765.368 1.366.509 1.78a12.721 12.721 0 0 0 .225.611l.015.037.005.011.001.004v.002h.001l.92-.393-.92.394.26.606h38.26l.291-.49-.86-.51.86.51v-.001l.002-.002.002-.005.01-.017.035-.06.127-.225c.108-.195.26-.477.441-.835.363-.714.845-1.732 1.328-2.953.959-2.427 1.945-5.725 1.945-9.068Z" fill="#E87DE8" stroke="#fff" stroke-width="2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M26.5 29.5c-3-.5-5.5-3-5.503-7l.002-7c0-.466 0-.698.026-.893a3 3 0 0 1 2.582-2.582c.195-.026.428-.026.893-.026 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.398 0 2.097 0 2.648.229a3 3 0 0 1 1.624 1.623c.228.552.228 1.25.228 2.649v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.495 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z" fill="#fff"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="2.5"/><defs><clipPath id="k"><rect width="60" height="60" rx="3" fill="#fff"/></clipPath></defs></svg>`,HELP_CHART_IMG:Ne`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#l)"><path d="M0 25.01C0 15.76 0 11.133 1.97 7.678a15 15 0 0 1 5.598-5.597C11.023.11 15.648.11 24.9.11h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.597C60 11.133 60 15.758 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a15 15 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a14.999 14.999 0 0 1-5.597-5.598C0 49.087 0 44.462 0 35.21v-10.2Z" fill="#1DC956"/><path d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z" stroke="#fff" stroke-opacity=".1"/><path d="M16.109 60c-3.833-.179-6.41-.645-8.541-1.86a15 15 0 0 1-5.598-5.598C.553 50.057.155 46.967.043 41.985l4.146-1.382a4 4 0 0 0 2.48-2.39l4.654-12.409a2 2 0 0 1 2.505-1.195l2.526.842a2 2 0 0 0 2.422-1.003l2.968-5.938c.81-1.62 3.185-1.415 3.705.32l3.774 12.581a2 2 0 0 0 3.025 1.09l3.342-2.228c.27-.18.49-.422.646-.706l5.297-9.712a2 2 0 0 1 1.428-1.016l4.134-.689a2 2 0 0 1 1.61.437l3.892 3.243a2 2 0 0 0 2.694-.122l4.633-4.632C60 19.28 60 21.88 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a14.998 14.998 0 0 1-5.598 5.598c-2.131 1.215-4.708 1.681-8.54 1.86H16.108Z" fill="#2BEE6C"/><path d="M.072 43.03a112.37 112.37 0 0 1-.048-2.093l3.85-1.283a3 3 0 0 0 1.86-1.793l4.653-12.408a3 3 0 0 1 3.758-1.793l2.526.842a1 1 0 0 0 1.21-.501l2.97-5.938c1.214-2.43 4.775-2.123 5.556.48l3.774 12.58a1 1 0 0 0 1.513.545l3.341-2.227a1 1 0 0 0 .323-.353l5.298-9.712a3 3 0 0 1 2.14-1.523l4.135-.69a3 3 0 0 1 2.414.655l3.892 3.244a1 1 0 0 0 1.347-.061l5.28-5.28c.046.845.077 1.752.097 2.732l-3.962 3.962a3 3 0 0 1-4.042.183l-3.893-3.243a1 1 0 0 0-.804-.218l-4.135.689a1 1 0 0 0-.714.507l-5.297 9.712c-.233.427-.565.79-.97 1.06l-3.34 2.228a3 3 0 0 1-4.538-1.635l-3.775-12.58c-.26-.868-1.447-.97-1.852-.16l-2.969 5.937a3 3 0 0 1-3.632 1.505l-2.526-.842a1 1 0 0 0-1.252.597L7.606 38.564a5 5 0 0 1-3.1 2.988L.072 43.029Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z" fill="#2BEE6C"/><path d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" fill="#fff"/><path d="M45 .283v59.654c-.63.042-1.294.074-2 .098V.185c.706.025 1.37.056 2 .098Z" fill="#fff"/><path class="help-img-highlight" d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z"/></g><defs><clipPath id="l"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_KEY_IMG:Ne`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#m)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M39.192 29.192c5.077-5.077 5.077-13.308 0-18.385-5.076-5.077-13.308-5.077-18.384 0-5.077 5.077-5.077 13.308 0 18.385l1.287 1.291c1.137 1.142 1.706 1.712 2.097 2.387.267.462.472.957.608 1.473.2.755.2 1.56.2 3.171V48.75c0 1.077 0 1.615.134 2.119a4 4 0 0 0 .407.984c.262.45.643.831 1.404 1.592l.294.295c.654.654.982.981 1.365 1.086.26.07.533.07.792 0 .383-.105.71-.432 1.365-1.086l3.478-3.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.478-.479c-.655-.654-.982-.981-1.087-1.365a1.5 1.5 0 0 1 0-.791c.105-.384.432-.711 1.087-1.365l.478-.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.492-.493c-.65-.65-.974-.974-1.08-1.355a1.5 1.5 0 0 1-.003-.788c.102-.382.425-.71 1.069-1.364l5.46-5.547Z"/><circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="m"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_USER_IMG:Ne`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#n)"><rect width="60" height="60" fill="#00ACE6" rx="30"/><path fill="#1AC6FF" stroke="#fff" stroke-width="2" d="M59 73c0 16.016-12.984 29-29 29S1 89.016 1 73c0-16.017 11-29 29-29s29 12.983 29 29ZM18.69 19.902a11 11 0 0 1 9.281-8.692 14.842 14.842 0 0 1 4.058 0 11 11 0 0 1 9.28 8.692c.178.866.322 1.75.44 2.625.132.977.132 1.968 0 2.945a39.467 39.467 0 0 1-.44 2.625 11 11 0 0 1-9.28 8.692 14.862 14.862 0 0 1-4.058 0 11 11 0 0 1-9.28-8.692 39.467 39.467 0 0 1-.44-2.625 11.004 11.004 0 0 1 0-2.945c.118-.876.262-1.759.44-2.625Z"/><circle cx="24.5" cy="23.5" r="1.5" fill="#fff"/><circle cx="35.5" cy="23.5" r="1.5" fill="#fff"/><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m31 20-3 8h4"/></g><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/><defs><clipPath id="n"><rect width="60" height="60" fill="#fff" rx="30"/></clipPath></defs></svg>`,HELP_LOCK_IMG:Ne`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#C653C6" rx="3"/><path fill="#fff" d="M20.034 15.216C20 15.607 20 16.07 20 17v2.808c0 1.13 0 1.696-.2 2.11a1.78 1.78 0 0 1-.584.714c-.366.28-1.051.42-2.423.7a7.076 7.076 0 0 0-1.597.511 9.001 9.001 0 0 0-4.353 4.353C10 30.005 10 32.336 10 37c0 4.663 0 6.995.843 8.804a9.001 9.001 0 0 0 4.353 4.353C17.005 51 19.336 51 24 51h12c4.663 0 6.995 0 8.804-.843a9.001 9.001 0 0 0 4.353-4.353C50 43.995 50 41.664 50 37c0-4.663 0-6.995-.843-8.804a9.001 9.001 0 0 0-4.353-4.353 7.076 7.076 0 0 0-1.597-.511c-1.372-.28-2.057-.42-2.423-.7a1.78 1.78 0 0 1-.583-.715C40 21.505 40 20.94 40 19.809V17c0-.929 0-1.393-.034-1.784a9 9 0 0 0-8.182-8.182C31.393 7 30.93 7 30 7s-1.393 0-1.784.034a9 9 0 0 0-8.182 8.182Z"/><path fill="#E87DE8" d="M22 17c0-.929 0-1.393.044-1.784a7 7 0 0 1 6.172-6.172C28.606 9 29.071 9 30 9s1.393 0 1.784.044a7 7 0 0 1 6.172 6.172c.044.39.044.855.044 1.784v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.394-.077-1.78a4 4 0 0 0-3.143-3.143C31.394 12 30.93 12 30 12s-1.394 0-1.78.077a4 4 0 0 0-3.143 3.143C25 15.606 25 16.07 25 17v4.5a1.5 1.5 0 0 1-3 0V17Z"/><path fill="#E87DE8" fill-rule="evenodd" d="M12 36.62c0-4.317 0-6.476.92-8.088a7 7 0 0 1 2.612-2.612c1.612-.92 3.77-.92 8.088-.92h6.855c.469 0 .703 0 .906.017 2.73.222 4.364 2.438 4.619 4.983.27-2.698 2.111-5 5.015-5A6.985 6.985 0 0 1 48 31.985v5.395c0 4.317 0 6.476-.92 8.088a7 7 0 0 1-2.612 2.612c-1.612.92-3.77.92-8.088.92h-5.855c-.469 0-.703 0-.906-.017-2.73-.222-4.364-2.438-4.619-4.983-.258 2.583-1.943 4.818-4.714 4.99-.155.01-.335.01-.694.01-.55 0-.825 0-1.057-.015a7 7 0 0 1-6.52-6.52C12 42.233 12 41.958 12 41.408V36.62Zm21.24-.273a4 4 0 1 0-6.478 0c.985 1.36 1.479 2.039 1.564 2.229.178.398.176.818.174 1.247V42.5a1.5 1.5 0 0 0 3 0v-2.677c-.002-.429-.004-.85.174-1.247.085-.19.579-.87 1.565-2.229Z" clip-rule="evenodd"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_COMPAS_IMG:Ne`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#1DC956" rx="30"/><circle cx="30" cy="29.999" r="3" fill="#fff"/><path fill="#2BEE6C" stroke="#fff" stroke-width="2" d="m45.316 17.9-.88-.425.88.424a7.9 7.9 0 0 1 .026-.053c.093-.192.21-.432.26-.687l-.819-.162.819.162a2 2 0 0 0-.239-1.405c-.132-.224-.32-.412-.472-.562a8.415 8.415 0 0 1-.042-.042l-.042-.042c-.15-.151-.338-.34-.562-.472l-.508.862.508-.862a2 2 0 0 0-1.405-.239c-.255.05-.495.167-.687.26l-.053.026-15.05 7.246-.108.052c-1.131.545-1.843.887-2.456 1.374a6.994 6.994 0 0 0-1.13 1.13c-.487.613-.83 1.325-1.375 2.457l-.051.108-7.247 15.05-.025.053c-.094.192-.21.431-.26.686a2 2 0 0 0 .239 1.406l.855-.505-.856.505c.133.224.321.411.473.562l.042.042.041.042c.15.151.338.34.563.472a2 2 0 0 0 1.405.239l-.195-.981.195.98c.255-.05.494-.166.686-.26l.054-.025-.419-.87.419.87 15.05-7.247.107-.051c1.132-.545 1.844-.888 2.457-1.374a7.002 7.002 0 0 0 1.13-1.13c.487-.614.83-1.325 1.374-2.457l.052-.108 7.246-15.05Z"/><path fill="#1DC956" d="m33.376 32.723-2.669-3.43-14.85 14.849.206.205a1 1 0 0 0 1.141.194l15.105-7.273a3 3 0 0 0 1.067-4.545Z"/><path fill="#86F999" d="m26.624 27.276 2.669 3.43 14.85-14.849-.206-.205a1 1 0 0 0-1.141-.194L27.69 22.731a3 3 0 0 0-1.067 4.545Z"/><circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/></svg>`,HELP_NOUN_IMG:Ne`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#794CFF" rx="3"/><path fill="#987DE8" stroke="#fff" stroke-width="2" d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"/><path fill="#fff" d="M37.5 25h10v10h-10z"/><path fill="#4019B2" d="M42.5 25h5v10h-5z"/><path fill="#fff" d="M19.5 25h10v10h-10z"/><path fill="#4019B2" d="M24.5 25h5v10h-5z"/><path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_DAO_IMG:Ne`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#o)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M19 52c5.523 0 10-4.477 10-10s-4.477-10-10-10S9 36.477 9 42s4.477 10 10 10Z"/><path fill="#fff" fill-rule="evenodd" d="M42.844 8.326a1 1 0 0 0-1.687 0L28.978 27.463A1 1 0 0 0 29.822 29h24.357a1 1 0 0 0 .843-1.537L42.844 8.326Z" clip-rule="evenodd"/><path fill="#FF974C" fill-rule="evenodd" d="M42.335 11.646c.324.115.571.504 1.066 1.28l7.332 11.523c.562.883.843 1.325.792 1.69a1 1 0 0 1-.342.623c-.28.238-.803.238-1.85.238H34.667c-1.047 0-1.57 0-1.85-.238a1 1 0 0 1-.342-.623c-.051-.365.23-.806.792-1.69l7.332-11.523c.495-.776.742-1.165 1.066-1.28a1 1 0 0 1 .67 0ZM35 27a7 7 0 0 0 7-7 7 7 0 0 0 7 7H35Z" clip-rule="evenodd"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M10.106 9.357c-.109.32-.107.682-.106.975V25.668c-.001.293-.003.654.106.975a2 2 0 0 0 1.251 1.25c.32.11.682.108.975.107H19c5.523 0 10-4.477 10-10S24.523 8 19 8h-6.668c-.293-.001-.654-.003-.975.106a2 2 0 0 0-1.25 1.251Z"/><circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/><circle cx="19" cy="41.999" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="o"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,SEARCH_ICON:Ne`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,HELP_ICON:Ne`<svg width="11" height="17" viewBox="0 0 11 17"><path fill="#fff" d="M5.22 2.97c-1.07 0-2.25.843-2.25 2.25a.75.75 0 0 1-1.5 0c0-2.393 2.019-3.75 3.75-3.75 1.73 0 3.75 1.357 3.75 3.75 0 1.64-1.038 2.466-1.785 3.057-.802.635-1.215.984-1.215 1.693a.75.75 0 1 1-1.5 0c0-1.466.985-2.24 1.681-2.788l.103-.081C7.007 6.504 7.47 6.08 7.47 5.22c0-1.407-1.181-2.25-2.25-2.25ZM5.22 14.97a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"/></svg>`,WALLET_ICON:Ne`<svg width="15" height="14" fill="none" viewBox="0 0 15 14"><path fill="#fff" fill-rule="evenodd" d="M.64 9.2v-3h.001c.009-1.857.07-2.886.525-3.682a4 4 0 0 1 1.492-1.493C3.58.5 4.813.5 7.28.5h3.735c.58 0 .871 0 1.114.04A3 3 0 0 1 14.6 3.011c.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041h-.777c.178.307.302.648.362 1.011.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041H4.507A3.867 3.867 0 0 1 .64 9.633V9.2ZM7.28 2h3.735c.64 0 .779.005.87.02a1.5 1.5 0 0 1 1.235 1.236c.015.09.02.229.02.869s-.005.779-.02.87a1.5 1.5 0 0 1-1.236 1.235c-.09.015-.229.02-.869.02H4.023c-.697 0-1.345.21-1.883.572V6.25h.001c.004-.791.015-1.383.059-1.867.056-.629.157-.926.269-1.122a2.5 2.5 0 0 1 .932-.933c.197-.111.494-.212 1.123-.268C5.173 2 6.019 2 7.28 2Zm-.265 5.75H4.023c-1.04 0-1.883.843-1.883 1.883A2.367 2.367 0 0 0 4.507 12h2.508c.64 0 .779-.005.87-.02a1.5 1.5 0 0 0 1.235-1.236c.015-.09.02-.229.02-.869s-.005-.779-.02-.87A1.5 1.5 0 0 0 7.884 7.77c-.09-.015-.228-.02-.869-.02Z" clip-rule="evenodd"/></svg>`,NETWORK_PLACEHOLDER:Ne`<svg width="28" height="28" fill="none" viewBox="0 0 28 28"><mask id="p" width="26" height="28" x="1" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#D9D9D9" d="M12 1.172a4 4 0 0 1 4 0l8.124 4.69a4 4 0 0 1 2 3.465v9.381a4 4 0 0 1-2 3.464L16 26.862a4 4 0 0 1-4 0l-8.124-4.69a4 4 0 0 1-2-3.464V9.327a4 4 0 0 1 2-3.464L12 1.173Z"/></mask><g mask="url(#p)"><path id="network-placeholder-fill" fill="#fff" d="M0 0h28v28H0z"/><path id="network-placeholder-dash" stroke="#000" stroke-dasharray="2 2" d="m8.953 2.931 2.032-1.173.25.433 1.015-.586c.269-.155.553-.271.844-.35l-.13-.483a4.003 4.003 0 0 1 2.071 0l-.13.483c.293.079.576.195.845.35l1.016.586.25-.433 2.03 1.173-.25.433 2.032 1.173.25-.433 2.03 1.172-.25.433 1.016.587c.269.155.512.342.725.556l.354-.354a4.003 4.003 0 0 1 1.035 1.794l-.483.129c.078.292.12.596.12.906v1.172h.5v2.346h-.5v2.345h.5v2.345h-.5v1.173c0 .31-.042.614-.12.906l.483.13a4.003 4.003 0 0 1-1.035 1.793l-.354-.354a3.498 3.498 0 0 1-.725.556l-1.015.586.25.434-2.031 1.172-.25-.433-2.031 1.173.25.433-2.031 1.172-.25-.433-1.016.587a3.494 3.494 0 0 1-.844.35l.13.482a4.003 4.003 0 0 1-2.071 0l.13-.483a3.496 3.496 0 0 1-.845-.35l-1.015-.586-.25.433-2.032-1.172.25-.433-2.03-1.173-.25.433L4.89 22.76l.25-.434-1.015-.586a3.498 3.498 0 0 1-.725-.556l-.354.354a4.003 4.003 0 0 1-1.035-1.794l.483-.13a3.497 3.497 0 0 1-.12-.905v-1.173h-.5V15.19h.5v-2.345h-.5v-2.346h.5V9.327c0-.31.042-.614.12-.906l-.483-.13a4.003 4.003 0 0 1 1.035-1.793l.354.354c.213-.214.456-.401.725-.556l1.015-.587-.25-.433 2.031-1.172.25.433 2.031-1.173-.25-.433Z"/><path fill="#798686" stroke="#fff" d="M14.243 13.563 14 13.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.538.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.538-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#9EA9A9" stroke="#fff" d="M14.243 8.563 14 8.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.316.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.316-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#C9CFCF" stroke="#fff" d="m22.344 9.53-.468-.176.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-3.163-1.758-.09-.05c-1.163-.645-1.856-1.03-2.606-1.161a4.5 4.5 0 0 0-1.544 0c-.75.13-1.443.516-2.607 1.162l-.088.05-3.164 1.757-.024.013c-.432.24-.79.44-1.053.622-.266.185-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722Z"/></g></svg>`,WALLET_PLACEHOLDER:Ne`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,TOKEN_PLACEHOLDER:Ne`<svg width="60" height="60" viewBox="0 0 60 60" fill="none"><rect id="token-placeholder-fill" width="58" height="58" x="1" y="1" fill="#fff" rx="29"/><path fill="#3B4040" stroke="#fff" stroke-width="2" d="M32 10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v5.566c0 .357.192.685.495.875a16.001 16.001 0 0 1 4.256 3.894c.667.88.33 2.113-.627 2.665l-2.494 1.44c-.956.552-2.166.204-2.913-.609a9.12 9.12 0 1 0 .064 12.267c.739-.82 1.945-1.181 2.907-.64l2.509 1.415c.962.542 1.312 1.77.654 2.658a16 16 0 0 1-4.356 4.028c-.303.19-.495.518-.495.875V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-2.992c0-.602-.528-1.065-1.13-1.032-.579.032-1.16.032-1.74 0-.602-.032-1.13.43-1.13 1.032V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-5.566c0-.357-.192-.685-.495-.875a16 16 0 0 1 0-27.118c.303-.19.495-.517.495-.875V10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2.992c0 .601.528 1.064 1.13 1.032.58-.032 1.161-.032 1.74 0 .602.033 1.13-.43 1.13-1.032V10Z"/><rect id="token-placeholder-dash" width="58" height="58" x="1" y="1" stroke="#000" stroke-dasharray="6 6" stroke-width="2" rx="29"/></svg>`,ACCOUNT_COPY:Ne`<svg width="14" height="14" fill="none" viewBox="0 0 14 14"><path fill="#fff" fill-rule="evenodd" d="M4.003 4.005c.012-1.225.074-1.936.391-2.491a3 3 0 0 1 1.12-1.12C6.204 0 7.136 0 9 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C14 2.204 14 3.136 14 5s0 2.795-.394 3.486a3 3 0 0 1-1.12 1.12c-.555.317-1.266.379-2.491.391l.002.003c-.012 1.222-.075 1.932-.391 2.486a3 3 0 0 1-1.12 1.12C7.796 14 6.864 14 5 14s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C0 11.796 0 10.864 0 9s0-2.795.394-3.486a3 3 0 0 1 1.12-1.12c.554-.316 1.264-.379 2.486-.391l.003.002ZM9 8.5c-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.045-.08-.113-.243-.154-.693C5.501 6.58 5.5 5.959 5.5 5c0-.959.001-1.58.043-2.05.04-.45.109-.613.154-.693a1.5 1.5 0 0 1 .56-.56c.08-.045.243-.113.693-.154C7.42 1.501 8.041 1.5 9 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.045.08.113.243.154.693.042.47.043 1.091.043 2.05 0 .959-.001 1.58-.043 2.05-.04.45-.109.613-.154.693a1.5 1.5 0 0 1-.56.56c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043ZM4 5.503a13.77 13.77 0 0 0-1.05.04c-.45.04-.613.109-.693.154a1.5 1.5 0 0 0-.56.56c-.045.08-.113.243-.154.693C1.501 7.42 1.5 8.041 1.5 9c0 .959.001 1.58.043 2.05.04.45.109.613.154.693a1.5 1.5 0 0 0 .56.56c.08.045.243.113.693.154.47.042 1.091.043 2.05.043.959 0 1.58-.001 2.05-.043.45-.04.613-.109.693-.154a1.5 1.5 0 0 0 .56-.56c.045-.08.113-.242.154-.693.025-.283.035-.619.04-1.05-1.534-.003-2.358-.037-2.983-.394a3 3 0 0 1-1.12-1.12c-.357-.625-.39-1.449-.394-2.983Z" clip-rule="evenodd"/></svg>`,ACCOUNT_DISCONNECT:Ne`<svg width="16" height="14" fill="none" viewBox="0 0 16 14"><path fill="#fff" d="M9.677 1.5h-2.61c-1.261 0-2.107.001-2.757.06-.629.056-.926.157-1.122.268a2.5 2.5 0 0 0-.933.933c-.112.196-.212.493-.269 1.122-.058.65-.06 1.496-.06 2.757v.72c0 1.26.002 2.107.06 2.756.057.63.157.927.27 1.123a2.5 2.5 0 0 0 .932.933c.196.111.493.212 1.122.268.65.059 1.496.06 2.757.06h2.61a.75.75 0 1 1 0 1.5h-2.61c-2.467 0-3.7 0-4.622-.525a4 4 0 0 1-1.493-1.493C.427 11.06.427 9.827.427 7.36v-.72c0-2.467 0-3.7.525-4.622A4 4 0 0 1 2.445.525C3.366 0 4.6 0 7.067 0h2.61a.75.75 0 1 1 0 1.5Z"/><path fill="#fff" d="M10.896 11.03a.75.75 0 0 1 0-1.06l1.793-1.793a.25.25 0 0 0-.176-.427H8.177a.75.75 0 0 1 0-1.5h4.336a.25.25 0 0 0 .176-.427L10.896 4.03a.75.75 0 0 1 1.061-1.06l3.323 3.323a1 1 0 0 1 0 1.414l-3.323 3.323a.75.75 0 0 1-1.06 0Z"/></svg>`},R4=be`.w3m-custom-placeholder{inset:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--w3m-background-border-radius) * .9)}.w3m-custom-placeholder{background-color:var(--w3m-background-color);background-image:var(--w3m-background-image-url);background-position:center;background-size:cover}.w3m-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-accent-fill-color)}.w3m-action-btn{width:28px;height:28px;border-radius:var(--w3m-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:background-color,.2s ease;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay)}.w3m-action-btn:hover{background-color:var(--w3m-color-bg-2)}.w3m-action-btn svg{display:block;object-position:center}.w3m-action-btn path{fill:var(--w3m-color-fg-1)}.w3m-actions{display:flex}.w3m-actions button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}`;var M4=Object.defineProperty,L4=Object.getOwnPropertyDescriptor,Ad=(t,e,r,n)=>{for(var i=n>1?void 0:n?L4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&M4(e,r,i),i};let Ks=class extends ue{constructor(){super(),this.isHelp=!1,this.unsubscribeRouter=void 0,this.unsubscribeRouter=Ae.subscribe(t=>{this.isHelp=t.view==="Help"})}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this)}onHelp(){Ae.push("Help")}logoTemplate(){var t;const e=(t=gr.state.themeVariables)==null?void 0:t["--w3m-logo-image-url"];return e?V`<img src="${e}">`:ve.WALLET_CONNECT_LOGO}render(){const t={"w3m-actions":!0,"w3m-help-active":this.isHelp};return V`<div class="w3m-custom-placeholder"></div><div class="w3m-toolbar">${this.logoTemplate()}<div class="${Ft(t)}"><button class="w3m-action-btn" @click="${this.onHelp}">${ve.HELP_ICON}</button> <button class="w3m-action-btn" @click="${lt.close}">${ve.CROSS_ICON}</button></div></div>`}};Ks.styles=[we.globalCss,R4],Ad([Fe()],Ks.prototype,"isHelp",2),Ks=Ad([de("w3m-modal-backcard")],Ks);const U4=be`main{padding:20px;padding-top:0;width:100%}`;var j4=Object.defineProperty,F4=Object.getOwnPropertyDescriptor,B4=(t,e,r,n)=>{for(var i=n>1?void 0:n?F4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&j4(e,r,i),i};let bc=class extends ue{render(){return V`<main><slot></slot></main>`}};bc.styles=[we.globalCss,U4],bc=B4([de("w3m-modal-content")],bc);const k4=be`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var H4=Object.defineProperty,z4=Object.getOwnPropertyDescriptor,W4=(t,e,r,n)=>{for(var i=n>1?void 0:n?z4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&H4(e,r,i),i};let vc=class extends ue{render(){return V`<footer><slot></slot></footer>`}};vc.styles=[we.globalCss,k4],vc=W4([de("w3m-modal-footer")],vc);const q4=be`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px;transition:opacity .2s ease}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-accent-color)}`;var V4=Object.defineProperty,K4=Object.getOwnPropertyDescriptor,Ti=(t,e,r,n)=>{for(var i=n>1?void 0:n?K4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&V4(e,r,i),i};let Xr=class extends ue{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return V`<button class="w3m-back-btn" @click="${Ae.goBack}">${ve.BACK_ICON}</button>`}actionBtnTemplate(){return V`<button class="w3m-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"w3m-border":this.border},e=Ae.state.history.length>1,r=this.title?V`<w3m-text variant="big-bold">${this.title}</w3m-text>`:V`<slot></slot>`;return V`<header class="${Ft(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Xr.styles=[we.globalCss,q4],Ti([ye()],Xr.prototype,"title",2),Ti([ye()],Xr.prototype,"onAction",2),Ti([ye()],Xr.prototype,"actionIcon",2),Ti([ye()],Xr.prototype,"border",2),Xr=Ti([de("w3m-modal-header")],Xr);const G4={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00"};var Fn=(t=>(t.metaMask="metaMask",t.trust="trust",t.phantom="phantom",t.brave="brave",t.spotEthWallet="spotEthWallet",t.exodus="exodus",t.tokenPocket="tokenPocket",t.frame="frame",t.tally="tally",t.coinbaseWallet="coinbaseWallet",t.core="core",t.bitkeep="bitkeep",t.mathWallet="mathWallet",t.opera="opera",t.tokenary="tokenary",t["1inch"]="1inch",t.kuCoinWallet="kuCoinWallet",t.ledger="ledger",t))(Fn||{});const Qr={injectedPreset:{metaMask:{name:"MetaMask",icon:"619537c0-2ff3-4c78-9ed8-a05e7567f300",url:"https://metamask.io",isMobile:!0,isInjected:!0},trust:{name:"Trust",icon:"0528ee7e-16d1-4089-21e3-bbfb41933100",url:"https://trustwallet.com",isMobile:!0,isInjected:!0},spotEthWallet:{name:"Spot",icon:"1bf33a89-b049-4a1c-d1f6-4dd7419ee400",url:"https://www.spot-wallet.com",isMobile:!0,isInjected:!0},phantom:{name:"Phantom",icon:"62471a22-33cb-4e65-5b54-c3d9ea24b900",url:"https://phantom.app",isInjected:!0},core:{name:"Core",icon:"35f9c46e-cc57-4aa7-315d-e6ccb2a1d600",url:"https://core.app",isMobile:!0,isInjected:!0},bitkeep:{name:"BitKeep",icon:"3f7075d0-4ab7-4db5-404d-3e4c05e6fe00",url:"https://bitkeep.com",isMobile:!0,isInjected:!0},tokenPocket:{name:"TokenPocket",icon:"f3119826-4ef5-4d31-4789-d4ae5c18e400",url:"https://www.tokenpocket.pro",isMobile:!0,isInjected:!0},mathWallet:{name:"MathWallet",icon:"26a8f588-3231-4411-60ce-5bb6b805a700",url:"https://mathwallet.org",isMobile:!0,isInjected:!0},exodus:{name:"Exodus",icon:"4c16cad4-cac9-4643-6726-c696efaf5200",url:"https://www.exodus.com",isMobile:!0,isDesktop:!0,isInjected:!0},kuCoinWallet:{name:"KuCoin Wallet",icon:"1e47340b-8fd7-4ad6-17e7-b2bd651fae00",url:"https://kuwallet.com",isMobile:!0,isInjected:!0},ledger:{name:"Ledger",icon:"a7f416de-aa03-4c5e-3280-ab49269aef00",url:"https://www.ledger.com",isDesktop:!0},brave:{name:"Brave",icon:"125e828e-9936-4451-a8f2-949c119b7400",url:"https://brave.com/wallet",isInjected:!0},frame:{name:"Frame",icon:"cd492418-ea85-4ef1-aeed-1c9e20b58900",url:"https://frame.sh",isInjected:!0},tally:{name:"Tally",icon:"98d2620c-9fc8-4a1c-31bc-78d59d00a300",url:"https://tallyho.org",isInjected:!0},coinbaseWallet:{name:"Coinbase",icon:"f8068a7f-83d7-4190-1f94-78154a12c600",url:"https://www.coinbase.com/wallet",isInjected:!0},opera:{name:"Opera",icon:"877fa1a4-304d-4d45-ca8e-f76d1a556f00",url:"https://www.opera.com/crypto",isInjected:!0},tokenary:{name:"Tokenary",icon:"5e481041-dc3c-4a81-373a-76bbde91b800",url:"https://tokenary.io",isDesktop:!0,isInjected:!0},["1inch"]:{name:"1inch Wallet",icon:"dce1ee99-403f-44a9-9f94-20de30616500",url:"https://1inch.io/wallet",isMobile:!0}},getInjectedId(t){if(t.toUpperCase()!=="INJECTED"&&t.length)return t;const{ethereum:e,spotEthWallet:r,coinbaseWalletExtension:n}=window;return e?e.isTrust||e.isTrustWallet?"trust":e.isPhantom?"phantom":e.isBraveWallet?"brave":r?"spotEthWallet":e.isExodus?"exodus":e.isTokenPocket?"tokenPocket":e.isFrame?"frame":e.isTally?"tally":n?"coinbaseWallet":e.isAvalanche?"core":e.isBitKeep?"bitkeep":e.isMathWallet?"mathWallet":e.isOpera?"opera":e.isTokenary?"tokenary":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch":e.isKuCoinWallet?"kuCoinWallet":e.isMetaMask?"metaMask":"injected":"metaMask"},getInjectedName(t){var e,r;if(t.length&&t.toUpperCase()!=="INJECTED")return t;const n=Qr.getInjectedId("");return(r=(e=Qr.injectedPreset[n])==null?void 0:e.name)!=null?r:"Injected"}},Z4={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}};var Y4=Object.defineProperty,Pd=Object.getOwnPropertySymbols,J4=Object.prototype.hasOwnProperty,X4=Object.prototype.propertyIsEnumerable,Td=(t,e,r)=>e in t?Y4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Q4=(t,e)=>{for(var r in e||(e={}))J4.call(e,r)&&Td(t,r,e[r]);if(Pd)for(var r of Pd(e))X4.call(e,r)&&Td(t,r,e[r]);return t};const re={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET:"W3M_RECENT_WALLET",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",rejectStandaloneButtonComponent(){const{isStandalone:t}=le.state;if(t)throw new Error("Web3Modal button components are not available in standalone mode.")},getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletId(t){return Qr.getInjectedId(t)},getWalletIcon(t){var e,r;const n=(e=Qr.injectedPreset[t])==null?void 0:e.icon,{projectId:i,walletImages:s}=at.state;return(r=s?.[t])!=null?r:i&&n?ct.getImageUrl(n):""},getWalletName(t,e=!1){const r=Qr.getInjectedName(t);return e?r.split(" ")[0]:r},getChainIcon(t){var e;const r=G4[t],{projectId:n,chainImages:i}=at.state;return(e=i?.[t])!=null?e:n&&r?ct.getImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=Z4[t])==null?void 0:e.icon,{projectId:i,tokenImages:s}=at.state;return(r=s?.[t])!=null?r:i&&n?ct.getImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=re.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.src=t});return Promise.race([e,De.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},async handleMobileLinking(t){De.removeWalletConnectDeepLink();const{standaloneUri:e,selectedChain:r}=le.state,{links:n,name:i}=t;function s(o){let a="";n!=null&&n.universal?a=De.formatUniversalUrl(n.universal,o,i):n!=null&&n.native&&(a=De.formatNativeUrl(n.native,o,i)),De.openHref(a,"_self")}e?(re.setRecentWallet(t),s(e)):(await qe.client().connectWalletConnect(o=>{s(o)},r?.id),re.setRecentWallet(t),lt.close())},async handleAndroidLinking(){De.removeWalletConnectDeepLink();const{standaloneUri:t,selectedChain:e}=le.state;t?De.openHref(t,"_self"):(await qe.client().connectWalletConnect(r=>{De.setWalletConnectAndroidDeepLink(r),De.openHref(r,"_self")},e?.id),lt.close())},async handleUriCopy(){const{standaloneUri:t}=le.state;if(t)await navigator.clipboard.writeText(t);else{const e=qe.client().walletConnectUri;await navigator.clipboard.writeText(e)}Ot.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=le.state;await qe.client().connectConnector(t,r?.id),lt.close()}catch(r){console.error(r),e?e():Ot.openToast(re.getErrorMessage(r),"error")}},getCustomWallets(){var t;const{desktopWallets:e,mobileWallets:r}=at.state;return(t=De.isMobile()?r:e)!=null?t:[]},getCustomImageUrls(){const{chainImages:t,walletImages:e}=at.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},getConnectorImageUrls(){return qe.client().getConnectors().map(({id:t})=>Qr.getInjectedId(t)).map(t=>re.getWalletIcon(t))},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;const r=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),n=[];r?.forEach(s=>{let o=0;for(let c=0;c<s.length;c+=1)o=s.charCodeAt(c)+((o<<5)-o),o=o&o;const a=[0,0,0];for(let c=0;c<3;c+=1){const l=o>>c*8&255;a[c]=l}n.push(`rgb(${a[0]}, ${a[1]}, ${a[2]})`)});const i=document.querySelector(":root");if(i){const s={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(s).forEach(([o,a])=>i.style.setProperty(o,a))}},setRecentWallet(t){const{walletConnectVersion:e}=le.state;localStorage.setItem(re.W3M_RECENT_WALLET,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(re.W3M_RECENT_WALLET);if(t){const{walletConnectVersion:e}=le.state,r=JSON.parse(t);if(r[e])return r[e]}},getExtensionWallets(){const t=[];for(const[e,r]of Object.entries(Qr.injectedPreset))r!=null&&r.isInjected&&!r.isDesktop&&t.push(Q4({id:e},r));return t},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){De.openHref(re.EXPLORER_WALLET_URL,"_blank")}},e8=be`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var t8=Object.defineProperty,r8=Object.getOwnPropertyDescriptor,_c=(t,e,r,n)=>{for(var i=n>1?void 0:n?r8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&t8(e,r,i),i};let Ni=class extends ue{constructor(){super(),this.view=Ae.state.view,this.prevView=Ae.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Ae.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&(Cr(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),Cr(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.03})),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return re.getShadowRootElement(this,".w3m-router")}get contentEl(){return re.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return V`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return V`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnector":return V`<w3m-injected-connector-view></w3m-injected-connector-view>`;case"InstallConnector":return V`<w3m-install-connector-view></w3m-install-connector-view>`;case"GetWallet":return V`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"DesktopConnector":return V`<w3m-desktop-connector-view></w3m-desktop-connector-view>`;case"WalletExplorer":return V`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return V`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return V`<w3m-help-view></w3m-help-view>`;case"Account":return V`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return V`<w3m-switch-network-view></w3m-switch-network-view>`;case"Connectors":return V`<w3m-connectors-view></w3m-connectors-view>`;default:return V`<div>Not Found</div>`}}async onChangeRoute(){await Cr(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15}).finished,this.view=Ae.state.view}render(){return V`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};Ni.styles=[we.globalCss,e8],_c([Fe()],Ni.prototype,"view",2),_c([Fe()],Ni.prototype,"prevView",2),Ni=_c([de("w3m-modal-router")],Ni);const n8=be`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:10px 15px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--w3m-notification-border-radius);border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-accent-color)}.w3m-error path{fill:var(--w3m-error-color)}`;var i8=Object.defineProperty,s8=Object.getOwnPropertyDescriptor,Nd=(t,e,r,n)=>{for(var i=n>1?void 0:n?s8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&i8(e,r,i),i};let Gs=class extends ue{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Ot.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Ot.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Ot.closeToast()}render(){const{message:t,variant:e}=Ot.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?V`<div class="${Ft(r)}">${e==="success"?ve.CHECKMARK_ICON:null} ${e==="error"?ve.CROSS_ICON:null}<w3m-text variant="small-regular">${t}</w3m-text></div>`:null}};Gs.styles=[we.globalCss,n8],Nd([Fe()],Gs.prototype,"open",2),Gs=Nd([de("w3m-modal-toast")],Gs);const o8=be`button{padding:5px;border-radius:var(--w3m-button-hover-highlight-border-radius);transition:all .2s ease;display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:hover{background-color:var(--w3m-color-overlay)}`;var a8=Object.defineProperty,c8=Object.getOwnPropertyDescriptor,Zs=(t,e,r,n)=>{for(var i=n>1?void 0:n?c8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&a8(e,r,i),i};let Bn=class extends ue{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId=""}render(){return V`<button @click="${this.onClick}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular">${this.name}</w3m-text></button>`}};Bn.styles=[we.globalCss,o8],Zs([ye()],Bn.prototype,"onClick",2),Zs([ye()],Bn.prototype,"name",2),Zs([ye()],Bn.prototype,"chainId",2),Bn=Zs([de("w3m-network-button")],Bn);const l8=be`div{width:inherit;height:inherit}.polygon-stroke{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var h8=Object.defineProperty,u8=Object.getOwnPropertyDescriptor,Rd=(t,e,r,n)=>{for(var i=n>1?void 0:n?u8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&h8(e,r,i),i};let Ys=class extends ue{constructor(){super(...arguments),this.chainId=""}render(){const t=re.getChainIcon(this.chainId);return t?V`<div><svg width="54" height="59" viewBox="0 0 54 59" fill="none"><defs><clipPath id="polygon"><path d="M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z"/></clipPath></defs><image clip-path="url(#polygon)" href="${t}" width="58" height="59" x="-2" y="0"/><path class="polygon-stroke" d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z" stroke="#fff"/></svg></div>`:V`${ve.NETWORK_PLACEHOLDER}`}};Ys.styles=[we.globalCss,l8],Rd([ye()],Ys.prototype,"chainId",2),Ys=Rd([de("w3m-network-image")],Ys);const d8=.1,Md=2.5,mr=7;function Ec(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+d8}function f8(t,e){const r=Array.prototype.slice.call(Si.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,s,o)=>(o%n===0?i.push([s]):i[i.length-1].push(s))&&i,[])}const p8={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",s=n==="light"?"#fff":"#141414",o=[],a=f8(t,"Q"),c=e/a.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:T,y:N})=>{const L=(a.length-mr)*c*T,C=(a.length-mr)*c*N,D=.32;for(let b=0;b<l.length;b+=1){const S=c*(mr-b*2);o.push(Ne`<rect fill="${b%2===0?i:s}" height="${S}" rx="${S*D}" ry="${S*D}" width="${S}" x="${L+c*b}" y="${C+c*b}">`)}});const p=Math.floor((r+25)/c),m=a.length/2-p/2,w=a.length/2+p/2-1,y=[];a.forEach((T,N)=>{T.forEach((L,C)=>{if(a[N][C]&&!(N<mr&&C<mr||N>a.length-(mr+1)&&C<mr||N<mr&&C>a.length-(mr+1))&&!(N>m&&N<w&&C>m&&C<w)){const D=N*c+c/2,b=C*c+c/2;y.push([D,b])}})});const E={};return y.forEach(([T,N])=>{E[T]?E[T].push(N):E[T]=[N]}),Object.entries(E).map(([T,N])=>{const L=N.filter(C=>N.every(D=>!Ec(C,D,c)));return[Number(T),L]}).forEach(([T,N])=>{N.forEach(L=>{o.push(Ne`<circle cx="${T}" cy="${L}" fill="${i}" r="${c/Md}">`)})}),Object.entries(E).filter(([T,N])=>N.length>1).map(([T,N])=>{const L=N.filter(C=>N.some(D=>Ec(C,D,c)));return[Number(T),L]}).map(([T,N])=>{N.sort((C,D)=>C<D?-1:1);const L=[];for(const C of N){const D=L.find(b=>b.some(S=>Ec(C,S,c)));D?D.push(C):L.push([C])}return[T,L.map(C=>[C[0],C[C.length-1]])]}).forEach(([T,N])=>{N.forEach(([L,C])=>{o.push(Ne`<line x1="${T}" x2="${T}" y1="${L}" y2="${C}" stroke="${i}" stroke-width="${c/(Md/2)}" stroke-linecap="round">`)})}),o}},g8=be`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:15px}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-accent-color)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var m8=Object.defineProperty,w8=Object.getOwnPropertyDescriptor,Ri=(t,e,r,n)=>{for(var i=n>1?void 0:n?w8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&m8(e,r,i),i};let en=class extends ue{constructor(){super(...arguments),this.uri="",this.size=0,this.logoSrc="",this.walletId=""}svgTemplate(){var t;const e=(t=gr.state.themeMode)!=null?t:"light";return Ne`<svg height="${this.size}" width="${this.size}">${p8.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return V`<div>${this.walletId||this.logoSrc?V`<w3m-wallet-image walletId="${Bt(this.walletId)}" src="${Bt(this.logoSrc)}"></w3m-wallet-image>`:ve.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};en.styles=[we.globalCss,g8],Ri([ye()],en.prototype,"uri",2),Ri([ye({type:Number})],en.prototype,"size",2),Ri([ye()],en.prototype,"logoSrc",2),Ri([ye()],en.prototype,"walletId",2),en=Ri([de("w3m-qrcode")],en);const y8=be`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--w3m-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:transparent;position:absolute;background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}input::placeholder{color:transparent}svg{margin-right:4px}.w3m-placeholder{top:0;left:50%;transform:translateX(-50%);transition:.2s all ease;pointer-events:none;display:flex;align-items:center;justify-content:center;height:100%;width:fit-content;position:relative}input:focus-within+.w3m-placeholder,input:not(:placeholder-shown)+.w3m-placeholder{transform:translateX(10px);left:0}w3m-text{opacity:1;transition:.2s opacity ease}input:focus-within+.w3m-placeholder w3m-text,input:not(:placeholder-shown)+.w3m-placeholder w3m-text{opacity:0}input:focus-within,input:not(:placeholder-shown){color:var(--w3m-color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var b8=Object.defineProperty,v8=Object.getOwnPropertyDescriptor,Ld=(t,e,r,n)=>{for(var i=n>1?void 0:n?v8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&b8(e,r,i),i};let Js=class extends ue{constructor(){super(...arguments),this.onChange=()=>null}render(){const t=De.isMobile()?"Search mobile wallets":"Search desktop wallets";return V`<input type="text" @input="${this.onChange}" placeholder="${t}"><div class="w3m-placeholder">${ve.SEARCH_ICON}<w3m-text color="secondary" variant="small-thin">${t}</w3m-text></div>`}};Js.styles=[we.globalCss,y8],Ld([ye()],Js.prototype,"onChange",2),Js=Ld([de("w3m-search-input")],Js);const _8=be`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-accent-color)}`;var E8=Object.defineProperty,x8=Object.getOwnPropertyDescriptor,C8=(t,e,r,n)=>{for(var i=n>1?void 0:n?x8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&E8(e,r,i),i};let xc=class extends ue{render(){return V`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};xc.styles=[we.globalCss,_8],xc=C8([de("w3m-spinner")],xc);const I8=be`span{font-style:normal;font-family:var(--w3m-font-family);font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xsmall-bold{font-family:var(--w3m-text-xsmall-bold-font-family);font-weight:var(--w3m-text-xsmall-bold-weight);font-size:var(--w3m-text-xsmall-bold-size);line-height:var(--w3m-text-xsmall-bold-line-height);letter-spacing:var(--w3m-text-xsmall-bold-letter-spacing);text-transform:var(--w3m-text-xsmall-bold-text-transform)}.w3m-xsmall-regular{font-family:var(--w3m-text-xsmall-regular-font-family);font-weight:var(--w3m-text-xsmall-regular-weight);font-size:var(--w3m-text-xsmall-regular-size);line-height:var(--w3m-text-xsmall-regular-line-height);letter-spacing:var(--w3m-text-xsmall-regular-letter-spacing);text-transform:var(--w3m-text-xsmall-regular-text-transform)}.w3m-small-thin{font-family:var(--w3m-text-small-thin-font-family);font-weight:var(--w3m-text-small-thin-weight);font-size:var(--w3m-text-small-thin-size);line-height:var(--w3m-text-small-thin-line-height);letter-spacing:var(--w3m-text-small-thin-letter-spacing);text-transform:var(--w3m-text-small-thin-text-transform)}.w3m-small-regular{font-family:var(--w3m-text-small-regular-font-family);font-weight:var(--w3m-text-small-regular-weight);font-size:var(--w3m-text-small-regular-size);line-height:var(--w3m-text-small-regular-line-height);letter-spacing:var(--w3m-text-small-regular-letter-spacing);text-transform:var(--w3m-text-small-regular-text-transform)}.w3m-medium-regular{font-family:var(--w3m-text-medium-regular-font-family);font-weight:var(--w3m-text-medium-regular-weight);font-size:var(--w3m-text-medium-regular-size);line-height:var(--w3m-text-medium-regular-line-height);letter-spacing:var(--w3m-text-medium-regular-letter-spacing);text-transform:var(--w3m-text-medium-regular-text-transform)}.w3m-big-bold{font-family:var(--w3m-text-big-bold-font-family);font-weight:var(--w3m-text-big-bold-weight);font-size:var(--w3m-text-big-bold-size);line-height:var(--w3m-text-big-bold-line-height);letter-spacing:var(--w3m-text-big-bold-letter-spacing);text-transform:var(--w3m-text-big-bold-text-transform)}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-accent-fill-color)}.w3m-color-accnt{color:var(--w3m-accent-color)}.w3m-color-error{color:var(--w3m-error-color)}`;var S8=Object.defineProperty,D8=Object.getOwnPropertyDescriptor,Cc=(t,e,r,n)=>{for(var i=n>1?void 0:n?D8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&S8(e,r,i),i};let Mi=class extends ue{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"w3m-big-bold":this.variant==="big-bold","w3m-medium-regular":this.variant==="medium-regular","w3m-small-regular":this.variant==="small-regular","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-regular":this.variant==="xsmall-regular","w3m-xsmall-bold":this.variant==="xsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return V`<span><slot class="${Ft(t)}"></slot></span>`}};Mi.styles=[we.globalCss,I8],Cc([ye()],Mi.prototype,"variant",2),Cc([ye()],Mi.prototype,"color",2),Mi=Cc([de("w3m-text")],Mi);const O8=be`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;inset:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var $8=Object.defineProperty,A8=Object.getOwnPropertyDescriptor,Ud=(t,e,r,n)=>{for(var i=n>1?void 0:n?A8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&$8(e,r,i),i};let Xs=class extends ue{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=re.getTokenIcon((t=this.symbol)!=null?t:"");return e?V`<div><img src="${e}" alt="${this.id}"></div>`:ve.TOKEN_PLACEHOLDER}};Xs.styles=[we.globalCss,O8],Ud([ye()],Xs.prototype,"symbol",2),Xs=Ud([de("w3m-token-image")],Xs);const P8=be`button{transition:all .2s ease;width:100%;height:100%;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:hover{background-color:var(--w3m-color-overlay)}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--w3m-wallet-icon-border-radius);margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var T8=Object.defineProperty,N8=Object.getOwnPropertyDescriptor,Dr=(t,e,r,n)=>{for(var i=n>1?void 0:n?N8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&T8(e,r,i),i};let hr=class extends ue{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.src=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?V`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?V`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</w3m-text>`:null}render(){var t;return V`<button @click="${this.onClick}"><div><w3m-wallet-image walletId="${this.walletId}" .src="${this.src}"></w3m-wallet-image><w3m-text variant="xsmall-regular">${(t=this.label)!=null?t:re.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};hr.styles=[we.globalCss,P8],Dr([ye()],hr.prototype,"onClick",2),Dr([ye()],hr.prototype,"name",2),Dr([ye()],hr.prototype,"walletId",2),Dr([ye()],hr.prototype,"label",2),Dr([ye()],hr.prototype,"src",2),Dr([ye()],hr.prototype,"installed",2),Dr([ye()],hr.prototype,"recent",2),hr=Dr([de("w3m-wallet-button")],hr);const R8=be`div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;inset:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var M8=Object.defineProperty,L8=Object.getOwnPropertyDescriptor,Ic=(t,e,r,n)=>{for(var i=n>1?void 0:n?L8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&M8(e,r,i),i};let Li=class extends ue{constructor(){super(...arguments),this.walletId=void 0,this.src=void 0}render(){var t;const e=re.getWalletId((t=this.walletId)!=null?t:""),r=this.src?this.src:re.getWalletIcon(e);return V`${r.length?V`<div><img src="${r}" alt="${this.id}"></div>`:ve.WALLET_PLACEHOLDER}`}};Li.styles=[we.globalCss,R8],Ic([ye()],Li.prototype,"walletId",2),Ic([ye()],Li.prototype,"src",2),Li=Ic([de("w3m-wallet-image")],Li);var U8=Object.defineProperty,j8=Object.getOwnPropertyDescriptor,F8=(t,e,r,n)=>{for(var i=n>1?void 0:n?j8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&U8(e,r,i),i};let jd=class extends ue{constructor(){super(),this.unwatchAccount=void 0,He.getAccount(),this.fetchProfile(),this.fetchBalance(),this.unwatchAccount=qe.client().watchAccount(t=>{if(He.state.isConnected&&!t.isConnected)lt.close();else{const{address:e}=He.state;t.address!==e&&(this.fetchProfile(t.address),this.fetchBalance(t.address)),He.setAddress(t.address)}He.setIsConnected(t.isConnected)})}disconnectedCallback(){var t;(t=this.unwatchAccount)==null||t.call(this)}async fetchProfile(t){var e;const r=(e=le.state.chains)==null?void 0:e.find(n=>n.id===1);if(at.state.enableAccountView&&r)try{await He.fetchProfile(re.preloadImage,t)}catch(n){console.error(n),Ot.openToast(re.getErrorMessage(n),"error")}}async fetchBalance(t){if(at.state.enableAccountView)try{await He.fetchBalance(t)}catch(e){console.error(e),Ot.openToast(re.getErrorMessage(e),"error")}}};jd=F8([de("w3m-account-context")],jd);var B8=Object.defineProperty,k8=Object.getOwnPropertyDescriptor,Fd=(t,e,r,n)=>{for(var i=n>1?void 0:n?k8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&B8(e,r,i),i};let Sc=class extends ue{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>re.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){var t;if(at.state.enableExplorer){const{standaloneChains:e,chains:r,walletConnectVersion:n}=le.state,i=e?.join(",");await Promise.all([ct.getPreviewWallets({page:1,entries:10,chains:i,device:De.isMobile()?"mobile":"desktop",version:n}),ct.getRecomendedWallets()]),le.setIsDataLoaded(!0);const{previewWallets:s,recomendedWallets:o}=ct.state,a=(t=r?.map(l=>re.getChainIcon(l.id)))!=null?t:[],c=[...s,...o].map(l=>l.image_url.lg);await this.loadImages([...a,...c])}else le.setIsDataLoaded(!0)}async preloadCustomImages(){const t=re.getCustomImageUrls();await this.loadImages(t)}async preloadConnectorImages(){if(!le.state.isStandalone){const t=re.getConnectorImageUrls();await this.loadImages(t)}}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages(),this.preloadConnectorImages()]))}catch(t){console.error(t),Ot.openToast("Failed preloading","error")}}};Fd([Fe()],Sc.prototype,"preload",2),Sc=Fd([de("w3m-explorer-context")],Sc);var H8=Object.defineProperty,z8=Object.getOwnPropertyDescriptor,Bd=(t,e,r,n)=>{for(var i=n>1?void 0:n?z8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&H8(e,r,i),i};let Dc=class extends ue{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const t=le.getSelectedChain();this.activeChainId=t?.id,this.unwatchNetwork=qe.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(le.setSelectedChain(r),this.activeChainId=r.id,He.resetBalance(),this.fetchBalance())})}disconnectedCallback(){var t;(t=this.unwatchNetwork)==null||t.call(this)}async fetchBalance(){if(at.state.enableAccountView)try{await He.fetchBalance()}catch(t){console.error(t),Ot.openToast(re.getErrorMessage(t),"error")}}};Bd([Fe()],Dc.prototype,"activeChainId",2),Dc=Bd([de("w3m-network-context")],Dc);var W8=Object.defineProperty,q8=Object.getOwnPropertyDescriptor,V8=(t,e,r,n)=>{for(var i=n>1?void 0:n?q8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&W8(e,r,i),i};let kd=class extends ue{constructor(){super(),this.unsubscribeTheme=void 0,we.setTheme(),this.unsubscribeTheme=gr.subscribe(we.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=gr.state,e=[t?.["--w3m-background-image-url"],t?.["--w3m-logo-image-url"]].filter(Boolean);e.length&&await Promise.all(e.map(async r=>re.preloadImage(r)))}catch{console.info("Unsuccessful attempt at preloading some images")}}};kd=V8([de("w3m-theme-context")],kd);const K8=be`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:var(--w3m-button-border-radius);padding:4px 4px 4px 8px}div button{border-radius:var(--w3m-secondary-button-border-radius);padding:4px 8px;padding-left:4px;height:auto;margin-left:10px;color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}.w3m-no-avatar{padding-left:8px}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var G8=Object.defineProperty,Z8=Object.getOwnPropertyDescriptor,Oc=(t,e,r,n)=>{for(var i=n>1?void 0:n?Z8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&G8(e,r,i),i};let kn=class extends ue{constructor(){super(),this.balance="hide",this.avatar="show",re.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=le.state;t||lt.open({route:"Account"})}accountTemplate(){const t=this.avatar==="show";return V`${t?V`<w3m-avatar></w3m-avatar>`:null}<w3m-address-text></w3m-address-text>`}render(){const t=this.balance==="show",e={"w3m-no-avatar":this.avatar==="hide"};return t?V`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}" class="${Ft(e)}">${this.accountTemplate()}</button></div>`:V`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};kn.styles=[we.globalCss,K8],Oc([ye()],kn.prototype,"balance",2),Oc([ye()],kn.prototype,"avatar",2),kn=Oc([de("w3m-account-button")],kn);const Y8=be`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--w3m-color-overlay)}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var J8=Object.defineProperty,X8=Object.getOwnPropertyDescriptor,$c=(t,e,r,n)=>{for(var i=n>1?void 0:n?X8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&J8(e,r,i),i};let Ui=class extends ue{constructor(){super(),this.chainId="",this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=le.state;this.chainId=t?.id.toString(),this.label=t?.name,this.unsubscribeNetwork=le.subscribe(({selectedChain:e})=>{this.chainId=e?.id.toString(),this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){Ae.push("SelectNetwork")}render(){const{chains:t,selectedChain:e}=le.state,r=t?.map(s=>s.id),n=e&&r?.includes(e.id),i=t&&t.length<=1&&n;return V`<button @click="${this.onClick}" ?disabled="${i}"><w3m-network-image chainId="${Bt(this.chainId)}"></w3m-network-image><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};Ui.styles=[we.globalCss,Y8],$c([Fe()],Ui.prototype,"chainId",2),$c([Fe()],Ui.prototype,"label",2),Ui=$c([de("w3m-account-network-button")],Ui);const Q8=be`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var e_=Object.defineProperty,t_=Object.getOwnPropertyDescriptor,ji=(t,e,r,n)=>{for(var i=n>1?void 0:n?t_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&e_(e,r,i),i};let tn=class extends ue{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=He.state.address,this.name=He.state.profileName,this.loading=!!He.state.profileLoading,this.unsubscribeAccount=He.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;const e=this.variant==="button",r={"w3m-loading":this.loading};return V`<w3m-text class="${Ft(r)}" variant="${e?"medium-regular":"big-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:re.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};tn.styles=[we.globalCss,Q8],ji([Fe()],tn.prototype,"address",2),ji([Fe()],tn.prototype,"name",2),ji([Fe()],tn.prototype,"loading",2),ji([ye()],tn.prototype,"variant",2),tn=ji([de("w3m-address-text")],tn);const Rt={allowedExplorerListings(t){const{explorerAllowList:e,explorerDenyList:r}=at.state;let n=[...t];return e&&(n=n.filter(i=>e.includes(i.id))),r&&(n=n.filter(i=>!r.includes(i.id))),n},walletsWithInjected(t){let e=[...t??[]];if(window.ethereum){const r=re.getWalletName("");e=e.filter(({name:n})=>!re.caseSafeIncludes(n,r))}return e},connectorWallets(){const{isStandalone:t}=le.state;if(t)return[];let e=qe.client().getConnectors();return!window.ethereum&&De.isMobile()&&(e=e.filter(({id:r})=>r!=="injected"&&r!==Fn.metaMask)),e},walletTemplatesWithRecent(t,e){let r=[...t];if(e){const n=re.getRecentWallet();r=r.filter(i=>!i.values.includes(n?.name)),r.splice(1,0,e)}return r},deduplicateExplorerListingsFromConnectors(t){const{isStandalone:e}=le.state;if(e)return t;const r=qe.client().getConnectors().map(({name:n})=>n.toUpperCase());return t.filter(({name:n})=>!r.includes(n.toUpperCase()))}},r_=be`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 10),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px}.w3m-slider::after,.w3m-slider::before{content:'';height:100%;width:50px;z-index:2;position:absolute;background:linear-gradient(to right,var(--w3m-color-bg-1) 0,transparent 100%);top:0}.w3m-slider::before{left:0}.w3m-slider::after{right:0;transform:rotateZ(180deg)}.w3m-track{display:flex;width:calc(70px * 20);animation:scroll 20s linear infinite}.w3m-action{padding:30px 0 10px 0;display:flex;justify-content:center;align-items:center;flex-direction:column}.w3m-action w3m-button-big:last-child{margin-top:10px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;box-shadow:0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08);border-radius:15px}w3m-button-big{margin:0 5px}`;var n_=Object.defineProperty,i_=Object.getOwnPropertyDescriptor,s_=(t,e,r,n)=>{for(var i=n>1?void 0:n?i_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&n_(e,r,i),i};let Ac=class extends ue{onGoToQrcode(){Ae.push("Qrcode")}onGoToConnectors(){Ae.push("Connectors")}onGoToGetWallet(){Ae.push("GetWallet")}getConnectors(){let t=Rt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==Fn.metaMask)),t}render(){const{previewWallets:t}=ct.state,e=t.length,r=[...t,...t],n=this.getConnectors().length>0;return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ve.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content>${e?V`<div class="w3m-slider"><div class="w3m-track">${r.map(({image_url:i})=>V`<w3m-wallet-image src="${i.lg}"></w3m-wallet-image>`)}</div></div>`:null}<div class="w3m-action"><div><w3m-button-big @click="${re.handleAndroidLinking}"><w3m-text variant="medium-normal" color="inverse">${n?"WalletConnect":"Select Wallet"}</w3m-text></w3m-button-big>${n?V`<w3m-button-big @click="${this.onGoToConnectors}"><w3m-text variant="medium-normal" color="inverse">Other</w3m-text></w3m-button-big>`:null}</div><w3m-button-big variant="secondary" @click="${this.onGoToGetWallet}"><w3m-text variant="medium-regular" color="accent">I don’t have a wallet</w3m-text></w3m-button-big></div></w3m-modal-content>`}};Ac.styles=[we.globalCss,r_],Ac=s_([de("w3m-android-wallet-selection")],Ac);const o_=be`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var a_=Object.defineProperty,c_=Object.getOwnPropertyDescriptor,Fi=(t,e,r,n)=>{for(var i=n>1?void 0:n?c_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&a_(e,r,i),i};let rn=class extends ue{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=He.state.address,this.avatar=He.state.profileAvatar,this.loading=!!He.state.profileLoading,this.unsubscribeAccount=He.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?V`<img class="${Ft(t)}" src="${this.avatar}">`:this.address?(re.generateAvatarColors(this.address),V`<div class="${Ft(t)}">${this.loading?V`<div class="w3m-loader"></div>`:null}</div>`):null}};rn.styles=[we.globalCss,o_],Fi([Fe()],rn.prototype,"address",2),Fi([Fe()],rn.prototype,"avatar",2),Fi([Fe()],rn.prototype,"loading",2),Fi([ye()],rn.prototype,"size",2),rn=Fi([de("w3m-avatar")],rn);const l_=be`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var h_=Object.defineProperty,u_=Object.getOwnPropertyDescriptor,Pc=(t,e,r,n)=>{for(var i=n>1?void 0:n?u_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&h_(e,r,i),i};let Bi=class extends ue{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=He.state.balance)==null?void 0:t.symbol,this.amount=(e=He.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=He.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"?t=0:typeof this.amount=="string"&&this.amount.length>6?t=parseFloat(this.amount).toFixed(3):typeof this.amount=="string"&&(t=parseFloat(this.amount)),V`<div><w3m-token-image symbol="${Bt(this.symbol)}"></w3m-token-image><w3m-text variant="medium-regular" color="primary">${t} ${this.symbol}</w3m-text></div>`}};Bi.styles=[we.globalCss,l_],Pc([Fe()],Bi.prototype,"symbol",2),Pc([Fe()],Bi.prototype,"amount",2),Bi=Pc([de("w3m-balance")],Bi);const d_=be`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-accent-fill-color)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var f_=Object.defineProperty,p_=Object.getOwnPropertyDescriptor,Qs=(t,e,r,n)=>{for(var i=n>1?void 0:n?p_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&f_(e,r,i),i};let nn=class extends ue{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,re.rejectStandaloneButtonComponent(),this.modalUnsub=lt.subscribe(t=>{t.open&&(this.loading=!0),t.open||(this.loading=!1)})}disconnectedCallback(){var t;(t=this.modalUnsub)==null||t.call(this)}iconTemplate(){return this.icon==="show"?ve.WALLET_CONNECT_ICON:null}onClick(){He.state.isConnected?this.onDisconnect():this.onConnect()}onConnect(){this.loading=!0;const{enableNetworkView:t}=at.state,{chains:e,selectedChain:r}=le.state,n=e?.length&&e.length>1;t||n&&!r?lt.open({route:"SelectNetwork"}):lt.open({route:"ConnectWallet"})}onDisconnect(){qe.client().disconnect(),He.resetAccount()}render(){return V`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${this.loading?V`<w3m-spinner></w3m-spinner><w3m-text variant="medium-regular" color="accent">Connecting...</w3m-text>`:V`${this.iconTemplate()}<w3m-text variant="medium-regular" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};nn.styles=[we.globalCss,d_],Qs([Fe()],nn.prototype,"loading",2),Qs([ye()],nn.prototype,"label",2),Qs([ye()],nn.prototype,"icon",2),nn=Qs([de("w3m-connect-button")],nn);var g_=Object.defineProperty,m_=Object.getOwnPropertyDescriptor,Hn=(t,e,r,n)=>{for(var i=n>1?void 0:n?m_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&g_(e,r,i),i};let Or=class extends ue{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.avatar="show",this.balance="hide",this.unsubscribeAccount=void 0,re.rejectStandaloneButtonComponent(),this.isConnected=He.state.isConnected,this.unsubscribeAccount=He.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=at.state,e=Bt(this.balance),r=Bt(this.label),n=Bt(this.icon),i=Bt(this.avatar);return this.isConnected&&t?V`<w3m-account-button balance="${e}" avatar="${i}"></w3m-account-button>`:V`<w3m-connect-button label="${this.isConnected?"Disconnect":r}" icon="${n}"></w3m-connect-button>`}};Hn([Fe()],Or.prototype,"isConnected",2),Hn([ye()],Or.prototype,"label",2),Hn([ye()],Or.prototype,"icon",2),Hn([ye()],Or.prototype,"avatar",2),Hn([ye()],Or.prototype,"balance",2),Or=Hn([de("w3m-core-button")],Or);const w_=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-accent-color)}`;var y_=Object.defineProperty,b_=Object.getOwnPropertyDescriptor,v_=(t,e,r,n)=>{for(var i=n>1?void 0:n?b_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&y_(e,r,i),i};let Tc=class extends ue{onDesktopWallet(t){Ae.push("DesktopConnector",{DesktopConnector:t})}onInjectedWallet(){Ae.push("InjectedConnector")}onInstallConnector(){Ae.push("InstallConnector",{InstallConnector:{id:"metaMask",name:"MetaMask",isMobile:!0,url:"https://metamask.io"}})}async onConnectorWallet(t){window.ethereum?t==="injected"||t===Fn.metaMask?this.onInjectedWallet():await re.handleConnectorConnection(t):this.onInstallConnector()}desktopWalletsTemplate(){const{desktopWallets:t}=at.state;return t?.map(({id:e,name:r,links:{universal:n,native:i}})=>V`<w3m-wallet-button walletId="${e}" name="${r}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n,native:i})}"></w3m-wallet-button>`)}previewWalletsTemplate(){let t=Rt.allowedExplorerListings(ct.state.previewWallets);return t=Rt.deduplicateExplorerListingsFromConnectors(t),t.map(({name:e,desktop:{universal:r,native:n},homepage:i,image_url:s,id:o})=>V`<w3m-wallet-button src="${s.lg}" name="${e}" .onClick="${()=>this.onDesktopWallet({walletId:o,name:e,native:n,universal:r||i,icon:s.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){return Rt.connectorWallets().map(({id:t,name:e,ready:r})=>V`<w3m-wallet-button .installed="${["injected","metaMask"].includes(t)&&r}" name="${e}" walletId="${t}" .onClick="${async()=>this.onConnectorWallet(t)}"></w3m-wallet-button>`)}recentWalletTemplate(){const t=re.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Bt(e)}" src="${Bt(i)}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n?.universal,native:n?.native,icon:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=le.state,e=this.desktopWalletsTemplate(),r=this.previewWalletsTemplate(),n=this.connectorWalletsTemplate(),i=this.recentWalletTemplate(),s=[...e??[],...r],o=[...n,...s],a=Rt.walletTemplatesWithRecent(o,i),c=Rt.walletTemplatesWithRecent(s,i),l=t?c:a,p=l.length>4;let m=[];p?m=l.slice(0,3):m=l;const w=!!m.length;return V`<w3m-modal-header border="${!0}" title="Connect your wallet" .onAction="${re.handleUriCopy}" .actionIcon="${ve.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${ve.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${ve.SCAN_ICON}<w3m-text variant="small-regular" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${w?V`<w3m-modal-footer><div class="w3m-desktop-title">${ve.DESKTOP_ICON}<w3m-text variant="small-regular" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${m} ${p?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};Tc.styles=[we.globalCss,w_],Tc=v_([de("w3m-desktop-wallet-selection")],Tc);const __=be`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-accent-color);text-decoration:none;transition:opacity .2s ease-in-out}a:hover{opacity:.8}`;var E_=Object.defineProperty,x_=Object.getOwnPropertyDescriptor,C_=(t,e,r,n)=>{for(var i=n>1?void 0:n?x_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&E_(e,r,i),i};let Nc=class extends ue{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=at.state;return t??e?V`<div><w3m-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's<br>${t?V`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?V`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</w3m-text></div>`:null}};Nc.styles=[we.globalCss,__],Nc=C_([de("w3m-legal-notice")],Nc);const I_=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var S_=Object.defineProperty,D_=Object.getOwnPropertyDescriptor,O_=(t,e,r,n)=>{for(var i=n>1?void 0:n?D_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&S_(e,r,i),i};let Rc=class extends ue{onGoToQrcode(){Ae.push("Qrcode")}async onConnectorWallet(t){await re.handleConnectorConnection(t)}mobileWalletsTemplate(){const{mobileWallets:t}=at.state,e=Rt.walletsWithInjected(t);if(e.length)return e.map(({id:r,name:n,links:{universal:i,native:s}})=>V`<w3m-wallet-button name="${n}" walletId="${r}" .onClick="${async()=>re.handleMobileLinking({links:{native:s,universal:i},name:n,id:r})}"></w3m-wallet-button>`)}previewWalletsTemplate(){const{previewWallets:t}=ct.state;let e=Rt.walletsWithInjected(t);return e=Rt.allowedExplorerListings(e),e=Rt.deduplicateExplorerListingsFromConnectors(e),e.map(({image_url:r,name:n,mobile:{native:i,universal:s},id:o})=>V`<w3m-wallet-button name="${n}" src="${r.lg}" .onClick="${async()=>re.handleMobileLinking({links:{native:i,universal:s},name:n,id:o,image:r.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){let t=Rt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==Fn.metaMask)),t.map(({name:e,id:r,ready:n})=>V`<w3m-wallet-button .installed="${["injected","metaMask"].includes(r)&&n}" name="${e}" walletId="${r}" .onClick="${async()=>this.onConnectorWallet(r)}"></w3m-wallet-button>`)}recentWalletTemplate(){const t=re.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Bt(e)}" src="${Bt(i)}" .onClick="${async()=>re.handleMobileLinking({name:r,id:e,links:n,image:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=le.state,e=this.connectorWalletsTemplate(),r=this.mobileWalletsTemplate(),n=this.previewWalletsTemplate(),i=this.recentWalletTemplate(),s=r??n,o=[...e,...s],a=Rt.walletTemplatesWithRecent(o,i),c=Rt.walletTemplatesWithRecent(s,i),l=t?c:a,p=l.length>8;let m=[];p?m=l.slice(0,7):m=l;const w=m.slice(0,4),y=m.slice(4,8),E=!!m.length;return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ve.QRCODE_ICON}"></w3m-modal-header>${E?V`<w3m-modal-content><div class="w3m-grid">${w} ${y.length?V`${y} ${p?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}`:null}</div></w3m-modal-content>`:null}`}};Rc.styles=[we.globalCss,I_],Rc=O_([de("w3m-mobile-wallet-selection")],Rc);const $_=be`:host{all:initial}.w3m-overlay{inset:0;position:fixed;z-index:var(--w3m-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}@media(max-height:720px) and (orientation:landscape){.w3m-overlay{overflow:scroll;align-items:flex-start}}.w3m-open{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) var(--w3m-container-border-radius) var(--w3m-container-border-radius);border:1px solid var(--w3m-color-overlay);overflow:hidden}.w3m-card{width:100%;position:relative;border-radius:var(--w3m-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) 0 0}.w3m-card{border-radius:var(--w3m-container-border-radius) var(--w3m-container-border-radius) 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:440px){.w3m-container{border:0}}`;var A_=Object.defineProperty,P_=Object.getOwnPropertyDescriptor,Hd=(t,e,r,n)=>{for(var i=n>1?void 0:n?P_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&A_(e,r,i),i};let ki=class extends ue{constructor(){super(),this.open=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=lt.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return re.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return re.getShadowRootElement(this,".w3m-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("w3m-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="w3m-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&<.close()}async onOpenModalEvent(){this.toggleBodyScroll(!1);const t=.2;await Cr(this.containerEl,{y:0},{duration:0}).finished,Cr(this.overlayEl,{opacity:[0,1]},{duration:.2,delay:t}),Cr(this.containerEl,re.isMobileAnimation()?{y:["50vh",0]}:{scale:[.98,1]},{scale:{easing:Ls({velocity:.4})},y:{easing:Ls({mass:.5})},delay:t}),this.addKeyboardEvents(),this.open=!0}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents(),await Promise.all([Cr(this.containerEl,re.isMobileAnimation()?{y:[0,"50vh"]}:{scale:[1,.98]},{scale:{easing:Ls({velocity:0})},y:{easing:Ls({mass:.5})}}).finished,Cr(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished]),this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?lt.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}managedModalContextTemplate(){const{isStandalone:t}=le.state;return t?null:V`<w3m-account-context></w3m-account-context><w3m-network-context></w3m-network-context>`}render(){const t={"w3m-overlay":!0,"w3m-open":this.open};return V`<w3m-explorer-context></w3m-explorer-context><w3m-theme-context></w3m-theme-context>${this.managedModalContextTemplate()}<div id="w3m-modal" class="${Ft(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="w3m-container" tabindex="0">${this.open?V`<w3m-modal-backcard></w3m-modal-backcard><div class="w3m-card"><w3m-modal-router></w3m-modal-router><w3m-modal-toast></w3m-modal-toast></div>`:null}</div></div>`}};ki.styles=[we.globalCss,$_],Hd([Fe()],ki.prototype,"open",2),ki=Hd([de("w3m-modal")],ki);const T_=be`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var N_=Object.defineProperty,R_=Object.getOwnPropertyDescriptor,eo=(t,e,r,n)=>{for(var i=n>1?void 0:n?R_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&N_(e,r,i),i};let sn=class extends ue{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,re.rejectStandaloneButtonComponent();const{selectedChain:t}=le.state;this.onSetChainData(t),this.unsubscribeNetwork=le.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=le.state,r=e?.map(n=>n.id);this.chainId=t.id.toString(),this.wrongNetwork=!(r!=null&&r.includes(t.id)),this.label=this.wrongNetwork?"Wrong Network":t.name}}onClick(){lt.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=le.state,r=e&&e.length>1;return V`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${Bt(this.chainId)}"></w3m-network-image><w3m-text variant="medium-regular" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};sn.styles=[we.globalCss,T_],eo([Fe()],sn.prototype,"chainId",2),eo([Fe()],sn.prototype,"label",2),eo([Fe()],sn.prototype,"wrongNetwork",2),sn=eo([de("w3m-network-switch")],sn);const M_=be`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--w3m-button-hover-highlight-border-radius);transition:background-color .2s ease;height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--w3m-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:hover{background-color:var(--w3m-color-overlay)}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--w3m-wallet-icon-border-radius)/ 2);border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var L_=Object.defineProperty,U_=Object.getOwnPropertyDescriptor,j_=(t,e,r,n)=>{for(var i=n>1?void 0:n?U_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&L_(e,r,i),i};let Mc=class extends ue{onClick(){Ae.push("WalletExplorer")}render(){const{previewWallets:t}=ct.state,e=re.getCustomWallets(),r=[...t,...e].reverse().slice(0,4);return V`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{var i;const s=(i=n.image_url)==null?void 0:i.lg;if(s)return V`<img src="${s}">`;const o=re.getWalletId(n.id),a=re.getWalletIcon(o);return a?V`<img src="${a}">`:ve.WALLET_PLACEHOLDER})}</div><w3m-text variant="xsmall-regular">View All</w3m-text></button>`}};Mc.styles=[we.globalCss,M_],Mc=j_([de("w3m-view-all-wallets-button")],Mc);const F_=be`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var B_=Object.defineProperty,k_=Object.getOwnPropertyDescriptor,zd=(t,e,r,n)=>{for(var i=n>1?void 0:n?k_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&B_(e,r,i),i};let to=class extends ue{constructor(){super(),this.uri="",this.createConnectionAndWait()}get overlayEl(){return re.getShadowRootElement(this,".w3m-qr-container")}async createConnectionAndWait(t=0){var e;De.removeWalletConnectDeepLink();try{const{standaloneUri:r}=le.state;r?setTimeout(()=>this.uri=r,0):(await qe.client().connectWalletConnect(n=>this.uri=n,(e=le.state.selectedChain)==null?void 0:e.id),lt.close())}catch(r){console.error(r),Ot.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}render(){return V`<div class="w3m-qr-container">${this.uri?V`<w3m-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}"></w3m-qrcode>`:V`<w3m-spinner></w3m-spinner>`}</div>`}};to.styles=[we.globalCss,F_],zd([Fe()],to.prototype,"uri",2),to=zd([de("w3m-walletconnect-qr")],to);const H_=be`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-success-color);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-success-color),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var z_=Object.defineProperty,W_=Object.getOwnPropertyDescriptor,q_=(t,e,r,n)=>{for(var i=n>1?void 0:n?W_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&z_(e,r,i),i};let Lc=class extends ue{onDisconnect(){lt.close(),qe.client().disconnect(),He.resetAccount()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=He.state.address)!=null?t:""),Ot.openToast("Address copied","success")}render(){return V`<w3m-modal-content><div class="w3m-profile"><div class="w3m-info"><w3m-avatar size="medium"></w3m-avatar><w3m-address-text variant="modal"></w3m-address-text></div><div class="w3m-connection-badge"><w3m-text variant="small-regular" color="secondary">Connected</w3m-text></div></div></w3m-modal-content><div class="w3m-balance"><w3m-balance></w3m-balance></div><w3m-modal-footer><div class="w3m-footer"><w3m-account-network-button></w3m-account-network-button><w3m-box-button label="Copy Address" .onClick="${this.onCopyAddress}" .icon="${ve.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${ve.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};Lc.styles=[we.globalCss,H_],Lc=q_([de("w3m-account-view")],Lc);var V_=Object.defineProperty,K_=Object.getOwnPropertyDescriptor,G_=(t,e,r,n)=>{for(var i=n>1?void 0:n?K_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&V_(e,r,i),i};let Uc=class extends ue{viewTemplate(){return De.isAndroid()?V`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:De.isMobile()?V`<w3m-mobile-wallet-selection></w3m-mobile-wallet-selection>`:V`<w3m-desktop-wallet-selection></w3m-desktop-wallet-selection>`}render(){return V`${this.viewTemplate()}<w3m-legal-notice></w3m-legal-notice>`}};Uc.styles=[we.globalCss],Uc=G_([de("w3m-connect-wallet-view")],Uc);const Z_=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}`;var Y_=Object.defineProperty,J_=Object.getOwnPropertyDescriptor,X_=(t,e,r,n)=>{for(var i=n>1?void 0:n?J_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Y_(e,r,i),i};let jc=class extends ue{async onConnectorWallet(t){await re.handleConnectorConnection(t)}connectorWalletsTemplate(){let t=Rt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==Fn.metaMask)),t.map(({name:e,id:r,ready:n})=>V`<w3m-wallet-button .installed="${["injected","metaMask"].includes(r)&&n}" name="${e}" walletId="${r}" .onClick="${async()=>this.onConnectorWallet(r)}"></w3m-wallet-button>`)}render(){const t=this.connectorWalletsTemplate();return V`<w3m-modal-header title="Other wallets"></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${t}</div></w3m-modal-content>`}};jc.styles=[we.globalCss,Z_],jc=X_([de("w3m-connectors-view")],jc);const Q_=be`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-border-radius);width:25%;aspect-ratio:1/1;margin-bottom:20px}.w3m-install-actions{display:flex}.w3m-install-actions w3m-button{margin:0 5px;opacity:1}`;var e7=Object.defineProperty,t7=Object.getOwnPropertyDescriptor,Wd=(t,e,r,n)=>{for(var i=n>1?void 0:n?t7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&e7(e,r,i),i};let ro=class extends ue{constructor(){super(),this.uri="",this.createConnectionAndWait()}getRouterData(){var t;const e=(t=Ae.state.data)==null?void 0:t.DesktopConnector;if(!e)throw new Error("Missing router data");return e}onFormatAndRedirect(t){const{native:e,universal:r,name:n}=this.getRouterData();if(e){const i=De.formatNativeUrl(e,t,n);De.openHref(i,"_self")}else if(r){const i=De.formatUniversalUrl(r,t,n);De.openHref(i,"_blank")}}async createConnectionAndWait(t=0){var e;De.removeWalletConnectDeepLink();const{standaloneUri:r}=le.state,{name:n,walletId:i,native:s,universal:o,icon:a}=this.getRouterData(),c={name:n,id:i,links:{native:s,universal:o},image:a};if(r)re.setRecentWallet(c),this.onFormatAndRedirect(r);else try{await qe.client().connectWalletConnect(l=>{this.uri=l,this.onFormatAndRedirect(l)},(e=le.state.selectedChain)==null?void 0:e.id),re.setRecentWallet(c),lt.close()}catch{Ot.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}onConnectWithMobile(){Ae.push("Qrcode")}onGoToWallet(){const{universal:t,name:e}=this.getRouterData();if(t){const r=De.formatUniversalUrl(t,this.uri,e);De.openHref(r,"_blank")}}render(){const{name:t,icon:e,universal:r,walletId:n}=this.getRouterData(),i=re.getWalletName(t);return V`<w3m-modal-header title="${i}"></w3m-modal-header><w3m-modal-content><div class="w3m-wrapper">${e?V`<w3m-wallet-image src="${e}" size="lg"></w3m-wallet-image>`:V`<w3m-wallet-image size="lg" walletid="${Bt(n)}"></w3m-wallet-image>`}<div class="w3m-connecting-title"><w3m-spinner></w3m-spinner><w3m-text variant="big-bold" color="secondary">${`Continue in ${i}...`}</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${async()=>this.createConnectionAndWait()}" .iconRight="${ve.RETRY_ICON}">Retry</w3m-button>${r?V`<w3m-button .onClick="${this.onGoToWallet.bind(this)}" .iconLeft="${ve.ARROW_UP_RIGHT_ICON}">Go to Wallet</w3m-button>`:V`<w3m-button .onClick="${this.onConnectWithMobile}" .iconLeft="${ve.MOBILE_ICON}">Connect with Mobile</w3m-button>`}</div></div></w3m-modal-content>`}};ro.styles=[we.globalCss,Q_],Wd([Fe()],ro.prototype,"uri",2),ro=Wd([de("w3m-desktop-connector-view")],ro);const r7=be`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var n7=Object.defineProperty,i7=Object.getOwnPropertyDescriptor,s7=(t,e,r,n)=>{for(var i=n>1?void 0:n?i7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&n7(e,r,i),i};let Fc=class extends ue{onGet(t){De.openHref(t,"_blank")}render(){const{recomendedWallets:t}=ct.state,e=re.getCustomWallets().slice(0,6),r=t.length,n=e.length;return V`<w3m-modal-header title="Get a wallet"></w3m-modal-header><w3m-modal-content>${r?t.map(({name:i,image_url:s,homepage:o})=>V`<div class="w3m-wallet-item"><w3m-wallet-image src="${s.lg}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i}</w3m-text><w3m-button .iconRight="${ve.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(o)}">Get</w3m-button></div></div>`):null} ${n?e.map(({name:i,id:s,links:o})=>V`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${s}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i}</w3m-text><w3m-button .iconRight="${ve.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(o.universal)}">Get</w3m-button></div></div>`):null}</w3m-modal-content><div class="w3m-footer-actions"><w3m-text variant="medium-regular">Not what you're looking for?</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With hundreds of wallets out there, there's something for everyone</w3m-text><w3m-button .onClick="${re.openWalletExplorerUrl}" .iconRight="${ve.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Fc.styles=[we.globalCss,r7],Fc=s7([de("w3m-get-wallet-view")],Fc);const o7=be`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;var a7=Object.defineProperty,c7=Object.getOwnPropertyDescriptor,l7=(t,e,r,n)=>{for(var i=n>1?void 0:n?c7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&a7(e,r,i),i};let Bc=class extends ue{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){at.state.enableExplorer?Ae.push("GetWallet"):re.openWalletExplorerUrl()}onLearnMore(){De.openHref(this.learnUrl,"_blank")}render(){return V`<w3m-modal-header title="What is a wallet?"></w3m-modal-header><w3m-modal-content><div class="w3m-info-container"><div class="w3m-images">${ve.HELP_CHART_IMG} ${ve.HELP_PAINTING_IMG} ${ve.HELP_ETH_IMG}</div><w3m-text variant="medium-regular">A home for your digital assets</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${ve.HELP_KEY_IMG} ${ve.HELP_USER_IMG} ${ve.HELP_LOCK_IMG}</div><w3m-text variant="medium-regular">One login for all of web3</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">Log in to any app by connecting your wallet. Say goodbye to countless passwords!</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${ve.HELP_COMPAS_IMG} ${ve.HELP_NOUN_IMG} ${ve.HELP_DAO_IMG}</div><w3m-text variant="medium-regular">Your gateway to a new web</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.</w3m-text></div><div class="w3m-footer-actions"><w3m-button .onClick="${this.onGet.bind(this)}" .iconLeft="${ve.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${ve.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};Bc.styles=[we.globalCss,o7],Bc=l7([de("w3m-help-view")],Bc);const h7=be`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:20px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-border-radius);width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-injected-error w3m-button{opacity:1}`;var u7=Object.defineProperty,d7=Object.getOwnPropertyDescriptor,kc=(t,e,r,n)=>{for(var i=n>1?void 0:n?d7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&u7(e,r,i),i};let Hi=class extends ue{constructor(){super(),this.connecting=!0,this.error=!1,this.connector=qe.client().getConnectorById("injected"),this.onConnect()}async onConnect(){const{ready:t}=this.connector;t&&(this.error=!1,this.connecting=!0,await re.handleConnectorConnection("injected",()=>{this.error=!0,this.connecting=!1}))}render(){const t=re.getWalletName(this.connector.name),e=re.getWalletId(this.connector.id),r={"w3m-injected-wrapper":!0,"w3m-injected-error":this.error};return V`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><div class="${Ft(r)}"><w3m-wallet-image walletId="${e}" size="lg"></w3m-wallet-image><div class="w3m-connecting-title">${this.connecting?V`<w3m-spinner></w3m-spinner>`:null}<w3m-text variant="big-bold" color="${this.error?"error":"secondary"}">${this.error?"Connection declined":`Continue in ${t}...`}</w3m-text></div><w3m-button .onClick="${this.onConnect.bind(this)}" .disabled="${!this.error}" .iconRight="${ve.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Hi.styles=[we.globalCss,h7],kc([Fe()],Hi.prototype,"connecting",2),kc([Fe()],Hi.prototype,"error",2),Hi=kc([de("w3m-injected-connector-view")],Hi);const f7=be`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}.w3m-install-title{display:flex;align-items:center;justify-content:center;flex-direction:column}.w3m-install-title w3m-text:last-child{margin-top:10px;max-width:240px}.w3m-install-actions{display:flex;margin-top:15px;align-items:center;flex-direction:column}@media(max-width:355px){.w3m-install-actions{flex-direction:column;align-items:center}}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-install-actions w3m-button{margin:5px;opacity:1}.w3m-info-text{text-align:center}`;var p7=Object.defineProperty,g7=Object.getOwnPropertyDescriptor,m7=(t,e,r,n)=>{for(var i=n>1?void 0:n?g7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&p7(e,r,i),i};let Hc=class extends ue{getRouterData(){var t;const e=(t=Ae.state.data)==null?void 0:t.InstallConnector;if(!e)throw new Error("Missing router data");return e}onInstall(){const{url:t}=this.getRouterData();De.openHref(t,"_blank")}onMobile(){const{name:t}=this.getRouterData();Ae.push("ConnectWallet"),Ot.openToast(`Scan the code with ${t}`,"success")}render(){const{name:t,id:e,isMobile:r}=this.getRouterData();return V`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><div class="w3m-injected-wrapper"><w3m-wallet-image walletId="${e}" size="lg"></w3m-wallet-image><div class="w3m-install-title"><w3m-text variant="big-bold">Install ${t}</w3m-text><w3m-text color="secondary" variant="small-thin" class="w3m-info-text">To connect ${t}, install the browser extension.</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${this.onInstall.bind(this)}" .iconLeft="${ve.ARROW_DOWN_ICON}">Install Extension</w3m-button>${r?V`<w3m-button .onClick="${this.onMobile.bind(this)}" .iconLeft="${ve.MOBILE_ICON}">${t} Mobile</w3m-button>`:null}</div></div></w3m-modal-content>`}};Hc.styles=[we.globalCss,f7],Hc=m7([de("w3m-install-connector-view")],Hc);var w7=Object.defineProperty,y7=Object.getOwnPropertyDescriptor,b7=(t,e,r,n)=>{for(var i=n>1?void 0:n?y7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&w7(e,r,i),i};let zc=class extends ue{render(){return V`<w3m-modal-header title="Scan the code" .onAction="${re.handleUriCopy}" .actionIcon="${ve.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};zc.styles=[we.globalCss],zc=b7([de("w3m-qrcode-view")],zc);const v7=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}`;var _7=Object.defineProperty,E7=Object.getOwnPropertyDescriptor,x7=(t,e,r,n)=>{for(var i=n>1?void 0:n?E7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&_7(e,r,i),i};let Wc=class extends ue{async onSelectChain(t){try{const{selectedChain:e,walletConnectVersion:r}=le.state,{isConnected:n}=He.state;n?e?.id===t.id?Ae.replace("Account"):r===2?(await qe.client().switchNetwork({chainId:t.id}),Ae.replace("Account")):Ae.push("SwitchNetwork",{SwitchNetwork:t}):(Ae.push("ConnectWallet"),le.setSelectedChain(t))}catch(e){console.error(e),Ot.openToast(re.getErrorMessage(e),"error")}}render(){const{chains:t}=le.state;return V`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${t?.map(e=>V`<w3m-network-button name="${e.name}" chainId="${e.id}" .onClick="${async()=>this.onSelectChain(e)}">${e.name}</w3m-network-button>`)}</div></w3m-modal-content>`}};Wc.styles=[we.globalCss,v7],Wc=x7([de("w3m-select-network-view")],Wc);const C7=be`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-network-image{width:96px;height:96px;margin-bottom:20px}w3m-button{opacity:0}.w3m-error w3m-button{opacity:1}`;var I7=Object.defineProperty,S7=Object.getOwnPropertyDescriptor,qd=(t,e,r,n)=>{for(var i=n>1?void 0:n?S7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&I7(e,r,i),i};let no=class extends ue{constructor(){super(),this.error=!1,this.onSwitchNetwork()}getRouterData(){var t;const e=(t=Ae.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error("Missing router data");return e}async onSwitchNetwork(){try{this.error=!1;const t=this.getRouterData();await qe.client().switchNetwork({chainId:t.id}),le.setSelectedChain(t),Ae.replace("Account")}catch{this.error=!0}}render(){const{id:t,name:e}=this.getRouterData(),r={"w3m-wrapper":!0,"w3m-error":this.error};return V`<w3m-modal-header title="${`Connect to ${e}`}"></w3m-modal-header><w3m-modal-content><div class="${Ft(r)}"><w3m-network-image chainId="${t}"></w3m-network-image><div class="w3m-connecting-title">${this.error?null:V`<w3m-spinner></w3m-spinner>`}<w3m-text variant="big-bold" color="${this.error?"error":"secondary"}">${this.error?"Connection declined":"Approve in your wallet"}</w3m-text></div><w3m-button .onClick="${this.onSwitchNetwork.bind(this)}" .disabled="${!this.error}" .iconRight="${ve.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};no.styles=[we.globalCss,C7],qd([Fe()],no.prototype,"error",2),no=qd([de("w3m-switch-network-view")],no);const D7=be`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var O7=Object.defineProperty,$7=Object.getOwnPropertyDescriptor,zi=(t,e,r,n)=>{for(var i=n>1?void 0:n?$7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&O7(e,r,i),i};const qc=40;let on=class extends ue{constructor(){super(...arguments),this.loading=!ct.state.wallets.listings.length,this.firstFetch=!ct.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=re.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,ct.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),ct.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return re.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=ct.state,{listings:r,total:n}=this.search?e:t;return n<=qc||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r}=ct.state,n=re.getExtensionWallets(),{listings:i,total:s,page:o}=this.search?r:e;if(!this.endReached&&(this.firstFetch||s>qc&&i.length<s))try{this.loading=!0;const a=(t=le.state.standaloneChains)==null?void 0:t.join(","),{listings:c}=await ct.getPaginatedWallets({page:this.firstFetch?1:o+1,entries:qc,device:De.isMobile()?"mobile":"desktop",search:this.search,version:le.state.walletConnectVersion,chains:a}),l=c.map(({image_url:m})=>m.lg),p=n.map(({id:m})=>re.getWalletIcon(m));await Promise.all([...l.map(async m=>re.preloadImage(m)),...p.map(async m=>re.preloadImage(m)),De.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),Ot.openToast(re.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnectCustom({name:t,id:e,links:r}){De.isMobile()?re.handleMobileLinking({links:r,name:t,id:e}):Ae.push("DesktopConnector",{DesktopConnector:{name:t,walletId:e,universal:r.universal,native:r.native}})}onConnectListing(t){if(De.isMobile()){const{id:e,image_url:r}=t,{native:n,universal:i}=t.mobile;re.handleMobileLinking({links:{native:n,universal:i},name:t.name,id:e,image:r.lg})}else Ae.push("DesktopConnector",{DesktopConnector:{name:t.name,icon:t.image_url.lg,universal:t.desktop.universal||t.homepage,native:t.desktop.native}})}onConnectExtension(t){re.getWalletId("")===t.id?Ae.push("InjectedConnector"):Ae.push("InstallConnector",{InstallConnector:t})}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=ct.state,{isStandalone:r}=le.state;let{listings:n}=this.search?e:t;n=Rt.allowedExplorerListings(n);const i=this.loading&&!n.length,s=this.search.length>=3;let o=!r&&!De.isMobile()?re.getExtensionWallets():[],a=re.getCustomWallets();s&&(o=o.filter(({name:m})=>re.caseSafeIncludes(m,this.search)),a=a.filter(({name:m})=>re.caseSafeIncludes(m,this.search)));const c=!this.loading&&!n.length&&!o.length,l=Math.max(o.length,n.length),p={"w3m-loading":i,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":c};return V`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Ft(p)}"><div class="w3m-grid">${i?null:[...Array(l)].map((m,w)=>V`${a[w]?V`<w3m-wallet-button name="${a[w].name}" walletId="${a[w].id}" .onClick="${()=>this.onConnectCustom(a[w])}"></w3m-wallet-button>`:null} ${o[w]?V`<w3m-wallet-button name="${o[w].name}" walletId="${o[w].id}" .onClick="${()=>this.onConnectExtension(o[w])}"></w3m-wallet-button>`:null} ${n[w]?V`<w3m-wallet-button src="${n[w].image_url.lg}" name="${n[w].name}" walletId="${n[w].id}" .onClick="${()=>this.onConnectListing(n[w])}"></w3m-wallet-button>`:null}`)}</div><div class="w3m-placeholder-block">${c?V`<w3m-text variant="big-bold" color="secondary">No results found</w3m-text>`:null} ${!c&&this.loading?V`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};on.styles=[we.globalCss,D7],zi([Fe()],on.prototype,"loading",2),zi([Fe()],on.prototype,"firstFetch",2),zi([Fe()],on.prototype,"search",2),zi([Fe()],on.prototype,"endReached",2),on=zi([de("w3m-wallet-explorer-view")],on);var A7=Object.freeze({__proto__:null,get W3mAccountButton(){return kn},get W3mConnectButton(){return nn},get W3mCoreButton(){return Or},get W3mModal(){return ki},get W3mNetworkSwitch(){return sn}});Xt.EthereumProvider=Kb,Xt.OPTIONAL_EVENTS=Bb,Xt.OPTIONAL_METHODS=Fb,Xt.REQUIRED_EVENTS=_s,Xt.REQUIRED_METHODS=vs,Xt.default=Es,Object.defineProperty(Xt,"__esModule",{value:!0})});
|
|
131
|
+
`);const o=s8(e,r,i),a=qs.getSymbolSize(e),c=new G4(a);return e8(c,e),t8(c),r8(c,e),pc(c,r,0),e>=7&&n8(c,e),i8(c,o),isNaN(n)&&(n=uc.getBestMask(c,pc.bind(null,c,r))),uc.applyMask(n,c),pc(c,r,n),{modules:c,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}Sd.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=hc.M,i,s;return typeof r<"u"&&(n=hc.from(r.errorCorrectionLevel,hc.M),i=Vs.from(r.version),s=uc.from(r.maskPattern),r.toSJISFunc&&qs.setToSJISFunction(r.toSJISFunc)),a8(e,i,n,s)};var kd={},gc={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(s){return[s,s]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,s=n.width&&n.width>=21?n.width:void 0,o=n.scale||4;return{width:s,scale:s?4:o,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const s=t.getScale(n,i);return Math.floor((n+i.margin*2)*s)},t.qrToImageData=function(n,i,s){const o=i.modules.size,a=i.modules.data,c=t.getScale(o,s),l=Math.floor((o+s.margin*2)*c),p=s.margin*c,m=[s.color.light,s.color.dark];for(let w=0;w<l;w++)for(let y=0;y<l;y++){let E=(w*l+y)*4,T=s.color.light;if(w>=p&&y>=p&&w<l-p&&y<l-p){const R=Math.floor((w-p)/c),L=Math.floor((y-p)/c);T=m[a[R*o+L]?1:0]}n[E++]=T.r,n[E++]=T.g,n[E++]=T.b,n[E]=T.a}}})(gc),function(t){const e=gc;function r(i,s,o){i.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=o,s.width=o,s.style.height=o+"px",s.style.width=o+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,o,a){let c=a,l=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(l=n()),c=e.getOptions(c);const p=e.getImageWidth(s.modules.size,c),m=l.getContext("2d"),w=m.createImageData(p,p);return e.qrToImageData(w.data,s,c),r(m,l,p),m.putImageData(w,0,0),l},t.renderToDataURL=function(s,o,a){let c=a;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const l=t.render(s,o,c),p=c.type||"image/png",m=c.rendererOpts||{};return l.toDataURL(p,m.quality)}}(kd);var Hd={};const c8=gc;function zd(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function mc(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function l8(t,e,r){let n="",i=0,s=!1,o=0;for(let a=0;a<t.length;a++){const c=Math.floor(a%e),l=Math.floor(a/e);!c&&!s&&(s=!0),t[a]?(o++,a>0&&c>0&&t[a-1]||(n+=s?mc("M",c+r,.5+l+r):mc("m",i,0),i=0,s=!1),c+1<e&&t[a+1]||(n+=mc("h",o),o=0)):i++}return n}Hd.render=function(e,r,n){const i=c8.getOptions(r),s=e.modules.size,o=e.modules.data,a=s+i.margin*2,c=i.color.light.a?"<path "+zd(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+zd(i.color.dark,"stroke")+' d="'+l8(o,s,i.margin)+'"/>',p='viewBox="0 0 '+a+" "+a+'"',w='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+p+' shape-rendering="crispEdges">'+c+l+`</svg>
|
|
132
|
+
`;return typeof n=="function"&&n(null,w),w};const h8=C4,wc=Sd,Wd=kd,u8=Hd;function yc(t,e,r,n,i){const s=[].slice.call(arguments,1),o=s.length,a=typeof s[o-1]=="function";if(!a&&!h8())throw new Error("Callback required as last argument");if(a){if(o<2)throw new Error("Too few arguments provided");o===2?(i=r,r=e,e=n=void 0):o===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(r=e,e=n=void 0):o===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(c,l){try{const p=wc.create(r,n);c(t(p,e,n))}catch(p){l(p)}})}try{const c=wc.create(r,n);i(null,t(c,e,n))}catch(c){i(c)}}Oi.create=wc.create,Oi.toCanvas=yc.bind(null,Wd.render),Oi.toDataURL=yc.bind(null,Wd.renderToDataURL),Oi.toString=yc.bind(null,function(t,e,r){return u8.render(t,r)});var d8=Object.defineProperty,qd=Object.getOwnPropertySymbols,f8=Object.prototype.hasOwnProperty,p8=Object.prototype.propertyIsEnumerable,Vd=(t,e,r)=>e in t?d8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ks=(t,e)=>{for(var r in e||(e={}))f8.call(e,r)&&Vd(t,r,e[r]);if(qd)for(var r of qd(e))p8.call(e,r)&&Vd(t,r,e[r]);return t};function g8(){var t;const e=(t=fr.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--w3m-color-fg-1":r.foreground[1],"--w3m-color-fg-2":r.foreground[2],"--w3m-color-fg-3":r.foreground[3],"--w3m-color-bg-1":r.background[1],"--w3m-color-bg-2":r.background[2],"--w3m-color-bg-3":r.background[3],"--w3m-color-overlay":r.overlay}}function m8(){return{"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)"}}function w8(){const{themeVariables:t}=fr.state;return{"--w3m-background-image-url":t!=null&&t["--w3m-background-image-url"]?`url(${t["--w3m-background-image-url"]})`:"none"}}const we={setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=fr.state;if(t){const r=Ks(Ks(Ks(Ks({},g8()),m8()),e),w8());Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:be`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent}button::after{content:'';position:absolute;inset:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-accent-fill-color);background:var(--w3m-accent-color)}`},y8=be`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--w3m-color-overlay)}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-accent-color);border-radius:var(--w3m-icon-button-border-radius);margin-bottom:4px}button path{fill:var(--w3m-accent-fill-color)}`;var b8=Object.defineProperty,v8=Object.getOwnPropertyDescriptor,Gs=(t,e,r,n)=>{for(var i=n>1?void 0:n?v8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&b8(e,r,i),i};let jn=class extends ue{constructor(){super(...arguments),this.icon=void 0,this.label="",this.onClick=()=>null}render(){return V`<button @click="${this.onClick}"><div>${this.icon}</div><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};jn.styles=[we.globalCss,y8],Gs([ye()],jn.prototype,"icon",2),Gs([ye()],jn.prototype,"label",2),Gs([ye()],jn.prototype,"onClick",2),jn=Gs([de("w3m-box-button")],jn);const _8=be`button{border-radius:var(--w3m-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--w3m-accent-color)}button path{fill:var(--w3m-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{background-color:var(--w3m-color-bg-3)}`;var E8=Object.defineProperty,x8=Object.getOwnPropertyDescriptor,Ti=(t,e,r,n)=>{for(var i=n>1?void 0:n?x8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&E8(e,r,i),i};let Zr=class extends ue{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null}render(){const t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0};return V`<button class="${Ft(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-regular" color="inverse"><slot></slot></w3m-text>${this.iconRight}</button>`}};Zr.styles=[we.globalCss,_8],Ti([ye()],Zr.prototype,"disabled",2),Ti([ye()],Zr.prototype,"iconLeft",2),Ti([ye()],Zr.prototype,"iconRight",2),Ti([ye()],Zr.prototype,"onClick",2),Zr=Ti([de("w3m-button")],Zr);const C8=be`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--w3m-button-border-radius);color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-accent-color);background-color:transparent}.w3m-secondary::after{display:none}`;var I8=Object.defineProperty,S8=Object.getOwnPropertyDescriptor,bc=(t,e,r,n)=>{for(var i=n>1?void 0:n?S8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&I8(e,r,i),i};let Ri=class extends ue{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return V`<button ?disabled="${this.disabled}" class="${Ft(t)}"><slot></slot></button>`}};Ri.styles=[we.globalCss,C8],bc([ye()],Ri.prototype,"disabled",2),bc([ye()],Ri.prototype,"variant",2),Ri=bc([de("w3m-button-big")],Ri);const ve={CROSS_ICON:Re`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:Re`<svg width="178" height="29" viewBox="0 0 178 29" id="w3m-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:Re`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:Re`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:Re`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:Re`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:Re`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:Re`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:Re`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:Re`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:Re`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:Re`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:Re`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:Re`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:Re`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,HELP_ETH_IMG:Re`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#j)"><rect width="60" height="60" rx="30" fill="#987DE8"/><path fill-rule="evenodd" clip-rule="evenodd" d="m15.48 28.367 11.966-19.3c1.174-1.892 3.927-1.892 5.1 0l11.97 19.306a6 6 0 0 1 .9 3.142v.028a6 6 0 0 1-1.154 3.56L33.227 50.208c-1.599 2.188-4.864 2.188-6.461 0L15.733 35.095a6 6 0 0 1-1.154-3.538v-.029a6 6 0 0 1 .9-3.161Z" fill="#fff"/><path d="M30.84 10.112a.992.992 0 0 0-.844-.464V24.5l12.598 5.53c.081-.466-.001-.963-.27-1.398L30.84 10.112Z" fill="#643CDD"/><path d="M29.996 9.648a.991.991 0 0 0-.845.465l-11.489 18.53a1.991 1.991 0 0 0-.264 1.387l12.598-5.53V9.648Z" fill="#BDADEB"/><path d="M29.996 50.544a.994.994 0 0 0 .808-.41l11.235-15.38c.307-.434-.193-.988-.658-.72L31.49 39.71a2.998 2.998 0 0 1-1.494.398v10.437Z" fill="#643CDD"/><path d="M17.966 34.762 29.19 50.134c.2.274.503.41.807.41V40.108a2.998 2.998 0 0 1-1.493-.398l-9.884-5.676c-.468-.27-.971.292-.653.728Z" fill="#BDADEB"/><path d="M42.594 30.03 29.996 24.5v13.138a3 3 0 0 0 1.495-.399l10.149-5.83c.525-.31.856-.823.954-1.38Z" fill="#401AB3"/><path d="M29.996 37.638V24.462l-12.598 5.566c.098.564.437 1.083.974 1.392l10.13 5.82c.462.265.978.398 1.494.398Z" fill="#7C5AE2"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="29.5"/><defs><clipPath id="j"><rect width="60" height="60" rx="30" fill="#fff"/></clipPath></defs></svg>`,HELP_PAINTING_IMG:Re`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#k)"><rect width="60" height="60" rx="3" fill="#C653C6"/><path d="M52.094 47.344c0-4.246-1.436-9.557-5.885-12.4a2.876 2.876 0 0 0-1.615-3.891v-.819a4.037 4.037 0 0 0-1.34-3.007 4.75 4.75 0 0 0-2.41-6.252v-5.506c0-6.248-5.065-11.313-11.313-11.313-6.247 0-11.312 5.065-11.312 11.313v2.152a3.343 3.343 0 0 0-1.18 5.045 4.738 4.738 0 0 0-1.633 3.584 4.73 4.73 0 0 0 .956 2.858 5.218 5.218 0 0 0-2.358 6.815c-3.06 4.129-6.098 8.298-6.098 15.64 0 2.668.364 4.856.731 6.385.184.765.368 1.366.509 1.78a12.721 12.721 0 0 0 .225.611l.015.037.005.011.001.004v.002h.001l.92-.393-.92.394.26.606h38.26l.291-.49-.86-.51.86.51v-.001l.002-.002.002-.005.01-.017.035-.06.127-.225c.108-.195.26-.477.441-.835.363-.714.845-1.732 1.328-2.953.959-2.427 1.945-5.725 1.945-9.068Z" fill="#E87DE8" stroke="#fff" stroke-width="2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M26.5 29.5c-3-.5-5.5-3-5.503-7l.002-7c0-.466 0-.698.026-.893a3 3 0 0 1 2.582-2.582c.195-.026.428-.026.893-.026 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.398 0 2.097 0 2.648.229a3 3 0 0 1 1.624 1.623c.228.552.228 1.25.228 2.649v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.495 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z" fill="#fff"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="2.5"/><defs><clipPath id="k"><rect width="60" height="60" rx="3" fill="#fff"/></clipPath></defs></svg>`,HELP_CHART_IMG:Re`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#l)"><path d="M0 25.01C0 15.76 0 11.133 1.97 7.678a15 15 0 0 1 5.598-5.597C11.023.11 15.648.11 24.9.11h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.597C60 11.133 60 15.758 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a15 15 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a14.999 14.999 0 0 1-5.597-5.598C0 49.087 0 44.462 0 35.21v-10.2Z" fill="#1DC956"/><path d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z" stroke="#fff" stroke-opacity=".1"/><path d="M16.109 60c-3.833-.179-6.41-.645-8.541-1.86a15 15 0 0 1-5.598-5.598C.553 50.057.155 46.967.043 41.985l4.146-1.382a4 4 0 0 0 2.48-2.39l4.654-12.409a2 2 0 0 1 2.505-1.195l2.526.842a2 2 0 0 0 2.422-1.003l2.968-5.938c.81-1.62 3.185-1.415 3.705.32l3.774 12.581a2 2 0 0 0 3.025 1.09l3.342-2.228c.27-.18.49-.422.646-.706l5.297-9.712a2 2 0 0 1 1.428-1.016l4.134-.689a2 2 0 0 1 1.61.437l3.892 3.243a2 2 0 0 0 2.694-.122l4.633-4.632C60 19.28 60 21.88 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a14.998 14.998 0 0 1-5.598 5.598c-2.131 1.215-4.708 1.681-8.54 1.86H16.108Z" fill="#2BEE6C"/><path d="M.072 43.03a112.37 112.37 0 0 1-.048-2.093l3.85-1.283a3 3 0 0 0 1.86-1.793l4.653-12.408a3 3 0 0 1 3.758-1.793l2.526.842a1 1 0 0 0 1.21-.501l2.97-5.938c1.214-2.43 4.775-2.123 5.556.48l3.774 12.58a1 1 0 0 0 1.513.545l3.341-2.227a1 1 0 0 0 .323-.353l5.298-9.712a3 3 0 0 1 2.14-1.523l4.135-.69a3 3 0 0 1 2.414.655l3.892 3.244a1 1 0 0 0 1.347-.061l5.28-5.28c.046.845.077 1.752.097 2.732l-3.962 3.962a3 3 0 0 1-4.042.183l-3.893-3.243a1 1 0 0 0-.804-.218l-4.135.689a1 1 0 0 0-.714.507l-5.297 9.712c-.233.427-.565.79-.97 1.06l-3.34 2.228a3 3 0 0 1-4.538-1.635l-3.775-12.58c-.26-.868-1.447-.97-1.852-.16l-2.969 5.937a3 3 0 0 1-3.632 1.505l-2.526-.842a1 1 0 0 0-1.252.597L7.606 38.564a5 5 0 0 1-3.1 2.988L.072 43.029Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z" fill="#2BEE6C"/><path d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" fill="#fff"/><path d="M45 .283v59.654c-.63.042-1.294.074-2 .098V.185c.706.025 1.37.056 2 .098Z" fill="#fff"/><path class="help-img-highlight" d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z"/></g><defs><clipPath id="l"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_KEY_IMG:Re`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#m)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M39.192 29.192c5.077-5.077 5.077-13.308 0-18.385-5.076-5.077-13.308-5.077-18.384 0-5.077 5.077-5.077 13.308 0 18.385l1.287 1.291c1.137 1.142 1.706 1.712 2.097 2.387.267.462.472.957.608 1.473.2.755.2 1.56.2 3.171V48.75c0 1.077 0 1.615.134 2.119a4 4 0 0 0 .407.984c.262.45.643.831 1.404 1.592l.294.295c.654.654.982.981 1.365 1.086.26.07.533.07.792 0 .383-.105.71-.432 1.365-1.086l3.478-3.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.478-.479c-.655-.654-.982-.981-1.087-1.365a1.5 1.5 0 0 1 0-.791c.105-.384.432-.711 1.087-1.365l.478-.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.492-.493c-.65-.65-.974-.974-1.08-1.355a1.5 1.5 0 0 1-.003-.788c.102-.382.425-.71 1.069-1.364l5.46-5.547Z"/><circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="m"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_USER_IMG:Re`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#n)"><rect width="60" height="60" fill="#00ACE6" rx="30"/><path fill="#1AC6FF" stroke="#fff" stroke-width="2" d="M59 73c0 16.016-12.984 29-29 29S1 89.016 1 73c0-16.017 11-29 29-29s29 12.983 29 29ZM18.69 19.902a11 11 0 0 1 9.281-8.692 14.842 14.842 0 0 1 4.058 0 11 11 0 0 1 9.28 8.692c.178.866.322 1.75.44 2.625.132.977.132 1.968 0 2.945a39.467 39.467 0 0 1-.44 2.625 11 11 0 0 1-9.28 8.692 14.862 14.862 0 0 1-4.058 0 11 11 0 0 1-9.28-8.692 39.467 39.467 0 0 1-.44-2.625 11.004 11.004 0 0 1 0-2.945c.118-.876.262-1.759.44-2.625Z"/><circle cx="24.5" cy="23.5" r="1.5" fill="#fff"/><circle cx="35.5" cy="23.5" r="1.5" fill="#fff"/><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m31 20-3 8h4"/></g><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/><defs><clipPath id="n"><rect width="60" height="60" fill="#fff" rx="30"/></clipPath></defs></svg>`,HELP_LOCK_IMG:Re`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#C653C6" rx="3"/><path fill="#fff" d="M20.034 15.216C20 15.607 20 16.07 20 17v2.808c0 1.13 0 1.696-.2 2.11a1.78 1.78 0 0 1-.584.714c-.366.28-1.051.42-2.423.7a7.076 7.076 0 0 0-1.597.511 9.001 9.001 0 0 0-4.353 4.353C10 30.005 10 32.336 10 37c0 4.663 0 6.995.843 8.804a9.001 9.001 0 0 0 4.353 4.353C17.005 51 19.336 51 24 51h12c4.663 0 6.995 0 8.804-.843a9.001 9.001 0 0 0 4.353-4.353C50 43.995 50 41.664 50 37c0-4.663 0-6.995-.843-8.804a9.001 9.001 0 0 0-4.353-4.353 7.076 7.076 0 0 0-1.597-.511c-1.372-.28-2.057-.42-2.423-.7a1.78 1.78 0 0 1-.583-.715C40 21.505 40 20.94 40 19.809V17c0-.929 0-1.393-.034-1.784a9 9 0 0 0-8.182-8.182C31.393 7 30.93 7 30 7s-1.393 0-1.784.034a9 9 0 0 0-8.182 8.182Z"/><path fill="#E87DE8" d="M22 17c0-.929 0-1.393.044-1.784a7 7 0 0 1 6.172-6.172C28.606 9 29.071 9 30 9s1.393 0 1.784.044a7 7 0 0 1 6.172 6.172c.044.39.044.855.044 1.784v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.394-.077-1.78a4 4 0 0 0-3.143-3.143C31.394 12 30.93 12 30 12s-1.394 0-1.78.077a4 4 0 0 0-3.143 3.143C25 15.606 25 16.07 25 17v4.5a1.5 1.5 0 0 1-3 0V17Z"/><path fill="#E87DE8" fill-rule="evenodd" d="M12 36.62c0-4.317 0-6.476.92-8.088a7 7 0 0 1 2.612-2.612c1.612-.92 3.77-.92 8.088-.92h6.855c.469 0 .703 0 .906.017 2.73.222 4.364 2.438 4.619 4.983.27-2.698 2.111-5 5.015-5A6.985 6.985 0 0 1 48 31.985v5.395c0 4.317 0 6.476-.92 8.088a7 7 0 0 1-2.612 2.612c-1.612.92-3.77.92-8.088.92h-5.855c-.469 0-.703 0-.906-.017-2.73-.222-4.364-2.438-4.619-4.983-.258 2.583-1.943 4.818-4.714 4.99-.155.01-.335.01-.694.01-.55 0-.825 0-1.057-.015a7 7 0 0 1-6.52-6.52C12 42.233 12 41.958 12 41.408V36.62Zm21.24-.273a4 4 0 1 0-6.478 0c.985 1.36 1.479 2.039 1.564 2.229.178.398.176.818.174 1.247V42.5a1.5 1.5 0 0 0 3 0v-2.677c-.002-.429-.004-.85.174-1.247.085-.19.579-.87 1.565-2.229Z" clip-rule="evenodd"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_COMPAS_IMG:Re`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#1DC956" rx="30"/><circle cx="30" cy="29.999" r="3" fill="#fff"/><path fill="#2BEE6C" stroke="#fff" stroke-width="2" d="m45.316 17.9-.88-.425.88.424a7.9 7.9 0 0 1 .026-.053c.093-.192.21-.432.26-.687l-.819-.162.819.162a2 2 0 0 0-.239-1.405c-.132-.224-.32-.412-.472-.562a8.415 8.415 0 0 1-.042-.042l-.042-.042c-.15-.151-.338-.34-.562-.472l-.508.862.508-.862a2 2 0 0 0-1.405-.239c-.255.05-.495.167-.687.26l-.053.026-15.05 7.246-.108.052c-1.131.545-1.843.887-2.456 1.374a6.994 6.994 0 0 0-1.13 1.13c-.487.613-.83 1.325-1.375 2.457l-.051.108-7.247 15.05-.025.053c-.094.192-.21.431-.26.686a2 2 0 0 0 .239 1.406l.855-.505-.856.505c.133.224.321.411.473.562l.042.042.041.042c.15.151.338.34.563.472a2 2 0 0 0 1.405.239l-.195-.981.195.98c.255-.05.494-.166.686-.26l.054-.025-.419-.87.419.87 15.05-7.247.107-.051c1.132-.545 1.844-.888 2.457-1.374a7.002 7.002 0 0 0 1.13-1.13c.487-.614.83-1.325 1.374-2.457l.052-.108 7.246-15.05Z"/><path fill="#1DC956" d="m33.376 32.723-2.669-3.43-14.85 14.849.206.205a1 1 0 0 0 1.141.194l15.105-7.273a3 3 0 0 0 1.067-4.545Z"/><path fill="#86F999" d="m26.624 27.276 2.669 3.43 14.85-14.849-.206-.205a1 1 0 0 0-1.141-.194L27.69 22.731a3 3 0 0 0-1.067 4.545Z"/><circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/></svg>`,HELP_NOUN_IMG:Re`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#794CFF" rx="3"/><path fill="#987DE8" stroke="#fff" stroke-width="2" d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"/><path fill="#fff" d="M37.5 25h10v10h-10z"/><path fill="#4019B2" d="M42.5 25h5v10h-5z"/><path fill="#fff" d="M19.5 25h10v10h-10z"/><path fill="#4019B2" d="M24.5 25h5v10h-5z"/><path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_DAO_IMG:Re`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#o)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M19 52c5.523 0 10-4.477 10-10s-4.477-10-10-10S9 36.477 9 42s4.477 10 10 10Z"/><path fill="#fff" fill-rule="evenodd" d="M42.844 8.326a1 1 0 0 0-1.687 0L28.978 27.463A1 1 0 0 0 29.822 29h24.357a1 1 0 0 0 .843-1.537L42.844 8.326Z" clip-rule="evenodd"/><path fill="#FF974C" fill-rule="evenodd" d="M42.335 11.646c.324.115.571.504 1.066 1.28l7.332 11.523c.562.883.843 1.325.792 1.69a1 1 0 0 1-.342.623c-.28.238-.803.238-1.85.238H34.667c-1.047 0-1.57 0-1.85-.238a1 1 0 0 1-.342-.623c-.051-.365.23-.806.792-1.69l7.332-11.523c.495-.776.742-1.165 1.066-1.28a1 1 0 0 1 .67 0ZM35 27a7 7 0 0 0 7-7 7 7 0 0 0 7 7H35Z" clip-rule="evenodd"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M10.106 9.357c-.109.32-.107.682-.106.975V25.668c-.001.293-.003.654.106.975a2 2 0 0 0 1.251 1.25c.32.11.682.108.975.107H19c5.523 0 10-4.477 10-10S24.523 8 19 8h-6.668c-.293-.001-.654-.003-.975.106a2 2 0 0 0-1.25 1.251Z"/><circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/><circle cx="19" cy="41.999" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="o"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,SEARCH_ICON:Re`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,HELP_ICON:Re`<svg width="11" height="17" viewBox="0 0 11 17"><path fill="#fff" d="M5.22 2.97c-1.07 0-2.25.843-2.25 2.25a.75.75 0 0 1-1.5 0c0-2.393 2.019-3.75 3.75-3.75 1.73 0 3.75 1.357 3.75 3.75 0 1.64-1.038 2.466-1.785 3.057-.802.635-1.215.984-1.215 1.693a.75.75 0 1 1-1.5 0c0-1.466.985-2.24 1.681-2.788l.103-.081C7.007 6.504 7.47 6.08 7.47 5.22c0-1.407-1.181-2.25-2.25-2.25ZM5.22 14.97a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"/></svg>`,WALLET_ICON:Re`<svg width="15" height="14" fill="none" viewBox="0 0 15 14"><path fill="#fff" fill-rule="evenodd" d="M.64 9.2v-3h.001c.009-1.857.07-2.886.525-3.682a4 4 0 0 1 1.492-1.493C3.58.5 4.813.5 7.28.5h3.735c.58 0 .871 0 1.114.04A3 3 0 0 1 14.6 3.011c.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041h-.777c.178.307.302.648.362 1.011.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041H4.507A3.867 3.867 0 0 1 .64 9.633V9.2ZM7.28 2h3.735c.64 0 .779.005.87.02a1.5 1.5 0 0 1 1.235 1.236c.015.09.02.229.02.869s-.005.779-.02.87a1.5 1.5 0 0 1-1.236 1.235c-.09.015-.229.02-.869.02H4.023c-.697 0-1.345.21-1.883.572V6.25h.001c.004-.791.015-1.383.059-1.867.056-.629.157-.926.269-1.122a2.5 2.5 0 0 1 .932-.933c.197-.111.494-.212 1.123-.268C5.173 2 6.019 2 7.28 2Zm-.265 5.75H4.023c-1.04 0-1.883.843-1.883 1.883A2.367 2.367 0 0 0 4.507 12h2.508c.64 0 .779-.005.87-.02a1.5 1.5 0 0 0 1.235-1.236c.015-.09.02-.229.02-.869s-.005-.779-.02-.87A1.5 1.5 0 0 0 7.884 7.77c-.09-.015-.228-.02-.869-.02Z" clip-rule="evenodd"/></svg>`,NETWORK_PLACEHOLDER:Re`<svg width="28" height="28" fill="none" viewBox="0 0 28 28"><mask id="p" width="26" height="28" x="1" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#D9D9D9" d="M12 1.172a4 4 0 0 1 4 0l8.124 4.69a4 4 0 0 1 2 3.465v9.381a4 4 0 0 1-2 3.464L16 26.862a4 4 0 0 1-4 0l-8.124-4.69a4 4 0 0 1-2-3.464V9.327a4 4 0 0 1 2-3.464L12 1.173Z"/></mask><g mask="url(#p)"><path id="network-placeholder-fill" fill="#fff" d="M0 0h28v28H0z"/><path id="network-placeholder-dash" stroke="#000" stroke-dasharray="2 2" d="m8.953 2.931 2.032-1.173.25.433 1.015-.586c.269-.155.553-.271.844-.35l-.13-.483a4.003 4.003 0 0 1 2.071 0l-.13.483c.293.079.576.195.845.35l1.016.586.25-.433 2.03 1.173-.25.433 2.032 1.173.25-.433 2.03 1.172-.25.433 1.016.587c.269.155.512.342.725.556l.354-.354a4.003 4.003 0 0 1 1.035 1.794l-.483.129c.078.292.12.596.12.906v1.172h.5v2.346h-.5v2.345h.5v2.345h-.5v1.173c0 .31-.042.614-.12.906l.483.13a4.003 4.003 0 0 1-1.035 1.793l-.354-.354a3.498 3.498 0 0 1-.725.556l-1.015.586.25.434-2.031 1.172-.25-.433-2.031 1.173.25.433-2.031 1.172-.25-.433-1.016.587a3.494 3.494 0 0 1-.844.35l.13.482a4.003 4.003 0 0 1-2.071 0l.13-.483a3.496 3.496 0 0 1-.845-.35l-1.015-.586-.25.433-2.032-1.172.25-.433-2.03-1.173-.25.433L4.89 22.76l.25-.434-1.015-.586a3.498 3.498 0 0 1-.725-.556l-.354.354a4.003 4.003 0 0 1-1.035-1.794l.483-.13a3.497 3.497 0 0 1-.12-.905v-1.173h-.5V15.19h.5v-2.345h-.5v-2.346h.5V9.327c0-.31.042-.614.12-.906l-.483-.13a4.003 4.003 0 0 1 1.035-1.793l.354.354c.213-.214.456-.401.725-.556l1.015-.587-.25-.433 2.031-1.172.25.433 2.031-1.173-.25-.433Z"/><path fill="#798686" stroke="#fff" d="M14.243 13.563 14 13.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.538.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.538-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#9EA9A9" stroke="#fff" d="M14.243 8.563 14 8.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.316.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.316-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#C9CFCF" stroke="#fff" d="m22.344 9.53-.468-.176.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-3.163-1.758-.09-.05c-1.163-.645-1.856-1.03-2.606-1.161a4.5 4.5 0 0 0-1.544 0c-.75.13-1.443.516-2.607 1.162l-.088.05-3.164 1.757-.024.013c-.432.24-.79.44-1.053.622-.266.185-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722Z"/></g></svg>`,WALLET_PLACEHOLDER:Re`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,TOKEN_PLACEHOLDER:Re`<svg width="60" height="60" viewBox="0 0 60 60" fill="none"><rect id="token-placeholder-fill" width="58" height="58" x="1" y="1" fill="#fff" rx="29"/><path fill="#3B4040" stroke="#fff" stroke-width="2" d="M32 10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v5.566c0 .357.192.685.495.875a16.001 16.001 0 0 1 4.256 3.894c.667.88.33 2.113-.627 2.665l-2.494 1.44c-.956.552-2.166.204-2.913-.609a9.12 9.12 0 1 0 .064 12.267c.739-.82 1.945-1.181 2.907-.64l2.509 1.415c.962.542 1.312 1.77.654 2.658a16 16 0 0 1-4.356 4.028c-.303.19-.495.518-.495.875V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-2.992c0-.602-.528-1.065-1.13-1.032-.579.032-1.16.032-1.74 0-.602-.032-1.13.43-1.13 1.032V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-5.566c0-.357-.192-.685-.495-.875a16 16 0 0 1 0-27.118c.303-.19.495-.517.495-.875V10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2.992c0 .601.528 1.064 1.13 1.032.58-.032 1.161-.032 1.74 0 .602.033 1.13-.43 1.13-1.032V10Z"/><rect id="token-placeholder-dash" width="58" height="58" x="1" y="1" stroke="#000" stroke-dasharray="6 6" stroke-width="2" rx="29"/></svg>`,ACCOUNT_COPY:Re`<svg width="14" height="14" fill="none" viewBox="0 0 14 14"><path fill="#fff" fill-rule="evenodd" d="M4.003 4.005c.012-1.225.074-1.936.391-2.491a3 3 0 0 1 1.12-1.12C6.204 0 7.136 0 9 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C14 2.204 14 3.136 14 5s0 2.795-.394 3.486a3 3 0 0 1-1.12 1.12c-.555.317-1.266.379-2.491.391l.002.003c-.012 1.222-.075 1.932-.391 2.486a3 3 0 0 1-1.12 1.12C7.796 14 6.864 14 5 14s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C0 11.796 0 10.864 0 9s0-2.795.394-3.486a3 3 0 0 1 1.12-1.12c.554-.316 1.264-.379 2.486-.391l.003.002ZM9 8.5c-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.045-.08-.113-.243-.154-.693C5.501 6.58 5.5 5.959 5.5 5c0-.959.001-1.58.043-2.05.04-.45.109-.613.154-.693a1.5 1.5 0 0 1 .56-.56c.08-.045.243-.113.693-.154C7.42 1.501 8.041 1.5 9 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.045.08.113.243.154.693.042.47.043 1.091.043 2.05 0 .959-.001 1.58-.043 2.05-.04.45-.109.613-.154.693a1.5 1.5 0 0 1-.56.56c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043ZM4 5.503a13.77 13.77 0 0 0-1.05.04c-.45.04-.613.109-.693.154a1.5 1.5 0 0 0-.56.56c-.045.08-.113.243-.154.693C1.501 7.42 1.5 8.041 1.5 9c0 .959.001 1.58.043 2.05.04.45.109.613.154.693a1.5 1.5 0 0 0 .56.56c.08.045.243.113.693.154.47.042 1.091.043 2.05.043.959 0 1.58-.001 2.05-.043.45-.04.613-.109.693-.154a1.5 1.5 0 0 0 .56-.56c.045-.08.113-.242.154-.693.025-.283.035-.619.04-1.05-1.534-.003-2.358-.037-2.983-.394a3 3 0 0 1-1.12-1.12c-.357-.625-.39-1.449-.394-2.983Z" clip-rule="evenodd"/></svg>`,ACCOUNT_DISCONNECT:Re`<svg width="16" height="14" fill="none" viewBox="0 0 16 14"><path fill="#fff" d="M9.677 1.5h-2.61c-1.261 0-2.107.001-2.757.06-.629.056-.926.157-1.122.268a2.5 2.5 0 0 0-.933.933c-.112.196-.212.493-.269 1.122-.058.65-.06 1.496-.06 2.757v.72c0 1.26.002 2.107.06 2.756.057.63.157.927.27 1.123a2.5 2.5 0 0 0 .932.933c.196.111.493.212 1.122.268.65.059 1.496.06 2.757.06h2.61a.75.75 0 1 1 0 1.5h-2.61c-2.467 0-3.7 0-4.622-.525a4 4 0 0 1-1.493-1.493C.427 11.06.427 9.827.427 7.36v-.72c0-2.467 0-3.7.525-4.622A4 4 0 0 1 2.445.525C3.366 0 4.6 0 7.067 0h2.61a.75.75 0 1 1 0 1.5Z"/><path fill="#fff" d="M10.896 11.03a.75.75 0 0 1 0-1.06l1.793-1.793a.25.25 0 0 0-.176-.427H8.177a.75.75 0 0 1 0-1.5h4.336a.25.25 0 0 0 .176-.427L10.896 4.03a.75.75 0 0 1 1.061-1.06l3.323 3.323a1 1 0 0 1 0 1.414l-3.323 3.323a.75.75 0 0 1-1.06 0Z"/></svg>`},D8=be`.w3m-custom-placeholder{inset:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--w3m-background-border-radius) * .9)}.w3m-custom-placeholder{background-color:var(--w3m-background-color);background-image:var(--w3m-background-image-url);background-position:center;background-size:cover}.w3m-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-accent-fill-color)}.w3m-action-btn{width:28px;height:28px;border-radius:var(--w3m-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:background-color,.2s ease;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay)}.w3m-action-btn:hover{background-color:var(--w3m-color-bg-2)}.w3m-action-btn svg{display:block;object-position:center}.w3m-action-btn path{fill:var(--w3m-color-fg-1)}.w3m-actions{display:flex}.w3m-actions button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}`;var O8=Object.defineProperty,$8=Object.getOwnPropertyDescriptor,Kd=(t,e,r,n)=>{for(var i=n>1?void 0:n?$8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&O8(e,r,i),i};let Zs=class extends ue{constructor(){super(),this.isHelp=!1,this.unsubscribeRouter=void 0,this.unsubscribeRouter=Ae.subscribe(t=>{this.isHelp=t.view==="Help"})}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this)}onHelp(){Ae.push("Help")}logoTemplate(){var t;const e=(t=fr.state.themeVariables)==null?void 0:t["--w3m-logo-image-url"];return e?V`<img src="${e}">`:ve.WALLET_CONNECT_LOGO}render(){const t={"w3m-actions":!0,"w3m-help-active":this.isHelp};return V`<div class="w3m-custom-placeholder"></div><div class="w3m-toolbar">${this.logoTemplate()}<div class="${Ft(t)}"><button class="w3m-action-btn" @click="${this.onHelp}">${ve.HELP_ICON}</button> <button class="w3m-action-btn" @click="${lt.close}">${ve.CROSS_ICON}</button></div></div>`}};Zs.styles=[we.globalCss,D8],Kd([Fe()],Zs.prototype,"isHelp",2),Zs=Kd([de("w3m-modal-backcard")],Zs);const A8=be`main{padding:20px;padding-top:0;width:100%}`;var P8=Object.defineProperty,T8=Object.getOwnPropertyDescriptor,R8=(t,e,r,n)=>{for(var i=n>1?void 0:n?T8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&P8(e,r,i),i};let vc=class extends ue{render(){return V`<main><slot></slot></main>`}};vc.styles=[we.globalCss,A8],vc=R8([de("w3m-modal-content")],vc);const N8=be`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var M8=Object.defineProperty,L8=Object.getOwnPropertyDescriptor,U8=(t,e,r,n)=>{for(var i=n>1?void 0:n?L8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&M8(e,r,i),i};let _c=class extends ue{render(){return V`<footer><slot></slot></footer>`}};_c.styles=[we.globalCss,N8],_c=U8([de("w3m-modal-footer")],_c);const j8=be`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px;transition:opacity .2s ease}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-accent-color)}`;var F8=Object.defineProperty,B8=Object.getOwnPropertyDescriptor,Ni=(t,e,r,n)=>{for(var i=n>1?void 0:n?B8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&F8(e,r,i),i};let Yr=class extends ue{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return V`<button class="w3m-back-btn" @click="${Ae.goBack}">${ve.BACK_ICON}</button>`}actionBtnTemplate(){return V`<button class="w3m-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"w3m-border":this.border},e=Ae.state.history.length>1,r=this.title?V`<w3m-text variant="big-bold">${this.title}</w3m-text>`:V`<slot></slot>`;return V`<header class="${Ft(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Yr.styles=[we.globalCss,j8],Ni([ye()],Yr.prototype,"title",2),Ni([ye()],Yr.prototype,"onAction",2),Ni([ye()],Yr.prototype,"actionIcon",2),Ni([ye()],Yr.prototype,"border",2),Yr=Ni([de("w3m-modal-header")],Yr);const k8={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00"};var Fn=(t=>(t.metaMask="metaMask",t.trust="trust",t.phantom="phantom",t.brave="brave",t.spotEthWallet="spotEthWallet",t.exodus="exodus",t.tokenPocket="tokenPocket",t.frame="frame",t.tally="tally",t.coinbaseWallet="coinbaseWallet",t.core="core",t.bitkeep="bitkeep",t.mathWallet="mathWallet",t.opera="opera",t.tokenary="tokenary",t["1inch"]="1inch",t.kuCoinWallet="kuCoinWallet",t.ledger="ledger",t))(Fn||{});const Jr={injectedPreset:{metaMask:{name:"MetaMask",icon:"619537c0-2ff3-4c78-9ed8-a05e7567f300",url:"https://metamask.io",isMobile:!0,isInjected:!0},trust:{name:"Trust",icon:"0528ee7e-16d1-4089-21e3-bbfb41933100",url:"https://trustwallet.com",isMobile:!0,isInjected:!0},spotEthWallet:{name:"Spot",icon:"1bf33a89-b049-4a1c-d1f6-4dd7419ee400",url:"https://www.spot-wallet.com",isMobile:!0,isInjected:!0},phantom:{name:"Phantom",icon:"62471a22-33cb-4e65-5b54-c3d9ea24b900",url:"https://phantom.app",isInjected:!0},core:{name:"Core",icon:"35f9c46e-cc57-4aa7-315d-e6ccb2a1d600",url:"https://core.app",isMobile:!0,isInjected:!0},bitkeep:{name:"BitKeep",icon:"3f7075d0-4ab7-4db5-404d-3e4c05e6fe00",url:"https://bitkeep.com",isMobile:!0,isInjected:!0},tokenPocket:{name:"TokenPocket",icon:"f3119826-4ef5-4d31-4789-d4ae5c18e400",url:"https://www.tokenpocket.pro",isMobile:!0,isInjected:!0},mathWallet:{name:"MathWallet",icon:"26a8f588-3231-4411-60ce-5bb6b805a700",url:"https://mathwallet.org",isMobile:!0,isInjected:!0},exodus:{name:"Exodus",icon:"4c16cad4-cac9-4643-6726-c696efaf5200",url:"https://www.exodus.com",isMobile:!0,isDesktop:!0,isInjected:!0},kuCoinWallet:{name:"KuCoin Wallet",icon:"1e47340b-8fd7-4ad6-17e7-b2bd651fae00",url:"https://kuwallet.com",isMobile:!0,isInjected:!0},ledger:{name:"Ledger",icon:"a7f416de-aa03-4c5e-3280-ab49269aef00",url:"https://www.ledger.com",isDesktop:!0},brave:{name:"Brave",icon:"125e828e-9936-4451-a8f2-949c119b7400",url:"https://brave.com/wallet",isInjected:!0},frame:{name:"Frame",icon:"cd492418-ea85-4ef1-aeed-1c9e20b58900",url:"https://frame.sh",isInjected:!0},tally:{name:"Tally",icon:"98d2620c-9fc8-4a1c-31bc-78d59d00a300",url:"https://tallyho.org",isInjected:!0},coinbaseWallet:{name:"Coinbase",icon:"f8068a7f-83d7-4190-1f94-78154a12c600",url:"https://www.coinbase.com/wallet",isInjected:!0},opera:{name:"Opera",icon:"877fa1a4-304d-4d45-ca8e-f76d1a556f00",url:"https://www.opera.com/crypto",isInjected:!0},tokenary:{name:"Tokenary",icon:"5e481041-dc3c-4a81-373a-76bbde91b800",url:"https://tokenary.io",isDesktop:!0,isInjected:!0},["1inch"]:{name:"1inch Wallet",icon:"dce1ee99-403f-44a9-9f94-20de30616500",url:"https://1inch.io/wallet",isMobile:!0}},getInjectedId(t){if(t.toUpperCase()!=="INJECTED"&&t.length)return t;const{ethereum:e,spotEthWallet:r,coinbaseWalletExtension:n}=window;return e?e.isTrust||e.isTrustWallet?"trust":e.isPhantom?"phantom":e.isBraveWallet?"brave":r?"spotEthWallet":e.isExodus?"exodus":e.isTokenPocket?"tokenPocket":e.isFrame?"frame":e.isTally?"tally":n?"coinbaseWallet":e.isAvalanche?"core":e.isBitKeep?"bitkeep":e.isMathWallet?"mathWallet":e.isOpera?"opera":e.isTokenary?"tokenary":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch":e.isKuCoinWallet?"kuCoinWallet":e.isMetaMask?"metaMask":"injected":"metaMask"},getInjectedName(t){var e,r;if(t.length&&t.toUpperCase()!=="INJECTED")return t;const n=Jr.getInjectedId("");return(r=(e=Jr.injectedPreset[n])==null?void 0:e.name)!=null?r:"Injected"}},H8={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}};var z8=Object.defineProperty,Gd=Object.getOwnPropertySymbols,W8=Object.prototype.hasOwnProperty,q8=Object.prototype.propertyIsEnumerable,Zd=(t,e,r)=>e in t?z8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,V8=(t,e)=>{for(var r in e||(e={}))W8.call(e,r)&&Zd(t,r,e[r]);if(Gd)for(var r of Gd(e))q8.call(e,r)&&Zd(t,r,e[r]);return t};const re={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET:"W3M_RECENT_WALLET",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",rejectStandaloneButtonComponent(){const{isStandalone:t}=le.state;if(t)throw new Error("Web3Modal button components are not available in standalone mode.")},getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletId(t){return Jr.getInjectedId(t)},getWalletIcon(t){var e,r;const n=(e=Jr.injectedPreset[t])==null?void 0:e.icon,{projectId:i,walletImages:s}=at.state;return(r=s?.[t])!=null?r:i&&n?ct.getImageUrl(n):""},getWalletName(t,e=!1){const r=Jr.getInjectedName(t);return e?r.split(" ")[0]:r},getChainIcon(t){var e;const r=k8[t],{projectId:n,chainImages:i}=at.state;return(e=i?.[t])!=null?e:n&&r?ct.getImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=H8[t])==null?void 0:e.icon,{projectId:i,tokenImages:s}=at.state;return(r=s?.[t])!=null?r:i&&n?ct.getImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=re.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.src=t});return Promise.race([e,De.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},async handleMobileLinking(t){De.removeWalletConnectDeepLink();const{standaloneUri:e,selectedChain:r}=le.state,{links:n,name:i}=t;function s(o){let a="";n!=null&&n.universal?a=De.formatUniversalUrl(n.universal,o,i):n!=null&&n.native&&(a=De.formatNativeUrl(n.native,o,i)),De.openHref(a,"_self")}e?(re.setRecentWallet(t),s(e)):(await qe.client().connectWalletConnect(o=>{s(o)},r?.id),re.setRecentWallet(t),lt.close())},async handleAndroidLinking(){De.removeWalletConnectDeepLink();const{standaloneUri:t,selectedChain:e}=le.state;t?De.openHref(t,"_self"):(await qe.client().connectWalletConnect(r=>{De.setWalletConnectAndroidDeepLink(r),De.openHref(r,"_self")},e?.id),lt.close())},async handleUriCopy(){const{standaloneUri:t}=le.state;if(t)await navigator.clipboard.writeText(t);else{const e=qe.client().walletConnectUri;await navigator.clipboard.writeText(e)}Ot.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=le.state;await qe.client().connectConnector(t,r?.id),lt.close()}catch(r){console.error(r),e?e():Ot.openToast(re.getErrorMessage(r),"error")}},getCustomWallets(){var t;const{desktopWallets:e,mobileWallets:r}=at.state;return(t=De.isMobile()?r:e)!=null?t:[]},getCustomImageUrls(){const{chainImages:t,walletImages:e}=at.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},getConnectorImageUrls(){return qe.client().getConnectors().map(({id:t})=>Jr.getInjectedId(t)).map(t=>re.getWalletIcon(t))},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;const r=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),n=[];r?.forEach(s=>{let o=0;for(let c=0;c<s.length;c+=1)o=s.charCodeAt(c)+((o<<5)-o),o=o&o;const a=[0,0,0];for(let c=0;c<3;c+=1){const l=o>>c*8&255;a[c]=l}n.push(`rgb(${a[0]}, ${a[1]}, ${a[2]})`)});const i=document.querySelector(":root");if(i){const s={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(s).forEach(([o,a])=>i.style.setProperty(o,a))}},setRecentWallet(t){const{walletConnectVersion:e}=le.state;localStorage.setItem(re.W3M_RECENT_WALLET,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(re.W3M_RECENT_WALLET);if(t){const{walletConnectVersion:e}=le.state,r=JSON.parse(t);if(r[e])return r[e]}},getExtensionWallets(){const t=[];for(const[e,r]of Object.entries(Jr.injectedPreset))r!=null&&r.isInjected&&!r.isDesktop&&t.push(V8({id:e},r));return t},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){De.openHref(re.EXPLORER_WALLET_URL,"_blank")}},K8=be`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var G8=Object.defineProperty,Z8=Object.getOwnPropertyDescriptor,Ec=(t,e,r,n)=>{for(var i=n>1?void 0:n?Z8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&G8(e,r,i),i};let Mi=class extends ue{constructor(){super(),this.view=Ae.state.view,this.prevView=Ae.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Ae.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&(Cr(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),Cr(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.03})),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return re.getShadowRootElement(this,".w3m-router")}get contentEl(){return re.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return V`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return V`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnector":return V`<w3m-injected-connector-view></w3m-injected-connector-view>`;case"InstallConnector":return V`<w3m-install-connector-view></w3m-install-connector-view>`;case"GetWallet":return V`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"DesktopConnector":return V`<w3m-desktop-connector-view></w3m-desktop-connector-view>`;case"WalletExplorer":return V`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return V`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return V`<w3m-help-view></w3m-help-view>`;case"Account":return V`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return V`<w3m-switch-network-view></w3m-switch-network-view>`;case"Connectors":return V`<w3m-connectors-view></w3m-connectors-view>`;default:return V`<div>Not Found</div>`}}async onChangeRoute(){await Cr(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15}).finished,this.view=Ae.state.view}render(){return V`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};Mi.styles=[we.globalCss,K8],Ec([Fe()],Mi.prototype,"view",2),Ec([Fe()],Mi.prototype,"prevView",2),Mi=Ec([de("w3m-modal-router")],Mi);const Y8=be`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:10px 15px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--w3m-notification-border-radius);border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-accent-color)}.w3m-error path{fill:var(--w3m-error-color)}`;var J8=Object.defineProperty,X8=Object.getOwnPropertyDescriptor,Yd=(t,e,r,n)=>{for(var i=n>1?void 0:n?X8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&J8(e,r,i),i};let Ys=class extends ue{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Ot.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Ot.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Ot.closeToast()}render(){const{message:t,variant:e}=Ot.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?V`<div class="${Ft(r)}">${e==="success"?ve.CHECKMARK_ICON:null} ${e==="error"?ve.CROSS_ICON:null}<w3m-text variant="small-regular">${t}</w3m-text></div>`:null}};Ys.styles=[we.globalCss,Y8],Yd([Fe()],Ys.prototype,"open",2),Ys=Yd([de("w3m-modal-toast")],Ys);const Q8=be`button{padding:5px;border-radius:var(--w3m-button-hover-highlight-border-radius);transition:all .2s ease;display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:hover{background-color:var(--w3m-color-overlay)}`;var e_=Object.defineProperty,t_=Object.getOwnPropertyDescriptor,Js=(t,e,r,n)=>{for(var i=n>1?void 0:n?t_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&e_(e,r,i),i};let Bn=class extends ue{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId=""}render(){return V`<button @click="${this.onClick}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular">${this.name}</w3m-text></button>`}};Bn.styles=[we.globalCss,Q8],Js([ye()],Bn.prototype,"onClick",2),Js([ye()],Bn.prototype,"name",2),Js([ye()],Bn.prototype,"chainId",2),Bn=Js([de("w3m-network-button")],Bn);const r_=be`div{width:inherit;height:inherit}.polygon-stroke{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var n_=Object.defineProperty,i_=Object.getOwnPropertyDescriptor,Jd=(t,e,r,n)=>{for(var i=n>1?void 0:n?i_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&n_(e,r,i),i};let Xs=class extends ue{constructor(){super(...arguments),this.chainId=""}render(){const t=re.getChainIcon(this.chainId);return t?V`<div><svg width="54" height="59" viewBox="0 0 54 59" fill="none"><defs><clipPath id="polygon"><path d="M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z"/></clipPath></defs><image clip-path="url(#polygon)" href="${t}" width="58" height="59" x="-2" y="0"/><path class="polygon-stroke" d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z" stroke="#fff"/></svg></div>`:V`${ve.NETWORK_PLACEHOLDER}`}};Xs.styles=[we.globalCss,r_],Jd([ye()],Xs.prototype,"chainId",2),Xs=Jd([de("w3m-network-image")],Xs);const s_=.1,Xd=2.5,pr=7;function xc(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+s_}function o_(t,e){const r=Array.prototype.slice.call(Oi.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,s,o)=>(o%n===0?i.push([s]):i[i.length-1].push(s))&&i,[])}const a_={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",s=n==="light"?"#fff":"#141414",o=[],a=o_(t,"Q"),c=e/a.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:T,y:R})=>{const L=(a.length-pr)*c*T,C=(a.length-pr)*c*R,O=.32;for(let b=0;b<l.length;b+=1){const S=c*(pr-b*2);o.push(Re`<rect fill="${b%2===0?i:s}" height="${S}" rx="${S*O}" ry="${S*O}" width="${S}" x="${L+c*b}" y="${C+c*b}">`)}});const p=Math.floor((r+25)/c),m=a.length/2-p/2,w=a.length/2+p/2-1,y=[];a.forEach((T,R)=>{T.forEach((L,C)=>{if(a[R][C]&&!(R<pr&&C<pr||R>a.length-(pr+1)&&C<pr||R<pr&&C>a.length-(pr+1))&&!(R>m&&R<w&&C>m&&C<w)){const O=R*c+c/2,b=C*c+c/2;y.push([O,b])}})});const E={};return y.forEach(([T,R])=>{E[T]?E[T].push(R):E[T]=[R]}),Object.entries(E).map(([T,R])=>{const L=R.filter(C=>R.every(O=>!xc(C,O,c)));return[Number(T),L]}).forEach(([T,R])=>{R.forEach(L=>{o.push(Re`<circle cx="${T}" cy="${L}" fill="${i}" r="${c/Xd}">`)})}),Object.entries(E).filter(([T,R])=>R.length>1).map(([T,R])=>{const L=R.filter(C=>R.some(O=>xc(C,O,c)));return[Number(T),L]}).map(([T,R])=>{R.sort((C,O)=>C<O?-1:1);const L=[];for(const C of R){const O=L.find(b=>b.some(S=>xc(C,S,c)));O?O.push(C):L.push([C])}return[T,L.map(C=>[C[0],C[C.length-1]])]}).forEach(([T,R])=>{R.forEach(([L,C])=>{o.push(Re`<line x1="${T}" x2="${T}" y1="${L}" y2="${C}" stroke="${i}" stroke-width="${c/(Xd/2)}" stroke-linecap="round">`)})}),o}},c_=be`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:15px}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-accent-color)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var l_=Object.defineProperty,h_=Object.getOwnPropertyDescriptor,Li=(t,e,r,n)=>{for(var i=n>1?void 0:n?h_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&l_(e,r,i),i};let Xr=class extends ue{constructor(){super(...arguments),this.uri="",this.size=0,this.logoSrc="",this.walletId=""}svgTemplate(){var t;const e=(t=fr.state.themeMode)!=null?t:"light";return Re`<svg height="${this.size}" width="${this.size}">${a_.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return V`<div>${this.walletId||this.logoSrc?V`<w3m-wallet-image walletId="${Bt(this.walletId)}" src="${Bt(this.logoSrc)}"></w3m-wallet-image>`:ve.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Xr.styles=[we.globalCss,c_],Li([ye()],Xr.prototype,"uri",2),Li([ye({type:Number})],Xr.prototype,"size",2),Li([ye()],Xr.prototype,"logoSrc",2),Li([ye()],Xr.prototype,"walletId",2),Xr=Li([de("w3m-qrcode")],Xr);const u_=be`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--w3m-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:transparent;position:absolute;background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}input::placeholder{color:transparent}svg{margin-right:4px}.w3m-placeholder{top:0;left:50%;transform:translateX(-50%);transition:.2s all ease;pointer-events:none;display:flex;align-items:center;justify-content:center;height:100%;width:fit-content;position:relative}input:focus-within+.w3m-placeholder,input:not(:placeholder-shown)+.w3m-placeholder{transform:translateX(10px);left:0}w3m-text{opacity:1;transition:.2s opacity ease}input:focus-within+.w3m-placeholder w3m-text,input:not(:placeholder-shown)+.w3m-placeholder w3m-text{opacity:0}input:focus-within,input:not(:placeholder-shown){color:var(--w3m-color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var d_=Object.defineProperty,f_=Object.getOwnPropertyDescriptor,Qd=(t,e,r,n)=>{for(var i=n>1?void 0:n?f_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&d_(e,r,i),i};let Qs=class extends ue{constructor(){super(...arguments),this.onChange=()=>null}render(){const t=De.isMobile()?"Search mobile wallets":"Search desktop wallets";return V`<input type="text" @input="${this.onChange}" placeholder="${t}"><div class="w3m-placeholder">${ve.SEARCH_ICON}<w3m-text color="secondary" variant="small-thin">${t}</w3m-text></div>`}};Qs.styles=[we.globalCss,u_],Qd([ye()],Qs.prototype,"onChange",2),Qs=Qd([de("w3m-search-input")],Qs);const p_=be`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-accent-color)}`;var g_=Object.defineProperty,m_=Object.getOwnPropertyDescriptor,w_=(t,e,r,n)=>{for(var i=n>1?void 0:n?m_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&g_(e,r,i),i};let Cc=class extends ue{render(){return V`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};Cc.styles=[we.globalCss,p_],Cc=w_([de("w3m-spinner")],Cc);const y_=be`span{font-style:normal;font-family:var(--w3m-font-family);font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xsmall-bold{font-family:var(--w3m-text-xsmall-bold-font-family);font-weight:var(--w3m-text-xsmall-bold-weight);font-size:var(--w3m-text-xsmall-bold-size);line-height:var(--w3m-text-xsmall-bold-line-height);letter-spacing:var(--w3m-text-xsmall-bold-letter-spacing);text-transform:var(--w3m-text-xsmall-bold-text-transform)}.w3m-xsmall-regular{font-family:var(--w3m-text-xsmall-regular-font-family);font-weight:var(--w3m-text-xsmall-regular-weight);font-size:var(--w3m-text-xsmall-regular-size);line-height:var(--w3m-text-xsmall-regular-line-height);letter-spacing:var(--w3m-text-xsmall-regular-letter-spacing);text-transform:var(--w3m-text-xsmall-regular-text-transform)}.w3m-small-thin{font-family:var(--w3m-text-small-thin-font-family);font-weight:var(--w3m-text-small-thin-weight);font-size:var(--w3m-text-small-thin-size);line-height:var(--w3m-text-small-thin-line-height);letter-spacing:var(--w3m-text-small-thin-letter-spacing);text-transform:var(--w3m-text-small-thin-text-transform)}.w3m-small-regular{font-family:var(--w3m-text-small-regular-font-family);font-weight:var(--w3m-text-small-regular-weight);font-size:var(--w3m-text-small-regular-size);line-height:var(--w3m-text-small-regular-line-height);letter-spacing:var(--w3m-text-small-regular-letter-spacing);text-transform:var(--w3m-text-small-regular-text-transform)}.w3m-medium-regular{font-family:var(--w3m-text-medium-regular-font-family);font-weight:var(--w3m-text-medium-regular-weight);font-size:var(--w3m-text-medium-regular-size);line-height:var(--w3m-text-medium-regular-line-height);letter-spacing:var(--w3m-text-medium-regular-letter-spacing);text-transform:var(--w3m-text-medium-regular-text-transform)}.w3m-big-bold{font-family:var(--w3m-text-big-bold-font-family);font-weight:var(--w3m-text-big-bold-weight);font-size:var(--w3m-text-big-bold-size);line-height:var(--w3m-text-big-bold-line-height);letter-spacing:var(--w3m-text-big-bold-letter-spacing);text-transform:var(--w3m-text-big-bold-text-transform)}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-accent-fill-color)}.w3m-color-accnt{color:var(--w3m-accent-color)}.w3m-color-error{color:var(--w3m-error-color)}`;var b_=Object.defineProperty,v_=Object.getOwnPropertyDescriptor,Ic=(t,e,r,n)=>{for(var i=n>1?void 0:n?v_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&b_(e,r,i),i};let Ui=class extends ue{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"w3m-big-bold":this.variant==="big-bold","w3m-medium-regular":this.variant==="medium-regular","w3m-small-regular":this.variant==="small-regular","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-regular":this.variant==="xsmall-regular","w3m-xsmall-bold":this.variant==="xsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return V`<span><slot class="${Ft(t)}"></slot></span>`}};Ui.styles=[we.globalCss,y_],Ic([ye()],Ui.prototype,"variant",2),Ic([ye()],Ui.prototype,"color",2),Ui=Ic([de("w3m-text")],Ui);const __=be`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;inset:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var E_=Object.defineProperty,x_=Object.getOwnPropertyDescriptor,ef=(t,e,r,n)=>{for(var i=n>1?void 0:n?x_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&E_(e,r,i),i};let eo=class extends ue{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=re.getTokenIcon((t=this.symbol)!=null?t:"");return e?V`<div><img src="${e}" alt="${this.id}"></div>`:ve.TOKEN_PLACEHOLDER}};eo.styles=[we.globalCss,__],ef([ye()],eo.prototype,"symbol",2),eo=ef([de("w3m-token-image")],eo);const C_=be`button{transition:all .2s ease;width:100%;height:100%;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:hover{background-color:var(--w3m-color-overlay)}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--w3m-wallet-icon-border-radius);margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var I_=Object.defineProperty,S_=Object.getOwnPropertyDescriptor,Dr=(t,e,r,n)=>{for(var i=n>1?void 0:n?S_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&I_(e,r,i),i};let lr=class extends ue{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.src=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?V`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?V`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</w3m-text>`:null}render(){var t;return V`<button @click="${this.onClick}"><div><w3m-wallet-image walletId="${this.walletId}" .src="${this.src}"></w3m-wallet-image><w3m-text variant="xsmall-regular">${(t=this.label)!=null?t:re.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};lr.styles=[we.globalCss,C_],Dr([ye()],lr.prototype,"onClick",2),Dr([ye()],lr.prototype,"name",2),Dr([ye()],lr.prototype,"walletId",2),Dr([ye()],lr.prototype,"label",2),Dr([ye()],lr.prototype,"src",2),Dr([ye()],lr.prototype,"installed",2),Dr([ye()],lr.prototype,"recent",2),lr=Dr([de("w3m-wallet-button")],lr);const D_=be`div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;inset:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var O_=Object.defineProperty,$_=Object.getOwnPropertyDescriptor,Sc=(t,e,r,n)=>{for(var i=n>1?void 0:n?$_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&O_(e,r,i),i};let ji=class extends ue{constructor(){super(...arguments),this.walletId=void 0,this.src=void 0}render(){var t;const e=re.getWalletId((t=this.walletId)!=null?t:""),r=this.src?this.src:re.getWalletIcon(e);return V`${r.length?V`<div><img src="${r}" alt="${this.id}"></div>`:ve.WALLET_PLACEHOLDER}`}};ji.styles=[we.globalCss,D_],Sc([ye()],ji.prototype,"walletId",2),Sc([ye()],ji.prototype,"src",2),ji=Sc([de("w3m-wallet-image")],ji);var A_=Object.defineProperty,P_=Object.getOwnPropertyDescriptor,T_=(t,e,r,n)=>{for(var i=n>1?void 0:n?P_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&A_(e,r,i),i};let tf=class extends ue{constructor(){super(),this.unwatchAccount=void 0,He.getAccount(),this.fetchProfile(),this.fetchBalance(),this.unwatchAccount=qe.client().watchAccount(t=>{if(He.state.isConnected&&!t.isConnected)lt.close();else{const{address:e}=He.state;t.address!==e&&(this.fetchProfile(t.address),this.fetchBalance(t.address)),He.setAddress(t.address)}He.setIsConnected(t.isConnected)})}disconnectedCallback(){var t;(t=this.unwatchAccount)==null||t.call(this)}async fetchProfile(t){var e;const r=(e=le.state.chains)==null?void 0:e.find(n=>n.id===1);if(at.state.enableAccountView&&r)try{await He.fetchProfile(re.preloadImage,t)}catch(n){console.error(n),Ot.openToast(re.getErrorMessage(n),"error")}}async fetchBalance(t){if(at.state.enableAccountView)try{await He.fetchBalance(t)}catch(e){console.error(e),Ot.openToast(re.getErrorMessage(e),"error")}}};tf=T_([de("w3m-account-context")],tf);var R_=Object.defineProperty,N_=Object.getOwnPropertyDescriptor,rf=(t,e,r,n)=>{for(var i=n>1?void 0:n?N_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&R_(e,r,i),i};let Dc=class extends ue{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>re.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){var t;if(at.state.enableExplorer){const{standaloneChains:e,chains:r,walletConnectVersion:n}=le.state,i=e?.join(",");await Promise.all([ct.getPreviewWallets({page:1,entries:10,chains:i,device:De.isMobile()?"mobile":"desktop",version:n}),ct.getRecomendedWallets()]),le.setIsDataLoaded(!0);const{previewWallets:s,recomendedWallets:o}=ct.state,a=(t=r?.map(l=>re.getChainIcon(l.id)))!=null?t:[],c=[...s,...o].map(l=>l.image_url.lg);await this.loadImages([...a,...c])}else le.setIsDataLoaded(!0)}async preloadCustomImages(){const t=re.getCustomImageUrls();await this.loadImages(t)}async preloadConnectorImages(){if(!le.state.isStandalone){const t=re.getConnectorImageUrls();await this.loadImages(t)}}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages(),this.preloadConnectorImages()]))}catch(t){console.error(t),Ot.openToast("Failed preloading","error")}}};rf([Fe()],Dc.prototype,"preload",2),Dc=rf([de("w3m-explorer-context")],Dc);var M_=Object.defineProperty,L_=Object.getOwnPropertyDescriptor,nf=(t,e,r,n)=>{for(var i=n>1?void 0:n?L_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&M_(e,r,i),i};let Oc=class extends ue{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const t=le.getSelectedChain();this.activeChainId=t?.id,this.unwatchNetwork=qe.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(le.setSelectedChain(r),this.activeChainId=r.id,He.resetBalance(),this.fetchBalance())})}disconnectedCallback(){var t;(t=this.unwatchNetwork)==null||t.call(this)}async fetchBalance(){if(at.state.enableAccountView)try{await He.fetchBalance()}catch(t){console.error(t),Ot.openToast(re.getErrorMessage(t),"error")}}};nf([Fe()],Oc.prototype,"activeChainId",2),Oc=nf([de("w3m-network-context")],Oc);var U_=Object.defineProperty,j_=Object.getOwnPropertyDescriptor,F_=(t,e,r,n)=>{for(var i=n>1?void 0:n?j_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&U_(e,r,i),i};let sf=class extends ue{constructor(){super(),this.unsubscribeTheme=void 0,we.setTheme(),this.unsubscribeTheme=fr.subscribe(we.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=fr.state,e=[t?.["--w3m-background-image-url"],t?.["--w3m-logo-image-url"]].filter(Boolean);e.length&&await Promise.all(e.map(async r=>re.preloadImage(r)))}catch{console.info("Unsuccessful attempt at preloading some images")}}};sf=F_([de("w3m-theme-context")],sf);const B_=be`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:var(--w3m-button-border-radius);padding:4px 4px 4px 8px}div button{border-radius:var(--w3m-secondary-button-border-radius);padding:4px 8px;padding-left:4px;height:auto;margin-left:10px;color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}.w3m-no-avatar{padding-left:8px}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var k_=Object.defineProperty,H_=Object.getOwnPropertyDescriptor,$c=(t,e,r,n)=>{for(var i=n>1?void 0:n?H_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&k_(e,r,i),i};let kn=class extends ue{constructor(){super(),this.balance="hide",this.avatar="show",re.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=le.state;t||lt.open({route:"Account"})}accountTemplate(){const t=this.avatar==="show";return V`${t?V`<w3m-avatar></w3m-avatar>`:null}<w3m-address-text></w3m-address-text>`}render(){const t=this.balance==="show",e={"w3m-no-avatar":this.avatar==="hide"};return t?V`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}" class="${Ft(e)}">${this.accountTemplate()}</button></div>`:V`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};kn.styles=[we.globalCss,B_],$c([ye()],kn.prototype,"balance",2),$c([ye()],kn.prototype,"avatar",2),kn=$c([de("w3m-account-button")],kn);const z_=be`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--w3m-color-overlay)}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var W_=Object.defineProperty,q_=Object.getOwnPropertyDescriptor,Ac=(t,e,r,n)=>{for(var i=n>1?void 0:n?q_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&W_(e,r,i),i};let Fi=class extends ue{constructor(){super(),this.chainId="",this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=le.state;this.chainId=t?.id.toString(),this.label=t?.name,this.unsubscribeNetwork=le.subscribe(({selectedChain:e})=>{this.chainId=e?.id.toString(),this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){Ae.push("SelectNetwork")}render(){const{chains:t,selectedChain:e}=le.state,r=t?.map(s=>s.id),n=e&&r?.includes(e.id),i=t&&t.length<=1&&n;return V`<button @click="${this.onClick}" ?disabled="${i}"><w3m-network-image chainId="${Bt(this.chainId)}"></w3m-network-image><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};Fi.styles=[we.globalCss,z_],Ac([Fe()],Fi.prototype,"chainId",2),Ac([Fe()],Fi.prototype,"label",2),Fi=Ac([de("w3m-account-network-button")],Fi);const V_=be`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var K_=Object.defineProperty,G_=Object.getOwnPropertyDescriptor,Bi=(t,e,r,n)=>{for(var i=n>1?void 0:n?G_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&K_(e,r,i),i};let Qr=class extends ue{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=He.state.address,this.name=He.state.profileName,this.loading=!!He.state.profileLoading,this.unsubscribeAccount=He.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;const e=this.variant==="button",r={"w3m-loading":this.loading};return V`<w3m-text class="${Ft(r)}" variant="${e?"medium-regular":"big-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:re.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};Qr.styles=[we.globalCss,V_],Bi([Fe()],Qr.prototype,"address",2),Bi([Fe()],Qr.prototype,"name",2),Bi([Fe()],Qr.prototype,"loading",2),Bi([ye()],Qr.prototype,"variant",2),Qr=Bi([de("w3m-address-text")],Qr);const Lt={allowedExplorerListings(t){const{explorerAllowList:e,explorerDenyList:r}=at.state;let n=[...t];return e&&(n=n.filter(i=>e.includes(i.id))),r&&(n=n.filter(i=>!r.includes(i.id))),n},walletsWithInjected(t){let e=[...t??[]];if(window.ethereum){const r=re.getWalletName("");e=e.filter(({name:n})=>!re.caseSafeIncludes(n,r))}return e},connectorWallets(){const{isStandalone:t}=le.state;if(t)return[];let e=qe.client().getConnectors();return!window.ethereum&&De.isMobile()&&(e=e.filter(({id:r})=>r!=="injected"&&r!==Fn.metaMask)),e},walletTemplatesWithRecent(t,e){let r=[...t];if(e){const n=re.getRecentWallet();r=r.filter(i=>!i.values.includes(n?.name)),r.splice(1,0,e)}return r},deduplicateExplorerListingsFromConnectors(t){const{isStandalone:e}=le.state;if(e)return t;const r=qe.client().getConnectors().map(({name:n})=>n.toUpperCase());return t.filter(({name:n})=>!r.includes(n.toUpperCase()))}},Z_=be`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 10),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px}.w3m-slider::after,.w3m-slider::before{content:'';height:100%;width:50px;z-index:2;position:absolute;background:linear-gradient(to right,var(--w3m-color-bg-1) 0,transparent 100%);top:0}.w3m-slider::before{left:0}.w3m-slider::after{right:0;transform:rotateZ(180deg)}.w3m-track{display:flex;width:calc(70px * 20);animation:scroll 20s linear infinite}.w3m-action{padding:30px 0 10px 0;display:flex;justify-content:center;align-items:center;flex-direction:column}.w3m-action w3m-button-big:last-child{margin-top:10px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;box-shadow:0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08);border-radius:15px}w3m-button-big{margin:0 5px}`;var Y_=Object.defineProperty,J_=Object.getOwnPropertyDescriptor,X_=(t,e,r,n)=>{for(var i=n>1?void 0:n?J_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Y_(e,r,i),i};let Pc=class extends ue{onGoToQrcode(){Ae.push("Qrcode")}onGoToConnectors(){Ae.push("Connectors")}onGoToGetWallet(){Ae.push("GetWallet")}getConnectors(){let t=Lt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==Fn.metaMask)),t}render(){const{previewWallets:t}=ct.state,e=t.length,r=[...t,...t],n=this.getConnectors().length>0;return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ve.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content>${e?V`<div class="w3m-slider"><div class="w3m-track">${r.map(({image_url:i})=>V`<w3m-wallet-image src="${i.lg}"></w3m-wallet-image>`)}</div></div>`:null}<div class="w3m-action"><div><w3m-button-big @click="${re.handleAndroidLinking}"><w3m-text variant="medium-normal" color="inverse">${n?"WalletConnect":"Select Wallet"}</w3m-text></w3m-button-big>${n?V`<w3m-button-big @click="${this.onGoToConnectors}"><w3m-text variant="medium-normal" color="inverse">Other</w3m-text></w3m-button-big>`:null}</div><w3m-button-big variant="secondary" @click="${this.onGoToGetWallet}"><w3m-text variant="medium-regular" color="accent">I don’t have a wallet</w3m-text></w3m-button-big></div></w3m-modal-content>`}};Pc.styles=[we.globalCss,Z_],Pc=X_([de("w3m-android-wallet-selection")],Pc);const Q_=be`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var eE=Object.defineProperty,tE=Object.getOwnPropertyDescriptor,ki=(t,e,r,n)=>{for(var i=n>1?void 0:n?tE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&eE(e,r,i),i};let en=class extends ue{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=He.state.address,this.avatar=He.state.profileAvatar,this.loading=!!He.state.profileLoading,this.unsubscribeAccount=He.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?V`<img class="${Ft(t)}" src="${this.avatar}">`:this.address?(re.generateAvatarColors(this.address),V`<div class="${Ft(t)}">${this.loading?V`<div class="w3m-loader"></div>`:null}</div>`):null}};en.styles=[we.globalCss,Q_],ki([Fe()],en.prototype,"address",2),ki([Fe()],en.prototype,"avatar",2),ki([Fe()],en.prototype,"loading",2),ki([ye()],en.prototype,"size",2),en=ki([de("w3m-avatar")],en);const rE=be`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var nE=Object.defineProperty,iE=Object.getOwnPropertyDescriptor,Tc=(t,e,r,n)=>{for(var i=n>1?void 0:n?iE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&nE(e,r,i),i};let Hi=class extends ue{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=He.state.balance)==null?void 0:t.symbol,this.amount=(e=He.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=He.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"?t=0:typeof this.amount=="string"&&this.amount.length>6?t=parseFloat(this.amount).toFixed(3):typeof this.amount=="string"&&(t=parseFloat(this.amount)),V`<div><w3m-token-image symbol="${Bt(this.symbol)}"></w3m-token-image><w3m-text variant="medium-regular" color="primary">${t} ${this.symbol}</w3m-text></div>`}};Hi.styles=[we.globalCss,rE],Tc([Fe()],Hi.prototype,"symbol",2),Tc([Fe()],Hi.prototype,"amount",2),Hi=Tc([de("w3m-balance")],Hi);const sE=be`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-accent-fill-color)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var oE=Object.defineProperty,aE=Object.getOwnPropertyDescriptor,to=(t,e,r,n)=>{for(var i=n>1?void 0:n?aE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&oE(e,r,i),i};let tn=class extends ue{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,re.rejectStandaloneButtonComponent(),this.modalUnsub=lt.subscribe(t=>{t.open&&(this.loading=!0),t.open||(this.loading=!1)})}disconnectedCallback(){var t;(t=this.modalUnsub)==null||t.call(this)}iconTemplate(){return this.icon==="show"?ve.WALLET_CONNECT_ICON:null}onClick(){He.state.isConnected?this.onDisconnect():this.onConnect()}onConnect(){this.loading=!0;const{enableNetworkView:t}=at.state,{chains:e,selectedChain:r}=le.state,n=e?.length&&e.length>1;t||n&&!r?lt.open({route:"SelectNetwork"}):lt.open({route:"ConnectWallet"})}onDisconnect(){qe.client().disconnect(),He.resetAccount()}render(){return V`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${this.loading?V`<w3m-spinner></w3m-spinner><w3m-text variant="medium-regular" color="accent">Connecting...</w3m-text>`:V`${this.iconTemplate()}<w3m-text variant="medium-regular" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};tn.styles=[we.globalCss,sE],to([Fe()],tn.prototype,"loading",2),to([ye()],tn.prototype,"label",2),to([ye()],tn.prototype,"icon",2),tn=to([de("w3m-connect-button")],tn);var cE=Object.defineProperty,lE=Object.getOwnPropertyDescriptor,Hn=(t,e,r,n)=>{for(var i=n>1?void 0:n?lE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&cE(e,r,i),i};let Or=class extends ue{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.avatar="show",this.balance="hide",this.unsubscribeAccount=void 0,re.rejectStandaloneButtonComponent(),this.isConnected=He.state.isConnected,this.unsubscribeAccount=He.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=at.state,e=Bt(this.balance),r=Bt(this.label),n=Bt(this.icon),i=Bt(this.avatar);return this.isConnected&&t?V`<w3m-account-button balance="${e}" avatar="${i}"></w3m-account-button>`:V`<w3m-connect-button label="${this.isConnected?"Disconnect":r}" icon="${n}"></w3m-connect-button>`}};Hn([Fe()],Or.prototype,"isConnected",2),Hn([ye()],Or.prototype,"label",2),Hn([ye()],Or.prototype,"icon",2),Hn([ye()],Or.prototype,"avatar",2),Hn([ye()],Or.prototype,"balance",2),Or=Hn([de("w3m-core-button")],Or);const hE=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-accent-color)}`;var uE=Object.defineProperty,dE=Object.getOwnPropertyDescriptor,fE=(t,e,r,n)=>{for(var i=n>1?void 0:n?dE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&uE(e,r,i),i};let Rc=class extends ue{onDesktopWallet(t){Ae.push("DesktopConnector",{DesktopConnector:t})}onInjectedWallet(){Ae.push("InjectedConnector")}onInstallConnector(){Ae.push("InstallConnector",{InstallConnector:{id:"metaMask",name:"MetaMask",isMobile:!0,url:"https://metamask.io"}})}async onConnectorWallet(t){window.ethereum?t==="injected"||t===Fn.metaMask?this.onInjectedWallet():await re.handleConnectorConnection(t):this.onInstallConnector()}desktopWalletsTemplate(){const{desktopWallets:t}=at.state;return t?.map(({id:e,name:r,links:{universal:n,native:i}})=>V`<w3m-wallet-button walletId="${e}" name="${r}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n,native:i})}"></w3m-wallet-button>`)}previewWalletsTemplate(){let t=Lt.allowedExplorerListings(ct.state.previewWallets);return t=Lt.deduplicateExplorerListingsFromConnectors(t),t.map(({name:e,desktop:{universal:r,native:n},homepage:i,image_url:s,id:o})=>V`<w3m-wallet-button src="${s.lg}" name="${e}" .onClick="${()=>this.onDesktopWallet({walletId:o,name:e,native:n,universal:r||i,icon:s.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){return Lt.connectorWallets().map(({id:t,name:e,ready:r})=>V`<w3m-wallet-button .installed="${["injected","metaMask"].includes(t)&&r}" name="${e}" walletId="${t}" .onClick="${async()=>this.onConnectorWallet(t)}"></w3m-wallet-button>`)}recentWalletTemplate(){const t=re.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Bt(e)}" src="${Bt(i)}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n?.universal,native:n?.native,icon:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=le.state,e=this.desktopWalletsTemplate(),r=this.previewWalletsTemplate(),n=this.connectorWalletsTemplate(),i=this.recentWalletTemplate(),s=[...e??[],...r],o=[...n,...s],a=Lt.walletTemplatesWithRecent(o,i),c=Lt.walletTemplatesWithRecent(s,i),l=t?c:a,p=l.length>4;let m=[];p?m=l.slice(0,3):m=l;const w=!!m.length;return V`<w3m-modal-header border="${!0}" title="Connect your wallet" .onAction="${re.handleUriCopy}" .actionIcon="${ve.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${ve.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${ve.SCAN_ICON}<w3m-text variant="small-regular" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${w?V`<w3m-modal-footer><div class="w3m-desktop-title">${ve.DESKTOP_ICON}<w3m-text variant="small-regular" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${m} ${p?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};Rc.styles=[we.globalCss,hE],Rc=fE([de("w3m-desktop-wallet-selection")],Rc);const pE=be`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-accent-color);text-decoration:none;transition:opacity .2s ease-in-out}a:hover{opacity:.8}`;var gE=Object.defineProperty,mE=Object.getOwnPropertyDescriptor,wE=(t,e,r,n)=>{for(var i=n>1?void 0:n?mE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&gE(e,r,i),i};let Nc=class extends ue{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=at.state;return t??e?V`<div><w3m-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's<br>${t?V`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?V`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</w3m-text></div>`:null}};Nc.styles=[we.globalCss,pE],Nc=wE([de("w3m-legal-notice")],Nc);const yE=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var bE=Object.defineProperty,vE=Object.getOwnPropertyDescriptor,_E=(t,e,r,n)=>{for(var i=n>1?void 0:n?vE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&bE(e,r,i),i};let Mc=class extends ue{onGoToQrcode(){Ae.push("Qrcode")}async onConnectorWallet(t){await re.handleConnectorConnection(t)}mobileWalletsTemplate(){const{mobileWallets:t}=at.state,e=Lt.walletsWithInjected(t);if(e.length)return e.map(({id:r,name:n,links:{universal:i,native:s}})=>V`<w3m-wallet-button name="${n}" walletId="${r}" .onClick="${async()=>re.handleMobileLinking({links:{native:s,universal:i},name:n,id:r})}"></w3m-wallet-button>`)}previewWalletsTemplate(){const{previewWallets:t}=ct.state;let e=Lt.walletsWithInjected(t);return e=Lt.allowedExplorerListings(e),e=Lt.deduplicateExplorerListingsFromConnectors(e),e.map(({image_url:r,name:n,mobile:{native:i,universal:s},id:o})=>V`<w3m-wallet-button name="${n}" src="${r.lg}" .onClick="${async()=>re.handleMobileLinking({links:{native:i,universal:s},name:n,id:o,image:r.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){let t=Lt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==Fn.metaMask)),t.map(({name:e,id:r,ready:n})=>V`<w3m-wallet-button .installed="${["injected","metaMask"].includes(r)&&n}" name="${e}" walletId="${r}" .onClick="${async()=>this.onConnectorWallet(r)}"></w3m-wallet-button>`)}recentWalletTemplate(){const t=re.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Bt(e)}" src="${Bt(i)}" .onClick="${async()=>re.handleMobileLinking({name:r,id:e,links:n,image:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=le.state,e=this.connectorWalletsTemplate(),r=this.mobileWalletsTemplate(),n=this.previewWalletsTemplate(),i=this.recentWalletTemplate(),s=r??n,o=[...e,...s],a=Lt.walletTemplatesWithRecent(o,i),c=Lt.walletTemplatesWithRecent(s,i),l=t?c:a,p=l.length>8;let m=[];p?m=l.slice(0,7):m=l;const w=m.slice(0,4),y=m.slice(4,8),E=!!m.length;return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ve.QRCODE_ICON}"></w3m-modal-header>${E?V`<w3m-modal-content><div class="w3m-grid">${w} ${y.length?V`${y} ${p?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}`:null}</div></w3m-modal-content>`:null}`}};Mc.styles=[we.globalCss,yE],Mc=_E([de("w3m-mobile-wallet-selection")],Mc);const EE=be`:host{all:initial}.w3m-overlay{inset:0;position:fixed;z-index:var(--w3m-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}@media(max-height:720px) and (orientation:landscape){.w3m-overlay{overflow:scroll;align-items:flex-start}}.w3m-open{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) var(--w3m-container-border-radius) var(--w3m-container-border-radius);border:1px solid var(--w3m-color-overlay);overflow:hidden}.w3m-card{width:100%;position:relative;border-radius:var(--w3m-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) 0 0}.w3m-card{border-radius:var(--w3m-container-border-radius) var(--w3m-container-border-radius) 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:440px){.w3m-container{border:0}}`;var xE=Object.defineProperty,CE=Object.getOwnPropertyDescriptor,of=(t,e,r,n)=>{for(var i=n>1?void 0:n?CE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&xE(e,r,i),i};let zi=class extends ue{constructor(){super(),this.open=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=lt.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return re.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return re.getShadowRootElement(this,".w3m-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("w3m-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="w3m-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&<.close()}async onOpenModalEvent(){this.toggleBodyScroll(!1);const t=.2;await Cr(this.containerEl,{y:0},{duration:0}).finished,Cr(this.overlayEl,{opacity:[0,1]},{duration:.2,delay:t}),Cr(this.containerEl,re.isMobileAnimation()?{y:["50vh",0]}:{scale:[.98,1]},{scale:{easing:js({velocity:.4})},y:{easing:js({mass:.5})},delay:t}),this.addKeyboardEvents(),this.open=!0}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents(),await Promise.all([Cr(this.containerEl,re.isMobileAnimation()?{y:[0,"50vh"]}:{scale:[1,.98]},{scale:{easing:js({velocity:0})},y:{easing:js({mass:.5})}}).finished,Cr(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished]),this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?lt.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}managedModalContextTemplate(){const{isStandalone:t}=le.state;return t?null:V`<w3m-account-context></w3m-account-context><w3m-network-context></w3m-network-context>`}render(){const t={"w3m-overlay":!0,"w3m-open":this.open};return V`<w3m-explorer-context></w3m-explorer-context><w3m-theme-context></w3m-theme-context>${this.managedModalContextTemplate()}<div id="w3m-modal" class="${Ft(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="w3m-container" tabindex="0">${this.open?V`<w3m-modal-backcard></w3m-modal-backcard><div class="w3m-card"><w3m-modal-router></w3m-modal-router><w3m-modal-toast></w3m-modal-toast></div>`:null}</div></div>`}};zi.styles=[we.globalCss,EE],of([Fe()],zi.prototype,"open",2),zi=of([de("w3m-modal")],zi);const IE=be`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var SE=Object.defineProperty,DE=Object.getOwnPropertyDescriptor,ro=(t,e,r,n)=>{for(var i=n>1?void 0:n?DE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&SE(e,r,i),i};let rn=class extends ue{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,re.rejectStandaloneButtonComponent();const{selectedChain:t}=le.state;this.onSetChainData(t),this.unsubscribeNetwork=le.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=le.state,r=e?.map(n=>n.id);this.chainId=t.id.toString(),this.wrongNetwork=!(r!=null&&r.includes(t.id)),this.label=this.wrongNetwork?"Wrong Network":t.name}}onClick(){lt.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=le.state,r=e&&e.length>1;return V`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${Bt(this.chainId)}"></w3m-network-image><w3m-text variant="medium-regular" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};rn.styles=[we.globalCss,IE],ro([Fe()],rn.prototype,"chainId",2),ro([Fe()],rn.prototype,"label",2),ro([Fe()],rn.prototype,"wrongNetwork",2),rn=ro([de("w3m-network-switch")],rn);const OE=be`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--w3m-button-hover-highlight-border-radius);transition:background-color .2s ease;height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--w3m-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:hover{background-color:var(--w3m-color-overlay)}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--w3m-wallet-icon-border-radius)/ 2);border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var $E=Object.defineProperty,AE=Object.getOwnPropertyDescriptor,PE=(t,e,r,n)=>{for(var i=n>1?void 0:n?AE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&$E(e,r,i),i};let Lc=class extends ue{onClick(){Ae.push("WalletExplorer")}render(){const{previewWallets:t}=ct.state,e=re.getCustomWallets(),r=[...t,...e].reverse().slice(0,4);return V`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{var i;const s=(i=n.image_url)==null?void 0:i.lg;if(s)return V`<img src="${s}">`;const o=re.getWalletId(n.id),a=re.getWalletIcon(o);return a?V`<img src="${a}">`:ve.WALLET_PLACEHOLDER})}</div><w3m-text variant="xsmall-regular">View All</w3m-text></button>`}};Lc.styles=[we.globalCss,OE],Lc=PE([de("w3m-view-all-wallets-button")],Lc);const TE=be`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var RE=Object.defineProperty,NE=Object.getOwnPropertyDescriptor,af=(t,e,r,n)=>{for(var i=n>1?void 0:n?NE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&RE(e,r,i),i};let no=class extends ue{constructor(){super(),this.uri="",this.createConnectionAndWait()}get overlayEl(){return re.getShadowRootElement(this,".w3m-qr-container")}async createConnectionAndWait(t=0){var e;De.removeWalletConnectDeepLink();try{const{standaloneUri:r}=le.state;r?setTimeout(()=>this.uri=r,0):(await qe.client().connectWalletConnect(n=>this.uri=n,(e=le.state.selectedChain)==null?void 0:e.id),lt.close())}catch(r){console.error(r),Ot.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}render(){return V`<div class="w3m-qr-container">${this.uri?V`<w3m-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}"></w3m-qrcode>`:V`<w3m-spinner></w3m-spinner>`}</div>`}};no.styles=[we.globalCss,TE],af([Fe()],no.prototype,"uri",2),no=af([de("w3m-walletconnect-qr")],no);const ME=be`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-success-color);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-success-color),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var LE=Object.defineProperty,UE=Object.getOwnPropertyDescriptor,jE=(t,e,r,n)=>{for(var i=n>1?void 0:n?UE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&LE(e,r,i),i};let Uc=class extends ue{onDisconnect(){lt.close(),qe.client().disconnect(),He.resetAccount()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=He.state.address)!=null?t:""),Ot.openToast("Address copied","success")}render(){return V`<w3m-modal-content><div class="w3m-profile"><div class="w3m-info"><w3m-avatar size="medium"></w3m-avatar><w3m-address-text variant="modal"></w3m-address-text></div><div class="w3m-connection-badge"><w3m-text variant="small-regular" color="secondary">Connected</w3m-text></div></div></w3m-modal-content><div class="w3m-balance"><w3m-balance></w3m-balance></div><w3m-modal-footer><div class="w3m-footer"><w3m-account-network-button></w3m-account-network-button><w3m-box-button label="Copy Address" .onClick="${this.onCopyAddress}" .icon="${ve.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${ve.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};Uc.styles=[we.globalCss,ME],Uc=jE([de("w3m-account-view")],Uc);var FE=Object.defineProperty,BE=Object.getOwnPropertyDescriptor,kE=(t,e,r,n)=>{for(var i=n>1?void 0:n?BE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&FE(e,r,i),i};let jc=class extends ue{viewTemplate(){return De.isAndroid()?V`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:De.isMobile()?V`<w3m-mobile-wallet-selection></w3m-mobile-wallet-selection>`:V`<w3m-desktop-wallet-selection></w3m-desktop-wallet-selection>`}render(){return V`${this.viewTemplate()}<w3m-legal-notice></w3m-legal-notice>`}};jc.styles=[we.globalCss],jc=kE([de("w3m-connect-wallet-view")],jc);const HE=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}`;var zE=Object.defineProperty,WE=Object.getOwnPropertyDescriptor,qE=(t,e,r,n)=>{for(var i=n>1?void 0:n?WE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&zE(e,r,i),i};let Fc=class extends ue{async onConnectorWallet(t){await re.handleConnectorConnection(t)}connectorWalletsTemplate(){let t=Lt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==Fn.metaMask)),t.map(({name:e,id:r,ready:n})=>V`<w3m-wallet-button .installed="${["injected","metaMask"].includes(r)&&n}" name="${e}" walletId="${r}" .onClick="${async()=>this.onConnectorWallet(r)}"></w3m-wallet-button>`)}render(){const t=this.connectorWalletsTemplate();return V`<w3m-modal-header title="Other wallets"></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${t}</div></w3m-modal-content>`}};Fc.styles=[we.globalCss,HE],Fc=qE([de("w3m-connectors-view")],Fc);const VE=be`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-border-radius);width:25%;aspect-ratio:1/1;margin-bottom:20px}.w3m-install-actions{display:flex}.w3m-install-actions w3m-button{margin:0 5px;opacity:1}`;var KE=Object.defineProperty,GE=Object.getOwnPropertyDescriptor,cf=(t,e,r,n)=>{for(var i=n>1?void 0:n?GE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&KE(e,r,i),i};let io=class extends ue{constructor(){super(),this.uri="",this.createConnectionAndWait()}getRouterData(){var t;const e=(t=Ae.state.data)==null?void 0:t.DesktopConnector;if(!e)throw new Error("Missing router data");return e}onFormatAndRedirect(t){const{native:e,universal:r,name:n}=this.getRouterData();if(e){const i=De.formatNativeUrl(e,t,n);De.openHref(i,"_self")}else if(r){const i=De.formatUniversalUrl(r,t,n);De.openHref(i,"_blank")}}async createConnectionAndWait(t=0){var e;De.removeWalletConnectDeepLink();const{standaloneUri:r}=le.state,{name:n,walletId:i,native:s,universal:o,icon:a}=this.getRouterData(),c={name:n,id:i,links:{native:s,universal:o},image:a};if(r)re.setRecentWallet(c),this.onFormatAndRedirect(r);else try{await qe.client().connectWalletConnect(l=>{this.uri=l,this.onFormatAndRedirect(l)},(e=le.state.selectedChain)==null?void 0:e.id),re.setRecentWallet(c),lt.close()}catch{Ot.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}onConnectWithMobile(){Ae.push("Qrcode")}onGoToWallet(){const{universal:t,name:e}=this.getRouterData();if(t){const r=De.formatUniversalUrl(t,this.uri,e);De.openHref(r,"_blank")}}render(){const{name:t,icon:e,universal:r,walletId:n}=this.getRouterData(),i=re.getWalletName(t);return V`<w3m-modal-header title="${i}"></w3m-modal-header><w3m-modal-content><div class="w3m-wrapper">${e?V`<w3m-wallet-image src="${e}" size="lg"></w3m-wallet-image>`:V`<w3m-wallet-image size="lg" walletid="${Bt(n)}"></w3m-wallet-image>`}<div class="w3m-connecting-title"><w3m-spinner></w3m-spinner><w3m-text variant="big-bold" color="secondary">${`Continue in ${i}...`}</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${async()=>this.createConnectionAndWait()}" .iconRight="${ve.RETRY_ICON}">Retry</w3m-button>${r?V`<w3m-button .onClick="${this.onGoToWallet.bind(this)}" .iconLeft="${ve.ARROW_UP_RIGHT_ICON}">Go to Wallet</w3m-button>`:V`<w3m-button .onClick="${this.onConnectWithMobile}" .iconLeft="${ve.MOBILE_ICON}">Connect with Mobile</w3m-button>`}</div></div></w3m-modal-content>`}};io.styles=[we.globalCss,VE],cf([Fe()],io.prototype,"uri",2),io=cf([de("w3m-desktop-connector-view")],io);const ZE=be`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var YE=Object.defineProperty,JE=Object.getOwnPropertyDescriptor,XE=(t,e,r,n)=>{for(var i=n>1?void 0:n?JE(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&YE(e,r,i),i};let Bc=class extends ue{onGet(t){De.openHref(t,"_blank")}render(){const{recomendedWallets:t}=ct.state,e=re.getCustomWallets().slice(0,6),r=t.length,n=e.length;return V`<w3m-modal-header title="Get a wallet"></w3m-modal-header><w3m-modal-content>${r?t.map(({name:i,image_url:s,homepage:o})=>V`<div class="w3m-wallet-item"><w3m-wallet-image src="${s.lg}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i}</w3m-text><w3m-button .iconRight="${ve.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(o)}">Get</w3m-button></div></div>`):null} ${n?e.map(({name:i,id:s,links:o})=>V`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${s}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i}</w3m-text><w3m-button .iconRight="${ve.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(o.universal)}">Get</w3m-button></div></div>`):null}</w3m-modal-content><div class="w3m-footer-actions"><w3m-text variant="medium-regular">Not what you're looking for?</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With hundreds of wallets out there, there's something for everyone</w3m-text><w3m-button .onClick="${re.openWalletExplorerUrl}" .iconRight="${ve.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Bc.styles=[we.globalCss,ZE],Bc=XE([de("w3m-get-wallet-view")],Bc);const QE=be`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;var e7=Object.defineProperty,t7=Object.getOwnPropertyDescriptor,r7=(t,e,r,n)=>{for(var i=n>1?void 0:n?t7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&e7(e,r,i),i};let kc=class extends ue{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){at.state.enableExplorer?Ae.push("GetWallet"):re.openWalletExplorerUrl()}onLearnMore(){De.openHref(this.learnUrl,"_blank")}render(){return V`<w3m-modal-header title="What is a wallet?"></w3m-modal-header><w3m-modal-content><div class="w3m-info-container"><div class="w3m-images">${ve.HELP_CHART_IMG} ${ve.HELP_PAINTING_IMG} ${ve.HELP_ETH_IMG}</div><w3m-text variant="medium-regular">A home for your digital assets</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${ve.HELP_KEY_IMG} ${ve.HELP_USER_IMG} ${ve.HELP_LOCK_IMG}</div><w3m-text variant="medium-regular">One login for all of web3</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">Log in to any app by connecting your wallet. Say goodbye to countless passwords!</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${ve.HELP_COMPAS_IMG} ${ve.HELP_NOUN_IMG} ${ve.HELP_DAO_IMG}</div><w3m-text variant="medium-regular">Your gateway to a new web</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.</w3m-text></div><div class="w3m-footer-actions"><w3m-button .onClick="${this.onGet.bind(this)}" .iconLeft="${ve.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${ve.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};kc.styles=[we.globalCss,QE],kc=r7([de("w3m-help-view")],kc);const n7=be`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:20px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-border-radius);width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-injected-error w3m-button{opacity:1}`;var i7=Object.defineProperty,s7=Object.getOwnPropertyDescriptor,Hc=(t,e,r,n)=>{for(var i=n>1?void 0:n?s7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&i7(e,r,i),i};let Wi=class extends ue{constructor(){super(),this.connecting=!0,this.error=!1,this.connector=qe.client().getConnectorById("injected"),this.onConnect()}async onConnect(){const{ready:t}=this.connector;t&&(this.error=!1,this.connecting=!0,await re.handleConnectorConnection("injected",()=>{this.error=!0,this.connecting=!1}))}render(){const t=re.getWalletName(this.connector.name),e=re.getWalletId(this.connector.id),r={"w3m-injected-wrapper":!0,"w3m-injected-error":this.error};return V`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><div class="${Ft(r)}"><w3m-wallet-image walletId="${e}" size="lg"></w3m-wallet-image><div class="w3m-connecting-title">${this.connecting?V`<w3m-spinner></w3m-spinner>`:null}<w3m-text variant="big-bold" color="${this.error?"error":"secondary"}">${this.error?"Connection declined":`Continue in ${t}...`}</w3m-text></div><w3m-button .onClick="${this.onConnect.bind(this)}" .disabled="${!this.error}" .iconRight="${ve.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Wi.styles=[we.globalCss,n7],Hc([Fe()],Wi.prototype,"connecting",2),Hc([Fe()],Wi.prototype,"error",2),Wi=Hc([de("w3m-injected-connector-view")],Wi);const o7=be`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}.w3m-install-title{display:flex;align-items:center;justify-content:center;flex-direction:column}.w3m-install-title w3m-text:last-child{margin-top:10px;max-width:240px}.w3m-install-actions{display:flex;margin-top:15px;align-items:center;flex-direction:column}@media(max-width:355px){.w3m-install-actions{flex-direction:column;align-items:center}}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-install-actions w3m-button{margin:5px;opacity:1}.w3m-info-text{text-align:center}`;var a7=Object.defineProperty,c7=Object.getOwnPropertyDescriptor,l7=(t,e,r,n)=>{for(var i=n>1?void 0:n?c7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&a7(e,r,i),i};let zc=class extends ue{getRouterData(){var t;const e=(t=Ae.state.data)==null?void 0:t.InstallConnector;if(!e)throw new Error("Missing router data");return e}onInstall(){const{url:t}=this.getRouterData();De.openHref(t,"_blank")}onMobile(){const{name:t}=this.getRouterData();Ae.push("ConnectWallet"),Ot.openToast(`Scan the code with ${t}`,"success")}render(){const{name:t,id:e,isMobile:r}=this.getRouterData();return V`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><div class="w3m-injected-wrapper"><w3m-wallet-image walletId="${e}" size="lg"></w3m-wallet-image><div class="w3m-install-title"><w3m-text variant="big-bold">Install ${t}</w3m-text><w3m-text color="secondary" variant="small-thin" class="w3m-info-text">To connect ${t}, install the browser extension.</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${this.onInstall.bind(this)}" .iconLeft="${ve.ARROW_DOWN_ICON}">Install Extension</w3m-button>${r?V`<w3m-button .onClick="${this.onMobile.bind(this)}" .iconLeft="${ve.MOBILE_ICON}">${t} Mobile</w3m-button>`:null}</div></div></w3m-modal-content>`}};zc.styles=[we.globalCss,o7],zc=l7([de("w3m-install-connector-view")],zc);var h7=Object.defineProperty,u7=Object.getOwnPropertyDescriptor,d7=(t,e,r,n)=>{for(var i=n>1?void 0:n?u7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&h7(e,r,i),i};let Wc=class extends ue{render(){return V`<w3m-modal-header title="Scan the code" .onAction="${re.handleUriCopy}" .actionIcon="${ve.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Wc.styles=[we.globalCss],Wc=d7([de("w3m-qrcode-view")],Wc);const f7=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}`;var p7=Object.defineProperty,g7=Object.getOwnPropertyDescriptor,m7=(t,e,r,n)=>{for(var i=n>1?void 0:n?g7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&p7(e,r,i),i};let qc=class extends ue{async onSelectChain(t){try{const{selectedChain:e,walletConnectVersion:r}=le.state,{isConnected:n}=He.state;n?e?.id===t.id?Ae.replace("Account"):r===2?(await qe.client().switchNetwork({chainId:t.id}),Ae.replace("Account")):Ae.push("SwitchNetwork",{SwitchNetwork:t}):(Ae.push("ConnectWallet"),le.setSelectedChain(t))}catch(e){console.error(e),Ot.openToast(re.getErrorMessage(e),"error")}}render(){const{chains:t}=le.state;return V`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${t?.map(e=>V`<w3m-network-button name="${e.name}" chainId="${e.id}" .onClick="${async()=>this.onSelectChain(e)}">${e.name}</w3m-network-button>`)}</div></w3m-modal-content>`}};qc.styles=[we.globalCss,f7],qc=m7([de("w3m-select-network-view")],qc);const w7=be`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-network-image{width:96px;height:96px;margin-bottom:20px}w3m-button{opacity:0}.w3m-error w3m-button{opacity:1}`;var y7=Object.defineProperty,b7=Object.getOwnPropertyDescriptor,lf=(t,e,r,n)=>{for(var i=n>1?void 0:n?b7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&y7(e,r,i),i};let so=class extends ue{constructor(){super(),this.error=!1,this.onSwitchNetwork()}getRouterData(){var t;const e=(t=Ae.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error("Missing router data");return e}async onSwitchNetwork(){try{this.error=!1;const t=this.getRouterData();await qe.client().switchNetwork({chainId:t.id}),le.setSelectedChain(t),Ae.replace("Account")}catch{this.error=!0}}render(){const{id:t,name:e}=this.getRouterData(),r={"w3m-wrapper":!0,"w3m-error":this.error};return V`<w3m-modal-header title="${`Connect to ${e}`}"></w3m-modal-header><w3m-modal-content><div class="${Ft(r)}"><w3m-network-image chainId="${t}"></w3m-network-image><div class="w3m-connecting-title">${this.error?null:V`<w3m-spinner></w3m-spinner>`}<w3m-text variant="big-bold" color="${this.error?"error":"secondary"}">${this.error?"Connection declined":"Approve in your wallet"}</w3m-text></div><w3m-button .onClick="${this.onSwitchNetwork.bind(this)}" .disabled="${!this.error}" .iconRight="${ve.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};so.styles=[we.globalCss,w7],lf([Fe()],so.prototype,"error",2),so=lf([de("w3m-switch-network-view")],so);const v7=be`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var _7=Object.defineProperty,E7=Object.getOwnPropertyDescriptor,qi=(t,e,r,n)=>{for(var i=n>1?void 0:n?E7(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&_7(e,r,i),i};const Vc=40;let nn=class extends ue{constructor(){super(...arguments),this.loading=!ct.state.wallets.listings.length,this.firstFetch=!ct.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=re.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,ct.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),ct.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return re.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=ct.state,{listings:r,total:n}=this.search?e:t;return n<=Vc||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r}=ct.state,n=re.getExtensionWallets(),{listings:i,total:s,page:o}=this.search?r:e;if(!this.endReached&&(this.firstFetch||s>Vc&&i.length<s))try{this.loading=!0;const a=(t=le.state.standaloneChains)==null?void 0:t.join(","),{listings:c}=await ct.getPaginatedWallets({page:this.firstFetch?1:o+1,entries:Vc,device:De.isMobile()?"mobile":"desktop",search:this.search,version:le.state.walletConnectVersion,chains:a}),l=c.map(({image_url:m})=>m.lg),p=n.map(({id:m})=>re.getWalletIcon(m));await Promise.all([...l.map(async m=>re.preloadImage(m)),...p.map(async m=>re.preloadImage(m)),De.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),Ot.openToast(re.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnectCustom({name:t,id:e,links:r}){De.isMobile()?re.handleMobileLinking({links:r,name:t,id:e}):Ae.push("DesktopConnector",{DesktopConnector:{name:t,walletId:e,universal:r.universal,native:r.native}})}onConnectListing(t){if(De.isMobile()){const{id:e,image_url:r}=t,{native:n,universal:i}=t.mobile;re.handleMobileLinking({links:{native:n,universal:i},name:t.name,id:e,image:r.lg})}else Ae.push("DesktopConnector",{DesktopConnector:{name:t.name,icon:t.image_url.lg,universal:t.desktop.universal||t.homepage,native:t.desktop.native}})}onConnectExtension(t){re.getWalletId("")===t.id?Ae.push("InjectedConnector"):Ae.push("InstallConnector",{InstallConnector:t})}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=ct.state,{isStandalone:r}=le.state;let{listings:n}=this.search?e:t;n=Lt.allowedExplorerListings(n);const i=this.loading&&!n.length,s=this.search.length>=3;let o=!r&&!De.isMobile()?re.getExtensionWallets():[],a=re.getCustomWallets();s&&(o=o.filter(({name:m})=>re.caseSafeIncludes(m,this.search)),a=a.filter(({name:m})=>re.caseSafeIncludes(m,this.search)));const c=!this.loading&&!n.length&&!o.length,l=Math.max(o.length,n.length),p={"w3m-loading":i,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":c};return V`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Ft(p)}"><div class="w3m-grid">${i?null:[...Array(l)].map((m,w)=>V`${a[w]?V`<w3m-wallet-button name="${a[w].name}" walletId="${a[w].id}" .onClick="${()=>this.onConnectCustom(a[w])}"></w3m-wallet-button>`:null} ${o[w]?V`<w3m-wallet-button name="${o[w].name}" walletId="${o[w].id}" .onClick="${()=>this.onConnectExtension(o[w])}"></w3m-wallet-button>`:null} ${n[w]?V`<w3m-wallet-button src="${n[w].image_url.lg}" name="${n[w].name}" walletId="${n[w].id}" .onClick="${()=>this.onConnectListing(n[w])}"></w3m-wallet-button>`:null}`)}</div><div class="w3m-placeholder-block">${c?V`<w3m-text variant="big-bold" color="secondary">No results found</w3m-text>`:null} ${!c&&this.loading?V`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};nn.styles=[we.globalCss,v7],qi([Fe()],nn.prototype,"loading",2),qi([Fe()],nn.prototype,"firstFetch",2),qi([Fe()],nn.prototype,"search",2),qi([Fe()],nn.prototype,"endReached",2),nn=qi([de("w3m-wallet-explorer-view")],nn);var x7=Object.freeze({__proto__:null,get W3mAccountButton(){return kn},get W3mConnectButton(){return tn},get W3mCoreButton(){return Or},get W3mModal(){return zi},get W3mNetworkSwitch(){return rn}});Xt.EthereumProvider=Bv,Xt.OPTIONAL_EVENTS=Rv,Xt.OPTIONAL_METHODS=Tv,Xt.REQUIRED_EVENTS=xs,Xt.REQUIRED_METHODS=Es,Xt.default=Cs,Object.defineProperty(Xt,"__esModule",{value:!0})});
|
|
133
133
|
//# sourceMappingURL=index.umd.js.map
|