@walletconnect/ethereum-provider 2.3.2 → 2.3.3
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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +22 -22
- package/dist/index.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/EthereumProvider.d.ts +4 -1
- package/dist/types/EthereumProvider.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Or,ut){typeof exports=="object"&&typeof module<"u"?ut(exports):typeof define=="function"&&define.amd?define(["exports"],ut):(Or=typeof globalThis<"u"?globalThis:Or||self,ut(Or["@walletconnect/ethereum-provider"]={}))})(this,function(Or){"use strict";var ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Id(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ar(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 vt={exports:{}},on=typeof Reflect=="object"?Reflect:null,Oc=on&&typeof on.apply=="function"?on.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},ki;on&&typeof on.ownKeys=="function"?ki=on.ownKeys:Object.getOwnPropertySymbols?ki=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:ki=function(e){return Object.getOwnPropertyNames(e)};function Od(t){console&&console.warn&&console.warn(t)}var Ac=Number.isNaN||function(e){return e!==e};function ke(){ke.init.call(this)}vt.exports=ke,vt.exports.once=Td,ke.EventEmitter=ke,ke.prototype._events=void 0,ke.prototype._eventsCount=0,ke.prototype._maxListeners=void 0;var $c=10;function Hi(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 $c},set:function(t){if(typeof t!="number"||t<0||Ac(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");$c=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||Ac(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 Pc(t){return t._maxListeners===void 0?ke.defaultMaxListeners:t._maxListeners}ke.prototype.getMaxListeners=function(){return Pc(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")Oc(c,this,r);else for(var l=c.length,p=Mc(c,l),n=0;n<l;++n)Oc(p[n],this,r);return!0};function Tc(t,e,r,n){var i,s,o;if(Hi(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=Pc(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,Od(a)}return t}ke.prototype.addListener=function(e,r){return Tc(this,e,r,!1)},ke.prototype.on=ke.prototype.addListener,ke.prototype.prependListener=function(e,r){return Tc(this,e,r,!0)};function Ad(){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 Rc(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Ad.bind(n);return i.listener=r,n.wrapFn=i,i}ke.prototype.once=function(e,r){return Hi(r),this.on(e,Rc(this,e,r)),this},ke.prototype.prependOnceListener=function(e,r){return Hi(r),this.prependListener(e,Rc(this,e,r)),this},ke.prototype.removeListener=function(e,r){var n,i,s,o,a;if(Hi(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():$d(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 Nc(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?Pd(i):Mc(i,i.length)}ke.prototype.listeners=function(e){return Nc(this,e,!0)},ke.prototype.rawListeners=function(e){return Nc(this,e,!1)},ke.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Lc.call(t,e)},ke.prototype.listenerCount=Lc;function Lc(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 Mc(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function $d(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Pd(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Td(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))}Uc(t,e,s,{once:!0}),e!=="error"&&Rd(t,i,{once:!0})})}function Rd(t,e,r){typeof t.on=="function"&&Uc(t,"error",e,r)}function Uc(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 to={},zi={},_e={},Fc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,p=a&65535,w=c>>>16&65535,m=c&65535;return p*m+(l*m+p*w<<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}})(Fc),Object.defineProperty(_e,"__esModule",{value:!0});var Bc=Fc;function Nd(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}_e.readInt16BE=Nd;function Ld(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}_e.readUint16BE=Ld;function Md(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}_e.readInt16LE=Md;function Ud(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}_e.readUint16LE=Ud;function jc(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=jc,_e.writeInt16BE=jc;function kc(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=kc,_e.writeInt16LE=kc;function ro(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}_e.readInt32BE=ro;function no(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=no;function io(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}_e.readInt32LE=io;function so(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=so;function Wi(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=Wi,_e.writeInt32BE=Wi;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 Fd(t,e){e===void 0&&(e=0);var r=ro(t,e),n=ro(t,e+4);return r*4294967296+n-(n>>31)*4294967296}_e.readInt64BE=Fd;function Bd(t,e){e===void 0&&(e=0);var r=no(t,e),n=no(t,e+4);return r*4294967296+n}_e.readUint64BE=Bd;function jd(t,e){e===void 0&&(e=0);var r=io(t,e),n=io(t,e+4);return n*4294967296+r-(r>>31)*4294967296}_e.readInt64LE=jd;function kd(t,e){e===void 0&&(e=0);var r=so(t,e),n=so(t,e+4);return n*4294967296+r}_e.readUint64LE=kd;function Hc(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Wi(t/4294967296>>>0,e,r),Wi(t>>>0,e,r+4),e}_e.writeUint64BE=Hc,_e.writeInt64BE=Hc;function zc(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=zc,_e.writeInt64LE=zc;function Hd(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=Hd;function zd(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=zd;function Wd(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(!Bc.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=Wd;function qd(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(!Bc.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=qd;function Vd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}_e.readFloat32BE=Vd;function Kd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}_e.readFloat32LE=Kd;function Gd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}_e.readFloat64BE=Gd;function Zd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}_e.readFloat64LE=Zd;function Yd(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=Yd;function Jd(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=Jd;function Xd(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=Xd;function Qd(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=Qd;var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});function ef(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Mt.wipe=ef,Object.defineProperty(zi,"__esModule",{value:!0});var St=_e,oo=Mt,tf=20;function rf(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],w=r[19]<<24|r[18]<<16|r[17]<<8|r[16],m=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],x=e[15]<<24|e[14]<<16|e[13]<<8|e[12],O=n,_=i,D=s,I=o,h=a,v=c,H=l,j=p,q=w,X=m,re=y,C=E,A=T,G=R,K=L,W=x,z=0;z<tf;z+=2)O=O+h|0,A^=O,A=A>>>32-16|A<<16,q=q+A|0,h^=q,h=h>>>32-12|h<<12,_=_+v|0,G^=_,G=G>>>32-16|G<<16,X=X+G|0,v^=X,v=v>>>32-12|v<<12,D=D+H|0,K^=D,K=K>>>32-16|K<<16,re=re+K|0,H^=re,H=H>>>32-12|H<<12,I=I+j|0,W^=I,W=W>>>32-16|W<<16,C=C+W|0,j^=C,j=j>>>32-12|j<<12,D=D+H|0,K^=D,K=K>>>32-8|K<<8,re=re+K|0,H^=re,H=H>>>32-7|H<<7,I=I+j|0,W^=I,W=W>>>32-8|W<<8,C=C+W|0,j^=C,j=j>>>32-7|j<<7,_=_+v|0,G^=_,G=G>>>32-8|G<<8,X=X+G|0,v^=X,v=v>>>32-7|v<<7,O=O+h|0,A^=O,A=A>>>32-8|A<<8,q=q+A|0,h^=q,h=h>>>32-7|h<<7,O=O+v|0,W^=O,W=W>>>32-16|W<<16,re=re+W|0,v^=re,v=v>>>32-12|v<<12,_=_+H|0,A^=_,A=A>>>32-16|A<<16,C=C+A|0,H^=C,H=H>>>32-12|H<<12,D=D+j|0,G^=D,G=G>>>32-16|G<<16,q=q+G|0,j^=q,j=j>>>32-12|j<<12,I=I+h|0,K^=I,K=K>>>32-16|K<<16,X=X+K|0,h^=X,h=h>>>32-12|h<<12,D=D+j|0,G^=D,G=G>>>32-8|G<<8,q=q+G|0,j^=q,j=j>>>32-7|j<<7,I=I+h|0,K^=I,K=K>>>32-8|K<<8,X=X+K|0,h^=X,h=h>>>32-7|h<<7,_=_+H|0,A^=_,A=A>>>32-8|A<<8,C=C+A|0,H^=C,H=H>>>32-7|H<<7,O=O+v|0,W^=O,W=W>>>32-8|W<<8,re=re+W|0,v^=re,v=v>>>32-7|v<<7;St.writeUint32LE(O+n|0,t,0),St.writeUint32LE(_+i|0,t,4),St.writeUint32LE(D+s|0,t,8),St.writeUint32LE(I+o|0,t,12),St.writeUint32LE(h+a|0,t,16),St.writeUint32LE(v+c|0,t,20),St.writeUint32LE(H+l|0,t,24),St.writeUint32LE(j+p|0,t,28),St.writeUint32LE(q+w|0,t,32),St.writeUint32LE(X+m|0,t,36),St.writeUint32LE(re+y|0,t,40),St.writeUint32LE(C+E|0,t,44),St.writeUint32LE(A+T|0,t,48),St.writeUint32LE(G+R|0,t,52),St.writeUint32LE(K+L|0,t,56),St.writeUint32LE(W+x|0,t,60)}function Wc(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){rf(a,s,t);for(var l=c;l<c+64&&l<r.length;l++)n[l]=r[l]^a[l-c];sf(s,0,o)}return oo.wipe(a),i===0&&oo.wipe(s),n}zi.streamXOR=Wc;function nf(t,e,r,n){return n===void 0&&(n=0),oo.wipe(r),Wc(t,e,r,r,n)}zi.stream=nf;function sf(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 qc={},pr={};Object.defineProperty(pr,"__esModule",{value:!0});function of(t,e,r){return~(t-1)&e|t-1&r}pr.select=of;function af(t,e){return(t|0)-(e|0)-1>>>31&1}pr.lessOrEqual=af;function Vc(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}pr.compare=Vc;function cf(t,e){return t.length===0||e.length===0?!1:Vc(t,e)!==0}pr.equal=cf,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=pr,r=Mt;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 w=a[6]|a[7]<<8;this._r[3]=(p>>>7|w<<9)&8191;var m=a[8]|a[9]<<8;this._r[4]=(w>>>4|m<<12)&255,this._r[5]=m>>>1&8190;var y=a[10]|a[11]<<8;this._r[6]=(m>>>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,w=this._h[0],m=this._h[1],y=this._h[2],E=this._h[3],T=this._h[4],R=this._h[5],L=this._h[6],x=this._h[7],O=this._h[8],_=this._h[9],D=this._r[0],I=this._r[1],h=this._r[2],v=this._r[3],H=this._r[4],j=this._r[5],q=this._r[6],X=this._r[7],re=this._r[8],C=this._r[9];l>=16;){var A=a[c+0]|a[c+1]<<8;w+=A&8191;var G=a[c+2]|a[c+3]<<8;m+=(A>>>13|G<<3)&8191;var K=a[c+4]|a[c+5]<<8;y+=(G>>>10|K<<6)&8191;var W=a[c+6]|a[c+7]<<8;E+=(K>>>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 Z=a[c+12]|a[c+13]<<8;x+=(J>>>11|Z<<5)&8191;var ue=a[c+14]|a[c+15]<<8;O+=(Z>>>8|ue<<8)&8191,_+=ue>>>5|p;var Q=0,fe=Q;fe+=w*D,fe+=m*(5*C),fe+=y*(5*re),fe+=E*(5*X),fe+=T*(5*q),Q=fe>>>13,fe&=8191,fe+=R*(5*j),fe+=L*(5*H),fe+=x*(5*v),fe+=O*(5*h),fe+=_*(5*I),Q+=fe>>>13,fe&=8191;var ae=Q;ae+=w*I,ae+=m*D,ae+=y*(5*C),ae+=E*(5*re),ae+=T*(5*X),Q=ae>>>13,ae&=8191,ae+=R*(5*q),ae+=L*(5*j),ae+=x*(5*H),ae+=O*(5*v),ae+=_*(5*h),Q+=ae>>>13,ae&=8191;var Ce=Q;Ce+=w*h,Ce+=m*I,Ce+=y*D,Ce+=E*(5*C),Ce+=T*(5*re),Q=Ce>>>13,Ce&=8191,Ce+=R*(5*X),Ce+=L*(5*q),Ce+=x*(5*j),Ce+=O*(5*H),Ce+=_*(5*v),Q+=Ce>>>13,Ce&=8191;var B=Q;B+=w*v,B+=m*h,B+=y*I,B+=E*D,B+=T*(5*C),Q=B>>>13,B&=8191,B+=R*(5*re),B+=L*(5*X),B+=x*(5*q),B+=O*(5*j),B+=_*(5*H),Q+=B>>>13,B&=8191;var F=Q;F+=w*H,F+=m*v,F+=y*h,F+=E*I,F+=T*D,Q=F>>>13,F&=8191,F+=R*(5*C),F+=L*(5*re),F+=x*(5*X),F+=O*(5*q),F+=_*(5*j),Q+=F>>>13,F&=8191;var N=Q;N+=w*j,N+=m*H,N+=y*v,N+=E*h,N+=T*I,Q=N>>>13,N&=8191,N+=R*D,N+=L*(5*C),N+=x*(5*re),N+=O*(5*X),N+=_*(5*q),Q+=N>>>13,N&=8191;var f=Q;f+=w*q,f+=m*j,f+=y*H,f+=E*v,f+=T*h,Q=f>>>13,f&=8191,f+=R*I,f+=L*D,f+=x*(5*C),f+=O*(5*re),f+=_*(5*X),Q+=f>>>13,f&=8191;var $=Q;$+=w*X,$+=m*q,$+=y*j,$+=E*H,$+=T*v,Q=$>>>13,$&=8191,$+=R*h,$+=L*I,$+=x*D,$+=O*(5*C),$+=_*(5*re),Q+=$>>>13,$&=8191;var ee=Q;ee+=w*re,ee+=m*X,ee+=y*q,ee+=E*j,ee+=T*H,Q=ee>>>13,ee&=8191,ee+=R*v,ee+=L*h,ee+=x*I,ee+=O*D,ee+=_*(5*C),Q+=ee>>>13,ee&=8191;var ne=Q;ne+=w*C,ne+=m*re,ne+=y*X,ne+=E*q,ne+=T*j,Q=ne>>>13,ne&=8191,ne+=R*H,ne+=L*v,ne+=x*h,ne+=O*I,ne+=_*D,Q+=ne>>>13,ne&=8191,Q=(Q<<2)+Q|0,Q=Q+fe|0,fe=Q&8191,Q=Q>>>13,ae+=Q,w=fe,m=ae,y=Ce,E=B,T=F,R=N,L=f,x=$,O=ee,_=ne,c+=16,l-=16}this._h[0]=w,this._h[1]=m,this._h[2]=y,this._h[3]=E,this._h[4]=T,this._h[5]=R,this._h[6]=L,this._h[7]=x,this._h[8]=O,this._h[9]=_},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),p,w,m,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,w=(p^1)-1,y=0;y<10;y++)l[y]&=w;for(w=~w,y=0;y<10;y++)this._h[y]=this._h[y]&w|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,m=this._h[0]+this._pad[0],this._h[0]=m&65535,y=1;y<8;y++)m=(this._h[y]+this._pad[y]|0)+(m>>>16)|0,this._h[y]=m&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 w=0;w<p;w++)this._buffer[this._leftover+w]=a[c+w];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 w=0;w<l;w++)this._buffer[this._leftover+w]=a[c+w];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}(qc),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=zi,r=qc,n=Mt,i=_e,s=pr;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,w,m){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(m){if(m.length!==T)throw new Error("ChaCha20Poly1305: incorrect destination length");R=m}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),w),n.wipe(y),R},c.prototype.open=function(l,p,w,m){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),w),!s.equal(T,p.subarray(p.length-this.tagLength,p.length)))return null;var R=p.length-this.tagLength,L;if(m){if(m.length!==R)throw new Error("ChaCha20Poly1305: incorrect destination length");L=m}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,w,m){var y=new r.Poly1305(p);m&&(y.update(m),m.length%16>0&&y.update(o.subarray(m.length%16))),y.update(w),w.length%16>0&&y.update(o.subarray(w.length%16));var E=new Uint8Array(8);m&&i.writeUint64LE(m.length,E),y.update(E),i.writeUint64LE(w.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}(to);var Kc={},Rn={},ao={};Object.defineProperty(ao,"__esModule",{value:!0});function lf(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}ao.isSerializableHash=lf,Object.defineProperty(Rn,"__esModule",{value:!0});var Jt=ao,uf=pr,hf=Mt,Gc=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),Jt.isSerializableHash(this._inner)&&Jt.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),hf.wipe(n)}return t.prototype.reset=function(){if(!Jt.isSerializableHash(this._inner)||!Jt.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(){Jt.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Jt.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(!Jt.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(!Jt.isSerializableHash(this._inner)||!Jt.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(!Jt.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Rn.HMAC=Gc;function df(t,e,r){var n=new Gc(t,e);n.update(r);var i=n.digest();return n.clean(),i}Rn.hmac=df,Rn.equal=uf.equal,Object.defineProperty(Kc,"__esModule",{value:!0});var Zc=Rn,Yc=Mt,ff=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=Zc.hmac(this._hash,n,r);this._hmac=new Zc.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(),Yc.wipe(this._buffer),Yc.wipe(this._counter),this._bufpos=0},t}(),pf=Kc.HKDF=ff,an={},Vi={},Ki={};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.BrowserRandomSource=void 0;const Jc=65536;class gf{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+=Jc)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Jc)));return r}}Ki.BrowserRandomSource=gf;function mf(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 Gi={},wf={},yf=Object.freeze({__proto__:null,default:wf}),bf=Ar(yf);Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.NodeRandomSource=void 0;const vf=Mt;class _f{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof mf<"u"){const e=bf;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,vf.wipe)(r),n}}Gi.NodeRandomSource=_f,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.SystemRandomSource=void 0;const Ef=Ki,xf=Gi;class Cf{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Ef.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)}}Vi.SystemRandomSource=Cf,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Vi,r=_e,n=Mt;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),w=(0,r.readUint32LE)(p);return(0,n.wipe)(p),w}t.randomUint32=s;const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(l,p=o,w=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 m="";const y=p.length,E=256-256%y;for(;l>0;){const T=i(Math.ceil(l*256/E),w);for(let R=0;R<T.length&&l>0;R++){const L=T[R];L<E&&(m+=p.charAt(L%y),l--)}(0,n.wipe)(T)}return m}t.randomString=a;function c(l,p=o,w=t.defaultRandomSource){const m=Math.ceil(l/(Math.log(p.length)/Math.LN2));return a(m,p,w)}t.randomStringForEntropy=c}(an);var Zi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_e,r=Mt;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,w=l/536870912|0,m=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(w,this._buffer,y-8),e.writeUint32BE(m,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,w){for(;w>=64;){for(var m=c[0],y=c[1],E=c[2],T=c[3],R=c[4],L=c[5],x=c[6],O=c[7],_=0;_<16;_++){var D=p+_*4;a[_]=e.readUint32BE(l,D)}for(var _=16;_<64;_++){var I=a[_-2],h=(I>>>17|I<<32-17)^(I>>>19|I<<32-19)^I>>>10;I=a[_-15];var v=(I>>>7|I<<32-7)^(I>>>18|I<<32-18)^I>>>3;a[_]=(h+a[_-7]|0)+(v+a[_-16]|0)}for(var _=0;_<64;_++){var h=(((R>>>6|R<<26)^(R>>>11|R<<21)^(R>>>25|R<<7))+(R&L^~R&x)|0)+(O+(i[_]+a[_]|0)|0)|0,v=((m>>>2|m<<32-2)^(m>>>13|m<<32-13)^(m>>>22|m<<32-22))+(m&y^m&E^y&E)|0;O=x,x=L,L=R,R=T+h|0,T=E,E=y,y=m,m=h+v|0}c[0]+=m,c[1]+=y,c[2]+=E,c[3]+=T,c[4]+=R,c[5]+=L,c[6]+=x,c[7]+=O,p+=64,w-=64}return p}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Zi);var co={};(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=an,r=Mt;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(_){const D=new Float64Array(16);if(_)for(let I=0;I<_.length;I++)D[I]=_[I];return D}const i=new Uint8Array(32);i[0]=9;const s=n([56129,1]);function o(_){let D=1;for(let I=0;I<16;I++){let h=_[I]+D+65535;D=Math.floor(h/65536),_[I]=h-D*65536}_[0]+=D-1+37*(D-1)}function a(_,D,I){const h=~(I-1);for(let v=0;v<16;v++){const H=h&(_[v]^D[v]);_[v]^=H,D[v]^=H}}function c(_,D){const I=n(),h=n();for(let v=0;v<16;v++)h[v]=D[v];o(h),o(h),o(h);for(let v=0;v<2;v++){I[0]=h[0]-65517;for(let j=1;j<15;j++)I[j]=h[j]-65535-(I[j-1]>>16&1),I[j-1]&=65535;I[15]=h[15]-32767-(I[14]>>16&1);const H=I[15]>>16&1;I[14]&=65535,a(h,I,1-H)}for(let v=0;v<16;v++)_[2*v]=h[v]&255,_[2*v+1]=h[v]>>8}function l(_,D){for(let I=0;I<16;I++)_[I]=D[2*I]+(D[2*I+1]<<8);_[15]&=32767}function p(_,D,I){for(let h=0;h<16;h++)_[h]=D[h]+I[h]}function w(_,D,I){for(let h=0;h<16;h++)_[h]=D[h]-I[h]}function m(_,D,I){let h,v,H=0,j=0,q=0,X=0,re=0,C=0,A=0,G=0,K=0,W=0,z=0,J=0,Z=0,ue=0,Q=0,fe=0,ae=0,Ce=0,B=0,F=0,N=0,f=0,$=0,ee=0,ne=0,Ee=0,Me=0,$e=0,Ue=0,Ge=0,qe=0,Pe=I[0],Ie=I[1],me=I[2],Se=I[3],Oe=I[4],pe=I[5],xe=I[6],g=I[7],u=I[8],d=I[9],b=I[10],P=I[11],U=I[12],k=I[13],oe=I[14],he=I[15];h=D[0],H+=h*Pe,j+=h*Ie,q+=h*me,X+=h*Se,re+=h*Oe,C+=h*pe,A+=h*xe,G+=h*g,K+=h*u,W+=h*d,z+=h*b,J+=h*P,Z+=h*U,ue+=h*k,Q+=h*oe,fe+=h*he,h=D[1],j+=h*Pe,q+=h*Ie,X+=h*me,re+=h*Se,C+=h*Oe,A+=h*pe,G+=h*xe,K+=h*g,W+=h*u,z+=h*d,J+=h*b,Z+=h*P,ue+=h*U,Q+=h*k,fe+=h*oe,ae+=h*he,h=D[2],q+=h*Pe,X+=h*Ie,re+=h*me,C+=h*Se,A+=h*Oe,G+=h*pe,K+=h*xe,W+=h*g,z+=h*u,J+=h*d,Z+=h*b,ue+=h*P,Q+=h*U,fe+=h*k,ae+=h*oe,Ce+=h*he,h=D[3],X+=h*Pe,re+=h*Ie,C+=h*me,A+=h*Se,G+=h*Oe,K+=h*pe,W+=h*xe,z+=h*g,J+=h*u,Z+=h*d,ue+=h*b,Q+=h*P,fe+=h*U,ae+=h*k,Ce+=h*oe,B+=h*he,h=D[4],re+=h*Pe,C+=h*Ie,A+=h*me,G+=h*Se,K+=h*Oe,W+=h*pe,z+=h*xe,J+=h*g,Z+=h*u,ue+=h*d,Q+=h*b,fe+=h*P,ae+=h*U,Ce+=h*k,B+=h*oe,F+=h*he,h=D[5],C+=h*Pe,A+=h*Ie,G+=h*me,K+=h*Se,W+=h*Oe,z+=h*pe,J+=h*xe,Z+=h*g,ue+=h*u,Q+=h*d,fe+=h*b,ae+=h*P,Ce+=h*U,B+=h*k,F+=h*oe,N+=h*he,h=D[6],A+=h*Pe,G+=h*Ie,K+=h*me,W+=h*Se,z+=h*Oe,J+=h*pe,Z+=h*xe,ue+=h*g,Q+=h*u,fe+=h*d,ae+=h*b,Ce+=h*P,B+=h*U,F+=h*k,N+=h*oe,f+=h*he,h=D[7],G+=h*Pe,K+=h*Ie,W+=h*me,z+=h*Se,J+=h*Oe,Z+=h*pe,ue+=h*xe,Q+=h*g,fe+=h*u,ae+=h*d,Ce+=h*b,B+=h*P,F+=h*U,N+=h*k,f+=h*oe,$+=h*he,h=D[8],K+=h*Pe,W+=h*Ie,z+=h*me,J+=h*Se,Z+=h*Oe,ue+=h*pe,Q+=h*xe,fe+=h*g,ae+=h*u,Ce+=h*d,B+=h*b,F+=h*P,N+=h*U,f+=h*k,$+=h*oe,ee+=h*he,h=D[9],W+=h*Pe,z+=h*Ie,J+=h*me,Z+=h*Se,ue+=h*Oe,Q+=h*pe,fe+=h*xe,ae+=h*g,Ce+=h*u,B+=h*d,F+=h*b,N+=h*P,f+=h*U,$+=h*k,ee+=h*oe,ne+=h*he,h=D[10],z+=h*Pe,J+=h*Ie,Z+=h*me,ue+=h*Se,Q+=h*Oe,fe+=h*pe,ae+=h*xe,Ce+=h*g,B+=h*u,F+=h*d,N+=h*b,f+=h*P,$+=h*U,ee+=h*k,ne+=h*oe,Ee+=h*he,h=D[11],J+=h*Pe,Z+=h*Ie,ue+=h*me,Q+=h*Se,fe+=h*Oe,ae+=h*pe,Ce+=h*xe,B+=h*g,F+=h*u,N+=h*d,f+=h*b,$+=h*P,ee+=h*U,ne+=h*k,Ee+=h*oe,Me+=h*he,h=D[12],Z+=h*Pe,ue+=h*Ie,Q+=h*me,fe+=h*Se,ae+=h*Oe,Ce+=h*pe,B+=h*xe,F+=h*g,N+=h*u,f+=h*d,$+=h*b,ee+=h*P,ne+=h*U,Ee+=h*k,Me+=h*oe,$e+=h*he,h=D[13],ue+=h*Pe,Q+=h*Ie,fe+=h*me,ae+=h*Se,Ce+=h*Oe,B+=h*pe,F+=h*xe,N+=h*g,f+=h*u,$+=h*d,ee+=h*b,ne+=h*P,Ee+=h*U,Me+=h*k,$e+=h*oe,Ue+=h*he,h=D[14],Q+=h*Pe,fe+=h*Ie,ae+=h*me,Ce+=h*Se,B+=h*Oe,F+=h*pe,N+=h*xe,f+=h*g,$+=h*u,ee+=h*d,ne+=h*b,Ee+=h*P,Me+=h*U,$e+=h*k,Ue+=h*oe,Ge+=h*he,h=D[15],fe+=h*Pe,ae+=h*Ie,Ce+=h*me,B+=h*Se,F+=h*Oe,N+=h*pe,f+=h*xe,$+=h*g,ee+=h*u,ne+=h*d,Ee+=h*b,Me+=h*P,$e+=h*U,Ue+=h*k,Ge+=h*oe,qe+=h*he,H+=38*ae,j+=38*Ce,q+=38*B,X+=38*F,re+=38*N,C+=38*f,A+=38*$,G+=38*ee,K+=38*ne,W+=38*Ee,z+=38*Me,J+=38*$e,Z+=38*Ue,ue+=38*Ge,Q+=38*qe,v=1,h=H+v+65535,v=Math.floor(h/65536),H=h-v*65536,h=j+v+65535,v=Math.floor(h/65536),j=h-v*65536,h=q+v+65535,v=Math.floor(h/65536),q=h-v*65536,h=X+v+65535,v=Math.floor(h/65536),X=h-v*65536,h=re+v+65535,v=Math.floor(h/65536),re=h-v*65536,h=C+v+65535,v=Math.floor(h/65536),C=h-v*65536,h=A+v+65535,v=Math.floor(h/65536),A=h-v*65536,h=G+v+65535,v=Math.floor(h/65536),G=h-v*65536,h=K+v+65535,v=Math.floor(h/65536),K=h-v*65536,h=W+v+65535,v=Math.floor(h/65536),W=h-v*65536,h=z+v+65535,v=Math.floor(h/65536),z=h-v*65536,h=J+v+65535,v=Math.floor(h/65536),J=h-v*65536,h=Z+v+65535,v=Math.floor(h/65536),Z=h-v*65536,h=ue+v+65535,v=Math.floor(h/65536),ue=h-v*65536,h=Q+v+65535,v=Math.floor(h/65536),Q=h-v*65536,h=fe+v+65535,v=Math.floor(h/65536),fe=h-v*65536,H+=v-1+37*(v-1),v=1,h=H+v+65535,v=Math.floor(h/65536),H=h-v*65536,h=j+v+65535,v=Math.floor(h/65536),j=h-v*65536,h=q+v+65535,v=Math.floor(h/65536),q=h-v*65536,h=X+v+65535,v=Math.floor(h/65536),X=h-v*65536,h=re+v+65535,v=Math.floor(h/65536),re=h-v*65536,h=C+v+65535,v=Math.floor(h/65536),C=h-v*65536,h=A+v+65535,v=Math.floor(h/65536),A=h-v*65536,h=G+v+65535,v=Math.floor(h/65536),G=h-v*65536,h=K+v+65535,v=Math.floor(h/65536),K=h-v*65536,h=W+v+65535,v=Math.floor(h/65536),W=h-v*65536,h=z+v+65535,v=Math.floor(h/65536),z=h-v*65536,h=J+v+65535,v=Math.floor(h/65536),J=h-v*65536,h=Z+v+65535,v=Math.floor(h/65536),Z=h-v*65536,h=ue+v+65535,v=Math.floor(h/65536),ue=h-v*65536,h=Q+v+65535,v=Math.floor(h/65536),Q=h-v*65536,h=fe+v+65535,v=Math.floor(h/65536),fe=h-v*65536,H+=v-1+37*(v-1),_[0]=H,_[1]=j,_[2]=q,_[3]=X,_[4]=re,_[5]=C,_[6]=A,_[7]=G,_[8]=K,_[9]=W,_[10]=z,_[11]=J,_[12]=Z,_[13]=ue,_[14]=Q,_[15]=fe}function y(_,D){m(_,D,D)}function E(_,D){const I=n();for(let h=0;h<16;h++)I[h]=D[h];for(let h=253;h>=0;h--)y(I,I),h!==2&&h!==4&&m(I,I,D);for(let h=0;h<16;h++)_[h]=I[h]}function T(_,D){const I=new Uint8Array(32),h=new Float64Array(80),v=n(),H=n(),j=n(),q=n(),X=n(),re=n();for(let K=0;K<31;K++)I[K]=_[K];I[31]=_[31]&127|64,I[0]&=248,l(h,D);for(let K=0;K<16;K++)H[K]=h[K];v[0]=q[0]=1;for(let K=254;K>=0;--K){const W=I[K>>>3]>>>(K&7)&1;a(v,H,W),a(j,q,W),p(X,v,j),w(v,v,j),p(j,H,q),w(H,H,q),y(q,X),y(re,v),m(v,j,v),m(j,H,X),p(X,v,j),w(v,v,j),y(H,v),w(j,q,re),m(v,j,s),p(v,v,q),m(j,j,v),m(v,q,re),m(q,H,h),y(H,X),a(v,H,W),a(j,q,W)}for(let K=0;K<16;K++)h[K+16]=v[K],h[K+32]=j[K],h[K+48]=H[K],h[K+64]=q[K];const C=h.subarray(32),A=h.subarray(16);E(C,C),m(A,A,C);const G=new Uint8Array(32);return c(G,A),G}t.scalarMult=T;function R(_){return T(_,i)}t.scalarMultBase=R;function L(_){if(_.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const D=new Uint8Array(_);return{publicKey:R(D),secretKey:D}}t.generateKeyPairFromSeed=L;function x(_){const D=(0,e.randomBytes)(32,_),I=L(D);return(0,r.wipe)(D),I}t.generateKeyPair=x;function O(_,D,I=!1){if(_.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(D.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const h=T(_,D);if(I){let v=0;for(let H=0;H<h.length;H++)v|=h[H];if(v===0)throw new Error("X25519: invalid shared key")}return h}t.sharedKey=O})(co);function Xc(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function lo(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=Xc(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function Sf(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 w(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,x=E.length;L!==x&&E[L]===0;)L++,T++;for(var O=(x-L)*p+1>>>0,_=new Uint8Array(O);L!==x;){for(var D=E[L],I=0,h=O-1;(D!==0||I<R)&&h!==-1;h--,I++)D+=256*_[h]>>>0,_[h]=D%a>>>0,D=D/a>>>0;if(D!==0)throw new Error("Non-zero carry");R=I,L++}for(var v=O-R;v!==O&&_[v]===0;)v++;for(var H=c.repeat(T);v<O;++v)H+=t.charAt(_[v]);return H}function m(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 x=(E.length-T)*l+1>>>0,O=new Uint8Array(x);E[T];){var _=r[E.charCodeAt(T)];if(_===255)return;for(var D=0,I=x-1;(_!==0||D<L)&&I!==-1;I--,D++)_+=a*O[I]>>>0,O[I]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");L=D,T++}if(E[T]!==" "){for(var h=x-L;h!==x&&O[h]===0;)h++;for(var v=new Uint8Array(R+(x-h)),H=R;h!==x;)v[H++]=O[h++];return v}}}function y(E){var T=m(E);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:m,decode:y}}var Df=Sf,If=Df;const Qc=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")},Of=t=>new TextEncoder().encode(t),Af=t=>new TextDecoder().decode(t);class $f{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 Pf{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 el(this,e)}}class Tf{constructor(e){this.decoders=e}or(e){return el(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 el=(t,e)=>new Tf({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Rf{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new $f(e,r,n),this.decoder=new Pf(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Yi=({name:t,prefix:e,encode:r,decode:n})=>new Rf(t,e,r,n),Nn=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=If(r,e);return Yi({prefix:t,name:e,encode:n,decode:s=>Qc(i(s))})},Nf=(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 w=i[t[p]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|w,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},Lf=(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},_t=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Yi({prefix:e,name:t,encode(i){return Lf(i,n,r)},decode(i){return Nf(i,n,r,t)}}),Mf=Yi({prefix:"\0",name:"identity",encode:t=>Af(t),decode:t=>Of(t)});var Uf=Object.freeze({__proto__:null,identity:Mf});const Ff=_t({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Bf=Object.freeze({__proto__:null,base2:Ff});const jf=_t({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var kf=Object.freeze({__proto__:null,base8:jf});const Hf=Nn({prefix:"9",name:"base10",alphabet:"0123456789"});var zf=Object.freeze({__proto__:null,base10:Hf});const Wf=_t({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qf=_t({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Vf=Object.freeze({__proto__:null,base16:Wf,base16upper:qf});const Kf=_t({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Gf=_t({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Zf=_t({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Yf=_t({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jf=_t({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Xf=_t({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Qf=_t({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),e1=_t({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),t1=_t({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var r1=Object.freeze({__proto__:null,base32:Kf,base32upper:Gf,base32pad:Zf,base32padupper:Yf,base32hex:Jf,base32hexupper:Xf,base32hexpad:Qf,base32hexpadupper:e1,base32z:t1});const n1=Nn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),i1=Nn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var s1=Object.freeze({__proto__:null,base36:n1,base36upper:i1});const o1=Nn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),a1=Nn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var c1=Object.freeze({__proto__:null,base58btc:o1,base58flickr:a1});const l1=_t({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),u1=_t({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),h1=_t({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),d1=_t({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var f1=Object.freeze({__proto__:null,base64:l1,base64pad:u1,base64url:h1,base64urlpad:d1});const tl=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}"),p1=tl.reduce((t,e,r)=>(t[r]=e,t),[]),g1=tl.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function m1(t){return t.reduce((e,r)=>(e+=p1[r],e),"")}function w1(t){const e=[];for(const r of t){const n=g1[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const y1=Yi({prefix:"\u{1F680}",name:"base256emoji",encode:m1,decode:w1});var b1=Object.freeze({__proto__:null,base256emoji:y1}),v1=nl,rl=128,_1=127,E1=~_1,x1=Math.pow(2,31);function nl(t,e,r){e=e||[],r=r||0;for(var n=r;t>=x1;)e[r++]=t&255|rl,t/=128;for(;t&E1;)e[r++]=t&255|rl,t>>>=7;return e[r]=t|0,nl.bytes=r-n+1,e}var C1=uo,S1=128,il=127;function uo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw uo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&il)<<i:(o&il)*Math.pow(2,i),i+=7}while(o>=S1);return uo.bytes=s-n,r}var D1=Math.pow(2,7),I1=Math.pow(2,14),O1=Math.pow(2,21),A1=Math.pow(2,28),$1=Math.pow(2,35),P1=Math.pow(2,42),T1=Math.pow(2,49),R1=Math.pow(2,56),N1=Math.pow(2,63),L1=function(t){return t<D1?1:t<I1?2:t<O1?3:t<A1?4:t<$1?5:t<P1?6:t<T1?7:t<R1?8:t<N1?9:10},M1={encode:v1,decode:C1,encodingLength:L1},sl=M1;const ol=(t,e,r=0)=>(sl.encode(t,e,r),e),al=t=>sl.encodingLength(t),ho=(t,e)=>{const r=e.byteLength,n=al(t),i=n+al(r),s=new Uint8Array(i+r);return ol(t,s,0),ol(r,s,n),s.set(e,i),new U1(t,r,e,s)};class U1{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const cl=({name:t,code:e,encode:r})=>new F1(t,e,r);class F1{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?ho(this.code,r):r.then(n=>ho(this.code,n))}else throw Error("Unknown type, must be binary type")}}const ll=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),B1=cl({name:"sha2-256",code:18,encode:ll("SHA-256")}),j1=cl({name:"sha2-512",code:19,encode:ll("SHA-512")});var k1=Object.freeze({__proto__:null,sha256:B1,sha512:j1});const ul=0,H1="identity",hl=Qc;var z1=Object.freeze({__proto__:null,identity:{code:ul,name:H1,encode:hl,digest:t=>ho(ul,hl(t))}});new TextEncoder,new TextDecoder;const dl={...Uf,...Bf,...kf,...zf,...Vf,...r1,...s1,...c1,...f1,...b1};({...k1,...z1});function fl(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const pl=fl("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),fo=fl("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=Xc(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),gl={utf8:pl,"utf-8":pl,hex:dl.base16,latin1:fo,ascii:fo,binary:fo,...dl};function $t(t,e="utf8"){const r=gl[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 Pt(t,e="utf8"){const r=gl[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))},W1=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),q1=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),V1=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}(),K1=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),G1=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Z1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Y1=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,wl=3,J1=[["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",Z1]],yl=[["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 X1(t){return t?bl(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new G1:typeof navigator<"u"?bl(navigator.userAgent):tp()}function Q1(t){return t!==""&&J1.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 bl(t){var e=Q1(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new K1;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<wl&&(i=ml(ml([],i,!0),rp(wl-i.length),!0)):i=[];var s=i.join("."),o=ep(t),a=Y1.exec(t);return a&&a[1]?new V1(r,s,o,a[1]):new W1(r,s,o)}function ep(t){for(var e=0,r=yl.length;e<r;e++){var n=yl[e],i=n[0],s=n[1],o=s.exec(t);if(o)return i}return null}function tp(){var t=typeof process<"u"&&process.version;return t?new q1(process.version.slice(1)):null}function rp(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var ge={};/*! *****************************************************************************
|
|
1
|
+
(function(Or,ut){typeof exports=="object"&&typeof module<"u"?ut(exports):typeof define=="function"&&define.amd?define(["exports"],ut):(Or=typeof globalThis<"u"?globalThis:Or||self,ut(Or["@walletconnect/ethereum-provider"]={}))})(this,function(Or){"use strict";var ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ar(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 vt={exports:{}},on=typeof Reflect=="object"?Reflect:null,Oc=on&&typeof on.apply=="function"?on.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},ki;on&&typeof on.ownKeys=="function"?ki=on.ownKeys:Object.getOwnPropertySymbols?ki=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:ki=function(e){return Object.getOwnPropertyNames(e)};function Id(t){console&&console.warn&&console.warn(t)}var Ac=Number.isNaN||function(e){return e!==e};function ke(){ke.init.call(this)}vt.exports=ke,vt.exports.once=Pd,ke.EventEmitter=ke,ke.prototype._events=void 0,ke.prototype._eventsCount=0,ke.prototype._maxListeners=void 0;var $c=10;function Hi(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 $c},set:function(t){if(typeof t!="number"||t<0||Ac(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");$c=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||Ac(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 Pc(t){return t._maxListeners===void 0?ke.defaultMaxListeners:t._maxListeners}ke.prototype.getMaxListeners=function(){return Pc(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")Oc(c,this,r);else for(var l=c.length,p=Mc(c,l),n=0;n<l;++n)Oc(p[n],this,r);return!0};function Tc(t,e,r,n){var i,s,o;if(Hi(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=Pc(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,Id(a)}return t}ke.prototype.addListener=function(e,r){return Tc(this,e,r,!1)},ke.prototype.on=ke.prototype.addListener,ke.prototype.prependListener=function(e,r){return Tc(this,e,r,!0)};function Od(){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 Rc(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Od.bind(n);return i.listener=r,n.wrapFn=i,i}ke.prototype.once=function(e,r){return Hi(r),this.on(e,Rc(this,e,r)),this},ke.prototype.prependOnceListener=function(e,r){return Hi(r),this.prependListener(e,Rc(this,e,r)),this},ke.prototype.removeListener=function(e,r){var n,i,s,o,a;if(Hi(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():Ad(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 Nc(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?$d(i):Mc(i,i.length)}ke.prototype.listeners=function(e){return Nc(this,e,!0)},ke.prototype.rawListeners=function(e){return Nc(this,e,!1)},ke.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Lc.call(t,e)},ke.prototype.listenerCount=Lc;function Lc(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 Mc(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Ad(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function $d(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Pd(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))}Uc(t,e,s,{once:!0}),e!=="error"&&Td(t,i,{once:!0})})}function Td(t,e,r){typeof t.on=="function"&&Uc(t,"error",e,r)}function Uc(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 to={},zi={},_e={},Fc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,p=a&65535,w=c>>>16&65535,m=c&65535;return p*m+(l*m+p*w<<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}})(Fc),Object.defineProperty(_e,"__esModule",{value:!0});var Bc=Fc;function Rd(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}_e.readInt16BE=Rd;function Nd(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}_e.readUint16BE=Nd;function Ld(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}_e.readInt16LE=Ld;function Md(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}_e.readUint16LE=Md;function jc(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=jc,_e.writeInt16BE=jc;function kc(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=kc,_e.writeInt16LE=kc;function ro(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}_e.readInt32BE=ro;function no(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=no;function io(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}_e.readInt32LE=io;function so(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=so;function Wi(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=Wi,_e.writeInt32BE=Wi;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 Ud(t,e){e===void 0&&(e=0);var r=ro(t,e),n=ro(t,e+4);return r*4294967296+n-(n>>31)*4294967296}_e.readInt64BE=Ud;function Fd(t,e){e===void 0&&(e=0);var r=no(t,e),n=no(t,e+4);return r*4294967296+n}_e.readUint64BE=Fd;function Bd(t,e){e===void 0&&(e=0);var r=io(t,e),n=io(t,e+4);return n*4294967296+r-(r>>31)*4294967296}_e.readInt64LE=Bd;function jd(t,e){e===void 0&&(e=0);var r=so(t,e),n=so(t,e+4);return n*4294967296+r}_e.readUint64LE=jd;function Hc(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Wi(t/4294967296>>>0,e,r),Wi(t>>>0,e,r+4),e}_e.writeUint64BE=Hc,_e.writeInt64BE=Hc;function zc(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=zc,_e.writeInt64LE=zc;function kd(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=kd;function Hd(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=Hd;function zd(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(!Bc.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=zd;function Wd(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(!Bc.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=Wd;function qd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}_e.readFloat32BE=qd;function Vd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}_e.readFloat32LE=Vd;function Kd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}_e.readFloat64BE=Kd;function Gd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}_e.readFloat64LE=Gd;function Zd(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=Zd;function Yd(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=Yd;function Jd(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=Jd;function Xd(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=Xd;var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});function Qd(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Mt.wipe=Qd,Object.defineProperty(zi,"__esModule",{value:!0});var St=_e,oo=Mt,ef=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],w=r[19]<<24|r[18]<<16|r[17]<<8|r[16],m=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],x=e[15]<<24|e[14]<<16|e[13]<<8|e[12],O=n,_=i,D=s,I=o,h=a,v=c,H=l,j=p,q=w,X=m,re=y,C=E,A=T,G=R,K=L,W=x,z=0;z<ef;z+=2)O=O+h|0,A^=O,A=A>>>32-16|A<<16,q=q+A|0,h^=q,h=h>>>32-12|h<<12,_=_+v|0,G^=_,G=G>>>32-16|G<<16,X=X+G|0,v^=X,v=v>>>32-12|v<<12,D=D+H|0,K^=D,K=K>>>32-16|K<<16,re=re+K|0,H^=re,H=H>>>32-12|H<<12,I=I+j|0,W^=I,W=W>>>32-16|W<<16,C=C+W|0,j^=C,j=j>>>32-12|j<<12,D=D+H|0,K^=D,K=K>>>32-8|K<<8,re=re+K|0,H^=re,H=H>>>32-7|H<<7,I=I+j|0,W^=I,W=W>>>32-8|W<<8,C=C+W|0,j^=C,j=j>>>32-7|j<<7,_=_+v|0,G^=_,G=G>>>32-8|G<<8,X=X+G|0,v^=X,v=v>>>32-7|v<<7,O=O+h|0,A^=O,A=A>>>32-8|A<<8,q=q+A|0,h^=q,h=h>>>32-7|h<<7,O=O+v|0,W^=O,W=W>>>32-16|W<<16,re=re+W|0,v^=re,v=v>>>32-12|v<<12,_=_+H|0,A^=_,A=A>>>32-16|A<<16,C=C+A|0,H^=C,H=H>>>32-12|H<<12,D=D+j|0,G^=D,G=G>>>32-16|G<<16,q=q+G|0,j^=q,j=j>>>32-12|j<<12,I=I+h|0,K^=I,K=K>>>32-16|K<<16,X=X+K|0,h^=X,h=h>>>32-12|h<<12,D=D+j|0,G^=D,G=G>>>32-8|G<<8,q=q+G|0,j^=q,j=j>>>32-7|j<<7,I=I+h|0,K^=I,K=K>>>32-8|K<<8,X=X+K|0,h^=X,h=h>>>32-7|h<<7,_=_+H|0,A^=_,A=A>>>32-8|A<<8,C=C+A|0,H^=C,H=H>>>32-7|H<<7,O=O+v|0,W^=O,W=W>>>32-8|W<<8,re=re+W|0,v^=re,v=v>>>32-7|v<<7;St.writeUint32LE(O+n|0,t,0),St.writeUint32LE(_+i|0,t,4),St.writeUint32LE(D+s|0,t,8),St.writeUint32LE(I+o|0,t,12),St.writeUint32LE(h+a|0,t,16),St.writeUint32LE(v+c|0,t,20),St.writeUint32LE(H+l|0,t,24),St.writeUint32LE(j+p|0,t,28),St.writeUint32LE(q+w|0,t,32),St.writeUint32LE(X+m|0,t,36),St.writeUint32LE(re+y|0,t,40),St.writeUint32LE(C+E|0,t,44),St.writeUint32LE(A+T|0,t,48),St.writeUint32LE(G+R|0,t,52),St.writeUint32LE(K+L|0,t,56),St.writeUint32LE(W+x|0,t,60)}function Wc(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];nf(s,0,o)}return oo.wipe(a),i===0&&oo.wipe(s),n}zi.streamXOR=Wc;function rf(t,e,r,n){return n===void 0&&(n=0),oo.wipe(r),Wc(t,e,r,r,n)}zi.stream=rf;function nf(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 qc={},pr={};Object.defineProperty(pr,"__esModule",{value:!0});function sf(t,e,r){return~(t-1)&e|t-1&r}pr.select=sf;function of(t,e){return(t|0)-(e|0)-1>>>31&1}pr.lessOrEqual=of;function Vc(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}pr.compare=Vc;function af(t,e){return t.length===0||e.length===0?!1:Vc(t,e)!==0}pr.equal=af,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=pr,r=Mt;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 w=a[6]|a[7]<<8;this._r[3]=(p>>>7|w<<9)&8191;var m=a[8]|a[9]<<8;this._r[4]=(w>>>4|m<<12)&255,this._r[5]=m>>>1&8190;var y=a[10]|a[11]<<8;this._r[6]=(m>>>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,w=this._h[0],m=this._h[1],y=this._h[2],E=this._h[3],T=this._h[4],R=this._h[5],L=this._h[6],x=this._h[7],O=this._h[8],_=this._h[9],D=this._r[0],I=this._r[1],h=this._r[2],v=this._r[3],H=this._r[4],j=this._r[5],q=this._r[6],X=this._r[7],re=this._r[8],C=this._r[9];l>=16;){var A=a[c+0]|a[c+1]<<8;w+=A&8191;var G=a[c+2]|a[c+3]<<8;m+=(A>>>13|G<<3)&8191;var K=a[c+4]|a[c+5]<<8;y+=(G>>>10|K<<6)&8191;var W=a[c+6]|a[c+7]<<8;E+=(K>>>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 Z=a[c+12]|a[c+13]<<8;x+=(J>>>11|Z<<5)&8191;var ue=a[c+14]|a[c+15]<<8;O+=(Z>>>8|ue<<8)&8191,_+=ue>>>5|p;var Q=0,fe=Q;fe+=w*D,fe+=m*(5*C),fe+=y*(5*re),fe+=E*(5*X),fe+=T*(5*q),Q=fe>>>13,fe&=8191,fe+=R*(5*j),fe+=L*(5*H),fe+=x*(5*v),fe+=O*(5*h),fe+=_*(5*I),Q+=fe>>>13,fe&=8191;var ae=Q;ae+=w*I,ae+=m*D,ae+=y*(5*C),ae+=E*(5*re),ae+=T*(5*X),Q=ae>>>13,ae&=8191,ae+=R*(5*q),ae+=L*(5*j),ae+=x*(5*H),ae+=O*(5*v),ae+=_*(5*h),Q+=ae>>>13,ae&=8191;var Ce=Q;Ce+=w*h,Ce+=m*I,Ce+=y*D,Ce+=E*(5*C),Ce+=T*(5*re),Q=Ce>>>13,Ce&=8191,Ce+=R*(5*X),Ce+=L*(5*q),Ce+=x*(5*j),Ce+=O*(5*H),Ce+=_*(5*v),Q+=Ce>>>13,Ce&=8191;var B=Q;B+=w*v,B+=m*h,B+=y*I,B+=E*D,B+=T*(5*C),Q=B>>>13,B&=8191,B+=R*(5*re),B+=L*(5*X),B+=x*(5*q),B+=O*(5*j),B+=_*(5*H),Q+=B>>>13,B&=8191;var F=Q;F+=w*H,F+=m*v,F+=y*h,F+=E*I,F+=T*D,Q=F>>>13,F&=8191,F+=R*(5*C),F+=L*(5*re),F+=x*(5*X),F+=O*(5*q),F+=_*(5*j),Q+=F>>>13,F&=8191;var N=Q;N+=w*j,N+=m*H,N+=y*v,N+=E*h,N+=T*I,Q=N>>>13,N&=8191,N+=R*D,N+=L*(5*C),N+=x*(5*re),N+=O*(5*X),N+=_*(5*q),Q+=N>>>13,N&=8191;var f=Q;f+=w*q,f+=m*j,f+=y*H,f+=E*v,f+=T*h,Q=f>>>13,f&=8191,f+=R*I,f+=L*D,f+=x*(5*C),f+=O*(5*re),f+=_*(5*X),Q+=f>>>13,f&=8191;var $=Q;$+=w*X,$+=m*q,$+=y*j,$+=E*H,$+=T*v,Q=$>>>13,$&=8191,$+=R*h,$+=L*I,$+=x*D,$+=O*(5*C),$+=_*(5*re),Q+=$>>>13,$&=8191;var ee=Q;ee+=w*re,ee+=m*X,ee+=y*q,ee+=E*j,ee+=T*H,Q=ee>>>13,ee&=8191,ee+=R*v,ee+=L*h,ee+=x*I,ee+=O*D,ee+=_*(5*C),Q+=ee>>>13,ee&=8191;var ne=Q;ne+=w*C,ne+=m*re,ne+=y*X,ne+=E*q,ne+=T*j,Q=ne>>>13,ne&=8191,ne+=R*H,ne+=L*v,ne+=x*h,ne+=O*I,ne+=_*D,Q+=ne>>>13,ne&=8191,Q=(Q<<2)+Q|0,Q=Q+fe|0,fe=Q&8191,Q=Q>>>13,ae+=Q,w=fe,m=ae,y=Ce,E=B,T=F,R=N,L=f,x=$,O=ee,_=ne,c+=16,l-=16}this._h[0]=w,this._h[1]=m,this._h[2]=y,this._h[3]=E,this._h[4]=T,this._h[5]=R,this._h[6]=L,this._h[7]=x,this._h[8]=O,this._h[9]=_},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),p,w,m,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,w=(p^1)-1,y=0;y<10;y++)l[y]&=w;for(w=~w,y=0;y<10;y++)this._h[y]=this._h[y]&w|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,m=this._h[0]+this._pad[0],this._h[0]=m&65535,y=1;y<8;y++)m=(this._h[y]+this._pad[y]|0)+(m>>>16)|0,this._h[y]=m&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 w=0;w<p;w++)this._buffer[this._leftover+w]=a[c+w];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 w=0;w<l;w++)this._buffer[this._leftover+w]=a[c+w];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}(qc),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=zi,r=qc,n=Mt,i=_e,s=pr;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,w,m){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(m){if(m.length!==T)throw new Error("ChaCha20Poly1305: incorrect destination length");R=m}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),w),n.wipe(y),R},c.prototype.open=function(l,p,w,m){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),w),!s.equal(T,p.subarray(p.length-this.tagLength,p.length)))return null;var R=p.length-this.tagLength,L;if(m){if(m.length!==R)throw new Error("ChaCha20Poly1305: incorrect destination length");L=m}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,w,m){var y=new r.Poly1305(p);m&&(y.update(m),m.length%16>0&&y.update(o.subarray(m.length%16))),y.update(w),w.length%16>0&&y.update(o.subarray(w.length%16));var E=new Uint8Array(8);m&&i.writeUint64LE(m.length,E),y.update(E),i.writeUint64LE(w.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}(to);var Kc={},Rn={},ao={};Object.defineProperty(ao,"__esModule",{value:!0});function cf(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}ao.isSerializableHash=cf,Object.defineProperty(Rn,"__esModule",{value:!0});var Jt=ao,lf=pr,uf=Mt,Gc=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),Jt.isSerializableHash(this._inner)&&Jt.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),uf.wipe(n)}return t.prototype.reset=function(){if(!Jt.isSerializableHash(this._inner)||!Jt.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(){Jt.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Jt.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(!Jt.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(!Jt.isSerializableHash(this._inner)||!Jt.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(!Jt.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Rn.HMAC=Gc;function hf(t,e,r){var n=new Gc(t,e);n.update(r);var i=n.digest();return n.clean(),i}Rn.hmac=hf,Rn.equal=lf.equal,Object.defineProperty(Kc,"__esModule",{value:!0});var Zc=Rn,Yc=Mt,df=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=Zc.hmac(this._hash,n,r);this._hmac=new Zc.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(),Yc.wipe(this._buffer),Yc.wipe(this._counter),this._bufpos=0},t}(),ff=Kc.HKDF=df,an={},Vi={},Ki={};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.BrowserRandomSource=void 0;const Jc=65536;class pf{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+=Jc)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Jc)));return r}}Ki.BrowserRandomSource=pf;function gf(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 Gi={},mf={},wf=Object.freeze({__proto__:null,default:mf}),yf=Ar(wf);Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.NodeRandomSource=void 0;const bf=Mt;class vf{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof gf<"u"){const e=yf;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,bf.wipe)(r),n}}Gi.NodeRandomSource=vf,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.SystemRandomSource=void 0;const _f=Ki,Ef=Gi;class xf{constructor(){if(this.isAvailable=!1,this.name="",this._source=new _f.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Ef.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)}}Vi.SystemRandomSource=xf,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Vi,r=_e,n=Mt;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),w=(0,r.readUint32LE)(p);return(0,n.wipe)(p),w}t.randomUint32=s;const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(l,p=o,w=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 m="";const y=p.length,E=256-256%y;for(;l>0;){const T=i(Math.ceil(l*256/E),w);for(let R=0;R<T.length&&l>0;R++){const L=T[R];L<E&&(m+=p.charAt(L%y),l--)}(0,n.wipe)(T)}return m}t.randomString=a;function c(l,p=o,w=t.defaultRandomSource){const m=Math.ceil(l/(Math.log(p.length)/Math.LN2));return a(m,p,w)}t.randomStringForEntropy=c}(an);var Zi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_e,r=Mt;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,w=l/536870912|0,m=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(w,this._buffer,y-8),e.writeUint32BE(m,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,w){for(;w>=64;){for(var m=c[0],y=c[1],E=c[2],T=c[3],R=c[4],L=c[5],x=c[6],O=c[7],_=0;_<16;_++){var D=p+_*4;a[_]=e.readUint32BE(l,D)}for(var _=16;_<64;_++){var I=a[_-2],h=(I>>>17|I<<32-17)^(I>>>19|I<<32-19)^I>>>10;I=a[_-15];var v=(I>>>7|I<<32-7)^(I>>>18|I<<32-18)^I>>>3;a[_]=(h+a[_-7]|0)+(v+a[_-16]|0)}for(var _=0;_<64;_++){var h=(((R>>>6|R<<26)^(R>>>11|R<<21)^(R>>>25|R<<7))+(R&L^~R&x)|0)+(O+(i[_]+a[_]|0)|0)|0,v=((m>>>2|m<<32-2)^(m>>>13|m<<32-13)^(m>>>22|m<<32-22))+(m&y^m&E^y&E)|0;O=x,x=L,L=R,R=T+h|0,T=E,E=y,y=m,m=h+v|0}c[0]+=m,c[1]+=y,c[2]+=E,c[3]+=T,c[4]+=R,c[5]+=L,c[6]+=x,c[7]+=O,p+=64,w-=64}return p}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Zi);var co={};(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=an,r=Mt;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(_){const D=new Float64Array(16);if(_)for(let I=0;I<_.length;I++)D[I]=_[I];return D}const i=new Uint8Array(32);i[0]=9;const s=n([56129,1]);function o(_){let D=1;for(let I=0;I<16;I++){let h=_[I]+D+65535;D=Math.floor(h/65536),_[I]=h-D*65536}_[0]+=D-1+37*(D-1)}function a(_,D,I){const h=~(I-1);for(let v=0;v<16;v++){const H=h&(_[v]^D[v]);_[v]^=H,D[v]^=H}}function c(_,D){const I=n(),h=n();for(let v=0;v<16;v++)h[v]=D[v];o(h),o(h),o(h);for(let v=0;v<2;v++){I[0]=h[0]-65517;for(let j=1;j<15;j++)I[j]=h[j]-65535-(I[j-1]>>16&1),I[j-1]&=65535;I[15]=h[15]-32767-(I[14]>>16&1);const H=I[15]>>16&1;I[14]&=65535,a(h,I,1-H)}for(let v=0;v<16;v++)_[2*v]=h[v]&255,_[2*v+1]=h[v]>>8}function l(_,D){for(let I=0;I<16;I++)_[I]=D[2*I]+(D[2*I+1]<<8);_[15]&=32767}function p(_,D,I){for(let h=0;h<16;h++)_[h]=D[h]+I[h]}function w(_,D,I){for(let h=0;h<16;h++)_[h]=D[h]-I[h]}function m(_,D,I){let h,v,H=0,j=0,q=0,X=0,re=0,C=0,A=0,G=0,K=0,W=0,z=0,J=0,Z=0,ue=0,Q=0,fe=0,ae=0,Ce=0,B=0,F=0,N=0,f=0,$=0,ee=0,ne=0,Ee=0,Me=0,$e=0,Ue=0,Ge=0,qe=0,Pe=I[0],Ie=I[1],me=I[2],Se=I[3],Oe=I[4],pe=I[5],xe=I[6],g=I[7],u=I[8],d=I[9],b=I[10],P=I[11],U=I[12],k=I[13],oe=I[14],he=I[15];h=D[0],H+=h*Pe,j+=h*Ie,q+=h*me,X+=h*Se,re+=h*Oe,C+=h*pe,A+=h*xe,G+=h*g,K+=h*u,W+=h*d,z+=h*b,J+=h*P,Z+=h*U,ue+=h*k,Q+=h*oe,fe+=h*he,h=D[1],j+=h*Pe,q+=h*Ie,X+=h*me,re+=h*Se,C+=h*Oe,A+=h*pe,G+=h*xe,K+=h*g,W+=h*u,z+=h*d,J+=h*b,Z+=h*P,ue+=h*U,Q+=h*k,fe+=h*oe,ae+=h*he,h=D[2],q+=h*Pe,X+=h*Ie,re+=h*me,C+=h*Se,A+=h*Oe,G+=h*pe,K+=h*xe,W+=h*g,z+=h*u,J+=h*d,Z+=h*b,ue+=h*P,Q+=h*U,fe+=h*k,ae+=h*oe,Ce+=h*he,h=D[3],X+=h*Pe,re+=h*Ie,C+=h*me,A+=h*Se,G+=h*Oe,K+=h*pe,W+=h*xe,z+=h*g,J+=h*u,Z+=h*d,ue+=h*b,Q+=h*P,fe+=h*U,ae+=h*k,Ce+=h*oe,B+=h*he,h=D[4],re+=h*Pe,C+=h*Ie,A+=h*me,G+=h*Se,K+=h*Oe,W+=h*pe,z+=h*xe,J+=h*g,Z+=h*u,ue+=h*d,Q+=h*b,fe+=h*P,ae+=h*U,Ce+=h*k,B+=h*oe,F+=h*he,h=D[5],C+=h*Pe,A+=h*Ie,G+=h*me,K+=h*Se,W+=h*Oe,z+=h*pe,J+=h*xe,Z+=h*g,ue+=h*u,Q+=h*d,fe+=h*b,ae+=h*P,Ce+=h*U,B+=h*k,F+=h*oe,N+=h*he,h=D[6],A+=h*Pe,G+=h*Ie,K+=h*me,W+=h*Se,z+=h*Oe,J+=h*pe,Z+=h*xe,ue+=h*g,Q+=h*u,fe+=h*d,ae+=h*b,Ce+=h*P,B+=h*U,F+=h*k,N+=h*oe,f+=h*he,h=D[7],G+=h*Pe,K+=h*Ie,W+=h*me,z+=h*Se,J+=h*Oe,Z+=h*pe,ue+=h*xe,Q+=h*g,fe+=h*u,ae+=h*d,Ce+=h*b,B+=h*P,F+=h*U,N+=h*k,f+=h*oe,$+=h*he,h=D[8],K+=h*Pe,W+=h*Ie,z+=h*me,J+=h*Se,Z+=h*Oe,ue+=h*pe,Q+=h*xe,fe+=h*g,ae+=h*u,Ce+=h*d,B+=h*b,F+=h*P,N+=h*U,f+=h*k,$+=h*oe,ee+=h*he,h=D[9],W+=h*Pe,z+=h*Ie,J+=h*me,Z+=h*Se,ue+=h*Oe,Q+=h*pe,fe+=h*xe,ae+=h*g,Ce+=h*u,B+=h*d,F+=h*b,N+=h*P,f+=h*U,$+=h*k,ee+=h*oe,ne+=h*he,h=D[10],z+=h*Pe,J+=h*Ie,Z+=h*me,ue+=h*Se,Q+=h*Oe,fe+=h*pe,ae+=h*xe,Ce+=h*g,B+=h*u,F+=h*d,N+=h*b,f+=h*P,$+=h*U,ee+=h*k,ne+=h*oe,Ee+=h*he,h=D[11],J+=h*Pe,Z+=h*Ie,ue+=h*me,Q+=h*Se,fe+=h*Oe,ae+=h*pe,Ce+=h*xe,B+=h*g,F+=h*u,N+=h*d,f+=h*b,$+=h*P,ee+=h*U,ne+=h*k,Ee+=h*oe,Me+=h*he,h=D[12],Z+=h*Pe,ue+=h*Ie,Q+=h*me,fe+=h*Se,ae+=h*Oe,Ce+=h*pe,B+=h*xe,F+=h*g,N+=h*u,f+=h*d,$+=h*b,ee+=h*P,ne+=h*U,Ee+=h*k,Me+=h*oe,$e+=h*he,h=D[13],ue+=h*Pe,Q+=h*Ie,fe+=h*me,ae+=h*Se,Ce+=h*Oe,B+=h*pe,F+=h*xe,N+=h*g,f+=h*u,$+=h*d,ee+=h*b,ne+=h*P,Ee+=h*U,Me+=h*k,$e+=h*oe,Ue+=h*he,h=D[14],Q+=h*Pe,fe+=h*Ie,ae+=h*me,Ce+=h*Se,B+=h*Oe,F+=h*pe,N+=h*xe,f+=h*g,$+=h*u,ee+=h*d,ne+=h*b,Ee+=h*P,Me+=h*U,$e+=h*k,Ue+=h*oe,Ge+=h*he,h=D[15],fe+=h*Pe,ae+=h*Ie,Ce+=h*me,B+=h*Se,F+=h*Oe,N+=h*pe,f+=h*xe,$+=h*g,ee+=h*u,ne+=h*d,Ee+=h*b,Me+=h*P,$e+=h*U,Ue+=h*k,Ge+=h*oe,qe+=h*he,H+=38*ae,j+=38*Ce,q+=38*B,X+=38*F,re+=38*N,C+=38*f,A+=38*$,G+=38*ee,K+=38*ne,W+=38*Ee,z+=38*Me,J+=38*$e,Z+=38*Ue,ue+=38*Ge,Q+=38*qe,v=1,h=H+v+65535,v=Math.floor(h/65536),H=h-v*65536,h=j+v+65535,v=Math.floor(h/65536),j=h-v*65536,h=q+v+65535,v=Math.floor(h/65536),q=h-v*65536,h=X+v+65535,v=Math.floor(h/65536),X=h-v*65536,h=re+v+65535,v=Math.floor(h/65536),re=h-v*65536,h=C+v+65535,v=Math.floor(h/65536),C=h-v*65536,h=A+v+65535,v=Math.floor(h/65536),A=h-v*65536,h=G+v+65535,v=Math.floor(h/65536),G=h-v*65536,h=K+v+65535,v=Math.floor(h/65536),K=h-v*65536,h=W+v+65535,v=Math.floor(h/65536),W=h-v*65536,h=z+v+65535,v=Math.floor(h/65536),z=h-v*65536,h=J+v+65535,v=Math.floor(h/65536),J=h-v*65536,h=Z+v+65535,v=Math.floor(h/65536),Z=h-v*65536,h=ue+v+65535,v=Math.floor(h/65536),ue=h-v*65536,h=Q+v+65535,v=Math.floor(h/65536),Q=h-v*65536,h=fe+v+65535,v=Math.floor(h/65536),fe=h-v*65536,H+=v-1+37*(v-1),v=1,h=H+v+65535,v=Math.floor(h/65536),H=h-v*65536,h=j+v+65535,v=Math.floor(h/65536),j=h-v*65536,h=q+v+65535,v=Math.floor(h/65536),q=h-v*65536,h=X+v+65535,v=Math.floor(h/65536),X=h-v*65536,h=re+v+65535,v=Math.floor(h/65536),re=h-v*65536,h=C+v+65535,v=Math.floor(h/65536),C=h-v*65536,h=A+v+65535,v=Math.floor(h/65536),A=h-v*65536,h=G+v+65535,v=Math.floor(h/65536),G=h-v*65536,h=K+v+65535,v=Math.floor(h/65536),K=h-v*65536,h=W+v+65535,v=Math.floor(h/65536),W=h-v*65536,h=z+v+65535,v=Math.floor(h/65536),z=h-v*65536,h=J+v+65535,v=Math.floor(h/65536),J=h-v*65536,h=Z+v+65535,v=Math.floor(h/65536),Z=h-v*65536,h=ue+v+65535,v=Math.floor(h/65536),ue=h-v*65536,h=Q+v+65535,v=Math.floor(h/65536),Q=h-v*65536,h=fe+v+65535,v=Math.floor(h/65536),fe=h-v*65536,H+=v-1+37*(v-1),_[0]=H,_[1]=j,_[2]=q,_[3]=X,_[4]=re,_[5]=C,_[6]=A,_[7]=G,_[8]=K,_[9]=W,_[10]=z,_[11]=J,_[12]=Z,_[13]=ue,_[14]=Q,_[15]=fe}function y(_,D){m(_,D,D)}function E(_,D){const I=n();for(let h=0;h<16;h++)I[h]=D[h];for(let h=253;h>=0;h--)y(I,I),h!==2&&h!==4&&m(I,I,D);for(let h=0;h<16;h++)_[h]=I[h]}function T(_,D){const I=new Uint8Array(32),h=new Float64Array(80),v=n(),H=n(),j=n(),q=n(),X=n(),re=n();for(let K=0;K<31;K++)I[K]=_[K];I[31]=_[31]&127|64,I[0]&=248,l(h,D);for(let K=0;K<16;K++)H[K]=h[K];v[0]=q[0]=1;for(let K=254;K>=0;--K){const W=I[K>>>3]>>>(K&7)&1;a(v,H,W),a(j,q,W),p(X,v,j),w(v,v,j),p(j,H,q),w(H,H,q),y(q,X),y(re,v),m(v,j,v),m(j,H,X),p(X,v,j),w(v,v,j),y(H,v),w(j,q,re),m(v,j,s),p(v,v,q),m(j,j,v),m(v,q,re),m(q,H,h),y(H,X),a(v,H,W),a(j,q,W)}for(let K=0;K<16;K++)h[K+16]=v[K],h[K+32]=j[K],h[K+48]=H[K],h[K+64]=q[K];const C=h.subarray(32),A=h.subarray(16);E(C,C),m(A,A,C);const G=new Uint8Array(32);return c(G,A),G}t.scalarMult=T;function R(_){return T(_,i)}t.scalarMultBase=R;function L(_){if(_.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const D=new Uint8Array(_);return{publicKey:R(D),secretKey:D}}t.generateKeyPairFromSeed=L;function x(_){const D=(0,e.randomBytes)(32,_),I=L(D);return(0,r.wipe)(D),I}t.generateKeyPair=x;function O(_,D,I=!1){if(_.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(D.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const h=T(_,D);if(I){let v=0;for(let H=0;H<h.length;H++)v|=h[H];if(v===0)throw new Error("X25519: invalid shared key")}return h}t.sharedKey=O})(co);function Xc(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function lo(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=Xc(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function Cf(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 w(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,x=E.length;L!==x&&E[L]===0;)L++,T++;for(var O=(x-L)*p+1>>>0,_=new Uint8Array(O);L!==x;){for(var D=E[L],I=0,h=O-1;(D!==0||I<R)&&h!==-1;h--,I++)D+=256*_[h]>>>0,_[h]=D%a>>>0,D=D/a>>>0;if(D!==0)throw new Error("Non-zero carry");R=I,L++}for(var v=O-R;v!==O&&_[v]===0;)v++;for(var H=c.repeat(T);v<O;++v)H+=t.charAt(_[v]);return H}function m(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 x=(E.length-T)*l+1>>>0,O=new Uint8Array(x);E[T];){var _=r[E.charCodeAt(T)];if(_===255)return;for(var D=0,I=x-1;(_!==0||D<L)&&I!==-1;I--,D++)_+=a*O[I]>>>0,O[I]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");L=D,T++}if(E[T]!==" "){for(var h=x-L;h!==x&&O[h]===0;)h++;for(var v=new Uint8Array(R+(x-h)),H=R;h!==x;)v[H++]=O[h++];return v}}}function y(E){var T=m(E);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:m,decode:y}}var Sf=Cf,Df=Sf;const Qc=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")},If=t=>new TextEncoder().encode(t),Of=t=>new TextDecoder().decode(t);class Af{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 $f{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 el(this,e)}}class Pf{constructor(e){this.decoders=e}or(e){return el(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 el=(t,e)=>new Pf({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Tf{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Af(e,r,n),this.decoder=new $f(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Yi=({name:t,prefix:e,encode:r,decode:n})=>new Tf(t,e,r,n),Nn=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Df(r,e);return Yi({prefix:t,name:e,encode:n,decode:s=>Qc(i(s))})},Rf=(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 w=i[t[p]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|w,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},Nf=(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},_t=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Yi({prefix:e,name:t,encode(i){return Nf(i,n,r)},decode(i){return Rf(i,n,r,t)}}),Lf=Yi({prefix:"\0",name:"identity",encode:t=>Of(t),decode:t=>If(t)});var Mf=Object.freeze({__proto__:null,identity:Lf});const Uf=_t({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ff=Object.freeze({__proto__:null,base2:Uf});const Bf=_t({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var jf=Object.freeze({__proto__:null,base8:Bf});const kf=Nn({prefix:"9",name:"base10",alphabet:"0123456789"});var Hf=Object.freeze({__proto__:null,base10:kf});const zf=_t({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Wf=_t({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var qf=Object.freeze({__proto__:null,base16:zf,base16upper:Wf});const Vf=_t({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Kf=_t({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Gf=_t({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Zf=_t({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Yf=_t({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Jf=_t({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Xf=_t({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Qf=_t({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),e1=_t({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var t1=Object.freeze({__proto__:null,base32:Vf,base32upper:Kf,base32pad:Gf,base32padupper:Zf,base32hex:Yf,base32hexupper:Jf,base32hexpad:Xf,base32hexpadupper:Qf,base32z:e1});const r1=Nn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),n1=Nn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var i1=Object.freeze({__proto__:null,base36:r1,base36upper:n1});const s1=Nn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),o1=Nn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var a1=Object.freeze({__proto__:null,base58btc:s1,base58flickr:o1});const c1=_t({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),l1=_t({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),u1=_t({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),h1=_t({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var d1=Object.freeze({__proto__:null,base64:c1,base64pad:l1,base64url:u1,base64urlpad:h1});const tl=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}"),f1=tl.reduce((t,e,r)=>(t[r]=e,t),[]),p1=tl.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function g1(t){return t.reduce((e,r)=>(e+=f1[r],e),"")}function m1(t){const e=[];for(const r of t){const n=p1[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const w1=Yi({prefix:"\u{1F680}",name:"base256emoji",encode:g1,decode:m1});var y1=Object.freeze({__proto__:null,base256emoji:w1}),b1=nl,rl=128,v1=127,_1=~v1,E1=Math.pow(2,31);function nl(t,e,r){e=e||[],r=r||0;for(var n=r;t>=E1;)e[r++]=t&255|rl,t/=128;for(;t&_1;)e[r++]=t&255|rl,t>>>=7;return e[r]=t|0,nl.bytes=r-n+1,e}var x1=uo,C1=128,il=127;function uo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw uo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&il)<<i:(o&il)*Math.pow(2,i),i+=7}while(o>=C1);return uo.bytes=s-n,r}var S1=Math.pow(2,7),D1=Math.pow(2,14),I1=Math.pow(2,21),O1=Math.pow(2,28),A1=Math.pow(2,35),$1=Math.pow(2,42),P1=Math.pow(2,49),T1=Math.pow(2,56),R1=Math.pow(2,63),N1=function(t){return t<S1?1:t<D1?2:t<I1?3:t<O1?4:t<A1?5:t<$1?6:t<P1?7:t<T1?8:t<R1?9:10},L1={encode:b1,decode:x1,encodingLength:N1},sl=L1;const ol=(t,e,r=0)=>(sl.encode(t,e,r),e),al=t=>sl.encodingLength(t),ho=(t,e)=>{const r=e.byteLength,n=al(t),i=n+al(r),s=new Uint8Array(i+r);return ol(t,s,0),ol(r,s,n),s.set(e,i),new M1(t,r,e,s)};class M1{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const cl=({name:t,code:e,encode:r})=>new U1(t,e,r);class U1{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?ho(this.code,r):r.then(n=>ho(this.code,n))}else throw Error("Unknown type, must be binary type")}}const ll=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),F1=cl({name:"sha2-256",code:18,encode:ll("SHA-256")}),B1=cl({name:"sha2-512",code:19,encode:ll("SHA-512")});var j1=Object.freeze({__proto__:null,sha256:F1,sha512:B1});const ul=0,k1="identity",hl=Qc;var H1=Object.freeze({__proto__:null,identity:{code:ul,name:k1,encode:hl,digest:t=>ho(ul,hl(t))}});new TextEncoder,new TextDecoder;const dl={...Mf,...Ff,...jf,...Hf,...qf,...t1,...i1,...a1,...d1,...y1};({...j1,...H1});function fl(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const pl=fl("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),fo=fl("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=Xc(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),gl={utf8:pl,"utf-8":pl,hex:dl.base16,latin1:fo,ascii:fo,binary:fo,...dl};function $t(t,e="utf8"){const r=gl[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 Pt(t,e="utf8"){const r=gl[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))},z1=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),W1=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),q1=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}(),V1=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),K1=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),G1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Z1=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,wl=3,Y1=[["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",G1]],yl=[["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 J1(t){return t?bl(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new K1:typeof navigator<"u"?bl(navigator.userAgent):ep()}function X1(t){return t!==""&&Y1.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 bl(t){var e=X1(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new V1;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<wl&&(i=ml(ml([],i,!0),tp(wl-i.length),!0)):i=[];var s=i.join("."),o=Q1(t),a=Z1.exec(t);return a&&a[1]?new q1(r,s,o,a[1]):new z1(r,s,o)}function Q1(t){for(var e=0,r=yl.length;e<r;e++){var n=yl[e],i=n[0],s=n[1],o=s.exec(t);if(o)return i}return null}function ep(){var t=typeof process<"u"&&process.version;return t?new W1(process.version.slice(1)):null}function tp(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var ge={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -11,7 +11,7 @@
|
|
|
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 po=function(t,e){return po=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])},po(t,e)};function np(t,e){po(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var go=function(){return go=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},go.apply(this,arguments)};function ip(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 sp(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 op(t,e){return function(r,n){e(r,n,t)}}function ap(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function cp(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(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function lp(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 up(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function hp(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function mo(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 vl(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 dp(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(vl(arguments[e]));return t}function fp(){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 Ln(t){return this instanceof Ln?(this.v=t,this):new Ln(t)}function pp(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(m){n[m]&&(i[m]=function(y){return new Promise(function(E,T){s.push([m,y,E,T])>1||a(m,y)})})}function a(m,y){try{c(n[m](y))}catch(E){w(s[0][3],E)}}function c(m){m.value instanceof Ln?Promise.resolve(m.value.v).then(l,p):w(s[0][2],m)}function l(m){a("next",m)}function p(m){a("throw",m)}function w(m,y){m(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function gp(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:Ln(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function mp(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 mo=="function"?mo(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 wp(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function yp(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 bp(t){return t&&t.__esModule?t:{default:t}}function vp(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function _p(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 Ep=Object.freeze({__proto__:null,__extends:np,get __assign(){return go},__rest:ip,__decorate:sp,__param:op,__metadata:ap,__awaiter:cp,__generator:lp,__createBinding:up,__exportStar:hp,__values:mo,__read:vl,__spread:dp,__spreadArrays:fp,__await:Ln,__asyncGenerator:pp,__asyncDelegator:gp,__asyncValues:mp,__makeTemplateObject:wp,__importStar:yp,__importDefault:bp,__classPrivateFieldGet:vp,__classPrivateFieldSet:_p}),Ji=Ar(Ep),wo={},Mn={},_l;function xp(){if(_l)return Mn;_l=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Mn.delay=t,Mn}var $r={},yo={},Pr={},El;function Cp(){return El||(El=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.ONE_THOUSAND=Pr.ONE_HUNDRED=void 0,Pr.ONE_HUNDRED=100,Pr.ONE_THOUSAND=1e3),Pr}var bo={},xl;function Sp(){return xl||(xl=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}(bo)),bo}var Cl;function Sl(){return Cl||(Cl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Ji;e.__exportStar(Cp(),t),e.__exportStar(Sp(),t)}(yo)),yo}var Dl;function Dp(){if(Dl)return $r;Dl=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.fromMiliseconds=$r.toMiliseconds=void 0;const t=Sl();function e(n){return n*t.ONE_THOUSAND}$r.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return $r.fromMiliseconds=r,$r}var Il;function Ip(){return Il||(Il=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Ji;e.__exportStar(xp(),t),e.__exportStar(Dp(),t)}(wo)),wo}var cn={},Ol;function Op(){if(Ol)return cn;Ol=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.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 cn.Watch=t,cn.default=t,cn}var vo={},Un={},Al;function Ap(){if(Al)return Un;Al=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.IWatch=void 0;class t{}return Un.IWatch=t,Un}var $l;function $p(){return $l||($l=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Ji.__exportStar(Ap(),t)}(vo)),vo}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Ji;e.__exportStar(Ip(),t),e.__exportStar(Op(),t),e.__exportStar($p(),t),e.__exportStar(Sl(),t)})(ge);var ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.getLocalStorage=ze.getLocalStorageOrThrow=ze.getCrypto=ze.getCryptoOrThrow=Tl=ze.getLocation=ze.getLocationOrThrow=_o=ze.getNavigator=ze.getNavigatorOrThrow=Pl=ze.getDocument=ze.getDocumentOrThrow=ze.getFromWindowOrThrow=ze.getFromWindow=void 0;function Tr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}ze.getFromWindow=Tr;function ln(t){const e=Tr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}ze.getFromWindowOrThrow=ln;function Pp(){return ln("document")}ze.getDocumentOrThrow=Pp;function Tp(){return Tr("document")}var Pl=ze.getDocument=Tp;function Rp(){return ln("navigator")}ze.getNavigatorOrThrow=Rp;function Np(){return Tr("navigator")}var _o=ze.getNavigator=Np;function Lp(){return ln("location")}ze.getLocationOrThrow=Lp;function Mp(){return Tr("location")}var Tl=ze.getLocation=Mp;function Up(){return ln("crypto")}ze.getCryptoOrThrow=Up;function Fp(){return Tr("crypto")}ze.getCrypto=Fp;function Bp(){return ln("localStorage")}ze.getLocalStorageOrThrow=Bp;function jp(){return Tr("localStorage")}ze.getLocalStorage=jp;var Eo={};Object.defineProperty(Eo,"__esModule",{value:!0});var Rl=Eo.getWindowMetadata=void 0;const Nl=ze;function kp(){let t,e;try{t=Nl.getDocumentOrThrow(),e=Nl.getLocationOrThrow()}catch{return null}function r(){const w=t.getElementsByTagName("link"),m=[];for(let y=0;y<w.length;y++){const E=w[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 x=e.pathname.split("/");x.pop();const O=x.join("/");L+=O+"/"+R}m.push(L)}else if(R.indexOf("//")===0){const L=e.protocol+R;m.push(L)}else m.push(R)}}return m}function n(...w){const m=t.getElementsByTagName("meta");for(let y=0;y<m.length;y++){const E=m[y],T=["itemprop","property","name"].map(R=>E.getAttribute(R)).filter(R=>R?w.includes(R):!1);if(T.length&&T){const R=E.getAttribute("content");if(R)return R}}return""}function i(){let w=n("name","og:site_name","og:title","twitter:title");return w||(w=t.title),w}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}}Rl=Eo.getWindowMetadata=kp;var Fn={},Hp=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Ll="%[a-f0-9]{2}",Ml=new RegExp("("+Ll+")|([^%]+?)","gi"),Ul=new RegExp("("+Ll+")+","gi");function xo(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([],xo(r),xo(n))}function zp(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(Ml)||[],r=1;r<e.length;r++)t=xo(e,r).join(""),e=t.match(Ml)||[];return t}}function Wp(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=Ul.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=zp(r[0]);n!==r[0]&&(e[r[0]]=n)}r=Ul.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 qp=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 Wp(t)}},Vp=(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)]},Kp=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=Hp,r=qp,n=Vp,i=Kp,s=x=>x==null,o=Symbol("encodeFragmentIdentifier");function a(x){switch(x.arrayFormat){case"index":return O=>(_,D)=>{const I=_.length;return D===void 0||x.skipNull&&D===null||x.skipEmptyString&&D===""?_:D===null?[..._,[p(O,x),"[",I,"]"].join("")]:[..._,[p(O,x),"[",p(I,x),"]=",p(D,x)].join("")]};case"bracket":return O=>(_,D)=>D===void 0||x.skipNull&&D===null||x.skipEmptyString&&D===""?_:D===null?[..._,[p(O,x),"[]"].join("")]:[..._,[p(O,x),"[]=",p(D,x)].join("")];case"colon-list-separator":return O=>(_,D)=>D===void 0||x.skipNull&&D===null||x.skipEmptyString&&D===""?_:D===null?[..._,[p(O,x),":list="].join("")]:[..._,[p(O,x),":list=",p(D,x)].join("")];case"comma":case"separator":case"bracket-separator":{const O=x.arrayFormat==="bracket-separator"?"[]=":"=";return _=>(D,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?D:(I=I===null?"":I,D.length===0?[[p(_,x),O,p(I,x)].join("")]:[[D,p(I,x)].join(x.arrayFormatSeparator)])}default:return O=>(_,D)=>D===void 0||x.skipNull&&D===null||x.skipEmptyString&&D===""?_:D===null?[..._,p(O,x)]:[..._,[p(O,x),"=",p(D,x)].join("")]}}function c(x){let O;switch(x.arrayFormat){case"index":return(_,D,I)=>{if(O=/\[(\d*)\]$/.exec(_),_=_.replace(/\[\d*\]$/,""),!O){I[_]=D;return}I[_]===void 0&&(I[_]={}),I[_][O[1]]=D};case"bracket":return(_,D,I)=>{if(O=/(\[\])$/.exec(_),_=_.replace(/\[\]$/,""),!O){I[_]=D;return}if(I[_]===void 0){I[_]=[D];return}I[_]=[].concat(I[_],D)};case"colon-list-separator":return(_,D,I)=>{if(O=/(:list)$/.exec(_),_=_.replace(/:list$/,""),!O){I[_]=D;return}if(I[_]===void 0){I[_]=[D];return}I[_]=[].concat(I[_],D)};case"comma":case"separator":return(_,D,I)=>{const h=typeof D=="string"&&D.includes(x.arrayFormatSeparator),v=typeof D=="string"&&!h&&w(D,x).includes(x.arrayFormatSeparator);D=v?w(D,x):D;const H=h||v?D.split(x.arrayFormatSeparator).map(j=>w(j,x)):D===null?D:w(D,x);I[_]=H};case"bracket-separator":return(_,D,I)=>{const h=/(\[\])$/.test(_);if(_=_.replace(/\[\]$/,""),!h){I[_]=D&&w(D,x);return}const v=D===null?[]:D.split(x.arrayFormatSeparator).map(H=>w(H,x));if(I[_]===void 0){I[_]=v;return}I[_]=[].concat(I[_],v)};default:return(_,D,I)=>{if(I[_]===void 0){I[_]=D;return}I[_]=[].concat(I[_],D)}}}function l(x){if(typeof x!="string"||x.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function p(x,O){return O.encode?O.strict?e(x):encodeURIComponent(x):x}function w(x,O){return O.decode?r(x):x}function m(x){return Array.isArray(x)?x.sort():typeof x=="object"?m(Object.keys(x)).sort((O,_)=>Number(O)-Number(_)).map(O=>x[O]):x}function y(x){const O=x.indexOf("#");return O!==-1&&(x=x.slice(0,O)),x}function E(x){let O="";const _=x.indexOf("#");return _!==-1&&(O=x.slice(_)),O}function T(x){x=y(x);const O=x.indexOf("?");return O===-1?"":x.slice(O+1)}function R(x,O){return O.parseNumbers&&!Number.isNaN(Number(x))&&typeof x=="string"&&x.trim()!==""?x=Number(x):O.parseBooleans&&x!==null&&(x.toLowerCase()==="true"||x.toLowerCase()==="false")&&(x=x.toLowerCase()==="true"),x}function L(x,O){O=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},O),l(O.arrayFormatSeparator);const _=c(O),D=Object.create(null);if(typeof x!="string"||(x=x.trim().replace(/^[?#&]/,""),!x))return D;for(const I of x.split("&")){if(I==="")continue;let[h,v]=n(O.decode?I.replace(/\+/g," "):I,"=");v=v===void 0?null:["comma","separator","bracket-separator"].includes(O.arrayFormat)?v:w(v,O),_(w(h,O),v,D)}for(const I of Object.keys(D)){const h=D[I];if(typeof h=="object"&&h!==null)for(const v of Object.keys(h))h[v]=R(h[v],O);else D[I]=R(h,O)}return O.sort===!1?D:(O.sort===!0?Object.keys(D).sort():Object.keys(D).sort(O.sort)).reduce((I,h)=>{const v=D[h];return Boolean(v)&&typeof v=="object"&&!Array.isArray(v)?I[h]=m(v):I[h]=v,I},Object.create(null))}t.extract=T,t.parse=L,t.stringify=(x,O)=>{if(!x)return"";O=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},O),l(O.arrayFormatSeparator);const _=v=>O.skipNull&&s(x[v])||O.skipEmptyString&&x[v]==="",D=a(O),I={};for(const v of Object.keys(x))_(v)||(I[v]=x[v]);const h=Object.keys(I);return O.sort!==!1&&h.sort(O.sort),h.map(v=>{const H=x[v];return H===void 0?"":H===null?p(v,O):Array.isArray(H)?H.length===0&&O.arrayFormat==="bracket-separator"?p(v,O)+"[]":H.reduce(D(v),[]).join("&"):p(v,O)+"="+p(H,O)}).filter(v=>v.length>0).join("&")},t.parseUrl=(x,O)=>{O=Object.assign({decode:!0},O);const[_,D]=n(x,"#");return Object.assign({url:_.split("?")[0]||"",query:L(T(x),O)},O&&O.parseFragmentIdentifier&&D?{fragmentIdentifier:w(D,O)}:{})},t.stringifyUrl=(x,O)=>{O=Object.assign({encode:!0,strict:!0,[o]:!0},O);const _=y(x.url).split("?")[0]||"",D=t.extract(x.url),I=t.parse(D,{sort:!1}),h=Object.assign(I,x.query);let v=t.stringify(h,O);v&&(v=`?${v}`);let H=E(x.url);return x.fragmentIdentifier&&(H=`#${O[o]?p(x.fragmentIdentifier,O):x.fragmentIdentifier}`),`${_}${v}${H}`},t.pick=(x,O,_)=>{_=Object.assign({parseFragmentIdentifier:!0,[o]:!1},_);const{url:D,query:I,fragmentIdentifier:h}=t.parseUrl(x,_);return t.stringifyUrl({url:D,query:i(I,O),fragmentIdentifier:h},_)},t.exclude=(x,O,_)=>{const D=Array.isArray(O)?I=>!O.includes(I):(I,h)=>!O(I,h);return t.pick(x,D,_)}})(Fn);const Gp={waku:{publish:"waku_publish",subscribe:"waku_subscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe"},irn:{publish:"irn_publish",subscribe:"irn_subscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe"},iridium:{publish:"iridium_publish",subscribe:"iridium_subscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe"}},Fl=":";function Zp(t){const{namespace:e,reference:r}=t;return[e,r].join(Fl)}function Yp(t){const[e,r,n]=t.split(Fl);return{namespace:e,reference:r,address:n}}function Jp(t,e){const r=[];return t.forEach(n=>{const i=e(n);r.includes(i)||r.push(i)}),r}function Xp(t){const{namespace:e,reference:r}=Yp(t);return Zp({namespace:e,reference:r})}function Qp(t){return Jp(t,Xp)}function eg(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 tg(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...Qp(i.accounts))}),r}const Bl="base10",Tt="base16",Co="base64pad",So="utf8",jl=0,Rr=1,rg=0,kl=1,Do=12,Io=32;function ng(){const t=co.generateKeyPair();return{privateKey:Pt(t.secretKey,Tt),publicKey:Pt(t.publicKey,Tt)}}function Oo(){const t=an.randomBytes(Io);return Pt(t,Tt)}function ig(t,e){const r=co.sharedKey($t(t,Tt),$t(e,Tt)),n=new pf(Zi.SHA256,r).expand(Io);return Pt(n,Tt)}function sg(t){const e=Zi.hash($t(t,Tt));return Pt(e,Tt)}function Ao(t){const e=Zi.hash($t(t,So));return Pt(e,Tt)}function og(t){return $t(`${t}`,Bl)}function Bn(t){return Number(Pt(t,Bl))}function ag(t){const e=og(typeof t.type<"u"?t.type:jl);if(Bn(e)===Rr&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?$t(t.senderPublicKey,Tt):void 0,n=typeof t.iv<"u"?$t(t.iv,Tt):an.randomBytes(Do),i=new to.ChaCha20Poly1305($t(t.symKey,Tt)).seal(n,$t(t.message,So));return lg({type:e,sealed:i,iv:n,senderPublicKey:r})}function cg(t){const e=new to.ChaCha20Poly1305($t(t.symKey,Tt)),{sealed:r,iv:n}=$o(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Pt(i,So)}function lg(t){if(Bn(t.type)===Rr){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Pt(lo([t.type,t.senderPublicKey,t.iv,t.sealed]),Co)}return Pt(lo([t.type,t.iv,t.sealed]),Co)}function $o(t){const e=$t(t,Co),r=e.slice(rg,kl),n=kl;if(Bn(r)===Rr){const a=n+Io,c=a+Do,l=e.slice(n,a),p=e.slice(a,c),w=e.slice(c);return{type:r,sealed:w,iv:p,senderPublicKey:l}}const i=n+Do,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function ug(t,e){const r=$o(t);return Hl({type:Bn(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Pt(r.senderPublicKey,Tt):void 0,receiverPublicKey:e?.receiverPublicKey})}function Hl(t){const e=t?.type||jl;if(e===Rr){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 zl(t){return t.type===Rr&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var hg=Object.defineProperty,Wl=Object.getOwnPropertySymbols,dg=Object.prototype.hasOwnProperty,fg=Object.prototype.propertyIsEnumerable,ql=(t,e,r)=>e in t?hg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vl=(t,e)=>{for(var r in e||(e={}))dg.call(e,r)&&ql(t,r,e[r]);if(Wl)for(var r of Wl(e))fg.call(e,r)&&ql(t,r,e[r]);return t};const pg="ReactNative",jn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},gg="js";function Kl(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function mg(){return!Pl()&&!!_o()&&navigator.product===pg}function wg(){return!Kl()&&!!_o()}function yg(){return mg()?jn.reactNative:Kl()?jn.node:wg()?jn.browser:jn.unknown}function bg(t,e){let r=Fn.parse(t);return r=Vl(Vl({},r),e),t=Fn.stringify(r),t}function vg(){return Rl()||{name:"",description:"",url:"",icons:[""]}}function _g(){const t=X1();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 Eg(){var t;const e=yg();return e===jn.browser?[e,((t=Tl())==null?void 0:t.host)||"unknown"].join(":"):e}function xg(t,e,r){const n=_g(),i=Eg();return[[t,e].join("-"),[gg,r].join("-"),n,i].join("/")}function Cg({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s}){const o=r.split("?"),a=xg(t,e,n),c={auth:i,ua:a,projectId:s},l=bg(o[1]||"",c);return o[0]+"?"+l}function gr(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Gl(t){return Object.fromEntries(t.entries())}function Zl(t){return new Map(Object.entries(t))}function Xt(t,e){return ge.fromMiliseconds((e||Date.now())+ge.toMiliseconds(t))}function mr(t){return ge.fromMiliseconds(Date.now())>=ge.toMiliseconds(t)}function Nr(t){const e=ge.toMiliseconds(t||ge.FIVE_MINUTES);let r,n,i;return{resolve:s=>{i&&r&&(clearTimeout(i),r(s))},reject:s=>{i&&n&&(clearTimeout(i),n(s))},done:()=>new Promise((s,o)=>{i=setTimeout(o,e),r=s,n=o})}}function Yl(t,e){return new Promise(async(r,n)=>{const i=setTimeout(()=>n(),e),s=await t;clearTimeout(i),r(s)})}function Jl(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 Sg(t){return Jl("topic",t)}function Dg(t){return Jl("id",t)}function Xl(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 Qe(t,e){return`${t}${e?`:${e}`:""}`}const Ig="irn";function Po(t){return t?.relay||{protocol:Ig}}function To(t){const e=Gp[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Og=Object.defineProperty,Ql=Object.getOwnPropertySymbols,Ag=Object.prototype.hasOwnProperty,$g=Object.prototype.propertyIsEnumerable,eu=(t,e,r)=>e in t?Og(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pg=(t,e)=>{for(var r in e||(e={}))Ag.call(e,r)&&eu(t,r,e[r]);if(Ql)for(var r of Ql(e))$g.call(e,r)&&eu(t,r,e[r]);return t};function Tg(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 Rg(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=Fn.parse(s);return{protocol:n,topic:i[0],version:parseInt(i[1],10),symKey:o.symKey,relay:Tg(o)}}function Ng(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 Lg(t){return`${t.protocol}:${t.topic}@${t.version}?`+Fn.stringify(Pg({symKey:t.symKey},Ng(t.relay)))}function kn(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Mg(t){const e=[];return Object.values(t).forEach(r=>{e.push(...kn(r.accounts))}),e}function Ug(t,e){const r=[];return Object.values(t).forEach(n=>{kn(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Fg(t,e){const r=[];return Object.values(t).forEach(n=>{kn(n.accounts).includes(e)&&r.push(...n.events)}),r}function Bg(t,e){const r=Qi(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 jg={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}},kg={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 se(t,e){const{message:r,code:n}=kg[t];return{message:e?`${r} ${e}`:r,code:n}}function ot(t,e){const{message:r,code:n}=jg[t];return{message:e?`${r} ${e}`:r,code:n}}function un(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Xi(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ht(t){return typeof t>"u"}function Et(t,e){return e&&Ht(t)?!0:typeof t=="string"&&Boolean(t.trim().length)}function Ro(t,e){return e&&Ht(t)?!0:typeof t=="number"&&!isNaN(t)}function Hg(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return gr(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],p=kn(a),w=r[o];(!gr(w.chains,p)||!gr(w.methods,c)||!gr(w.events,l))&&(s=!1)}),s):!1}function No(t){return Et(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function zg(t){if(Et(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&No(r)}}return!1}function Wg(t){if(Et(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function qg(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Vg(t){return t?.topic}function Kg(t,e){let r=null;return Et(t?.publicKey,!1)||(r=se("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function tu(t){let e=!0;return un(t)?t.length&&(e=t.every(r=>Et(r,!1))):e=!1,e}function Gg(t,e,r){let n=null;return un(e)?e.forEach(i=>{n||(!No(i)||!i.includes(t))&&(n=ot("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=ot("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function Zg(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;const s=Gg(n,i?.chains,`${e} requiredNamespace`);s&&(r=s)}),r}function Yg(t,e){let r=null;return un(t)?t.forEach(n=>{r||zg(n)||(r=ot("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=ot("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Jg(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Yg(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function Xg(t,e){let r=null;return tu(t?.methods)?tu(t?.events)||(r=ot("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=ot("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function ru(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Xg(n,`${e}, namespace`);i&&(r=i)}),r}function Qg(t,e){let r=null;if(t&&Xi(t)){const n=ru(t,e);n&&(r=n);const i=Zg(t,e);i&&(r=i)}else r=se("MISSING_OR_INVALID",`${e}, requiredNamespaces should be an object with data`);return r}function Qi(t,e){let r=null;if(t&&Xi(t)){const n=ru(t,e);n&&(r=n);const i=Jg(t,e);i&&(r=i)}else r=se("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function nu(t){return Et(t.protocol,!0)}function e2(t,e){let r=!1;return e&&!t?r=!0:t&&un(t)&&t.length&&t.forEach(n=>{r=nu(n)}),r}function t2(t){return typeof t=="number"}function Rt(t){return typeof t<"u"&&typeof t!==null}function r2(t){return!(!t||typeof t!="object"||!t.code||!Ro(t.code,!1)||!t.message||!Et(t.message,!1))}function n2(t){return!(Ht(t)||!Et(t.method,!1))}function i2(t){return!(Ht(t)||Ht(t.result)&&Ht(t.error)||!Ro(t.id,!1)||!Et(t.jsonrpc,!1))}function s2(t){return!(Ht(t)||!Et(t.name,!1))}function iu(t,e){return!(!No(e)||!Mg(t).includes(e))}function o2(t,e,r){return Et(r,!1)?Ug(t,e).includes(r):!1}function a2(t,e,r){return Et(r,!1)?Fg(t,e).includes(r):!1}function su(t,e,r){let n=null;const i=Object.keys(t),s=Object.keys(e);return gr(i,s)?i.forEach(o=>{if(n)return;const a=t[o].chains,c=kn(e[o].accounts);gr(a,c)?gr(t[o].methods,e[o].methods)?gr(t[o].events,e[o].events)||(n=se("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy requiredNamespaces events for ${o}`)):n=se("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy requiredNamespaces methods for ${o}`):n=se("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy requiredNamespaces chains for ${o}`)}):n=se("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces`),n}function c2(t,e){return Ro(t,!1)&&t<=e.max&&t>=e.min}function l2(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var u2=h2;function h2(t,e,r){var n=r&&r.stringify||l2,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,w=-1,m=t&&t.length||0,y=0;y<m;){if(t.charCodeAt(y)===37&&y+1<m){switch(w=w>-1?w:0,t.charCodeAt(y+1)){case 100:case 102:if(p>=c||e[p]==null)break;w<y&&(l+=t.slice(w,y)),l+=Number(e[p]),w=y+2,y++;break;case 105:if(p>=c||e[p]==null)break;w<y&&(l+=t.slice(w,y)),l+=Math.floor(Number(e[p])),w=y+2,y++;break;case 79:case 111:case 106:if(p>=c||e[p]===void 0)break;w<y&&(l+=t.slice(w,y));var E=typeof e[p];if(E==="string"){l+="'"+e[p]+"'",w=y+2,y++;break}if(E==="function"){l+=e[p].name||"<anonymous>",w=y+2,y++;break}l+=n(e[p]),w=y+2,y++;break;case 115:if(p>=c)break;w<y&&(l+=t.slice(w,y)),l+=String(e[p]),w=y+2,y++;break;case 37:w<y&&(l+=t.slice(w,y)),l+="%",w=y+2,y++,p--;break}++p}++y}return w===-1?t:(w<m&&(l+=t.slice(w)),l)}const ou=u2;var Hn=Qt;const zn=_2().console||{},d2={mapHttpRequest:ts,mapHttpResponse:ts,wrapRequestSerializer:Mo,wrapResponseSerializer:Mo,wrapErrorSerializer:Mo,req:ts,res:ts,err:w2};function f2(t,e){return Array.isArray(t)?t.filter(function(n){return n!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function Qt(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||zn;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=f2(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=Wn),Object.defineProperty(c,"levelVal",{get:p}),Object.defineProperty(c,"level",{get:w,set:m});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:y2(t)};c.levels=Qt.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=Wn,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=y,e&&(c._logEvent=Lo());function p(){return this.level==="silent"?1/0:this.levels.values[this.level]}function w(){return this._level}function m(E){if(E!=="silent"&&!this.levels.values[E])throw Error("unknown level "+E);this._level=E,hn(l,c,"error","log"),hn(l,c,"fatal","error"),hn(l,c,"warn","error"),hn(l,c,"info","log"),hn(l,c,"debug","log"),hn(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),x=t.browser.serialize===!0?Object.keys(L):i;delete E.serializers,es([E],x,L,this._stdErrSerialize)}function O(_){this._childLevel=(_._childLevel|0)+1,this.error=dn(_,E,"error"),this.fatal=dn(_,E,"fatal"),this.warn=dn(_,E,"warn"),this.info=dn(_,E,"info"),this.debug=dn(_,E,"debug"),this.trace=dn(_,E,"trace"),L&&(this.serializers=L,this._serialize=x),e&&(this._logEvent=Lo([].concat(_._logEvent.bindings,E)))}return O.prototype=this,new O(this)}return c}Qt.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"}},Qt.stdSerializers=d2,Qt.stdTimeFunctions=Object.assign({},{nullTime:au,epochTime:cu,unixTime:b2,isoTime:v2});function hn(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?Wn:i[r]?i[r]:zn[r]||zn[n]||Wn,p2(t,e,r)}function p2(t,e,r){!t.transmit&&e[r]===Wn||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===zn?zn:this;for(var c=0;c<o.length;c++)o[c]=arguments[c];if(t.serialize&&!t.asObject&&es(o,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?n.call(a,g2(this,r,o,s)):n.apply(a,o),t.transmit){const l=t.transmit.level||e.level,p=Qt.levels.values[l],w=Qt.levels.values[r];if(w<p)return;m2(this,{ts:s,methodLevel:r,methodValue:w,transmitLevel:l,transmitValue:Qt.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},o)}}}(e[r]))}function g2(t,e,r,n){t._serialize&&es(r,t._serialize,t.serializers,t._stdErrSerialize);const i=r.slice();let s=i[0];const o={};n&&(o.time=n),o.level=Qt.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?ou(i.shift(),i):void 0}else typeof s=="string"&&(s=ou(i.shift(),i));return s!==void 0&&(o.msg=s),o}function es(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=Qt.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 dn(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 m2(t,e,r){const n=e.send,i=e.ts,s=e.methodLevel,o=e.methodValue,a=e.val,c=t._logEvent.bindings;es(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=Lo(c)}function Lo(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function w2(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 y2(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?au:cu}function ts(){return{}}function Mo(t){return t}function Wn(){}function au(){return!1}function cu(){return Date.now()}function b2(){return Math.round(Date.now()/1e3)}function v2(){return new Date(Date.now()).toISOString()}function _2(){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 rs={};/*! *****************************************************************************
|
|
14
|
+
***************************************************************************** */var po=function(t,e){return po=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])},po(t,e)};function rp(t,e){po(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var go=function(){return go=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},go.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 ip(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 sp(t,e){return function(r,n){e(r,n,t)}}function op(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ap(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(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function cp(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 lp(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function up(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function mo(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 vl(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 hp(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(vl(arguments[e]));return t}function dp(){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 Ln(t){return this instanceof Ln?(this.v=t,this):new Ln(t)}function fp(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(m){n[m]&&(i[m]=function(y){return new Promise(function(E,T){s.push([m,y,E,T])>1||a(m,y)})})}function a(m,y){try{c(n[m](y))}catch(E){w(s[0][3],E)}}function c(m){m.value instanceof Ln?Promise.resolve(m.value.v).then(l,p):w(s[0][2],m)}function l(m){a("next",m)}function p(m){a("throw",m)}function w(m,y){m(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function pp(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:Ln(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function gp(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 mo=="function"?mo(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 mp(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function wp(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 yp(t){return t&&t.__esModule?t:{default:t}}function bp(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function vp(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 _p=Object.freeze({__proto__:null,__extends:rp,get __assign(){return go},__rest:np,__decorate:ip,__param:sp,__metadata:op,__awaiter:ap,__generator:cp,__createBinding:lp,__exportStar:up,__values:mo,__read:vl,__spread:hp,__spreadArrays:dp,__await:Ln,__asyncGenerator:fp,__asyncDelegator:pp,__asyncValues:gp,__makeTemplateObject:mp,__importStar:wp,__importDefault:yp,__classPrivateFieldGet:bp,__classPrivateFieldSet:vp}),Ji=Ar(_p),wo={},Mn={},_l;function Ep(){if(_l)return Mn;_l=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Mn.delay=t,Mn}var $r={},yo={},Pr={},El;function xp(){return El||(El=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.ONE_THOUSAND=Pr.ONE_HUNDRED=void 0,Pr.ONE_HUNDRED=100,Pr.ONE_THOUSAND=1e3),Pr}var bo={},xl;function Cp(){return xl||(xl=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}(bo)),bo}var Cl;function Sl(){return Cl||(Cl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Ji;e.__exportStar(xp(),t),e.__exportStar(Cp(),t)}(yo)),yo}var Dl;function Sp(){if(Dl)return $r;Dl=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.fromMiliseconds=$r.toMiliseconds=void 0;const t=Sl();function e(n){return n*t.ONE_THOUSAND}$r.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return $r.fromMiliseconds=r,$r}var Il;function Dp(){return Il||(Il=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Ji;e.__exportStar(Ep(),t),e.__exportStar(Sp(),t)}(wo)),wo}var cn={},Ol;function Ip(){if(Ol)return cn;Ol=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.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 cn.Watch=t,cn.default=t,cn}var vo={},Un={},Al;function Op(){if(Al)return Un;Al=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.IWatch=void 0;class t{}return Un.IWatch=t,Un}var $l;function Ap(){return $l||($l=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Ji.__exportStar(Op(),t)}(vo)),vo}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Ji;e.__exportStar(Dp(),t),e.__exportStar(Ip(),t),e.__exportStar(Ap(),t),e.__exportStar(Sl(),t)})(ge);var ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.getLocalStorage=ze.getLocalStorageOrThrow=ze.getCrypto=ze.getCryptoOrThrow=Tl=ze.getLocation=ze.getLocationOrThrow=_o=ze.getNavigator=ze.getNavigatorOrThrow=Pl=ze.getDocument=ze.getDocumentOrThrow=ze.getFromWindowOrThrow=ze.getFromWindow=void 0;function Tr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}ze.getFromWindow=Tr;function ln(t){const e=Tr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}ze.getFromWindowOrThrow=ln;function $p(){return ln("document")}ze.getDocumentOrThrow=$p;function Pp(){return Tr("document")}var Pl=ze.getDocument=Pp;function Tp(){return ln("navigator")}ze.getNavigatorOrThrow=Tp;function Rp(){return Tr("navigator")}var _o=ze.getNavigator=Rp;function Np(){return ln("location")}ze.getLocationOrThrow=Np;function Lp(){return Tr("location")}var Tl=ze.getLocation=Lp;function Mp(){return ln("crypto")}ze.getCryptoOrThrow=Mp;function Up(){return Tr("crypto")}ze.getCrypto=Up;function Fp(){return ln("localStorage")}ze.getLocalStorageOrThrow=Fp;function Bp(){return Tr("localStorage")}ze.getLocalStorage=Bp;var Eo={};Object.defineProperty(Eo,"__esModule",{value:!0});var Rl=Eo.getWindowMetadata=void 0;const Nl=ze;function jp(){let t,e;try{t=Nl.getDocumentOrThrow(),e=Nl.getLocationOrThrow()}catch{return null}function r(){const w=t.getElementsByTagName("link"),m=[];for(let y=0;y<w.length;y++){const E=w[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 x=e.pathname.split("/");x.pop();const O=x.join("/");L+=O+"/"+R}m.push(L)}else if(R.indexOf("//")===0){const L=e.protocol+R;m.push(L)}else m.push(R)}}return m}function n(...w){const m=t.getElementsByTagName("meta");for(let y=0;y<m.length;y++){const E=m[y],T=["itemprop","property","name"].map(R=>E.getAttribute(R)).filter(R=>R?w.includes(R):!1);if(T.length&&T){const R=E.getAttribute("content");if(R)return R}}return""}function i(){let w=n("name","og:site_name","og:title","twitter:title");return w||(w=t.title),w}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}}Rl=Eo.getWindowMetadata=jp;var Fn={},kp=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Ll="%[a-f0-9]{2}",Ml=new RegExp("("+Ll+")|([^%]+?)","gi"),Ul=new RegExp("("+Ll+")+","gi");function xo(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([],xo(r),xo(n))}function Hp(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(Ml)||[],r=1;r<e.length;r++)t=xo(e,r).join(""),e=t.match(Ml)||[];return t}}function zp(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=Ul.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=Hp(r[0]);n!==r[0]&&(e[r[0]]=n)}r=Ul.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 Wp=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 zp(t)}},qp=(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)]},Vp=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=kp,r=Wp,n=qp,i=Vp,s=x=>x==null,o=Symbol("encodeFragmentIdentifier");function a(x){switch(x.arrayFormat){case"index":return O=>(_,D)=>{const I=_.length;return D===void 0||x.skipNull&&D===null||x.skipEmptyString&&D===""?_:D===null?[..._,[p(O,x),"[",I,"]"].join("")]:[..._,[p(O,x),"[",p(I,x),"]=",p(D,x)].join("")]};case"bracket":return O=>(_,D)=>D===void 0||x.skipNull&&D===null||x.skipEmptyString&&D===""?_:D===null?[..._,[p(O,x),"[]"].join("")]:[..._,[p(O,x),"[]=",p(D,x)].join("")];case"colon-list-separator":return O=>(_,D)=>D===void 0||x.skipNull&&D===null||x.skipEmptyString&&D===""?_:D===null?[..._,[p(O,x),":list="].join("")]:[..._,[p(O,x),":list=",p(D,x)].join("")];case"comma":case"separator":case"bracket-separator":{const O=x.arrayFormat==="bracket-separator"?"[]=":"=";return _=>(D,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?D:(I=I===null?"":I,D.length===0?[[p(_,x),O,p(I,x)].join("")]:[[D,p(I,x)].join(x.arrayFormatSeparator)])}default:return O=>(_,D)=>D===void 0||x.skipNull&&D===null||x.skipEmptyString&&D===""?_:D===null?[..._,p(O,x)]:[..._,[p(O,x),"=",p(D,x)].join("")]}}function c(x){let O;switch(x.arrayFormat){case"index":return(_,D,I)=>{if(O=/\[(\d*)\]$/.exec(_),_=_.replace(/\[\d*\]$/,""),!O){I[_]=D;return}I[_]===void 0&&(I[_]={}),I[_][O[1]]=D};case"bracket":return(_,D,I)=>{if(O=/(\[\])$/.exec(_),_=_.replace(/\[\]$/,""),!O){I[_]=D;return}if(I[_]===void 0){I[_]=[D];return}I[_]=[].concat(I[_],D)};case"colon-list-separator":return(_,D,I)=>{if(O=/(:list)$/.exec(_),_=_.replace(/:list$/,""),!O){I[_]=D;return}if(I[_]===void 0){I[_]=[D];return}I[_]=[].concat(I[_],D)};case"comma":case"separator":return(_,D,I)=>{const h=typeof D=="string"&&D.includes(x.arrayFormatSeparator),v=typeof D=="string"&&!h&&w(D,x).includes(x.arrayFormatSeparator);D=v?w(D,x):D;const H=h||v?D.split(x.arrayFormatSeparator).map(j=>w(j,x)):D===null?D:w(D,x);I[_]=H};case"bracket-separator":return(_,D,I)=>{const h=/(\[\])$/.test(_);if(_=_.replace(/\[\]$/,""),!h){I[_]=D&&w(D,x);return}const v=D===null?[]:D.split(x.arrayFormatSeparator).map(H=>w(H,x));if(I[_]===void 0){I[_]=v;return}I[_]=[].concat(I[_],v)};default:return(_,D,I)=>{if(I[_]===void 0){I[_]=D;return}I[_]=[].concat(I[_],D)}}}function l(x){if(typeof x!="string"||x.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function p(x,O){return O.encode?O.strict?e(x):encodeURIComponent(x):x}function w(x,O){return O.decode?r(x):x}function m(x){return Array.isArray(x)?x.sort():typeof x=="object"?m(Object.keys(x)).sort((O,_)=>Number(O)-Number(_)).map(O=>x[O]):x}function y(x){const O=x.indexOf("#");return O!==-1&&(x=x.slice(0,O)),x}function E(x){let O="";const _=x.indexOf("#");return _!==-1&&(O=x.slice(_)),O}function T(x){x=y(x);const O=x.indexOf("?");return O===-1?"":x.slice(O+1)}function R(x,O){return O.parseNumbers&&!Number.isNaN(Number(x))&&typeof x=="string"&&x.trim()!==""?x=Number(x):O.parseBooleans&&x!==null&&(x.toLowerCase()==="true"||x.toLowerCase()==="false")&&(x=x.toLowerCase()==="true"),x}function L(x,O){O=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},O),l(O.arrayFormatSeparator);const _=c(O),D=Object.create(null);if(typeof x!="string"||(x=x.trim().replace(/^[?#&]/,""),!x))return D;for(const I of x.split("&")){if(I==="")continue;let[h,v]=n(O.decode?I.replace(/\+/g," "):I,"=");v=v===void 0?null:["comma","separator","bracket-separator"].includes(O.arrayFormat)?v:w(v,O),_(w(h,O),v,D)}for(const I of Object.keys(D)){const h=D[I];if(typeof h=="object"&&h!==null)for(const v of Object.keys(h))h[v]=R(h[v],O);else D[I]=R(h,O)}return O.sort===!1?D:(O.sort===!0?Object.keys(D).sort():Object.keys(D).sort(O.sort)).reduce((I,h)=>{const v=D[h];return Boolean(v)&&typeof v=="object"&&!Array.isArray(v)?I[h]=m(v):I[h]=v,I},Object.create(null))}t.extract=T,t.parse=L,t.stringify=(x,O)=>{if(!x)return"";O=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},O),l(O.arrayFormatSeparator);const _=v=>O.skipNull&&s(x[v])||O.skipEmptyString&&x[v]==="",D=a(O),I={};for(const v of Object.keys(x))_(v)||(I[v]=x[v]);const h=Object.keys(I);return O.sort!==!1&&h.sort(O.sort),h.map(v=>{const H=x[v];return H===void 0?"":H===null?p(v,O):Array.isArray(H)?H.length===0&&O.arrayFormat==="bracket-separator"?p(v,O)+"[]":H.reduce(D(v),[]).join("&"):p(v,O)+"="+p(H,O)}).filter(v=>v.length>0).join("&")},t.parseUrl=(x,O)=>{O=Object.assign({decode:!0},O);const[_,D]=n(x,"#");return Object.assign({url:_.split("?")[0]||"",query:L(T(x),O)},O&&O.parseFragmentIdentifier&&D?{fragmentIdentifier:w(D,O)}:{})},t.stringifyUrl=(x,O)=>{O=Object.assign({encode:!0,strict:!0,[o]:!0},O);const _=y(x.url).split("?")[0]||"",D=t.extract(x.url),I=t.parse(D,{sort:!1}),h=Object.assign(I,x.query);let v=t.stringify(h,O);v&&(v=`?${v}`);let H=E(x.url);return x.fragmentIdentifier&&(H=`#${O[o]?p(x.fragmentIdentifier,O):x.fragmentIdentifier}`),`${_}${v}${H}`},t.pick=(x,O,_)=>{_=Object.assign({parseFragmentIdentifier:!0,[o]:!1},_);const{url:D,query:I,fragmentIdentifier:h}=t.parseUrl(x,_);return t.stringifyUrl({url:D,query:i(I,O),fragmentIdentifier:h},_)},t.exclude=(x,O,_)=>{const D=Array.isArray(O)?I=>!O.includes(I):(I,h)=>!O(I,h);return t.pick(x,D,_)}})(Fn);const Kp={waku:{publish:"waku_publish",subscribe:"waku_subscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe"},irn:{publish:"irn_publish",subscribe:"irn_subscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe"},iridium:{publish:"iridium_publish",subscribe:"iridium_subscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe"}};function Gp(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}const Fl="base10",Tt="base16",Co="base64pad",So="utf8",Bl=0,Rr=1,Zp=0,jl=1,Do=12,Io=32;function Yp(){const t=co.generateKeyPair();return{privateKey:Pt(t.secretKey,Tt),publicKey:Pt(t.publicKey,Tt)}}function Oo(){const t=an.randomBytes(Io);return Pt(t,Tt)}function Jp(t,e){const r=co.sharedKey($t(t,Tt),$t(e,Tt)),n=new ff(Zi.SHA256,r).expand(Io);return Pt(n,Tt)}function Xp(t){const e=Zi.hash($t(t,Tt));return Pt(e,Tt)}function Ao(t){const e=Zi.hash($t(t,So));return Pt(e,Tt)}function Qp(t){return $t(`${t}`,Fl)}function Bn(t){return Number(Pt(t,Fl))}function eg(t){const e=Qp(typeof t.type<"u"?t.type:Bl);if(Bn(e)===Rr&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?$t(t.senderPublicKey,Tt):void 0,n=typeof t.iv<"u"?$t(t.iv,Tt):an.randomBytes(Do),i=new to.ChaCha20Poly1305($t(t.symKey,Tt)).seal(n,$t(t.message,So));return rg({type:e,sealed:i,iv:n,senderPublicKey:r})}function tg(t){const e=new to.ChaCha20Poly1305($t(t.symKey,Tt)),{sealed:r,iv:n}=$o(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Pt(i,So)}function rg(t){if(Bn(t.type)===Rr){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Pt(lo([t.type,t.senderPublicKey,t.iv,t.sealed]),Co)}return Pt(lo([t.type,t.iv,t.sealed]),Co)}function $o(t){const e=$t(t,Co),r=e.slice(Zp,jl),n=jl;if(Bn(r)===Rr){const a=n+Io,c=a+Do,l=e.slice(n,a),p=e.slice(a,c),w=e.slice(c);return{type:r,sealed:w,iv:p,senderPublicKey:l}}const i=n+Do,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function ng(t,e){const r=$o(t);return kl({type:Bn(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Pt(r.senderPublicKey,Tt):void 0,receiverPublicKey:e?.receiverPublicKey})}function kl(t){const e=t?.type||Bl;if(e===Rr){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 Hl(t){return t.type===Rr&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var ig=Object.defineProperty,zl=Object.getOwnPropertySymbols,sg=Object.prototype.hasOwnProperty,og=Object.prototype.propertyIsEnumerable,Wl=(t,e,r)=>e in t?ig(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ql=(t,e)=>{for(var r in e||(e={}))sg.call(e,r)&&Wl(t,r,e[r]);if(zl)for(var r of zl(e))og.call(e,r)&&Wl(t,r,e[r]);return t};const ag="ReactNative",jn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},cg="js";function Vl(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function lg(){return!Pl()&&!!_o()&&navigator.product===ag}function ug(){return!Vl()&&!!_o()}function hg(){return lg()?jn.reactNative:Vl()?jn.node:ug()?jn.browser:jn.unknown}function dg(t,e){let r=Fn.parse(t);return r=ql(ql({},r),e),t=Fn.stringify(r),t}function fg(){return Rl()||{name:"",description:"",url:"",icons:[""]}}function pg(){const t=J1();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 gg(){var t;const e=hg();return e===jn.browser?[e,((t=Tl())==null?void 0:t.host)||"unknown"].join(":"):e}function mg(t,e,r){const n=pg(),i=gg();return[[t,e].join("-"),[cg,r].join("-"),n,i].join("/")}function wg({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s}){const o=r.split("?"),a=mg(t,e,n),c={auth:i,ua:a,projectId:s},l=dg(o[1]||"",c);return o[0]+"?"+l}function gr(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Kl(t){return Object.fromEntries(t.entries())}function Gl(t){return new Map(Object.entries(t))}function Xt(t,e){return ge.fromMiliseconds((e||Date.now())+ge.toMiliseconds(t))}function mr(t){return ge.fromMiliseconds(Date.now())>=ge.toMiliseconds(t)}function Nr(t){const e=ge.toMiliseconds(t||ge.FIVE_MINUTES);let r,n,i;return{resolve:s=>{i&&r&&(clearTimeout(i),r(s))},reject:s=>{i&&n&&(clearTimeout(i),n(s))},done:()=>new Promise((s,o)=>{i=setTimeout(o,e),r=s,n=o})}}function Zl(t,e){return new Promise(async(r,n)=>{const i=setTimeout(()=>n(),e),s=await t;clearTimeout(i),r(s)})}function Yl(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 yg(t){return Yl("topic",t)}function bg(t){return Yl("id",t)}function Jl(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 Qe(t,e){return`${t}${e?`:${e}`:""}`}const vg="irn";function Po(t){return t?.relay||{protocol:vg}}function To(t){const e=Kp[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var _g=Object.defineProperty,Xl=Object.getOwnPropertySymbols,Eg=Object.prototype.hasOwnProperty,xg=Object.prototype.propertyIsEnumerable,Ql=(t,e,r)=>e in t?_g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cg=(t,e)=>{for(var r in e||(e={}))Eg.call(e,r)&&Ql(t,r,e[r]);if(Xl)for(var r of Xl(e))xg.call(e,r)&&Ql(t,r,e[r]);return t};function Sg(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 Dg(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=Fn.parse(s);return{protocol:n,topic:i[0],version:parseInt(i[1],10),symKey:o.symKey,relay:Sg(o)}}function Ig(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 Og(t){return`${t.protocol}:${t.topic}@${t.version}?`+Fn.stringify(Cg({symKey:t.symKey},Ig(t.relay)))}function kn(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Ag(t){const e=[];return Object.values(t).forEach(r=>{e.push(...kn(r.accounts))}),e}function $g(t,e){const r=[];return Object.values(t).forEach(n=>{kn(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Pg(t,e){const r=[];return Object.values(t).forEach(n=>{kn(n.accounts).includes(e)&&r.push(...n.events)}),r}function Tg(t,e){const r=Qi(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 Rg={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}},Ng={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 se(t,e){const{message:r,code:n}=Ng[t];return{message:e?`${r} ${e}`:r,code:n}}function ot(t,e){const{message:r,code:n}=Rg[t];return{message:e?`${r} ${e}`:r,code:n}}function un(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Xi(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ht(t){return typeof t>"u"}function Et(t,e){return e&&Ht(t)?!0:typeof t=="string"&&Boolean(t.trim().length)}function Ro(t,e){return e&&Ht(t)?!0:typeof t=="number"&&!isNaN(t)}function Lg(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return gr(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],p=kn(a),w=r[o];(!gr(w.chains,p)||!gr(w.methods,c)||!gr(w.events,l))&&(s=!1)}),s):!1}function No(t){return Et(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Mg(t){if(Et(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&No(r)}}return!1}function Ug(t){if(Et(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Fg(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Bg(t){return t?.topic}function jg(t,e){let r=null;return Et(t?.publicKey,!1)||(r=se("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function eu(t){let e=!0;return un(t)?t.length&&(e=t.every(r=>Et(r,!1))):e=!1,e}function kg(t,e,r){let n=null;return un(e)?e.forEach(i=>{n||(!No(i)||!i.includes(t))&&(n=ot("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=ot("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function Hg(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;const s=kg(n,i?.chains,`${e} requiredNamespace`);s&&(r=s)}),r}function zg(t,e){let r=null;return un(t)?t.forEach(n=>{r||Mg(n)||(r=ot("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=ot("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Wg(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=zg(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function qg(t,e){let r=null;return eu(t?.methods)?eu(t?.events)||(r=ot("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=ot("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function tu(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=qg(n,`${e}, namespace`);i&&(r=i)}),r}function Vg(t,e){let r=null;if(t&&Xi(t)){const n=tu(t,e);n&&(r=n);const i=Hg(t,e);i&&(r=i)}else r=se("MISSING_OR_INVALID",`${e}, requiredNamespaces should be an object with data`);return r}function Qi(t,e){let r=null;if(t&&Xi(t)){const n=tu(t,e);n&&(r=n);const i=Wg(t,e);i&&(r=i)}else r=se("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function ru(t){return Et(t.protocol,!0)}function Kg(t,e){let r=!1;return e&&!t?r=!0:t&&un(t)&&t.length&&t.forEach(n=>{r=ru(n)}),r}function Gg(t){return typeof t=="number"}function Rt(t){return typeof t<"u"&&typeof t!==null}function Zg(t){return!(!t||typeof t!="object"||!t.code||!Ro(t.code,!1)||!t.message||!Et(t.message,!1))}function Yg(t){return!(Ht(t)||!Et(t.method,!1))}function Jg(t){return!(Ht(t)||Ht(t.result)&&Ht(t.error)||!Ro(t.id,!1)||!Et(t.jsonrpc,!1))}function Xg(t){return!(Ht(t)||!Et(t.name,!1))}function nu(t,e){return!(!No(e)||!Ag(t).includes(e))}function Qg(t,e,r){return Et(r,!1)?$g(t,e).includes(r):!1}function e2(t,e,r){return Et(r,!1)?Pg(t,e).includes(r):!1}function iu(t,e,r){let n=null;const i=Object.keys(t),s=Object.keys(e);return gr(i,s)?i.forEach(o=>{if(n)return;const a=t[o].chains,c=kn(e[o].accounts);gr(a,c)?gr(t[o].methods,e[o].methods)?gr(t[o].events,e[o].events)||(n=se("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy requiredNamespaces events for ${o}`)):n=se("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy requiredNamespaces methods for ${o}`):n=se("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy requiredNamespaces chains for ${o}`)}):n=se("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces`),n}function t2(t,e){return Ro(t,!1)&&t<=e.max&&t>=e.min}function r2(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var n2=i2;function i2(t,e,r){var n=r&&r.stringify||r2,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,w=-1,m=t&&t.length||0,y=0;y<m;){if(t.charCodeAt(y)===37&&y+1<m){switch(w=w>-1?w:0,t.charCodeAt(y+1)){case 100:case 102:if(p>=c||e[p]==null)break;w<y&&(l+=t.slice(w,y)),l+=Number(e[p]),w=y+2,y++;break;case 105:if(p>=c||e[p]==null)break;w<y&&(l+=t.slice(w,y)),l+=Math.floor(Number(e[p])),w=y+2,y++;break;case 79:case 111:case 106:if(p>=c||e[p]===void 0)break;w<y&&(l+=t.slice(w,y));var E=typeof e[p];if(E==="string"){l+="'"+e[p]+"'",w=y+2,y++;break}if(E==="function"){l+=e[p].name||"<anonymous>",w=y+2,y++;break}l+=n(e[p]),w=y+2,y++;break;case 115:if(p>=c)break;w<y&&(l+=t.slice(w,y)),l+=String(e[p]),w=y+2,y++;break;case 37:w<y&&(l+=t.slice(w,y)),l+="%",w=y+2,y++,p--;break}++p}++y}return w===-1?t:(w<m&&(l+=t.slice(w)),l)}const su=n2;var Hn=Qt;const zn=p2().console||{},s2={mapHttpRequest:ts,mapHttpResponse:ts,wrapRequestSerializer:Mo,wrapResponseSerializer:Mo,wrapErrorSerializer:Mo,req:ts,res:ts,err:u2};function o2(t,e){return Array.isArray(t)?t.filter(function(n){return n!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function Qt(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||zn;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=o2(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=Wn),Object.defineProperty(c,"levelVal",{get:p}),Object.defineProperty(c,"level",{get:w,set:m});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:h2(t)};c.levels=Qt.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=Wn,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=y,e&&(c._logEvent=Lo());function p(){return this.level==="silent"?1/0:this.levels.values[this.level]}function w(){return this._level}function m(E){if(E!=="silent"&&!this.levels.values[E])throw Error("unknown level "+E);this._level=E,hn(l,c,"error","log"),hn(l,c,"fatal","error"),hn(l,c,"warn","error"),hn(l,c,"info","log"),hn(l,c,"debug","log"),hn(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),x=t.browser.serialize===!0?Object.keys(L):i;delete E.serializers,es([E],x,L,this._stdErrSerialize)}function O(_){this._childLevel=(_._childLevel|0)+1,this.error=dn(_,E,"error"),this.fatal=dn(_,E,"fatal"),this.warn=dn(_,E,"warn"),this.info=dn(_,E,"info"),this.debug=dn(_,E,"debug"),this.trace=dn(_,E,"trace"),L&&(this.serializers=L,this._serialize=x),e&&(this._logEvent=Lo([].concat(_._logEvent.bindings,E)))}return O.prototype=this,new O(this)}return c}Qt.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"}},Qt.stdSerializers=s2,Qt.stdTimeFunctions=Object.assign({},{nullTime:ou,epochTime:au,unixTime:d2,isoTime:f2});function hn(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?Wn:i[r]?i[r]:zn[r]||zn[n]||Wn,a2(t,e,r)}function a2(t,e,r){!t.transmit&&e[r]===Wn||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===zn?zn:this;for(var c=0;c<o.length;c++)o[c]=arguments[c];if(t.serialize&&!t.asObject&&es(o,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?n.call(a,c2(this,r,o,s)):n.apply(a,o),t.transmit){const l=t.transmit.level||e.level,p=Qt.levels.values[l],w=Qt.levels.values[r];if(w<p)return;l2(this,{ts:s,methodLevel:r,methodValue:w,transmitLevel:l,transmitValue:Qt.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},o)}}}(e[r]))}function c2(t,e,r,n){t._serialize&&es(r,t._serialize,t.serializers,t._stdErrSerialize);const i=r.slice();let s=i[0];const o={};n&&(o.time=n),o.level=Qt.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?su(i.shift(),i):void 0}else typeof s=="string"&&(s=su(i.shift(),i));return s!==void 0&&(o.msg=s),o}function es(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=Qt.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 dn(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 l2(t,e,r){const n=e.send,i=e.ts,s=e.methodLevel,o=e.methodValue,a=e.val,c=t._logEvent.bindings;es(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=Lo(c)}function Lo(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function u2(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 h2(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?ou:au}function ts(){return{}}function Mo(t){return t}function Wn(){}function ou(){return!1}function au(){return Date.now()}function d2(){return Math.round(Date.now()/1e3)}function f2(){return new Date(Date.now()).toISOString()}function p2(){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 rs={};/*! *****************************************************************************
|
|
15
15
|
Copyright (c) Microsoft Corporation.
|
|
16
16
|
|
|
17
17
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
25
25
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
26
26
|
PERFORMANCE OF THIS SOFTWARE.
|
|
27
|
-
***************************************************************************** */var Uo=function(t,e){return Uo=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])},Uo(t,e)};function
|
|
27
|
+
***************************************************************************** */var Uo=function(t,e){return Uo=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])},Uo(t,e)};function g2(t,e){Uo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Fo=function(){return Fo=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},Fo.apply(this,arguments)};function m2(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 w2(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 b2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function v2(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(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function _2(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 E2(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function x2(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Bo(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 cu(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 C2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(cu(arguments[e]));return t}function S2(){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 qn(t){return this instanceof qn?(this.v=t,this):new qn(t)}function D2(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(m){n[m]&&(i[m]=function(y){return new Promise(function(E,T){s.push([m,y,E,T])>1||a(m,y)})})}function a(m,y){try{c(n[m](y))}catch(E){w(s[0][3],E)}}function c(m){m.value instanceof qn?Promise.resolve(m.value.v).then(l,p):w(s[0][2],m)}function l(m){a("next",m)}function p(m){a("throw",m)}function w(m,y){m(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function I2(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:qn(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function O2(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 Bo=="function"?Bo(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 A2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function $2(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 P2(t){return t&&t.__esModule?t:{default:t}}function T2(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function R2(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 N2=Object.freeze({__proto__:null,__extends:g2,get __assign(){return Fo},__rest:m2,__decorate:w2,__param:y2,__metadata:b2,__awaiter:v2,__generator:_2,__createBinding:E2,__exportStar:x2,__values:Bo,__read:cu,__spread:C2,__spreadArrays:S2,__await:qn,__asyncGenerator:D2,__asyncDelegator:I2,__asyncValues:O2,__makeTemplateObject:A2,__importStar:$2,__importDefault:P2,__classPrivateFieldGet:T2,__classPrivateFieldSet:R2}),lu=Ar(N2),Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});function L2(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}}Vn.safeJsonParse=L2;function M2(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}Vn.safeJsonStringify=M2;var Kn={exports:{}},uu;function U2(){return uu||(uu=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 ut<"u"&&ut.localStorage?Kn.exports=ut.localStorage:typeof window<"u"&&window.localStorage?Kn.exports=window.localStorage:Kn.exports=new e}()),Kn.exports}var jo={},Gn={},hu;function F2(){if(hu)return Gn;hu=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.IKeyValueStorage=void 0;class t{}return Gn.IKeyValueStorage=t,Gn}var Zn={},du;function B2(){if(du)return Zn;du=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.parseEntry=void 0;const t=Vn;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return Zn.parseEntry=e,Zn}var fu;function j2(){return fu||(fu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=lu;e.__exportStar(F2(),t),e.__exportStar(B2(),t)}(jo)),jo}Object.defineProperty(rs,"__esModule",{value:!0}),rs.KeyValueStorage=void 0;const fn=lu,pu=Vn,k2=fn.__importDefault(U2()),H2=j2();class gu{constructor(){this.localStorage=k2.default}getKeys(){return fn.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return fn.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(H2.parseEntry)})}getItem(e){return fn.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return pu.safeJsonParse(r)})}setItem(e,r){return fn.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,pu.safeJsonStringify(r))})}removeItem(e){return fn.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}rs.KeyValueStorage=gu;var z2=rs.default=gu,Yn={};/*! *****************************************************************************
|
|
28
28
|
Copyright (c) Microsoft Corporation.
|
|
29
29
|
|
|
30
30
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
38
38
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
39
39
|
PERFORMANCE OF THIS SOFTWARE.
|
|
40
|
-
***************************************************************************** */var ko=function(t,e){return ko=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])},ko(t,e)};function
|
|
40
|
+
***************************************************************************** */var ko=function(t,e){return ko=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])},ko(t,e)};function W2(t,e){ko(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Ho=function(){return Ho=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},Ho.apply(this,arguments)};function q2(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 V2(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 K2(t,e){return function(r,n){e(r,n,t)}}function G2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Z2(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(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function Y2(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 J2(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function X2(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function zo(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 mu(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 Q2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(mu(arguments[e]));return t}function e3(){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 Jn(t){return this instanceof Jn?(this.v=t,this):new Jn(t)}function t3(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(m){n[m]&&(i[m]=function(y){return new Promise(function(E,T){s.push([m,y,E,T])>1||a(m,y)})})}function a(m,y){try{c(n[m](y))}catch(E){w(s[0][3],E)}}function c(m){m.value instanceof Jn?Promise.resolve(m.value.v).then(l,p):w(s[0][2],m)}function l(m){a("next",m)}function p(m){a("throw",m)}function w(m,y){m(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function r3(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:Jn(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function n3(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 zo=="function"?zo(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 i3(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function s3(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 o3(t){return t&&t.__esModule?t:{default:t}}function a3(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function c3(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 l3=Object.freeze({__proto__:null,__extends:W2,get __assign(){return Ho},__rest:q2,__decorate:V2,__param:K2,__metadata:G2,__awaiter:Z2,__generator:Y2,__createBinding:J2,__exportStar:X2,__values:zo,__read:mu,__spread:Q2,__spreadArrays:e3,__await:Jn,__asyncGenerator:t3,__asyncDelegator:r3,__asyncValues:n3,__makeTemplateObject:i3,__importStar:s3,__importDefault:o3,__classPrivateFieldGet:a3,__classPrivateFieldSet:c3}),ns=Ar(l3),Xn={},Wo={},Qn={};class Lr{}var u3=Object.freeze({__proto__:null,IEvents:Lr}),h3=Ar(u3),wu;function d3(){if(wu)return Qn;wu=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.IHeartBeat=void 0;const t=h3;class e extends t.IEvents{constructor(n){super()}}return Qn.IHeartBeat=e,Qn}var yu;function bu(){return yu||(yu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ns.__exportStar(d3(),t)}(Wo)),Wo}var qo={},Mr={},vu;function f3(){if(vu)return Mr;vu=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.HEARTBEAT_EVENTS=Mr.HEARTBEAT_INTERVAL=void 0;const t=ge;return Mr.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Mr.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Mr}var _u;function Eu(){return _u||(_u=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ns.__exportStar(f3(),t)}(qo)),qo}var xu;function p3(){if(xu)return Xn;xu=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.HeartBeat=void 0;const t=ns,e=vt.exports,r=ge,n=bu(),i=Eu();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 Xn.HeartBeat=s,Xn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ns;e.__exportStar(p3(),t),e.__exportStar(bu(),t),e.__exportStar(Eu(),t)})(Yn);var je={};/*! *****************************************************************************
|
|
41
41
|
Copyright (c) Microsoft Corporation.
|
|
42
42
|
|
|
43
43
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
51
51
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
52
52
|
PERFORMANCE OF THIS SOFTWARE.
|
|
53
|
-
***************************************************************************** */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 E3(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 x3(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 C3(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 S3(t,e){return function(r,n){e(r,n,t)}}function D3(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function I3(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(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function O3(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 A3(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function $3(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 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 P3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Su(arguments[e]));return t}function T3(){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 ei(t){return this instanceof ei?(this.v=t,this):new ei(t)}function R3(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(m){n[m]&&(i[m]=function(y){return new Promise(function(E,T){s.push([m,y,E,T])>1||a(m,y)})})}function a(m,y){try{c(n[m](y))}catch(E){w(s[0][3],E)}}function c(m){m.value instanceof ei?Promise.resolve(m.value.v).then(l,p):w(s[0][2],m)}function l(m){a("next",m)}function p(m){a("throw",m)}function w(m,y){m(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function N3(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:ei(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function L3(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 M3(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function U3(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 F3(t){return t&&t.__esModule?t:{default:t}}function B3(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function j3(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 k3=Object.freeze({__proto__:null,__extends:E3,get __assign(){return Ko},__rest:x3,__decorate:C3,__param:S3,__metadata:D3,__awaiter:I3,__generator:O3,__createBinding:A3,__exportStar:$3,__values:Go,__read:Su,__spread:P3,__spreadArrays:T3,__await:ei,__asyncGenerator:R3,__asyncDelegator:N3,__asyncValues:L3,__makeTemplateObject:M3,__importStar:U3,__importDefault:F3,__classPrivateFieldGet:B3,__classPrivateFieldSet:j3}),H3=Ar(k3),Ur={},Du;function Iu(){return Du||(Du=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.PINO_CUSTOM_CONTEXT_KEY=Ur.PINO_LOGGER_DEFAULTS=void 0,Ur.PINO_LOGGER_DEFAULTS={level:"info"},Ur.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Ur}var Ot={},Ou;function z3(){if(Ou)return Ot;Ou=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.generateChildLogger=Ot.formatChildLoggerContext=Ot.getLoggerContext=Ot.setBrowserLoggerContext=Ot.getBrowserLoggerContext=Ot.getDefaultLoggerOptions=void 0;const t=Iu();function e(a){return Object.assign(Object.assign({},a),{level:a?.level||t.PINO_LOGGER_DEFAULTS.level})}Ot.getDefaultLoggerOptions=e;function r(a,c=t.PINO_CUSTOM_CONTEXT_KEY){return a[c]||""}Ot.getBrowserLoggerContext=r;function n(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){return a[l]=c,a}Ot.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}Ot.getLoggerContext=i;function s(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=i(a,l);return p.trim()?`${p}/${c}`:c}Ot.formatChildLoggerContext=s;function o(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=s(a,c,l),w=a.child({context:p});return n(w,p,l)}return Ot.generateChildLogger=o,Ot}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=H3,r=e.__importDefault(Hn);Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(Iu(),t),e.__exportStar(z3(),t)})(je);class W3 extends Lr{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class q3 extends Lr{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class V3{constructor(e,r){this.logger=e,this.core=r}}class K3 extends Lr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class G3 extends Lr{constructor(e){super()}}class Z3{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class Y3 extends Lr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class J3 extends Lr{constructor(e,r){super(),this.core=e,this.logger=r}}class X3{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class Q3{constructor(e){this.client=e}}function Zo(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 ti(t){return typeof t=="string"?t:JSON.stringify(t)}var Yo={},Au={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_e,r=Mt;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,w=l/536870912|0,m=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(w,this._buffer,y-8),e.writeUint32BE(m,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,w,m,y){for(var E=l[0],T=l[1],R=l[2],L=l[3],x=l[4],O=l[5],_=l[6],D=l[7],I=p[0],h=p[1],v=p[2],H=p[3],j=p[4],q=p[5],X=p[6],re=p[7],C,A,G,K,W,z,J,Z;y>=128;){for(var ue=0;ue<16;ue++){var Q=8*ue+m;a[ue]=e.readUint32BE(w,Q),c[ue]=e.readUint32BE(w,Q+4)}for(var ue=0;ue<80;ue++){var fe=E,ae=T,Ce=R,B=L,F=x,N=O,f=_,$=D,ee=I,ne=h,Ee=v,Me=H,$e=j,Ue=q,Ge=X,qe=re;if(C=D,A=re,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=(x>>>14|j<<32-14)^(x>>>18|j<<32-18)^(j>>>41-32|x<<32-(41-32)),A=(j>>>14|x<<32-14)^(j>>>18|x<<32-18)^(x>>>41-32|j<<32-(41-32)),W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,C=x&O^~x&_,A=j&q^~j&X,W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,C=i[ue*2],A=i[ue*2+1],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,C=a[ue%16],A=c[ue%16],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,G=J&65535|Z<<16,K=W&65535|z<<16,C=G,A=K,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=(E>>>28|I<<32-28)^(I>>>34-32|E<<32-(34-32))^(I>>>39-32|E<<32-(39-32)),A=(I>>>28|E<<32-28)^(E>>>34-32|I<<32-(34-32))^(E>>>39-32|I<<32-(39-32)),W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,C=E&T^E&R^T&R,A=I&h^I&v^h&v,W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,$=J&65535|Z<<16,qe=W&65535|z<<16,C=B,A=Me,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=G,A=K,W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,B=J&65535|Z<<16,Me=W&65535|z<<16,T=fe,R=ae,L=Ce,x=B,O=F,_=N,D=f,E=$,h=ee,v=ne,H=Ee,j=Me,q=$e,X=Ue,re=Ge,I=qe,ue%16===15)for(var Q=0;Q<16;Q++)C=a[Q],A=c[Q],W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=a[(Q+9)%16],A=c[(Q+9)%16],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,G=a[(Q+1)%16],K=c[(Q+1)%16],C=(G>>>1|K<<32-1)^(G>>>8|K<<32-8)^G>>>7,A=(K>>>1|G<<32-1)^(K>>>8|G<<32-8)^(K>>>7|G<<32-7),W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,G=a[(Q+14)%16],K=c[(Q+14)%16],C=(G>>>19|K<<32-19)^(K>>>61-32|G<<32-(61-32))^G>>>6,A=(K>>>19|G<<32-19)^(G>>>61-32|K<<32-(61-32))^(K>>>6|G<<32-6),W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,a[Q]=J&65535|Z<<16,c[Q]=W&65535|z<<16}C=E,A=I,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[0],A=p[0],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[0]=E=J&65535|Z<<16,p[0]=I=W&65535|z<<16,C=T,A=h,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[1],A=p[1],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[1]=T=J&65535|Z<<16,p[1]=h=W&65535|z<<16,C=R,A=v,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[2],A=p[2],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[2]=R=J&65535|Z<<16,p[2]=v=W&65535|z<<16,C=L,A=H,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[3],A=p[3],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[3]=L=J&65535|Z<<16,p[3]=H=W&65535|z<<16,C=x,A=j,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[4],A=p[4],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[4]=x=J&65535|Z<<16,p[4]=j=W&65535|z<<16,C=O,A=q,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[5],A=p[5],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[5]=O=J&65535|Z<<16,p[5]=q=W&65535|z<<16,C=_,A=X,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[6],A=p[6],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[6]=_=J&65535|Z<<16,p[6]=X=W&65535|z<<16,C=D,A=re,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[7],A=p[7],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[7]=D=J&65535|Z<<16,p[7]=re=W&65535|z<<16,m+=128,y-=128}return m}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Au),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=an,r=Au,n=Mt;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(B){const F=new Float64Array(16);if(B)for(let N=0;N<B.length;N++)F[N]=B[N];return F}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]),w=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function y(B,F){for(let N=0;N<16;N++)B[N]=F[N]|0}function E(B){let F=1;for(let N=0;N<16;N++){let f=B[N]+F+65535;F=Math.floor(f/65536),B[N]=f-F*65536}B[0]+=F-1+37*(F-1)}function T(B,F,N){const f=~(N-1);for(let $=0;$<16;$++){const ee=f&(B[$]^F[$]);B[$]^=ee,F[$]^=ee}}function R(B,F){const N=i(),f=i();for(let $=0;$<16;$++)f[$]=F[$];E(f),E(f),E(f);for(let $=0;$<2;$++){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 $=0;$<16;$++)B[2*$]=f[$]&255,B[2*$+1]=f[$]>>8}function L(B,F){let N=0;for(let f=0;f<32;f++)N|=B[f]^F[f];return(1&N-1>>>8)-1}function x(B,F){const N=new Uint8Array(32),f=new Uint8Array(32);return R(N,B),R(f,F),L(N,f)}function O(B){const F=new Uint8Array(32);return R(F,B),F[0]&1}function _(B,F){for(let N=0;N<16;N++)B[N]=F[2*N]+(F[2*N+1]<<8);B[15]&=32767}function D(B,F,N){for(let f=0;f<16;f++)B[f]=F[f]+N[f]}function I(B,F,N){for(let f=0;f<16;f++)B[f]=F[f]-N[f]}function h(B,F,N){let f,$,ee=0,ne=0,Ee=0,Me=0,$e=0,Ue=0,Ge=0,qe=0,Pe=0,Ie=0,me=0,Se=0,Oe=0,pe=0,xe=0,g=0,u=0,d=0,b=0,P=0,U=0,k=0,oe=0,he=0,Ne=0,Be=0,Le=0,jt=0,tn=0,Fi=0,Gs=0,tt=N[0],Ye=N[1],rt=N[2],nt=N[3],it=N[4],Je=N[5],dt=N[6],ft=N[7],pt=N[8],gt=N[9],mt=N[10],lt=N[11],st=N[12],Ve=N[13],wt=N[14],yt=N[15];f=F[0],ee+=f*tt,ne+=f*Ye,Ee+=f*rt,Me+=f*nt,$e+=f*it,Ue+=f*Je,Ge+=f*dt,qe+=f*ft,Pe+=f*pt,Ie+=f*gt,me+=f*mt,Se+=f*lt,Oe+=f*st,pe+=f*Ve,xe+=f*wt,g+=f*yt,f=F[1],ne+=f*tt,Ee+=f*Ye,Me+=f*rt,$e+=f*nt,Ue+=f*it,Ge+=f*Je,qe+=f*dt,Pe+=f*ft,Ie+=f*pt,me+=f*gt,Se+=f*mt,Oe+=f*lt,pe+=f*st,xe+=f*Ve,g+=f*wt,u+=f*yt,f=F[2],Ee+=f*tt,Me+=f*Ye,$e+=f*rt,Ue+=f*nt,Ge+=f*it,qe+=f*Je,Pe+=f*dt,Ie+=f*ft,me+=f*pt,Se+=f*gt,Oe+=f*mt,pe+=f*lt,xe+=f*st,g+=f*Ve,u+=f*wt,d+=f*yt,f=F[3],Me+=f*tt,$e+=f*Ye,Ue+=f*rt,Ge+=f*nt,qe+=f*it,Pe+=f*Je,Ie+=f*dt,me+=f*ft,Se+=f*pt,Oe+=f*gt,pe+=f*mt,xe+=f*lt,g+=f*st,u+=f*Ve,d+=f*wt,b+=f*yt,f=F[4],$e+=f*tt,Ue+=f*Ye,Ge+=f*rt,qe+=f*nt,Pe+=f*it,Ie+=f*Je,me+=f*dt,Se+=f*ft,Oe+=f*pt,pe+=f*gt,xe+=f*mt,g+=f*lt,u+=f*st,d+=f*Ve,b+=f*wt,P+=f*yt,f=F[5],Ue+=f*tt,Ge+=f*Ye,qe+=f*rt,Pe+=f*nt,Ie+=f*it,me+=f*Je,Se+=f*dt,Oe+=f*ft,pe+=f*pt,xe+=f*gt,g+=f*mt,u+=f*lt,d+=f*st,b+=f*Ve,P+=f*wt,U+=f*yt,f=F[6],Ge+=f*tt,qe+=f*Ye,Pe+=f*rt,Ie+=f*nt,me+=f*it,Se+=f*Je,Oe+=f*dt,pe+=f*ft,xe+=f*pt,g+=f*gt,u+=f*mt,d+=f*lt,b+=f*st,P+=f*Ve,U+=f*wt,k+=f*yt,f=F[7],qe+=f*tt,Pe+=f*Ye,Ie+=f*rt,me+=f*nt,Se+=f*it,Oe+=f*Je,pe+=f*dt,xe+=f*ft,g+=f*pt,u+=f*gt,d+=f*mt,b+=f*lt,P+=f*st,U+=f*Ve,k+=f*wt,oe+=f*yt,f=F[8],Pe+=f*tt,Ie+=f*Ye,me+=f*rt,Se+=f*nt,Oe+=f*it,pe+=f*Je,xe+=f*dt,g+=f*ft,u+=f*pt,d+=f*gt,b+=f*mt,P+=f*lt,U+=f*st,k+=f*Ve,oe+=f*wt,he+=f*yt,f=F[9],Ie+=f*tt,me+=f*Ye,Se+=f*rt,Oe+=f*nt,pe+=f*it,xe+=f*Je,g+=f*dt,u+=f*ft,d+=f*pt,b+=f*gt,P+=f*mt,U+=f*lt,k+=f*st,oe+=f*Ve,he+=f*wt,Ne+=f*yt,f=F[10],me+=f*tt,Se+=f*Ye,Oe+=f*rt,pe+=f*nt,xe+=f*it,g+=f*Je,u+=f*dt,d+=f*ft,b+=f*pt,P+=f*gt,U+=f*mt,k+=f*lt,oe+=f*st,he+=f*Ve,Ne+=f*wt,Be+=f*yt,f=F[11],Se+=f*tt,Oe+=f*Ye,pe+=f*rt,xe+=f*nt,g+=f*it,u+=f*Je,d+=f*dt,b+=f*ft,P+=f*pt,U+=f*gt,k+=f*mt,oe+=f*lt,he+=f*st,Ne+=f*Ve,Be+=f*wt,Le+=f*yt,f=F[12],Oe+=f*tt,pe+=f*Ye,xe+=f*rt,g+=f*nt,u+=f*it,d+=f*Je,b+=f*dt,P+=f*ft,U+=f*pt,k+=f*gt,oe+=f*mt,he+=f*lt,Ne+=f*st,Be+=f*Ve,Le+=f*wt,jt+=f*yt,f=F[13],pe+=f*tt,xe+=f*Ye,g+=f*rt,u+=f*nt,d+=f*it,b+=f*Je,P+=f*dt,U+=f*ft,k+=f*pt,oe+=f*gt,he+=f*mt,Ne+=f*lt,Be+=f*st,Le+=f*Ve,jt+=f*wt,tn+=f*yt,f=F[14],xe+=f*tt,g+=f*Ye,u+=f*rt,d+=f*nt,b+=f*it,P+=f*Je,U+=f*dt,k+=f*ft,oe+=f*pt,he+=f*gt,Ne+=f*mt,Be+=f*lt,Le+=f*st,jt+=f*Ve,tn+=f*wt,Fi+=f*yt,f=F[15],g+=f*tt,u+=f*Ye,d+=f*rt,b+=f*nt,P+=f*it,U+=f*Je,k+=f*dt,oe+=f*ft,he+=f*pt,Ne+=f*gt,Be+=f*mt,Le+=f*lt,jt+=f*st,tn+=f*Ve,Fi+=f*wt,Gs+=f*yt,ee+=38*u,ne+=38*d,Ee+=38*b,Me+=38*P,$e+=38*U,Ue+=38*k,Ge+=38*oe,qe+=38*he,Pe+=38*Ne,Ie+=38*Be,me+=38*Le,Se+=38*jt,Oe+=38*tn,pe+=38*Fi,xe+=38*Gs,$=1,f=ee+$+65535,$=Math.floor(f/65536),ee=f-$*65536,f=ne+$+65535,$=Math.floor(f/65536),ne=f-$*65536,f=Ee+$+65535,$=Math.floor(f/65536),Ee=f-$*65536,f=Me+$+65535,$=Math.floor(f/65536),Me=f-$*65536,f=$e+$+65535,$=Math.floor(f/65536),$e=f-$*65536,f=Ue+$+65535,$=Math.floor(f/65536),Ue=f-$*65536,f=Ge+$+65535,$=Math.floor(f/65536),Ge=f-$*65536,f=qe+$+65535,$=Math.floor(f/65536),qe=f-$*65536,f=Pe+$+65535,$=Math.floor(f/65536),Pe=f-$*65536,f=Ie+$+65535,$=Math.floor(f/65536),Ie=f-$*65536,f=me+$+65535,$=Math.floor(f/65536),me=f-$*65536,f=Se+$+65535,$=Math.floor(f/65536),Se=f-$*65536,f=Oe+$+65535,$=Math.floor(f/65536),Oe=f-$*65536,f=pe+$+65535,$=Math.floor(f/65536),pe=f-$*65536,f=xe+$+65535,$=Math.floor(f/65536),xe=f-$*65536,f=g+$+65535,$=Math.floor(f/65536),g=f-$*65536,ee+=$-1+37*($-1),$=1,f=ee+$+65535,$=Math.floor(f/65536),ee=f-$*65536,f=ne+$+65535,$=Math.floor(f/65536),ne=f-$*65536,f=Ee+$+65535,$=Math.floor(f/65536),Ee=f-$*65536,f=Me+$+65535,$=Math.floor(f/65536),Me=f-$*65536,f=$e+$+65535,$=Math.floor(f/65536),$e=f-$*65536,f=Ue+$+65535,$=Math.floor(f/65536),Ue=f-$*65536,f=Ge+$+65535,$=Math.floor(f/65536),Ge=f-$*65536,f=qe+$+65535,$=Math.floor(f/65536),qe=f-$*65536,f=Pe+$+65535,$=Math.floor(f/65536),Pe=f-$*65536,f=Ie+$+65535,$=Math.floor(f/65536),Ie=f-$*65536,f=me+$+65535,$=Math.floor(f/65536),me=f-$*65536,f=Se+$+65535,$=Math.floor(f/65536),Se=f-$*65536,f=Oe+$+65535,$=Math.floor(f/65536),Oe=f-$*65536,f=pe+$+65535,$=Math.floor(f/65536),pe=f-$*65536,f=xe+$+65535,$=Math.floor(f/65536),xe=f-$*65536,f=g+$+65535,$=Math.floor(f/65536),g=f-$*65536,ee+=$-1+37*($-1),B[0]=ee,B[1]=ne,B[2]=Ee,B[3]=Me,B[4]=$e,B[5]=Ue,B[6]=Ge,B[7]=qe,B[8]=Pe,B[9]=Ie,B[10]=me,B[11]=Se,B[12]=Oe,B[13]=pe,B[14]=xe,B[15]=g}function v(B,F){h(B,F,F)}function H(B,F){const N=i();let f;for(f=0;f<16;f++)N[f]=F[f];for(f=253;f>=0;f--)v(N,N),f!==2&&f!==4&&h(N,N,F);for(f=0;f<16;f++)B[f]=N[f]}function j(B,F){const N=i();let f;for(f=0;f<16;f++)N[f]=F[f];for(f=250;f>=0;f--)v(N,N),f!==1&&h(N,N,F);for(f=0;f<16;f++)B[f]=N[f]}function q(B,F){const N=i(),f=i(),$=i(),ee=i(),ne=i(),Ee=i(),Me=i(),$e=i(),Ue=i();I(N,B[1],B[0]),I(Ue,F[1],F[0]),h(N,N,Ue),D(f,B[0],B[1]),D(Ue,F[0],F[1]),h(f,f,Ue),h($,B[3],F[3]),h($,$,l),h(ee,B[2],F[2]),D(ee,ee,ee),I(ne,f,N),I(Ee,ee,$),D(Me,ee,$),D($e,f,N),h(B[0],ne,Ee),h(B[1],$e,Me),h(B[2],Me,Ee),h(B[3],ne,$e)}function X(B,F,N){for(let f=0;f<4;f++)T(B[f],F[f],N)}function re(B,F){const N=i(),f=i(),$=i();H($,F[2]),h(N,F[0],$),h(f,F[1],$),R(B,f),B[31]^=O(N)<<7}function C(B,F,N){y(B[0],o),y(B[1],a),y(B[2],a),y(B[3],o);for(let f=255;f>=0;--f){const $=N[f/8|0]>>(f&7)&1;X(B,F,$),q(F,B),q(B,B),X(B,F,$)}}function A(B,F){const N=[i(),i(),i(),i()];y(N[0],p),y(N[1],w),y(N[2],a),h(N[3],p,w),C(B,N,F)}function G(B){if(B.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const F=(0,r.hash)(B);F[0]&=248,F[31]&=127,F[31]|=64;const N=new Uint8Array(32),f=[i(),i(),i(),i()];A(f,F),re(N,f);const $=new Uint8Array(64);return $.set(B),$.set(N,32),{publicKey:N,secretKey:$}}t.generateKeyPairFromSeed=G;function K(B){const F=(0,e.randomBytes)(32,B),N=G(F);return(0,n.wipe)(F),N}t.generateKeyPair=K;function W(B){if(B.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(B.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(B,F){let N,f,$,ee;for(f=63;f>=32;--f){for(N=0,$=f-32,ee=f-12;$<ee;++$)F[$]+=N-16*F[f]*z[$-(f-32)],N=Math.floor((F[$]+128)/256),F[$]-=N*256;F[$]+=N,F[f]=0}for(N=0,$=0;$<32;$++)F[$]+=N-(F[31]>>4)*z[$],N=F[$]>>8,F[$]&=255;for($=0;$<32;$++)F[$]-=N*z[$];for(f=0;f<32;f++)F[f+1]+=F[f]>>8,B[f]=F[f]&255}function Z(B){const F=new Float64Array(64);for(let N=0;N<64;N++)F[N]=B[N];for(let N=0;N<64;N++)B[N]=0;J(B,F)}function ue(B,F){const N=new Float64Array(64),f=[i(),i(),i(),i()],$=(0,r.hash)(B.subarray(0,32));$[0]&=248,$[31]&=127,$[31]|=64;const ee=new Uint8Array(64);ee.set($.subarray(32),32);const ne=new r.SHA512;ne.update(ee.subarray(32)),ne.update(F);const Ee=ne.digest();ne.clean(),Z(Ee),A(f,Ee),re(ee,f),ne.reset(),ne.update(ee.subarray(0,32)),ne.update(B.subarray(32)),ne.update(F);const Me=ne.digest();Z(Me);for(let $e=0;$e<32;$e++)N[$e]=Ee[$e];for(let $e=0;$e<32;$e++)for(let Ue=0;Ue<32;Ue++)N[$e+Ue]+=Me[$e]*$[Ue];return J(ee.subarray(32),N),ee}t.sign=ue;function Q(B,F){const N=i(),f=i(),$=i(),ee=i(),ne=i(),Ee=i(),Me=i();return y(B[2],a),_(B[1],F),v($,B[1]),h(ee,$,c),I($,$,B[2]),D(ee,B[2],ee),v(ne,ee),v(Ee,ne),h(Me,Ee,ne),h(N,Me,$),h(N,N,ee),j(N,N),h(N,N,$),h(N,N,ee),h(N,N,ee),h(B[0],N,ee),v(f,B[0]),h(f,f,ee),x(f,$)&&h(B[0],B[0],m),v(f,B[0]),h(f,f,ee),x(f,$)?-1:(O(B[0])===F[31]>>7&&I(B[0],o,B[0]),h(B[3],B[0],B[1]),0)}function fe(B,F,N){const f=new Uint8Array(32),$=[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,B))return!1;const ne=new r.SHA512;ne.update(N.subarray(0,32)),ne.update(B),ne.update(F);const Ee=ne.digest();return Z(Ee),C($,ee,Ee),A(ee,N.subarray(32)),q($,ee),re(f,$),!L(N,f)}t.verify=fe;function ae(B){let F=[i(),i(),i(),i()];if(Q(F,B))throw new Error("Ed25519: invalid public key");let N=i(),f=i(),$=F[1];D(N,a,$),I(f,a,$),H(f,f),h(N,N,f);let ee=new Uint8Array(32);return R(ee,N),ee}t.convertPublicKeyToX25519=ae;function Ce(B){const F=(0,r.hash)(B.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const N=new Uint8Array(F.subarray(0,32));return(0,n.wipe)(F),N}t.convertSecretKeyToX25519=Ce}(Yo);const em="EdDSA",tm="JWT",$u=".",Pu="base64url",rm="utf8",nm="utf8",im=":",sm="did",om="key",Tu="base58btc",am="z",cm="K36",lm=32;function is(t){return Pt($t(ti(t),rm),Pu)}function Ru(t){const e=$t(cm,Tu),r=am+Pt(lo([e,t]),Tu);return[sm,om,r].join(im)}function um(t){return Pt(t,Pu)}function hm(t){return $t([is(t.header),is(t.payload)].join($u),nm)}function dm(t){return[is(t.header),is(t.payload),um(t.signature)].join($u)}function Nu(t=an.randomBytes(lm)){return Yo.generateKeyPairFromSeed(t)}async function fm(t,e,r,n,i=ge.fromMiliseconds(Date.now())){const s={alg:em,typ:tm},o=Ru(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=hm({header:s,payload:c}),p=Yo.sign(n.secretKey,l);return dm({header:s,payload:c,signature:p})}const pm="PARSE_ERROR",gm="INVALID_REQUEST",mm="METHOD_NOT_FOUND",wm="INVALID_PARAMS",Lu="INTERNAL_ERROR",Jo="SERVER_ERROR",ym=[-32700,-32600,-32601,-32602,-32603],ri={[pm]:{code:-32700,message:"Parse error"},[gm]:{code:-32600,message:"Invalid Request"},[mm]:{code:-32601,message:"Method not found"},[wm]:{code:-32602,message:"Invalid params"},[Lu]:{code:-32603,message:"Internal error"},[Jo]:{code:-32e3,message:"Server error"}},Mu=Jo;function bm(t){return ym.includes(t)}function Uu(t){return Object.keys(ri).includes(t)?ri[t]:ri[Mu]}function vm(t){const e=Object.values(ri).find(r=>r.code===t);return e||ri[Mu]}function Fu(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Bu={};/*! *****************************************************************************
|
|
53
|
+
***************************************************************************** */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 g3(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 m3(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 w3(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 y3(t,e){return function(r,n){e(r,n,t)}}function b3(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function v3(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(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function _3(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 E3(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function x3(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 Cu(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 C3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Cu(arguments[e]));return t}function S3(){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 ei(t){return this instanceof ei?(this.v=t,this):new ei(t)}function D3(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(m){n[m]&&(i[m]=function(y){return new Promise(function(E,T){s.push([m,y,E,T])>1||a(m,y)})})}function a(m,y){try{c(n[m](y))}catch(E){w(s[0][3],E)}}function c(m){m.value instanceof ei?Promise.resolve(m.value.v).then(l,p):w(s[0][2],m)}function l(m){a("next",m)}function p(m){a("throw",m)}function w(m,y){m(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function I3(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:ei(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function O3(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 A3(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function $3(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 P3(t){return t&&t.__esModule?t:{default:t}}function T3(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function R3(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 N3=Object.freeze({__proto__:null,__extends:g3,get __assign(){return Ko},__rest:m3,__decorate:w3,__param:y3,__metadata:b3,__awaiter:v3,__generator:_3,__createBinding:E3,__exportStar:x3,__values:Go,__read:Cu,__spread:C3,__spreadArrays:S3,__await:ei,__asyncGenerator:D3,__asyncDelegator:I3,__asyncValues:O3,__makeTemplateObject:A3,__importStar:$3,__importDefault:P3,__classPrivateFieldGet:T3,__classPrivateFieldSet:R3}),L3=Ar(N3),Ur={},Su;function Du(){return Su||(Su=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.PINO_CUSTOM_CONTEXT_KEY=Ur.PINO_LOGGER_DEFAULTS=void 0,Ur.PINO_LOGGER_DEFAULTS={level:"info"},Ur.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Ur}var Ot={},Iu;function M3(){if(Iu)return Ot;Iu=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.generateChildLogger=Ot.formatChildLoggerContext=Ot.getLoggerContext=Ot.setBrowserLoggerContext=Ot.getBrowserLoggerContext=Ot.getDefaultLoggerOptions=void 0;const t=Du();function e(a){return Object.assign(Object.assign({},a),{level:a?.level||t.PINO_LOGGER_DEFAULTS.level})}Ot.getDefaultLoggerOptions=e;function r(a,c=t.PINO_CUSTOM_CONTEXT_KEY){return a[c]||""}Ot.getBrowserLoggerContext=r;function n(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){return a[l]=c,a}Ot.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}Ot.getLoggerContext=i;function s(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=i(a,l);return p.trim()?`${p}/${c}`:c}Ot.formatChildLoggerContext=s;function o(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=s(a,c,l),w=a.child({context:p});return n(w,p,l)}return Ot.generateChildLogger=o,Ot}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=L3,r=e.__importDefault(Hn);Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(Du(),t),e.__exportStar(M3(),t)})(je);class U3 extends Lr{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class F3 extends Lr{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class B3{constructor(e,r){this.logger=e,this.core=r}}class j3 extends Lr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class k3 extends Lr{constructor(e){super()}}class H3{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class z3 extends Lr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class W3 extends Lr{constructor(e,r){super(),this.core=e,this.logger=r}}class q3{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class V3{constructor(e){this.client=e}}function Zo(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 ti(t){return typeof t=="string"?t:JSON.stringify(t)}var Yo={},Ou={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_e,r=Mt;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,w=l/536870912|0,m=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(w,this._buffer,y-8),e.writeUint32BE(m,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,w,m,y){for(var E=l[0],T=l[1],R=l[2],L=l[3],x=l[4],O=l[5],_=l[6],D=l[7],I=p[0],h=p[1],v=p[2],H=p[3],j=p[4],q=p[5],X=p[6],re=p[7],C,A,G,K,W,z,J,Z;y>=128;){for(var ue=0;ue<16;ue++){var Q=8*ue+m;a[ue]=e.readUint32BE(w,Q),c[ue]=e.readUint32BE(w,Q+4)}for(var ue=0;ue<80;ue++){var fe=E,ae=T,Ce=R,B=L,F=x,N=O,f=_,$=D,ee=I,ne=h,Ee=v,Me=H,$e=j,Ue=q,Ge=X,qe=re;if(C=D,A=re,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=(x>>>14|j<<32-14)^(x>>>18|j<<32-18)^(j>>>41-32|x<<32-(41-32)),A=(j>>>14|x<<32-14)^(j>>>18|x<<32-18)^(x>>>41-32|j<<32-(41-32)),W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,C=x&O^~x&_,A=j&q^~j&X,W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,C=i[ue*2],A=i[ue*2+1],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,C=a[ue%16],A=c[ue%16],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,G=J&65535|Z<<16,K=W&65535|z<<16,C=G,A=K,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=(E>>>28|I<<32-28)^(I>>>34-32|E<<32-(34-32))^(I>>>39-32|E<<32-(39-32)),A=(I>>>28|E<<32-28)^(E>>>34-32|I<<32-(34-32))^(E>>>39-32|I<<32-(39-32)),W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,C=E&T^E&R^T&R,A=I&h^I&v^h&v,W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,$=J&65535|Z<<16,qe=W&65535|z<<16,C=B,A=Me,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=G,A=K,W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,B=J&65535|Z<<16,Me=W&65535|z<<16,T=fe,R=ae,L=Ce,x=B,O=F,_=N,D=f,E=$,h=ee,v=ne,H=Ee,j=Me,q=$e,X=Ue,re=Ge,I=qe,ue%16===15)for(var Q=0;Q<16;Q++)C=a[Q],A=c[Q],W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=a[(Q+9)%16],A=c[(Q+9)%16],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,G=a[(Q+1)%16],K=c[(Q+1)%16],C=(G>>>1|K<<32-1)^(G>>>8|K<<32-8)^G>>>7,A=(K>>>1|G<<32-1)^(K>>>8|G<<32-8)^(K>>>7|G<<32-7),W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,G=a[(Q+14)%16],K=c[(Q+14)%16],C=(G>>>19|K<<32-19)^(K>>>61-32|G<<32-(61-32))^G>>>6,A=(K>>>19|G<<32-19)^(G>>>61-32|K<<32-(61-32))^(K>>>6|G<<32-6),W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,a[Q]=J&65535|Z<<16,c[Q]=W&65535|z<<16}C=E,A=I,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[0],A=p[0],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[0]=E=J&65535|Z<<16,p[0]=I=W&65535|z<<16,C=T,A=h,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[1],A=p[1],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[1]=T=J&65535|Z<<16,p[1]=h=W&65535|z<<16,C=R,A=v,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[2],A=p[2],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[2]=R=J&65535|Z<<16,p[2]=v=W&65535|z<<16,C=L,A=H,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[3],A=p[3],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[3]=L=J&65535|Z<<16,p[3]=H=W&65535|z<<16,C=x,A=j,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[4],A=p[4],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[4]=x=J&65535|Z<<16,p[4]=j=W&65535|z<<16,C=O,A=q,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[5],A=p[5],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[5]=O=J&65535|Z<<16,p[5]=q=W&65535|z<<16,C=_,A=X,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[6],A=p[6],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[6]=_=J&65535|Z<<16,p[6]=X=W&65535|z<<16,C=D,A=re,W=A&65535,z=A>>>16,J=C&65535,Z=C>>>16,C=l[7],A=p[7],W+=A&65535,z+=A>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[7]=D=J&65535|Z<<16,p[7]=re=W&65535|z<<16,m+=128,y-=128}return m}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Ou),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=an,r=Ou,n=Mt;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(B){const F=new Float64Array(16);if(B)for(let N=0;N<B.length;N++)F[N]=B[N];return F}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]),w=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function y(B,F){for(let N=0;N<16;N++)B[N]=F[N]|0}function E(B){let F=1;for(let N=0;N<16;N++){let f=B[N]+F+65535;F=Math.floor(f/65536),B[N]=f-F*65536}B[0]+=F-1+37*(F-1)}function T(B,F,N){const f=~(N-1);for(let $=0;$<16;$++){const ee=f&(B[$]^F[$]);B[$]^=ee,F[$]^=ee}}function R(B,F){const N=i(),f=i();for(let $=0;$<16;$++)f[$]=F[$];E(f),E(f),E(f);for(let $=0;$<2;$++){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 $=0;$<16;$++)B[2*$]=f[$]&255,B[2*$+1]=f[$]>>8}function L(B,F){let N=0;for(let f=0;f<32;f++)N|=B[f]^F[f];return(1&N-1>>>8)-1}function x(B,F){const N=new Uint8Array(32),f=new Uint8Array(32);return R(N,B),R(f,F),L(N,f)}function O(B){const F=new Uint8Array(32);return R(F,B),F[0]&1}function _(B,F){for(let N=0;N<16;N++)B[N]=F[2*N]+(F[2*N+1]<<8);B[15]&=32767}function D(B,F,N){for(let f=0;f<16;f++)B[f]=F[f]+N[f]}function I(B,F,N){for(let f=0;f<16;f++)B[f]=F[f]-N[f]}function h(B,F,N){let f,$,ee=0,ne=0,Ee=0,Me=0,$e=0,Ue=0,Ge=0,qe=0,Pe=0,Ie=0,me=0,Se=0,Oe=0,pe=0,xe=0,g=0,u=0,d=0,b=0,P=0,U=0,k=0,oe=0,he=0,Ne=0,Be=0,Le=0,jt=0,tn=0,Fi=0,Gs=0,tt=N[0],Ye=N[1],rt=N[2],nt=N[3],it=N[4],Je=N[5],dt=N[6],ft=N[7],pt=N[8],gt=N[9],mt=N[10],lt=N[11],st=N[12],Ve=N[13],wt=N[14],yt=N[15];f=F[0],ee+=f*tt,ne+=f*Ye,Ee+=f*rt,Me+=f*nt,$e+=f*it,Ue+=f*Je,Ge+=f*dt,qe+=f*ft,Pe+=f*pt,Ie+=f*gt,me+=f*mt,Se+=f*lt,Oe+=f*st,pe+=f*Ve,xe+=f*wt,g+=f*yt,f=F[1],ne+=f*tt,Ee+=f*Ye,Me+=f*rt,$e+=f*nt,Ue+=f*it,Ge+=f*Je,qe+=f*dt,Pe+=f*ft,Ie+=f*pt,me+=f*gt,Se+=f*mt,Oe+=f*lt,pe+=f*st,xe+=f*Ve,g+=f*wt,u+=f*yt,f=F[2],Ee+=f*tt,Me+=f*Ye,$e+=f*rt,Ue+=f*nt,Ge+=f*it,qe+=f*Je,Pe+=f*dt,Ie+=f*ft,me+=f*pt,Se+=f*gt,Oe+=f*mt,pe+=f*lt,xe+=f*st,g+=f*Ve,u+=f*wt,d+=f*yt,f=F[3],Me+=f*tt,$e+=f*Ye,Ue+=f*rt,Ge+=f*nt,qe+=f*it,Pe+=f*Je,Ie+=f*dt,me+=f*ft,Se+=f*pt,Oe+=f*gt,pe+=f*mt,xe+=f*lt,g+=f*st,u+=f*Ve,d+=f*wt,b+=f*yt,f=F[4],$e+=f*tt,Ue+=f*Ye,Ge+=f*rt,qe+=f*nt,Pe+=f*it,Ie+=f*Je,me+=f*dt,Se+=f*ft,Oe+=f*pt,pe+=f*gt,xe+=f*mt,g+=f*lt,u+=f*st,d+=f*Ve,b+=f*wt,P+=f*yt,f=F[5],Ue+=f*tt,Ge+=f*Ye,qe+=f*rt,Pe+=f*nt,Ie+=f*it,me+=f*Je,Se+=f*dt,Oe+=f*ft,pe+=f*pt,xe+=f*gt,g+=f*mt,u+=f*lt,d+=f*st,b+=f*Ve,P+=f*wt,U+=f*yt,f=F[6],Ge+=f*tt,qe+=f*Ye,Pe+=f*rt,Ie+=f*nt,me+=f*it,Se+=f*Je,Oe+=f*dt,pe+=f*ft,xe+=f*pt,g+=f*gt,u+=f*mt,d+=f*lt,b+=f*st,P+=f*Ve,U+=f*wt,k+=f*yt,f=F[7],qe+=f*tt,Pe+=f*Ye,Ie+=f*rt,me+=f*nt,Se+=f*it,Oe+=f*Je,pe+=f*dt,xe+=f*ft,g+=f*pt,u+=f*gt,d+=f*mt,b+=f*lt,P+=f*st,U+=f*Ve,k+=f*wt,oe+=f*yt,f=F[8],Pe+=f*tt,Ie+=f*Ye,me+=f*rt,Se+=f*nt,Oe+=f*it,pe+=f*Je,xe+=f*dt,g+=f*ft,u+=f*pt,d+=f*gt,b+=f*mt,P+=f*lt,U+=f*st,k+=f*Ve,oe+=f*wt,he+=f*yt,f=F[9],Ie+=f*tt,me+=f*Ye,Se+=f*rt,Oe+=f*nt,pe+=f*it,xe+=f*Je,g+=f*dt,u+=f*ft,d+=f*pt,b+=f*gt,P+=f*mt,U+=f*lt,k+=f*st,oe+=f*Ve,he+=f*wt,Ne+=f*yt,f=F[10],me+=f*tt,Se+=f*Ye,Oe+=f*rt,pe+=f*nt,xe+=f*it,g+=f*Je,u+=f*dt,d+=f*ft,b+=f*pt,P+=f*gt,U+=f*mt,k+=f*lt,oe+=f*st,he+=f*Ve,Ne+=f*wt,Be+=f*yt,f=F[11],Se+=f*tt,Oe+=f*Ye,pe+=f*rt,xe+=f*nt,g+=f*it,u+=f*Je,d+=f*dt,b+=f*ft,P+=f*pt,U+=f*gt,k+=f*mt,oe+=f*lt,he+=f*st,Ne+=f*Ve,Be+=f*wt,Le+=f*yt,f=F[12],Oe+=f*tt,pe+=f*Ye,xe+=f*rt,g+=f*nt,u+=f*it,d+=f*Je,b+=f*dt,P+=f*ft,U+=f*pt,k+=f*gt,oe+=f*mt,he+=f*lt,Ne+=f*st,Be+=f*Ve,Le+=f*wt,jt+=f*yt,f=F[13],pe+=f*tt,xe+=f*Ye,g+=f*rt,u+=f*nt,d+=f*it,b+=f*Je,P+=f*dt,U+=f*ft,k+=f*pt,oe+=f*gt,he+=f*mt,Ne+=f*lt,Be+=f*st,Le+=f*Ve,jt+=f*wt,tn+=f*yt,f=F[14],xe+=f*tt,g+=f*Ye,u+=f*rt,d+=f*nt,b+=f*it,P+=f*Je,U+=f*dt,k+=f*ft,oe+=f*pt,he+=f*gt,Ne+=f*mt,Be+=f*lt,Le+=f*st,jt+=f*Ve,tn+=f*wt,Fi+=f*yt,f=F[15],g+=f*tt,u+=f*Ye,d+=f*rt,b+=f*nt,P+=f*it,U+=f*Je,k+=f*dt,oe+=f*ft,he+=f*pt,Ne+=f*gt,Be+=f*mt,Le+=f*lt,jt+=f*st,tn+=f*Ve,Fi+=f*wt,Gs+=f*yt,ee+=38*u,ne+=38*d,Ee+=38*b,Me+=38*P,$e+=38*U,Ue+=38*k,Ge+=38*oe,qe+=38*he,Pe+=38*Ne,Ie+=38*Be,me+=38*Le,Se+=38*jt,Oe+=38*tn,pe+=38*Fi,xe+=38*Gs,$=1,f=ee+$+65535,$=Math.floor(f/65536),ee=f-$*65536,f=ne+$+65535,$=Math.floor(f/65536),ne=f-$*65536,f=Ee+$+65535,$=Math.floor(f/65536),Ee=f-$*65536,f=Me+$+65535,$=Math.floor(f/65536),Me=f-$*65536,f=$e+$+65535,$=Math.floor(f/65536),$e=f-$*65536,f=Ue+$+65535,$=Math.floor(f/65536),Ue=f-$*65536,f=Ge+$+65535,$=Math.floor(f/65536),Ge=f-$*65536,f=qe+$+65535,$=Math.floor(f/65536),qe=f-$*65536,f=Pe+$+65535,$=Math.floor(f/65536),Pe=f-$*65536,f=Ie+$+65535,$=Math.floor(f/65536),Ie=f-$*65536,f=me+$+65535,$=Math.floor(f/65536),me=f-$*65536,f=Se+$+65535,$=Math.floor(f/65536),Se=f-$*65536,f=Oe+$+65535,$=Math.floor(f/65536),Oe=f-$*65536,f=pe+$+65535,$=Math.floor(f/65536),pe=f-$*65536,f=xe+$+65535,$=Math.floor(f/65536),xe=f-$*65536,f=g+$+65535,$=Math.floor(f/65536),g=f-$*65536,ee+=$-1+37*($-1),$=1,f=ee+$+65535,$=Math.floor(f/65536),ee=f-$*65536,f=ne+$+65535,$=Math.floor(f/65536),ne=f-$*65536,f=Ee+$+65535,$=Math.floor(f/65536),Ee=f-$*65536,f=Me+$+65535,$=Math.floor(f/65536),Me=f-$*65536,f=$e+$+65535,$=Math.floor(f/65536),$e=f-$*65536,f=Ue+$+65535,$=Math.floor(f/65536),Ue=f-$*65536,f=Ge+$+65535,$=Math.floor(f/65536),Ge=f-$*65536,f=qe+$+65535,$=Math.floor(f/65536),qe=f-$*65536,f=Pe+$+65535,$=Math.floor(f/65536),Pe=f-$*65536,f=Ie+$+65535,$=Math.floor(f/65536),Ie=f-$*65536,f=me+$+65535,$=Math.floor(f/65536),me=f-$*65536,f=Se+$+65535,$=Math.floor(f/65536),Se=f-$*65536,f=Oe+$+65535,$=Math.floor(f/65536),Oe=f-$*65536,f=pe+$+65535,$=Math.floor(f/65536),pe=f-$*65536,f=xe+$+65535,$=Math.floor(f/65536),xe=f-$*65536,f=g+$+65535,$=Math.floor(f/65536),g=f-$*65536,ee+=$-1+37*($-1),B[0]=ee,B[1]=ne,B[2]=Ee,B[3]=Me,B[4]=$e,B[5]=Ue,B[6]=Ge,B[7]=qe,B[8]=Pe,B[9]=Ie,B[10]=me,B[11]=Se,B[12]=Oe,B[13]=pe,B[14]=xe,B[15]=g}function v(B,F){h(B,F,F)}function H(B,F){const N=i();let f;for(f=0;f<16;f++)N[f]=F[f];for(f=253;f>=0;f--)v(N,N),f!==2&&f!==4&&h(N,N,F);for(f=0;f<16;f++)B[f]=N[f]}function j(B,F){const N=i();let f;for(f=0;f<16;f++)N[f]=F[f];for(f=250;f>=0;f--)v(N,N),f!==1&&h(N,N,F);for(f=0;f<16;f++)B[f]=N[f]}function q(B,F){const N=i(),f=i(),$=i(),ee=i(),ne=i(),Ee=i(),Me=i(),$e=i(),Ue=i();I(N,B[1],B[0]),I(Ue,F[1],F[0]),h(N,N,Ue),D(f,B[0],B[1]),D(Ue,F[0],F[1]),h(f,f,Ue),h($,B[3],F[3]),h($,$,l),h(ee,B[2],F[2]),D(ee,ee,ee),I(ne,f,N),I(Ee,ee,$),D(Me,ee,$),D($e,f,N),h(B[0],ne,Ee),h(B[1],$e,Me),h(B[2],Me,Ee),h(B[3],ne,$e)}function X(B,F,N){for(let f=0;f<4;f++)T(B[f],F[f],N)}function re(B,F){const N=i(),f=i(),$=i();H($,F[2]),h(N,F[0],$),h(f,F[1],$),R(B,f),B[31]^=O(N)<<7}function C(B,F,N){y(B[0],o),y(B[1],a),y(B[2],a),y(B[3],o);for(let f=255;f>=0;--f){const $=N[f/8|0]>>(f&7)&1;X(B,F,$),q(F,B),q(B,B),X(B,F,$)}}function A(B,F){const N=[i(),i(),i(),i()];y(N[0],p),y(N[1],w),y(N[2],a),h(N[3],p,w),C(B,N,F)}function G(B){if(B.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const F=(0,r.hash)(B);F[0]&=248,F[31]&=127,F[31]|=64;const N=new Uint8Array(32),f=[i(),i(),i(),i()];A(f,F),re(N,f);const $=new Uint8Array(64);return $.set(B),$.set(N,32),{publicKey:N,secretKey:$}}t.generateKeyPairFromSeed=G;function K(B){const F=(0,e.randomBytes)(32,B),N=G(F);return(0,n.wipe)(F),N}t.generateKeyPair=K;function W(B){if(B.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(B.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(B,F){let N,f,$,ee;for(f=63;f>=32;--f){for(N=0,$=f-32,ee=f-12;$<ee;++$)F[$]+=N-16*F[f]*z[$-(f-32)],N=Math.floor((F[$]+128)/256),F[$]-=N*256;F[$]+=N,F[f]=0}for(N=0,$=0;$<32;$++)F[$]+=N-(F[31]>>4)*z[$],N=F[$]>>8,F[$]&=255;for($=0;$<32;$++)F[$]-=N*z[$];for(f=0;f<32;f++)F[f+1]+=F[f]>>8,B[f]=F[f]&255}function Z(B){const F=new Float64Array(64);for(let N=0;N<64;N++)F[N]=B[N];for(let N=0;N<64;N++)B[N]=0;J(B,F)}function ue(B,F){const N=new Float64Array(64),f=[i(),i(),i(),i()],$=(0,r.hash)(B.subarray(0,32));$[0]&=248,$[31]&=127,$[31]|=64;const ee=new Uint8Array(64);ee.set($.subarray(32),32);const ne=new r.SHA512;ne.update(ee.subarray(32)),ne.update(F);const Ee=ne.digest();ne.clean(),Z(Ee),A(f,Ee),re(ee,f),ne.reset(),ne.update(ee.subarray(0,32)),ne.update(B.subarray(32)),ne.update(F);const Me=ne.digest();Z(Me);for(let $e=0;$e<32;$e++)N[$e]=Ee[$e];for(let $e=0;$e<32;$e++)for(let Ue=0;Ue<32;Ue++)N[$e+Ue]+=Me[$e]*$[Ue];return J(ee.subarray(32),N),ee}t.sign=ue;function Q(B,F){const N=i(),f=i(),$=i(),ee=i(),ne=i(),Ee=i(),Me=i();return y(B[2],a),_(B[1],F),v($,B[1]),h(ee,$,c),I($,$,B[2]),D(ee,B[2],ee),v(ne,ee),v(Ee,ne),h(Me,Ee,ne),h(N,Me,$),h(N,N,ee),j(N,N),h(N,N,$),h(N,N,ee),h(N,N,ee),h(B[0],N,ee),v(f,B[0]),h(f,f,ee),x(f,$)&&h(B[0],B[0],m),v(f,B[0]),h(f,f,ee),x(f,$)?-1:(O(B[0])===F[31]>>7&&I(B[0],o,B[0]),h(B[3],B[0],B[1]),0)}function fe(B,F,N){const f=new Uint8Array(32),$=[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,B))return!1;const ne=new r.SHA512;ne.update(N.subarray(0,32)),ne.update(B),ne.update(F);const Ee=ne.digest();return Z(Ee),C($,ee,Ee),A(ee,N.subarray(32)),q($,ee),re(f,$),!L(N,f)}t.verify=fe;function ae(B){let F=[i(),i(),i(),i()];if(Q(F,B))throw new Error("Ed25519: invalid public key");let N=i(),f=i(),$=F[1];D(N,a,$),I(f,a,$),H(f,f),h(N,N,f);let ee=new Uint8Array(32);return R(ee,N),ee}t.convertPublicKeyToX25519=ae;function Ce(B){const F=(0,r.hash)(B.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const N=new Uint8Array(F.subarray(0,32));return(0,n.wipe)(F),N}t.convertSecretKeyToX25519=Ce}(Yo);const K3="EdDSA",G3="JWT",Au=".",$u="base64url",Z3="utf8",Y3="utf8",J3=":",X3="did",Q3="key",Pu="base58btc",em="z",tm="K36",rm=32;function is(t){return Pt($t(ti(t),Z3),$u)}function Tu(t){const e=$t(tm,Pu),r=em+Pt(lo([e,t]),Pu);return[X3,Q3,r].join(J3)}function nm(t){return Pt(t,$u)}function im(t){return $t([is(t.header),is(t.payload)].join(Au),Y3)}function sm(t){return[is(t.header),is(t.payload),nm(t.signature)].join(Au)}function Ru(t=an.randomBytes(rm)){return Yo.generateKeyPairFromSeed(t)}async function om(t,e,r,n,i=ge.fromMiliseconds(Date.now())){const s={alg:K3,typ:G3},o=Tu(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=im({header:s,payload:c}),p=Yo.sign(n.secretKey,l);return sm({header:s,payload:c,signature:p})}const am="PARSE_ERROR",cm="INVALID_REQUEST",lm="METHOD_NOT_FOUND",um="INVALID_PARAMS",Nu="INTERNAL_ERROR",Jo="SERVER_ERROR",hm=[-32700,-32600,-32601,-32602,-32603],ri={[am]:{code:-32700,message:"Parse error"},[cm]:{code:-32600,message:"Invalid Request"},[lm]:{code:-32601,message:"Method not found"},[um]:{code:-32602,message:"Invalid params"},[Nu]:{code:-32603,message:"Internal error"},[Jo]:{code:-32e3,message:"Server error"}},Lu=Jo;function dm(t){return hm.includes(t)}function Mu(t){return Object.keys(ri).includes(t)?ri[t]:ri[Lu]}function fm(t){const e=Object.values(ri).find(r=>r.code===t);return e||ri[Lu]}function Uu(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Fu={};/*! *****************************************************************************
|
|
54
54
|
Copyright (c) Microsoft Corporation.
|
|
55
55
|
|
|
56
56
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -63,32 +63,32 @@
|
|
|
63
63
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
64
64
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
65
65
|
PERFORMANCE OF THIS SOFTWARE.
|
|
66
|
-
***************************************************************************** */var Xo=function(t,e){return Xo=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])},Xo(t,e)};function _m(t,e){Xo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Qo=function(){return Qo=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},Qo.apply(this,arguments)};function Em(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 xm(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 Cm(t,e){return function(r,n){e(r,n,t)}}function Sm(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Dm(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(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function Im(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 Om(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Am(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ea(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 ju(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 $m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(ju(arguments[e]));return t}function Pm(){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 ni(t){return this instanceof ni?(this.v=t,this):new ni(t)}function Tm(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(m){n[m]&&(i[m]=function(y){return new Promise(function(E,T){s.push([m,y,E,T])>1||a(m,y)})})}function a(m,y){try{c(n[m](y))}catch(E){w(s[0][3],E)}}function c(m){m.value instanceof ni?Promise.resolve(m.value.v).then(l,p):w(s[0][2],m)}function l(m){a("next",m)}function p(m){a("throw",m)}function w(m,y){m(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Rm(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:ni(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function Nm(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 ea=="function"?ea(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 Lm(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Mm(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 Um(t){return t&&t.__esModule?t:{default:t}}function Fm(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Bm(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 jm=Object.freeze({__proto__:null,__extends:_m,get __assign(){return Qo},__rest:Em,__decorate:xm,__param:Cm,__metadata:Sm,__awaiter:Dm,__generator:Im,__createBinding:Om,__exportStar:Am,__values:ea,__read:ju,__spread:$m,__spreadArrays:Pm,__await:ni,__asyncGenerator:Tm,__asyncDelegator:Rm,__asyncValues:Nm,__makeTemplateObject:Lm,__importStar:Mm,__importDefault:Um,__classPrivateFieldGet:Fm,__classPrivateFieldSet:Bm}),km=Ar(jm),ar={},ku;function Hm(){if(ku)return ar;ku=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.isBrowserCryptoAvailable=ar.getSubtleCrypto=ar.getBrowerCrypto=void 0;function t(){return ut?.crypto||ut?.msCrypto||{}}ar.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}ar.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return ar.isBrowserCryptoAvailable=r,ar}var cr={},Hu;function zm(){if(Hu)return cr;Hu=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.isBrowser=cr.isNode=cr.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}cr.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}cr.isNode=e;function r(){return!t()&&!e()}return cr.isBrowser=r,cr}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=km;e.__exportStar(Hm(),t),e.__exportStar(zm(),t)})(Bu);function Wm(){const t=Date.now()*Math.pow(10,3),e=Math.floor(Math.random()*Math.pow(10,3));return t+e}function ss(t,e,r){return{id:r||Wm(),jsonrpc:"2.0",method:t,params:e}}function ta(t,e){return{id:t,jsonrpc:"2.0",result:e}}function os(t,e,r){return{id:t,jsonrpc:"2.0",error:qm(e,r)}}function qm(t,e){return typeof t>"u"?Uu(Lu):(typeof t=="string"&&(t=Object.assign(Object.assign({},Uu(Jo)),{message:t})),typeof e<"u"&&(t.data=e),bm(t.code)&&(t=vm(t.code)),t)}class Vm{}class Km extends Vm{constructor(){super()}}class Gm extends Km{constructor(e){super()}}const Zm="^https?:",Ym="^wss?:";function Jm(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function zu(t,e){const r=Jm(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Wu(t){return zu(t,Zm)}function qu(t){return zu(t,Ym)}function Xm(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Vu(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function ra(t){return Vu(t)&&"method"in t}function na(t){return Vu(t)&&(lr(t)||Gt(t))}function lr(t){return"result"in t}function Gt(t){return"error"in t}class ii extends Gm{constructor(e){super(e),this.events=new vt.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(ss(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=>{Gt(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),na(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}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",()=>this.events.emit("disconnect")),this.connection.on("error",e=>this.events.emit("error",e)),this.hasRegisteredEventListeners=!0)}}const Ku=10,Qm=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),e5=()=>typeof window<"u",t5=Qm();class r5{constructor(e){if(this.url=e,this.events=new vt.exports.EventEmitter,this.registering=!1,!qu(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(){if(typeof this.socket>"u")throw new Error("Connection already closed");this.socket.close(),this.onClose()}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ti(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!qu(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=Bu.isReactNative()?void 0:{rejectUnauthorized:!Xm(e)},s=new t5(e,[],i);e5()?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=()=>this.onClose(),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(){this.socket=void 0,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Zo(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=os(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Fu(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>Ku&&this.events.setMaxListeners(Ku)}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 ia={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]",w="[object Date]",m="[object Error]",y="[object Function]",E="[object GeneratorFunction]",T="[object Map]",R="[object Number]",L="[object Null]",x="[object Object]",O="[object Promise]",_="[object Proxy]",D="[object RegExp]",I="[object Set]",h="[object String]",v="[object Symbol]",H="[object Undefined]",j="[object WeakMap]",q="[object ArrayBuffer]",X="[object DataView]",re="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",G="[object Int16Array]",K="[object Int32Array]",W="[object Uint8Array]",z="[object Uint8ClampedArray]",J="[object Uint16Array]",Z="[object Uint32Array]",ue=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,ae={};ae[re]=ae[C]=ae[A]=ae[G]=ae[K]=ae[W]=ae[z]=ae[J]=ae[Z]=!0,ae[a]=ae[c]=ae[q]=ae[p]=ae[X]=ae[w]=ae[m]=ae[y]=ae[T]=ae[R]=ae[x]=ae[D]=ae[I]=ae[h]=ae[j]=!1;var Ce=typeof ut=="object"&&ut&&ut.Object===Object&&ut,B=typeof self=="object"&&self&&self.Object===Object&&self,F=Ce||B||Function("return this")(),N=e&&!e.nodeType&&e,f=N&&!0&&t&&!t.nodeType&&t,$=f&&f.exports===N,ee=$&&Ce.process,ne=function(){try{return ee&&ee.binding&&ee.binding("util")}catch{}}(),Ee=ne&&ne.isTypedArray;function Me(S,M){for(var Y=-1,ce=S==null?0:S.length,We=0,De=[];++Y<ce;){var Xe=S[Y];M(Xe,Y,S)&&(De[We++]=Xe)}return De}function $e(S,M){for(var Y=-1,ce=M.length,We=S.length;++Y<ce;)S[We+Y]=M[Y];return S}function Ue(S,M){for(var Y=-1,ce=S==null?0:S.length;++Y<ce;)if(M(S[Y],Y,S))return!0;return!1}function Ge(S,M){for(var Y=-1,ce=Array(S);++Y<S;)ce[Y]=M(Y);return ce}function qe(S){return function(M){return S(M)}}function Pe(S,M){return S.has(M)}function Ie(S,M){return S?.[M]}function me(S){var M=-1,Y=Array(S.size);return S.forEach(function(ce,We){Y[++M]=[We,ce]}),Y}function Se(S,M){return function(Y){return S(M(Y))}}function Oe(S){var M=-1,Y=Array(S.size);return S.forEach(function(ce){Y[++M]=ce}),Y}var pe=Array.prototype,xe=Function.prototype,g=Object.prototype,u=F["__core-js_shared__"],d=xe.toString,b=g.hasOwnProperty,P=function(){var S=/[^.]+$/.exec(u&&u.keys&&u.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),U=g.toString,k=RegExp("^"+d.call(b).replace(ue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=$?F.Buffer:void 0,he=F.Symbol,Ne=F.Uint8Array,Be=g.propertyIsEnumerable,Le=pe.splice,jt=he?he.toStringTag:void 0,tn=Object.getOwnPropertySymbols,Fi=oe?oe.isBuffer:void 0,Gs=Se(Object.keys,Object),tt=Tn(F,"DataView"),Ye=Tn(F,"Map"),rt=Tn(F,"Promise"),nt=Tn(F,"Set"),it=Tn(F,"WeakMap"),Je=Tn(Object,"create"),dt=nn(tt),ft=nn(Ye),pt=nn(rt),gt=nn(nt),mt=nn(it),lt=he?he.prototype:void 0,st=lt?lt.valueOf:void 0;function Ve(S){var M=-1,Y=S==null?0:S.length;for(this.clear();++M<Y;){var ce=S[M];this.set(ce[0],ce[1])}}function wt(){this.__data__=Je?Je(null):{},this.size=0}function yt(S){var M=this.has(S)&&delete this.__data__[S];return this.size-=M?1:0,M}function P_(S){var M=this.__data__;if(Je){var Y=M[S];return Y===n?void 0:Y}return b.call(M,S)?M[S]:void 0}function T_(S){var M=this.__data__;return Je?M[S]!==void 0:b.call(M,S)}function R_(S,M){var Y=this.__data__;return this.size+=this.has(S)?0:1,Y[S]=Je&&M===void 0?n:M,this}Ve.prototype.clear=wt,Ve.prototype.delete=yt,Ve.prototype.get=P_,Ve.prototype.has=T_,Ve.prototype.set=R_;function dr(S){var M=-1,Y=S==null?0:S.length;for(this.clear();++M<Y;){var ce=S[M];this.set(ce[0],ce[1])}}function N_(){this.__data__=[],this.size=0}function L_(S){var M=this.__data__,Y=Ys(M,S);if(Y<0)return!1;var ce=M.length-1;return Y==ce?M.pop():Le.call(M,Y,1),--this.size,!0}function M_(S){var M=this.__data__,Y=Ys(M,S);return Y<0?void 0:M[Y][1]}function U_(S){return Ys(this.__data__,S)>-1}function F_(S,M){var Y=this.__data__,ce=Ys(Y,S);return ce<0?(++this.size,Y.push([S,M])):Y[ce][1]=M,this}dr.prototype.clear=N_,dr.prototype.delete=L_,dr.prototype.get=M_,dr.prototype.has=U_,dr.prototype.set=F_;function rn(S){var M=-1,Y=S==null?0:S.length;for(this.clear();++M<Y;){var ce=S[M];this.set(ce[0],ce[1])}}function B_(){this.size=0,this.__data__={hash:new Ve,map:new(Ye||dr),string:new Ve}}function j_(S){var M=Js(this,S).delete(S);return this.size-=M?1:0,M}function k_(S){return Js(this,S).get(S)}function H_(S){return Js(this,S).has(S)}function z_(S,M){var Y=Js(this,S),ce=Y.size;return Y.set(S,M),this.size+=Y.size==ce?0:1,this}rn.prototype.clear=B_,rn.prototype.delete=j_,rn.prototype.get=k_,rn.prototype.has=H_,rn.prototype.set=z_;function Zs(S){var M=-1,Y=S==null?0:S.length;for(this.__data__=new rn;++M<Y;)this.add(S[M])}function W_(S){return this.__data__.set(S,n),this}function q_(S){return this.__data__.has(S)}Zs.prototype.add=Zs.prototype.push=W_,Zs.prototype.has=q_;function Sr(S){var M=this.__data__=new dr(S);this.size=M.size}function V_(){this.__data__=new dr,this.size=0}function K_(S){var M=this.__data__,Y=M.delete(S);return this.size=M.size,Y}function G_(S){return this.__data__.get(S)}function Z_(S){return this.__data__.has(S)}function Y_(S,M){var Y=this.__data__;if(Y instanceof dr){var ce=Y.__data__;if(!Ye||ce.length<r-1)return ce.push([S,M]),this.size=++Y.size,this;Y=this.__data__=new rn(ce)}return Y.set(S,M),this.size=Y.size,this}Sr.prototype.clear=V_,Sr.prototype.delete=K_,Sr.prototype.get=G_,Sr.prototype.has=Z_,Sr.prototype.set=Y_;function J_(S,M){var Y=Xs(S),ce=!Y&&d7(S),We=!Y&&!ce&&Ic(S),De=!Y&&!ce&&!We&&Sd(S),Xe=Y||ce||We||De,bt=Xe?Ge(S.length,String):[],Ct=bt.length;for(var Ze in S)(M||b.call(S,Ze))&&!(Xe&&(Ze=="length"||We&&(Ze=="offset"||Ze=="parent")||De&&(Ze=="buffer"||Ze=="byteLength"||Ze=="byteOffset")||a7(Ze,Ct)))&&bt.push(Ze);return bt}function Ys(S,M){for(var Y=S.length;Y--;)if(_d(S[Y][0],M))return Y;return-1}function X_(S,M,Y){var ce=M(S);return Xs(S)?ce:$e(ce,Y(S))}function Bi(S){return S==null?S===void 0?H:L:jt&&jt in Object(S)?s7(S):h7(S)}function wd(S){return ji(S)&&Bi(S)==a}function yd(S,M,Y,ce,We){return S===M?!0:S==null||M==null||!ji(S)&&!ji(M)?S!==S&&M!==M:Q_(S,M,Y,ce,yd,We)}function Q_(S,M,Y,ce,We,De){var Xe=Xs(S),bt=Xs(M),Ct=Xe?c:Dr(S),Ze=bt?c:Dr(M);Ct=Ct==a?x:Ct,Ze=Ze==a?x:Ze;var kt=Ct==x,Yt=Ze==x,It=Ct==Ze;if(It&&Ic(S)){if(!Ic(M))return!1;Xe=!0,kt=!1}if(It&&!kt)return De||(De=new Sr),Xe||Sd(S)?bd(S,M,Y,ce,We,De):n7(S,M,Ct,Y,ce,We,De);if(!(Y&i)){var Vt=kt&&b.call(S,"__wrapped__"),Kt=Yt&&b.call(M,"__wrapped__");if(Vt||Kt){var Ir=Vt?S.value():S,fr=Kt?M.value():M;return De||(De=new Sr),We(Ir,fr,Y,ce,De)}}return It?(De||(De=new Sr),i7(S,M,Y,ce,We,De)):!1}function e7(S){if(!Cd(S)||l7(S))return!1;var M=Ed(S)?k:Q;return M.test(nn(S))}function t7(S){return ji(S)&&xd(S.length)&&!!ae[Bi(S)]}function r7(S){if(!u7(S))return Gs(S);var M=[];for(var Y in Object(S))b.call(S,Y)&&Y!="constructor"&&M.push(Y);return M}function bd(S,M,Y,ce,We,De){var Xe=Y&i,bt=S.length,Ct=M.length;if(bt!=Ct&&!(Xe&&Ct>bt))return!1;var Ze=De.get(S);if(Ze&&De.get(M))return Ze==M;var kt=-1,Yt=!0,It=Y&s?new Zs:void 0;for(De.set(S,M),De.set(M,S);++kt<bt;){var Vt=S[kt],Kt=M[kt];if(ce)var Ir=Xe?ce(Kt,Vt,kt,M,S,De):ce(Vt,Kt,kt,S,M,De);if(Ir!==void 0){if(Ir)continue;Yt=!1;break}if(It){if(!Ue(M,function(fr,sn){if(!Pe(It,sn)&&(Vt===fr||We(Vt,fr,Y,ce,De)))return It.push(sn)})){Yt=!1;break}}else if(!(Vt===Kt||We(Vt,Kt,Y,ce,De))){Yt=!1;break}}return De.delete(S),De.delete(M),Yt}function n7(S,M,Y,ce,We,De,Xe){switch(Y){case X:if(S.byteLength!=M.byteLength||S.byteOffset!=M.byteOffset)return!1;S=S.buffer,M=M.buffer;case q:return!(S.byteLength!=M.byteLength||!De(new Ne(S),new Ne(M)));case p:case w:case R:return _d(+S,+M);case m:return S.name==M.name&&S.message==M.message;case D:case h:return S==M+"";case T:var bt=me;case I:var Ct=ce&i;if(bt||(bt=Oe),S.size!=M.size&&!Ct)return!1;var Ze=Xe.get(S);if(Ze)return Ze==M;ce|=s,Xe.set(S,M);var kt=bd(bt(S),bt(M),ce,We,De,Xe);return Xe.delete(S),kt;case v:if(st)return st.call(S)==st.call(M)}return!1}function i7(S,M,Y,ce,We,De){var Xe=Y&i,bt=vd(S),Ct=bt.length,Ze=vd(M),kt=Ze.length;if(Ct!=kt&&!Xe)return!1;for(var Yt=Ct;Yt--;){var It=bt[Yt];if(!(Xe?It in M:b.call(M,It)))return!1}var Vt=De.get(S);if(Vt&&De.get(M))return Vt==M;var Kt=!0;De.set(S,M),De.set(M,S);for(var Ir=Xe;++Yt<Ct;){It=bt[Yt];var fr=S[It],sn=M[It];if(ce)var Dd=Xe?ce(sn,fr,It,M,S,De):ce(fr,sn,It,S,M,De);if(!(Dd===void 0?fr===sn||We(fr,sn,Y,ce,De):Dd)){Kt=!1;break}Ir||(Ir=It=="constructor")}if(Kt&&!Ir){var Qs=S.constructor,eo=M.constructor;Qs!=eo&&"constructor"in S&&"constructor"in M&&!(typeof Qs=="function"&&Qs instanceof Qs&&typeof eo=="function"&&eo instanceof eo)&&(Kt=!1)}return De.delete(S),De.delete(M),Kt}function vd(S){return X_(S,g7,o7)}function Js(S,M){var Y=S.__data__;return c7(M)?Y[typeof M=="string"?"string":"hash"]:Y.map}function Tn(S,M){var Y=Ie(S,M);return e7(Y)?Y:void 0}function s7(S){var M=b.call(S,jt),Y=S[jt];try{S[jt]=void 0;var ce=!0}catch{}var We=U.call(S);return ce&&(M?S[jt]=Y:delete S[jt]),We}var o7=tn?function(S){return S==null?[]:(S=Object(S),Me(tn(S),function(M){return Be.call(S,M)}))}:m7,Dr=Bi;(tt&&Dr(new tt(new ArrayBuffer(1)))!=X||Ye&&Dr(new Ye)!=T||rt&&Dr(rt.resolve())!=O||nt&&Dr(new nt)!=I||it&&Dr(new it)!=j)&&(Dr=function(S){var M=Bi(S),Y=M==x?S.constructor:void 0,ce=Y?nn(Y):"";if(ce)switch(ce){case dt:return X;case ft:return T;case pt:return O;case gt:return I;case mt:return j}return M});function a7(S,M){return M=M??o,!!M&&(typeof S=="number"||fe.test(S))&&S>-1&&S%1==0&&S<M}function c7(S){var M=typeof S;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?S!=="__proto__":S===null}function l7(S){return!!P&&P in S}function u7(S){var M=S&&S.constructor,Y=typeof M=="function"&&M.prototype||g;return S===Y}function h7(S){return U.call(S)}function nn(S){if(S!=null){try{return d.call(S)}catch{}try{return S+""}catch{}}return""}function _d(S,M){return S===M||S!==S&&M!==M}var d7=wd(function(){return arguments}())?wd:function(S){return ji(S)&&b.call(S,"callee")&&!Be.call(S,"callee")},Xs=Array.isArray;function f7(S){return S!=null&&xd(S.length)&&!Ed(S)}var Ic=Fi||w7;function p7(S,M){return yd(S,M)}function Ed(S){if(!Cd(S))return!1;var M=Bi(S);return M==y||M==E||M==l||M==_}function xd(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=o}function Cd(S){var M=typeof S;return S!=null&&(M=="object"||M=="function")}function ji(S){return S!=null&&typeof S=="object"}var Sd=Ee?qe(Ee):t7;function g7(S){return f7(S)?J_(S):r7(S)}function m7(){return[]}function w7(){return!1}t.exports=p7})(ia,ia.exports);var n5=ia.exports,i5=Object.defineProperty,Gu=Object.getOwnPropertySymbols,s5=Object.prototype.hasOwnProperty,o5=Object.prototype.propertyIsEnumerable,Zu=(t,e,r)=>e in t?i5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,At=(t,e)=>{for(var r in e||(e={}))s5.call(e,r)&&Zu(t,r,e[r]);if(Gu)for(var r of Gu(e))o5.call(e,r)&&Zu(t,r,e[r]);return t};function a5(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 w(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,x=E.length;L!==x&&E[L]===0;)L++,T++;for(var O=(x-L)*p+1>>>0,_=new Uint8Array(O);L!==x;){for(var D=E[L],I=0,h=O-1;(D!==0||I<R)&&h!==-1;h--,I++)D+=256*_[h]>>>0,_[h]=D%a>>>0,D=D/a>>>0;if(D!==0)throw new Error("Non-zero carry");R=I,L++}for(var v=O-R;v!==O&&_[v]===0;)v++;for(var H=c.repeat(T);v<O;++v)H+=t.charAt(_[v]);return H}function m(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 x=(E.length-T)*l+1>>>0,O=new Uint8Array(x);E[T];){var _=r[E.charCodeAt(T)];if(_===255)return;for(var D=0,I=x-1;(_!==0||D<L)&&I!==-1;I--,D++)_+=a*O[I]>>>0,O[I]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");L=D,T++}if(E[T]!==" "){for(var h=x-L;h!==x&&O[h]===0;)h++;for(var v=new Uint8Array(R+(x-h)),H=R;h!==x;)v[H++]=O[h++];return v}}}function y(E){var T=m(E);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:m,decode:y}}var c5=a5,l5=c5;const Yu=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")},u5=t=>new TextEncoder().encode(t),h5=t=>new TextDecoder().decode(t);class d5{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 f5{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 Ju(this,e)}}class p5{constructor(e){this.decoders=e}or(e){return Ju(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 Ju=(t,e)=>new p5(At(At({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class g5{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new d5(e,r,n),this.decoder=new f5(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const as=({name:t,prefix:e,encode:r,decode:n})=>new g5(t,e,r,n),si=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=l5(r,e);return as({prefix:t,name:e,encode:n,decode:s=>Yu(i(s))})},m5=(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 w=i[t[p]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|w,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},w5=(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},xt=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>as({prefix:e,name:t,encode(i){return w5(i,n,r)},decode(i){return m5(i,n,r,t)}}),y5=as({prefix:"\0",name:"identity",encode:t=>h5(t),decode:t=>u5(t)});var b5=Object.freeze({__proto__:null,identity:y5});const v5=xt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var _5=Object.freeze({__proto__:null,base2:v5});const E5=xt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var x5=Object.freeze({__proto__:null,base8:E5});const C5=si({prefix:"9",name:"base10",alphabet:"0123456789"});var S5=Object.freeze({__proto__:null,base10:C5});const D5=xt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),I5=xt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var O5=Object.freeze({__proto__:null,base16:D5,base16upper:I5});const A5=xt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$5=xt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),P5=xt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),T5=xt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),R5=xt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),N5=xt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),L5=xt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),M5=xt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),U5=xt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var F5=Object.freeze({__proto__:null,base32:A5,base32upper:$5,base32pad:P5,base32padupper:T5,base32hex:R5,base32hexupper:N5,base32hexpad:L5,base32hexpadupper:M5,base32z:U5});const B5=si({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),j5=si({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var k5=Object.freeze({__proto__:null,base36:B5,base36upper:j5});const H5=si({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),z5=si({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var W5=Object.freeze({__proto__:null,base58btc:H5,base58flickr:z5});const q5=xt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),V5=xt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),K5=xt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),G5=xt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Z5=Object.freeze({__proto__:null,base64:q5,base64pad:V5,base64url:K5,base64urlpad:G5});const Xu=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}"),Y5=Xu.reduce((t,e,r)=>(t[r]=e,t),[]),J5=Xu.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function X5(t){return t.reduce((e,r)=>(e+=Y5[r],e),"")}function Q5(t){const e=[];for(const r of t){const n=J5[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const ew=as({prefix:"\u{1F680}",name:"base256emoji",encode:X5,decode:Q5});var tw=Object.freeze({__proto__:null,base256emoji:ew}),rw=eh,Qu=128,nw=127,iw=~nw,sw=Math.pow(2,31);function eh(t,e,r){e=e||[],r=r||0;for(var n=r;t>=sw;)e[r++]=t&255|Qu,t/=128;for(;t&iw;)e[r++]=t&255|Qu,t>>>=7;return e[r]=t|0,eh.bytes=r-n+1,e}var ow=sa,aw=128,th=127;function sa(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw sa.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&th)<<i:(o&th)*Math.pow(2,i),i+=7}while(o>=aw);return sa.bytes=s-n,r}var cw=Math.pow(2,7),lw=Math.pow(2,14),uw=Math.pow(2,21),hw=Math.pow(2,28),dw=Math.pow(2,35),fw=Math.pow(2,42),pw=Math.pow(2,49),gw=Math.pow(2,56),mw=Math.pow(2,63),ww=function(t){return t<cw?1:t<lw?2:t<uw?3:t<hw?4:t<dw?5:t<fw?6:t<pw?7:t<gw?8:t<mw?9:10},yw={encode:rw,decode:ow,encodingLength:ww},rh=yw;const nh=(t,e,r=0)=>(rh.encode(t,e,r),e),ih=t=>rh.encodingLength(t),oa=(t,e)=>{const r=e.byteLength,n=ih(t),i=n+ih(r),s=new Uint8Array(i+r);return nh(t,s,0),nh(r,s,n),s.set(e,i),new bw(t,r,e,s)};class bw{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const sh=({name:t,code:e,encode:r})=>new vw(t,e,r);class vw{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?oa(this.code,r):r.then(n=>oa(this.code,n))}else throw Error("Unknown type, must be binary type")}}const oh=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),_w=sh({name:"sha2-256",code:18,encode:oh("SHA-256")}),Ew=sh({name:"sha2-512",code:19,encode:oh("SHA-512")});var xw=Object.freeze({__proto__:null,sha256:_w,sha512:Ew});const ah=0,Cw="identity",ch=Yu;var Sw=Object.freeze({__proto__:null,identity:{code:ah,name:Cw,encode:ch,digest:t=>oa(ah,ch(t))}});new TextEncoder,new TextDecoder;const lh=At(At(At(At(At(At(At(At(At(At({},b5),_5),x5),S5),O5),F5),k5),W5),Z5),tw);At(At({},xw),Sw);function Dw(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function uh(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const hh=uh("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),aa=uh("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=Dw(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Iw=At({utf8:hh,"utf-8":hh,hex:lh.base16,latin1:aa,ascii:aa,binary:aa},lh);function Ow(t,e="utf8"){const r=Iw[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 dh="wc",Aw=2,ca="core",wr=`${dh}@${2}:${ca}:`,$w={name:ca,logger:"error"},Pw={database:":memory:"},Tw="crypto",fh="client_ed25519_seed",Rw=ge.ONE_DAY,Nw="keychain",Lw="0.3",Mw="messages",Uw="0.3",Fw=ge.SIX_HOURS,Bw="publisher",ph="irn",jw="error",kw="wss://relay.walletconnect.com",Hw="relayer",Dt={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"},zw="_subscription",cs={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},gh=ge.ONE_SECOND,Ww="2.3.2",qw="0.3",er={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},Vw="subscription",Kw="0.3",Gw=ge.FIVE_SECONDS*1e3,Zw="pairing",Yw="0.3",oi={wc_pairingDelete:{req:{ttl:ge.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ge.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ge.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ge.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ge.ONE_DAY,prompt:!1,tag:0},res:{ttl:ge.ONE_DAY,prompt:!1,tag:0}}},tr={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Jw="history",Xw="0.3",Qw="expirer",zt={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},ey="0.3";class ty{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=Nw,this.version=Lw,this.initialized=!1,this.storagePrefix=wr,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}=se("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=je.generateChildLogger(r,this.name)}get context(){return je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Gl(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Zl(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ry{constructor(e,r,n){this.core=e,this.logger=r,this.name=Tw,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=Nu(i);return Ru(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=ng();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=Nu(s),a=Oo();return await fm(a,i,Rw,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=ig(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||sg(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=Hl(o),c=ti(s);if(zl(a)){const m=a.senderPublicKey,y=a.receiverPublicKey;i=await this.generateSharedKey(m,y)}const l=this.getSymKey(i),{type:p,senderPublicKey:w}=a;return ag({type:p,symKey:l,message:c,senderPublicKey:w})},this.decode=async(i,s,o)=>{this.isInitialized();const a=ug(s,o);if(zl(a)){const p=a.receiverPublicKey,w=a.senderPublicKey;i=await this.generateSharedKey(p,w)}const c=this.getSymKey(i),l=cg({symKey:c,encoded:s});return Zo(l)},this.core=e,this.logger=je.generateChildLogger(r,this.name),this.keychain=n||new ty(this.core,this.logger)}get context(){return je.getLoggerContext(this.logger)}getPayloadType(e){const r=$o(e);return Bn(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(fh)}catch{e=Oo(),await this.keychain.set(fh,e)}return Ow(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ny extends V3{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=Mw,this.version=Uw,this.initialized=!1,this.storagePrefix=wr,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=Ao(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=Ao(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=je.generateChildLogger(e,this.name),this.core=r}get context(){return je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Gl(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Zl(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class iy extends K3{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new vt.exports.EventEmitter,this.name=Bw,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||Fw,a=Po(s),c=s?.prompt||!1,l=s?.tag||0,p={topic:n,message:i,opts:{ttl:o,relay:a,prompt:c,tag:l}},w=Ao(i);this.queue.set(w,p);try{await await Yl(this.rpcPublish(n,i,o,a,c,l),this.publishTimeout),this.relayer.events.emit(Dt.publish,p)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(Dt.connection_stalled);return}this.onPublish(w,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=je.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return je.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,s,o){var a,c,l,p;const w={method:To(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o}};return Ht((a=w.params)==null?void 0:a.prompt)&&((c=w.params)==null||delete c.prompt),Ht((l=w.params)==null?void 0:l.tag)&&((p=w.params)==null||delete p.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:w}),this.relayer.provider.request(w)}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(Yn.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()})}}class sy{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 oy=Object.defineProperty,ay=Object.defineProperties,cy=Object.getOwnPropertyDescriptors,mh=Object.getOwnPropertySymbols,ly=Object.prototype.hasOwnProperty,uy=Object.prototype.propertyIsEnumerable,wh=(t,e,r)=>e in t?oy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ls=(t,e)=>{for(var r in e||(e={}))ly.call(e,r)&&wh(t,r,e[r]);if(mh)for(var r of mh(e))uy.call(e,r)&&wh(t,r,e[r]);return t},la=(t,e)=>ay(t,cy(e));class hy extends Y3{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new sy,this.events=new vt.exports.EventEmitter,this.name=Vw,this.version=Kw,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pendingSubInterval=20,this.storagePrefix=wr,this.subscribeTimeout=1e4,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable())},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=Po(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)=>{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 ge.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)>=Gw&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),s(!1))},this.pendingSubInterval)}),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()=>{await this.restore(),await this.reset()},this.relayer=e,this.logger=je.generateChildLogger(r,this.name)}get context(){return je.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(),this.initialized=!1}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=Po(n);await this.rpcUnsubscribe(e,r,i);const s=ot("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:To(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await Yl(this.relayer.provider.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Dt.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:To(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.provider.request(i)}onSubscribe(e,r){this.setSubscription(e,la(ls({},r),{id:e})),this.pending.delete(r.topic)}onResubscribe(e,r){this.addSubscription(e,la(ls({},r),{id:e})),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,ls({},r)),this.topicMap.set(r.topic,e),this.events.emit(er.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}=se("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(er.deleted,la(ls({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(er.sync)}async reset(){this.cached.length&&await Promise.all(this.cached.map(async e=>await this.resubscribe(e))),this.events.emit(er.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),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 resubscribe(e){if(!this.ids.includes(e.id)){const{topic:r,relay:n}=e,i={topic:r,relay:n};this.pending.set(i.topic,i);const s=await this.rpcSubscribe(i.topic,i.relay);this.onResubscribe(s,i)}}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}checkPending(){this.relayer.transportExplicitlyClosed||this.pending.forEach(async e=>{const r=await this.rpcSubscribe(e.topic,e.relay);this.onSubscribe(r,e)})}registerEventListeners(){this.relayer.core.heartbeat.on(Yn.HEARTBEAT_EVENTS.pulse,()=>{this.checkPending()}),this.relayer.on(Dt.connect,async()=>{await this.onConnect()}),this.relayer.on(Dt.disconnect,()=>{this.onDisconnect()}),this.events.on(er.created,async e=>{const r=er.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(er.deleted,async e=>{const r=er.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}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var dy=Object.defineProperty,yh=Object.getOwnPropertySymbols,fy=Object.prototype.hasOwnProperty,py=Object.prototype.propertyIsEnumerable,bh=(t,e,r)=>e in t?dy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gy=(t,e)=>{for(var r in e||(e={}))fy.call(e,r)&&bh(t,r,e[r]);if(yh)for(var r of yh(e))py.call(e,r)&&bh(t,r,e[r]);return t};class my extends G3{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new vt.exports.EventEmitter,this.name=Hw,this.transportExplicitlyClosed=!1,this.initialized=!1,this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?je.generateChildLogger(e.logger,this.name):Hn(je.getDefaultLoggerOptions({level:e.logger||jw})),this.messages=new ny(this.logger,e.core),this.subscriber=new hy(this,this.logger),this.publisher=new iy(this,this.logger),this.relayUrl=e?.relayUrl||kw,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.provider=await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0}get context(){return je.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})}async subscribe(e,r){this.isInitialized();let n="";return await Promise.all([new Promise(i=>{this.subscriber.once(er.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(Dt.transport_closed))}async transportOpen(e){this.relayUrl=e||this.relayUrl,this.transportExplicitlyClosed=!1;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(er.resubscribed,()=>{r()})}),await Promise.race([this.provider.connect(),new Promise((r,n)=>this.once(Dt.transport_closed,()=>{n(new Error("closeTransport called before connection was established"))}))])])}catch(r){const n=r;if(!/socket hang up/i.test(n.message))throw new Error(n.message);this.logger.error(n),this.events.emit(Dt.transport_closed)}}async restartTransport(e){await this.transportClose(),await new Promise(r=>setTimeout(r,gh)),await this.transportOpen(e)}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);return new ii(new r5(Cg({sdkVersion:Ww,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e})))}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}),ra(e)){if(!e.method.endsWith(zw))return;const r=e.params,{topic:n,message:i}=r.data,s={topic:n,message:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(gy({type:"event",event:r.id},s)),this.events.emit(r.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Dt.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=ta(e.id,!0);await this.provider.connection.send(r)}registerEventListeners(){this.provider.on(cs.payload,e=>this.onProviderPayload(e)),this.provider.on(cs.connect,()=>{this.events.emit(Dt.connect)}),this.provider.on(cs.disconnect,()=>{this.events.emit(Dt.disconnect),this.attemptToReconnect()}),this.provider.on(cs.error,e=>this.events.emit(Dt.error,e)),this.events.on(Dt.connection_stalled,async()=>{await this.restartTransport()})}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.transportOpen()},ge.toMiliseconds(gh))}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var wy=Object.defineProperty,vh=Object.getOwnPropertySymbols,yy=Object.prototype.hasOwnProperty,by=Object.prototype.propertyIsEnumerable,_h=(t,e,r)=>e in t?wy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Eh=(t,e)=>{for(var r in e||(e={}))yy.call(e,r)&&_h(t,r,e[r]);if(vh)for(var r of vh(e))by.call(e,r)&&_h(t,r,e[r]);return t};class us extends Z3{constructor(e,r,n,i=wr,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=qw,this.cached=[],this.initialized=!1,this.storagePrefix=wr,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{qg(o)?this.map.set(o.id,o):Vg(o)?this.map.set(o.topic,o):this.getKey&&o!==null&&!Ht(o)&&this.map.set(this.getKey(o),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=>n5(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=Eh(Eh({},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=je.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return je.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}=se("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}=se("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}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class vy{constructor(e,r){this.core=e,this.logger=r,this.name=Zw,this.version=Yw,this.events=new vt.exports,this.initialized=!1,this.storagePrefix=wr,this.ignoredPayloadTypes=[Rr],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=Oo(),i=await this.core.crypto.setSymKey(n),s=Xt(ge.FIVE_MINUTES),o={protocol:ph},a={topic:i,expiry:s,relay:o,active:!1},c=Lg({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}=Rg(n.uri),a=Xt(ge.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=Xt(ge.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}=Nr();this.events.once(Qe("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",ot("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const o=ss(i,s),a=await this.core.crypto.encode(n,o),c=oi[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=ta(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=oi[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=os(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=oi[c.request.method]?oi[c.request.method].res:oi.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,ot("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=>mr(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(()=>{lr(i)?this.events.emit(Qe("pairing_ping",s),{}):Gt(i)&&this.events.emit(Qe("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.sendResult(s,n,!0),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=ot("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(ot("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!Rt(n)){const{message:i}=se("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Wg(n.uri)){const{message:i}=se("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!Rt(n)){const{message:s}=se("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Rt(n)){const{message:s}=se("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!Et(n,!1)){const{message:i}=se("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=se("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(mr(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=se("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=je.generateChildLogger(r,this.name),this.pairings=new us(this.core,this.logger,this.name,this.storagePrefix)}get context(){return je.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Dt.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);ra(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):na(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(zt.expired,async e=>{const{topic:r}=Xl(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class _y extends q3{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new vt.exports.EventEmitter,this.name=Jw,this.version=Xw,this.cached=[],this.initialized=!1,this.storagePrefix=wr,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(tr.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=Gt(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(tr.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(tr.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=je.generateChildLogger(r,this.name)}get context(){return je.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:ss(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}=se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(tr.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=se("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(tr.created,e=>{const r=tr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(tr.updated,e=>{const r=tr.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(tr.deleted,e=>{const r=tr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Ey extends J3{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new vt.exports.EventEmitter,this.name=Qw,this.version=ey,this.cached=[],this.initialized=!1,this.storagePrefix=wr,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(zt.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(zt.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=je.generateChildLogger(r,this.name)}get context(){return je.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 Sg(e);if(typeof e=="number")return Dg(e);const{message:r}=se("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(zt.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=se("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}=se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ge.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(zt.expired,{target:e,expiration:r})}checkExpirations(){this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Yn.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(zt.created,e=>{const r=zt.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(zt.expired,e=>{const r=zt.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(zt.deleted,e=>{const r=zt.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var xy=Object.defineProperty,xh=Object.getOwnPropertySymbols,Cy=Object.prototype.hasOwnProperty,Sy=Object.prototype.propertyIsEnumerable,Ch=(t,e,r)=>e in t?xy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sh=(t,e)=>{for(var r in e||(e={}))Cy.call(e,r)&&Ch(t,r,e[r]);if(xh)for(var r of xh(e))Sy.call(e,r)&&Ch(t,r,e[r]);return t};class ua extends W3{constructor(e){super(e),this.protocol=dh,this.version=Aw,this.name=ca,this.events=new vt.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;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Hn(je.getDefaultLoggerOptions({level:e?.logger||$w.logger}));this.logger=je.generateChildLogger(r,this.name),this.heartbeat=new Yn.HeartBeat,this.crypto=new ry(this,this.logger,e?.keychain),this.history=new _y(this,this.logger),this.expirer=new Ey(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new Y2(Sh(Sh({},Pw),e?.storageOptions)),this.relayer=new my({core:this,logger:this.logger,relayUrl:e?.relayUrl,projectId:this.projectId}),this.pairing=new vy(this,this.logger)}static async init(e){const r=new ua(e);return await r.initialize(),r}get context(){return je.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 Dy=ua,Dh="wc",Ih=2,Oh="client",ha=`${Dh}@${Ih}:${Oh}:`,da={name:Oh,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Iy="proposal",Oy="session",hs=ge.SEVEN_DAYS,Ay="engine",ai={wc_sessionPropose:{req:{ttl:ge.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ge.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ge.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ge.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ge.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ge.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ge.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ge.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ge.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ge.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ge.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ge.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ge.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ge.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ge.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ge.THIRTY_SECONDS,prompt:!1,tag:1115}}},fa={min:ge.FIVE_MINUTES,max:ge.SEVEN_DAYS},$y="request";var Py=Object.defineProperty,Ty=Object.defineProperties,Ry=Object.getOwnPropertyDescriptors,Ah=Object.getOwnPropertySymbols,Ny=Object.prototype.hasOwnProperty,Ly=Object.prototype.propertyIsEnumerable,$h=(t,e,r)=>e in t?Py(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ur=(t,e)=>{for(var r in e||(e={}))Ny.call(e,r)&&$h(t,r,e[r]);if(Ah)for(var r of Ah(e))Ly.call(e,r)&&$h(t,r,e[r]);return t},pa=(t,e)=>Ty(t,Ry(e));class My extends Q3{constructor(e){super(e),this.name=Ay,this.events=new vt.exports,this.initialized=!1,this.ignoredPayloadTypes=[Rr],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(ai)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized(),await this.isValidConnect(r);const{pairingTopic:n,requiredNamespaces:i,relays:s}=r;let o=n,a,c=!1;if(o&&(c=this.client.core.pairing.pairings.get(o).active),!o||!c){const{topic:R,uri:L}=await this.client.core.pairing.create();o=R,a=L}const l=await this.client.core.crypto.generateKeyPair(),p={requiredNamespaces:i,relays:s??[{protocol:ph}],proposer:{publicKey:l,metadata:this.client.metadata}},{reject:w,resolve:m,done:y}=Nr();if(this.events.once(Qe("session_connect"),async({error:R,session:L})=>{if(R)w(R);else if(L){L.self.publicKey=l;const x=pa(ur({},L),{requiredNamespaces:L.requiredNamespaces});await this.client.session.set(L.topic,x),await this.setExpiry(L.topic,L.expiry),o&&await this.client.core.pairing.updateMetadata({topic:o,metadata:L.peer.metadata}),m(x)}}),!o){const{message:R}=se("NO_MATCHING_KEY",`connect() pairing topic: ${o}`);throw new Error(R)}const E=await this.sendRequest(o,"wc_sessionPropose",p),T=Xt(ge.FIVE_MINUTES);return await this.setProposal(E,ur({id:E,expiry:T},p)),{uri:a,approval:y}},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}=r,o=this.client.proposal.get(n);let{pairingTopic:a,proposer:c,requiredNamespaces:l}=o;Xi(l)||(l=Bg(s,"approve()"),this.client.proposal.set(n,pa(ur({},o),{requiredNamespaces:l})));const p=await this.client.core.crypto.generateKeyPair(),w=c.publicKey,m=await this.client.core.crypto.generateSharedKey(p,w),y={relay:{protocol:i??"irn"},namespaces:s,requiredNamespaces:l,controller:{publicKey:p,metadata:this.client.metadata},expiry:Xt(hs)};await this.client.core.relayer.subscribe(m);const E=await this.sendRequest(m,"wc_sessionSettle",y),{done:T,resolve:R,reject:L}=Nr();this.events.once(Qe("session_approve",E),({error:O})=>{O?L(O):R(this.client.session.get(m))});const x=pa(ur({},y),{topic:m,acknowledged:!1,self:y.controller,peer:{publicKey:c.publicKey,metadata:c.metadata},controller:p});return await this.client.session.set(m,x),await this.setExpiry(m,Xt(hs)),a&&await this.client.core.pairing.updateMetadata({topic:a,metadata:x.peer.metadata}),a&&n&&(await this.sendResult(n,a,{relay:{protocol:i??"irn"},responderPublicKey:p}),await this.client.proposal.delete(n,ot("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:a})),{topic:m,acknowledged:T}},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,ot("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}=Nr();return this.events.once(Qe("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}=Nr();return this.events.once(Qe("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,Xt(hs)),{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}=Nr(o);return this.events.once(Qe("session_request",a),({error:w,result:m})=>{w?p(w):l(m)}),await c()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i;lr(i)?await this.sendResult(s,n,i.result):Gt(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}=Nr();this.events.once(Qe("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",ot("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=>Hg(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,ot("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,ot("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=ai.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,Xt(n))},this.sendRequest=async(r,n,i,s)=>{const o=ss(n,i),a=await this.client.core.crypto.encode(r,o),c=ai[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=ta(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=ai[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=os(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=ai[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=>{mr(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{mr(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(ur({},n.params));const o=Xt(ge.FIVE_MINUTES),a=ur({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(lr(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 Gt(n)&&(await this.client.proposal.delete(i,ot("USER_DISCONNECTED")),this.events.emit(Qe("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}=n.params,w={topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,requiredNamespaces:p,controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}};await this.sendResult(n.id,r,!0),this.events.emit(Qe("session_connect"),{session:w})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;lr(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Qe("session_approve",i),{})):Gt(n)&&(await this.client.session.delete(r,ot("USER_DISCONNECTED")),this.events.emit(Qe("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidUpdate(ur({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;lr(n)?this.events.emit(Qe("session_update",i),{}):Gt(n)&&this.events.emit(Qe("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Xt(hs)),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;lr(n)?this.events.emit(Qe("session_extend",i),{}):Gt(n)&&this.events.emit(Qe("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(()=>{lr(n)?this.events.emit(Qe("session_ping",i),{}):Gt(n)&&this.events.emit(Qe("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(Dt.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(ur({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;lr(n)?this.events.emit(Qe("session_request",i),{result:n.result}):Gt(n)&&this.events.emit(Qe("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidEmit(ur({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(!Rt(r)){const{message:a}=se("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(a)}const{pairingTopic:n,requiredNamespaces:i,relays:s}=r;if(Ht(n)||await this.isValidPairingTopic(n),!Ht(i)&&Xi(i)===0)return;const o=Qg(i,"connect()");if(o)throw new Error(o.message);if(!e2(s,!0)){const{message:a}=se("MISSING_OR_INVALID",`connect() relays: ${s}`);throw new Error(a)}},this.isValidApprove=async r=>{if(!Rt(r))throw new Error(se("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s}=r;await this.isValidProposalId(n);const o=this.client.proposal.get(n),a=Qi(i,"approve()");if(a)throw new Error(a.message);const c=su(o.requiredNamespaces,i,"update()");if(c)throw new Error(c.message);if(!Et(s,!0)){const{message:l}=se("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(l)}},this.isValidReject=async r=>{if(!Rt(r)){const{message:s}=se("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!r2(i)){const{message:s}=se("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!Rt(r)){const{message:l}=se("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!nu(n)){const{message:l}=se("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=Kg(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=Qi(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(mr(o)){const{message:l}=se("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!Rt(r)){const{message:c}=se("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=Qi(i,"update()");if(o)throw new Error(o.message);const a=su(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Rt(r)){const{message:i}=se("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Rt(r)){const{message:c}=se("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(!iu(a,s)){const{message:c}=se("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!n2(i)){const{message:c}=se("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!o2(a,s,i.method)){const{message:c}=se("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!c2(o,fa)){const{message:c}=se("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${fa.min} and ${fa.max}`);throw new Error(c)}},this.isValidRespond=async r=>{if(!Rt(r)){const{message:s}=se("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(s)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!i2(i)){const{message:s}=se("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidPing=async r=>{if(!Rt(r)){const{message:i}=se("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Rt(r)){const{message:a}=se("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(!iu(o,s)){const{message:a}=se("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!s2(i)){const{message:a}=se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!a2(o,s,i.name)){const{message:a}=se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Rt(r)){const{message:i}=se("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)}}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(Dt.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);ra(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):na(i)&&(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.client.core.expirer.on(zt.expired,async e=>{const{topic:r,id:n}=Xl(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,se("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(!Et(e,!1)){const{message:r}=se("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}=se("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(mr(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=se("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!Et(e,!1)){const{message:r}=se("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=se("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(mr(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=se("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(Et(e,!1)){const{message:r}=se("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=se("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!t2(e)){const{message:r}=se("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=se("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(mr(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=se("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class Uy extends us{constructor(e,r){super(e,r,Iy,ha),this.core=e,this.logger=r}}class Fy extends us{constructor(e,r){super(e,r,Oy,ha),this.core=e,this.logger=r}}class By extends us{constructor(e,r){super(e,r,$y,ha),this.core=e,this.logger=r}}class ga extends X3{constructor(e){super(e),this.protocol=Dh,this.version=Ih,this.name=da.name,this.events=new vt.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||da.name,this.metadata=e?.metadata||vg();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Hn(je.getDefaultLoggerOptions({level:e?.logger||da.logger}));this.core=e?.core||new Dy(e),this.logger=je.generateChildLogger(r,this.name),this.session=new Fy(this.core,this.logger),this.proposal=new Uy(this.core,this.logger),this.pendingRequest=new By(this.core,this.logger),this.engine=new My(this)}static async init(e){const r=new ga(e);return await r.initialize(),r}get context(){return je.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 ma={exports:{}};(function(t,e){var r=typeof self<"u"?self:ut,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(C){return C&&DataView.prototype.isPrototypeOf(C)}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(C){return C&&l.indexOf(Object.prototype.toString.call(C))>-1};function w(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(C))throw new TypeError("Invalid character in header field name");return C.toLowerCase()}function m(C){return typeof C!="string"&&(C=String(C)),C}function y(C){var A={next:function(){var G=C.shift();return{done:G===void 0,value:G}}};return a.iterable&&(A[Symbol.iterator]=function(){return A}),A}function E(C){this.map={},C instanceof E?C.forEach(function(A,G){this.append(G,A)},this):Array.isArray(C)?C.forEach(function(A){this.append(A[0],A[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(A){this.append(A,C[A])},this)}E.prototype.append=function(C,A){C=w(C),A=m(A);var G=this.map[C];this.map[C]=G?G+", "+A:A},E.prototype.delete=function(C){delete this.map[w(C)]},E.prototype.get=function(C){return C=w(C),this.has(C)?this.map[C]:null},E.prototype.has=function(C){return this.map.hasOwnProperty(w(C))},E.prototype.set=function(C,A){this.map[w(C)]=m(A)},E.prototype.forEach=function(C,A){for(var G in this.map)this.map.hasOwnProperty(G)&&C.call(A,this.map[G],G,this)},E.prototype.keys=function(){var C=[];return this.forEach(function(A,G){C.push(G)}),y(C)},E.prototype.values=function(){var C=[];return this.forEach(function(A){C.push(A)}),y(C)},E.prototype.entries=function(){var C=[];return this.forEach(function(A,G){C.push([G,A])}),y(C)},a.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function T(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}function R(C){return new Promise(function(A,G){C.onload=function(){A(C.result)},C.onerror=function(){G(C.error)}})}function L(C){var A=new FileReader,G=R(A);return A.readAsArrayBuffer(C),G}function x(C){var A=new FileReader,G=R(A);return A.readAsText(C),G}function O(C){for(var A=new Uint8Array(C),G=new Array(A.length),K=0;K<A.length;K++)G[K]=String.fromCharCode(A[K]);return G.join("")}function _(C){if(C.slice)return C.slice(0);var A=new Uint8Array(C.byteLength);return A.set(new Uint8Array(C)),A.buffer}function D(){return this.bodyUsed=!1,this._initBody=function(C){this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:a.blob&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:a.formData&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():a.arrayBuffer&&a.blob&&c(C)?(this._bodyArrayBuffer=_(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(C)||p(C))?this._bodyArrayBuffer=_(C):this._bodyText=C=Object.prototype.toString.call(C):this._bodyText="",this.headers.get("content-type")||(typeof C=="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(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var C=T(this);if(C)return C;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 C=T(this);if(C)return C;if(this._bodyBlob)return x(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 I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function h(C){var A=C.toUpperCase();return I.indexOf(A)>-1?A:C}function v(C,A){A=A||{};var G=A.body;if(C instanceof v){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,A.headers||(this.headers=new E(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,!G&&C._bodyInit!=null&&(G=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=A.credentials||this.credentials||"same-origin",(A.headers||!this.headers)&&(this.headers=new E(A.headers)),this.method=h(A.method||this.method||"GET"),this.mode=A.mode||this.mode||null,this.signal=A.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&G)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(G)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})};function H(C){var A=new FormData;return C.trim().split("&").forEach(function(G){if(G){var K=G.split("="),W=K.shift().replace(/\+/g," "),z=K.join("=").replace(/\+/g," ");A.append(decodeURIComponent(W),decodeURIComponent(z))}}),A}function j(C){var A=new E,G=C.replace(/\r?\n[\t ]+/g," ");return G.split(/\r?\n/).forEach(function(K){var W=K.split(":"),z=W.shift().trim();if(z){var J=W.join(":").trim();A.append(z,J)}}),A}D.call(v.prototype);function q(C,A){A||(A={}),this.type="default",this.status=A.status===void 0?200:A.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in A?A.statusText:"OK",this.headers=new E(A.headers),this.url=A.url||"",this._initBody(C)}D.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 C=new q(null,{status:0,statusText:""});return C.type="error",C};var X=[301,302,303,307,308];q.redirect=function(C,A){if(X.indexOf(A)===-1)throw new RangeError("Invalid status code");return new q(null,{status:A,headers:{location:C}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(A,G){this.message=A,this.name=G;var K=Error(A);this.stack=K.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function re(C,A){return new Promise(function(G,K){var W=new v(C,A);if(W.signal&&W.signal.aborted)return K(new o.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function J(){z.abort()}z.onload=function(){var Z={status:z.status,statusText:z.statusText,headers:j(z.getAllResponseHeaders()||"")};Z.url="responseURL"in z?z.responseURL:Z.headers.get("X-Request-URL");var ue="response"in z?z.response:z.responseText;G(new q(ue,Z))},z.onerror=function(){K(new TypeError("Network request failed"))},z.ontimeout=function(){K(new TypeError("Network request failed"))},z.onabort=function(){K(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(Z,ue){z.setRequestHeader(ue,Z)}),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 re.polyfill=!0,s.fetch||(s.fetch=re,s.Headers=E,s.Request=v,s.Response=q),o.Headers=E,o.Request=v,o.Response=q,o.fetch=re,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})(ma,ma.exports);var Ph=Id(ma.exports);const Th={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Rh=10;class ds{constructor(e){if(this.url=e,this.events=new vt.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Wu(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=ti(e),s=await(await Ph(this.url,Object.assign(Object.assign({},Th),{body:n}))).json();this.onPayload({data:s})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Wu(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=ti({id:1,jsonrpc:"2.0",method:"test",params:[]});await Ph(e,Object.assign(Object.assign({},Th),{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"?Zo(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=os(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Fu(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Rh&&this.events.setMaxListeners(Rh)}}function jy(t){var e;const r=(e=t[Object.keys(t)[0]])==null?void 0:e.chains[0];return[r.split(":")[0],r.split(":")[1]]}function yr(t,e){let r;return e.rpcMap&&(r=e.rpcMap[ky([t])]),r}function ky(t){return Number(t[0].split(":")[1])}class Hy{constructor(e){this.name="eip155",this.namespace=e.namespace,this.client=e.client,this.events=e.events,this.httpProviders=this.createHttpProviders(),this.chainId=this.getDefaultChainId()}async request(e){var r;switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":{const n=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";return this.setDefaultChain(parseInt(n,16).toString()),null}case"eth_chainId":return this.getDefaultChainId()}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){if(this.chainId=parseInt(e),!this.httpProviders[e]){const n=r||yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}requestAccounts(){return this.getAccounts()}createHttpProvider(e,r){const n=r||yr(e,this.namespace);return typeof n>"u"?void 0:new ii(new ds(n))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}getDefaultChainId(){if(this.chainId)return this.chainId;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return parseInt(e.split(":")[1])}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}}class zy{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;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)?this.client.request(e):this.getHttpProvider().request(e.request)}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}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yr(e,this.namespace);return typeof n>"u"?void 0:new ii(new ds(n))}}class Wy{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;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)?this.client.request(e):this.getHttpProvider().request(e.request)}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}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yr(e,this.namespace);return typeof n>"u"?void 0:new ii(new ds(n))}}class qy{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;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)?this.client.request(e):this.getHttpProvider().request(e.request)}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}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yr(e,this.namespace);return typeof n>"u"?void 0:new ii(new ds(n))}}const Nh="error",Vy="wss://relay.walletconnect.com",Ky="wc",Gy="universal_provider",Lh=`${Ky}@${2}:${Gy}:`;var Zy=Object.defineProperty,Yy=Object.defineProperties,Jy=Object.getOwnPropertyDescriptors,Mh=Object.getOwnPropertySymbols,Xy=Object.prototype.hasOwnProperty,Qy=Object.prototype.propertyIsEnumerable,Uh=(t,e,r)=>e in t?Zy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Fh=(t,e)=>{for(var r in e||(e={}))Xy.call(e,r)&&Uh(t,r,e[r]);if(Mh)for(var r of Mh(e))Qy.call(e,r)&&Uh(t,r,e[r]);return t},eb=(t,e)=>Yy(t,Jy(e));class wa{constructor(e){this.events=new vt.exports,this.rpcProviders={},this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Hn(je.getDefaultLoggerOptions({level:e?.logger||Nh}))}static async init(e){const r=new wa(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:Fh({},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}),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:ot("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");const{namespaces:r}=e;return this.setNamespaces(r),this.createProviders(),await this.cleanupPendingPairings(),e.skipPairing===!0?void 0: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){const{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces});return r&&(this.uri=r,this.events.emit("display_uri",r)),this.session=await n(),this.onSessionUpdate(),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(un(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}`)}}async checkStorage(){if(this.namespaces=await this.client.core.storage.getItem(`${Lh}/namespaces`)||{},this.namespaces&&this.createProviders(),this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.onSessionUpdate()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await ga.init({logger:this.providerOpts.logger||Nh,relayUrl:this.providerOpts.relayUrl||Vy,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");Object.keys(this.namespaces).forEach(e=>{switch(e){case"eip155":this.rpcProviders[e]=new Hy({client:this.client,namespace:this.namespaces[e],events:this.events});break;case"solana":this.rpcProviders[e]=new zy({client:this.client,namespace:this.namespaces[e],events:this.events});break;case"cosmos":this.rpcProviders[e]=new Wy({client:this.client,namespace:this.namespaces[e],events:this.events});break;case"polkadot":break;case"cip34":this.rpcProviders[e]=new qy({client:this.client,namespace:this.namespaces[e],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(n.data,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=eb(Fh({},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)})}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){if(!e||!Object.keys(e).length)throw new Error("Namespaces must be not empty");this.client.core.storage.setItem(`${Lh}/namespaces`,e),this.namespaces=e}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.`);return!r||!n?jy(this.namespaces):[r,n]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r){const[n,i]=this.validateChain(r);this.getProvider(n).setDefaultChain(i),this.events.emit("chainChanged",e)}onConnect(){this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.rpcProviders={},await this.cleanupPendingPairings({deletePairings:!0})}}const tb=wa,rb=Symbol(),Bh=Object.getPrototypeOf,ya=new WeakMap,nb=t=>t&&(ya.has(t)?ya.get(t):Bh(t)===Object.prototype||Bh(t)===Array.prototype),ib=t=>nb(t)&&t[rb]||null,jh=(t,e=!0)=>{ya.set(t,e)},ba=t=>typeof t=="object"&&t!==null,Fr=new WeakMap,fs=new WeakSet,sb=(t=Object.is,e=(l,p)=>new Proxy(l,p),r=l=>ba(l)&&!fs.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,w=n)=>{const m=i.get(l);if(m?.[0]===p)return m[1];const y=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return jh(y,!0),i.set(l,[p,y]),Reflect.ownKeys(l).forEach(E=>{const T=Reflect.get(l,E);fs.has(T)?(jh(T,!1),y[E]=T):T instanceof Promise?Object.defineProperty(y,E,{get(){return w(T)}}):Fr.has(T)?y[E]=ab(T,w):y[E]=T}),Object.freeze(y)},o=new WeakMap,a=[1,1],c=l=>{if(!ba(l))throw new Error("object required");const p=o.get(l);if(p)return p;let w=a[0];const m=new Set,y=(H,j=++a[0])=>{w!==j&&(w=j,m.forEach(q=>q(H,j)))};let E=a[1];const T=(H=++a[1])=>(E!==H&&!m.size&&(E=H,L.forEach(([j])=>{const q=j[1](H);q>w&&(w=q)})),w),R=H=>(j,q)=>{const X=[...j];X[1]=[H,...X[1]],y(X,q)},L=new Map,x=(H,j)=>{if(void 0!=="production"&&L.has(H))throw new Error("prop listener already exists");if(m.size){const q=j[3](R(H));L.set(H,[j,q])}else L.set(H,[j])},O=H=>{var j;const q=L.get(H);q&&(L.delete(H),(j=q[1])==null||j.call(q))},_=H=>(m.add(H),m.size===1&&L.forEach(([q,X],re)=>{if(void 0!=="production"&&X)throw new Error("remove already exists");const C=q[3](R(re));L.set(re,[q,C])}),()=>{m.delete(H),m.size===0&&L.forEach(([q,X],re)=>{X&&(X(),L.set(re,[q]))})}),D=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),h=e(D,{deleteProperty(H,j){const q=Reflect.get(H,j);O(j);const X=Reflect.deleteProperty(H,j);return X&&y(["delete",[j],q]),X},set(H,j,q,X){var re;const C=Reflect.has(H,j),A=Reflect.get(H,j,X);if(C&&t(A,q))return!0;O(j),ba(q)&&(q=ib(q)||q);let G=q;if(!((re=Object.getOwnPropertyDescriptor(H,j))!=null&&re.set))if(q instanceof Promise)q.then(K=>{q.status="fulfilled",q.value=K,y(["resolve",[j],K])}).catch(K=>{q.status="rejected",q.reason=K,y(["reject",[j],K])});else{!Fr.has(q)&&r(q)&&(G=br(q));const K=!fs.has(G)&&Fr.get(G);K&&x(j,K)}return Reflect.set(H,j,G,X),y(["set",[j],q,A]),!0}});o.set(l,h);const v=[D,T,s,_];return Fr.set(h,v),Reflect.ownKeys(l).forEach(H=>{const j=Object.getOwnPropertyDescriptor(l,H);j.get||j.set?Object.defineProperty(D,H,j):h[H]=l[H]}),h})=>[c,Fr,fs,t,e,r,n,i,s,o,a],[ob]=sb();function br(t={}){return ob(t)}function ci(t,e,r){const n=Fr.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()}}function ab(t,e){const r=Fr.get(t);void 0!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}var kh={},ps={};ps.byteLength=ub,ps.toByteArray=db,ps.fromByteArray=gb;for(var rr=[],Wt=[],cb=typeof Uint8Array<"u"?Uint8Array:Array,va="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pn=0,lb=va.length;pn<lb;++pn)rr[pn]=va[pn],Wt[va.charCodeAt(pn)]=pn;Wt["-".charCodeAt(0)]=62,Wt["_".charCodeAt(0)]=63;function Hh(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 ub(t){var e=Hh(t),r=e[0],n=e[1];return(r+n)*3/4-n}function hb(t,e,r){return(e+r)*3/4-r}function db(t){var e,r=Hh(t),n=r[0],i=r[1],s=new cb(hb(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=Wt[t.charCodeAt(c)]<<18|Wt[t.charCodeAt(c+1)]<<12|Wt[t.charCodeAt(c+2)]<<6|Wt[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Wt[t.charCodeAt(c)]<<2|Wt[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Wt[t.charCodeAt(c)]<<10|Wt[t.charCodeAt(c+1)]<<4|Wt[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function fb(t){return rr[t>>18&63]+rr[t>>12&63]+rr[t>>6&63]+rr[t&63]}function pb(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(fb(n));return i.join("")}function gb(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(pb(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(rr[e>>2]+rr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(rr[e>>10]+rr[e>>4&63]+rr[e<<2&63]+"=")),i.join("")}var _a={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */_a.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<<a)-1,l=c>>1,p=-7,w=r?i-1:0,m=r?-1:1,y=t[e+w];for(w+=m,s=y&(1<<-p)-1,y>>=-p,p+=a;p>0;s=s*256+t[e+w],w+=m,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+w],w+=m,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)},_a.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,p=(1<<l)-1,w=p>>1,m=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+w>=1?e+=m/c:e+=m*Math.pow(2,1-w),e*c>=2&&(o++,c/=2),o+w>=p?(a=0,o=p):o+w>=1?(a=(e*c-1)*Math.pow(2,i),o=o+w):(a=e*Math.pow(2,w-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};/*!
|
|
66
|
+
***************************************************************************** */var Xo=function(t,e){return Xo=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])},Xo(t,e)};function pm(t,e){Xo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Qo=function(){return Qo=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},Qo.apply(this,arguments)};function gm(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 mm(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 wm(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 bm(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(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function vm(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 _m(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Em(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ea(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 Bu(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 xm(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Bu(arguments[e]));return t}function Cm(){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 ni(t){return this instanceof ni?(this.v=t,this):new ni(t)}function Sm(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(m){n[m]&&(i[m]=function(y){return new Promise(function(E,T){s.push([m,y,E,T])>1||a(m,y)})})}function a(m,y){try{c(n[m](y))}catch(E){w(s[0][3],E)}}function c(m){m.value instanceof ni?Promise.resolve(m.value.v).then(l,p):w(s[0][2],m)}function l(m){a("next",m)}function p(m){a("throw",m)}function w(m,y){m(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Dm(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:ni(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function Im(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 ea=="function"?ea(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 Om(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Am(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 $m(t){return t&&t.__esModule?t:{default:t}}function Pm(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Tm(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 Rm=Object.freeze({__proto__:null,__extends:pm,get __assign(){return Qo},__rest:gm,__decorate:mm,__param:wm,__metadata:ym,__awaiter:bm,__generator:vm,__createBinding:_m,__exportStar:Em,__values:ea,__read:Bu,__spread:xm,__spreadArrays:Cm,__await:ni,__asyncGenerator:Sm,__asyncDelegator:Dm,__asyncValues:Im,__makeTemplateObject:Om,__importStar:Am,__importDefault:$m,__classPrivateFieldGet:Pm,__classPrivateFieldSet:Tm}),Nm=Ar(Rm),ar={},ju;function Lm(){if(ju)return ar;ju=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.isBrowserCryptoAvailable=ar.getSubtleCrypto=ar.getBrowerCrypto=void 0;function t(){return ut?.crypto||ut?.msCrypto||{}}ar.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}ar.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return ar.isBrowserCryptoAvailable=r,ar}var cr={},ku;function Mm(){if(ku)return cr;ku=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.isBrowser=cr.isNode=cr.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}cr.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}cr.isNode=e;function r(){return!t()&&!e()}return cr.isBrowser=r,cr}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Nm;e.__exportStar(Lm(),t),e.__exportStar(Mm(),t)})(Fu);function Um(){const t=Date.now()*Math.pow(10,3),e=Math.floor(Math.random()*Math.pow(10,3));return t+e}function ss(t,e,r){return{id:r||Um(),jsonrpc:"2.0",method:t,params:e}}function ta(t,e){return{id:t,jsonrpc:"2.0",result:e}}function os(t,e,r){return{id:t,jsonrpc:"2.0",error:Fm(e,r)}}function Fm(t,e){return typeof t>"u"?Mu(Nu):(typeof t=="string"&&(t=Object.assign(Object.assign({},Mu(Jo)),{message:t})),typeof e<"u"&&(t.data=e),dm(t.code)&&(t=fm(t.code)),t)}class Bm{}class jm extends Bm{constructor(){super()}}class km extends jm{constructor(e){super()}}const Hm="^https?:",zm="^wss?:";function Wm(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Hu(t,e){const r=Wm(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function zu(t){return Hu(t,Hm)}function Wu(t){return Hu(t,zm)}function qm(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function qu(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function ra(t){return qu(t)&&"method"in t}function na(t){return qu(t)&&(lr(t)||Gt(t))}function lr(t){return"result"in t}function Gt(t){return"error"in t}class ii extends km{constructor(e){super(e),this.events=new vt.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(ss(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=>{Gt(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),na(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}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",()=>this.events.emit("disconnect")),this.connection.on("error",e=>this.events.emit("error",e)),this.hasRegisteredEventListeners=!0)}}const Vu=10,Vm=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),Km=()=>typeof window<"u",Gm=Vm();class Zm{constructor(e){if(this.url=e,this.events=new vt.exports.EventEmitter,this.registering=!1,!Wu(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(){if(typeof this.socket>"u")throw new Error("Connection already closed");this.socket.close(),this.onClose()}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ti(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!Wu(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=Fu.isReactNative()?void 0:{rejectUnauthorized:!qm(e)},s=new Gm(e,[],i);Km()?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=()=>this.onClose(),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(){this.socket=void 0,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Zo(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=os(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Uu(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>Vu&&this.events.setMaxListeners(Vu)}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 ia={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]",w="[object Date]",m="[object Error]",y="[object Function]",E="[object GeneratorFunction]",T="[object Map]",R="[object Number]",L="[object Null]",x="[object Object]",O="[object Promise]",_="[object Proxy]",D="[object RegExp]",I="[object Set]",h="[object String]",v="[object Symbol]",H="[object Undefined]",j="[object WeakMap]",q="[object ArrayBuffer]",X="[object DataView]",re="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",G="[object Int16Array]",K="[object Int32Array]",W="[object Uint8Array]",z="[object Uint8ClampedArray]",J="[object Uint16Array]",Z="[object Uint32Array]",ue=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,ae={};ae[re]=ae[C]=ae[A]=ae[G]=ae[K]=ae[W]=ae[z]=ae[J]=ae[Z]=!0,ae[a]=ae[c]=ae[q]=ae[p]=ae[X]=ae[w]=ae[m]=ae[y]=ae[T]=ae[R]=ae[x]=ae[D]=ae[I]=ae[h]=ae[j]=!1;var Ce=typeof ut=="object"&&ut&&ut.Object===Object&&ut,B=typeof self=="object"&&self&&self.Object===Object&&self,F=Ce||B||Function("return this")(),N=e&&!e.nodeType&&e,f=N&&!0&&t&&!t.nodeType&&t,$=f&&f.exports===N,ee=$&&Ce.process,ne=function(){try{return ee&&ee.binding&&ee.binding("util")}catch{}}(),Ee=ne&&ne.isTypedArray;function Me(S,M){for(var Y=-1,ce=S==null?0:S.length,We=0,De=[];++Y<ce;){var Xe=S[Y];M(Xe,Y,S)&&(De[We++]=Xe)}return De}function $e(S,M){for(var Y=-1,ce=M.length,We=S.length;++Y<ce;)S[We+Y]=M[Y];return S}function Ue(S,M){for(var Y=-1,ce=S==null?0:S.length;++Y<ce;)if(M(S[Y],Y,S))return!0;return!1}function Ge(S,M){for(var Y=-1,ce=Array(S);++Y<S;)ce[Y]=M(Y);return ce}function qe(S){return function(M){return S(M)}}function Pe(S,M){return S.has(M)}function Ie(S,M){return S?.[M]}function me(S){var M=-1,Y=Array(S.size);return S.forEach(function(ce,We){Y[++M]=[We,ce]}),Y}function Se(S,M){return function(Y){return S(M(Y))}}function Oe(S){var M=-1,Y=Array(S.size);return S.forEach(function(ce){Y[++M]=ce}),Y}var pe=Array.prototype,xe=Function.prototype,g=Object.prototype,u=F["__core-js_shared__"],d=xe.toString,b=g.hasOwnProperty,P=function(){var S=/[^.]+$/.exec(u&&u.keys&&u.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),U=g.toString,k=RegExp("^"+d.call(b).replace(ue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=$?F.Buffer:void 0,he=F.Symbol,Ne=F.Uint8Array,Be=g.propertyIsEnumerable,Le=pe.splice,jt=he?he.toStringTag:void 0,tn=Object.getOwnPropertySymbols,Fi=oe?oe.isBuffer:void 0,Gs=Se(Object.keys,Object),tt=Tn(F,"DataView"),Ye=Tn(F,"Map"),rt=Tn(F,"Promise"),nt=Tn(F,"Set"),it=Tn(F,"WeakMap"),Je=Tn(Object,"create"),dt=nn(tt),ft=nn(Ye),pt=nn(rt),gt=nn(nt),mt=nn(it),lt=he?he.prototype:void 0,st=lt?lt.valueOf:void 0;function Ve(S){var M=-1,Y=S==null?0:S.length;for(this.clear();++M<Y;){var ce=S[M];this.set(ce[0],ce[1])}}function wt(){this.__data__=Je?Je(null):{},this.size=0}function yt(S){var M=this.has(S)&&delete this.__data__[S];return this.size-=M?1:0,M}function C_(S){var M=this.__data__;if(Je){var Y=M[S];return Y===n?void 0:Y}return b.call(M,S)?M[S]:void 0}function S_(S){var M=this.__data__;return Je?M[S]!==void 0:b.call(M,S)}function D_(S,M){var Y=this.__data__;return this.size+=this.has(S)?0:1,Y[S]=Je&&M===void 0?n:M,this}Ve.prototype.clear=wt,Ve.prototype.delete=yt,Ve.prototype.get=C_,Ve.prototype.has=S_,Ve.prototype.set=D_;function dr(S){var M=-1,Y=S==null?0:S.length;for(this.clear();++M<Y;){var ce=S[M];this.set(ce[0],ce[1])}}function I_(){this.__data__=[],this.size=0}function O_(S){var M=this.__data__,Y=Ys(M,S);if(Y<0)return!1;var ce=M.length-1;return Y==ce?M.pop():Le.call(M,Y,1),--this.size,!0}function A_(S){var M=this.__data__,Y=Ys(M,S);return Y<0?void 0:M[Y][1]}function $_(S){return Ys(this.__data__,S)>-1}function P_(S,M){var Y=this.__data__,ce=Ys(Y,S);return ce<0?(++this.size,Y.push([S,M])):Y[ce][1]=M,this}dr.prototype.clear=I_,dr.prototype.delete=O_,dr.prototype.get=A_,dr.prototype.has=$_,dr.prototype.set=P_;function rn(S){var M=-1,Y=S==null?0:S.length;for(this.clear();++M<Y;){var ce=S[M];this.set(ce[0],ce[1])}}function T_(){this.size=0,this.__data__={hash:new Ve,map:new(Ye||dr),string:new Ve}}function R_(S){var M=Js(this,S).delete(S);return this.size-=M?1:0,M}function N_(S){return Js(this,S).get(S)}function L_(S){return Js(this,S).has(S)}function M_(S,M){var Y=Js(this,S),ce=Y.size;return Y.set(S,M),this.size+=Y.size==ce?0:1,this}rn.prototype.clear=T_,rn.prototype.delete=R_,rn.prototype.get=N_,rn.prototype.has=L_,rn.prototype.set=M_;function Zs(S){var M=-1,Y=S==null?0:S.length;for(this.__data__=new rn;++M<Y;)this.add(S[M])}function U_(S){return this.__data__.set(S,n),this}function F_(S){return this.__data__.has(S)}Zs.prototype.add=Zs.prototype.push=U_,Zs.prototype.has=F_;function Sr(S){var M=this.__data__=new dr(S);this.size=M.size}function B_(){this.__data__=new dr,this.size=0}function j_(S){var M=this.__data__,Y=M.delete(S);return this.size=M.size,Y}function k_(S){return this.__data__.get(S)}function H_(S){return this.__data__.has(S)}function z_(S,M){var Y=this.__data__;if(Y instanceof dr){var ce=Y.__data__;if(!Ye||ce.length<r-1)return ce.push([S,M]),this.size=++Y.size,this;Y=this.__data__=new rn(ce)}return Y.set(S,M),this.size=Y.size,this}Sr.prototype.clear=B_,Sr.prototype.delete=j_,Sr.prototype.get=k_,Sr.prototype.has=H_,Sr.prototype.set=z_;function W_(S,M){var Y=Xs(S),ce=!Y&&s7(S),We=!Y&&!ce&&Ic(S),De=!Y&&!ce&&!We&&Cd(S),Xe=Y||ce||We||De,bt=Xe?Ge(S.length,String):[],Ct=bt.length;for(var Ze in S)(M||b.call(S,Ze))&&!(Xe&&(Ze=="length"||We&&(Ze=="offset"||Ze=="parent")||De&&(Ze=="buffer"||Ze=="byteLength"||Ze=="byteOffset")||e7(Ze,Ct)))&&bt.push(Ze);return bt}function Ys(S,M){for(var Y=S.length;Y--;)if(vd(S[Y][0],M))return Y;return-1}function q_(S,M,Y){var ce=M(S);return Xs(S)?ce:$e(ce,Y(S))}function Bi(S){return S==null?S===void 0?H:L:jt&&jt in Object(S)?X_(S):i7(S)}function md(S){return ji(S)&&Bi(S)==a}function wd(S,M,Y,ce,We){return S===M?!0:S==null||M==null||!ji(S)&&!ji(M)?S!==S&&M!==M:V_(S,M,Y,ce,wd,We)}function V_(S,M,Y,ce,We,De){var Xe=Xs(S),bt=Xs(M),Ct=Xe?c:Dr(S),Ze=bt?c:Dr(M);Ct=Ct==a?x:Ct,Ze=Ze==a?x:Ze;var kt=Ct==x,Yt=Ze==x,It=Ct==Ze;if(It&&Ic(S)){if(!Ic(M))return!1;Xe=!0,kt=!1}if(It&&!kt)return De||(De=new Sr),Xe||Cd(S)?yd(S,M,Y,ce,We,De):Y_(S,M,Ct,Y,ce,We,De);if(!(Y&i)){var Vt=kt&&b.call(S,"__wrapped__"),Kt=Yt&&b.call(M,"__wrapped__");if(Vt||Kt){var Ir=Vt?S.value():S,fr=Kt?M.value():M;return De||(De=new Sr),We(Ir,fr,Y,ce,De)}}return It?(De||(De=new Sr),J_(S,M,Y,ce,We,De)):!1}function K_(S){if(!xd(S)||r7(S))return!1;var M=_d(S)?k:Q;return M.test(nn(S))}function G_(S){return ji(S)&&Ed(S.length)&&!!ae[Bi(S)]}function Z_(S){if(!n7(S))return Gs(S);var M=[];for(var Y in Object(S))b.call(S,Y)&&Y!="constructor"&&M.push(Y);return M}function yd(S,M,Y,ce,We,De){var Xe=Y&i,bt=S.length,Ct=M.length;if(bt!=Ct&&!(Xe&&Ct>bt))return!1;var Ze=De.get(S);if(Ze&&De.get(M))return Ze==M;var kt=-1,Yt=!0,It=Y&s?new Zs:void 0;for(De.set(S,M),De.set(M,S);++kt<bt;){var Vt=S[kt],Kt=M[kt];if(ce)var Ir=Xe?ce(Kt,Vt,kt,M,S,De):ce(Vt,Kt,kt,S,M,De);if(Ir!==void 0){if(Ir)continue;Yt=!1;break}if(It){if(!Ue(M,function(fr,sn){if(!Pe(It,sn)&&(Vt===fr||We(Vt,fr,Y,ce,De)))return It.push(sn)})){Yt=!1;break}}else if(!(Vt===Kt||We(Vt,Kt,Y,ce,De))){Yt=!1;break}}return De.delete(S),De.delete(M),Yt}function Y_(S,M,Y,ce,We,De,Xe){switch(Y){case X:if(S.byteLength!=M.byteLength||S.byteOffset!=M.byteOffset)return!1;S=S.buffer,M=M.buffer;case q:return!(S.byteLength!=M.byteLength||!De(new Ne(S),new Ne(M)));case p:case w:case R:return vd(+S,+M);case m:return S.name==M.name&&S.message==M.message;case D:case h:return S==M+"";case T:var bt=me;case I:var Ct=ce&i;if(bt||(bt=Oe),S.size!=M.size&&!Ct)return!1;var Ze=Xe.get(S);if(Ze)return Ze==M;ce|=s,Xe.set(S,M);var kt=yd(bt(S),bt(M),ce,We,De,Xe);return Xe.delete(S),kt;case v:if(st)return st.call(S)==st.call(M)}return!1}function J_(S,M,Y,ce,We,De){var Xe=Y&i,bt=bd(S),Ct=bt.length,Ze=bd(M),kt=Ze.length;if(Ct!=kt&&!Xe)return!1;for(var Yt=Ct;Yt--;){var It=bt[Yt];if(!(Xe?It in M:b.call(M,It)))return!1}var Vt=De.get(S);if(Vt&&De.get(M))return Vt==M;var Kt=!0;De.set(S,M),De.set(M,S);for(var Ir=Xe;++Yt<Ct;){It=bt[Yt];var fr=S[It],sn=M[It];if(ce)var Sd=Xe?ce(sn,fr,It,M,S,De):ce(fr,sn,It,S,M,De);if(!(Sd===void 0?fr===sn||We(fr,sn,Y,ce,De):Sd)){Kt=!1;break}Ir||(Ir=It=="constructor")}if(Kt&&!Ir){var Qs=S.constructor,eo=M.constructor;Qs!=eo&&"constructor"in S&&"constructor"in M&&!(typeof Qs=="function"&&Qs instanceof Qs&&typeof eo=="function"&&eo instanceof eo)&&(Kt=!1)}return De.delete(S),De.delete(M),Kt}function bd(S){return q_(S,c7,Q_)}function Js(S,M){var Y=S.__data__;return t7(M)?Y[typeof M=="string"?"string":"hash"]:Y.map}function Tn(S,M){var Y=Ie(S,M);return K_(Y)?Y:void 0}function X_(S){var M=b.call(S,jt),Y=S[jt];try{S[jt]=void 0;var ce=!0}catch{}var We=U.call(S);return ce&&(M?S[jt]=Y:delete S[jt]),We}var Q_=tn?function(S){return S==null?[]:(S=Object(S),Me(tn(S),function(M){return Be.call(S,M)}))}:l7,Dr=Bi;(tt&&Dr(new tt(new ArrayBuffer(1)))!=X||Ye&&Dr(new Ye)!=T||rt&&Dr(rt.resolve())!=O||nt&&Dr(new nt)!=I||it&&Dr(new it)!=j)&&(Dr=function(S){var M=Bi(S),Y=M==x?S.constructor:void 0,ce=Y?nn(Y):"";if(ce)switch(ce){case dt:return X;case ft:return T;case pt:return O;case gt:return I;case mt:return j}return M});function e7(S,M){return M=M??o,!!M&&(typeof S=="number"||fe.test(S))&&S>-1&&S%1==0&&S<M}function t7(S){var M=typeof S;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?S!=="__proto__":S===null}function r7(S){return!!P&&P in S}function n7(S){var M=S&&S.constructor,Y=typeof M=="function"&&M.prototype||g;return S===Y}function i7(S){return U.call(S)}function nn(S){if(S!=null){try{return d.call(S)}catch{}try{return S+""}catch{}}return""}function vd(S,M){return S===M||S!==S&&M!==M}var s7=md(function(){return arguments}())?md:function(S){return ji(S)&&b.call(S,"callee")&&!Be.call(S,"callee")},Xs=Array.isArray;function o7(S){return S!=null&&Ed(S.length)&&!_d(S)}var Ic=Fi||u7;function a7(S,M){return wd(S,M)}function _d(S){if(!xd(S))return!1;var M=Bi(S);return M==y||M==E||M==l||M==_}function Ed(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=o}function xd(S){var M=typeof S;return S!=null&&(M=="object"||M=="function")}function ji(S){return S!=null&&typeof S=="object"}var Cd=Ee?qe(Ee):G_;function c7(S){return o7(S)?W_(S):Z_(S)}function l7(){return[]}function u7(){return!1}t.exports=a7})(ia,ia.exports);var Ym=ia.exports,Jm=Object.defineProperty,Ku=Object.getOwnPropertySymbols,Xm=Object.prototype.hasOwnProperty,Qm=Object.prototype.propertyIsEnumerable,Gu=(t,e,r)=>e in t?Jm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,At=(t,e)=>{for(var r in e||(e={}))Xm.call(e,r)&&Gu(t,r,e[r]);if(Ku)for(var r of Ku(e))Qm.call(e,r)&&Gu(t,r,e[r]);return t};function e5(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 w(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,x=E.length;L!==x&&E[L]===0;)L++,T++;for(var O=(x-L)*p+1>>>0,_=new Uint8Array(O);L!==x;){for(var D=E[L],I=0,h=O-1;(D!==0||I<R)&&h!==-1;h--,I++)D+=256*_[h]>>>0,_[h]=D%a>>>0,D=D/a>>>0;if(D!==0)throw new Error("Non-zero carry");R=I,L++}for(var v=O-R;v!==O&&_[v]===0;)v++;for(var H=c.repeat(T);v<O;++v)H+=t.charAt(_[v]);return H}function m(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 x=(E.length-T)*l+1>>>0,O=new Uint8Array(x);E[T];){var _=r[E.charCodeAt(T)];if(_===255)return;for(var D=0,I=x-1;(_!==0||D<L)&&I!==-1;I--,D++)_+=a*O[I]>>>0,O[I]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");L=D,T++}if(E[T]!==" "){for(var h=x-L;h!==x&&O[h]===0;)h++;for(var v=new Uint8Array(R+(x-h)),H=R;h!==x;)v[H++]=O[h++];return v}}}function y(E){var T=m(E);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:m,decode:y}}var t5=e5,r5=t5;const Zu=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")},n5=t=>new TextEncoder().encode(t),i5=t=>new TextDecoder().decode(t);class s5{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 o5{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 Yu(this,e)}}class a5{constructor(e){this.decoders=e}or(e){return Yu(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 Yu=(t,e)=>new a5(At(At({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class c5{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new s5(e,r,n),this.decoder=new o5(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const as=({name:t,prefix:e,encode:r,decode:n})=>new c5(t,e,r,n),si=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=r5(r,e);return as({prefix:t,name:e,encode:n,decode:s=>Zu(i(s))})},l5=(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 w=i[t[p]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|w,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},u5=(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},xt=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>as({prefix:e,name:t,encode(i){return u5(i,n,r)},decode(i){return l5(i,n,r,t)}}),h5=as({prefix:"\0",name:"identity",encode:t=>i5(t),decode:t=>n5(t)});var d5=Object.freeze({__proto__:null,identity:h5});const f5=xt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var p5=Object.freeze({__proto__:null,base2:f5});const g5=xt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var m5=Object.freeze({__proto__:null,base8:g5});const w5=si({prefix:"9",name:"base10",alphabet:"0123456789"});var y5=Object.freeze({__proto__:null,base10:w5});const b5=xt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),v5=xt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var _5=Object.freeze({__proto__:null,base16:b5,base16upper:v5});const E5=xt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),x5=xt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),C5=xt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),S5=xt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),D5=xt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),I5=xt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O5=xt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),A5=xt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),$5=xt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var P5=Object.freeze({__proto__:null,base32:E5,base32upper:x5,base32pad:C5,base32padupper:S5,base32hex:D5,base32hexupper:I5,base32hexpad:O5,base32hexpadupper:A5,base32z:$5});const T5=si({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),R5=si({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var N5=Object.freeze({__proto__:null,base36:T5,base36upper:R5});const L5=si({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),M5=si({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var U5=Object.freeze({__proto__:null,base58btc:L5,base58flickr:M5});const F5=xt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),B5=xt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),j5=xt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),k5=xt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var H5=Object.freeze({__proto__:null,base64:F5,base64pad:B5,base64url:j5,base64urlpad:k5});const Ju=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=Ju.reduce((t,e,r)=>(t[r]=e,t),[]),W5=Ju.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function q5(t){return t.reduce((e,r)=>(e+=z5[r],e),"")}function V5(t){const e=[];for(const r of t){const n=W5[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const K5=as({prefix:"\u{1F680}",name:"base256emoji",encode:q5,decode:V5});var G5=Object.freeze({__proto__:null,base256emoji:K5}),Z5=Qu,Xu=128,Y5=127,J5=~Y5,X5=Math.pow(2,31);function Qu(t,e,r){e=e||[],r=r||0;for(var n=r;t>=X5;)e[r++]=t&255|Xu,t/=128;for(;t&J5;)e[r++]=t&255|Xu,t>>>=7;return e[r]=t|0,Qu.bytes=r-n+1,e}var Q5=sa,ew=128,eh=127;function sa(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw sa.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&eh)<<i:(o&eh)*Math.pow(2,i),i+=7}while(o>=ew);return sa.bytes=s-n,r}var tw=Math.pow(2,7),rw=Math.pow(2,14),nw=Math.pow(2,21),iw=Math.pow(2,28),sw=Math.pow(2,35),ow=Math.pow(2,42),aw=Math.pow(2,49),cw=Math.pow(2,56),lw=Math.pow(2,63),uw=function(t){return t<tw?1:t<rw?2:t<nw?3:t<iw?4:t<sw?5:t<ow?6:t<aw?7:t<cw?8:t<lw?9:10},hw={encode:Z5,decode:Q5,encodingLength:uw},th=hw;const rh=(t,e,r=0)=>(th.encode(t,e,r),e),nh=t=>th.encodingLength(t),oa=(t,e)=>{const r=e.byteLength,n=nh(t),i=n+nh(r),s=new Uint8Array(i+r);return rh(t,s,0),rh(r,s,n),s.set(e,i),new dw(t,r,e,s)};class dw{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const ih=({name:t,code:e,encode:r})=>new fw(t,e,r);class fw{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?oa(this.code,r):r.then(n=>oa(this.code,n))}else throw Error("Unknown type, must be binary type")}}const sh=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),pw=ih({name:"sha2-256",code:18,encode:sh("SHA-256")}),gw=ih({name:"sha2-512",code:19,encode:sh("SHA-512")});var mw=Object.freeze({__proto__:null,sha256:pw,sha512:gw});const oh=0,ww="identity",ah=Zu;var yw=Object.freeze({__proto__:null,identity:{code:oh,name:ww,encode:ah,digest:t=>oa(oh,ah(t))}});new TextEncoder,new TextDecoder;const ch=At(At(At(At(At(At(At(At(At(At({},d5),p5),m5),y5),_5),P5),N5),U5),H5),G5);At(At({},mw),yw);function bw(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function lh(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const uh=lh("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),aa=lh("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=bw(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),vw=At({utf8:uh,"utf-8":uh,hex:ch.base16,latin1:aa,ascii:aa,binary:aa},ch);function _w(t,e="utf8"){const r=vw[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 hh="wc",Ew=2,ca="core",wr=`${hh}@${2}:${ca}:`,xw={name:ca,logger:"error"},Cw={database:":memory:"},Sw="crypto",dh="client_ed25519_seed",Dw=ge.ONE_DAY,Iw="keychain",Ow="0.3",Aw="messages",$w="0.3",Pw=ge.SIX_HOURS,Tw="publisher",fh="irn",Rw="error",Nw="wss://relay.walletconnect.com",Lw="relayer",Dt={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"},Mw="_subscription",cs={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},ph=ge.ONE_SECOND,Uw="2.3.3",Fw="0.3",er={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},Bw="subscription",jw="0.3",kw=ge.FIVE_SECONDS*1e3,Hw="pairing",zw="0.3",oi={wc_pairingDelete:{req:{ttl:ge.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ge.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ge.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ge.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ge.ONE_DAY,prompt:!1,tag:0},res:{ttl:ge.ONE_DAY,prompt:!1,tag:0}}},tr={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Ww="history",qw="0.3",Vw="expirer",zt={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},Kw="0.3";class Gw{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=Iw,this.version=Ow,this.initialized=!1,this.storagePrefix=wr,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}=se("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=je.generateChildLogger(r,this.name)}get context(){return je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Kl(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Gl(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Zw{constructor(e,r,n){this.core=e,this.logger=r,this.name=Sw,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=Ru(i);return Tu(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=Yp();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=Ru(s),a=Oo();return await om(a,i,Dw,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=Jp(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||Xp(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=kl(o),c=ti(s);if(Hl(a)){const m=a.senderPublicKey,y=a.receiverPublicKey;i=await this.generateSharedKey(m,y)}const l=this.getSymKey(i),{type:p,senderPublicKey:w}=a;return eg({type:p,symKey:l,message:c,senderPublicKey:w})},this.decode=async(i,s,o)=>{this.isInitialized();const a=ng(s,o);if(Hl(a)){const p=a.receiverPublicKey,w=a.senderPublicKey;i=await this.generateSharedKey(p,w)}const c=this.getSymKey(i),l=tg({symKey:c,encoded:s});return Zo(l)},this.core=e,this.logger=je.generateChildLogger(r,this.name),this.keychain=n||new Gw(this.core,this.logger)}get context(){return je.getLoggerContext(this.logger)}getPayloadType(e){const r=$o(e);return Bn(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(dh)}catch{e=Oo(),await this.keychain.set(dh,e)}return _w(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Yw extends B3{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=Aw,this.version=$w,this.initialized=!1,this.storagePrefix=wr,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=Ao(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=Ao(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=je.generateChildLogger(e,this.name),this.core=r}get context(){return je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Kl(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Gl(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Jw extends j3{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new vt.exports.EventEmitter,this.name=Tw,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||Pw,a=Po(s),c=s?.prompt||!1,l=s?.tag||0,p={topic:n,message:i,opts:{ttl:o,relay:a,prompt:c,tag:l}},w=Ao(i);this.queue.set(w,p);try{await await Zl(this.rpcPublish(n,i,o,a,c,l),this.publishTimeout),this.relayer.events.emit(Dt.publish,p)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(Dt.connection_stalled);return}this.onPublish(w,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=je.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return je.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,s,o){var a,c,l,p;const w={method:To(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o}};return Ht((a=w.params)==null?void 0:a.prompt)&&((c=w.params)==null||delete c.prompt),Ht((l=w.params)==null?void 0:l.tag)&&((p=w.params)==null||delete p.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:w}),this.relayer.provider.request(w)}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(Yn.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()})}}class Xw{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 Qw=Object.defineProperty,ey=Object.defineProperties,ty=Object.getOwnPropertyDescriptors,gh=Object.getOwnPropertySymbols,ry=Object.prototype.hasOwnProperty,ny=Object.prototype.propertyIsEnumerable,mh=(t,e,r)=>e in t?Qw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ls=(t,e)=>{for(var r in e||(e={}))ry.call(e,r)&&mh(t,r,e[r]);if(gh)for(var r of gh(e))ny.call(e,r)&&mh(t,r,e[r]);return t},la=(t,e)=>ey(t,ty(e));class iy extends z3{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new Xw,this.events=new vt.exports.EventEmitter,this.name=Bw,this.version=jw,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pendingSubInterval=20,this.storagePrefix=wr,this.subscribeTimeout=1e4,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable())},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=Po(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)=>{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 ge.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)>=kw&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),s(!1))},this.pendingSubInterval)}),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()=>{await this.restore(),await this.reset()},this.relayer=e,this.logger=je.generateChildLogger(r,this.name)}get context(){return je.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(),this.initialized=!1}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=Po(n);await this.rpcUnsubscribe(e,r,i);const s=ot("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:To(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await Zl(this.relayer.provider.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Dt.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:To(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.provider.request(i)}onSubscribe(e,r){this.setSubscription(e,la(ls({},r),{id:e})),this.pending.delete(r.topic)}onResubscribe(e,r){this.addSubscription(e,la(ls({},r),{id:e})),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,ls({},r)),this.topicMap.set(r.topic,e),this.events.emit(er.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}=se("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(er.deleted,la(ls({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(er.sync)}async reset(){this.cached.length&&await Promise.all(this.cached.map(async e=>await this.resubscribe(e))),this.events.emit(er.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),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 resubscribe(e){if(!this.ids.includes(e.id)){const{topic:r,relay:n}=e,i={topic:r,relay:n};this.pending.set(i.topic,i);const s=await this.rpcSubscribe(i.topic,i.relay);this.onResubscribe(s,i)}}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}checkPending(){this.relayer.transportExplicitlyClosed||this.pending.forEach(async e=>{const r=await this.rpcSubscribe(e.topic,e.relay);this.onSubscribe(r,e)})}registerEventListeners(){this.relayer.core.heartbeat.on(Yn.HEARTBEAT_EVENTS.pulse,()=>{this.checkPending()}),this.relayer.on(Dt.connect,async()=>{await this.onConnect()}),this.relayer.on(Dt.disconnect,()=>{this.onDisconnect()}),this.events.on(er.created,async e=>{const r=er.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(er.deleted,async e=>{const r=er.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}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var sy=Object.defineProperty,wh=Object.getOwnPropertySymbols,oy=Object.prototype.hasOwnProperty,ay=Object.prototype.propertyIsEnumerable,yh=(t,e,r)=>e in t?sy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cy=(t,e)=>{for(var r in e||(e={}))oy.call(e,r)&&yh(t,r,e[r]);if(wh)for(var r of wh(e))ay.call(e,r)&&yh(t,r,e[r]);return t};class ly extends k3{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new vt.exports.EventEmitter,this.name=Lw,this.transportExplicitlyClosed=!1,this.initialized=!1,this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?je.generateChildLogger(e.logger,this.name):Hn(je.getDefaultLoggerOptions({level:e.logger||Rw})),this.messages=new Yw(this.logger,e.core),this.subscriber=new iy(this,this.logger),this.publisher=new Jw(this,this.logger),this.relayUrl=e?.relayUrl||Nw,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.provider=await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0}get context(){return je.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})}async subscribe(e,r){this.isInitialized();let n="";return await Promise.all([new Promise(i=>{this.subscriber.once(er.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(Dt.transport_closed))}async transportOpen(e){this.relayUrl=e||this.relayUrl,this.transportExplicitlyClosed=!1;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(er.resubscribed,()=>{r()})}),await Promise.race([this.provider.connect(),new Promise((r,n)=>this.once(Dt.transport_closed,()=>{n(new Error("closeTransport called before connection was established"))}))])])}catch(r){const n=r;if(!/socket hang up/i.test(n.message))throw new Error(n.message);this.logger.error(n),this.events.emit(Dt.transport_closed)}}async restartTransport(e){await this.transportClose(),await new Promise(r=>setTimeout(r,ph)),await this.transportOpen(e)}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);return new ii(new Zm(wg({sdkVersion:Uw,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e})))}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}),ra(e)){if(!e.method.endsWith(Mw))return;const r=e.params,{topic:n,message:i}=r.data,s={topic:n,message:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(cy({type:"event",event:r.id},s)),this.events.emit(r.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Dt.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=ta(e.id,!0);await this.provider.connection.send(r)}registerEventListeners(){this.provider.on(cs.payload,e=>this.onProviderPayload(e)),this.provider.on(cs.connect,()=>{this.events.emit(Dt.connect)}),this.provider.on(cs.disconnect,()=>{this.events.emit(Dt.disconnect),this.attemptToReconnect()}),this.provider.on(cs.error,e=>this.events.emit(Dt.error,e)),this.events.on(Dt.connection_stalled,async()=>{await this.restartTransport()})}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.transportOpen()},ge.toMiliseconds(ph))}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var uy=Object.defineProperty,bh=Object.getOwnPropertySymbols,hy=Object.prototype.hasOwnProperty,dy=Object.prototype.propertyIsEnumerable,vh=(t,e,r)=>e in t?uy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_h=(t,e)=>{for(var r in e||(e={}))hy.call(e,r)&&vh(t,r,e[r]);if(bh)for(var r of bh(e))dy.call(e,r)&&vh(t,r,e[r]);return t};class us extends H3{constructor(e,r,n,i=wr,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=Fw,this.cached=[],this.initialized=!1,this.storagePrefix=wr,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{Fg(o)?this.map.set(o.id,o):Bg(o)?this.map.set(o.topic,o):this.getKey&&o!==null&&!Ht(o)&&this.map.set(this.getKey(o),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=>Ym(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=_h(_h({},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=je.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return je.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}=se("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}=se("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}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class fy{constructor(e,r){this.core=e,this.logger=r,this.name=Hw,this.version=zw,this.events=new vt.exports,this.initialized=!1,this.storagePrefix=wr,this.ignoredPayloadTypes=[Rr],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=Oo(),i=await this.core.crypto.setSymKey(n),s=Xt(ge.FIVE_MINUTES),o={protocol:fh},a={topic:i,expiry:s,relay:o,active:!1},c=Og({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}=Dg(n.uri),a=Xt(ge.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=Xt(ge.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}=Nr();this.events.once(Qe("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",ot("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const o=ss(i,s),a=await this.core.crypto.encode(n,o),c=oi[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=ta(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=oi[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=os(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=oi[c.request.method]?oi[c.request.method].res:oi.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,ot("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=>mr(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(()=>{lr(i)?this.events.emit(Qe("pairing_ping",s),{}):Gt(i)&&this.events.emit(Qe("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.sendResult(s,n,!0),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=ot("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(ot("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!Rt(n)){const{message:i}=se("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Ug(n.uri)){const{message:i}=se("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!Rt(n)){const{message:s}=se("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Rt(n)){const{message:s}=se("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!Et(n,!1)){const{message:i}=se("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=se("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(mr(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=se("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=je.generateChildLogger(r,this.name),this.pairings=new us(this.core,this.logger,this.name,this.storagePrefix)}get context(){return je.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Dt.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);ra(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):na(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(zt.expired,async e=>{const{topic:r}=Jl(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class py extends F3{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new vt.exports.EventEmitter,this.name=Ww,this.version=qw,this.cached=[],this.initialized=!1,this.storagePrefix=wr,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(tr.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=Gt(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(tr.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(tr.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=je.generateChildLogger(r,this.name)}get context(){return je.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:ss(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}=se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(tr.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=se("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(tr.created,e=>{const r=tr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(tr.updated,e=>{const r=tr.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(tr.deleted,e=>{const r=tr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class gy extends W3{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new vt.exports.EventEmitter,this.name=Vw,this.version=Kw,this.cached=[],this.initialized=!1,this.storagePrefix=wr,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(zt.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(zt.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=je.generateChildLogger(r,this.name)}get context(){return je.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 yg(e);if(typeof e=="number")return bg(e);const{message:r}=se("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(zt.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=se("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}=se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ge.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(zt.expired,{target:e,expiration:r})}checkExpirations(){this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Yn.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(zt.created,e=>{const r=zt.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(zt.expired,e=>{const r=zt.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(zt.deleted,e=>{const r=zt.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var my=Object.defineProperty,Eh=Object.getOwnPropertySymbols,wy=Object.prototype.hasOwnProperty,yy=Object.prototype.propertyIsEnumerable,xh=(t,e,r)=>e in t?my(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ch=(t,e)=>{for(var r in e||(e={}))wy.call(e,r)&&xh(t,r,e[r]);if(Eh)for(var r of Eh(e))yy.call(e,r)&&xh(t,r,e[r]);return t};class ua extends U3{constructor(e){super(e),this.protocol=hh,this.version=Ew,this.name=ca,this.events=new vt.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;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Hn(je.getDefaultLoggerOptions({level:e?.logger||xw.logger}));this.logger=je.generateChildLogger(r,this.name),this.heartbeat=new Yn.HeartBeat,this.crypto=new Zw(this,this.logger,e?.keychain),this.history=new py(this,this.logger),this.expirer=new gy(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new z2(Ch(Ch({},Cw),e?.storageOptions)),this.relayer=new ly({core:this,logger:this.logger,relayUrl:e?.relayUrl,projectId:this.projectId}),this.pairing=new fy(this,this.logger)}static async init(e){const r=new ua(e);return await r.initialize(),r}get context(){return je.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 by=ua,Sh="wc",Dh=2,Ih="client",ha=`${Sh}@${Dh}:${Ih}:`,da={name:Ih,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},vy="proposal",_y="session",hs=ge.SEVEN_DAYS,Ey="engine",ai={wc_sessionPropose:{req:{ttl:ge.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ge.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ge.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ge.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ge.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ge.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ge.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ge.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ge.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ge.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ge.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ge.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ge.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ge.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ge.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ge.THIRTY_SECONDS,prompt:!1,tag:1115}}},fa={min:ge.FIVE_MINUTES,max:ge.SEVEN_DAYS},xy="request";var Cy=Object.defineProperty,Sy=Object.defineProperties,Dy=Object.getOwnPropertyDescriptors,Oh=Object.getOwnPropertySymbols,Iy=Object.prototype.hasOwnProperty,Oy=Object.prototype.propertyIsEnumerable,Ah=(t,e,r)=>e in t?Cy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ur=(t,e)=>{for(var r in e||(e={}))Iy.call(e,r)&&Ah(t,r,e[r]);if(Oh)for(var r of Oh(e))Oy.call(e,r)&&Ah(t,r,e[r]);return t},pa=(t,e)=>Sy(t,Dy(e));class Ay extends V3{constructor(e){super(e),this.name=Ey,this.events=new vt.exports,this.initialized=!1,this.ignoredPayloadTypes=[Rr],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(ai)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized(),await this.isValidConnect(r);const{pairingTopic:n,requiredNamespaces:i,relays:s}=r;let o=n,a,c=!1;if(o&&(c=this.client.core.pairing.pairings.get(o).active),!o||!c){const{topic:R,uri:L}=await this.client.core.pairing.create();o=R,a=L}const l=await this.client.core.crypto.generateKeyPair(),p={requiredNamespaces:i,relays:s??[{protocol:fh}],proposer:{publicKey:l,metadata:this.client.metadata}},{reject:w,resolve:m,done:y}=Nr();if(this.events.once(Qe("session_connect"),async({error:R,session:L})=>{if(R)w(R);else if(L){L.self.publicKey=l;const x=pa(ur({},L),{requiredNamespaces:L.requiredNamespaces});await this.client.session.set(L.topic,x),await this.setExpiry(L.topic,L.expiry),o&&await this.client.core.pairing.updateMetadata({topic:o,metadata:L.peer.metadata}),m(x)}}),!o){const{message:R}=se("NO_MATCHING_KEY",`connect() pairing topic: ${o}`);throw new Error(R)}const E=await this.sendRequest(o,"wc_sessionPropose",p),T=Xt(ge.FIVE_MINUTES);return await this.setProposal(E,ur({id:E,expiry:T},p)),{uri:a,approval:y}},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}=r,o=this.client.proposal.get(n);let{pairingTopic:a,proposer:c,requiredNamespaces:l}=o;Xi(l)||(l=Tg(s,"approve()"),this.client.proposal.set(n,pa(ur({},o),{requiredNamespaces:l})));const p=await this.client.core.crypto.generateKeyPair(),w=c.publicKey,m=await this.client.core.crypto.generateSharedKey(p,w),y={relay:{protocol:i??"irn"},namespaces:s,requiredNamespaces:l,controller:{publicKey:p,metadata:this.client.metadata},expiry:Xt(hs)};await this.client.core.relayer.subscribe(m);const E=await this.sendRequest(m,"wc_sessionSettle",y),{done:T,resolve:R,reject:L}=Nr();this.events.once(Qe("session_approve",E),({error:O})=>{O?L(O):R(this.client.session.get(m))});const x=pa(ur({},y),{topic:m,acknowledged:!1,self:y.controller,peer:{publicKey:c.publicKey,metadata:c.metadata},controller:p});return await this.client.session.set(m,x),await this.setExpiry(m,Xt(hs)),a&&await this.client.core.pairing.updateMetadata({topic:a,metadata:x.peer.metadata}),a&&n&&(await this.sendResult(n,a,{relay:{protocol:i??"irn"},responderPublicKey:p}),await this.client.proposal.delete(n,ot("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:a})),{topic:m,acknowledged:T}},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,ot("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}=Nr();return this.events.once(Qe("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}=Nr();return this.events.once(Qe("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,Xt(hs)),{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}=Nr(o);return this.events.once(Qe("session_request",a),({error:w,result:m})=>{w?p(w):l(m)}),await c()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i;lr(i)?await this.sendResult(s,n,i.result):Gt(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}=Nr();this.events.once(Qe("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",ot("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=>Lg(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,ot("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,ot("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=ai.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,Xt(n))},this.sendRequest=async(r,n,i,s)=>{const o=ss(n,i),a=await this.client.core.crypto.encode(r,o),c=ai[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=ta(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=ai[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=os(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=ai[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=>{mr(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{mr(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(ur({},n.params));const o=Xt(ge.FIVE_MINUTES),a=ur({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(lr(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 Gt(n)&&(await this.client.proposal.delete(i,ot("USER_DISCONNECTED")),this.events.emit(Qe("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}=n.params,w={topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,requiredNamespaces:p,controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}};await this.sendResult(n.id,r,!0),this.events.emit(Qe("session_connect"),{session:w})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;lr(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Qe("session_approve",i),{})):Gt(n)&&(await this.client.session.delete(r,ot("USER_DISCONNECTED")),this.events.emit(Qe("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidUpdate(ur({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;lr(n)?this.events.emit(Qe("session_update",i),{}):Gt(n)&&this.events.emit(Qe("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Xt(hs)),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;lr(n)?this.events.emit(Qe("session_extend",i),{}):Gt(n)&&this.events.emit(Qe("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(()=>{lr(n)?this.events.emit(Qe("session_ping",i),{}):Gt(n)&&this.events.emit(Qe("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(Dt.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(ur({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;lr(n)?this.events.emit(Qe("session_request",i),{result:n.result}):Gt(n)&&this.events.emit(Qe("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidEmit(ur({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(!Rt(r)){const{message:a}=se("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(a)}const{pairingTopic:n,requiredNamespaces:i,relays:s}=r;if(Ht(n)||await this.isValidPairingTopic(n),!Ht(i)&&Xi(i)===0)return;const o=Vg(i,"connect()");if(o)throw new Error(o.message);if(!Kg(s,!0)){const{message:a}=se("MISSING_OR_INVALID",`connect() relays: ${s}`);throw new Error(a)}},this.isValidApprove=async r=>{if(!Rt(r))throw new Error(se("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s}=r;await this.isValidProposalId(n);const o=this.client.proposal.get(n),a=Qi(i,"approve()");if(a)throw new Error(a.message);const c=iu(o.requiredNamespaces,i,"update()");if(c)throw new Error(c.message);if(!Et(s,!0)){const{message:l}=se("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(l)}},this.isValidReject=async r=>{if(!Rt(r)){const{message:s}=se("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!Zg(i)){const{message:s}=se("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!Rt(r)){const{message:l}=se("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!ru(n)){const{message:l}=se("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=jg(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=Qi(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(mr(o)){const{message:l}=se("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!Rt(r)){const{message:c}=se("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=Qi(i,"update()");if(o)throw new Error(o.message);const a=iu(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Rt(r)){const{message:i}=se("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Rt(r)){const{message:c}=se("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(!nu(a,s)){const{message:c}=se("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!Yg(i)){const{message:c}=se("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!Qg(a,s,i.method)){const{message:c}=se("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!t2(o,fa)){const{message:c}=se("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${fa.min} and ${fa.max}`);throw new Error(c)}},this.isValidRespond=async r=>{if(!Rt(r)){const{message:s}=se("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(s)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!Jg(i)){const{message:s}=se("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidPing=async r=>{if(!Rt(r)){const{message:i}=se("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Rt(r)){const{message:a}=se("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(!nu(o,s)){const{message:a}=se("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!Xg(i)){const{message:a}=se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!e2(o,s,i.name)){const{message:a}=se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Rt(r)){const{message:i}=se("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)}}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(Dt.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);ra(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):na(i)&&(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.client.core.expirer.on(zt.expired,async e=>{const{topic:r,id:n}=Jl(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,se("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(!Et(e,!1)){const{message:r}=se("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}=se("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(mr(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=se("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!Et(e,!1)){const{message:r}=se("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=se("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(mr(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=se("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(Et(e,!1)){const{message:r}=se("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=se("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!Gg(e)){const{message:r}=se("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=se("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(mr(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=se("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class $y extends us{constructor(e,r){super(e,r,vy,ha),this.core=e,this.logger=r}}class Py extends us{constructor(e,r){super(e,r,_y,ha),this.core=e,this.logger=r}}class Ty extends us{constructor(e,r){super(e,r,xy,ha),this.core=e,this.logger=r}}class ga extends q3{constructor(e){super(e),this.protocol=Sh,this.version=Dh,this.name=da.name,this.events=new vt.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||da.name,this.metadata=e?.metadata||fg();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Hn(je.getDefaultLoggerOptions({level:e?.logger||da.logger}));this.core=e?.core||new by(e),this.logger=je.generateChildLogger(r,this.name),this.session=new Py(this.core,this.logger),this.proposal=new $y(this.core,this.logger),this.pendingRequest=new Ty(this.core,this.logger),this.engine=new Ay(this)}static async init(e){const r=new ga(e);return await r.initialize(),r}get context(){return je.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 ma={exports:{}};(function(t,e){var r=typeof self<"u"?self:ut,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(C){return C&&DataView.prototype.isPrototypeOf(C)}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(C){return C&&l.indexOf(Object.prototype.toString.call(C))>-1};function w(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(C))throw new TypeError("Invalid character in header field name");return C.toLowerCase()}function m(C){return typeof C!="string"&&(C=String(C)),C}function y(C){var A={next:function(){var G=C.shift();return{done:G===void 0,value:G}}};return a.iterable&&(A[Symbol.iterator]=function(){return A}),A}function E(C){this.map={},C instanceof E?C.forEach(function(A,G){this.append(G,A)},this):Array.isArray(C)?C.forEach(function(A){this.append(A[0],A[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(A){this.append(A,C[A])},this)}E.prototype.append=function(C,A){C=w(C),A=m(A);var G=this.map[C];this.map[C]=G?G+", "+A:A},E.prototype.delete=function(C){delete this.map[w(C)]},E.prototype.get=function(C){return C=w(C),this.has(C)?this.map[C]:null},E.prototype.has=function(C){return this.map.hasOwnProperty(w(C))},E.prototype.set=function(C,A){this.map[w(C)]=m(A)},E.prototype.forEach=function(C,A){for(var G in this.map)this.map.hasOwnProperty(G)&&C.call(A,this.map[G],G,this)},E.prototype.keys=function(){var C=[];return this.forEach(function(A,G){C.push(G)}),y(C)},E.prototype.values=function(){var C=[];return this.forEach(function(A){C.push(A)}),y(C)},E.prototype.entries=function(){var C=[];return this.forEach(function(A,G){C.push([G,A])}),y(C)},a.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function T(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}function R(C){return new Promise(function(A,G){C.onload=function(){A(C.result)},C.onerror=function(){G(C.error)}})}function L(C){var A=new FileReader,G=R(A);return A.readAsArrayBuffer(C),G}function x(C){var A=new FileReader,G=R(A);return A.readAsText(C),G}function O(C){for(var A=new Uint8Array(C),G=new Array(A.length),K=0;K<A.length;K++)G[K]=String.fromCharCode(A[K]);return G.join("")}function _(C){if(C.slice)return C.slice(0);var A=new Uint8Array(C.byteLength);return A.set(new Uint8Array(C)),A.buffer}function D(){return this.bodyUsed=!1,this._initBody=function(C){this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:a.blob&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:a.formData&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():a.arrayBuffer&&a.blob&&c(C)?(this._bodyArrayBuffer=_(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(C)||p(C))?this._bodyArrayBuffer=_(C):this._bodyText=C=Object.prototype.toString.call(C):this._bodyText="",this.headers.get("content-type")||(typeof C=="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(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var C=T(this);if(C)return C;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 C=T(this);if(C)return C;if(this._bodyBlob)return x(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 I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function h(C){var A=C.toUpperCase();return I.indexOf(A)>-1?A:C}function v(C,A){A=A||{};var G=A.body;if(C instanceof v){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,A.headers||(this.headers=new E(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,!G&&C._bodyInit!=null&&(G=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=A.credentials||this.credentials||"same-origin",(A.headers||!this.headers)&&(this.headers=new E(A.headers)),this.method=h(A.method||this.method||"GET"),this.mode=A.mode||this.mode||null,this.signal=A.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&G)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(G)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})};function H(C){var A=new FormData;return C.trim().split("&").forEach(function(G){if(G){var K=G.split("="),W=K.shift().replace(/\+/g," "),z=K.join("=").replace(/\+/g," ");A.append(decodeURIComponent(W),decodeURIComponent(z))}}),A}function j(C){var A=new E,G=C.replace(/\r?\n[\t ]+/g," ");return G.split(/\r?\n/).forEach(function(K){var W=K.split(":"),z=W.shift().trim();if(z){var J=W.join(":").trim();A.append(z,J)}}),A}D.call(v.prototype);function q(C,A){A||(A={}),this.type="default",this.status=A.status===void 0?200:A.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in A?A.statusText:"OK",this.headers=new E(A.headers),this.url=A.url||"",this._initBody(C)}D.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 C=new q(null,{status:0,statusText:""});return C.type="error",C};var X=[301,302,303,307,308];q.redirect=function(C,A){if(X.indexOf(A)===-1)throw new RangeError("Invalid status code");return new q(null,{status:A,headers:{location:C}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(A,G){this.message=A,this.name=G;var K=Error(A);this.stack=K.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function re(C,A){return new Promise(function(G,K){var W=new v(C,A);if(W.signal&&W.signal.aborted)return K(new o.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function J(){z.abort()}z.onload=function(){var Z={status:z.status,statusText:z.statusText,headers:j(z.getAllResponseHeaders()||"")};Z.url="responseURL"in z?z.responseURL:Z.headers.get("X-Request-URL");var ue="response"in z?z.response:z.responseText;G(new q(ue,Z))},z.onerror=function(){K(new TypeError("Network request failed"))},z.ontimeout=function(){K(new TypeError("Network request failed"))},z.onabort=function(){K(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(Z,ue){z.setRequestHeader(ue,Z)}),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 re.polyfill=!0,s.fetch||(s.fetch=re,s.Headers=E,s.Request=v,s.Response=q),o.Headers=E,o.Request=v,o.Response=q,o.fetch=re,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})(ma,ma.exports);var $h=Dd(ma.exports);const Ph={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Th=10;class ds{constructor(e){if(this.url=e,this.events=new vt.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!zu(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=ti(e),s=await(await $h(this.url,Object.assign(Object.assign({},Ph),{body:n}))).json();this.onPayload({data:s})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!zu(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=ti({id:1,jsonrpc:"2.0",method:"test",params:[]});await $h(e,Object.assign(Object.assign({},Ph),{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"?Zo(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=os(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Uu(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Th&&this.events.setMaxListeners(Th)}}function Ry(t){var e;const r=(e=t[Object.keys(t)[0]])==null?void 0:e.chains[0];return[r.split(":")[0],r.split(":")[1]]}function yr(t,e){let r;return e.rpcMap&&(r=e.rpcMap[Ny([t])]),r}function Ny(t){return Number(t[0].split(":")[1])}class Ly{constructor(e){this.name="eip155",this.namespace=e.namespace,this.client=e.client,this.events=e.events,this.httpProviders=this.createHttpProviders(),this.chainId=this.getDefaultChainId()}async request(e){var r;switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":{const n=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";return this.setDefaultChain(parseInt(n,16).toString()),null}case"eth_chainId":return this.getDefaultChainId()}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){if(this.chainId=parseInt(e),!this.httpProviders[e]){const n=r||yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}requestAccounts(){return this.getAccounts()}createHttpProvider(e,r){const n=r||yr(e,this.namespace);return typeof n>"u"?void 0:new ii(new ds(n))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}getDefaultChainId(){if(this.chainId)return this.chainId;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return parseInt(e.split(":")[1])}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}}class My{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;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)?this.client.request(e):this.getHttpProvider().request(e.request)}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}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yr(e,this.namespace);return typeof n>"u"?void 0:new ii(new ds(n))}}class Uy{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;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)?this.client.request(e):this.getHttpProvider().request(e.request)}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}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yr(e,this.namespace);return typeof n>"u"?void 0:new ii(new ds(n))}}class Fy{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;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)?this.client.request(e):this.getHttpProvider().request(e.request)}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}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yr(e,this.namespace);return typeof n>"u"?void 0:new ii(new ds(n))}}const Rh="error",By="wss://relay.walletconnect.com",jy="wc",ky="universal_provider",Nh=`${jy}@${2}:${ky}:`;var Hy=Object.defineProperty,zy=Object.defineProperties,Wy=Object.getOwnPropertyDescriptors,Lh=Object.getOwnPropertySymbols,qy=Object.prototype.hasOwnProperty,Vy=Object.prototype.propertyIsEnumerable,Mh=(t,e,r)=>e in t?Hy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Uh=(t,e)=>{for(var r in e||(e={}))qy.call(e,r)&&Mh(t,r,e[r]);if(Lh)for(var r of Lh(e))Vy.call(e,r)&&Mh(t,r,e[r]);return t},Ky=(t,e)=>zy(t,Wy(e));class wa{constructor(e){this.events=new vt.exports,this.rpcProviders={},this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Hn(je.getDefaultLoggerOptions({level:e?.logger||Rh}))}static async init(e){const r=new wa(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:Uh({},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}),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:ot("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");const{namespaces:r}=e;return this.setNamespaces(r),this.createProviders(),await this.cleanupPendingPairings(),e.skipPairing===!0?void 0: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){const{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces});return r&&(this.uri=r,this.events.emit("display_uri",r)),this.session=await n(),this.onSessionUpdate(),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(un(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}`)}}async checkStorage(){if(this.namespaces=await this.client.core.storage.getItem(`${Nh}/namespaces`)||{},this.namespaces&&this.createProviders(),this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.onSessionUpdate()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await ga.init({logger:this.providerOpts.logger||Rh,relayUrl:this.providerOpts.relayUrl||By,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");Object.keys(this.namespaces).forEach(e=>{switch(e){case"eip155":this.rpcProviders[e]=new Ly({client:this.client,namespace:this.namespaces[e],events:this.events});break;case"solana":this.rpcProviders[e]=new My({client:this.client,namespace:this.namespaces[e],events:this.events});break;case"cosmos":this.rpcProviders[e]=new Uy({client:this.client,namespace:this.namespaces[e],events:this.events});break;case"polkadot":break;case"cip34":this.rpcProviders[e]=new Fy({client:this.client,namespace:this.namespaces[e],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(n.data,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=Ky(Uh({},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)})}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){if(!e||!Object.keys(e).length)throw new Error("Namespaces must be not empty");this.client.core.storage.setItem(`${Nh}/namespaces`,e),this.namespaces=e}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.`);return!r||!n?Ry(this.namespaces):[r,n]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r){const[n,i]=this.validateChain(r);this.getProvider(n).setDefaultChain(i),this.events.emit("chainChanged",e)}onConnect(){this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0})}}const Gy=wa,Zy=Symbol(),Fh=Object.getPrototypeOf,ya=new WeakMap,Yy=t=>t&&(ya.has(t)?ya.get(t):Fh(t)===Object.prototype||Fh(t)===Array.prototype),Jy=t=>Yy(t)&&t[Zy]||null,Bh=(t,e=!0)=>{ya.set(t,e)},ba=t=>typeof t=="object"&&t!==null,Fr=new WeakMap,fs=new WeakSet,Xy=(t=Object.is,e=(l,p)=>new Proxy(l,p),r=l=>ba(l)&&!fs.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,w=n)=>{const m=i.get(l);if(m?.[0]===p)return m[1];const y=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Bh(y,!0),i.set(l,[p,y]),Reflect.ownKeys(l).forEach(E=>{const T=Reflect.get(l,E);fs.has(T)?(Bh(T,!1),y[E]=T):T instanceof Promise?Object.defineProperty(y,E,{get(){return w(T)}}):Fr.has(T)?y[E]=eb(T,w):y[E]=T}),Object.freeze(y)},o=new WeakMap,a=[1,1],c=l=>{if(!ba(l))throw new Error("object required");const p=o.get(l);if(p)return p;let w=a[0];const m=new Set,y=(H,j=++a[0])=>{w!==j&&(w=j,m.forEach(q=>q(H,j)))};let E=a[1];const T=(H=++a[1])=>(E!==H&&!m.size&&(E=H,L.forEach(([j])=>{const q=j[1](H);q>w&&(w=q)})),w),R=H=>(j,q)=>{const X=[...j];X[1]=[H,...X[1]],y(X,q)},L=new Map,x=(H,j)=>{if(void 0!=="production"&&L.has(H))throw new Error("prop listener already exists");if(m.size){const q=j[3](R(H));L.set(H,[j,q])}else L.set(H,[j])},O=H=>{var j;const q=L.get(H);q&&(L.delete(H),(j=q[1])==null||j.call(q))},_=H=>(m.add(H),m.size===1&&L.forEach(([q,X],re)=>{if(void 0!=="production"&&X)throw new Error("remove already exists");const C=q[3](R(re));L.set(re,[q,C])}),()=>{m.delete(H),m.size===0&&L.forEach(([q,X],re)=>{X&&(X(),L.set(re,[q]))})}),D=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),h=e(D,{deleteProperty(H,j){const q=Reflect.get(H,j);O(j);const X=Reflect.deleteProperty(H,j);return X&&y(["delete",[j],q]),X},set(H,j,q,X){var re;const C=Reflect.has(H,j),A=Reflect.get(H,j,X);if(C&&t(A,q))return!0;O(j),ba(q)&&(q=Jy(q)||q);let G=q;if(!((re=Object.getOwnPropertyDescriptor(H,j))!=null&&re.set))if(q instanceof Promise)q.then(K=>{q.status="fulfilled",q.value=K,y(["resolve",[j],K])}).catch(K=>{q.status="rejected",q.reason=K,y(["reject",[j],K])});else{!Fr.has(q)&&r(q)&&(G=br(q));const K=!fs.has(G)&&Fr.get(G);K&&x(j,K)}return Reflect.set(H,j,G,X),y(["set",[j],q,A]),!0}});o.set(l,h);const v=[D,T,s,_];return Fr.set(h,v),Reflect.ownKeys(l).forEach(H=>{const j=Object.getOwnPropertyDescriptor(l,H);j.get||j.set?Object.defineProperty(D,H,j):h[H]=l[H]}),h})=>[c,Fr,fs,t,e,r,n,i,s,o,a],[Qy]=Xy();function br(t={}){return Qy(t)}function ci(t,e,r){const n=Fr.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()}}function eb(t,e){const r=Fr.get(t);void 0!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}var jh={},ps={};ps.byteLength=nb,ps.toByteArray=sb,ps.fromByteArray=cb;for(var rr=[],Wt=[],tb=typeof Uint8Array<"u"?Uint8Array:Array,va="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pn=0,rb=va.length;pn<rb;++pn)rr[pn]=va[pn],Wt[va.charCodeAt(pn)]=pn;Wt["-".charCodeAt(0)]=62,Wt["_".charCodeAt(0)]=63;function kh(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 nb(t){var e=kh(t),r=e[0],n=e[1];return(r+n)*3/4-n}function ib(t,e,r){return(e+r)*3/4-r}function sb(t){var e,r=kh(t),n=r[0],i=r[1],s=new tb(ib(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=Wt[t.charCodeAt(c)]<<18|Wt[t.charCodeAt(c+1)]<<12|Wt[t.charCodeAt(c+2)]<<6|Wt[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Wt[t.charCodeAt(c)]<<2|Wt[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Wt[t.charCodeAt(c)]<<10|Wt[t.charCodeAt(c+1)]<<4|Wt[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function ob(t){return rr[t>>18&63]+rr[t>>12&63]+rr[t>>6&63]+rr[t&63]}function ab(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(ob(n));return i.join("")}function cb(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(ab(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(rr[e>>2]+rr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(rr[e>>10]+rr[e>>4&63]+rr[e<<2&63]+"=")),i.join("")}var _a={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */_a.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<<a)-1,l=c>>1,p=-7,w=r?i-1:0,m=r?-1:1,y=t[e+w];for(w+=m,s=y&(1<<-p)-1,y>>=-p,p+=a;p>0;s=s*256+t[e+w],w+=m,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+w],w+=m,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)},_a.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,p=(1<<l)-1,w=p>>1,m=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+w>=1?e+=m/c:e+=m*Math.pow(2,1-w),e*c>=2&&(o++,c/=2),o+w>=p?(a=0,o=p):o+w>=1?(a=(e*c-1)*Math.pow(2,i),o=o+w):(a=e*Math.pow(2,w-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};/*!
|
|
67
67
|
* The buffer module from node.js, for the browser.
|
|
68
68
|
*
|
|
69
69
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
70
70
|
* @license MIT
|
|
71
|
-
*/(function(t){const e=ps,r=_a,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=x,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),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(g,u),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 u=new Uint8Array(g);return Object.setPrototypeOf(u,a.prototype),u}function a(g,u,d){if(typeof g=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(g)}return c(g,u,d)}a.poolSize=8192;function c(g,u,d){if(typeof g=="string")return m(g,u);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,u,d);if(typeof g=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const b=g.valueOf&&g.valueOf();if(b!=null&&b!==g)return a.from(b,u,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"),u,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,u,d){return c(g,u,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,u,d){return l(g),g<=0?o(g):u!==void 0?typeof d=="string"?o(g).fill(u,d):o(g).fill(u):o(g)}a.alloc=function(g,u,d){return p(g,u,d)};function w(g){return l(g),o(g<0?0:L(g)|0)}a.allocUnsafe=function(g){return w(g)},a.allocUnsafeSlow=function(g){return w(g)};function m(g,u){if((typeof u!="string"||u==="")&&(u="utf8"),!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const d=O(g,u)|0;let b=o(d);const P=b.write(g,u);return P!==d&&(b=b.slice(0,P)),b}function y(g){const u=g.length<0?0:L(g.length)|0,d=o(u);for(let b=0;b<u;b+=1)d[b]=g[b]&255;return d}function E(g){if(me(g,Uint8Array)){const u=new Uint8Array(g);return T(u.buffer,u.byteOffset,u.byteLength)}return y(g)}function T(g,u,d){if(u<0||g.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(g.byteLength<u+(d||0))throw new RangeError('"length" is outside of buffer bounds');let b;return u===void 0&&d===void 0?b=new Uint8Array(g):d===void 0?b=new Uint8Array(g,u):b=new Uint8Array(g,u,d),Object.setPrototypeOf(b,a.prototype),b}function R(g){if(a.isBuffer(g)){const u=L(g.length)|0,d=o(u);return d.length===0||g.copy(d,0,0,u),d}if(g.length!==void 0)return typeof g.length!="number"||Se(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 x(g){return+g!=g&&(g=0),a.alloc(+g)}a.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==a.prototype},a.compare=function(u,d){if(me(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),me(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(u)||!a.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===d)return 0;let b=u.length,P=d.length;for(let U=0,k=Math.min(b,P);U<k;++U)if(u[U]!==d[U]){b=u[U],P=d[U];break}return b<P?-1:P<b?1:0},a.isEncoding=function(u){switch(String(u).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(u,d){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return a.alloc(0);let b;if(d===void 0)for(d=0,b=0;b<u.length;++b)d+=u[b].length;const P=a.allocUnsafe(d);let U=0;for(b=0;b<u.length;++b){let k=u[b];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,u){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,b=arguments.length>2&&arguments[2]===!0;if(!b&&d===0)return 0;let P=!1;for(;;)switch(u){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 Pe(g).length;default:if(P)return b?-1:Ue(g).length;u=(""+u).toLowerCase(),P=!0}}a.byteLength=O;function _(g,u,d){let b=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,u>>>=0,d<=u))return"";for(g||(g="utf8");;)switch(g){case"hex":return z(this,u,d);case"utf8":case"utf-8":return C(this,u,d);case"ascii":return K(this,u,d);case"latin1":case"binary":return W(this,u,d);case"base64":return re(this,u,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,u,d);default:if(b)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),b=!0}}a.prototype._isBuffer=!0;function D(g,u,d){const b=g[u];g[u]=g[d],g[d]=b}a.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let d=0;d<u;d+=2)D(this,d,d+1);return this},a.prototype.swap32=function(){const u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let d=0;d<u;d+=4)D(this,d,d+3),D(this,d+1,d+2);return this},a.prototype.swap64=function(){const u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let d=0;d<u;d+=8)D(this,d,d+7),D(this,d+1,d+6),D(this,d+2,d+5),D(this,d+3,d+4);return this},a.prototype.toString=function(){const u=this.length;return u===0?"":arguments.length===0?C(this,0,u):_.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(u){if(!a.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:a.compare(this,u)===0},a.prototype.inspect=function(){let u="";const d=t.INSPECT_MAX_BYTES;return u=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(u+=" ... "),"<Buffer "+u+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(u,d,b,P,U){if(me(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),!a.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(d===void 0&&(d=0),b===void 0&&(b=u?u.length:0),P===void 0&&(P=0),U===void 0&&(U=this.length),d<0||b>u.length||P<0||U>this.length)throw new RangeError("out of range index");if(P>=U&&d>=b)return 0;if(P>=U)return-1;if(d>=b)return 1;if(d>>>=0,b>>>=0,P>>>=0,U>>>=0,this===u)return 0;let k=U-P,oe=b-d;const he=Math.min(k,oe),Ne=this.slice(P,U),Be=u.slice(d,b);for(let Le=0;Le<he;++Le)if(Ne[Le]!==Be[Le]){k=Ne[Le],oe=Be[Le];break}return k<oe?-1:oe<k?1:0};function I(g,u,d,b,P){if(g.length===0)return-1;if(typeof d=="string"?(b=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,Se(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 u=="string"&&(u=a.from(u,b)),a.isBuffer(u))return u.length===0?-1:h(g,u,d,b,P);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(g,u,d):Uint8Array.prototype.lastIndexOf.call(g,u,d):h(g,[u],d,b,P);throw new TypeError("val must be string, number or Buffer")}function h(g,u,d,b,P){let U=1,k=g.length,oe=u.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(g.length<2||u.length<2)return-1;U=2,k/=2,oe/=2,d/=2}function he(Be,Le){return U===1?Be[Le]:Be.readUInt16BE(Le*U)}let Ne;if(P){let Be=-1;for(Ne=d;Ne<k;Ne++)if(he(g,Ne)===he(u,Be===-1?0:Ne-Be)){if(Be===-1&&(Be=Ne),Ne-Be+1===oe)return Be*U}else Be!==-1&&(Ne-=Ne-Be),Be=-1}else for(d+oe>k&&(d=k-oe),Ne=d;Ne>=0;Ne--){let Be=!0;for(let Le=0;Le<oe;Le++)if(he(g,Ne+Le)!==he(u,Le)){Be=!1;break}if(Be)return Ne}return-1}a.prototype.includes=function(u,d,b){return this.indexOf(u,d,b)!==-1},a.prototype.indexOf=function(u,d,b){return I(this,u,d,b,!0)},a.prototype.lastIndexOf=function(u,d,b){return I(this,u,d,b,!1)};function v(g,u,d,b){d=Number(d)||0;const P=g.length-d;b?(b=Number(b),b>P&&(b=P)):b=P;const U=u.length;b>U/2&&(b=U/2);let k;for(k=0;k<b;++k){const oe=parseInt(u.substr(k*2,2),16);if(Se(oe))return k;g[d+k]=oe}return k}function H(g,u,d,b){return Ie(Ue(u,g.length-d),g,d,b)}function j(g,u,d,b){return Ie(Ge(u),g,d,b)}function q(g,u,d,b){return Ie(Pe(u),g,d,b)}function X(g,u,d,b){return Ie(qe(u,g.length-d),g,d,b)}a.prototype.write=function(u,d,b,P){if(d===void 0)P="utf8",b=this.length,d=0;else if(b===void 0&&typeof d=="string")P=d,b=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(b)?(b=b>>>0,P===void 0&&(P="utf8")):(P=b,b=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-d;if((b===void 0||b>U)&&(b=U),u.length>0&&(b<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 v(this,u,d,b);case"utf8":case"utf-8":return H(this,u,d,b);case"ascii":case"latin1":case"binary":return j(this,u,d,b);case"base64":return q(this,u,d,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,u,d,b);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 re(g,u,d){return u===0&&d===g.length?e.fromByteArray(g):e.fromByteArray(g.slice(u,d))}function C(g,u,d){d=Math.min(g.length,d);const b=[];let P=u;for(;P<d;){const U=g[P];let k=null,oe=U>239?4:U>223?3:U>191?2:1;if(P+oe<=d){let he,Ne,Be,Le;switch(oe){case 1:U<128&&(k=U);break;case 2:he=g[P+1],(he&192)===128&&(Le=(U&31)<<6|he&63,Le>127&&(k=Le));break;case 3:he=g[P+1],Ne=g[P+2],(he&192)===128&&(Ne&192)===128&&(Le=(U&15)<<12|(he&63)<<6|Ne&63,Le>2047&&(Le<55296||Le>57343)&&(k=Le));break;case 4:he=g[P+1],Ne=g[P+2],Be=g[P+3],(he&192)===128&&(Ne&192)===128&&(Be&192)===128&&(Le=(U&15)<<18|(he&63)<<12|(Ne&63)<<6|Be&63,Le>65535&&Le<1114112&&(k=Le))}}k===null?(k=65533,oe=1):k>65535&&(k-=65536,b.push(k>>>10&1023|55296),k=56320|k&1023),b.push(k),P+=oe}return G(b)}const A=4096;function G(g){const u=g.length;if(u<=A)return String.fromCharCode.apply(String,g);let d="",b=0;for(;b<u;)d+=String.fromCharCode.apply(String,g.slice(b,b+=A));return d}function K(g,u,d){let b="";d=Math.min(g.length,d);for(let P=u;P<d;++P)b+=String.fromCharCode(g[P]&127);return b}function W(g,u,d){let b="";d=Math.min(g.length,d);for(let P=u;P<d;++P)b+=String.fromCharCode(g[P]);return b}function z(g,u,d){const b=g.length;(!u||u<0)&&(u=0),(!d||d<0||d>b)&&(d=b);let P="";for(let U=u;U<d;++U)P+=Oe[g[U]];return P}function J(g,u,d){const b=g.slice(u,d);let P="";for(let U=0;U<b.length-1;U+=2)P+=String.fromCharCode(b[U]+b[U+1]*256);return P}a.prototype.slice=function(u,d){const b=this.length;u=~~u,d=d===void 0?b:~~d,u<0?(u+=b,u<0&&(u=0)):u>b&&(u=b),d<0?(d+=b,d<0&&(d=0)):d>b&&(d=b),d<u&&(d=u);const P=this.subarray(u,d);return Object.setPrototypeOf(P,a.prototype),P};function Z(g,u,d){if(g%1!==0||g<0)throw new RangeError("offset is not uint");if(g+u>d)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(u,d,b){u=u>>>0,d=d>>>0,b||Z(u,d,this.length);let P=this[u],U=1,k=0;for(;++k<d&&(U*=256);)P+=this[u+k]*U;return P},a.prototype.readUintBE=a.prototype.readUIntBE=function(u,d,b){u=u>>>0,d=d>>>0,b||Z(u,d,this.length);let P=this[u+--d],U=1;for(;d>0&&(U*=256);)P+=this[u+--d]*U;return P},a.prototype.readUint8=a.prototype.readUInt8=function(u,d){return u=u>>>0,d||Z(u,1,this.length),this[u]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(u,d){return u=u>>>0,d||Z(u,2,this.length),this[u]|this[u+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(u,d){return u=u>>>0,d||Z(u,2,this.length),this[u]<<8|this[u+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},a.prototype.readBigUInt64LE=pe(function(u){u=u>>>0,ne(u,"offset");const d=this[u],b=this[u+7];(d===void 0||b===void 0)&&Ee(u,this.length-8);const P=d+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,U=this[++u]+this[++u]*2**8+this[++u]*2**16+b*2**24;return BigInt(P)+(BigInt(U)<<BigInt(32))}),a.prototype.readBigUInt64BE=pe(function(u){u=u>>>0,ne(u,"offset");const d=this[u],b=this[u+7];(d===void 0||b===void 0)&&Ee(u,this.length-8);const P=d*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],U=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+b;return(BigInt(P)<<BigInt(32))+BigInt(U)}),a.prototype.readIntLE=function(u,d,b){u=u>>>0,d=d>>>0,b||Z(u,d,this.length);let P=this[u],U=1,k=0;for(;++k<d&&(U*=256);)P+=this[u+k]*U;return U*=128,P>=U&&(P-=Math.pow(2,8*d)),P},a.prototype.readIntBE=function(u,d,b){u=u>>>0,d=d>>>0,b||Z(u,d,this.length);let P=d,U=1,k=this[u+--P];for(;P>0&&(U*=256);)k+=this[u+--P]*U;return U*=128,k>=U&&(k-=Math.pow(2,8*d)),k},a.prototype.readInt8=function(u,d){return u=u>>>0,d||Z(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},a.prototype.readInt16LE=function(u,d){u=u>>>0,d||Z(u,2,this.length);const b=this[u]|this[u+1]<<8;return b&32768?b|4294901760:b},a.prototype.readInt16BE=function(u,d){u=u>>>0,d||Z(u,2,this.length);const b=this[u+1]|this[u]<<8;return b&32768?b|4294901760:b},a.prototype.readInt32LE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},a.prototype.readInt32BE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},a.prototype.readBigInt64LE=pe(function(u){u=u>>>0,ne(u,"offset");const d=this[u],b=this[u+7];(d===void 0||b===void 0)&&Ee(u,this.length-8);const P=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(b<<24);return(BigInt(P)<<BigInt(32))+BigInt(d+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),a.prototype.readBigInt64BE=pe(function(u){u=u>>>0,ne(u,"offset");const d=this[u],b=this[u+7];(d===void 0||b===void 0)&&Ee(u,this.length-8);const P=(d<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(P)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+b)}),a.prototype.readFloatLE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),r.read(this,u,!0,23,4)},a.prototype.readFloatBE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),r.read(this,u,!1,23,4)},a.prototype.readDoubleLE=function(u,d){return u=u>>>0,d||Z(u,8,this.length),r.read(this,u,!0,52,8)},a.prototype.readDoubleBE=function(u,d){return u=u>>>0,d||Z(u,8,this.length),r.read(this,u,!1,52,8)};function ue(g,u,d,b,P,U){if(!a.isBuffer(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>P||u<U)throw new RangeError('"value" argument is out of bounds');if(d+b>g.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(u,d,b,P){if(u=+u,d=d>>>0,b=b>>>0,!P){const oe=Math.pow(2,8*b)-1;ue(this,u,d,b,oe,0)}let U=1,k=0;for(this[d]=u&255;++k<b&&(U*=256);)this[d+k]=u/U&255;return d+b},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(u,d,b,P){if(u=+u,d=d>>>0,b=b>>>0,!P){const oe=Math.pow(2,8*b)-1;ue(this,u,d,b,oe,0)}let U=b-1,k=1;for(this[d+U]=u&255;--U>=0&&(k*=256);)this[d+U]=u/k&255;return d+b},a.prototype.writeUint8=a.prototype.writeUInt8=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,1,255,0),this[d]=u&255,d+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,2,65535,0),this[d]=u&255,this[d+1]=u>>>8,d+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,2,65535,0),this[d]=u>>>8,this[d+1]=u&255,d+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,4,4294967295,0),this[d+3]=u>>>24,this[d+2]=u>>>16,this[d+1]=u>>>8,this[d]=u&255,d+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,4,4294967295,0),this[d]=u>>>24,this[d+1]=u>>>16,this[d+2]=u>>>8,this[d+3]=u&255,d+4};function Q(g,u,d,b,P){ee(u,b,P,g,d,7);let U=Number(u&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(u>>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 fe(g,u,d,b,P){ee(u,b,P,g,d,7);let U=Number(u&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(u>>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=pe(function(u,d=0){return Q(this,u,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=pe(function(u,d=0){return fe(this,u,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(u,d,b,P){if(u=+u,d=d>>>0,!P){const he=Math.pow(2,8*b-1);ue(this,u,d,b,he-1,-he)}let U=0,k=1,oe=0;for(this[d]=u&255;++U<b&&(k*=256);)u<0&&oe===0&&this[d+U-1]!==0&&(oe=1),this[d+U]=(u/k>>0)-oe&255;return d+b},a.prototype.writeIntBE=function(u,d,b,P){if(u=+u,d=d>>>0,!P){const he=Math.pow(2,8*b-1);ue(this,u,d,b,he-1,-he)}let U=b-1,k=1,oe=0;for(this[d+U]=u&255;--U>=0&&(k*=256);)u<0&&oe===0&&this[d+U+1]!==0&&(oe=1),this[d+U]=(u/k>>0)-oe&255;return d+b},a.prototype.writeInt8=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,1,127,-128),u<0&&(u=255+u+1),this[d]=u&255,d+1},a.prototype.writeInt16LE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,2,32767,-32768),this[d]=u&255,this[d+1]=u>>>8,d+2},a.prototype.writeInt16BE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,2,32767,-32768),this[d]=u>>>8,this[d+1]=u&255,d+2},a.prototype.writeInt32LE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,4,2147483647,-2147483648),this[d]=u&255,this[d+1]=u>>>8,this[d+2]=u>>>16,this[d+3]=u>>>24,d+4},a.prototype.writeInt32BE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[d]=u>>>24,this[d+1]=u>>>16,this[d+2]=u>>>8,this[d+3]=u&255,d+4},a.prototype.writeBigInt64LE=pe(function(u,d=0){return Q(this,u,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=pe(function(u,d=0){return fe(this,u,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ae(g,u,d,b,P,U){if(d+b>g.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function Ce(g,u,d,b,P){return u=+u,d=d>>>0,P||ae(g,u,d,4),r.write(g,u,d,b,23,4),d+4}a.prototype.writeFloatLE=function(u,d,b){return Ce(this,u,d,!0,b)},a.prototype.writeFloatBE=function(u,d,b){return Ce(this,u,d,!1,b)};function B(g,u,d,b,P){return u=+u,d=d>>>0,P||ae(g,u,d,8),r.write(g,u,d,b,52,8),d+8}a.prototype.writeDoubleLE=function(u,d,b){return B(this,u,d,!0,b)},a.prototype.writeDoubleBE=function(u,d,b){return B(this,u,d,!1,b)},a.prototype.copy=function(u,d,b,P){if(!a.isBuffer(u))throw new TypeError("argument should be a Buffer");if(b||(b=0),!P&&P!==0&&(P=this.length),d>=u.length&&(d=u.length),d||(d=0),P>0&&P<b&&(P=b),P===b||u.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(b<0||b>=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),u.length-d<P-b&&(P=u.length-d+b);const U=P-b;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(d,b,P):Uint8Array.prototype.set.call(u,this.subarray(b,P),d),U},a.prototype.fill=function(u,d,b,P){if(typeof u=="string"){if(typeof d=="string"?(P=d,d=0,b=this.length):typeof b=="string"&&(P=b,b=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(u.length===1){const k=u.charCodeAt(0);(P==="utf8"&&k<128||P==="latin1")&&(u=k)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(d<0||this.length<d||this.length<b)throw new RangeError("Out of range index");if(b<=d)return this;d=d>>>0,b=b===void 0?this.length:b>>>0,u||(u=0);let U;if(typeof u=="number")for(U=d;U<b;++U)this[U]=u;else{const k=a.isBuffer(u)?u:a.from(u,P),oe=k.length;if(oe===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(U=0;U<b-d;++U)this[U+d]=k[U%oe]}return this};const F={};function N(g,u,d){F[g]=class extends d{constructor(){super(),Object.defineProperty(this,"message",{value:u.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,u){return`The "${g}" argument must be of type number. Received type ${typeof u}`},TypeError),N("ERR_OUT_OF_RANGE",function(g,u,d){let b=`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"),b+=` It must be ${u}. Received ${P}`,b},RangeError);function f(g){let u="",d=g.length;const b=g[0]==="-"?1:0;for(;d>=b+4;d-=3)u=`_${g.slice(d-3,d)}${u}`;return`${g.slice(0,d)}${u}`}function $(g,u,d){ne(u,"offset"),(g[u]===void 0||g[u+d]===void 0)&&Ee(u,g.length-(d+1))}function ee(g,u,d,b,P,U){if(g>d||g<u){const k=typeof u=="bigint"?"n":"";let oe;throw U>3?u===0||u===BigInt(0)?oe=`>= 0${k} and < 2${k} ** ${(U+1)*8}${k}`:oe=`>= -(2${k} ** ${(U+1)*8-1}${k}) and < 2 ** ${(U+1)*8-1}${k}`:oe=`>= ${u}${k} and <= ${d}${k}`,new F.ERR_OUT_OF_RANGE("value",oe,g)}$(b,P,U)}function ne(g,u){if(typeof g!="number")throw new F.ERR_INVALID_ARG_TYPE(u,"number",g)}function Ee(g,u,d){throw Math.floor(g)!==g?(ne(g,d),new F.ERR_OUT_OF_RANGE(d||"offset","an integer",g)):u<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE(d||"offset",`>= ${d?1:0} and <= ${u}`,g)}const Me=/[^+/0-9A-Za-z-_]/g;function $e(g){if(g=g.split("=")[0],g=g.trim().replace(Me,""),g.length<2)return"";for(;g.length%4!==0;)g=g+"=";return g}function Ue(g,u){u=u||1/0;let d;const b=g.length;let P=null;const U=[];for(let k=0;k<b;++k){if(d=g.charCodeAt(k),d>55295&&d<57344){if(!P){if(d>56319){(u-=3)>-1&&U.push(239,191,189);continue}else if(k+1===b){(u-=3)>-1&&U.push(239,191,189);continue}P=d;continue}if(d<56320){(u-=3)>-1&&U.push(239,191,189),P=d;continue}d=(P-55296<<10|d-56320)+65536}else P&&(u-=3)>-1&&U.push(239,191,189);if(P=null,d<128){if((u-=1)<0)break;U.push(d)}else if(d<2048){if((u-=2)<0)break;U.push(d>>6|192,d&63|128)}else if(d<65536){if((u-=3)<0)break;U.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((u-=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 u=[];for(let d=0;d<g.length;++d)u.push(g.charCodeAt(d)&255);return u}function qe(g,u){let d,b,P;const U=[];for(let k=0;k<g.length&&!((u-=2)<0);++k)d=g.charCodeAt(k),b=d>>8,P=d%256,U.push(P),U.push(b);return U}function Pe(g){return e.toByteArray($e(g))}function Ie(g,u,d,b){let P;for(P=0;P<b&&!(P+d>=u.length||P>=g.length);++P)u[P+d]=g[P];return P}function me(g,u){return g instanceof u||g!=null&&g.constructor!=null&&g.constructor.name!=null&&g.constructor.name===u.name}function Se(g){return g!==g}const Oe=function(){const g="0123456789abcdef",u=new Array(256);for(let d=0;d<16;++d){const b=d*16;for(let P=0;P<16;++P)u[b+P]=g[d]+g[P]}return u}();function pe(g){return typeof BigInt>"u"?xe:g}function xe(){throw new Error("BigInt not supported")}})(kh);const He=br({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1,isStandalone:!1,isCustomDesktop:!1,isCustomMobile:!1,isExplorer:!1,isDataLoaded:!1,isUiLoaded:!1}),te={state:He,subscribe(t){return ci(He,()=>t(He))},setChains(t){He.chains=t},setStandaloneChains(t){He.standaloneChains=t},setStandaloneUri(t){He.standaloneUri=t},getSelectedChain(){const t=Ke.client().getNetwork().chain;return t&&(He.selectedChain=t),He.selectedChain},setSelectedChain(t){He.selectedChain=t},setIsStandalone(t){He.isStandalone=t},setIsCustomDesktop(t){He.isCustomDesktop=t},setIsCustomMobile(t){He.isCustomMobile=t},setIsExplorer(t){He.isExplorer=t},getAccount(){const t=Ke.client().getAccount();He.address=t.address,He.isConnected=t.isConnected},setAddress(t){He.address=t},setIsConnected(t){He.isConnected=t},setProfileName(t){He.profileName=t},setProfileAvatar(t){He.profileAvatar=t},setProfileLoading(t){He.profileLoading=t},setBalanceLoading(t){He.balanceLoading=t},setBalance(t){He.balance=t},setIsDataLoaded(t){He.isDataLoaded=t},setIsUiLoaded(t){He.isUiLoaded=t},resetEnsProfile(){He.profileName=void 0,He.profileAvatar=void 0},resetBalance(){He.balance=void 0},resetAccount(){He.address=void 0,te.resetEnsProfile(),te.resetBalance()}},li=br({initialized:!1,ethereumClient:void 0}),Ke={setEthereumClient(t){!li.initialized&&t&&(li.ethereumClient=t,te.setChains(t.chains),li.initialized=!0)},client(){if(li.ethereumClient)return li.ethereumClient;throw new Error("ClientCtrl has no client set")}},Te={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",isMobile(){return typeof window<"u"?Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Te.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(Te.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(!Te.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="_self"){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(Te.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Te.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Te.WALLETCONNECT_DEEPLINK_CHOICE)},isNull(t){return t===null},getWalletConnectVersion(){const{isStandalone:t}=te.state;let e=1;return t||(e=Ke.client().walletConnectVersion),e}};function mb(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const ui=br({projectId:void 0,themeMode:mb()?"dark":"light",themeColor:"default",themeBackground:Te.isMobile()?"themeColor":"gradient",themeZIndex:89,mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableNetworkView:!1,defaultChain:void 0,explorerAllowList:void 0,explorerDenyList:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),et={state:ui,subscribe(t){return ci(ui,()=>t(ui))},setConfig(t){var e,r,n,i;if(te.setStandaloneChains(t.standaloneChains),te.setIsStandalone(Boolean((e=t.standaloneChains)==null?void 0:e.length)||Boolean(t.enableStandaloneMode)),te.setIsCustomMobile(Boolean((r=t.mobileWallets)==null?void 0:r.length)),te.setIsCustomDesktop(Boolean((n=t.desktopWallets)==null?void 0:n.length)),te.setIsExplorer(Boolean((i=t.projectId)==null?void 0:i.length)),t.defaultChain)te.setSelectedChain(t.defaultChain);else if(!te.state.isStandalone){const s=Ke.client().getDefaultChain();te.setSelectedChain(s)}Object.assign(ui,t)},setThemeConfig(t){Object.assign(ui,t)}},zh="https://explorer-api.walletconnect.com";function wb(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 gs={async fetchWallets(t,e){const r=wb(e),n=`${zh}/v3/wallets?projectId=${t}&${r}`;return(await fetch(n)).json()},formatImageUrl(t,e){return`${zh}/v3/logo/lg/${e}?projectId=${t}`}},Br=br({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},previewWallets:[],recomendedWallets:[]});function ms(){const{projectId:t}=et.state;if(!t)throw new Error("projectId is required to work with explorer api");return t}const at={state:Br,async getPreviewWallets(t){const{listings:e}=await gs.fetchWallets(ms(),t);return Br.previewWallets=Object.values(e),Br.previewWallets},async getRecomendedWallets(){const{listings:t}=await gs.fetchWallets(ms(),{page:1,entries:6});Br.recomendedWallets=Object.values(t)},async getPaginatedWallets(t){const{page:e,search:r}=t,{listings:n,total:i}=await gs.fetchWallets(ms(),t),s=Object.values(n),o=r?"search":"wallets";return Br[o]={listings:[...Br[o].listings,...s],total:i,page:e??1},{listings:s,total:i}},getImageUrl(t){return gs.formatImageUrl(ms(),t)},resetSearch(){Br.search={listings:[],total:0,page:1}}},Ut=br({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Re={state:Ut,subscribe(t){return ci(Ut,()=>t(Ut))},push(t,e){t!==Ut.view&&(Ut.view=t,e&&(Ut.data=e),Ut.history.push(t))},replace(t){Ut.view=t,Ut.history=[t]},goBack(){if(Ut.history.length>1){Ut.history.pop();const[t]=Ut.history.slice(-1);Ut.view=t}}},gn=br({open:!1}),ht={state:gn,subscribe(t){return ci(gn,()=>t(gn))},async open(t){return new Promise(e=>{const{isConnected:r,isStandalone:n,isUiLoaded:i,isDataLoaded:s}=te.state,{enableNetworkView:o}=et.state;if(n?(te.setStandaloneUri(t?.uri),te.setStandaloneChains(t?.standaloneChains),Re.replace("ConnectWallet")):t!=null&&t.route?Re.replace(t.route):r?Re.replace("Account"):o?Re.replace("SelectNetwork"):Re.replace("ConnectWallet"),i&&s)gn.open=!0,e();else{const a=setInterval(()=>{te.state.isUiLoaded&&te.state.isDataLoaded&&(clearInterval(a),gn.open=!0,e())},200)}})},close(){gn.open=!1}},jr=br({open:!1,message:"",variant:"success"}),Nt={state:jr,subscribe(t){return ci(jr,()=>t(jr))},openToast(t,e){jr.open=!0,jr.message=t,jr.variant=e},closeToast(){jr.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=kh.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var yb=Object.defineProperty,Wh=Object.getOwnPropertySymbols,bb=Object.prototype.hasOwnProperty,vb=Object.prototype.propertyIsEnumerable,qh=(t,e,r)=>e in t?yb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_b=(t,e)=>{for(var r in e||(e={}))bb.call(e,r)&&qh(t,r,e[r]);if(Wh)for(var r of Wh(e))vb.call(e,r)&&qh(t,r,e[r]);return t};class Eb{constructor(e){this.openModal=ht.open,this.closeModal=ht.close,this.subscribeModal=ht.subscribe,this.setTheme=et.setThemeConfig,et.setConfig(_b({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return $_});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),te.setIsUiLoaded(!0)}}}const xb="https://rpc.walletconnect.com/v1/",Cb=["eth_requestAccounts","eth_accounts","eth_chainId","eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","personal_sign"],Sb=["chainChanged","accountsChanged"];function Db(t){return Number(t[0].split(":")[1])}class ws{constructor(){this.events=new vt.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.signer={},this.rpc={}}static async init(e){const r=new ws;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);try{const r=await this.signer.connect({namespaces:{[this.namespace]:{chains:this.rpc.chains,methods:this.rpc.methods,events:this.rpc.events,rpcMap:this.rpc.rpcMap}},pairingTopic:e?.pairingTopic});if(!r)return;const n=tg(r.namespaces,[this.namespace]);this.setChainIds(n);const i=eg(r.namespaces,[this.namespace]);this.setAccounts(i),this.events.emit("connect",{chainId:this.chainId,accounts:this.accounts})}catch(r){throw new Error(r.message)}finally{this.modal&&this.modal.closeModal()}}async disconnect(){await this.signer.disconnect()}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}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e;if(!this.rpc.chains.includes(r.chainId))return;const{event:n}=r;n.name==="accountsChanged"?(this.accounts=n.data,this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(n.data):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("disconnect",()=>{this.events.emit("disconnect")}),this.signer.on("display_uri",e=>{var r;this.rpc.showQrModal&&((r=this.modal)==null||r.openModal({uri:e})),this.events.emit("display_uri",e)})}setHttpProvider(e){const r=this.formatChainId(e);this.signer.setDefaultChain(r,this.getRpcUrl(e))}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)).filter(n=>n!==this.chainId);r.length&&(this.chainId=r[0],this.events.emit("chainChanged",this.chainId))}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.setHttpProvider(r),this.events.emit("chainChanged",this.chainId)}}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){return{chains:e.chains.map(r=>this.formatChainId(r))||[`${this.namespace}:1`],methods:e?.methods||Cb,events:e?.events||Sb,rpcMap:e?.rpcMap||this.buildRpcMap(e.chains,e.projectId),showQrModal:e?.showQrModal||!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){this.rpc=this.getRpcConfig(e),this.chainId=Db(this.rpc.chains),this.signer=await tb.init({projectId:this.rpc.projectId}),this.registerEventListeners(),this.rpc.showQrModal&&(this.modal=new Eb({projectId:this.rpc.projectId,standaloneChains:this.rpc.chains}))}loadConnectOpts(e){if(!e)return;const{chains:r,rpcMap:n}=e;!un(r)||!r||(this.rpc.chains=this.rpc.chains.concat(r.map(i=>this.formatChainId(i))),this.rpc.chains=[...new Set(this.rpc.chains)],r.forEach(i=>{this.rpc.rpcMap[i]=n?.[i]||this.getRpcUrl(i)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${xb}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}}const Ib=ws;/**
|
|
71
|
+
*/(function(t){const e=ps,r=_a,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=x,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),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(g,u),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 u=new Uint8Array(g);return Object.setPrototypeOf(u,a.prototype),u}function a(g,u,d){if(typeof g=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(g)}return c(g,u,d)}a.poolSize=8192;function c(g,u,d){if(typeof g=="string")return m(g,u);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,u,d);if(typeof g=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const b=g.valueOf&&g.valueOf();if(b!=null&&b!==g)return a.from(b,u,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"),u,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,u,d){return c(g,u,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,u,d){return l(g),g<=0?o(g):u!==void 0?typeof d=="string"?o(g).fill(u,d):o(g).fill(u):o(g)}a.alloc=function(g,u,d){return p(g,u,d)};function w(g){return l(g),o(g<0?0:L(g)|0)}a.allocUnsafe=function(g){return w(g)},a.allocUnsafeSlow=function(g){return w(g)};function m(g,u){if((typeof u!="string"||u==="")&&(u="utf8"),!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const d=O(g,u)|0;let b=o(d);const P=b.write(g,u);return P!==d&&(b=b.slice(0,P)),b}function y(g){const u=g.length<0?0:L(g.length)|0,d=o(u);for(let b=0;b<u;b+=1)d[b]=g[b]&255;return d}function E(g){if(me(g,Uint8Array)){const u=new Uint8Array(g);return T(u.buffer,u.byteOffset,u.byteLength)}return y(g)}function T(g,u,d){if(u<0||g.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(g.byteLength<u+(d||0))throw new RangeError('"length" is outside of buffer bounds');let b;return u===void 0&&d===void 0?b=new Uint8Array(g):d===void 0?b=new Uint8Array(g,u):b=new Uint8Array(g,u,d),Object.setPrototypeOf(b,a.prototype),b}function R(g){if(a.isBuffer(g)){const u=L(g.length)|0,d=o(u);return d.length===0||g.copy(d,0,0,u),d}if(g.length!==void 0)return typeof g.length!="number"||Se(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 x(g){return+g!=g&&(g=0),a.alloc(+g)}a.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==a.prototype},a.compare=function(u,d){if(me(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),me(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(u)||!a.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===d)return 0;let b=u.length,P=d.length;for(let U=0,k=Math.min(b,P);U<k;++U)if(u[U]!==d[U]){b=u[U],P=d[U];break}return b<P?-1:P<b?1:0},a.isEncoding=function(u){switch(String(u).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(u,d){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return a.alloc(0);let b;if(d===void 0)for(d=0,b=0;b<u.length;++b)d+=u[b].length;const P=a.allocUnsafe(d);let U=0;for(b=0;b<u.length;++b){let k=u[b];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,u){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,b=arguments.length>2&&arguments[2]===!0;if(!b&&d===0)return 0;let P=!1;for(;;)switch(u){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 Pe(g).length;default:if(P)return b?-1:Ue(g).length;u=(""+u).toLowerCase(),P=!0}}a.byteLength=O;function _(g,u,d){let b=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,u>>>=0,d<=u))return"";for(g||(g="utf8");;)switch(g){case"hex":return z(this,u,d);case"utf8":case"utf-8":return C(this,u,d);case"ascii":return K(this,u,d);case"latin1":case"binary":return W(this,u,d);case"base64":return re(this,u,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,u,d);default:if(b)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),b=!0}}a.prototype._isBuffer=!0;function D(g,u,d){const b=g[u];g[u]=g[d],g[d]=b}a.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let d=0;d<u;d+=2)D(this,d,d+1);return this},a.prototype.swap32=function(){const u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let d=0;d<u;d+=4)D(this,d,d+3),D(this,d+1,d+2);return this},a.prototype.swap64=function(){const u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let d=0;d<u;d+=8)D(this,d,d+7),D(this,d+1,d+6),D(this,d+2,d+5),D(this,d+3,d+4);return this},a.prototype.toString=function(){const u=this.length;return u===0?"":arguments.length===0?C(this,0,u):_.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(u){if(!a.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:a.compare(this,u)===0},a.prototype.inspect=function(){let u="";const d=t.INSPECT_MAX_BYTES;return u=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(u+=" ... "),"<Buffer "+u+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(u,d,b,P,U){if(me(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),!a.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(d===void 0&&(d=0),b===void 0&&(b=u?u.length:0),P===void 0&&(P=0),U===void 0&&(U=this.length),d<0||b>u.length||P<0||U>this.length)throw new RangeError("out of range index");if(P>=U&&d>=b)return 0;if(P>=U)return-1;if(d>=b)return 1;if(d>>>=0,b>>>=0,P>>>=0,U>>>=0,this===u)return 0;let k=U-P,oe=b-d;const he=Math.min(k,oe),Ne=this.slice(P,U),Be=u.slice(d,b);for(let Le=0;Le<he;++Le)if(Ne[Le]!==Be[Le]){k=Ne[Le],oe=Be[Le];break}return k<oe?-1:oe<k?1:0};function I(g,u,d,b,P){if(g.length===0)return-1;if(typeof d=="string"?(b=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,Se(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 u=="string"&&(u=a.from(u,b)),a.isBuffer(u))return u.length===0?-1:h(g,u,d,b,P);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(g,u,d):Uint8Array.prototype.lastIndexOf.call(g,u,d):h(g,[u],d,b,P);throw new TypeError("val must be string, number or Buffer")}function h(g,u,d,b,P){let U=1,k=g.length,oe=u.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(g.length<2||u.length<2)return-1;U=2,k/=2,oe/=2,d/=2}function he(Be,Le){return U===1?Be[Le]:Be.readUInt16BE(Le*U)}let Ne;if(P){let Be=-1;for(Ne=d;Ne<k;Ne++)if(he(g,Ne)===he(u,Be===-1?0:Ne-Be)){if(Be===-1&&(Be=Ne),Ne-Be+1===oe)return Be*U}else Be!==-1&&(Ne-=Ne-Be),Be=-1}else for(d+oe>k&&(d=k-oe),Ne=d;Ne>=0;Ne--){let Be=!0;for(let Le=0;Le<oe;Le++)if(he(g,Ne+Le)!==he(u,Le)){Be=!1;break}if(Be)return Ne}return-1}a.prototype.includes=function(u,d,b){return this.indexOf(u,d,b)!==-1},a.prototype.indexOf=function(u,d,b){return I(this,u,d,b,!0)},a.prototype.lastIndexOf=function(u,d,b){return I(this,u,d,b,!1)};function v(g,u,d,b){d=Number(d)||0;const P=g.length-d;b?(b=Number(b),b>P&&(b=P)):b=P;const U=u.length;b>U/2&&(b=U/2);let k;for(k=0;k<b;++k){const oe=parseInt(u.substr(k*2,2),16);if(Se(oe))return k;g[d+k]=oe}return k}function H(g,u,d,b){return Ie(Ue(u,g.length-d),g,d,b)}function j(g,u,d,b){return Ie(Ge(u),g,d,b)}function q(g,u,d,b){return Ie(Pe(u),g,d,b)}function X(g,u,d,b){return Ie(qe(u,g.length-d),g,d,b)}a.prototype.write=function(u,d,b,P){if(d===void 0)P="utf8",b=this.length,d=0;else if(b===void 0&&typeof d=="string")P=d,b=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(b)?(b=b>>>0,P===void 0&&(P="utf8")):(P=b,b=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-d;if((b===void 0||b>U)&&(b=U),u.length>0&&(b<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 v(this,u,d,b);case"utf8":case"utf-8":return H(this,u,d,b);case"ascii":case"latin1":case"binary":return j(this,u,d,b);case"base64":return q(this,u,d,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,u,d,b);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 re(g,u,d){return u===0&&d===g.length?e.fromByteArray(g):e.fromByteArray(g.slice(u,d))}function C(g,u,d){d=Math.min(g.length,d);const b=[];let P=u;for(;P<d;){const U=g[P];let k=null,oe=U>239?4:U>223?3:U>191?2:1;if(P+oe<=d){let he,Ne,Be,Le;switch(oe){case 1:U<128&&(k=U);break;case 2:he=g[P+1],(he&192)===128&&(Le=(U&31)<<6|he&63,Le>127&&(k=Le));break;case 3:he=g[P+1],Ne=g[P+2],(he&192)===128&&(Ne&192)===128&&(Le=(U&15)<<12|(he&63)<<6|Ne&63,Le>2047&&(Le<55296||Le>57343)&&(k=Le));break;case 4:he=g[P+1],Ne=g[P+2],Be=g[P+3],(he&192)===128&&(Ne&192)===128&&(Be&192)===128&&(Le=(U&15)<<18|(he&63)<<12|(Ne&63)<<6|Be&63,Le>65535&&Le<1114112&&(k=Le))}}k===null?(k=65533,oe=1):k>65535&&(k-=65536,b.push(k>>>10&1023|55296),k=56320|k&1023),b.push(k),P+=oe}return G(b)}const A=4096;function G(g){const u=g.length;if(u<=A)return String.fromCharCode.apply(String,g);let d="",b=0;for(;b<u;)d+=String.fromCharCode.apply(String,g.slice(b,b+=A));return d}function K(g,u,d){let b="";d=Math.min(g.length,d);for(let P=u;P<d;++P)b+=String.fromCharCode(g[P]&127);return b}function W(g,u,d){let b="";d=Math.min(g.length,d);for(let P=u;P<d;++P)b+=String.fromCharCode(g[P]);return b}function z(g,u,d){const b=g.length;(!u||u<0)&&(u=0),(!d||d<0||d>b)&&(d=b);let P="";for(let U=u;U<d;++U)P+=Oe[g[U]];return P}function J(g,u,d){const b=g.slice(u,d);let P="";for(let U=0;U<b.length-1;U+=2)P+=String.fromCharCode(b[U]+b[U+1]*256);return P}a.prototype.slice=function(u,d){const b=this.length;u=~~u,d=d===void 0?b:~~d,u<0?(u+=b,u<0&&(u=0)):u>b&&(u=b),d<0?(d+=b,d<0&&(d=0)):d>b&&(d=b),d<u&&(d=u);const P=this.subarray(u,d);return Object.setPrototypeOf(P,a.prototype),P};function Z(g,u,d){if(g%1!==0||g<0)throw new RangeError("offset is not uint");if(g+u>d)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(u,d,b){u=u>>>0,d=d>>>0,b||Z(u,d,this.length);let P=this[u],U=1,k=0;for(;++k<d&&(U*=256);)P+=this[u+k]*U;return P},a.prototype.readUintBE=a.prototype.readUIntBE=function(u,d,b){u=u>>>0,d=d>>>0,b||Z(u,d,this.length);let P=this[u+--d],U=1;for(;d>0&&(U*=256);)P+=this[u+--d]*U;return P},a.prototype.readUint8=a.prototype.readUInt8=function(u,d){return u=u>>>0,d||Z(u,1,this.length),this[u]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(u,d){return u=u>>>0,d||Z(u,2,this.length),this[u]|this[u+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(u,d){return u=u>>>0,d||Z(u,2,this.length),this[u]<<8|this[u+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},a.prototype.readBigUInt64LE=pe(function(u){u=u>>>0,ne(u,"offset");const d=this[u],b=this[u+7];(d===void 0||b===void 0)&&Ee(u,this.length-8);const P=d+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,U=this[++u]+this[++u]*2**8+this[++u]*2**16+b*2**24;return BigInt(P)+(BigInt(U)<<BigInt(32))}),a.prototype.readBigUInt64BE=pe(function(u){u=u>>>0,ne(u,"offset");const d=this[u],b=this[u+7];(d===void 0||b===void 0)&&Ee(u,this.length-8);const P=d*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],U=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+b;return(BigInt(P)<<BigInt(32))+BigInt(U)}),a.prototype.readIntLE=function(u,d,b){u=u>>>0,d=d>>>0,b||Z(u,d,this.length);let P=this[u],U=1,k=0;for(;++k<d&&(U*=256);)P+=this[u+k]*U;return U*=128,P>=U&&(P-=Math.pow(2,8*d)),P},a.prototype.readIntBE=function(u,d,b){u=u>>>0,d=d>>>0,b||Z(u,d,this.length);let P=d,U=1,k=this[u+--P];for(;P>0&&(U*=256);)k+=this[u+--P]*U;return U*=128,k>=U&&(k-=Math.pow(2,8*d)),k},a.prototype.readInt8=function(u,d){return u=u>>>0,d||Z(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},a.prototype.readInt16LE=function(u,d){u=u>>>0,d||Z(u,2,this.length);const b=this[u]|this[u+1]<<8;return b&32768?b|4294901760:b},a.prototype.readInt16BE=function(u,d){u=u>>>0,d||Z(u,2,this.length);const b=this[u+1]|this[u]<<8;return b&32768?b|4294901760:b},a.prototype.readInt32LE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},a.prototype.readInt32BE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},a.prototype.readBigInt64LE=pe(function(u){u=u>>>0,ne(u,"offset");const d=this[u],b=this[u+7];(d===void 0||b===void 0)&&Ee(u,this.length-8);const P=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(b<<24);return(BigInt(P)<<BigInt(32))+BigInt(d+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),a.prototype.readBigInt64BE=pe(function(u){u=u>>>0,ne(u,"offset");const d=this[u],b=this[u+7];(d===void 0||b===void 0)&&Ee(u,this.length-8);const P=(d<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(P)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+b)}),a.prototype.readFloatLE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),r.read(this,u,!0,23,4)},a.prototype.readFloatBE=function(u,d){return u=u>>>0,d||Z(u,4,this.length),r.read(this,u,!1,23,4)},a.prototype.readDoubleLE=function(u,d){return u=u>>>0,d||Z(u,8,this.length),r.read(this,u,!0,52,8)},a.prototype.readDoubleBE=function(u,d){return u=u>>>0,d||Z(u,8,this.length),r.read(this,u,!1,52,8)};function ue(g,u,d,b,P,U){if(!a.isBuffer(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>P||u<U)throw new RangeError('"value" argument is out of bounds');if(d+b>g.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(u,d,b,P){if(u=+u,d=d>>>0,b=b>>>0,!P){const oe=Math.pow(2,8*b)-1;ue(this,u,d,b,oe,0)}let U=1,k=0;for(this[d]=u&255;++k<b&&(U*=256);)this[d+k]=u/U&255;return d+b},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(u,d,b,P){if(u=+u,d=d>>>0,b=b>>>0,!P){const oe=Math.pow(2,8*b)-1;ue(this,u,d,b,oe,0)}let U=b-1,k=1;for(this[d+U]=u&255;--U>=0&&(k*=256);)this[d+U]=u/k&255;return d+b},a.prototype.writeUint8=a.prototype.writeUInt8=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,1,255,0),this[d]=u&255,d+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,2,65535,0),this[d]=u&255,this[d+1]=u>>>8,d+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,2,65535,0),this[d]=u>>>8,this[d+1]=u&255,d+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,4,4294967295,0),this[d+3]=u>>>24,this[d+2]=u>>>16,this[d+1]=u>>>8,this[d]=u&255,d+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,4,4294967295,0),this[d]=u>>>24,this[d+1]=u>>>16,this[d+2]=u>>>8,this[d+3]=u&255,d+4};function Q(g,u,d,b,P){ee(u,b,P,g,d,7);let U=Number(u&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(u>>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 fe(g,u,d,b,P){ee(u,b,P,g,d,7);let U=Number(u&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(u>>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=pe(function(u,d=0){return Q(this,u,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=pe(function(u,d=0){return fe(this,u,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(u,d,b,P){if(u=+u,d=d>>>0,!P){const he=Math.pow(2,8*b-1);ue(this,u,d,b,he-1,-he)}let U=0,k=1,oe=0;for(this[d]=u&255;++U<b&&(k*=256);)u<0&&oe===0&&this[d+U-1]!==0&&(oe=1),this[d+U]=(u/k>>0)-oe&255;return d+b},a.prototype.writeIntBE=function(u,d,b,P){if(u=+u,d=d>>>0,!P){const he=Math.pow(2,8*b-1);ue(this,u,d,b,he-1,-he)}let U=b-1,k=1,oe=0;for(this[d+U]=u&255;--U>=0&&(k*=256);)u<0&&oe===0&&this[d+U+1]!==0&&(oe=1),this[d+U]=(u/k>>0)-oe&255;return d+b},a.prototype.writeInt8=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,1,127,-128),u<0&&(u=255+u+1),this[d]=u&255,d+1},a.prototype.writeInt16LE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,2,32767,-32768),this[d]=u&255,this[d+1]=u>>>8,d+2},a.prototype.writeInt16BE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,2,32767,-32768),this[d]=u>>>8,this[d+1]=u&255,d+2},a.prototype.writeInt32LE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,4,2147483647,-2147483648),this[d]=u&255,this[d+1]=u>>>8,this[d+2]=u>>>16,this[d+3]=u>>>24,d+4},a.prototype.writeInt32BE=function(u,d,b){return u=+u,d=d>>>0,b||ue(this,u,d,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[d]=u>>>24,this[d+1]=u>>>16,this[d+2]=u>>>8,this[d+3]=u&255,d+4},a.prototype.writeBigInt64LE=pe(function(u,d=0){return Q(this,u,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=pe(function(u,d=0){return fe(this,u,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ae(g,u,d,b,P,U){if(d+b>g.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function Ce(g,u,d,b,P){return u=+u,d=d>>>0,P||ae(g,u,d,4),r.write(g,u,d,b,23,4),d+4}a.prototype.writeFloatLE=function(u,d,b){return Ce(this,u,d,!0,b)},a.prototype.writeFloatBE=function(u,d,b){return Ce(this,u,d,!1,b)};function B(g,u,d,b,P){return u=+u,d=d>>>0,P||ae(g,u,d,8),r.write(g,u,d,b,52,8),d+8}a.prototype.writeDoubleLE=function(u,d,b){return B(this,u,d,!0,b)},a.prototype.writeDoubleBE=function(u,d,b){return B(this,u,d,!1,b)},a.prototype.copy=function(u,d,b,P){if(!a.isBuffer(u))throw new TypeError("argument should be a Buffer");if(b||(b=0),!P&&P!==0&&(P=this.length),d>=u.length&&(d=u.length),d||(d=0),P>0&&P<b&&(P=b),P===b||u.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(b<0||b>=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),u.length-d<P-b&&(P=u.length-d+b);const U=P-b;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(d,b,P):Uint8Array.prototype.set.call(u,this.subarray(b,P),d),U},a.prototype.fill=function(u,d,b,P){if(typeof u=="string"){if(typeof d=="string"?(P=d,d=0,b=this.length):typeof b=="string"&&(P=b,b=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(u.length===1){const k=u.charCodeAt(0);(P==="utf8"&&k<128||P==="latin1")&&(u=k)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(d<0||this.length<d||this.length<b)throw new RangeError("Out of range index");if(b<=d)return this;d=d>>>0,b=b===void 0?this.length:b>>>0,u||(u=0);let U;if(typeof u=="number")for(U=d;U<b;++U)this[U]=u;else{const k=a.isBuffer(u)?u:a.from(u,P),oe=k.length;if(oe===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(U=0;U<b-d;++U)this[U+d]=k[U%oe]}return this};const F={};function N(g,u,d){F[g]=class extends d{constructor(){super(),Object.defineProperty(this,"message",{value:u.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,u){return`The "${g}" argument must be of type number. Received type ${typeof u}`},TypeError),N("ERR_OUT_OF_RANGE",function(g,u,d){let b=`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"),b+=` It must be ${u}. Received ${P}`,b},RangeError);function f(g){let u="",d=g.length;const b=g[0]==="-"?1:0;for(;d>=b+4;d-=3)u=`_${g.slice(d-3,d)}${u}`;return`${g.slice(0,d)}${u}`}function $(g,u,d){ne(u,"offset"),(g[u]===void 0||g[u+d]===void 0)&&Ee(u,g.length-(d+1))}function ee(g,u,d,b,P,U){if(g>d||g<u){const k=typeof u=="bigint"?"n":"";let oe;throw U>3?u===0||u===BigInt(0)?oe=`>= 0${k} and < 2${k} ** ${(U+1)*8}${k}`:oe=`>= -(2${k} ** ${(U+1)*8-1}${k}) and < 2 ** ${(U+1)*8-1}${k}`:oe=`>= ${u}${k} and <= ${d}${k}`,new F.ERR_OUT_OF_RANGE("value",oe,g)}$(b,P,U)}function ne(g,u){if(typeof g!="number")throw new F.ERR_INVALID_ARG_TYPE(u,"number",g)}function Ee(g,u,d){throw Math.floor(g)!==g?(ne(g,d),new F.ERR_OUT_OF_RANGE(d||"offset","an integer",g)):u<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE(d||"offset",`>= ${d?1:0} and <= ${u}`,g)}const Me=/[^+/0-9A-Za-z-_]/g;function $e(g){if(g=g.split("=")[0],g=g.trim().replace(Me,""),g.length<2)return"";for(;g.length%4!==0;)g=g+"=";return g}function Ue(g,u){u=u||1/0;let d;const b=g.length;let P=null;const U=[];for(let k=0;k<b;++k){if(d=g.charCodeAt(k),d>55295&&d<57344){if(!P){if(d>56319){(u-=3)>-1&&U.push(239,191,189);continue}else if(k+1===b){(u-=3)>-1&&U.push(239,191,189);continue}P=d;continue}if(d<56320){(u-=3)>-1&&U.push(239,191,189),P=d;continue}d=(P-55296<<10|d-56320)+65536}else P&&(u-=3)>-1&&U.push(239,191,189);if(P=null,d<128){if((u-=1)<0)break;U.push(d)}else if(d<2048){if((u-=2)<0)break;U.push(d>>6|192,d&63|128)}else if(d<65536){if((u-=3)<0)break;U.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((u-=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 u=[];for(let d=0;d<g.length;++d)u.push(g.charCodeAt(d)&255);return u}function qe(g,u){let d,b,P;const U=[];for(let k=0;k<g.length&&!((u-=2)<0);++k)d=g.charCodeAt(k),b=d>>8,P=d%256,U.push(P),U.push(b);return U}function Pe(g){return e.toByteArray($e(g))}function Ie(g,u,d,b){let P;for(P=0;P<b&&!(P+d>=u.length||P>=g.length);++P)u[P+d]=g[P];return P}function me(g,u){return g instanceof u||g!=null&&g.constructor!=null&&g.constructor.name!=null&&g.constructor.name===u.name}function Se(g){return g!==g}const Oe=function(){const g="0123456789abcdef",u=new Array(256);for(let d=0;d<16;++d){const b=d*16;for(let P=0;P<16;++P)u[b+P]=g[d]+g[P]}return u}();function pe(g){return typeof BigInt>"u"?xe:g}function xe(){throw new Error("BigInt not supported")}})(jh);const He=br({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1,isStandalone:!1,isCustomDesktop:!1,isCustomMobile:!1,isExplorer:!1,isDataLoaded:!1,isUiLoaded:!1}),te={state:He,subscribe(t){return ci(He,()=>t(He))},setChains(t){He.chains=t},setStandaloneChains(t){He.standaloneChains=t},setStandaloneUri(t){He.standaloneUri=t},getSelectedChain(){const t=Ke.client().getNetwork().chain;return t&&(He.selectedChain=t),He.selectedChain},setSelectedChain(t){He.selectedChain=t},setIsStandalone(t){He.isStandalone=t},setIsCustomDesktop(t){He.isCustomDesktop=t},setIsCustomMobile(t){He.isCustomMobile=t},setIsExplorer(t){He.isExplorer=t},getAccount(){const t=Ke.client().getAccount();He.address=t.address,He.isConnected=t.isConnected},setAddress(t){He.address=t},setIsConnected(t){He.isConnected=t},setProfileName(t){He.profileName=t},setProfileAvatar(t){He.profileAvatar=t},setProfileLoading(t){He.profileLoading=t},setBalanceLoading(t){He.balanceLoading=t},setBalance(t){He.balance=t},setIsDataLoaded(t){He.isDataLoaded=t},setIsUiLoaded(t){He.isUiLoaded=t},resetEnsProfile(){He.profileName=void 0,He.profileAvatar=void 0},resetBalance(){He.balance=void 0},resetAccount(){He.address=void 0,te.resetEnsProfile(),te.resetBalance()}},li=br({initialized:!1,ethereumClient:void 0}),Ke={setEthereumClient(t){!li.initialized&&t&&(li.ethereumClient=t,te.setChains(t.chains),li.initialized=!0)},client(){if(li.ethereumClient)return li.ethereumClient;throw new Error("ClientCtrl has no client set")}},Te={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",isMobile(){return typeof window<"u"?Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Te.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(Te.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(!Te.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="_self"){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(Te.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Te.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Te.WALLETCONNECT_DEEPLINK_CHOICE)},isNull(t){return t===null},getWalletConnectVersion(){const{isStandalone:t}=te.state;let e=1;return t||(e=Ke.client().walletConnectVersion),e}};function lb(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const ui=br({projectId:void 0,themeMode:lb()?"dark":"light",themeColor:"default",themeBackground:Te.isMobile()?"themeColor":"gradient",themeZIndex:89,mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableNetworkView:!1,defaultChain:void 0,explorerAllowList:void 0,explorerDenyList:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),et={state:ui,subscribe(t){return ci(ui,()=>t(ui))},setConfig(t){var e,r,n,i;if(te.setStandaloneChains(t.standaloneChains),te.setIsStandalone(Boolean((e=t.standaloneChains)==null?void 0:e.length)||Boolean(t.enableStandaloneMode)),te.setIsCustomMobile(Boolean((r=t.mobileWallets)==null?void 0:r.length)),te.setIsCustomDesktop(Boolean((n=t.desktopWallets)==null?void 0:n.length)),te.setIsExplorer(Boolean((i=t.projectId)==null?void 0:i.length)),t.defaultChain)te.setSelectedChain(t.defaultChain);else if(!te.state.isStandalone){const s=Ke.client().getDefaultChain();te.setSelectedChain(s)}Object.assign(ui,t)},setThemeConfig(t){Object.assign(ui,t)}},Hh="https://explorer-api.walletconnect.com";function ub(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 gs={async fetchWallets(t,e){const r=ub(e),n=`${Hh}/v3/wallets?projectId=${t}&${r}`;return(await fetch(n)).json()},formatImageUrl(t,e){return`${Hh}/v3/logo/lg/${e}?projectId=${t}`}},Br=br({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},previewWallets:[],recomendedWallets:[]});function ms(){const{projectId:t}=et.state;if(!t)throw new Error("projectId is required to work with explorer api");return t}const at={state:Br,async getPreviewWallets(t){const{listings:e}=await gs.fetchWallets(ms(),t);return Br.previewWallets=Object.values(e),Br.previewWallets},async getRecomendedWallets(){const{listings:t}=await gs.fetchWallets(ms(),{page:1,entries:6});Br.recomendedWallets=Object.values(t)},async getPaginatedWallets(t){const{page:e,search:r}=t,{listings:n,total:i}=await gs.fetchWallets(ms(),t),s=Object.values(n),o=r?"search":"wallets";return Br[o]={listings:[...Br[o].listings,...s],total:i,page:e??1},{listings:s,total:i}},getImageUrl(t){return gs.formatImageUrl(ms(),t)},resetSearch(){Br.search={listings:[],total:0,page:1}}},Ut=br({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Re={state:Ut,subscribe(t){return ci(Ut,()=>t(Ut))},push(t,e){t!==Ut.view&&(Ut.view=t,e&&(Ut.data=e),Ut.history.push(t))},replace(t){Ut.view=t,Ut.history=[t]},goBack(){if(Ut.history.length>1){Ut.history.pop();const[t]=Ut.history.slice(-1);Ut.view=t}}},gn=br({open:!1}),ht={state:gn,subscribe(t){return ci(gn,()=>t(gn))},async open(t){return new Promise(e=>{const{isConnected:r,isStandalone:n,isUiLoaded:i,isDataLoaded:s}=te.state,{enableNetworkView:o}=et.state;if(n?(te.setStandaloneUri(t?.uri),te.setStandaloneChains(t?.standaloneChains),Re.replace("ConnectWallet")):t!=null&&t.route?Re.replace(t.route):r?Re.replace("Account"):o?Re.replace("SelectNetwork"):Re.replace("ConnectWallet"),i&&s)gn.open=!0,e();else{const a=setInterval(()=>{te.state.isUiLoaded&&te.state.isDataLoaded&&(clearInterval(a),gn.open=!0,e())},200)}})},close(){gn.open=!1}},jr=br({open:!1,message:"",variant:"success"}),Nt={state:jr,subscribe(t){return ci(jr,()=>t(jr))},openToast(t,e){jr.open=!0,jr.message=t,jr.variant=e},closeToast(){jr.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=jh.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var hb=Object.defineProperty,zh=Object.getOwnPropertySymbols,db=Object.prototype.hasOwnProperty,fb=Object.prototype.propertyIsEnumerable,Wh=(t,e,r)=>e in t?hb(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)&&Wh(t,r,e[r]);if(zh)for(var r of zh(e))fb.call(e,r)&&Wh(t,r,e[r]);return t};class gb{constructor(e){this.openModal=ht.open,this.closeModal=ht.close,this.subscribeModal=ht.subscribe,this.setTheme=et.setThemeConfig,et.setConfig(pb({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return x_});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),te.setIsUiLoaded(!0)}}}const mb="https://rpc.walletconnect.com/v1/",wb=["eth_requestAccounts","eth_accounts","eth_chainId","eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","personal_sign"],yb=["chainChanged","accountsChanged"];function bb(t){return Number(t[0].split(":")[1])}class ws{constructor(){this.events=new vt.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.signer={},this.rpc={}}static async init(e){const r=new ws;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);try{const r=await this.signer.connect({namespaces:{[this.namespace]:{chains:this.rpc.chains,methods:this.rpc.methods,events:this.rpc.events,rpcMap:this.rpc.rpcMap}},pairingTopic:e?.pairingTopic});if(!r)return;this.setChainIds(this.rpc.chains);const n=Gp(r.namespaces,[this.namespace]);this.setAccounts(n),this.events.emit("connect",{chainId:this.chainId,accounts:this.accounts})}catch(r){throw new Error(r.message)}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}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}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e;if(!this.rpc.chains.includes(r.chainId))return;const{event:n}=r;n.name==="accountsChanged"?(this.accounts=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=>{this.chainId=e,this.events.emit("chainChanged",e)}),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.signer.on("display_uri",e=>{var r;this.rpc.showQrModal&&((r=this.modal)==null||r.openModal({uri:e})),this.events.emit("display_uri",e)})}setHttpProvider(e){const r=this.formatChainId(e);this.signer.setDefaultChain(r,this.getRpcUrl(e))}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",this.chainId))}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){return{chains:e.chains.map(r=>this.formatChainId(r))||[`${this.namespace}:1`],methods:e?.methods||wb,events:e?.events||yb,rpcMap:e?.rpcMap||this.buildRpcMap(e.chains,e.projectId),showQrModal:e?.showQrModal||!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){this.rpc=this.getRpcConfig(e),this.chainId=bb(this.rpc.chains),this.signer=await Gy.init({projectId:this.rpc.projectId}),this.registerEventListeners(),this.loadPersistedSession(),this.rpc.showQrModal&&(this.modal=new gb({projectId:this.rpc.projectId,standaloneChains:this.rpc.chains}))}loadConnectOpts(e){if(!e)return;const{chains:r,rpcMap:n}=e;!un(r)||!r||(this.rpc.chains=this.rpc.chains.concat(r.map(i=>this.formatChainId(i))),this.rpc.chains=[...new Set(this.rpc.chains)],r.forEach(i=>{this.rpc.rpcMap[i]=n?.[i]||this.getRpcUrl(i)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${mb}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}loadPersistedSession(){this.session&&(this.setChainIds(this.session.namespaces[this.namespace].accounts),this.setAccounts(this.session.namespaces[this.namespace].accounts))}reset(){this.chainId=1,this.accounts=[]}}const vb=ws;/**
|
|
72
72
|
* @license
|
|
73
73
|
* Copyright 2019 Google LLC
|
|
74
74
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
75
|
-
*/const ys=window,Ea=ys.ShadowRoot&&(ys.ShadyCSS===void 0||ys.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,xa=Symbol(),
|
|
75
|
+
*/const ys=window,Ea=ys.ShadowRoot&&(ys.ShadyCSS===void 0||ys.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,xa=Symbol(),qh=new WeakMap;class Vh{constructor(e,r,n){if(this._$cssResult$=!0,n!==xa)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(Ea&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=qh.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&qh.set(r,e))}return e}toString(){return this.cssText}}const _b=t=>new Vh(typeof t=="string"?t:t+"",void 0,xa),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 Vh(r,t,xa)},Eb=(t,e)=>{Ea?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=ys.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},Kh=Ea?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return _b(r)})(t):t;/**
|
|
76
76
|
* @license
|
|
77
77
|
* Copyright 2017 Google LLC
|
|
78
78
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
79
|
-
*/var Ca;const bs=window,
|
|
79
|
+
*/var Ca;const bs=window,Gh=bs.trustedTypes,xb=Gh?Gh.emptyScript:"",Zh=bs.reactiveElementPolyfillSupport,Sa={toAttribute(t,e){switch(e){case Boolean:t=t?xb: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}},Yh=(t,e)=>e!==t&&(e==e||t==t),Da={attribute:!0,type:String,converter:Sa,reflect:!1,hasChanged:Yh};class mn 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=Da){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)||Da}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(Kh(i))}else e!==void 0&&r.push(Kh(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 Eb(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=Da){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:Sa).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:Sa;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||Yh)(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){}}mn.finalized=!0,mn.elementProperties=new Map,mn.elementStyles=[],mn.shadowRootOptions={mode:"open"},Zh?.({ReactiveElement:mn}),((Ca=bs.reactiveElementVersions)!==null&&Ca!==void 0?Ca:bs.reactiveElementVersions=[]).push("1.6.1");/**
|
|
80
80
|
* @license
|
|
81
81
|
* Copyright 2017 Google LLC
|
|
82
82
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
83
|
-
*/var Ia;const vs=window,wn=vs.trustedTypes,
|
|
83
|
+
*/var Ia;const vs=window,wn=vs.trustedTypes,Jh=wn?wn.createPolicy("lit-html",{createHTML:t=>t}):void 0,vr=`lit$${(Math.random()+"").slice(9)}$`,Xh="?"+vr,Cb=`<${Xh}>`,yn=document,hi=(t="")=>yn.createComment(t),di=t=>t===null||typeof t!="object"&&typeof t!="function",Qh=Array.isArray,Sb=t=>Qh(t)||typeof t?.[Symbol.iterator]=="function",fi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,e0=/-->/g,t0=/>/g,kr=RegExp(`>|[
|
|
84
84
|
\f\r](?:([^\\s"'>=/]+)([
|
|
85
85
|
\f\r]*=[
|
|
86
86
|
\f\r]*(?:[^
|
|
87
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
87
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),r0=/'/g,n0=/"/g,i0=/^(?:script|style|textarea|title)$/i,s0=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),V=s0(1),Ae=s0(2),Hr=Symbol.for("lit-noChange"),ct=Symbol.for("lit-nothing"),o0=new WeakMap,bn=yn.createTreeWalker(yn,129,null,!1),Db=(t,e)=>{const r=t.length-1,n=[];let i,s=e===2?"<svg>":"",o=fi;for(let c=0;c<r;c++){const l=t[c];let p,w,m=-1,y=0;for(;y<l.length&&(o.lastIndex=y,w=o.exec(l),w!==null);)y=o.lastIndex,o===fi?w[1]==="!--"?o=e0:w[1]!==void 0?o=t0:w[2]!==void 0?(i0.test(w[2])&&(i=RegExp("</"+w[2],"g")),o=kr):w[3]!==void 0&&(o=kr):o===kr?w[0]===">"?(o=i??fi,m=-1):w[1]===void 0?m=-2:(m=o.lastIndex-w[2].length,p=w[1],o=w[3]===void 0?kr:w[3]==='"'?n0:r0):o===n0||o===r0?o=kr:o===e0||o===t0?o=fi:(o=kr,i=void 0);const E=o===kr&&t[c+1].startsWith("/>")?" ":"";s+=o===fi?l+Cb:m>=0?(n.push(p),l.slice(0,m)+"$lit$"+l.slice(m)+vr+E):l+vr+(m===-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[Jh!==void 0?Jh.createHTML(a):a,n]};class pi{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]=Db(e,r);if(this.el=pi.createElement(l,n),bn.currentNode=this.el.content,r===2){const w=this.el.content,m=w.firstChild;m.remove(),w.append(...m.childNodes)}for(;(i=bn.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes()){const w=[];for(const m of i.getAttributeNames())if(m.endsWith("$lit$")||m.startsWith(vr)){const y=p[o++];if(w.push(m),y!==void 0){const E=i.getAttribute(y.toLowerCase()+"$lit$").split(vr),T=/([.?@])?(.*)/.exec(y);c.push({type:1,index:s,name:T[2],strings:E,ctor:T[1]==="."?Ob:T[1]==="?"?$b:T[1]==="@"?Pb:_s})}else c.push({type:6,index:s})}for(const m of w)i.removeAttribute(m)}if(i0.test(i.tagName)){const w=i.textContent.split(vr),m=w.length-1;if(m>0){i.textContent=wn?wn.emptyScript:"";for(let y=0;y<m;y++)i.append(w[y],hi()),bn.nextNode(),c.push({type:2,index:++s});i.append(w[m],hi())}}}else if(i.nodeType===8)if(i.data===Xh)c.push({type:2,index:s});else{let w=-1;for(;(w=i.data.indexOf(vr,w+1))!==-1;)c.push({type:7,index:s}),w+=vr.length-1}s++}}static createElement(e,r){const n=yn.createElement("template");return n.innerHTML=e,n}}function vn(t,e,r=t,n){var i,s,o,a;if(e===Hr)return e;let c=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const l=di(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=vn(t,c._$AS(t,e.values),c,n)),e}class Ib{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:yn).importNode(n,!0);bn.currentNode=s;let o=bn.nextNode(),a=0,c=0,l=i[0];for(;l!==void 0;){if(a===l.index){let p;l.type===2?p=new gi(o,o.nextSibling,this,e):l.type===1?p=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(p=new Tb(o,this,e)),this.u.push(p),l=i[++c]}a!==l?.index&&(o=bn.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 gi{constructor(e,r,n,i){var s;this.type=2,this._$AH=ct,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=vn(this,e,r),di(e)?e===ct||e==null||e===""?(this._$AH!==ct&&this._$AR(),this._$AH=ct):e!==this._$AH&&e!==Hr&&this.g(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Sb(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!==ct&&di(this._$AH)?this._$AA.nextSibling.data=e:this.T(yn.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=pi.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 Ib(s,this),a=o.v(this.options);o.p(n),this.T(a),this._$AH=o}}_$AC(e){let r=o0.get(e.strings);return r===void 0&&o0.set(e.strings,r=new pi(e)),r}k(e){Qh(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 gi(this.O(hi()),this.O(hi()),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 _s{constructor(e,r,n,i,s){this.type=1,this._$AH=ct,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=ct}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=vn(this,e,r,0),o=!di(e)||e!==this._$AH&&e!==Hr,o&&(this._$AH=e);else{const a=e;let c,l;for(e=s[0],c=0;c<s.length-1;c++)l=vn(this,a[n+c],r,c),l===Hr&&(l=this._$AH[c]),o||(o=!di(l)||l!==this._$AH[c]),l===ct?e=ct:e!==ct&&(e+=(l??"")+s[c+1]),this._$AH[c]=l}o&&!i&&this.j(e)}j(e){e===ct?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Ob extends _s{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ct?void 0:e}}const Ab=wn?wn.emptyScript:"";class $b extends _s{constructor(){super(...arguments),this.type=4}j(e){e&&e!==ct?this.element.setAttribute(this.name,Ab):this.element.removeAttribute(this.name)}}class Pb extends _s{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){var n;if((e=(n=vn(this,e,r,0))!==null&&n!==void 0?n:ct)===Hr)return;const i=this._$AH,s=e===ct&&i!==ct||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==ct&&(i===ct||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 Tb{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){vn(this,e)}}const a0=vs.litHtmlPolyfillSupport;a0?.(pi,gi),((Ia=vs.litHtmlVersions)!==null&&Ia!==void 0?Ia:vs.litHtmlVersions=[]).push("2.6.1");const Rb=(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 gi(e.insertBefore(hi(),a),a,void 0,r??{})}return o._$AI(t),o};/**
|
|
88
88
|
* @license
|
|
89
89
|
* Copyright 2017 Google LLC
|
|
90
90
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
91
|
-
*/var Oa,Aa;class de extends mn{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=
|
|
91
|
+
*/var Oa,Aa;class de extends mn{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=Rb(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 Hr}}de.finalized=!0,de._$litElement$=!0,(Oa=globalThis.litElementHydrateSupport)===null||Oa===void 0||Oa.call(globalThis,{LitElement:de});const c0=globalThis.litElementPolyfillSupport;c0?.({LitElement:de}),((Aa=globalThis.litElementVersions)!==null&&Aa!==void 0?Aa:globalThis.litElementVersions=[]).push("3.2.2");/**
|
|
92
92
|
* @license
|
|
93
93
|
* Copyright 2017 Google LLC
|
|
94
94
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
* @license
|
|
97
97
|
* Copyright 2017 Google LLC
|
|
98
98
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
99
|
-
*/const
|
|
99
|
+
*/const Nb=(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 ve(t){return(e,r)=>r!==void 0?((n,i,s)=>{i.constructor.createProperty(s,n)})(t,e,r):Nb(t,e)}/**
|
|
100
100
|
* @license
|
|
101
101
|
* Copyright 2017 Google LLC
|
|
102
102
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -108,24 +108,24 @@
|
|
|
108
108
|
* @license
|
|
109
109
|
* Copyright 2017 Google LLC
|
|
110
110
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
111
|
-
*/const
|
|
111
|
+
*/const Lb={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mb=t=>(...e)=>({_$litDirective$:t,values:e});class Ub{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)}}/**
|
|
112
112
|
* @license
|
|
113
113
|
* Copyright 2018 Google LLC
|
|
114
114
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
115
|
-
*/const Lt=zb(class extends Wb{constructor(t){var e;if(super(t),t.type!==Hb.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 Hr}});function qb(t,e){t.indexOf(e)===-1&&t.push(e)}const u0=(t,e,r)=>Math.min(Math.max(r,t),e),qt={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},mi=t=>typeof t=="number",_n=t=>Array.isArray(t)&&!mi(t[0]),Vb=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function Kb(t,e){return _n(t)?t[Vb(0,t.length,e)]:t}const h0=(t,e,r)=>-r*t+r*e+t,d0=()=>{},nr=t=>t,Pa=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function f0(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Pa(0,e,n);t.push(h0(r,1,i))}}function Gb(t){const e=[0];return f0(e,t-1),e}function Zb(t,e=Gb(t.length),r=nr){const n=t.length,i=n-e.length;return i>0&&f0(e,i),s=>{let o=0;for(;o<n-2&&!(s<e[o+1]);o++);let a=u0(0,1,Pa(e[o],e[o+1],s));return a=Kb(r,o)(a),h0(t[o],t[o+1],a)}}const p0=t=>Array.isArray(t)&&mi(t[0]),Ta=t=>typeof t=="object"&&Boolean(t.createAnimation),zr=t=>typeof t=="function",g0=t=>typeof t=="string",En={ms:t=>t*1e3,s:t=>t/1e3};function Yb(t,e){return e?t*(1e3/e):0}const m0=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,Jb=1e-7,Xb=12;function Qb(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=m0(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>Jb&&++a<Xb);return o}function wi(t,e,r,n){if(t===e&&r===n)return nr;const i=s=>Qb(s,0,1,t,r);return s=>s===0||s===1?s:m0(i(s),e,n)}const ev=(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 u0(0,1,i/t)},w0={ease:wi(.25,.1,.25,1),"ease-in":wi(.42,0,1,1),"ease-in-out":wi(.42,0,.58,1),"ease-out":wi(0,0,.58,1)},tv=/\((.*?)\)/;function y0(t){if(zr(t))return t;if(p0(t))return wi(...t);if(w0[t])return w0[t];if(t.startsWith("steps")){const e=tv.exec(t);if(e){const r=e[1].split(",");return ev(parseFloat(r[0]),r[1].trim())}}return nr}class b0{constructor(e,r=[0,1],{easing:n,duration:i=qt.duration,delay:s=qt.delay,endDelay:o=qt.endDelay,repeat:a=qt.repeat,offset:c,direction:l="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=nr,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((w,m)=>{this.resolve=w,this.reject=m}),n=n||qt.easing,Ta(n)){const w=n.createAnimation(r);n=w.easing,r=w.keyframes||r,i=w.duration||i}this.repeat=a,this.easing=_n(n)?nr:y0(n),this.updateDuration(i);const p=Zb(r,c,_n(n)?n.map(y0):nr);this.tick=w=>{var m;s=s;let y=0;this.pauseTime!==void 0?y=this.pauseTime:y=(w-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 x=y>=this.totalDuration?1:Math.min(R,1),O=p(this.easing(x));e(O),this.pauseTime===void 0&&(this.playState==="finished"||y>=this.totalDuration+o)?(this.playState="finished",(m=this.resolve)===null||m===void 0||m.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 Ra=function(){};process.env.NODE_ENV!=="production"&&(Ra=function(t,e){if(!t)throw new Error(e)});class rv{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Na=new WeakMap;function v0(t){return Na.has(t)||Na.set(t,{transforms:[],values:new Map}),Na.get(t)}function nv(t,e){return t.has(e)||t.set(e,new rv),t.get(e)}const iv=["","X","Y","Z"],sv=["translate","scale","rotate","skew"],Es={x:"translateX",y:"translateY",z:"translateZ"},_0={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},ov={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:_0,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:nr},skew:_0},xn=new Map,La=t=>`--motion-${t}`,xs=["x","y","z"];sv.forEach(t=>{iv.forEach(e=>{xs.push(t+e),xn.set(La(t+e),ov[t])})});const av=(t,e)=>xs.indexOf(t)-xs.indexOf(e),cv=new Set(xs),E0=t=>cv.has(t),lv=(t,e)=>{Es[e]&&(e=Es[e]);const{transforms:r}=v0(t);qb(r,e),t.style.transform=uv(r)},uv=t=>t.sort(av).reduce(hv,"").trim(),hv=(t,e)=>`${t} ${e}(var(${La(e)}))`,Ma=t=>t.startsWith("--"),x0=new Set;function dv(t){if(!x0.has(t)){x0.add(t);try{const{syntax:e,initialValue:r}=xn.has(t)?xn.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const Ua=(t,e)=>document.createElement("div").animate(t,e),C0={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ua({opacity:[1]})}catch{return!1}return!0},finished:()=>Boolean(Ua({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{Ua({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Fa={},Cn={};for(const t in C0)Cn[t]=()=>(Fa[t]===void 0&&(Fa[t]=C0[t]()),Fa[t]);const fv=.015,pv=(t,e)=>{let r="";const n=Math.round(e/fv);for(let i=0;i<n;i++)r+=t(Pa(0,n-1,i))+", ";return r.substring(0,r.length-2)},S0=(t,e)=>zr(t)?Cn.linearEasing()?`linear(${pv(t,e)})`:qt.easing:p0(t)?gv(t):t,gv=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function mv(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const wv=t=>Array.isArray(t)?t:[t];function Cs(t){return Es[t]&&(t=Es[t]),E0(t)?La(t):t}const Ss={get:(t,e)=>{e=Cs(e);let r=Ma(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=xn.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=Cs(e),Ma(e)?t.style.setProperty(e,r):t.style[e]=r}};function D0(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function I0(t,e){var r;let n=e?.toDefaultUnit||nr;const i=t[t.length-1];if(g0(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 yv(){return window.__MOTION_DEV_TOOLS_RECORD}function bv(t,e,r,n={},i){const s=yv(),o=n.record!==!1&&s;let a,{duration:c=qt.duration,delay:l=qt.delay,endDelay:p=qt.endDelay,repeat:w=qt.repeat,easing:m=qt.easing,persist:y=!1,direction:E,offset:T,allowWebkitAcceleration:R=!1}=n;const L=v0(t),x=E0(e);let O=Cn.waapi();x&&lv(t,e);const _=Cs(e),D=nv(L.values,_),I=xn.get(_);return D0(D.animation,!(Ta(m)&&D.generator)&&n.record!==!1),()=>{const h=()=>{var j,q;return(q=(j=Ss.get(t,_))!==null&&j!==void 0?j:I?.initialValue)!==null&&q!==void 0?q:0};let v=mv(wv(r),h);const H=I0(v,I);if(Ta(m)){const j=m.createAnimation(v,e!=="opacity",h,_,D);m=j.easing,v=j.keyframes||v,c=j.duration||c}if(Ma(_)&&(Cn.cssRegisterProperty()?dv(_):O=!1),x&&!Cn.linearEasing()&&(zr(m)||_n(m)&&m.some(zr))&&(O=!1),O){I&&(v=v.map(X=>mi(X)?I.toDefaultUnit(X):X)),v.length===1&&(!Cn.partialKeyframes()||o)&&v.unshift(h());const j={delay:En.ms(l),duration:En.ms(c),endDelay:En.ms(p),easing:_n(m)?void 0:S0(m,c),direction:E,iterations:w+1,fill:"both"};a=t.animate({[_]:v,offset:T,easing:_n(m)?m.map(X=>S0(X,c)):void 0},j),a.finished||(a.finished=new Promise((X,re)=>{a.onfinish=X,a.oncancel=re}));const q=v[v.length-1];a.finished.then(()=>{y||(Ss.set(t,_,q),a.cancel())}).catch(d0),R||(a.playbackRate=1.000001)}else if(i&&x)v=v.map(j=>typeof j=="string"?parseFloat(j):j),v.length===1&&v.unshift(parseFloat(h())),a=new i(j=>{Ss.set(t,_,H?H(j):j)},v,Object.assign(Object.assign({},n),{duration:c,easing:m}));else{const j=v[v.length-1];Ss.set(t,_,I&&mi(j)?I.toDefaultUnit(j):j)}return o&&s(t,e,v,{duration:c,delay:l,easing:m,repeat:w,offset:T},"motion-one"),D.setAnimation(a),a}}const vv=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function O0(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 _v=t=>t(),A0=(t,e,r=qt.duration)=>new Proxy({animations:t.map(_v).filter(Boolean),duration:r,options:e},xv),Ev=t=>t.animations[0],xv={get:(t,e)=>{const r=Ev(t);switch(e){case"duration":return t.duration;case"currentTime":return En.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Cv)).catch(d0)),t.finished;case"stop":return()=>{t.animations.forEach(n=>D0(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=En.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},Cv=t=>t.finished;function Sv(t,e,r){return zr(t)?t(e,r):t}function Dv(t){return function(r,n,i={}){r=O0(r);const s=r.length;Ra(Boolean(s),"No valid element provided."),Ra(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=vv(i,l);p.delay=Sv(p.delay,a,s);const w=bv(c,l,n[l],p,t);o.push(w)}}return A0(o,i,i.duration)}}const Iv=Dv(b0);function Ov(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 Av=5;function $0(t,e,r){const n=Math.max(e-Av,0);return Yb(r-t(n),e-n)}const Sn={stiffness:100,damping:10,mass:1},$v=(t=Sn.stiffness,e=Sn.damping,r=Sn.mass)=>e/(2*Math.sqrt(t*r));function Pv(t,e,r){return t<e&&r>=e||t>e&&r<=e}const Tv=({stiffness:t=Sn.stiffness,damping:e=Sn.damping,mass:r=Sn.mass,from:n=0,to:i=1,velocity:s=0,restSpeed:o=2,restDistance:a=.5}={})=>{s=s?En.s(s):0;const c={done:!1,hasReachedTarget:!1,current:n,target:i},l=i-n,p=Math.sqrt(t/r)/1e3,w=$v(t,e,r);let m;if(w<1){const y=p*Math.sqrt(1-w*w);m=E=>i-Math.exp(-w*p*E)*((-s+w*p*l)/y*Math.sin(y*E)+l*Math.cos(y*E))}else m=y=>i-Math.exp(-p*y)*(l+(-s+p*l)*y);return y=>{c.current=m(y);const E=y===0?s:$0(m,y,c.current),T=Math.abs(E)<=o,R=Math.abs(i-c.current)<=a;return c.done=T&&R,c.hasReachedTarget=Pv(n,i,c.current),c}},Ba=10,Rv=1e4;function Nv(t,e=nr){let r,n=Ba,i=t(0);const s=[e(i.current)];for(;!i.done&&n<Rv;)i=t(n),s.push(e(i.done?i.target:i.current)),r===void 0&&i.hasReachedTarget&&(r=n),n+=Ba;const o=n-Ba;return s.length===1&&s.push(i.current),{keyframes:s,duration:o/1e3,overshootDuration:(r??o)/1e3}}function P0(t){return mi(t)&&!isNaN(t)}function ja(t){return g0(t)?parseFloat(t):t}function Lv(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,Nv(o,a)),e.get(o));return{createAnimation:(o,a=!0,c,l,p)=>{let w,m,y,E=0,T=nr;const R=o.length;if(a){T=I0(o,l?xn.get(Cs(l)):void 0);const L=o[R-1];if(y=ja(L),R>1&&o[0]!==null)m=ja(o[0]);else{const x=p?.generator;if(x){const{animation:O,generatorStartTime:_}=p,D=O?.startTime||_||0,I=O?.currentTime||performance.now()-D,h=x(I).current;m=h,E=$0(v=>x(v).current,I,h)}else c&&(m=ja(c()))}}if(P0(m)&&P0(y)){const L=i(m,y,E,l?.includes("scale"));w=Object.assign(Object.assign({},s(L,T)),{easing:"linear"}),p&&(p.generator=L,p.generatorStartTime=performance.now())}return w||(w={easing:"ease",duration:s(i(0,100)).overshootDuration}),w}}}}const Ds=Lv(Tv),Mv={any:0,all:1};function Uv(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const s=O0(t),o=new WeakMap,a=l=>{l.forEach(p=>{const w=o.get(p.target);if(p.isIntersecting!==Boolean(w))if(p.isIntersecting){const m=e(p);zr(m)?o.set(p.target,m):c.unobserve(p.target)}else w&&(w(p),o.delete(p.target))})},c=new IntersectionObserver(a,{root:r,rootMargin:n,threshold:typeof i=="number"?i:Mv[i]});return s.forEach(l=>c.observe(l)),()=>c.disconnect()}function ka(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function T0(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const Fv={isActive:t=>Boolean(t.inView),subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,s=Ov(n,["once"]);return Uv(t,o=>{if(e(),T0(t,"viewenter",o),!i)return a=>{r(),T0(t,"viewleave",a)}},s)}},R0=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),ka(t,e,n))};[...Object.keys({inView:Fv,hover:{isActive:t=>Boolean(t.hover),subscribe:(t,{enable:e,disable:r})=>{const n=R0(t,"hoverstart",e),i=R0(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(),ka(t,"pressend",s),window.removeEventListener("pointerup",n)},i=s=>{e(),ka(t,"pressstart",s),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function Bv(t,e={}){return A0([()=>{const r=new b0(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function _r(t,e,r){return(zr(t)?Bv:Iv)(t,e,r)}/**
|
|
115
|
+
*/const Lt=Mb(class extends Ub{constructor(t){var e;if(super(t),t.type!==Lb.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 Hr}});function Fb(t,e){t.indexOf(e)===-1&&t.push(e)}const l0=(t,e,r)=>Math.min(Math.max(r,t),e),qt={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},mi=t=>typeof t=="number",_n=t=>Array.isArray(t)&&!mi(t[0]),Bb=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function jb(t,e){return _n(t)?t[Bb(0,t.length,e)]:t}const u0=(t,e,r)=>-r*t+r*e+t,h0=()=>{},nr=t=>t,Pa=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function d0(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Pa(0,e,n);t.push(u0(r,1,i))}}function kb(t){const e=[0];return d0(e,t-1),e}function Hb(t,e=kb(t.length),r=nr){const n=t.length,i=n-e.length;return i>0&&d0(e,i),s=>{let o=0;for(;o<n-2&&!(s<e[o+1]);o++);let a=l0(0,1,Pa(e[o],e[o+1],s));return a=jb(r,o)(a),u0(t[o],t[o+1],a)}}const f0=t=>Array.isArray(t)&&mi(t[0]),Ta=t=>typeof t=="object"&&Boolean(t.createAnimation),zr=t=>typeof t=="function",p0=t=>typeof t=="string",En={ms:t=>t*1e3,s:t=>t/1e3};function zb(t,e){return e?t*(1e3/e):0}const g0=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,Wb=1e-7,qb=12;function Vb(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=g0(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>Wb&&++a<qb);return o}function wi(t,e,r,n){if(t===e&&r===n)return nr;const i=s=>Vb(s,0,1,t,r);return s=>s===0||s===1?s:g0(i(s),e,n)}const Kb=(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 l0(0,1,i/t)},m0={ease:wi(.25,.1,.25,1),"ease-in":wi(.42,0,1,1),"ease-in-out":wi(.42,0,.58,1),"ease-out":wi(0,0,.58,1)},Gb=/\((.*?)\)/;function w0(t){if(zr(t))return t;if(f0(t))return wi(...t);if(m0[t])return m0[t];if(t.startsWith("steps")){const e=Gb.exec(t);if(e){const r=e[1].split(",");return Kb(parseFloat(r[0]),r[1].trim())}}return nr}class y0{constructor(e,r=[0,1],{easing:n,duration:i=qt.duration,delay:s=qt.delay,endDelay:o=qt.endDelay,repeat:a=qt.repeat,offset:c,direction:l="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=nr,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((w,m)=>{this.resolve=w,this.reject=m}),n=n||qt.easing,Ta(n)){const w=n.createAnimation(r);n=w.easing,r=w.keyframes||r,i=w.duration||i}this.repeat=a,this.easing=_n(n)?nr:w0(n),this.updateDuration(i);const p=Hb(r,c,_n(n)?n.map(w0):nr);this.tick=w=>{var m;s=s;let y=0;this.pauseTime!==void 0?y=this.pauseTime:y=(w-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 x=y>=this.totalDuration?1:Math.min(R,1),O=p(this.easing(x));e(O),this.pauseTime===void 0&&(this.playState==="finished"||y>=this.totalDuration+o)?(this.playState="finished",(m=this.resolve)===null||m===void 0||m.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 Ra=function(){};process.env.NODE_ENV!=="production"&&(Ra=function(t,e){if(!t)throw new Error(e)});class Zb{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Na=new WeakMap;function b0(t){return Na.has(t)||Na.set(t,{transforms:[],values:new Map}),Na.get(t)}function Yb(t,e){return t.has(e)||t.set(e,new Zb),t.get(e)}const Jb=["","X","Y","Z"],Xb=["translate","scale","rotate","skew"],Es={x:"translateX",y:"translateY",z:"translateZ"},v0={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},Qb={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:v0,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:nr},skew:v0},xn=new Map,La=t=>`--motion-${t}`,xs=["x","y","z"];Xb.forEach(t=>{Jb.forEach(e=>{xs.push(t+e),xn.set(La(t+e),Qb[t])})});const ev=(t,e)=>xs.indexOf(t)-xs.indexOf(e),tv=new Set(xs),_0=t=>tv.has(t),rv=(t,e)=>{Es[e]&&(e=Es[e]);const{transforms:r}=b0(t);Fb(r,e),t.style.transform=nv(r)},nv=t=>t.sort(ev).reduce(iv,"").trim(),iv=(t,e)=>`${t} ${e}(var(${La(e)}))`,Ma=t=>t.startsWith("--"),E0=new Set;function sv(t){if(!E0.has(t)){E0.add(t);try{const{syntax:e,initialValue:r}=xn.has(t)?xn.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const Ua=(t,e)=>document.createElement("div").animate(t,e),x0={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ua({opacity:[1]})}catch{return!1}return!0},finished:()=>Boolean(Ua({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{Ua({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Fa={},Cn={};for(const t in x0)Cn[t]=()=>(Fa[t]===void 0&&(Fa[t]=x0[t]()),Fa[t]);const ov=.015,av=(t,e)=>{let r="";const n=Math.round(e/ov);for(let i=0;i<n;i++)r+=t(Pa(0,n-1,i))+", ";return r.substring(0,r.length-2)},C0=(t,e)=>zr(t)?Cn.linearEasing()?`linear(${av(t,e)})`:qt.easing:f0(t)?cv(t):t,cv=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function lv(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const uv=t=>Array.isArray(t)?t:[t];function Cs(t){return Es[t]&&(t=Es[t]),_0(t)?La(t):t}const Ss={get:(t,e)=>{e=Cs(e);let r=Ma(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=xn.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=Cs(e),Ma(e)?t.style.setProperty(e,r):t.style[e]=r}};function S0(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function D0(t,e){var r;let n=e?.toDefaultUnit||nr;const i=t[t.length-1];if(p0(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 hv(){return window.__MOTION_DEV_TOOLS_RECORD}function dv(t,e,r,n={},i){const s=hv(),o=n.record!==!1&&s;let a,{duration:c=qt.duration,delay:l=qt.delay,endDelay:p=qt.endDelay,repeat:w=qt.repeat,easing:m=qt.easing,persist:y=!1,direction:E,offset:T,allowWebkitAcceleration:R=!1}=n;const L=b0(t),x=_0(e);let O=Cn.waapi();x&&rv(t,e);const _=Cs(e),D=Yb(L.values,_),I=xn.get(_);return S0(D.animation,!(Ta(m)&&D.generator)&&n.record!==!1),()=>{const h=()=>{var j,q;return(q=(j=Ss.get(t,_))!==null&&j!==void 0?j:I?.initialValue)!==null&&q!==void 0?q:0};let v=lv(uv(r),h);const H=D0(v,I);if(Ta(m)){const j=m.createAnimation(v,e!=="opacity",h,_,D);m=j.easing,v=j.keyframes||v,c=j.duration||c}if(Ma(_)&&(Cn.cssRegisterProperty()?sv(_):O=!1),x&&!Cn.linearEasing()&&(zr(m)||_n(m)&&m.some(zr))&&(O=!1),O){I&&(v=v.map(X=>mi(X)?I.toDefaultUnit(X):X)),v.length===1&&(!Cn.partialKeyframes()||o)&&v.unshift(h());const j={delay:En.ms(l),duration:En.ms(c),endDelay:En.ms(p),easing:_n(m)?void 0:C0(m,c),direction:E,iterations:w+1,fill:"both"};a=t.animate({[_]:v,offset:T,easing:_n(m)?m.map(X=>C0(X,c)):void 0},j),a.finished||(a.finished=new Promise((X,re)=>{a.onfinish=X,a.oncancel=re}));const q=v[v.length-1];a.finished.then(()=>{y||(Ss.set(t,_,q),a.cancel())}).catch(h0),R||(a.playbackRate=1.000001)}else if(i&&x)v=v.map(j=>typeof j=="string"?parseFloat(j):j),v.length===1&&v.unshift(parseFloat(h())),a=new i(j=>{Ss.set(t,_,H?H(j):j)},v,Object.assign(Object.assign({},n),{duration:c,easing:m}));else{const j=v[v.length-1];Ss.set(t,_,I&&mi(j)?I.toDefaultUnit(j):j)}return o&&s(t,e,v,{duration:c,delay:l,easing:m,repeat:w,offset:T},"motion-one"),D.setAnimation(a),a}}const fv=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function I0(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 pv=t=>t(),O0=(t,e,r=qt.duration)=>new Proxy({animations:t.map(pv).filter(Boolean),duration:r,options:e},mv),gv=t=>t.animations[0],mv={get:(t,e)=>{const r=gv(t);switch(e){case"duration":return t.duration;case"currentTime":return En.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(wv)).catch(h0)),t.finished;case"stop":return()=>{t.animations.forEach(n=>S0(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=En.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},wv=t=>t.finished;function yv(t,e,r){return zr(t)?t(e,r):t}function bv(t){return function(r,n,i={}){r=I0(r);const s=r.length;Ra(Boolean(s),"No valid element provided."),Ra(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=fv(i,l);p.delay=yv(p.delay,a,s);const w=dv(c,l,n[l],p,t);o.push(w)}}return O0(o,i,i.duration)}}const vv=bv(y0);function _v(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 Ev=5;function A0(t,e,r){const n=Math.max(e-Ev,0);return zb(r-t(n),e-n)}const Sn={stiffness:100,damping:10,mass:1},xv=(t=Sn.stiffness,e=Sn.damping,r=Sn.mass)=>e/(2*Math.sqrt(t*r));function Cv(t,e,r){return t<e&&r>=e||t>e&&r<=e}const Sv=({stiffness:t=Sn.stiffness,damping:e=Sn.damping,mass:r=Sn.mass,from:n=0,to:i=1,velocity:s=0,restSpeed:o=2,restDistance:a=.5}={})=>{s=s?En.s(s):0;const c={done:!1,hasReachedTarget:!1,current:n,target:i},l=i-n,p=Math.sqrt(t/r)/1e3,w=xv(t,e,r);let m;if(w<1){const y=p*Math.sqrt(1-w*w);m=E=>i-Math.exp(-w*p*E)*((-s+w*p*l)/y*Math.sin(y*E)+l*Math.cos(y*E))}else m=y=>i-Math.exp(-p*y)*(l+(-s+p*l)*y);return y=>{c.current=m(y);const E=y===0?s:A0(m,y,c.current),T=Math.abs(E)<=o,R=Math.abs(i-c.current)<=a;return c.done=T&&R,c.hasReachedTarget=Cv(n,i,c.current),c}},Ba=10,Dv=1e4;function Iv(t,e=nr){let r,n=Ba,i=t(0);const s=[e(i.current)];for(;!i.done&&n<Dv;)i=t(n),s.push(e(i.done?i.target:i.current)),r===void 0&&i.hasReachedTarget&&(r=n),n+=Ba;const o=n-Ba;return s.length===1&&s.push(i.current),{keyframes:s,duration:o/1e3,overshootDuration:(r??o)/1e3}}function $0(t){return mi(t)&&!isNaN(t)}function ja(t){return p0(t)?parseFloat(t):t}function Ov(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,Iv(o,a)),e.get(o));return{createAnimation:(o,a=!0,c,l,p)=>{let w,m,y,E=0,T=nr;const R=o.length;if(a){T=D0(o,l?xn.get(Cs(l)):void 0);const L=o[R-1];if(y=ja(L),R>1&&o[0]!==null)m=ja(o[0]);else{const x=p?.generator;if(x){const{animation:O,generatorStartTime:_}=p,D=O?.startTime||_||0,I=O?.currentTime||performance.now()-D,h=x(I).current;m=h,E=A0(v=>x(v).current,I,h)}else c&&(m=ja(c()))}}if($0(m)&&$0(y)){const L=i(m,y,E,l?.includes("scale"));w=Object.assign(Object.assign({},s(L,T)),{easing:"linear"}),p&&(p.generator=L,p.generatorStartTime=performance.now())}return w||(w={easing:"ease",duration:s(i(0,100)).overshootDuration}),w}}}}const Ds=Ov(Sv),Av={any:0,all:1};function $v(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const s=I0(t),o=new WeakMap,a=l=>{l.forEach(p=>{const w=o.get(p.target);if(p.isIntersecting!==Boolean(w))if(p.isIntersecting){const m=e(p);zr(m)?o.set(p.target,m):c.unobserve(p.target)}else w&&(w(p),o.delete(p.target))})},c=new IntersectionObserver(a,{root:r,rootMargin:n,threshold:typeof i=="number"?i:Av[i]});return s.forEach(l=>c.observe(l)),()=>c.disconnect()}function ka(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function P0(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const Pv={isActive:t=>Boolean(t.inView),subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,s=_v(n,["once"]);return $v(t,o=>{if(e(),P0(t,"viewenter",o),!i)return a=>{r(),P0(t,"viewleave",a)}},s)}},T0=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),ka(t,e,n))};[...Object.keys({inView:Pv,hover:{isActive:t=>Boolean(t.hover),subscribe:(t,{enable:e,disable:r})=>{const n=T0(t,"hoverstart",e),i=T0(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(),ka(t,"pressend",s),window.removeEventListener("pointerup",n)},i=s=>{e(),ka(t,"pressstart",s),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function Tv(t,e={}){return O0([()=>{const r=new y0(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function _r(t,e,r){return(zr(t)?Tv:vv)(t,e,r)}/**
|
|
116
116
|
* @license
|
|
117
117
|
* Copyright 2018 Google LLC
|
|
118
118
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
119
|
-
*/const Ft=t=>t??ct;var yi={},
|
|
120
|
-
]))+`;ir.KANJI=new RegExp(_i,"g"),ir.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ir.BYTE=new RegExp(
|
|
121
|
-
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var
|
|
122
|
-
Suggested mode is: `+e.toString(_));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(x){return x.reduce(function(O,_){return typeof _=="string"?O.push(R(_,null)):_.data&&O.push(R(_.data,_.mode)),O},[])},t.fromString=function(x,O){const _=w(x,a.isKanjiModeEnabled()),D=E(_),I=T(D,O),h=c.find_path(I.map,"start","end"),v=[];for(let H=1;H<h.length-1;H++)v.push(I.table[h[H]].node);return t.fromArray(y(v))},t.rawSplit=function(x){return t.fromArray(w(x,a.isKanjiModeEnabled()))}}(
|
|
119
|
+
*/const Ft=t=>t??ct;var yi={},Rv=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},R0={},Bt={};let Ha;const Nv=[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];Bt.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},Bt.getSymbolTotalCodewords=function(e){return Nv[e]},Bt.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},Bt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Ha=e},Bt.isKanjiModeEnabled=function(){return typeof Ha<"u"},Bt.toSJIS=function(e){return Ha(e)};var Is={};(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}}})(Is);function N0(){this.buffer=[],this.length=0}N0.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 Lv=N0;function bi(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)}bi.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},bi.prototype.get=function(t,e){return this.data[t*this.size+e]},bi.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},bi.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var Mv=bi,L0={};(function(t){const e=Bt.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}})(L0);var M0={};const Uv=Bt.getSymbolSize,U0=7;M0.getPositions=function(e){const r=Uv(e);return[[0,0],[r-U0,0],[0,r-U0]]};var F0={};(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 w=0;w<s;w++){a=c=0,l=p=null;for(let m=0;m<s;m++){let y=i.get(w,m);y===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=y,a=1),y=i.get(m,w),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}})(F0);var Os={};const Er=Is,As=[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],$s=[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];Os.getBlocksCount=function(e,r){switch(r){case Er.L:return As[(e-1)*4+0];case Er.M:return As[(e-1)*4+1];case Er.Q:return As[(e-1)*4+2];case Er.H:return As[(e-1)*4+3];default:return}},Os.getTotalCodewordsCount=function(e,r){switch(r){case Er.L:return $s[(e-1)*4+0];case Er.M:return $s[(e-1)*4+1];case Er.Q:return $s[(e-1)*4+2];case Er.H:return $s[(e-1)*4+3];default:return}};var B0={},Ps={};const vi=new Uint8Array(512),Ts=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)vi[r]=e,Ts[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)vi[r]=vi[r-255]})(),Ps.log=function(e){if(e<1)throw new Error("log("+e+")");return Ts[e]},Ps.exp=function(e){return vi[e]},Ps.mul=function(e,r){return e===0||r===0?0:vi[Ts[e]+Ts[r]]},function(t){const e=Ps;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}}(B0);const j0=B0;function za(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}za.prototype.initialize=function(e){this.degree=e,this.genPoly=j0.generateECPolynomial(this.degree)},za.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=j0.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 Fv=za,k0={},xr={},Wa={};Wa.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var ir={};const H0="[0-9]+",Bv="[A-Z $%*+\\-./:]+";let _i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";_i=_i.replace(/u/g,"\\u");const jv="(?:(?![A-Z0-9 $%*+\\-./:]|"+_i+`)(?:.|[\r
|
|
120
|
+
]))+`;ir.KANJI=new RegExp(_i,"g"),ir.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ir.BYTE=new RegExp(jv,"g"),ir.NUMERIC=new RegExp(H0,"g"),ir.ALPHANUMERIC=new RegExp(Bv,"g");const kv=new RegExp("^"+_i+"$"),Hv=new RegExp("^"+H0+"$"),zv=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ir.testKanji=function(e){return kv.test(e)},ir.testNumeric=function(e){return Hv.test(e)},ir.testAlphanumeric=function(e){return zv.test(e)},function(t){const e=Wa,r=ir;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}}}(xr),function(t){const e=Bt,r=Os,n=Is,i=xr,s=Wa,o=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,a=e.getBCHDigit(o);function c(m,y,E){for(let T=1;T<=40;T++)if(y<=t.getCapacity(T,E,m))return T}function l(m,y){return i.getCharCountIndicator(m,y)+4}function p(m,y){let E=0;return m.forEach(function(T){const R=l(T.mode,y);E+=R+T.getBitsLength()}),E}function w(m,y){for(let E=1;E<=40;E++)if(p(m,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),x=(R-L)*8;if(T===i.MIXED)return x;const O=x-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 w(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}}(k0);var z0={};const qa=Bt,W0=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,Wv=1<<14|1<<12|1<<10|1<<4|1<<1,q0=qa.getBCHDigit(W0);z0.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;qa.getBCHDigit(i)-q0>=0;)i^=W0<<qa.getBCHDigit(i)-q0;return(n<<10|i)^Wv};var V0={};const qv=xr;function Dn(t){this.mode=qv.NUMERIC,this.data=t.toString()}Dn.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Dn.prototype.getLength=function(){return this.data.length},Dn.prototype.getBitsLength=function(){return Dn.getBitsLength(this.data.length)},Dn.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 Vv=Dn;const Kv=xr,Va=["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 In(t){this.mode=Kv.ALPHANUMERIC,this.data=t}In.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},In.prototype.getLength=function(){return this.data.length},In.prototype.getBitsLength=function(){return In.getBitsLength(this.data.length)},In.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=Va.indexOf(this.data[r])*45;n+=Va.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(Va.indexOf(this.data[r]),6)};var Gv=In,Zv=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 Yv=Zv,Jv=xr;function On(t){this.mode=Jv.BYTE,typeof t=="string"&&(t=Yv(t)),this.data=new Uint8Array(t)}On.getBitsLength=function(e){return e*8},On.prototype.getLength=function(){return this.data.length},On.prototype.getBitsLength=function(){return On.getBitsLength(this.data.length)},On.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var Xv=On;const Qv=xr,e6=Bt;function An(t){this.mode=Qv.KANJI,this.data=t}An.getBitsLength=function(e){return e*13},An.prototype.getLength=function(){return this.data.length},An.prototype.getBitsLength=function(){return An.getBitsLength(this.data.length)},An.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=e6.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]+`
|
|
121
|
+
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var t6=An,K0={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,w,m,y,E,T,R;!a.empty();){c=a.pop(),l=c.value,w=c.cost,m=r[l]||{};for(p in m)m.hasOwnProperty(p)&&(y=m[p],E=w+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})(K0),function(t){const e=xr,r=Vv,n=Gv,i=Xv,s=t6,o=ir,a=Bt,c=K0.exports;function l(L){return unescape(encodeURIComponent(L)).length}function p(L,x,O){const _=[];let D;for(;(D=L.exec(O))!==null;)_.push({data:D[0],index:D.index,mode:x,length:D[0].length});return _}function w(L){const x=p(o.NUMERIC,e.NUMERIC,L),O=p(o.ALPHANUMERIC,e.ALPHANUMERIC,L);let _,D;return a.isKanjiModeEnabled()?(_=p(o.BYTE,e.BYTE,L),D=p(o.KANJI,e.KANJI,L)):(_=p(o.BYTE_KANJI,e.BYTE,L),D=[]),x.concat(O,_,D).sort(function(h,v){return h.index-v.index}).map(function(h){return{data:h.data,mode:h.mode,length:h.length}})}function m(L,x){switch(x){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(x,O){const _=x.length-1>=0?x[x.length-1]:null;return _&&_.mode===O.mode?(x[x.length-1].data+=O.data,x):(x.push(O),x)},[])}function E(L){const x=[];for(let O=0;O<L.length;O++){const _=L[O];switch(_.mode){case e.NUMERIC:x.push([_,{data:_.data,mode:e.ALPHANUMERIC,length:_.length},{data:_.data,mode:e.BYTE,length:_.length}]);break;case e.ALPHANUMERIC:x.push([_,{data:_.data,mode:e.BYTE,length:_.length}]);break;case e.KANJI:x.push([_,{data:_.data,mode:e.BYTE,length:l(_.data)}]);break;case e.BYTE:x.push([{data:_.data,mode:e.BYTE,length:l(_.data)}])}}return x}function T(L,x){const O={},_={start:{}};let D=["start"];for(let I=0;I<L.length;I++){const h=L[I],v=[];for(let H=0;H<h.length;H++){const j=h[H],q=""+I+H;v.push(q),O[q]={node:j,lastCount:0},_[q]={};for(let X=0;X<D.length;X++){const re=D[X];O[re]&&O[re].node.mode===j.mode?(_[re][q]=m(O[re].lastCount+j.length,j.mode)-m(O[re].lastCount,j.mode),O[re].lastCount+=j.length):(O[re]&&(O[re].lastCount=j.length),_[re][q]=m(j.length,j.mode)+4+e.getCharCountIndicator(j.mode,x))}}D=v}for(let I=0;I<D.length;I++)_[D[I]].end=0;return{map:_,table:O}}function R(L,x){let O;const _=e.getBestModeForData(L);if(O=e.from(x,_),O!==e.BYTE&&O.bit<_.bit)throw new Error('"'+L+'" cannot be encoded with mode '+e.toString(O)+`.
|
|
122
|
+
Suggested mode is: `+e.toString(_));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(x){return x.reduce(function(O,_){return typeof _=="string"?O.push(R(_,null)):_.data&&O.push(R(_.data,_.mode)),O},[])},t.fromString=function(x,O){const _=w(x,a.isKanjiModeEnabled()),D=E(_),I=T(D,O),h=c.find_path(I.map,"start","end"),v=[];for(let H=1;H<h.length-1;H++)v.push(I.table[h[H]].node);return t.fromArray(y(v))},t.rawSplit=function(x){return t.fromArray(w(x,a.isKanjiModeEnabled()))}}(V0);const Rs=Bt,Ka=Is,r6=Lv,n6=Mv,i6=L0,s6=M0,Ga=F0,Za=Os,o6=Fv,Ns=k0,a6=z0,c6=xr,Ya=V0;function l6(t,e){const r=t.size,n=s6.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 u6(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 h6(t,e){const r=i6.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 d6(t,e){const r=t.size,n=Ns.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 Ja(t,e,r){const n=t.size,i=a6.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 f6(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 p6(t,e,r){const n=new r6;r.forEach(function(c){n.put(c.mode.bit,4),n.put(c.getLength(),c6.getCharCountIndicator(c.mode,t)),c.write(n)});const i=Rs.getSymbolTotalCodewords(t),s=Za.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 g6(n,t,e)}function g6(t,e,r){const n=Rs.getSymbolTotalCodewords(e),i=Za.getTotalCodewordsCount(e,r),s=n-i,o=Za.getBlocksCount(e,r),a=n%o,c=o-a,l=Math.floor(n/o),p=Math.floor(s/o),w=p+1,m=l-p,y=new o6(m);let E=0;const T=new Array(o),R=new Array(o);let L=0;const x=new Uint8Array(t.buffer);for(let h=0;h<o;h++){const v=h<c?p:w;T[h]=x.slice(E,E+v),R[h]=y.encode(T[h]),E+=v,L=Math.max(L,v)}const O=new Uint8Array(n);let _=0,D,I;for(D=0;D<L;D++)for(I=0;I<o;I++)D<T[I].length&&(O[_++]=T[I][D]);for(D=0;D<m;D++)for(I=0;I<o;I++)O[_++]=R[I][D];return O}function m6(t,e,r,n){let i;if(Array.isArray(t))i=Ya.fromArray(t);else if(typeof t=="string"){let l=e;if(!l){const p=Ya.rawSplit(t);l=Ns.getBestVersionForData(p,r)}i=Ya.fromString(t,l||40)}else throw new Error("Invalid data");const s=Ns.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(`
|
|
123
123
|
The chosen QR Code version cannot contain this amount of data.
|
|
124
124
|
Minimum version required to store current data is: `+s+`.
|
|
125
|
-
`);const o=
|
|
126
|
-
`;return typeof n=="function"&&n(null,m),m};const D6=jv,ec=N0,X0=Z0,I6=Y0;function tc(t,e,r,n,i){const s=[].slice.call(arguments,1),o=s.length,a=typeof s[o-1]=="function";if(!a&&!D6())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=ec.create(r,n);c(t(p,e,n))}catch(p){l(p)}})}try{const c=ec.create(r,n);i(null,t(c,e,n))}catch(c){i(c)}}yi.create=ec.create,yi.toCanvas=tc.bind(null,X0.render),yi.toDataURL=tc.bind(null,X0.renderToDataURL),yi.toString=tc.bind(null,function(t,e,r){return I6.render(t,r)});var O6=Object.defineProperty,Q0=Object.getOwnPropertySymbols,A6=Object.prototype.hasOwnProperty,$6=Object.prototype.propertyIsEnumerable,ed=(t,e,r)=>e in t?O6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,td=(t,e)=>{for(var r in e||(e={}))A6.call(e,r)&&ed(t,r,e[r]);if(Q0)for(var r of Q0(e))$6.call(e,r)&&ed(t,r,e[r]);return t};function rd(){return{default:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(51,150,255)",background:"rgb(232,242,252)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(71,161,255)",background:"rgb(21,38,55)"}},magenta:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(198,83,128)",background:"rgb(244,221,230)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(203,77,140)",background:"rgb(57,35,43)"}},blue:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(61,92,245)",background:"rgb(232,235,252)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(81,109,251)",background:"rgb(28,33,59)"}},orange:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(234,140,46)",background:"rgb(244,236,221)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(255,166,76)",background:"rgb(57,50,34)"}},green:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(38,181,98)",background:"rgb(218,246,218)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(38,217,98)",background:"rgb(35,52,40)"}},purple:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(121,76,255)",background:"rgb(225,218,246)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(144,110,247)",background:"rgb(36,31,51)"}},teal:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(43,182,182)",background:"rgb(217,242,238)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(54,226,226)",background:"rgb(29,48,52)"}},blackWhite:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(20,20,20)",background:"rgb(255,255,255)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(255,255,255)",background:"rgb(20,20,20)"}}}}function P6(){return{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"}}}function T6(){return{default:{1:"#B6B9C9",2:"#C653C6",3:"#794DFF",4:"#2EB8B8"},blue:{1:"#E8EBFD",2:"#C653C6",3:"#2DD2C5",4:"#3D5CF5"},magenta:{1:"#F4DDE6",2:"#E0D452",3:"#F09475",4:"#D1618D"},orange:{1:"#F4ECDD",2:"#B4EB47",3:"#3075E8",4:"#EB9947"},green:{1:"#DAF6DA",2:"#E06B92",3:"#99E54D",4:"#26B562"},purple:{1:"#E1DAF6",2:"#EB9947",3:"#E06B92",4:"#794DFF"},teal:{1:"#D9F2EE",2:"#F09475",3:"#794DFF",4:"#2EB8B8"},blackWhite:{1:"#E3E8E8",2:"#98AEAE",3:"#516767",4:"#242E2E"}}}const le={color(){var t,e;const r=(t=et.state.themeColor)!=null?t:"default",n=(e=et.state.themeMode)!=null?e:"dark",i=rd()[r][n],s=P6()[n],o=T6()[r];return{foreground:td({accent:i.foreground,inverse:i.inverse},s.foreground),background:td({accent:i.background},s.background),gradient:o,overlay:s.overlay,error:"rgb(242, 90, 103)"}},setTheme(){const t=document.querySelector(":root"),{themeZIndex:e}=et.state;if(t){const r={"--color-fg-accent":le.color().foreground.accent,"--color-fg-inverse":le.color().foreground.inverse,"--color-fg-1":le.color().foreground[1],"--color-fg-2":le.color().foreground[2],"--color-fg-3":le.color().foreground[3],"--color-bg-1":le.color().background[1],"--color-bg-2":le.color().background[2],"--color-bg-3":le.color().background[3],"--color-overlay":le.color().overlay,"--color-err":le.color().error,"--color-success":rd().green.light.foreground,"--gradient-1":le.color().gradient[1],"--gradient-2":le.color().gradient[2],"--gradient-3":le.color().gradient[3],"--gradient-4":le.color().gradient[4],"--modal-z-index":`${e}`};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(--color-fg-inverse);background:var(--color-fg-accent)}`},R6=be`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--color-overlay)}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--color-overlay);background-color:var(--color-fg-accent);border-radius:50%;margin-bottom:4px}button path{fill:var(--color-fg-inverse)}`;var N6=Object.defineProperty,L6=Object.getOwnPropertyDescriptor,Ls=(t,e,r,n)=>{for(var i=n>1?void 0:n?L6(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&&N6(e,r,i),i};let $n=class extends de{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-normal" color="accent">${this.label}</w3m-text></button>`}};$n.styles=[le.globalCss,R6],Ls([ve()],$n.prototype,"icon",2),Ls([ve()],$n.prototype,"label",2),Ls([ve()],$n.prototype,"onClick",2),$n=Ls([we("w3m-box-button")],$n);const M6=be`button{border-radius:28px;height:28px;padding:0 10px;background-color:var(--color-fg-accent)}button path{fill:var(--color-fg-inverse)}button::after{border-radius:inherit;border:1px solid var(--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(--color-overlay)}button:disabled{background-color:var(--color-bg-3)}`;var U6=Object.defineProperty,F6=Object.getOwnPropertyDescriptor,Ei=(t,e,r,n)=>{for(var i=n>1?void 0:n?F6(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&&U6(e,r,i),i};let Wr=class extends de{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="${Lt(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-normal" color="inverse"><slot></slot></w3m-text>${this.iconRight}</button>`}};Wr.styles=[le.globalCss,M6],Ei([ve()],Wr.prototype,"disabled",2),Ei([ve()],Wr.prototype,"iconLeft",2),Ei([ve()],Wr.prototype,"iconRight",2),Ei([ve()],Wr.prototype,"onClick",2),Wr=Ei([we("w3m-button")],Wr);const B6=be`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:10px;color:var(--color-fg-inverse);background-color:var(--color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--color-overlay)}button:hover::after{background-color:var(--color-overlay)}button:disabled{padding-bottom:0;background-color:var(--color-bg-3);color:var(--color-fg-3)}.w3m-secondary{color:var(--color-fg-accent);background-color:transparent}.w3m-secondary::after{display:none}`;var j6=Object.defineProperty,k6=Object.getOwnPropertyDescriptor,rc=(t,e,r,n)=>{for(var i=n>1?void 0:n?k6(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&&j6(e,r,i),i};let xi=class extends de{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return V`<button ?disabled="${this.disabled}" class="${Lt(t)}"><slot></slot></button>`}};xi.styles=[le.globalCss,B6],rc([ve()],xi.prototype,"disabled",2),rc([ve()],xi.prototype,"variant",2),xi=rc([we("w3m-button-big")],xi);class H6{constructor(...e){this.angle=0,this.t=1253106,this.last=0,this.height=500,this.amp=300,this.seed=15,this.freqX=14e-5,this.freqY=29e-5,this.freqDelta=1e-5,this.activeColors=[1,1,1,1],this.isMetaKey=!1,this.playing=!1,nd(this,"resize",()=>{this.width=window.innerWidth,this.minigl.setSize(this.width,this.height),this.minigl.setOrthographicCamera(),this.xSegCount=Math.ceil(this.width*this.conf.density[0]),this.ySegCount=Math.ceil(this.height*this.conf.density[1]),this.mesh.geometry.setTopology(this.xSegCount,this.ySegCount),this.mesh.geometry.setSize(this.width,this.height),this.mesh.material.uniforms.u_shadow_power.value=this.width<550?5:6}),nd(this,"animate",r=>{if(this.playing){if(this.shouldSkipFrame(r)||(this.t+=Math.min(r-this.last,1e3/15),this.last=r,this.mesh.material.uniforms.u_time.value=this.t,this.minigl.render()),this.last!==0&&this.isStatic)return this.minigl.render();requestAnimationFrame(this.animate)}})}play(e){this.el=e,this.connect()}stop(){this.playing=!1}async connect(){this.shaderFiles={vertex:"varying vec3 v_color;void main(){float time=u_time*u_global.noiseSpeed;vec2 noiseCoord=resolution*uvNorm*u_global.noiseFreq;vec2 st=1.-uvNorm.xy;float tilt=resolution.y/2.0*uvNorm.y;float incline=resolution.x*uvNorm.x/2.0*u_vertDeform.incline;float offset=resolution.x/2.0*u_vertDeform.incline*mix(u_vertDeform.offsetBottom,u_vertDeform.offsetTop,uv.y);float noise=snoise(vec3(noiseCoord.x*u_vertDeform.noiseFreq.x+time*u_vertDeform.noiseFlow,noiseCoord.y*u_vertDeform.noiseFreq.y,time*u_vertDeform.noiseSpeed+u_vertDeform.noiseSeed))*u_vertDeform.noiseAmp;noise*=1.0-pow(abs(uvNorm.y),2.0);noise=max(0.0,noise);vec3 pos=vec3(position.x,position.y+tilt+incline+noise-offset,position.z);if(u_active_colors[0]==1.){v_color=u_baseColor;}for(int i=0;i<u_waveLayers_length;i++){if(u_active_colors[i+1]==1.){WaveLayers layer=u_waveLayers[i];float noise=smoothstep(layer.noiseFloor,layer.noiseCeil,snoise(vec3(noiseCoord.x*layer.noiseFreq.x+time*layer.noiseFlow,noiseCoord.y*layer.noiseFreq.y,time*layer.noiseSpeed+layer.noiseSeed))/2.0+0.5);v_color=blendNormal(v_color,layer.color,pow(noise,4.));}}gl_Position=projectionMatrix*modelViewMatrix*vec4(pos,1.0);}",noise:`
|
|
125
|
+
`);const o=p6(e,r,i),a=Rs.getSymbolSize(e),c=new n6(a);return l6(c,e),u6(c),h6(c,e),Ja(c,r,0),e>=7&&d6(c,e),f6(c,o),isNaN(n)&&(n=Ga.getBestMask(c,Ja.bind(null,c,r))),Ga.applyMask(n,c),Ja(c,r,n),{modules:c,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}R0.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=Ka.M,i,s;return typeof r<"u"&&(n=Ka.from(r.errorCorrectionLevel,Ka.M),i=Ns.from(r.version),s=Ga.from(r.maskPattern),r.toSJISFunc&&Rs.setToSJISFunction(r.toSJISFunc)),m6(e,i,n,s)};var G0={},Xa={};(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,w=[s.color.light,s.color.dark];for(let m=0;m<l;m++)for(let y=0;y<l;y++){let E=(m*l+y)*4,T=s.color.light;if(m>=p&&y>=p&&m<l-p&&y<l-p){const R=Math.floor((m-p)/c),L=Math.floor((y-p)/c);T=w[a[R*o+L]?1:0]}n[E++]=T.r,n[E++]=T.g,n[E++]=T.b,n[E]=T.a}}})(Xa),function(t){const e=Xa;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),w=l.getContext("2d"),m=w.createImageData(p,p);return e.qrToImageData(m.data,s,c),r(w,l,p),w.putImageData(m,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",w=c.rendererOpts||{};return l.toDataURL(p,w.quality)}}(G0);var Z0={};const w6=Xa;function Y0(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function Qa(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function y6(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?Qa("M",c+r,.5+l+r):Qa("m",i,0),i=0,s=!1),c+1<e&&t[a+1]||(n+=Qa("h",o),o=0)):i++}return n}Z0.render=function(e,r,n){const i=w6.getOptions(r),s=e.modules.size,o=e.modules.data,a=s+i.margin*2,c=i.color.light.a?"<path "+Y0(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+Y0(i.color.dark,"stroke")+' d="'+y6(o,s,i.margin)+'"/>',p='viewBox="0 0 '+a+" "+a+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+p+' shape-rendering="crispEdges">'+c+l+`</svg>
|
|
126
|
+
`;return typeof n=="function"&&n(null,m),m};const b6=Rv,ec=R0,J0=G0,v6=Z0;function tc(t,e,r,n,i){const s=[].slice.call(arguments,1),o=s.length,a=typeof s[o-1]=="function";if(!a&&!b6())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=ec.create(r,n);c(t(p,e,n))}catch(p){l(p)}})}try{const c=ec.create(r,n);i(null,t(c,e,n))}catch(c){i(c)}}yi.create=ec.create,yi.toCanvas=tc.bind(null,J0.render),yi.toDataURL=tc.bind(null,J0.renderToDataURL),yi.toString=tc.bind(null,function(t,e,r){return v6.render(t,r)});var _6=Object.defineProperty,X0=Object.getOwnPropertySymbols,E6=Object.prototype.hasOwnProperty,x6=Object.prototype.propertyIsEnumerable,Q0=(t,e,r)=>e in t?_6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ed=(t,e)=>{for(var r in e||(e={}))E6.call(e,r)&&Q0(t,r,e[r]);if(X0)for(var r of X0(e))x6.call(e,r)&&Q0(t,r,e[r]);return t};function td(){return{default:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(51,150,255)",background:"rgb(232,242,252)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(71,161,255)",background:"rgb(21,38,55)"}},magenta:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(198,83,128)",background:"rgb(244,221,230)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(203,77,140)",background:"rgb(57,35,43)"}},blue:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(61,92,245)",background:"rgb(232,235,252)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(81,109,251)",background:"rgb(28,33,59)"}},orange:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(234,140,46)",background:"rgb(244,236,221)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(255,166,76)",background:"rgb(57,50,34)"}},green:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(38,181,98)",background:"rgb(218,246,218)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(38,217,98)",background:"rgb(35,52,40)"}},purple:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(121,76,255)",background:"rgb(225,218,246)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(144,110,247)",background:"rgb(36,31,51)"}},teal:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(43,182,182)",background:"rgb(217,242,238)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(54,226,226)",background:"rgb(29,48,52)"}},blackWhite:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(20,20,20)",background:"rgb(255,255,255)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(255,255,255)",background:"rgb(20,20,20)"}}}}function C6(){return{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"}}}function S6(){return{default:{1:"#B6B9C9",2:"#C653C6",3:"#794DFF",4:"#2EB8B8"},blue:{1:"#E8EBFD",2:"#C653C6",3:"#2DD2C5",4:"#3D5CF5"},magenta:{1:"#F4DDE6",2:"#E0D452",3:"#F09475",4:"#D1618D"},orange:{1:"#F4ECDD",2:"#B4EB47",3:"#3075E8",4:"#EB9947"},green:{1:"#DAF6DA",2:"#E06B92",3:"#99E54D",4:"#26B562"},purple:{1:"#E1DAF6",2:"#EB9947",3:"#E06B92",4:"#794DFF"},teal:{1:"#D9F2EE",2:"#F09475",3:"#794DFF",4:"#2EB8B8"},blackWhite:{1:"#E3E8E8",2:"#98AEAE",3:"#516767",4:"#242E2E"}}}const le={color(){var t,e;const r=(t=et.state.themeColor)!=null?t:"default",n=(e=et.state.themeMode)!=null?e:"dark",i=td()[r][n],s=C6()[n],o=S6()[r];return{foreground:ed({accent:i.foreground,inverse:i.inverse},s.foreground),background:ed({accent:i.background},s.background),gradient:o,overlay:s.overlay,error:"rgb(242, 90, 103)"}},setTheme(){const t=document.querySelector(":root"),{themeZIndex:e}=et.state;if(t){const r={"--color-fg-accent":le.color().foreground.accent,"--color-fg-inverse":le.color().foreground.inverse,"--color-fg-1":le.color().foreground[1],"--color-fg-2":le.color().foreground[2],"--color-fg-3":le.color().foreground[3],"--color-bg-1":le.color().background[1],"--color-bg-2":le.color().background[2],"--color-bg-3":le.color().background[3],"--color-overlay":le.color().overlay,"--color-err":le.color().error,"--color-success":td().green.light.foreground,"--gradient-1":le.color().gradient[1],"--gradient-2":le.color().gradient[2],"--gradient-3":le.color().gradient[3],"--gradient-4":le.color().gradient[4],"--modal-z-index":`${e}`};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(--color-fg-inverse);background:var(--color-fg-accent)}`},D6=be`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--color-overlay)}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--color-overlay);background-color:var(--color-fg-accent);border-radius:50%;margin-bottom:4px}button path{fill:var(--color-fg-inverse)}`;var I6=Object.defineProperty,O6=Object.getOwnPropertyDescriptor,Ls=(t,e,r,n)=>{for(var i=n>1?void 0:n?O6(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&&I6(e,r,i),i};let $n=class extends de{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-normal" color="accent">${this.label}</w3m-text></button>`}};$n.styles=[le.globalCss,D6],Ls([ve()],$n.prototype,"icon",2),Ls([ve()],$n.prototype,"label",2),Ls([ve()],$n.prototype,"onClick",2),$n=Ls([we("w3m-box-button")],$n);const A6=be`button{border-radius:28px;height:28px;padding:0 10px;background-color:var(--color-fg-accent)}button path{fill:var(--color-fg-inverse)}button::after{border-radius:inherit;border:1px solid var(--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(--color-overlay)}button:disabled{background-color:var(--color-bg-3)}`;var $6=Object.defineProperty,P6=Object.getOwnPropertyDescriptor,Ei=(t,e,r,n)=>{for(var i=n>1?void 0:n?P6(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&&$6(e,r,i),i};let Wr=class extends de{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="${Lt(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-normal" color="inverse"><slot></slot></w3m-text>${this.iconRight}</button>`}};Wr.styles=[le.globalCss,A6],Ei([ve()],Wr.prototype,"disabled",2),Ei([ve()],Wr.prototype,"iconLeft",2),Ei([ve()],Wr.prototype,"iconRight",2),Ei([ve()],Wr.prototype,"onClick",2),Wr=Ei([we("w3m-button")],Wr);const T6=be`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:10px;color:var(--color-fg-inverse);background-color:var(--color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--color-overlay)}button:hover::after{background-color:var(--color-overlay)}button:disabled{padding-bottom:0;background-color:var(--color-bg-3);color:var(--color-fg-3)}.w3m-secondary{color:var(--color-fg-accent);background-color:transparent}.w3m-secondary::after{display:none}`;var R6=Object.defineProperty,N6=Object.getOwnPropertyDescriptor,rc=(t,e,r,n)=>{for(var i=n>1?void 0:n?N6(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&&R6(e,r,i),i};let xi=class extends de{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return V`<button ?disabled="${this.disabled}" class="${Lt(t)}"><slot></slot></button>`}};xi.styles=[le.globalCss,T6],rc([ve()],xi.prototype,"disabled",2),rc([ve()],xi.prototype,"variant",2),xi=rc([we("w3m-button-big")],xi);class L6{constructor(...e){this.angle=0,this.t=1253106,this.last=0,this.height=500,this.amp=300,this.seed=15,this.freqX=14e-5,this.freqY=29e-5,this.freqDelta=1e-5,this.activeColors=[1,1,1,1],this.isMetaKey=!1,this.playing=!1,rd(this,"resize",()=>{this.width=window.innerWidth,this.minigl.setSize(this.width,this.height),this.minigl.setOrthographicCamera(),this.xSegCount=Math.ceil(this.width*this.conf.density[0]),this.ySegCount=Math.ceil(this.height*this.conf.density[1]),this.mesh.geometry.setTopology(this.xSegCount,this.ySegCount),this.mesh.geometry.setSize(this.width,this.height),this.mesh.material.uniforms.u_shadow_power.value=this.width<550?5:6}),rd(this,"animate",r=>{if(this.playing){if(this.shouldSkipFrame(r)||(this.t+=Math.min(r-this.last,1e3/15),this.last=r,this.mesh.material.uniforms.u_time.value=this.t,this.minigl.render()),this.last!==0&&this.isStatic)return this.minigl.render();requestAnimationFrame(this.animate)}})}play(e){this.el=e,this.connect()}stop(){this.playing=!1}async connect(){this.shaderFiles={vertex:"varying vec3 v_color;void main(){float time=u_time*u_global.noiseSpeed;vec2 noiseCoord=resolution*uvNorm*u_global.noiseFreq;vec2 st=1.-uvNorm.xy;float tilt=resolution.y/2.0*uvNorm.y;float incline=resolution.x*uvNorm.x/2.0*u_vertDeform.incline;float offset=resolution.x/2.0*u_vertDeform.incline*mix(u_vertDeform.offsetBottom,u_vertDeform.offsetTop,uv.y);float noise=snoise(vec3(noiseCoord.x*u_vertDeform.noiseFreq.x+time*u_vertDeform.noiseFlow,noiseCoord.y*u_vertDeform.noiseFreq.y,time*u_vertDeform.noiseSpeed+u_vertDeform.noiseSeed))*u_vertDeform.noiseAmp;noise*=1.0-pow(abs(uvNorm.y),2.0);noise=max(0.0,noise);vec3 pos=vec3(position.x,position.y+tilt+incline+noise-offset,position.z);if(u_active_colors[0]==1.){v_color=u_baseColor;}for(int i=0;i<u_waveLayers_length;i++){if(u_active_colors[i+1]==1.){WaveLayers layer=u_waveLayers[i];float noise=smoothstep(layer.noiseFloor,layer.noiseCeil,snoise(vec3(noiseCoord.x*layer.noiseFreq.x+time*layer.noiseFlow,noiseCoord.y*layer.noiseFreq.y,time*layer.noiseSpeed+layer.noiseSeed))/2.0+0.5);v_color=blendNormal(v_color,layer.color,pow(noise,4.));}}gl_Position=projectionMatrix*modelViewMatrix*vec4(pos,1.0);}",noise:`
|
|
127
127
|
// MIT License: Copyright (C) 2011 Ashima Arts. All rights reserved. https://github.com/ashima/webgl-noise, https://github.com/stegu/webgl-noise
|
|
128
128
|
vec3 mod289(vec3 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 permute(vec4 x){return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}float snoise(vec3 v){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0.0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);m=m*m;return 42.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));}`,blend:`
|
|
129
129
|
// MIT Licence: Copyright (C) 2015 Jamie Owen. All rights reserved. https://github.com/jamieowen/glsl-blend
|
|
130
|
-
vec3 blendNormal(vec3 base, vec3 blend){return blend;}vec3 blendNormal(vec3 base,vec3 blend,float opacity){return (blendNormal(base,blend)*opacity+base*(1.0-opacity));}float blendScreen(float base,float blend){return 1.0-((1.0-base)*(1.0-blend));}vec3 blendScreen(vec3 base,vec3 blend){return vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b));}vec3 blendScreen(vec3 base,vec3 blend,float opacity){return (blendScreen(base, blend)*opacity+base*(1.0-opacity));}vec3 blendMultiply(vec3 base,vec3 blend){return base*blend;}vec3 blendMultiply(vec3 base,vec3 blend,float opacity){return (blendMultiply(base,blend)*opacity+base*(1.0-opacity));}float blendOverlay(float base,float blend){return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));}vec3 blendOverlay(vec3 base,vec3 blend){return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));}vec3 blendOverlay(vec3 base,vec3 blend,float opacity){return (blendOverlay(base,blend)*opacity+base*(1.0-opacity));}vec3 blendHardLight(vec3 base,vec3 blend){return blendOverlay(blend,base);}vec3 blendHardLight(vec3 base,vec3 blend,float opacity){return (blendHardLight(base,blend)*opacity+base*(1.0-opacity));}float blendSoftLight(float base,float blend){return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));}vec3 blendSoftLight(vec3 base,vec3 blend){return vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));}vec3 blendSoftLight(vec3 base,vec3 blend,float opacity){return (blendSoftLight(base,blend)*opacity+base*(1.0-opacity));}float blendColorDodge(float base,float blend){return (blend==1.0)?blend:min(base/(1.0-blend),1.0);}vec3 blendColorDodge(vec3 base,vec3 blend){return vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));}vec3 blendColorDodge(vec3 base,vec3 blend,float opacity){return (blendColorDodge(base, blend)*opacity+base*(1.0-opacity));}float blendColorBurn(float base,float blend){return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);}vec3 blendColorBurn(vec3 base,vec3 blend){return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));}vec3 blendColorBurn(vec3 base,vec3 blend,float opacity){return (blendColorBurn(base, blend)*opacity+base*(1.0-opacity));}float blendVividLight(float base,float blend){return (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));}vec3 blendVividLight(vec3 base,vec3 blend){return vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));}vec3 blendVividLight(vec3 base,vec3 blend,float opacity){return (blendVividLight(base,blend)*opacity+base*(1.0-opacity));}float blendLighten(float base,float blend){return max(blend,base);}vec3 blendLighten(vec3 base,vec3 blend){return vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));}vec3 blendLighten(vec3 base,vec3 blend,float opacity){return (blendLighten(base,blend)*opacity+base*(1.0-opacity));}float blendLinearBurn(float base,float blend){return max(base+blend-1.0,0.0);}vec3 blendLinearBurn(vec3 base,vec3 blend){return max(base+blend-vec3(1.0),vec3(0.0));}vec3 blendLinearBurn(vec3 base,vec3 blend,float opacity){return (blendLinearBurn(base, blend)*opacity+base*(1.0-opacity));}float blendLinearDodge(float base,float blend){return min(base+blend,1.0);}vec3 blendLinearDodge(vec3 base,vec3 blend){return min(base+blend,vec3(1.0));}vec3 blendLinearDodge(vec3 base,vec3 blend,float opacity){return (blendLinearDodge(base,blend)*opacity+base*(1.0-opacity));}float blendLinearLight(float base,float blend){return blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5)));}vec3 blendLinearLight(vec3 base,vec3 blend){return vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b));}vec3 blendLinearLight(vec3 base,vec3 blend,float opacity){return (blendLinearLight(base,blend)*opacity+base*(1.0-opacity));}`,fragment:"varying vec3 v_color;void main(){vec3 color=v_color;if(u_darken_top==1.0){vec2 st=gl_FragCoord.xy/resolution.xy;color.g-=pow(st.y+sin(-12.0)*st.x,u_shadow_power)*0.4;}gl_FragColor=vec4(color,1.0);}"},this.conf={density:[.06,.16]},this.minigl=new W6(this.el,null,null,!0),requestAnimationFrame(()=>{this.el&&(this.computedCanvasStyle=getComputedStyle(this.el),this.waitForCssVars())})}initMaterial(){this.uniforms={u_time:new this.minigl.Uniform({value:0}),u_shadow_power:new this.minigl.Uniform({value:5}),u_darken_top:new this.minigl.Uniform({value:this.el.dataset.jsDarkenTop===""?1:0}),u_active_colors:new this.minigl.Uniform({value:this.activeColors,type:"vec4"}),u_global:new this.minigl.Uniform({value:{noiseFreq:new this.minigl.Uniform({value:[this.freqX,this.freqY],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:5e-6})},type:"struct"}),u_vertDeform:new this.minigl.Uniform({value:{incline:new this.minigl.Uniform({value:Math.sin(this.angle)/Math.cos(this.angle)}),offsetTop:new this.minigl.Uniform({value:-.5}),offsetBottom:new this.minigl.Uniform({value:-.5}),noiseFreq:new this.minigl.Uniform({value:[3,4],type:"vec2"}),noiseAmp:new this.minigl.Uniform({value:this.amp}),noiseSpeed:new this.minigl.Uniform({value:10}),noiseFlow:new this.minigl.Uniform({value:3}),noiseSeed:new this.minigl.Uniform({value:this.seed})},type:"struct",excludeFrom:"fragment"}),u_baseColor:new this.minigl.Uniform({value:this.sectionColors[0],type:"vec3",excludeFrom:"fragment"}),u_waveLayers:new this.minigl.Uniform({value:[],excludeFrom:"fragment",type:"array"})};for(let e=1;e<this.sectionColors.length;e+=1)this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({value:{color:new this.minigl.Uniform({value:this.sectionColors[e],type:"vec3"}),noiseFreq:new this.minigl.Uniform({value:[2+e/this.sectionColors.length,3+e/this.sectionColors.length],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:11+.3*e}),noiseFlow:new this.minigl.Uniform({value:6.5+.3*e}),noiseSeed:new this.minigl.Uniform({value:this.seed+10*e}),noiseFloor:new this.minigl.Uniform({value:.1}),noiseCeil:new this.minigl.Uniform({value:.63+.07*e})},type:"struct"}));return this.vertexShader=[this.shaderFiles.noise,this.shaderFiles.blend,this.shaderFiles.vertex].join(""),new this.minigl.Material(this.vertexShader,this.shaderFiles.fragment,this.uniforms)}initMesh(){this.material=this.initMaterial(),this.geometry=new this.minigl.PlaneGeometry,this.mesh=new this.minigl.Mesh(this.geometry,this.material)}shouldSkipFrame(e){return!!window.document.hidden||parseInt(e,10)%2==0||void 0}updateFrequency(e){this.freqX+=e,this.freqY+=e}toggleColor(e){this.activeColors[e]=this.activeColors[e]===0?1:0}init(){this.playing=!0,this.initGradientColors(),this.initMesh(),this.resize(),requestAnimationFrame(this.animate)}waitForCssVars(){this.computedCanvasStyle&&this.computedCanvasStyle.getPropertyValue("--gradient-1").indexOf("#")!==-1?this.init():this.init()}initGradientColors(){this.sectionColors=["--gradient-1","--gradient-2","--gradient-3","--gradient-4"].map(e=>{let r=this.computedCanvasStyle.getPropertyValue(e).trim();return r.length===4&&(r=`#${r.substr(1).split("").map(n=>n+n).join("")}`),r&&`0x${r.substr(1)}`}).filter(Boolean).map(z6)}}function z6(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]}function nd(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}let W6=class{constructor(t,e,r){const n=this;n.canvas=t,n.gl=n.canvas.getContext("webgl",{antialias:!0}),n.meshes=[];const i=n.gl;e&&r&&this.setSize(e,r),Object.defineProperties(n,{Material:{enumerable:!1,value:class{constructor(o,a,c={}){const l=this;function p(y,E){const T=i.createShader(y);return i.shaderSource(T,E),i.compileShader(T),i.getShaderParameter(T,i.COMPILE_STATUS)||console.error(i.getShaderInfoLog(T)),T}function w(y,E){return Object.entries(y).map(([T,R])=>R.getDeclaration(T,E)).join("")}l.uniforms=c,l.uniformInstances=[];const m="precision highp float;";l.vertexSource=`${m} attribute vec4 position;attribute vec2 uv;attribute vec2 uvNorm;${w(n.commonUniforms,"vertex")} ${w(c,"vertex")} ${o}`,l.Source=`${m} ${w(n.commonUniforms,"fragment")} ${w(c,"fragment")} ${a} `,l.vertexShader=p(i.VERTEX_SHADER,l.vertexSource),l.fragmentShader=p(i.FRAGMENT_SHADER,l.Source),l.program=i.createProgram(),i.attachShader(l.program,l.vertexShader),i.attachShader(l.program,l.fragmentShader),i.linkProgram(l.program),i.getProgramParameter(l.program,i.LINK_STATUS)||console.error(i.getProgramInfoLog(l.program)),i.useProgram(l.program),l.attachUniforms(void 0,n.commonUniforms),l.attachUniforms(void 0,l.uniforms)}attachUniforms(o,a){const c=this;o===void 0?Object.entries(a).forEach(([l,p])=>{c.attachUniforms(l,p)}):a.type=="array"?a.value.forEach((l,p)=>c.attachUniforms(`${o}[${p}]`,l)):a.type=="struct"?Object.entries(a.value).forEach(([l,p])=>c.attachUniforms(`${o}.${l}`,p)):c.uniformInstances.push({uniform:a,location:i.getUniformLocation(c.program,o)})}}},Uniform:{enumerable:!1,value:class{constructor(o){this.type="float",Object.assign(this,o),this.typeFn={float:"1f",int:"1i",vec2:"2fv",vec3:"3fv",vec4:"4fv",mat4:"Matrix4fv"}[this.type]||"1f",this.update()}update(o){this.value!==void 0&&i[`uniform${this.typeFn}`](o,this.typeFn.indexOf("Matrix")===0?this.transpose:this.value,this.typeFn.indexOf("Matrix")===0?this.value:null)}getDeclaration(o,a,c){const l=this;if(l.excludeFrom!==a){if(l.type==="array")return l.value[0].getDeclaration(o,a,l.value.length)+`const int ${o}_length=${l.value.length};`;if(l.type==="struct"){let p=o.replace("u_","");return p=p.charAt(0).toUpperCase()+p.slice(1),`uniform struct ${p} {`+Object.entries(l.value).map(([w,m])=>m.getDeclaration(w,a).replace(/^uniform/,"")).join("")+`} ${o}${c>0?`[${c}]`:""};`}return`uniform ${l.type} ${o}${c>0?`[${c}]`:""};`}}}},PlaneGeometry:{enumerable:!1,value:class{constructor(o,a,c,l,p){i.createBuffer(),this.attributes={position:new n.Attribute({target:i.ARRAY_BUFFER,size:3}),uv:new n.Attribute({target:i.ARRAY_BUFFER,size:2}),uvNorm:new n.Attribute({target:i.ARRAY_BUFFER,size:2}),index:new n.Attribute({target:i.ELEMENT_ARRAY_BUFFER,size:3,type:i.UNSIGNED_SHORT})},this.setTopology(c,l),this.setSize(o,a,p)}setTopology(o=1,a=1){const c=this;c.xSegCount=o,c.ySegCount=a,c.vertexCount=(c.xSegCount+1)*(c.ySegCount+1),c.quadCount=c.xSegCount*c.ySegCount*2,c.attributes.uv.values=new Float32Array(2*c.vertexCount),c.attributes.uvNorm.values=new Float32Array(2*c.vertexCount),c.attributes.index.values=new Uint16Array(3*c.quadCount);for(let l=0;l<=c.ySegCount;l++)for(let p=0;p<=c.xSegCount;p++){const w=l*(c.xSegCount+1)+p;if(c.attributes.uv.values[2*w]=p/c.xSegCount,c.attributes.uv.values[2*w+1]=1-l/c.ySegCount,c.attributes.uvNorm.values[2*w]=p/c.xSegCount*2-1,c.attributes.uvNorm.values[2*w+1]=1-l/c.ySegCount*2,p<c.xSegCount&&l<c.ySegCount){const m=l*c.xSegCount+p;c.attributes.index.values[6*m]=w,c.attributes.index.values[6*m+1]=w+1+c.xSegCount,c.attributes.index.values[6*m+2]=w+1,c.attributes.index.values[6*m+3]=w+1,c.attributes.index.values[6*m+4]=w+1+c.xSegCount,c.attributes.index.values[6*m+5]=w+2+c.xSegCount}}c.attributes.uv.update(),c.attributes.uvNorm.update(),c.attributes.index.update()}setSize(o=1,a=1,c="xz"){const l=this;l.width=o,l.height=a,l.orientation=c,l.attributes.position.values&&l.attributes.position.values.length===3*l.vertexCount||(l.attributes.position.values=new Float32Array(3*l.vertexCount));const p=o/-2,w=a/-2,m=o/l.xSegCount,y=a/l.ySegCount;for(let E=0;E<=l.ySegCount;E++){const T=w+E*y;for(let R=0;R<=l.xSegCount;R++){const L=p+R*m,x=E*(l.xSegCount+1)+R;l.attributes.position.values[3*x+"xyz".indexOf(c[0])]=L,l.attributes.position.values[3*x+"xyz".indexOf(c[1])]=-T}}l.attributes.position.update()}}},Mesh:{enumerable:!1,value:class{constructor(o,a){const c=this;c.geometry=o,c.material=a,c.attributeInstances=[],Object.entries(c.geometry.attributes).forEach(([l,p])=>{c.attributeInstances.push({attribute:p,location:p.attach(l,c.material.program)})}),n.meshes.push(c)}draw(){i.useProgram(this.material.program),this.material.uniformInstances.forEach(({uniform:o,location:a})=>o.update(a)),this.attributeInstances.forEach(({attribute:o,location:a})=>o.use(a)),i.drawElements(i.TRIANGLES,this.geometry.attributes.index.values.length,i.UNSIGNED_SHORT,0)}remove(){n.meshes=n.meshes.filter(o=>o!=this)}}},Attribute:{enumerable:!1,value:class{constructor(o){this.type=i.FLOAT,this.normalized=!1,this.buffer=i.createBuffer(),Object.assign(this,o),this.update()}update(){this.values!==void 0&&(i.bindBuffer(this.target,this.buffer),i.bufferData(this.target,this.values,i.STATIC_DRAW))}attach(o,a){const c=i.getAttribLocation(a,o);return this.target===i.ARRAY_BUFFER&&(i.enableVertexAttribArray(c),i.vertexAttribPointer(c,this.size,this.type,this.normalized,0,0)),c}use(o){i.bindBuffer(this.target,this.buffer),this.target===i.ARRAY_BUFFER&&(i.enableVertexAttribArray(o),i.vertexAttribPointer(o,this.size,this.type,this.normalized,0,0))}}}});const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];n.commonUniforms={projectionMatrix:new n.Uniform({type:"mat4",value:s}),modelViewMatrix:new n.Uniform({type:"mat4",value:s}),resolution:new n.Uniform({type:"vec2",value:[1,1]}),aspectRatio:new n.Uniform({type:"float",value:1})}}setSize(t=640,e=480){this.width=t,this.height=e,this.canvas.width=t,this.canvas.height=e,this.gl.viewport(0,0,t,e),this.commonUniforms.resolution.value=[t,e],this.commonUniforms.aspectRatio.value=t/e}setOrthographicCamera(t=0,e=0,r=0,n=-2e3,i=2e3){this.commonUniforms.projectionMatrix.value=[2/this.width,0,0,0,0,2/this.height,0,0,0,0,2/(n-i),0,t,e,r,1]}render(){this.gl.clearColor(0,0,0,0),this.gl.clearDepth(1),this.meshes.forEach(t=>t.draw())}};const ye={CROSS_ICON:Ae`<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>`,NOISE_TEXTURE:Ae`<svg id="w3m-transparent-noise"><filter id="w3m-noise"><feTurbulence type="fractalNoise" baseFrequency="0.8"/></filter><rect width="100%" height="100%" filter="url(#w3m-noise)"/></svg>`,WALLET_CONNECT_LOGO:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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>`},q6={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"};var sr=(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))(sr||{});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"}},V6={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"}};var K6=Object.defineProperty,id=Object.getOwnPropertySymbols,G6=Object.prototype.hasOwnProperty,Z6=Object.prototype.propertyIsEnumerable,sd=(t,e,r)=>e in t?K6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Y6=(t,e)=>{for(var r in e||(e={}))G6.call(e,r)&&sd(t,r,e[r]);if(id)for(var r of id(e))Z6.call(e,r)&&sd(t,r,e[r]);return t};const ie={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET:"W3M_RECENT_WALLET",rejectStandaloneButtonComponent(){const{isStandalone:t}=te.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}=et.state;return(r=s?.[t])!=null?r:i&&n?at.getImageUrl(n):""},getWalletName(t,e=!1){const r=qr.getInjectedName(t);return e?r.split(" ")[0]:r},getChainIcon(t){var e;const r=q6[t],{projectId:n,chainImages:i}=et.state;return(e=i?.[t])!=null?e:n&&r?at.getImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=V6[t])==null?void 0:e.icon,{projectId:i,tokenImages:s}=et.state;return(r=s?.[t])!=null?r:i&&n?at.getImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=ie.MOBILE_BREAKPOINT},async preloadImage(t){return new Promise((e,r)=>{const n=new Image;n.onload=e,n.onerror=r,n.src=t})},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){const{standaloneUri:e,selectedChain:r}=te.state,{links:n,name:i}=t;function s(o){let a="";n!=null&&n.universal?a=Te.formatUniversalUrl(n.universal,o,i):n!=null&&n.native&&(a=Te.formatNativeUrl(n.native,o,i)),Te.openHref(a)}e?s(e):(await Ke.client().connectWalletConnect(o=>{s(o)},r?.id),ht.close()),ie.setRecentWallet(t)},async handleAndroidLinking(){const{standaloneUri:t,selectedChain:e}=te.state;t?Te.openHref(t):(await Ke.client().connectWalletConnect(r=>{Te.setWalletConnectAndroidDeepLink(r),Te.openHref(r)},e?.id),ht.close())},async handleUriCopy(){const{standaloneUri:t}=te.state;if(t)await navigator.clipboard.writeText(t);else{const e=Ke.client().walletConnectUri;await navigator.clipboard.writeText(e)}Nt.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=te.state;await Ke.client().connectConnector(t,r?.id),ht.close()}catch(r){e?e():Nt.openToast(ie.getErrorMessage(r),"error")}},getCustomWallets(){var t;const{desktopWallets:e,mobileWallets:r}=et.state;return(t=Te.isMobile()?r:e)!=null?t:[]},getCustomImageUrls(){const{chainImages:t,walletImages:e}=et.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},getConnectorImageUrls(){return Ke.client().getConnectors().map(({id:t})=>qr.getInjectedId(t)).map(t=>ie.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={"--color-av-1":n[0],"--color-av-2":n[1],"--color-av-3":n[2],"--color-av-4":n[3],"--color-av-5":n[4]};Object.entries(s).forEach(([o,a])=>i.style.setProperty(o,a))}},setRecentWallet(t){localStorage.setItem(ie.W3M_RECENT_WALLET,JSON.stringify(t))},getRecentWallet(){const t=localStorage.getItem(ie.W3M_RECENT_WALLET);if(t)return JSON.parse(t)},getExtensionWallets(){const t=[];for(const[e,r]of Object.entries(qr.injectedPreset))e!==sr.coinbaseWallet&&r&&r.isInjected&&!r.isDesktop&&t.push(Y6({id:e},r));return t},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())}},J6=be`#w3m-transparent-noise,.w3m-canvas,.w3m-color-placeholder,.w3m-gradient-placeholder,.w3m-highlight{inset:0;position:absolute;display:block;pointer-events:none;width:100%;height:100px;border-radius:8px 8px 0 0;transform:translateY(-5px)}.w3m-gradient-placeholder{background:linear-gradient(var(--gradient-1),var(--gradient-2),var(--gradient-3),var(--gradient-4))}.w3m-color-placeholder{background-color:var(--color-fg-accent)}.w3m-highlight{border:1px solid var(--color-overlay)}.w3m-canvas{opacity:0;transition:opacity 2s ease;box-shadow:0 8px 28px -6px rgba(10,16,31,.12),0 18px 88px -4px rgba(10,16,31,.14)}.w3m-canvas-visible{opacity:1}#w3m-transparent-noise{mix-blend-mode:multiply;opacity:.35}.w3m-toolbar{height:28px;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(--color-fg-inverse)}.w3m-action-btn{width:28px;height:28px;border-radius:50%;border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:background-color,.2s ease;background-color:var(--color-bg-1);box-shadow:0 0 0 1px var(--color-overlay),0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08)}.w3m-action-btn:hover{background-color:var(--color-bg-2)}.w3m-action-btn svg{display:block;object-position:center}.w3m-action-btn path{fill:var(--color-fg-1)}.w3m-actions{display:flex}.w3m-actions button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--color-fg-1)}.w3m-help-active button:first-child path{fill:var(--color-bg-1)}`;var X6=Object.defineProperty,Q6=Object.getOwnPropertyDescriptor,nc=(t,e,r,n)=>{for(var i=n>1?void 0:n?Q6(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&&X6(e,r,i),i};const od=new H6;let Ci=class extends de{constructor(){super(),this.open=!1,this.isHelp=!1,this.unsubscribeRouter=void 0,this.playTimeout=void 0,this.unsubscribeRouter=Re.subscribe(t=>{this.isHelp=t.view==="Help"})}firstUpdated(){const{themeBackground:t}=et.state;t==="gradient"&&(this.playTimeout=setTimeout(()=>{od.play(this.canvasEl),this.open=!0},800))}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this),clearTimeout(this.playTimeout),od.stop()}get canvasEl(){return ie.getShadowRootElement(this,".w3m-canvas")}onHelp(){Re.push("Help")}render(){const{themeBackground:t}=et.state,e={"w3m-canvas":!0,"w3m-canvas-visible":this.open},r={"w3m-actions":!0,"w3m-help-active":this.isHelp};return V`${t==="themeColor"?V`<div class="w3m-color-placeholder"></div>`:null} ${t==="gradient"?V`<div class="w3m-gradient-placeholder"></div><canvas class="${Lt(e)}"></canvas>${ye.NOISE_TEXTURE}`:null}<div class="w3m-highlight"></div><div class="w3m-toolbar">${ye.WALLET_CONNECT_LOGO}<div class="${Lt(r)}"><button class="w3m-action-btn" @click="${this.onHelp}">${ye.HELP_ICON}</button> <button class="w3m-action-btn" @click="${ht.close}">${ye.CROSS_ICON}</button></div></div>`}};Ci.styles=[le.globalCss,J6],nc([Fe()],Ci.prototype,"open",2),nc([Fe()],Ci.prototype,"isHelp",2),Ci=nc([we("w3m-modal-backcard")],Ci);const e4=be`main{padding:20px;padding-top:0;width:100%}`;var t4=Object.defineProperty,r4=Object.getOwnPropertyDescriptor,n4=(t,e,r,n)=>{for(var i=n>1?void 0:n?r4(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 ic=class extends de{render(){return V`<main><slot></slot></main>`}};ic.styles=[le.globalCss,e4],ic=n4([we("w3m-modal-content")],ic);const i4=be`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--color-bg-2)}`;var s4=Object.defineProperty,o4=Object.getOwnPropertyDescriptor,a4=(t,e,r,n)=>{for(var i=n>1?void 0:n?o4(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 sc=class extends de{render(){return V`<footer><slot></slot></footer>`}};sc.styles=[le.globalCss,i4],sc=a4([we("w3m-modal-footer")],sc);const c4=be`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--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(--color-fg-accent)}`;var l4=Object.defineProperty,u4=Object.getOwnPropertyDescriptor,Si=(t,e,r,n)=>{for(var i=n>1?void 0:n?u4(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&&l4(e,r,i),i};let Vr=class extends de{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="${Re.goBack}">${ye.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=Re.state.history.length>1,r=this.title?V`<w3m-text variant="large-bold">${this.title}</w3m-text>`:V`<slot></slot>`;return V`<header class="${Lt(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Vr.styles=[le.globalCss,c4],Si([ve()],Vr.prototype,"title",2),Si([ve()],Vr.prototype,"onAction",2),Si([ve()],Vr.prototype,"actionIcon",2),Si([ve()],Vr.prototype,"border",2),Vr=Si([we("w3m-modal-header")],Vr);const h4=be`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var d4=Object.defineProperty,f4=Object.getOwnPropertyDescriptor,oc=(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&&d4(e,r,i),i};let Di=class extends de{constructor(){super(),this.view=Re.state.view,this.prevView=Re.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Re.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&(_r(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),_r(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 ie.getShadowRootElement(this,".w3m-router")}get contentEl(){return ie.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"WalletFilter":return V`<w3m-wallet-filter-view></w3m-wallet-filter-view>`;case"Account":return V`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return V`<w3m-switch-network-view></w3m-switch-network-view>`;default:return V`<div>Not Found</div>`}}async onChangeRoute(){await _r(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15}).finished,this.view=Re.state.view}render(){return V`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};Di.styles=[le.globalCss,h4],oc([Fe()],Di.prototype,"view",2),oc([Fe()],Di.prototype,"prevView",2),Di=oc([we("w3m-modal-router")],Di);const p4=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:36px;border:1px solid var(--color-overlay);background-color:var(--color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--color-bg-3)}}.w3m-success path{fill:var(--color-fg-accent)}.w3m-error path{fill:var(--color-err)}`;var g4=Object.defineProperty,m4=Object.getOwnPropertyDescriptor,ad=(t,e,r,n)=>{for(var i=n>1?void 0:n?m4(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&&g4(e,r,i),i};let Ms=class extends de{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Nt.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Nt.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Nt.closeToast()}render(){const{message:t,variant:e}=Nt.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?V`<div class="${Lt(r)}">${e==="success"?ye.CHECKMARK_ICON:null} ${e==="error"?ye.CROSS_ICON:null}<w3m-text variant="small-normal">${t}</w3m-text></div>`:null}};Ms.styles=[le.globalCss,p4],ad([Fe()],Ms.prototype,"open",2),Ms=ad([we("w3m-modal-toast")],Ms);const w4=be`button{padding:5px;border-radius:10px;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(--color-overlay)}`;var y4=Object.defineProperty,b4=Object.getOwnPropertyDescriptor,Us=(t,e,r,n)=>{for(var i=n>1?void 0:n?b4(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&&y4(e,r,i),i};let Pn=class extends de{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-normal">${this.name}</w3m-text></button>`}};Pn.styles=[le.globalCss,w4],Us([ve()],Pn.prototype,"onClick",2),Us([ve()],Pn.prototype,"name",2),Us([ve()],Pn.prototype,"chainId",2),Pn=Us([we("w3m-network-button")],Pn);const v4=be`div{width:inherit;height:inherit}.polygon-stroke{stroke:var(--color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--color-bg-3)}#network-placeholder-dash{stroke:var(--color-overlay)}`;var _4=Object.defineProperty,E4=Object.getOwnPropertyDescriptor,cd=(t,e,r,n)=>{for(var i=n>1?void 0:n?E4(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 Fs=class extends de{constructor(){super(...arguments),this.chainId=""}render(){const t=ie.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`${ye.NETWORK_PLACEHOLDER}`}};Fs.styles=[le.globalCss,v4],cd([ve()],Fs.prototype,"chainId",2),Fs=cd([we("w3m-network-image")],Fs);const x4=.1,ld=2.5,hr=7;function ac(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+x4}function C4(t,e){const r=Array.prototype.slice.call(yi.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 S4={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",s=n==="light"?"#fff":"#141414",o=[],a=C4(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-hr)*c*T,x=(a.length-hr)*c*R,O=.32;for(let _=0;_<l.length;_+=1){const D=c*(hr-_*2);o.push(Ae`<rect fill="${_%2===0?i:s}" height="${D}" rx="${D*O}" ry="${D*O}" width="${D}" x="${L+c*_}" y="${x+c*_}">`)}});const p=Math.floor((r+25)/c),w=a.length/2-p/2,m=a.length/2+p/2-1,y=[];a.forEach((T,R)=>{T.forEach((L,x)=>{if(a[R][x]&&!(R<hr&&x<hr||R>a.length-(hr+1)&&x<hr||R<hr&&x>a.length-(hr+1))&&!(R>w&&R<m&&x>w&&x<m)){const O=R*c+c/2,_=x*c+c/2;y.push([O,_])}})});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(x=>R.every(O=>!ac(x,O,c)));return[Number(T),L]}).forEach(([T,R])=>{R.forEach(L=>{o.push(Ae`<circle cx="${T}" cy="${L}" fill="${i}" r="${c/ld}">`)})}),Object.entries(E).filter(([T,R])=>R.length>1).map(([T,R])=>{const L=R.filter(x=>R.some(O=>ac(x,O,c)));return[Number(T),L]}).map(([T,R])=>{R.sort((x,O)=>x<O?-1:1);const L=[];for(const x of R){const O=L.find(_=>_.some(D=>ac(x,D,c)));O?O.push(x):L.push([x])}return[T,L.map(x=>[x[0],x[x.length-1]])]}).forEach(([T,R])=>{R.forEach(([L,x])=>{o.push(Ae`<line x1="${T}" x2="${T}" y1="${L}" y2="${x}" stroke="${i}" stroke-width="${c/(ld/2)}" stroke-linecap="round">`)})}),o}},D4=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(--color-fg-accent)}svg:first-child path:last-child{stroke:var(--color-overlay)}`;var I4=Object.defineProperty,O4=Object.getOwnPropertyDescriptor,Ii=(t,e,r,n)=>{for(var i=n>1?void 0:n?O4(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&&I4(e,r,i),i};let Kr=class extends de{constructor(){super(...arguments),this.uri="",this.size=0,this.logoSrc="",this.walletId=""}svgTemplate(){var t;const e=(t=et.state.themeMode)!=null?t:"light";return Ae`<svg height="${this.size}" width="${this.size}">${S4.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return V`<div>${this.walletId||this.logoSrc?V`<w3m-wallet-image walletId="${Ft(this.walletId)}" src="${Ft(this.logoSrc)}"></w3m-wallet-image>`:ye.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Kr.styles=[le.globalCss,D4],Ii([ve()],Kr.prototype,"uri",2),Ii([ve({type:Number})],Kr.prototype,"size",2),Ii([ve()],Kr.prototype,"logoSrc",2),Ii([ve()],Kr.prototype,"walletId",2),Kr=Ii([we("w3m-qrcode")],Kr);const A4=be`:host{position:relative;height:28px;width:75%}input{width:100%;height:100%;line-height:28px!important;border-radius:28px;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(--color-bg-3);box-shadow:inset 0 0 0 1px var(--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(--color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--color-fg-accent)}path{fill:var(--color-fg-2)}`;var $4=Object.defineProperty,P4=Object.getOwnPropertyDescriptor,ud=(t,e,r,n)=>{for(var i=n>1?void 0:n?P4(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 Bs=class extends de{constructor(){super(...arguments),this.onChange=()=>null}render(){const t=Te.isMobile()?"Search mobile wallets":"Search desktop wallets";return V`<input type="text" @input="${this.onChange}" placeholder="${t}"><div class="w3m-placeholder">${ye.SEARCH_ICON}<w3m-text color="secondary" variant="medium-thin">${t}</w3m-text></div>`}};Bs.styles=[le.globalCss,A4],ud([ve()],Bs.prototype,"onChange",2),Bs=ud([we("w3m-search-input")],Bs);const T4=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(--color-fg-accent)}`;var R4=Object.defineProperty,N4=Object.getOwnPropertyDescriptor,L4=(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&&R4(e,r,i),i};let cc=class extends de{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=[le.globalCss,T4],cc=L4([we("w3m-spinner")],cc);const M4=be`span{font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xxsmall-bold{font-weight:700;font-size:10px;line-height:12px;letter-spacing:.02em;text-transform:uppercase}.w3m-xsmall-normal{font-weight:600;font-size:12px;line-height:14px;letter-spacing:-.03em}.w3m-small-thin{font-weight:500;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-small-normal{font-weight:600;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-medium-thin{font-weight:500;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-normal{font-weight:600;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-bold{font-weight:700;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-large-bold{font-weight:600;font-size:20px;line-height:24px;letter-spacing:-.03em}:host(*){color:var(--color-fg-1)}.w3m-color-primary{color:var(--color-fg-1)}.w3m-color-secondary{color:var(--color-fg-2)}.w3m-color-tertiary{color:var(--color-fg-3)}.w3m-color-inverse{color:var(--color-fg-inverse)}.w3m-color-accnt{color:var(--color-fg-accent)}.w3m-color-error{color:var(--color-err)}`;var U4=Object.defineProperty,F4=Object.getOwnPropertyDescriptor,lc=(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&&U4(e,r,i),i};let Oi=class extends de{constructor(){super(...arguments),this.variant="medium-normal",this.color="primary"}render(){const t={"w3m-large-bold":this.variant==="large-bold","w3m-medium-bold":this.variant==="medium-bold","w3m-medium-normal":this.variant==="medium-normal","w3m-medium-thin":this.variant==="medium-thin","w3m-small-normal":this.variant==="small-normal","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-normal":this.variant==="xsmall-normal","w3m-xxsmall-bold":this.variant==="xxsmall-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 class="${Lt(t)}"><slot></slot></span>`}};Oi.styles=[le.globalCss,M4],lc([ve()],Oi.prototype,"variant",2),lc([ve()],Oi.prototype,"color",2),Oi=lc([we("w3m-text")],Oi);const B4=be`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;inset:0;border-radius:50%;border:1px solid var(--color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--color-bg-3)}#token-placeholder-dash{stroke:var(--color-overlay)}`;var j4=Object.defineProperty,k4=Object.getOwnPropertyDescriptor,hd=(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&&j4(e,r,i),i};let js=class extends de{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=ie.getTokenIcon((t=this.symbol)!=null?t:"");return e?V`<div><img src="${e}" alt="${this.id}"></div>`:ye.TOKEN_PLACEHOLDER}};js.styles=[le.globalCss,B4],hd([ve()],js.prototype,"symbol",2),js=hd([we("w3m-token-image")],js);const H4=be`button{transition:all .2s ease;width:100%;height:100%;border-radius:10px;display:flex;align-items:flex-start}button:hover{background-color:var(--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:15px;margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var z4=Object.defineProperty,W4=Object.getOwnPropertyDescriptor,Cr=(t,e,r,n)=>{for(var i=n>1?void 0:n?W4(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&&z4(e,r,i),i};let or=class extends de{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="xxsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?V`<w3m-text class="w3m-sublabel" variant="xxsmall-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-normal">${(t=this.label)!=null?t:ie.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};or.styles=[le.globalCss,H4],Cr([ve()],or.prototype,"onClick",2),Cr([ve()],or.prototype,"name",2),Cr([ve()],or.prototype,"walletId",2),Cr([ve()],or.prototype,"label",2),Cr([ve()],or.prototype,"src",2),Cr([ve()],or.prototype,"installed",2),Cr([ve()],or.prototype,"recent",2),or=Cr([we("w3m-wallet-button")],or);const q4=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(--color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--color-bg-3)}#wallet-placeholder-dash{stroke:var(--color-overlay)}`;var V4=Object.defineProperty,K4=Object.getOwnPropertyDescriptor,uc=(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 Ai=class extends de{constructor(){super(...arguments),this.walletId=void 0,this.src=void 0}render(){var t;const e=ie.getWalletId((t=this.walletId)!=null?t:""),r=ie.getWalletId(e),n=this.src?this.src:ie.getWalletIcon(r);return V`${n.length?V`<div><img src="${n}" alt="${this.id}"></div>`:ye.WALLET_PLACEHOLDER}`}};Ai.styles=[le.globalCss,q4],uc([ve()],Ai.prototype,"walletId",2),uc([ve()],Ai.prototype,"src",2),Ai=uc([we("w3m-wallet-image")],Ai);const G4=be`:host{all:initial}div{display:flex;align-items:center;background-color:var(--color-overlay);box-shadow:inset 0 0 0 1px var(--color-overlay);border-radius:10px;padding:4px 4px 4px 8px}div button{border-radius:16px;padding:4px 8px 4px 4px;height:auto;margin-left:10px;color:var(--color-fg-inverse);background-color:var(--color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--color-overlay)}button:hover::after{background-color:var(--color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var Z4=Object.defineProperty,Y4=Object.getOwnPropertyDescriptor,dd=(t,e,r,n)=>{for(var i=n>1?void 0:n?Y4(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&&Z4(e,r,i),i};let $i=class extends de{constructor(){super(),this.balance="hide",ie.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=te.state;t||ht.open({route:"Account"})}accountTemplate(){return V`<w3m-avatar></w3m-avatar><w3m-address-text></w3m-address-text>`}render(){return this.balance==="show"?V`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}">${this.accountTemplate()}</button></div>`:V`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};$i.styles=[le.globalCss,G4],dd([ve()],$i.prototype,"balance",2),$i=dd([we("w3m-account-button")],$i);const J4=be`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--color-overlay)}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var X4=Object.defineProperty,Q4=Object.getOwnPropertyDescriptor,hc=(t,e,r,n)=>{for(var i=n>1?void 0:n?Q4(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&&X4(e,r,i),i};let Pi=class extends de{constructor(){super(),this.chainId="",this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=te.state;this.chainId=t?.id.toString(),this.label=t?.name,this.unsubscribeNetwork=te.subscribe(({selectedChain:e})=>{this.chainId=e?.id.toString(),this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){Re.push("SelectNetwork")}render(){const{chains:t}=te.state,e=t&&t.length>1;return V`<button @click="${this.onClick}" ?disabled="${!e}"><w3m-network-image chainId="${Ft(this.chainId)}"></w3m-network-image><w3m-text variant="xsmall-normal" color="accent">${this.label}</w3m-text></button>`}};Pi.styles=[le.globalCss,J4],hc([Fe()],Pi.prototype,"chainId",2),hc([Fe()],Pi.prototype,"label",2),Pi=hc([we("w3m-account-network-button")],Pi);const e8=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(--color-fg-1) 36.33%,var(--color-fg-3) 42.07%,var(--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 t8=Object.defineProperty,r8=Object.getOwnPropertyDescriptor,Ti=(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 Gr=class extends de{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=te.state.address,this.name=te.state.profileName,this.loading=Boolean(te.state.profileLoading),this.unsubscribeAccount=te.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=Boolean(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="${Lt(r)}" variant="${e?"medium-normal":"large-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:ie.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};Gr.styles=[le.globalCss,e8],Ti([Fe()],Gr.prototype,"address",2),Ti([Fe()],Gr.prototype,"name",2),Ti([Fe()],Gr.prototype,"loading",2),Ti([ve()],Gr.prototype,"variant",2),Gr=Ti([we("w3m-address-text")],Gr);const n8=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(--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}`;var i8=Object.defineProperty,s8=Object.getOwnPropertyDescriptor,o8=(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 dc=class extends de{onGoToQrcode(){Re.push("Qrcode")}onGoToGetWallet(){Re.push("GetWallet")}render(){const{previewWallets:t}=at.state,e=t.length,r=[...t,...t];return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ye.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content>${e?V`<div class="w3m-slider"><div class="w3m-track">${r.map(({image_url:n})=>V`<w3m-wallet-image src="${n.lg}"></w3m-wallet-image>`)}</div></div>`:null}<div class="w3m-action"><w3m-button-big @click="${ie.handleAndroidLinking}"><w3m-text variant="medium-normal" color="inverse">Select Wallet</w3m-text></w3m-button-big><w3m-button-big variant="secondary" @click="${this.onGoToGetWallet}"><w3m-text variant="medium-normal" color="accent">I don’t have a wallet</w3m-text></w3m-button-big></div></w3m-modal-content>`}};dc.styles=[le.globalCss,n8],dc=o8([we("w3m-android-wallet-selection")],dc);const a8=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(--color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--color-av-1);background-image:radial-gradient(at 66% 77%,var(--color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--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 c8=Object.defineProperty,l8=Object.getOwnPropertyDescriptor,Ri=(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&&c8(e,r,i),i};let Zr=class extends de{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=te.state.address,this.avatar=te.state.profileAvatar,this.loading=Boolean(te.state.profileLoading),this.unsubscribeAccount=te.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=Boolean(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="${Lt(t)}" src="${this.avatar}">`:this.address?(ie.generateAvatarColors(this.address),V`<div class="${Lt(t)}">${this.loading?V`<div class="w3m-loader"></div>`:null}</div>`):null}};Zr.styles=[le.globalCss,a8],Ri([Fe()],Zr.prototype,"address",2),Ri([Fe()],Zr.prototype,"avatar",2),Ri([Fe()],Zr.prototype,"loading",2),Ri([ve()],Zr.prototype,"size",2),Zr=Ri([we("w3m-avatar")],Zr);const u8=be`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var h8=Object.defineProperty,d8=Object.getOwnPropertyDescriptor,fc=(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&&h8(e,r,i),i};let Ni=class extends de{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=te.state.balance)==null?void 0:t.symbol,this.amount=(e=te.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=te.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),this.amount&&this.amount.length>6&&(t=parseFloat(this.amount).toFixed(3)),V`<div><w3m-token-image symbol="${Ft(this.symbol)}"></w3m-token-image><w3m-text variant="medium-normal" color="primary">${t} ${this.symbol}</w3m-text></div>`}};Ni.styles=[le.globalCss,u8],fc([Fe()],Ni.prototype,"symbol",2),fc([Fe()],Ni.prototype,"amount",2),Ni=fc([we("w3m-balance")],Ni);const f8=be`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--color-fg-inverse)}button:disabled svg path{fill:var(--color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var p8=Object.defineProperty,g8=Object.getOwnPropertyDescriptor,ks=(t,e,r,n)=>{for(var i=n>1?void 0:n?g8(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 Yr=class extends de{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,ie.rejectStandaloneButtonComponent(),this.modalUnsub=ht.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"?ye.WALLET_CONNECT_ICON:null}onOpen(){this.loading=!0;const{enableNetworkView:t}=et.state,{chains:e,selectedChain:r}=te.state,n=e?.length&&e.length>1;t||n&&!r?ht.open({route:"SelectNetwork"}):ht.open({route:"ConnectWallet"})}render(){return V`<w3m-button-big .disabled="${this.loading}" @click="${this.onOpen}">${this.loading?V`<w3m-spinner></w3m-spinner><w3m-text variant="medium-normal" color="accent">Connecting...</w3m-text>`:V`${this.iconTemplate()}<w3m-text variant="medium-normal" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};Yr.styles=[le.globalCss,f8],ks([Fe()],Yr.prototype,"loading",2),ks([ve()],Yr.prototype,"label",2),ks([ve()],Yr.prototype,"icon",2),Yr=ks([we("w3m-connect-button")],Yr);var m8=Object.defineProperty,w8=Object.getOwnPropertyDescriptor,Li=(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 Jr=class extends de{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.balance="hide",this.unsubscribeAccount=void 0,ie.rejectStandaloneButtonComponent(),this.isConnected=te.state.isConnected,this.unsubscribeAccount=te.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){return this.isConnected?V`<w3m-account-button balance="${Ft(this.balance)}"></w3m-account-button>`:V`<w3m-connect-button label="${Ft(this.label)}" icon="${Ft(this.icon)}"></w3m-connect-button>`}};Li([Fe()],Jr.prototype,"isConnected",2),Li([ve()],Jr.prototype,"label",2),Li([ve()],Jr.prototype,"icon",2),Li([ve()],Jr.prototype,"balance",2),Jr=Li([we("w3m-core-button")],Jr);const Zt={allowedExplorerListings(t){const{explorerAllowList:e,explorerDenyList:r}=et.state;let n=[...t];return e!=null&&e.length&&(n=n.filter(i=>e.includes(i.id))),r!=null&&r.length&&(n=n.filter(i=>!r.includes(i.id))),n},walletsWithInjected(t){let e=[...t??[]];if(window.ethereum){const r=ie.getWalletName("");e=e.filter(({name:n})=>!ie.caseSafeIncludes(n,r))}return e},connectorWallets(){const{isStandalone:t}=te.state;if(t)return[];let e=Ke.client().getConnectors();return!window.ethereum&&Te.isMobile()&&(e=e.filter(({id:r})=>r!=="injected"&&r!==sr.metaMask)),e},walletTemplatesWithRecent(t,e){let r=[...t];if(e){const n=ie.getRecentWallet();r=r.filter(i=>!i.values.includes(n?.name)),r.splice(1,0,e)}return r},deduplicateExplorerListingsFromConnectors(t){const{isStandalone:e}=te.state;if(e)return t;const r=Ke.client().getConnectors().map(({name:n})=>n.toUpperCase());return t.filter(({name:n})=>!r.includes(n.toUpperCase()))}},y8=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(--color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--color-fg-accent)}`;var b8=Object.defineProperty,v8=Object.getOwnPropertyDescriptor,_8=(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 pc=class extends de{onDesktopWallet(t){Re.push("DesktopConnector",{DesktopConnector:t})}onInjectedWallet(){Re.push("InjectedConnector")}onInstallConnector(){Re.push("InstallConnector",{InstallConnector:{id:"metaMask",name:"MetaMask",isMobile:!0,url:"https://metamask.io"}})}async onConnectorWallet(t){window.ethereum?t==="injected"||t===sr.metaMask?this.onInjectedWallet():await ie.handleConnectorConnection(t):this.onInstallConnector()}desktopWalletsTemplate(){const{desktopWallets:t}=et.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=Zt.allowedExplorerListings(at.state.previewWallets);return t=Zt.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 Zt.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=ie.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Ft(e)}" src="${Ft(i)}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n?.universal,native:n?.native,icon:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=te.state,e=this.desktopWalletsTemplate(),r=this.previewWalletsTemplate(),n=this.connectorWalletsTemplate(),i=this.recentWalletTemplate(),s=e??r;let o=[...n,...s];o=Zt.walletTemplatesWithRecent(o,i);const a=t?s:o,c=a.length>4;let l=[];c?l=a.filter(w=>!w.values.includes(sr.coinbaseWallet)).slice(0,3):l=a;const p=Boolean(l.length);return V`<w3m-modal-header border="${!0}" title="Connect your wallet" .onAction="${ie.handleUriCopy}" .actionIcon="${ye.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${ye.MOBILE_ICON}<w3m-text variant="small-normal" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${ye.SCAN_ICON}<w3m-text variant="small-normal" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${p?V`<w3m-modal-footer><div class="w3m-desktop-title">${ye.DESKTOP_ICON}<w3m-text variant="small-normal" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${l} ${c?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};pc.styles=[le.globalCss,y8],pc=_8([we("w3m-desktop-wallet-selection")],pc);const E8=be`div{background-color:var(--color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--color-bg-3);text-align:center}a{color:var(--color-fg-accent);text-decoration:none;transition:opacity .2s ease-in-out}a:hover{opacity:.8}`;var x8=Object.defineProperty,C8=Object.getOwnPropertyDescriptor,S8=(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&&x8(e,r,i),i};let gc=class extends de{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=et.state;return t??e?V`<div><w3m-text variant="small-normal" color="secondary">By connecting your wallet, you agree to our<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}};gc.styles=[le.globalCss,E8],gc=S8([we("w3m-legal-notice")],gc);const D8=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var I8=Object.defineProperty,O8=Object.getOwnPropertyDescriptor,A8=(t,e,r,n)=>{for(var i=n>1?void 0:n?O8(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 mc=class extends de{onGoToQrcode(){Re.push("Qrcode")}async onConnectorWallet(t){await ie.handleConnectorConnection(t)}mobileWalletsTemplate(){const{mobileWallets:t}=et.state,e=Zt.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()=>ie.handleMobileLinking({links:{native:s,universal:i},name:n,id:r})}"></w3m-wallet-button>`)}previewWalletsTemplate(){const{previewWallets:t}=at.state;let e=Zt.walletsWithInjected(t);return e=Zt.allowedExplorerListings(e),e=Zt.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()=>ie.handleMobileLinking({links:{native:i,universal:s},name:n,id:o,image:r.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){let t=Zt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==sr.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=ie.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Ft(e)}" src="${Ft(i)}" .onClick="${async()=>ie.handleMobileLinking({name:r,id:e,links:n,image:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=te.state,e=this.connectorWalletsTemplate(),r=this.mobileWalletsTemplate(),n=this.previewWalletsTemplate(),i=this.recentWalletTemplate(),s=r??n;let o=[...e,...s];o=Zt.walletTemplatesWithRecent(o,i);const a=t?s:o,c=a.length>8;let l=[];c?l=a.filter(y=>!y.values.includes(sr.coinbaseWallet)).slice(0,7):l=a;const p=l.slice(0,4),w=l.slice(4,8),m=Boolean(l.length);return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ye.QRCODE_ICON}"></w3m-modal-header>${m?V`<w3m-modal-content><div class="w3m-grid">${p} ${w.length?V`${w} ${c?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}`:null}</div></w3m-modal-content>`:null}`}};mc.styles=[le.globalCss,D8],mc=A8([we("w3m-mobile-wallet-selection")],mc);const $8=be`:host{all:initial}.w3m-overlay{inset:0;position:fixed;z-index:var(--modal-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}.w3m-open{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0}.w3m-card{width:100%;position:relative;transform:translateY(5px);border-radius:30px;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(--color-overlay);background-color:var(--color-bg-1);color:var(--color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{transform:translateY(5px);border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}`;var P8=Object.defineProperty,T8=Object.getOwnPropertyDescriptor,Hs=(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 Xr=class extends de{constructor(){if(super(),this.open=!1,this.preload=!0,this.activeChainId=void 0,this.unsubscribeModal=void 0,this.unsubscribeConfig=void 0,this.unwatchAccount=void 0,this.unwatchNetwork=void 0,this.abortController=void 0,le.setTheme(),this.unsubscribeConfig=et.subscribe(le.setTheme),this.unsubscribeModal=ht.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()}),!te.state.isStandalone){te.getAccount();const t=te.getSelectedChain();this.activeChainId=t?.id,this.fetchEnsProfile(),this.fetchBalance(),this.unwatchNetwork=Ke.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(te.setSelectedChain(r),this.activeChainId=r.id,te.resetBalance(),this.fetchBalance())}),this.unwatchAccount=Ke.client().watchAccount(e=>{const{address:r}=te.state;e.address!==r&&(this.fetchEnsProfile(e.address),this.fetchBalance(e.address)),te.setAddress(e.address),te.setIsConnected(e.isConnected)})}this.preloadModalData()}disconnectedCallback(){var t,e,r,n;(t=this.unsubscribeModal)==null||t.call(this),(e=this.unsubscribeConfig)==null||e.call(this),(r=this.unwatchAccount)==null||r.call(this),(n=this.unwatchNetwork)==null||n.call(this)}get overlayEl(){return ie.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return ie.getShadowRootElement(this,".w3m-container")}async fetchEnsProfile(t){try{te.setProfileLoading(!0);const e=t??te.state.address,{id:r}=Ke.client().getDefaultChain();if(e&&r===1){const[n,i]=await Promise.all([Ke.client().fetchEnsName({address:e,chainId:1}),Ke.client().fetchEnsAvatar({address:e,chainId:1})]);i&&await ie.preloadImage(i),te.setProfileName(n),te.setProfileAvatar(i)}}catch(e){Nt.openToast(ie.getErrorMessage(e),"error")}finally{te.setProfileLoading(!1)}}async fetchBalance(t){try{te.setBalanceLoading(!0);const e=t??te.state.address;if(e){const r=await Ke.client().fetchBalance({address:e});te.setBalance({amount:r.formatted,symbol:r.symbol})}}catch(e){Nt.openToast(ie.getErrorMessage(e),"error")}finally{te.setBalanceLoading(!1)}}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>'))}async preloadExplorerData(){var t;const{standaloneChains:e,chains:r,isExplorer:n}=te.state;if(n){const i=e?.join(",");await Promise.all([at.getPreviewWallets({page:1,entries:10,chains:i,device:Te.isMobile()?"mobile":"desktop",version:Te.getWalletConnectVersion()}),at.getRecomendedWallets()]),te.setIsDataLoaded(!0);const{previewWallets:s,recomendedWallets:o}=at.state,a=(t=r?.map(l=>ie.getChainIcon(l.id)))!=null?t:[],c=[...s,...o].map(l=>l.image_url.lg);await this.preloadExplorerImages([...a,...c])}else te.setIsDataLoaded(!0)}async preloadExplorerImages(t){t.length&&await Promise.all(t.map(async e=>ie.preloadImage(e)))}async preloadCustomImages(){const t=ie.getCustomImageUrls();t.length&&await Promise.all(t.map(async e=>ie.preloadImage(e)))}async preloadConnectorImages(){const t=ie.getConnectorImageUrls();t.length&&await Promise.all(t.map(async e=>ie.preloadImage(e)))}async preloadModalData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadExplorerData(),this.preloadCustomImages(),this.preloadConnectorImages()]))}catch{Nt.openToast("Failed preloading","error")}}onCloseModal(t){t.target===t.currentTarget&&ht.close()}async onOpenModalEvent(){await this.preloadModalData(),this.toggleBodyScroll(!1);const t=.2;await _r(this.containerEl,{y:0},{duration:0}).finished,_r(this.overlayEl,{opacity:[0,1]},{duration:.2,delay:t}),_r(this.containerEl,ie.isMobileAnimation()?{y:["50vh",0]}:{scale:[.98,1]},{scale:{easing:Ds({velocity:.4})},y:{easing:Ds({mass:.5})},delay:t}),this.addKeyboardEvents(),this.open=!0}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents(),await Promise.all([_r(this.containerEl,ie.isMobileAnimation()?{y:[0,"50vh"]}:{scale:[1,.98]},{scale:{easing:Ds({velocity:0})},y:{easing:Ds({mass:.5})}}).finished,_r(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"?ht.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}render(){const t={"w3m-overlay":!0,"w3m-open":this.open};return V`<div id="w3m-modal" class="${Lt(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>`}};Xr.styles=[le.globalCss,$8],Hs([Fe()],Xr.prototype,"open",2),Hs([Fe()],Xr.prototype,"preload",2),Hs([Fe()],Xr.prototype,"activeChainId",2),Xr=Hs([we("w3m-modal")],Xr);const R8=be`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var N8=Object.defineProperty,L8=Object.getOwnPropertyDescriptor,zs=(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&&N8(e,r,i),i};let Qr=class extends de{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,ie.rejectStandaloneButtonComponent();const{selectedChain:t}=te.state;this.onSetChainData(t),this.unsubscribeNetwork=te.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=te.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(){ht.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=te.state,r=e&&e.length>1;return V`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${Ft(this.chainId)}"></w3m-network-image><w3m-text variant="medium-normal" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};Qr.styles=[le.globalCss,R8],zs([Fe()],Qr.prototype,"chainId",2),zs([Fe()],Qr.prototype,"label",2),zs([Fe()],Qr.prototype,"wrongNetwork",2),Qr=zs([we("w3m-network-switch")],Qr);const M8=be`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:10px;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:15px;justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--color-bg-2);box-shadow:inset 0 0 0 1px var(--color-overlay)}button:hover{background-color:var(--color-overlay)}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:8px;border:1px solid var(--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(--color-bg-3)}#wallet-placeholder-dash{stroke:var(--color-overlay)}`;var U8=Object.defineProperty,F8=Object.getOwnPropertyDescriptor,B8=(t,e,r,n)=>{for(var i=n>1?void 0:n?F8(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 wc=class extends de{onClick(t,e){t?Re.push("WalletExplorer"):e&&Re.push("WalletFilter")}render(){const{previewWallets:t}=at.state,e=ie.getCustomWallets(),r=[...t].reverse().slice(0,4),n=[...e].reverse().slice(0,4),i=Boolean(r.length),s=Boolean(n.length);return V`<button @click="${()=>this.onClick(i,s)}"><div class="w3m-icons">${i?r.map(o=>V`<img src="${o.image_url.lg}">`):null} ${s?n.map(o=>{const a=ie.getWalletId(o.id),c=ie.getWalletIcon(a);return c?V`<img src="${c}">`:ye.WALLET_PLACEHOLDER}):null}</div><w3m-text variant="xsmall-normal">View All</w3m-text></button>`}};wc.styles=[le.globalCss,M8],wc=B8([we("w3m-view-all-wallets-button")],wc);const j8=be`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var k8=Object.defineProperty,H8=Object.getOwnPropertyDescriptor,fd=(t,e,r,n)=>{for(var i=n>1?void 0:n?H8(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&&k8(e,r,i),i};let Ws=class extends de{constructor(){super(),this.uri="",this.createConnectionAndWait()}get overlayEl(){return ie.getShadowRootElement(this,".w3m-qr-container")}async createConnectionAndWait(t=0){var e;try{const{standaloneUri:r}=te.state;r?setTimeout(()=>this.uri=r,0):(await Ke.client().connectWalletConnect(n=>this.uri=n,(e=te.state.selectedChain)==null?void 0:e.id),ht.close())}catch{Nt.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>`}};Ws.styles=[le.globalCss,j8],fd([Fe()],Ws.prototype,"uri",2),Ws=fd([we("w3m-walletconnect-qr")],Ws);const z8=be`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--color-bg-2);box-shadow:inset 0 0 0 1px var(--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(--color-success);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--color-success),inset 0 0 0 1px var(--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(--color-bg-2);padding:11px 20px}`;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 yc=class extends de{onDisconnect(){ht.close(),Ke.client().disconnect(),te.resetAccount()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=te.state.address)!=null?t:""),Nt.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-normal" 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="${ye.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${ye.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};yc.styles=[le.globalCss,z8],yc=V8([we("w3m-account-view")],yc);var K8=Object.defineProperty,G8=Object.getOwnPropertyDescriptor,Z8=(t,e,r,n)=>{for(var i=n>1?void 0:n?G8(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&&K8(e,r,i),i};let bc=class extends de{viewTemplate(){return Te.isAndroid()?V`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Te.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>`}};bc.styles=[le.globalCss],bc=Z8([we("w3m-connect-wallet-view")],bc);const Y8=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:15px;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 J8=Object.defineProperty,X8=Object.getOwnPropertyDescriptor,pd=(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 qs=class extends de{constructor(){super(),this.uri="",this.createConnectionAndWait()}getRouterData(){var t;const e=(t=Re.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=Te.formatNativeUrl(e,t,n);Te.openHref(i)}else if(r){const i=Te.formatUniversalUrl(r,t,n);Te.openHref(i,"_blank")}}async createConnectionAndWait(t=0){var e;const{standaloneUri:r}=te.state;if(r)this.onFormatAndRedirect(r);else try{await Ke.client().connectWalletConnect(c=>{this.uri=c,this.onFormatAndRedirect(c)},(e=te.state.selectedChain)==null?void 0:e.id);const{name:n,walletId:i,native:s,universal:o,icon:a}=this.getRouterData();ie.setRecentWallet({name:n,id:i,links:{native:s,universal:o},image:a}),ht.close()}catch{Nt.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}onConnectWithMobile(){Re.push("Qrcode")}onGoToWallet(){const{universal:t,name:e}=this.getRouterData();if(t){const r=Te.formatUniversalUrl(t,this.uri,e);Te.openHref(r,"_blank")}}render(){const{name:t,icon:e,universal:r,walletId:n}=this.getRouterData(),i=ie.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="${Ft(n)}"></w3m-wallet-image>`}<div class="w3m-connecting-title"><w3m-spinner></w3m-spinner><w3m-text variant="large-bold" color="secondary">${`Continue in ${i}...`}</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${async()=>this.createConnectionAndWait()}" .iconRight="${ye.RETRY_ICON}">Retry</w3m-button>${r?V`<w3m-button .onClick="${this.onGoToWallet.bind(this)}" .iconLeft="${ye.ARROW_UP_RIGHT_ICON}">Go to Wallet</w3m-button>`:V`<w3m-button .onClick="${this.onConnectWithMobile}" .iconLeft="${ye.MOBILE_ICON}">Connect with Mobile</w3m-button>`}</div></div></w3m-modal-content>`}};qs.styles=[le.globalCss,Y8],pd([Fe()],qs.prototype,"uri",2),qs=pd([we("w3m-desktop-connector-view")],qs);const Q8=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(--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(--color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var e_=Object.defineProperty,t_=Object.getOwnPropertyDescriptor,r_=(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 vc=class extends de{constructor(){super(...arguments),this.explorerUrl="https://explorer.walletconnect.com/"}onGet(t){Te.openHref(t,"_blank")}onExplore(){Te.openHref(this.explorerUrl,"_blank")}render(){const{recomendedWallets:t}=at.state,e=ie.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-normal">${i}</w3m-text><w3m-button .iconRight="${ye.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-normal">${i}</w3m-text><w3m-button .iconRight="${ye.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-normal">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="${this.onExplore.bind(this)}" .iconRight="${ye.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};vc.styles=[le.globalCss,Q8],vc=r_([we("w3m-get-wallet-view")],vc);const n_=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(--color-overlay)}`;var i_=Object.defineProperty,s_=Object.getOwnPropertyDescriptor,o_=(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 _c=class extends de{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){Re.push("GetWallet")}onLearnMore(){Te.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">${ye.HELP_CHART_IMG} ${ye.HELP_PAINTING_IMG} ${ye.HELP_ETH_IMG}</div><w3m-text variant="medium-normal">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">${ye.HELP_KEY_IMG} ${ye.HELP_USER_IMG} ${ye.HELP_LOCK_IMG}</div><w3m-text variant="medium-normal">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">${ye.HELP_COMPAS_IMG} ${ye.HELP_NOUN_IMG} ${ye.HELP_DAO_IMG}</div><w3m-text variant="medium-normal">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="${ye.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${ye.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};_c.styles=[le.globalCss,n_],_c=o_([we("w3m-help-view")],_c);const a_=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:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-injected-error w3m-button{opacity:1}`;var c_=Object.defineProperty,l_=Object.getOwnPropertyDescriptor,Ec=(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&&c_(e,r,i),i};let Mi=class extends de{constructor(){super(),this.connecting=!0,this.error=!1,this.connector=Ke.client().getConnectorById("injected"),this.onConnect()}async onConnect(){const{ready:t}=this.connector;t&&(this.error=!1,this.connecting=!0,await ie.handleConnectorConnection("injected",()=>{this.error=!0,this.connecting=!1}))}render(){const t=ie.getWalletName(this.connector.name),e=ie.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="${Lt(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="large-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="${ye.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Mi.styles=[le.globalCss,a_],Ec([Fe()],Mi.prototype,"connecting",2),Ec([Fe()],Mi.prototype,"error",2),Mi=Ec([we("w3m-injected-connector-view")],Mi);const u_=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 h_=Object.defineProperty,d_=Object.getOwnPropertyDescriptor,f_=(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&&h_(e,r,i),i};let xc=class extends de{getRouterData(){var t;const e=(t=Re.state.data)==null?void 0:t.InstallConnector;if(!e)throw new Error("Missing router data");return e}onInstall(){const{url:t}=this.getRouterData();Te.openHref(t,"_blank")}onMobile(){const{name:t}=this.getRouterData();Re.push("ConnectWallet"),Nt.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="large-bold">Install ${t}</w3m-text><w3m-text color="secondary" variant="medium-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="${ye.ARROW_DOWN_ICON}">Install Extension</w3m-button>${r?V`<w3m-button .onClick="${this.onMobile.bind(this)}" .iconLeft="${ye.MOBILE_ICON}">${t} Mobile</w3m-button>`:null}</div></div></w3m-modal-content>`}};xc.styles=[le.globalCss,u_],xc=f_([we("w3m-install-connector-view")],xc);var p_=Object.defineProperty,g_=Object.getOwnPropertyDescriptor,m_=(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&&p_(e,r,i),i};let Cc=class extends de{render(){return V`<w3m-modal-header title="Scan the code" .onAction="${ie.handleUriCopy}" .actionIcon="${ye.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Cc.styles=[le.globalCss],Cc=m_([we("w3m-qrcode-view")],Cc);const w_=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}`;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 Sc=class extends de{onSelectChain(t){const{isConnected:e,selectedChain:r}=te.state;e?r?.id===t.id?Re.replace("Account"):Re.push("SwitchNetwork",{SwitchNetwork:t}):(Re.push("ConnectWallet"),te.setSelectedChain(t))}render(){const{chains:t}=te.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="${()=>this.onSelectChain(e)}">${e.name}</w3m-network-button>`)}</div></w3m-modal-content>`}};Sc.styles=[le.globalCss,w_],Sc=v_([we("w3m-select-network-view")],Sc);const __=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 E_=Object.defineProperty,x_=Object.getOwnPropertyDescriptor,gd=(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 Vs=class extends de{constructor(){super(),this.error=!1,this.onSwitchNetwork()}getRouterData(){var t;const e=(t=Re.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 Ke.client().switchNetwork({chainId:t.id}),te.setSelectedChain(t),Re.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="${Lt(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="large-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="${ye.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Vs.styles=[le.globalCss,__],gd([Fe()],Vs.prototype,"error",2),Vs=gd([we("w3m-switch-network-view")],Vs);const C_=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(--color-bg-1);background:linear-gradient(var(--color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--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 S_=Object.defineProperty,D_=Object.getOwnPropertyDescriptor,Ui=(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};const Dc=40;let en=class extends de{constructor(){super(...arguments),this.loading=!at.state.wallets.listings.length,this.firstFetch=!at.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=ie.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,at.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),at.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return ie.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}=at.state,{listings:r,total:n}=this.search?e:t;return n<=Dc||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r}=at.state,n=ie.getExtensionWallets(),{listings:i,total:s,page:o}=this.search?r:e;if(!this.endReached&&(this.firstFetch||s>Dc&&i.length<s))try{this.loading=!0;const a=(t=te.state.standaloneChains)==null?void 0:t.join(","),{listings:c}=await at.getPaginatedWallets({page:this.firstFetch?1:o+1,entries:Dc,device:Te.isMobile()?"mobile":"desktop",search:this.search,version:Te.getWalletConnectVersion(),chains:a}),l=c.map(({image_url:w})=>w.lg),p=n.map(({id:w})=>ie.getWalletIcon(w));await Promise.all([...l.map(async w=>ie.preloadImage(w)),...p.map(async w=>ie.preloadImage(w)),Te.wait(300)]),this.endReached=this.isLastPage()}catch(a){Nt.openToast(ie.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}async onConnectPlatform(t){if(Te.isMobile()){const{id:e,image_url:r}=t,{native:n,universal:i}=t.mobile;await ie.handleMobileLinking({links:{native:n,universal:i},name:t.name,id:e,image:r.lg})}else Re.push("DesktopConnector",{DesktopConnector:{name:t.name,icon:t.image_url.lg,universal:t.desktop.universal||t.homepage,native:t.desktop.native}})}onConnectExtension(t){ie.getWalletId("")===t.id?Re.push("InjectedConnector"):Re.push("InstallConnector",{InstallConnector:t})}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}coinbaseConnectorTemplate(){try{const t=Ke.client().getConnectorById(sr.coinbaseWallet);return V`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${async()=>ie.handleConnectorConnection(sr.coinbaseWallet)}"></w3m-wallet-button>`}catch{return null}}render(){const{wallets:t,search:e}=at.state,{isStandalone:r}=te.state;let{listings:n}=this.search?e:t;n=Zt.allowedExplorerListings(n);const i=this.loading&&!n.length,s=this.search.length>=3,o=!i&&(!s||ie.caseSafeIncludes(sr.coinbaseWallet,this.search));let a=!r&&!Te.isMobile()?ie.getExtensionWallets():[];s&&(a=a.filter(({name:w})=>ie.caseSafeIncludes(w,this.search)));const c=!this.loading&&!n.length&&!a.length&&!o,l=Math.max(a.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="${Lt(p)}"><div class="w3m-grid">${i?null:[...Array(l)].map((w,m)=>V`${a[m]?V`<w3m-wallet-button name="${a[m].name}" walletId="${a[m].id}" .onClick="${()=>this.onConnectExtension(a[m])}"></w3m-wallet-button>`:null} ${n[m]?V`<w3m-wallet-button src="${n[m].image_url.lg}" name="${n[m].name}" walletId="${n[m].id}" .onClick="${async()=>this.onConnectPlatform(n[m])}"></w3m-wallet-button>`:null}`)} ${o?this.coinbaseConnectorTemplate():null}</div><div class="w3m-placeholder-block">${c?V`<w3m-text variant="large-bold" color="secondary">No results found</w3m-text>`:null} ${!c&&this.loading?V`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};en.styles=[le.globalCss,C_],Ui([Fe()],en.prototype,"loading",2),Ui([Fe()],en.prototype,"firstFetch",2),Ui([Fe()],en.prototype,"search",2),Ui([Fe()],en.prototype,"endReached",2),en=Ui([we("w3m-wallet-explorer-view")],en);const I_=be`w3m-modal-content{display:flex;max-height:55vh;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}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(--color-bg-1);background:linear-gradient(var(--color-bg-1),transparent)}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--color-bg-1);background:linear-gradient(transparent,var(--color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var O_=Object.defineProperty,A_=Object.getOwnPropertyDescriptor,md=(t,e,r,n)=>{for(var i=n>1?void 0:n?A_(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 Ks=class extends de{constructor(){super(...arguments),this.search=""}async onConnectPlatform({name:t,universal:e,native:r,walletId:n}){Te.isMobile()?await ie.handleMobileLinking({links:{native:r,universal:e},name:t,id:n}):Re.push("DesktopConnector",{DesktopConnector:{name:t,walletId:n,universal:e,native:r}})}onSearchChange(t){const{value:e}=t.target;this.search=e}render(){const t=ie.getCustomWallets(),e=this.search.length?t.filter(r=>ie.caseSafeIncludes(r.name,this.search)):t;return V`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${e.map(({id:r,name:n,links:{native:i,universal:s}})=>V`<w3m-wallet-button walletId="${r}" name="${n}" .onClick="${async()=>this.onConnectPlatform({name:n,universal:s,native:i,walletId:r})}"></w3m-wallet-button>`)}</div></w3m-modal-content>`}};Ks.styles=[le.globalCss,I_],md([Fe()],Ks.prototype,"search",2),Ks=md([we("w3m-wallet-filter-view")],Ks);var $_=Object.freeze({__proto__:null,get W3mAccountButton(){return $i},get W3mConnectButton(){return Yr},get W3mCoreButton(){return Jr},get W3mModal(){return Xr},get W3mNetworkSwitch(){return Qr}});Or.EthereumProvider=Ib,Or.default=ws,Object.defineProperty(Or,"__esModule",{value:!0})});
|
|
130
|
+
vec3 blendNormal(vec3 base, vec3 blend){return blend;}vec3 blendNormal(vec3 base,vec3 blend,float opacity){return (blendNormal(base,blend)*opacity+base*(1.0-opacity));}float blendScreen(float base,float blend){return 1.0-((1.0-base)*(1.0-blend));}vec3 blendScreen(vec3 base,vec3 blend){return vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b));}vec3 blendScreen(vec3 base,vec3 blend,float opacity){return (blendScreen(base, blend)*opacity+base*(1.0-opacity));}vec3 blendMultiply(vec3 base,vec3 blend){return base*blend;}vec3 blendMultiply(vec3 base,vec3 blend,float opacity){return (blendMultiply(base,blend)*opacity+base*(1.0-opacity));}float blendOverlay(float base,float blend){return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));}vec3 blendOverlay(vec3 base,vec3 blend){return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));}vec3 blendOverlay(vec3 base,vec3 blend,float opacity){return (blendOverlay(base,blend)*opacity+base*(1.0-opacity));}vec3 blendHardLight(vec3 base,vec3 blend){return blendOverlay(blend,base);}vec3 blendHardLight(vec3 base,vec3 blend,float opacity){return (blendHardLight(base,blend)*opacity+base*(1.0-opacity));}float blendSoftLight(float base,float blend){return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));}vec3 blendSoftLight(vec3 base,vec3 blend){return vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));}vec3 blendSoftLight(vec3 base,vec3 blend,float opacity){return (blendSoftLight(base,blend)*opacity+base*(1.0-opacity));}float blendColorDodge(float base,float blend){return (blend==1.0)?blend:min(base/(1.0-blend),1.0);}vec3 blendColorDodge(vec3 base,vec3 blend){return vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));}vec3 blendColorDodge(vec3 base,vec3 blend,float opacity){return (blendColorDodge(base, blend)*opacity+base*(1.0-opacity));}float blendColorBurn(float base,float blend){return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);}vec3 blendColorBurn(vec3 base,vec3 blend){return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));}vec3 blendColorBurn(vec3 base,vec3 blend,float opacity){return (blendColorBurn(base, blend)*opacity+base*(1.0-opacity));}float blendVividLight(float base,float blend){return (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));}vec3 blendVividLight(vec3 base,vec3 blend){return vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));}vec3 blendVividLight(vec3 base,vec3 blend,float opacity){return (blendVividLight(base,blend)*opacity+base*(1.0-opacity));}float blendLighten(float base,float blend){return max(blend,base);}vec3 blendLighten(vec3 base,vec3 blend){return vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));}vec3 blendLighten(vec3 base,vec3 blend,float opacity){return (blendLighten(base,blend)*opacity+base*(1.0-opacity));}float blendLinearBurn(float base,float blend){return max(base+blend-1.0,0.0);}vec3 blendLinearBurn(vec3 base,vec3 blend){return max(base+blend-vec3(1.0),vec3(0.0));}vec3 blendLinearBurn(vec3 base,vec3 blend,float opacity){return (blendLinearBurn(base, blend)*opacity+base*(1.0-opacity));}float blendLinearDodge(float base,float blend){return min(base+blend,1.0);}vec3 blendLinearDodge(vec3 base,vec3 blend){return min(base+blend,vec3(1.0));}vec3 blendLinearDodge(vec3 base,vec3 blend,float opacity){return (blendLinearDodge(base,blend)*opacity+base*(1.0-opacity));}float blendLinearLight(float base,float blend){return blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5)));}vec3 blendLinearLight(vec3 base,vec3 blend){return vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b));}vec3 blendLinearLight(vec3 base,vec3 blend,float opacity){return (blendLinearLight(base,blend)*opacity+base*(1.0-opacity));}`,fragment:"varying vec3 v_color;void main(){vec3 color=v_color;if(u_darken_top==1.0){vec2 st=gl_FragCoord.xy/resolution.xy;color.g-=pow(st.y+sin(-12.0)*st.x,u_shadow_power)*0.4;}gl_FragColor=vec4(color,1.0);}"},this.conf={density:[.06,.16]},this.minigl=new U6(this.el,null,null,!0),requestAnimationFrame(()=>{this.el&&(this.computedCanvasStyle=getComputedStyle(this.el),this.waitForCssVars())})}initMaterial(){this.uniforms={u_time:new this.minigl.Uniform({value:0}),u_shadow_power:new this.minigl.Uniform({value:5}),u_darken_top:new this.minigl.Uniform({value:this.el.dataset.jsDarkenTop===""?1:0}),u_active_colors:new this.minigl.Uniform({value:this.activeColors,type:"vec4"}),u_global:new this.minigl.Uniform({value:{noiseFreq:new this.minigl.Uniform({value:[this.freqX,this.freqY],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:5e-6})},type:"struct"}),u_vertDeform:new this.minigl.Uniform({value:{incline:new this.minigl.Uniform({value:Math.sin(this.angle)/Math.cos(this.angle)}),offsetTop:new this.minigl.Uniform({value:-.5}),offsetBottom:new this.minigl.Uniform({value:-.5}),noiseFreq:new this.minigl.Uniform({value:[3,4],type:"vec2"}),noiseAmp:new this.minigl.Uniform({value:this.amp}),noiseSpeed:new this.minigl.Uniform({value:10}),noiseFlow:new this.minigl.Uniform({value:3}),noiseSeed:new this.minigl.Uniform({value:this.seed})},type:"struct",excludeFrom:"fragment"}),u_baseColor:new this.minigl.Uniform({value:this.sectionColors[0],type:"vec3",excludeFrom:"fragment"}),u_waveLayers:new this.minigl.Uniform({value:[],excludeFrom:"fragment",type:"array"})};for(let e=1;e<this.sectionColors.length;e+=1)this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({value:{color:new this.minigl.Uniform({value:this.sectionColors[e],type:"vec3"}),noiseFreq:new this.minigl.Uniform({value:[2+e/this.sectionColors.length,3+e/this.sectionColors.length],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:11+.3*e}),noiseFlow:new this.minigl.Uniform({value:6.5+.3*e}),noiseSeed:new this.minigl.Uniform({value:this.seed+10*e}),noiseFloor:new this.minigl.Uniform({value:.1}),noiseCeil:new this.minigl.Uniform({value:.63+.07*e})},type:"struct"}));return this.vertexShader=[this.shaderFiles.noise,this.shaderFiles.blend,this.shaderFiles.vertex].join(""),new this.minigl.Material(this.vertexShader,this.shaderFiles.fragment,this.uniforms)}initMesh(){this.material=this.initMaterial(),this.geometry=new this.minigl.PlaneGeometry,this.mesh=new this.minigl.Mesh(this.geometry,this.material)}shouldSkipFrame(e){return!!window.document.hidden||parseInt(e,10)%2==0||void 0}updateFrequency(e){this.freqX+=e,this.freqY+=e}toggleColor(e){this.activeColors[e]=this.activeColors[e]===0?1:0}init(){this.playing=!0,this.initGradientColors(),this.initMesh(),this.resize(),requestAnimationFrame(this.animate)}waitForCssVars(){this.computedCanvasStyle&&this.computedCanvasStyle.getPropertyValue("--gradient-1").indexOf("#")!==-1?this.init():this.init()}initGradientColors(){this.sectionColors=["--gradient-1","--gradient-2","--gradient-3","--gradient-4"].map(e=>{let r=this.computedCanvasStyle.getPropertyValue(e).trim();return r.length===4&&(r=`#${r.substr(1).split("").map(n=>n+n).join("")}`),r&&`0x${r.substr(1)}`}).filter(Boolean).map(M6)}}function M6(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]}function rd(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}let U6=class{constructor(t,e,r){const n=this;n.canvas=t,n.gl=n.canvas.getContext("webgl",{antialias:!0}),n.meshes=[];const i=n.gl;e&&r&&this.setSize(e,r),Object.defineProperties(n,{Material:{enumerable:!1,value:class{constructor(o,a,c={}){const l=this;function p(y,E){const T=i.createShader(y);return i.shaderSource(T,E),i.compileShader(T),i.getShaderParameter(T,i.COMPILE_STATUS)||console.error(i.getShaderInfoLog(T)),T}function w(y,E){return Object.entries(y).map(([T,R])=>R.getDeclaration(T,E)).join("")}l.uniforms=c,l.uniformInstances=[];const m="precision highp float;";l.vertexSource=`${m} attribute vec4 position;attribute vec2 uv;attribute vec2 uvNorm;${w(n.commonUniforms,"vertex")} ${w(c,"vertex")} ${o}`,l.Source=`${m} ${w(n.commonUniforms,"fragment")} ${w(c,"fragment")} ${a} `,l.vertexShader=p(i.VERTEX_SHADER,l.vertexSource),l.fragmentShader=p(i.FRAGMENT_SHADER,l.Source),l.program=i.createProgram(),i.attachShader(l.program,l.vertexShader),i.attachShader(l.program,l.fragmentShader),i.linkProgram(l.program),i.getProgramParameter(l.program,i.LINK_STATUS)||console.error(i.getProgramInfoLog(l.program)),i.useProgram(l.program),l.attachUniforms(void 0,n.commonUniforms),l.attachUniforms(void 0,l.uniforms)}attachUniforms(o,a){const c=this;o===void 0?Object.entries(a).forEach(([l,p])=>{c.attachUniforms(l,p)}):a.type=="array"?a.value.forEach((l,p)=>c.attachUniforms(`${o}[${p}]`,l)):a.type=="struct"?Object.entries(a.value).forEach(([l,p])=>c.attachUniforms(`${o}.${l}`,p)):c.uniformInstances.push({uniform:a,location:i.getUniformLocation(c.program,o)})}}},Uniform:{enumerable:!1,value:class{constructor(o){this.type="float",Object.assign(this,o),this.typeFn={float:"1f",int:"1i",vec2:"2fv",vec3:"3fv",vec4:"4fv",mat4:"Matrix4fv"}[this.type]||"1f",this.update()}update(o){this.value!==void 0&&i[`uniform${this.typeFn}`](o,this.typeFn.indexOf("Matrix")===0?this.transpose:this.value,this.typeFn.indexOf("Matrix")===0?this.value:null)}getDeclaration(o,a,c){const l=this;if(l.excludeFrom!==a){if(l.type==="array")return l.value[0].getDeclaration(o,a,l.value.length)+`const int ${o}_length=${l.value.length};`;if(l.type==="struct"){let p=o.replace("u_","");return p=p.charAt(0).toUpperCase()+p.slice(1),`uniform struct ${p} {`+Object.entries(l.value).map(([w,m])=>m.getDeclaration(w,a).replace(/^uniform/,"")).join("")+`} ${o}${c>0?`[${c}]`:""};`}return`uniform ${l.type} ${o}${c>0?`[${c}]`:""};`}}}},PlaneGeometry:{enumerable:!1,value:class{constructor(o,a,c,l,p){i.createBuffer(),this.attributes={position:new n.Attribute({target:i.ARRAY_BUFFER,size:3}),uv:new n.Attribute({target:i.ARRAY_BUFFER,size:2}),uvNorm:new n.Attribute({target:i.ARRAY_BUFFER,size:2}),index:new n.Attribute({target:i.ELEMENT_ARRAY_BUFFER,size:3,type:i.UNSIGNED_SHORT})},this.setTopology(c,l),this.setSize(o,a,p)}setTopology(o=1,a=1){const c=this;c.xSegCount=o,c.ySegCount=a,c.vertexCount=(c.xSegCount+1)*(c.ySegCount+1),c.quadCount=c.xSegCount*c.ySegCount*2,c.attributes.uv.values=new Float32Array(2*c.vertexCount),c.attributes.uvNorm.values=new Float32Array(2*c.vertexCount),c.attributes.index.values=new Uint16Array(3*c.quadCount);for(let l=0;l<=c.ySegCount;l++)for(let p=0;p<=c.xSegCount;p++){const w=l*(c.xSegCount+1)+p;if(c.attributes.uv.values[2*w]=p/c.xSegCount,c.attributes.uv.values[2*w+1]=1-l/c.ySegCount,c.attributes.uvNorm.values[2*w]=p/c.xSegCount*2-1,c.attributes.uvNorm.values[2*w+1]=1-l/c.ySegCount*2,p<c.xSegCount&&l<c.ySegCount){const m=l*c.xSegCount+p;c.attributes.index.values[6*m]=w,c.attributes.index.values[6*m+1]=w+1+c.xSegCount,c.attributes.index.values[6*m+2]=w+1,c.attributes.index.values[6*m+3]=w+1,c.attributes.index.values[6*m+4]=w+1+c.xSegCount,c.attributes.index.values[6*m+5]=w+2+c.xSegCount}}c.attributes.uv.update(),c.attributes.uvNorm.update(),c.attributes.index.update()}setSize(o=1,a=1,c="xz"){const l=this;l.width=o,l.height=a,l.orientation=c,l.attributes.position.values&&l.attributes.position.values.length===3*l.vertexCount||(l.attributes.position.values=new Float32Array(3*l.vertexCount));const p=o/-2,w=a/-2,m=o/l.xSegCount,y=a/l.ySegCount;for(let E=0;E<=l.ySegCount;E++){const T=w+E*y;for(let R=0;R<=l.xSegCount;R++){const L=p+R*m,x=E*(l.xSegCount+1)+R;l.attributes.position.values[3*x+"xyz".indexOf(c[0])]=L,l.attributes.position.values[3*x+"xyz".indexOf(c[1])]=-T}}l.attributes.position.update()}}},Mesh:{enumerable:!1,value:class{constructor(o,a){const c=this;c.geometry=o,c.material=a,c.attributeInstances=[],Object.entries(c.geometry.attributes).forEach(([l,p])=>{c.attributeInstances.push({attribute:p,location:p.attach(l,c.material.program)})}),n.meshes.push(c)}draw(){i.useProgram(this.material.program),this.material.uniformInstances.forEach(({uniform:o,location:a})=>o.update(a)),this.attributeInstances.forEach(({attribute:o,location:a})=>o.use(a)),i.drawElements(i.TRIANGLES,this.geometry.attributes.index.values.length,i.UNSIGNED_SHORT,0)}remove(){n.meshes=n.meshes.filter(o=>o!=this)}}},Attribute:{enumerable:!1,value:class{constructor(o){this.type=i.FLOAT,this.normalized=!1,this.buffer=i.createBuffer(),Object.assign(this,o),this.update()}update(){this.values!==void 0&&(i.bindBuffer(this.target,this.buffer),i.bufferData(this.target,this.values,i.STATIC_DRAW))}attach(o,a){const c=i.getAttribLocation(a,o);return this.target===i.ARRAY_BUFFER&&(i.enableVertexAttribArray(c),i.vertexAttribPointer(c,this.size,this.type,this.normalized,0,0)),c}use(o){i.bindBuffer(this.target,this.buffer),this.target===i.ARRAY_BUFFER&&(i.enableVertexAttribArray(o),i.vertexAttribPointer(o,this.size,this.type,this.normalized,0,0))}}}});const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];n.commonUniforms={projectionMatrix:new n.Uniform({type:"mat4",value:s}),modelViewMatrix:new n.Uniform({type:"mat4",value:s}),resolution:new n.Uniform({type:"vec2",value:[1,1]}),aspectRatio:new n.Uniform({type:"float",value:1})}}setSize(t=640,e=480){this.width=t,this.height=e,this.canvas.width=t,this.canvas.height=e,this.gl.viewport(0,0,t,e),this.commonUniforms.resolution.value=[t,e],this.commonUniforms.aspectRatio.value=t/e}setOrthographicCamera(t=0,e=0,r=0,n=-2e3,i=2e3){this.commonUniforms.projectionMatrix.value=[2/this.width,0,0,0,0,2/this.height,0,0,0,0,2/(n-i),0,t,e,r,1]}render(){this.gl.clearColor(0,0,0,0),this.gl.clearDepth(1),this.meshes.forEach(t=>t.draw())}};const ye={CROSS_ICON:Ae`<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>`,NOISE_TEXTURE:Ae`<svg id="w3m-transparent-noise"><filter id="w3m-noise"><feTurbulence type="fractalNoise" baseFrequency="0.8"/></filter><rect width="100%" height="100%" filter="url(#w3m-noise)"/></svg>`,WALLET_CONNECT_LOGO:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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:Ae`<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>`},F6={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"};var sr=(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))(sr||{});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"}},B6={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"}};var j6=Object.defineProperty,nd=Object.getOwnPropertySymbols,k6=Object.prototype.hasOwnProperty,H6=Object.prototype.propertyIsEnumerable,id=(t,e,r)=>e in t?j6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,z6=(t,e)=>{for(var r in e||(e={}))k6.call(e,r)&&id(t,r,e[r]);if(nd)for(var r of nd(e))H6.call(e,r)&&id(t,r,e[r]);return t};const ie={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET:"W3M_RECENT_WALLET",rejectStandaloneButtonComponent(){const{isStandalone:t}=te.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}=et.state;return(r=s?.[t])!=null?r:i&&n?at.getImageUrl(n):""},getWalletName(t,e=!1){const r=qr.getInjectedName(t);return e?r.split(" ")[0]:r},getChainIcon(t){var e;const r=F6[t],{projectId:n,chainImages:i}=et.state;return(e=i?.[t])!=null?e:n&&r?at.getImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=B6[t])==null?void 0:e.icon,{projectId:i,tokenImages:s}=et.state;return(r=s?.[t])!=null?r:i&&n?at.getImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=ie.MOBILE_BREAKPOINT},async preloadImage(t){return new Promise((e,r)=>{const n=new Image;n.onload=e,n.onerror=r,n.src=t})},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){const{standaloneUri:e,selectedChain:r}=te.state,{links:n,name:i}=t;function s(o){let a="";n!=null&&n.universal?a=Te.formatUniversalUrl(n.universal,o,i):n!=null&&n.native&&(a=Te.formatNativeUrl(n.native,o,i)),Te.openHref(a)}e?s(e):(await Ke.client().connectWalletConnect(o=>{s(o)},r?.id),ht.close()),ie.setRecentWallet(t)},async handleAndroidLinking(){const{standaloneUri:t,selectedChain:e}=te.state;t?Te.openHref(t):(await Ke.client().connectWalletConnect(r=>{Te.setWalletConnectAndroidDeepLink(r),Te.openHref(r)},e?.id),ht.close())},async handleUriCopy(){const{standaloneUri:t}=te.state;if(t)await navigator.clipboard.writeText(t);else{const e=Ke.client().walletConnectUri;await navigator.clipboard.writeText(e)}Nt.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=te.state;await Ke.client().connectConnector(t,r?.id),ht.close()}catch(r){e?e():Nt.openToast(ie.getErrorMessage(r),"error")}},getCustomWallets(){var t;const{desktopWallets:e,mobileWallets:r}=et.state;return(t=Te.isMobile()?r:e)!=null?t:[]},getCustomImageUrls(){const{chainImages:t,walletImages:e}=et.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},getConnectorImageUrls(){return Ke.client().getConnectors().map(({id:t})=>qr.getInjectedId(t)).map(t=>ie.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={"--color-av-1":n[0],"--color-av-2":n[1],"--color-av-3":n[2],"--color-av-4":n[3],"--color-av-5":n[4]};Object.entries(s).forEach(([o,a])=>i.style.setProperty(o,a))}},setRecentWallet(t){localStorage.setItem(ie.W3M_RECENT_WALLET,JSON.stringify(t))},getRecentWallet(){const t=localStorage.getItem(ie.W3M_RECENT_WALLET);if(t)return JSON.parse(t)},getExtensionWallets(){const t=[];for(const[e,r]of Object.entries(qr.injectedPreset))e!==sr.coinbaseWallet&&r&&r.isInjected&&!r.isDesktop&&t.push(z6({id:e},r));return t},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())}},W6=be`#w3m-transparent-noise,.w3m-canvas,.w3m-color-placeholder,.w3m-gradient-placeholder,.w3m-highlight{inset:0;position:absolute;display:block;pointer-events:none;width:100%;height:100px;border-radius:8px 8px 0 0;transform:translateY(-5px)}.w3m-gradient-placeholder{background:linear-gradient(var(--gradient-1),var(--gradient-2),var(--gradient-3),var(--gradient-4))}.w3m-color-placeholder{background-color:var(--color-fg-accent)}.w3m-highlight{border:1px solid var(--color-overlay)}.w3m-canvas{opacity:0;transition:opacity 2s ease;box-shadow:0 8px 28px -6px rgba(10,16,31,.12),0 18px 88px -4px rgba(10,16,31,.14)}.w3m-canvas-visible{opacity:1}#w3m-transparent-noise{mix-blend-mode:multiply;opacity:.35}.w3m-toolbar{height:28px;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(--color-fg-inverse)}.w3m-action-btn{width:28px;height:28px;border-radius:50%;border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:background-color,.2s ease;background-color:var(--color-bg-1);box-shadow:0 0 0 1px var(--color-overlay),0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08)}.w3m-action-btn:hover{background-color:var(--color-bg-2)}.w3m-action-btn svg{display:block;object-position:center}.w3m-action-btn path{fill:var(--color-fg-1)}.w3m-actions{display:flex}.w3m-actions button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--color-fg-1)}.w3m-help-active button:first-child path{fill:var(--color-bg-1)}`;var q6=Object.defineProperty,V6=Object.getOwnPropertyDescriptor,nc=(t,e,r,n)=>{for(var i=n>1?void 0:n?V6(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&&q6(e,r,i),i};const sd=new L6;let Ci=class extends de{constructor(){super(),this.open=!1,this.isHelp=!1,this.unsubscribeRouter=void 0,this.playTimeout=void 0,this.unsubscribeRouter=Re.subscribe(t=>{this.isHelp=t.view==="Help"})}firstUpdated(){const{themeBackground:t}=et.state;t==="gradient"&&(this.playTimeout=setTimeout(()=>{sd.play(this.canvasEl),this.open=!0},800))}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this),clearTimeout(this.playTimeout),sd.stop()}get canvasEl(){return ie.getShadowRootElement(this,".w3m-canvas")}onHelp(){Re.push("Help")}render(){const{themeBackground:t}=et.state,e={"w3m-canvas":!0,"w3m-canvas-visible":this.open},r={"w3m-actions":!0,"w3m-help-active":this.isHelp};return V`${t==="themeColor"?V`<div class="w3m-color-placeholder"></div>`:null} ${t==="gradient"?V`<div class="w3m-gradient-placeholder"></div><canvas class="${Lt(e)}"></canvas>${ye.NOISE_TEXTURE}`:null}<div class="w3m-highlight"></div><div class="w3m-toolbar">${ye.WALLET_CONNECT_LOGO}<div class="${Lt(r)}"><button class="w3m-action-btn" @click="${this.onHelp}">${ye.HELP_ICON}</button> <button class="w3m-action-btn" @click="${ht.close}">${ye.CROSS_ICON}</button></div></div>`}};Ci.styles=[le.globalCss,W6],nc([Fe()],Ci.prototype,"open",2),nc([Fe()],Ci.prototype,"isHelp",2),Ci=nc([we("w3m-modal-backcard")],Ci);const K6=be`main{padding:20px;padding-top:0;width:100%}`;var G6=Object.defineProperty,Z6=Object.getOwnPropertyDescriptor,Y6=(t,e,r,n)=>{for(var i=n>1?void 0:n?Z6(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&&G6(e,r,i),i};let ic=class extends de{render(){return V`<main><slot></slot></main>`}};ic.styles=[le.globalCss,K6],ic=Y6([we("w3m-modal-content")],ic);const J6=be`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--color-bg-2)}`;var X6=Object.defineProperty,Q6=Object.getOwnPropertyDescriptor,e4=(t,e,r,n)=>{for(var i=n>1?void 0:n?Q6(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&&X6(e,r,i),i};let sc=class extends de{render(){return V`<footer><slot></slot></footer>`}};sc.styles=[le.globalCss,J6],sc=e4([we("w3m-modal-footer")],sc);const t4=be`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--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(--color-fg-accent)}`;var r4=Object.defineProperty,n4=Object.getOwnPropertyDescriptor,Si=(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&&r4(e,r,i),i};let Vr=class extends de{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="${Re.goBack}">${ye.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=Re.state.history.length>1,r=this.title?V`<w3m-text variant="large-bold">${this.title}</w3m-text>`:V`<slot></slot>`;return V`<header class="${Lt(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Vr.styles=[le.globalCss,t4],Si([ve()],Vr.prototype,"title",2),Si([ve()],Vr.prototype,"onAction",2),Si([ve()],Vr.prototype,"actionIcon",2),Si([ve()],Vr.prototype,"border",2),Vr=Si([we("w3m-modal-header")],Vr);const i4=be`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var s4=Object.defineProperty,o4=Object.getOwnPropertyDescriptor,oc=(t,e,r,n)=>{for(var i=n>1?void 0:n?o4(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 Di=class extends de{constructor(){super(),this.view=Re.state.view,this.prevView=Re.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Re.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&(_r(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),_r(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 ie.getShadowRootElement(this,".w3m-router")}get contentEl(){return ie.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"WalletFilter":return V`<w3m-wallet-filter-view></w3m-wallet-filter-view>`;case"Account":return V`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return V`<w3m-switch-network-view></w3m-switch-network-view>`;default:return V`<div>Not Found</div>`}}async onChangeRoute(){await _r(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15}).finished,this.view=Re.state.view}render(){return V`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};Di.styles=[le.globalCss,i4],oc([Fe()],Di.prototype,"view",2),oc([Fe()],Di.prototype,"prevView",2),Di=oc([we("w3m-modal-router")],Di);const a4=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:36px;border:1px solid var(--color-overlay);background-color:var(--color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--color-bg-3)}}.w3m-success path{fill:var(--color-fg-accent)}.w3m-error path{fill:var(--color-err)}`;var c4=Object.defineProperty,l4=Object.getOwnPropertyDescriptor,od=(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&&c4(e,r,i),i};let Ms=class extends de{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Nt.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Nt.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Nt.closeToast()}render(){const{message:t,variant:e}=Nt.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?V`<div class="${Lt(r)}">${e==="success"?ye.CHECKMARK_ICON:null} ${e==="error"?ye.CROSS_ICON:null}<w3m-text variant="small-normal">${t}</w3m-text></div>`:null}};Ms.styles=[le.globalCss,a4],od([Fe()],Ms.prototype,"open",2),Ms=od([we("w3m-modal-toast")],Ms);const u4=be`button{padding:5px;border-radius:10px;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(--color-overlay)}`;var h4=Object.defineProperty,d4=Object.getOwnPropertyDescriptor,Us=(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&&h4(e,r,i),i};let Pn=class extends de{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-normal">${this.name}</w3m-text></button>`}};Pn.styles=[le.globalCss,u4],Us([ve()],Pn.prototype,"onClick",2),Us([ve()],Pn.prototype,"name",2),Us([ve()],Pn.prototype,"chainId",2),Pn=Us([we("w3m-network-button")],Pn);const f4=be`div{width:inherit;height:inherit}.polygon-stroke{stroke:var(--color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--color-bg-3)}#network-placeholder-dash{stroke:var(--color-overlay)}`;var p4=Object.defineProperty,g4=Object.getOwnPropertyDescriptor,ad=(t,e,r,n)=>{for(var i=n>1?void 0:n?g4(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&&p4(e,r,i),i};let Fs=class extends de{constructor(){super(...arguments),this.chainId=""}render(){const t=ie.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`${ye.NETWORK_PLACEHOLDER}`}};Fs.styles=[le.globalCss,f4],ad([ve()],Fs.prototype,"chainId",2),Fs=ad([we("w3m-network-image")],Fs);const m4=.1,cd=2.5,hr=7;function ac(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+m4}function w4(t,e){const r=Array.prototype.slice.call(yi.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 y4={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",s=n==="light"?"#fff":"#141414",o=[],a=w4(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-hr)*c*T,x=(a.length-hr)*c*R,O=.32;for(let _=0;_<l.length;_+=1){const D=c*(hr-_*2);o.push(Ae`<rect fill="${_%2===0?i:s}" height="${D}" rx="${D*O}" ry="${D*O}" width="${D}" x="${L+c*_}" y="${x+c*_}">`)}});const p=Math.floor((r+25)/c),w=a.length/2-p/2,m=a.length/2+p/2-1,y=[];a.forEach((T,R)=>{T.forEach((L,x)=>{if(a[R][x]&&!(R<hr&&x<hr||R>a.length-(hr+1)&&x<hr||R<hr&&x>a.length-(hr+1))&&!(R>w&&R<m&&x>w&&x<m)){const O=R*c+c/2,_=x*c+c/2;y.push([O,_])}})});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(x=>R.every(O=>!ac(x,O,c)));return[Number(T),L]}).forEach(([T,R])=>{R.forEach(L=>{o.push(Ae`<circle cx="${T}" cy="${L}" fill="${i}" r="${c/cd}">`)})}),Object.entries(E).filter(([T,R])=>R.length>1).map(([T,R])=>{const L=R.filter(x=>R.some(O=>ac(x,O,c)));return[Number(T),L]}).map(([T,R])=>{R.sort((x,O)=>x<O?-1:1);const L=[];for(const x of R){const O=L.find(_=>_.some(D=>ac(x,D,c)));O?O.push(x):L.push([x])}return[T,L.map(x=>[x[0],x[x.length-1]])]}).forEach(([T,R])=>{R.forEach(([L,x])=>{o.push(Ae`<line x1="${T}" x2="${T}" y1="${L}" y2="${x}" stroke="${i}" stroke-width="${c/(cd/2)}" stroke-linecap="round">`)})}),o}},b4=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(--color-fg-accent)}svg:first-child path:last-child{stroke:var(--color-overlay)}`;var v4=Object.defineProperty,_4=Object.getOwnPropertyDescriptor,Ii=(t,e,r,n)=>{for(var i=n>1?void 0:n?_4(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 Kr=class extends de{constructor(){super(...arguments),this.uri="",this.size=0,this.logoSrc="",this.walletId=""}svgTemplate(){var t;const e=(t=et.state.themeMode)!=null?t:"light";return Ae`<svg height="${this.size}" width="${this.size}">${y4.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return V`<div>${this.walletId||this.logoSrc?V`<w3m-wallet-image walletId="${Ft(this.walletId)}" src="${Ft(this.logoSrc)}"></w3m-wallet-image>`:ye.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Kr.styles=[le.globalCss,b4],Ii([ve()],Kr.prototype,"uri",2),Ii([ve({type:Number})],Kr.prototype,"size",2),Ii([ve()],Kr.prototype,"logoSrc",2),Ii([ve()],Kr.prototype,"walletId",2),Kr=Ii([we("w3m-qrcode")],Kr);const E4=be`:host{position:relative;height:28px;width:75%}input{width:100%;height:100%;line-height:28px!important;border-radius:28px;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(--color-bg-3);box-shadow:inset 0 0 0 1px var(--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(--color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--color-fg-accent)}path{fill:var(--color-fg-2)}`;var x4=Object.defineProperty,C4=Object.getOwnPropertyDescriptor,ld=(t,e,r,n)=>{for(var i=n>1?void 0:n?C4(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&&x4(e,r,i),i};let Bs=class extends de{constructor(){super(...arguments),this.onChange=()=>null}render(){const t=Te.isMobile()?"Search mobile wallets":"Search desktop wallets";return V`<input type="text" @input="${this.onChange}" placeholder="${t}"><div class="w3m-placeholder">${ye.SEARCH_ICON}<w3m-text color="secondary" variant="medium-thin">${t}</w3m-text></div>`}};Bs.styles=[le.globalCss,E4],ld([ve()],Bs.prototype,"onChange",2),Bs=ld([we("w3m-search-input")],Bs);const S4=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(--color-fg-accent)}`;var D4=Object.defineProperty,I4=Object.getOwnPropertyDescriptor,O4=(t,e,r,n)=>{for(var i=n>1?void 0:n?I4(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&&D4(e,r,i),i};let cc=class extends de{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=[le.globalCss,S4],cc=O4([we("w3m-spinner")],cc);const A4=be`span{font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xxsmall-bold{font-weight:700;font-size:10px;line-height:12px;letter-spacing:.02em;text-transform:uppercase}.w3m-xsmall-normal{font-weight:600;font-size:12px;line-height:14px;letter-spacing:-.03em}.w3m-small-thin{font-weight:500;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-small-normal{font-weight:600;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-medium-thin{font-weight:500;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-normal{font-weight:600;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-bold{font-weight:700;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-large-bold{font-weight:600;font-size:20px;line-height:24px;letter-spacing:-.03em}:host(*){color:var(--color-fg-1)}.w3m-color-primary{color:var(--color-fg-1)}.w3m-color-secondary{color:var(--color-fg-2)}.w3m-color-tertiary{color:var(--color-fg-3)}.w3m-color-inverse{color:var(--color-fg-inverse)}.w3m-color-accnt{color:var(--color-fg-accent)}.w3m-color-error{color:var(--color-err)}`;var $4=Object.defineProperty,P4=Object.getOwnPropertyDescriptor,lc=(t,e,r,n)=>{for(var i=n>1?void 0:n?P4(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 Oi=class extends de{constructor(){super(...arguments),this.variant="medium-normal",this.color="primary"}render(){const t={"w3m-large-bold":this.variant==="large-bold","w3m-medium-bold":this.variant==="medium-bold","w3m-medium-normal":this.variant==="medium-normal","w3m-medium-thin":this.variant==="medium-thin","w3m-small-normal":this.variant==="small-normal","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-normal":this.variant==="xsmall-normal","w3m-xxsmall-bold":this.variant==="xxsmall-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 class="${Lt(t)}"><slot></slot></span>`}};Oi.styles=[le.globalCss,A4],lc([ve()],Oi.prototype,"variant",2),lc([ve()],Oi.prototype,"color",2),Oi=lc([we("w3m-text")],Oi);const T4=be`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;inset:0;border-radius:50%;border:1px solid var(--color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--color-bg-3)}#token-placeholder-dash{stroke:var(--color-overlay)}`;var R4=Object.defineProperty,N4=Object.getOwnPropertyDescriptor,ud=(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&&R4(e,r,i),i};let js=class extends de{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=ie.getTokenIcon((t=this.symbol)!=null?t:"");return e?V`<div><img src="${e}" alt="${this.id}"></div>`:ye.TOKEN_PLACEHOLDER}};js.styles=[le.globalCss,T4],ud([ve()],js.prototype,"symbol",2),js=ud([we("w3m-token-image")],js);const L4=be`button{transition:all .2s ease;width:100%;height:100%;border-radius:10px;display:flex;align-items:flex-start}button:hover{background-color:var(--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:15px;margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var M4=Object.defineProperty,U4=Object.getOwnPropertyDescriptor,Cr=(t,e,r,n)=>{for(var i=n>1?void 0:n?U4(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 or=class extends de{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="xxsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?V`<w3m-text class="w3m-sublabel" variant="xxsmall-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-normal">${(t=this.label)!=null?t:ie.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};or.styles=[le.globalCss,L4],Cr([ve()],or.prototype,"onClick",2),Cr([ve()],or.prototype,"name",2),Cr([ve()],or.prototype,"walletId",2),Cr([ve()],or.prototype,"label",2),Cr([ve()],or.prototype,"src",2),Cr([ve()],or.prototype,"installed",2),Cr([ve()],or.prototype,"recent",2),or=Cr([we("w3m-wallet-button")],or);const F4=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(--color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--color-bg-3)}#wallet-placeholder-dash{stroke:var(--color-overlay)}`;var B4=Object.defineProperty,j4=Object.getOwnPropertyDescriptor,uc=(t,e,r,n)=>{for(var i=n>1?void 0:n?j4(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&&B4(e,r,i),i};let Ai=class extends de{constructor(){super(...arguments),this.walletId=void 0,this.src=void 0}render(){var t;const e=ie.getWalletId((t=this.walletId)!=null?t:""),r=ie.getWalletId(e),n=this.src?this.src:ie.getWalletIcon(r);return V`${n.length?V`<div><img src="${n}" alt="${this.id}"></div>`:ye.WALLET_PLACEHOLDER}`}};Ai.styles=[le.globalCss,F4],uc([ve()],Ai.prototype,"walletId",2),uc([ve()],Ai.prototype,"src",2),Ai=uc([we("w3m-wallet-image")],Ai);const k4=be`:host{all:initial}div{display:flex;align-items:center;background-color:var(--color-overlay);box-shadow:inset 0 0 0 1px var(--color-overlay);border-radius:10px;padding:4px 4px 4px 8px}div button{border-radius:16px;padding:4px 8px 4px 4px;height:auto;margin-left:10px;color:var(--color-fg-inverse);background-color:var(--color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--color-overlay)}button:hover::after{background-color:var(--color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var H4=Object.defineProperty,z4=Object.getOwnPropertyDescriptor,hd=(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 $i=class extends de{constructor(){super(),this.balance="hide",ie.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=te.state;t||ht.open({route:"Account"})}accountTemplate(){return V`<w3m-avatar></w3m-avatar><w3m-address-text></w3m-address-text>`}render(){return this.balance==="show"?V`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}">${this.accountTemplate()}</button></div>`:V`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};$i.styles=[le.globalCss,k4],hd([ve()],$i.prototype,"balance",2),$i=hd([we("w3m-account-button")],$i);const W4=be`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--color-overlay)}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var q4=Object.defineProperty,V4=Object.getOwnPropertyDescriptor,hc=(t,e,r,n)=>{for(var i=n>1?void 0:n?V4(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&&q4(e,r,i),i};let Pi=class extends de{constructor(){super(),this.chainId="",this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=te.state;this.chainId=t?.id.toString(),this.label=t?.name,this.unsubscribeNetwork=te.subscribe(({selectedChain:e})=>{this.chainId=e?.id.toString(),this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){Re.push("SelectNetwork")}render(){const{chains:t}=te.state,e=t&&t.length>1;return V`<button @click="${this.onClick}" ?disabled="${!e}"><w3m-network-image chainId="${Ft(this.chainId)}"></w3m-network-image><w3m-text variant="xsmall-normal" color="accent">${this.label}</w3m-text></button>`}};Pi.styles=[le.globalCss,W4],hc([Fe()],Pi.prototype,"chainId",2),hc([Fe()],Pi.prototype,"label",2),Pi=hc([we("w3m-account-network-button")],Pi);const K4=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(--color-fg-1) 36.33%,var(--color-fg-3) 42.07%,var(--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 G4=Object.defineProperty,Z4=Object.getOwnPropertyDescriptor,Ti=(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&&G4(e,r,i),i};let Gr=class extends de{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=te.state.address,this.name=te.state.profileName,this.loading=Boolean(te.state.profileLoading),this.unsubscribeAccount=te.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=Boolean(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="${Lt(r)}" variant="${e?"medium-normal":"large-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:ie.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};Gr.styles=[le.globalCss,K4],Ti([Fe()],Gr.prototype,"address",2),Ti([Fe()],Gr.prototype,"name",2),Ti([Fe()],Gr.prototype,"loading",2),Ti([ve()],Gr.prototype,"variant",2),Gr=Ti([we("w3m-address-text")],Gr);const Y4=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(--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}`;var J4=Object.defineProperty,X4=Object.getOwnPropertyDescriptor,Q4=(t,e,r,n)=>{for(var i=n>1?void 0:n?X4(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 dc=class extends de{onGoToQrcode(){Re.push("Qrcode")}onGoToGetWallet(){Re.push("GetWallet")}render(){const{previewWallets:t}=at.state,e=t.length,r=[...t,...t];return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ye.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content>${e?V`<div class="w3m-slider"><div class="w3m-track">${r.map(({image_url:n})=>V`<w3m-wallet-image src="${n.lg}"></w3m-wallet-image>`)}</div></div>`:null}<div class="w3m-action"><w3m-button-big @click="${ie.handleAndroidLinking}"><w3m-text variant="medium-normal" color="inverse">Select Wallet</w3m-text></w3m-button-big><w3m-button-big variant="secondary" @click="${this.onGoToGetWallet}"><w3m-text variant="medium-normal" color="accent">I don’t have a wallet</w3m-text></w3m-button-big></div></w3m-modal-content>`}};dc.styles=[le.globalCss,Y4],dc=Q4([we("w3m-android-wallet-selection")],dc);const e8=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(--color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--color-av-1);background-image:radial-gradient(at 66% 77%,var(--color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--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 t8=Object.defineProperty,r8=Object.getOwnPropertyDescriptor,Ri=(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 Zr=class extends de{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=te.state.address,this.avatar=te.state.profileAvatar,this.loading=Boolean(te.state.profileLoading),this.unsubscribeAccount=te.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=Boolean(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="${Lt(t)}" src="${this.avatar}">`:this.address?(ie.generateAvatarColors(this.address),V`<div class="${Lt(t)}">${this.loading?V`<div class="w3m-loader"></div>`:null}</div>`):null}};Zr.styles=[le.globalCss,e8],Ri([Fe()],Zr.prototype,"address",2),Ri([Fe()],Zr.prototype,"avatar",2),Ri([Fe()],Zr.prototype,"loading",2),Ri([ve()],Zr.prototype,"size",2),Zr=Ri([we("w3m-avatar")],Zr);const n8=be`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var i8=Object.defineProperty,s8=Object.getOwnPropertyDescriptor,fc=(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 Ni=class extends de{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=te.state.balance)==null?void 0:t.symbol,this.amount=(e=te.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=te.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),this.amount&&this.amount.length>6&&(t=parseFloat(this.amount).toFixed(3)),V`<div><w3m-token-image symbol="${Ft(this.symbol)}"></w3m-token-image><w3m-text variant="medium-normal" color="primary">${t} ${this.symbol}</w3m-text></div>`}};Ni.styles=[le.globalCss,n8],fc([Fe()],Ni.prototype,"symbol",2),fc([Fe()],Ni.prototype,"amount",2),Ni=fc([we("w3m-balance")],Ni);const o8=be`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--color-fg-inverse)}button:disabled svg path{fill:var(--color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var a8=Object.defineProperty,c8=Object.getOwnPropertyDescriptor,ks=(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 Yr=class extends de{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,ie.rejectStandaloneButtonComponent(),this.modalUnsub=ht.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"?ye.WALLET_CONNECT_ICON:null}onOpen(){this.loading=!0;const{enableNetworkView:t}=et.state,{chains:e,selectedChain:r}=te.state,n=e?.length&&e.length>1;t||n&&!r?ht.open({route:"SelectNetwork"}):ht.open({route:"ConnectWallet"})}render(){return V`<w3m-button-big .disabled="${this.loading}" @click="${this.onOpen}">${this.loading?V`<w3m-spinner></w3m-spinner><w3m-text variant="medium-normal" color="accent">Connecting...</w3m-text>`:V`${this.iconTemplate()}<w3m-text variant="medium-normal" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};Yr.styles=[le.globalCss,o8],ks([Fe()],Yr.prototype,"loading",2),ks([ve()],Yr.prototype,"label",2),ks([ve()],Yr.prototype,"icon",2),Yr=ks([we("w3m-connect-button")],Yr);var l8=Object.defineProperty,u8=Object.getOwnPropertyDescriptor,Li=(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&&l8(e,r,i),i};let Jr=class extends de{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.balance="hide",this.unsubscribeAccount=void 0,ie.rejectStandaloneButtonComponent(),this.isConnected=te.state.isConnected,this.unsubscribeAccount=te.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){return this.isConnected?V`<w3m-account-button balance="${Ft(this.balance)}"></w3m-account-button>`:V`<w3m-connect-button label="${Ft(this.label)}" icon="${Ft(this.icon)}"></w3m-connect-button>`}};Li([Fe()],Jr.prototype,"isConnected",2),Li([ve()],Jr.prototype,"label",2),Li([ve()],Jr.prototype,"icon",2),Li([ve()],Jr.prototype,"balance",2),Jr=Li([we("w3m-core-button")],Jr);const Zt={allowedExplorerListings(t){const{explorerAllowList:e,explorerDenyList:r}=et.state;let n=[...t];return e!=null&&e.length&&(n=n.filter(i=>e.includes(i.id))),r!=null&&r.length&&(n=n.filter(i=>!r.includes(i.id))),n},walletsWithInjected(t){let e=[...t??[]];if(window.ethereum){const r=ie.getWalletName("");e=e.filter(({name:n})=>!ie.caseSafeIncludes(n,r))}return e},connectorWallets(){const{isStandalone:t}=te.state;if(t)return[];let e=Ke.client().getConnectors();return!window.ethereum&&Te.isMobile()&&(e=e.filter(({id:r})=>r!=="injected"&&r!==sr.metaMask)),e},walletTemplatesWithRecent(t,e){let r=[...t];if(e){const n=ie.getRecentWallet();r=r.filter(i=>!i.values.includes(n?.name)),r.splice(1,0,e)}return r},deduplicateExplorerListingsFromConnectors(t){const{isStandalone:e}=te.state;if(e)return t;const r=Ke.client().getConnectors().map(({name:n})=>n.toUpperCase());return t.filter(({name:n})=>!r.includes(n.toUpperCase()))}},h8=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(--color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--color-fg-accent)}`;var d8=Object.defineProperty,f8=Object.getOwnPropertyDescriptor,p8=(t,e,r,n)=>{for(var i=n>1?void 0:n?f8(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&&d8(e,r,i),i};let pc=class extends de{onDesktopWallet(t){Re.push("DesktopConnector",{DesktopConnector:t})}onInjectedWallet(){Re.push("InjectedConnector")}onInstallConnector(){Re.push("InstallConnector",{InstallConnector:{id:"metaMask",name:"MetaMask",isMobile:!0,url:"https://metamask.io"}})}async onConnectorWallet(t){window.ethereum?t==="injected"||t===sr.metaMask?this.onInjectedWallet():await ie.handleConnectorConnection(t):this.onInstallConnector()}desktopWalletsTemplate(){const{desktopWallets:t}=et.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=Zt.allowedExplorerListings(at.state.previewWallets);return t=Zt.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 Zt.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=ie.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Ft(e)}" src="${Ft(i)}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n?.universal,native:n?.native,icon:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=te.state,e=this.desktopWalletsTemplate(),r=this.previewWalletsTemplate(),n=this.connectorWalletsTemplate(),i=this.recentWalletTemplate(),s=e??r;let o=[...n,...s];o=Zt.walletTemplatesWithRecent(o,i);const a=t?s:o,c=a.length>4;let l=[];c?l=a.filter(w=>!w.values.includes(sr.coinbaseWallet)).slice(0,3):l=a;const p=Boolean(l.length);return V`<w3m-modal-header border="${!0}" title="Connect your wallet" .onAction="${ie.handleUriCopy}" .actionIcon="${ye.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${ye.MOBILE_ICON}<w3m-text variant="small-normal" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${ye.SCAN_ICON}<w3m-text variant="small-normal" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${p?V`<w3m-modal-footer><div class="w3m-desktop-title">${ye.DESKTOP_ICON}<w3m-text variant="small-normal" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${l} ${c?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};pc.styles=[le.globalCss,h8],pc=p8([we("w3m-desktop-wallet-selection")],pc);const g8=be`div{background-color:var(--color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--color-bg-3);text-align:center}a{color:var(--color-fg-accent);text-decoration:none;transition:opacity .2s ease-in-out}a:hover{opacity:.8}`;var m8=Object.defineProperty,w8=Object.getOwnPropertyDescriptor,y8=(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 gc=class extends de{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=et.state;return t??e?V`<div><w3m-text variant="small-normal" color="secondary">By connecting your wallet, you agree to our<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}};gc.styles=[le.globalCss,g8],gc=y8([we("w3m-legal-notice")],gc);const b8=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var v8=Object.defineProperty,_8=Object.getOwnPropertyDescriptor,E8=(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&&v8(e,r,i),i};let mc=class extends de{onGoToQrcode(){Re.push("Qrcode")}async onConnectorWallet(t){await ie.handleConnectorConnection(t)}mobileWalletsTemplate(){const{mobileWallets:t}=et.state,e=Zt.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()=>ie.handleMobileLinking({links:{native:s,universal:i},name:n,id:r})}"></w3m-wallet-button>`)}previewWalletsTemplate(){const{previewWallets:t}=at.state;let e=Zt.walletsWithInjected(t);return e=Zt.allowedExplorerListings(e),e=Zt.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()=>ie.handleMobileLinking({links:{native:i,universal:s},name:n,id:o,image:r.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){let t=Zt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==sr.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=ie.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Ft(e)}" src="${Ft(i)}" .onClick="${async()=>ie.handleMobileLinking({name:r,id:e,links:n,image:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=te.state,e=this.connectorWalletsTemplate(),r=this.mobileWalletsTemplate(),n=this.previewWalletsTemplate(),i=this.recentWalletTemplate(),s=r??n;let o=[...e,...s];o=Zt.walletTemplatesWithRecent(o,i);const a=t?s:o,c=a.length>8;let l=[];c?l=a.filter(y=>!y.values.includes(sr.coinbaseWallet)).slice(0,7):l=a;const p=l.slice(0,4),w=l.slice(4,8),m=Boolean(l.length);return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ye.QRCODE_ICON}"></w3m-modal-header>${m?V`<w3m-modal-content><div class="w3m-grid">${p} ${w.length?V`${w} ${c?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}`:null}</div></w3m-modal-content>`:null}`}};mc.styles=[le.globalCss,b8],mc=E8([we("w3m-mobile-wallet-selection")],mc);const x8=be`:host{all:initial}.w3m-overlay{inset:0;position:fixed;z-index:var(--modal-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}.w3m-open{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0}.w3m-card{width:100%;position:relative;transform:translateY(5px);border-radius:30px;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(--color-overlay);background-color:var(--color-bg-1);color:var(--color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{transform:translateY(5px);border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}`;var C8=Object.defineProperty,S8=Object.getOwnPropertyDescriptor,Hs=(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&&C8(e,r,i),i};let Xr=class extends de{constructor(){if(super(),this.open=!1,this.preload=!0,this.activeChainId=void 0,this.unsubscribeModal=void 0,this.unsubscribeConfig=void 0,this.unwatchAccount=void 0,this.unwatchNetwork=void 0,this.abortController=void 0,le.setTheme(),this.unsubscribeConfig=et.subscribe(le.setTheme),this.unsubscribeModal=ht.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()}),!te.state.isStandalone){te.getAccount();const t=te.getSelectedChain();this.activeChainId=t?.id,this.fetchEnsProfile(),this.fetchBalance(),this.unwatchNetwork=Ke.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(te.setSelectedChain(r),this.activeChainId=r.id,te.resetBalance(),this.fetchBalance())}),this.unwatchAccount=Ke.client().watchAccount(e=>{const{address:r}=te.state;e.address!==r&&(this.fetchEnsProfile(e.address),this.fetchBalance(e.address)),te.setAddress(e.address),te.setIsConnected(e.isConnected)})}this.preloadModalData()}disconnectedCallback(){var t,e,r,n;(t=this.unsubscribeModal)==null||t.call(this),(e=this.unsubscribeConfig)==null||e.call(this),(r=this.unwatchAccount)==null||r.call(this),(n=this.unwatchNetwork)==null||n.call(this)}get overlayEl(){return ie.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return ie.getShadowRootElement(this,".w3m-container")}async fetchEnsProfile(t){try{te.setProfileLoading(!0);const e=t??te.state.address,{id:r}=Ke.client().getDefaultChain();if(e&&r===1){const[n,i]=await Promise.all([Ke.client().fetchEnsName({address:e,chainId:1}),Ke.client().fetchEnsAvatar({address:e,chainId:1})]);i&&await ie.preloadImage(i),te.setProfileName(n),te.setProfileAvatar(i)}}catch(e){Nt.openToast(ie.getErrorMessage(e),"error")}finally{te.setProfileLoading(!1)}}async fetchBalance(t){try{te.setBalanceLoading(!0);const e=t??te.state.address;if(e){const r=await Ke.client().fetchBalance({address:e});te.setBalance({amount:r.formatted,symbol:r.symbol})}}catch(e){Nt.openToast(ie.getErrorMessage(e),"error")}finally{te.setBalanceLoading(!1)}}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>'))}async preloadExplorerData(){var t;const{standaloneChains:e,chains:r,isExplorer:n}=te.state;if(n){const i=e?.join(",");await Promise.all([at.getPreviewWallets({page:1,entries:10,chains:i,device:Te.isMobile()?"mobile":"desktop",version:Te.getWalletConnectVersion()}),at.getRecomendedWallets()]),te.setIsDataLoaded(!0);const{previewWallets:s,recomendedWallets:o}=at.state,a=(t=r?.map(l=>ie.getChainIcon(l.id)))!=null?t:[],c=[...s,...o].map(l=>l.image_url.lg);await this.preloadExplorerImages([...a,...c])}else te.setIsDataLoaded(!0)}async preloadExplorerImages(t){t.length&&await Promise.all(t.map(async e=>ie.preloadImage(e)))}async preloadCustomImages(){const t=ie.getCustomImageUrls();t.length&&await Promise.all(t.map(async e=>ie.preloadImage(e)))}async preloadConnectorImages(){const t=ie.getConnectorImageUrls();t.length&&await Promise.all(t.map(async e=>ie.preloadImage(e)))}async preloadModalData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadExplorerData(),this.preloadCustomImages(),this.preloadConnectorImages()]))}catch{Nt.openToast("Failed preloading","error")}}onCloseModal(t){t.target===t.currentTarget&&ht.close()}async onOpenModalEvent(){await this.preloadModalData(),this.toggleBodyScroll(!1);const t=.2;await _r(this.containerEl,{y:0},{duration:0}).finished,_r(this.overlayEl,{opacity:[0,1]},{duration:.2,delay:t}),_r(this.containerEl,ie.isMobileAnimation()?{y:["50vh",0]}:{scale:[.98,1]},{scale:{easing:Ds({velocity:.4})},y:{easing:Ds({mass:.5})},delay:t}),this.addKeyboardEvents(),this.open=!0}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents(),await Promise.all([_r(this.containerEl,ie.isMobileAnimation()?{y:[0,"50vh"]}:{scale:[1,.98]},{scale:{easing:Ds({velocity:0})},y:{easing:Ds({mass:.5})}}).finished,_r(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"?ht.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}render(){const t={"w3m-overlay":!0,"w3m-open":this.open};return V`<div id="w3m-modal" class="${Lt(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>`}};Xr.styles=[le.globalCss,x8],Hs([Fe()],Xr.prototype,"open",2),Hs([Fe()],Xr.prototype,"preload",2),Hs([Fe()],Xr.prototype,"activeChainId",2),Xr=Hs([we("w3m-modal")],Xr);const D8=be`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var I8=Object.defineProperty,O8=Object.getOwnPropertyDescriptor,zs=(t,e,r,n)=>{for(var i=n>1?void 0:n?O8(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 Qr=class extends de{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,ie.rejectStandaloneButtonComponent();const{selectedChain:t}=te.state;this.onSetChainData(t),this.unsubscribeNetwork=te.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=te.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(){ht.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=te.state,r=e&&e.length>1;return V`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${Ft(this.chainId)}"></w3m-network-image><w3m-text variant="medium-normal" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};Qr.styles=[le.globalCss,D8],zs([Fe()],Qr.prototype,"chainId",2),zs([Fe()],Qr.prototype,"label",2),zs([Fe()],Qr.prototype,"wrongNetwork",2),Qr=zs([we("w3m-network-switch")],Qr);const A8=be`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:10px;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:15px;justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--color-bg-2);box-shadow:inset 0 0 0 1px var(--color-overlay)}button:hover{background-color:var(--color-overlay)}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:8px;border:1px solid var(--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(--color-bg-3)}#wallet-placeholder-dash{stroke:var(--color-overlay)}`;var $8=Object.defineProperty,P8=Object.getOwnPropertyDescriptor,T8=(t,e,r,n)=>{for(var i=n>1?void 0:n?P8(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 wc=class extends de{onClick(t,e){t?Re.push("WalletExplorer"):e&&Re.push("WalletFilter")}render(){const{previewWallets:t}=at.state,e=ie.getCustomWallets(),r=[...t].reverse().slice(0,4),n=[...e].reverse().slice(0,4),i=Boolean(r.length),s=Boolean(n.length);return V`<button @click="${()=>this.onClick(i,s)}"><div class="w3m-icons">${i?r.map(o=>V`<img src="${o.image_url.lg}">`):null} ${s?n.map(o=>{const a=ie.getWalletId(o.id),c=ie.getWalletIcon(a);return c?V`<img src="${c}">`:ye.WALLET_PLACEHOLDER}):null}</div><w3m-text variant="xsmall-normal">View All</w3m-text></button>`}};wc.styles=[le.globalCss,A8],wc=T8([we("w3m-view-all-wallets-button")],wc);const R8=be`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var N8=Object.defineProperty,L8=Object.getOwnPropertyDescriptor,dd=(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&&N8(e,r,i),i};let Ws=class extends de{constructor(){super(),this.uri="",this.createConnectionAndWait()}get overlayEl(){return ie.getShadowRootElement(this,".w3m-qr-container")}async createConnectionAndWait(t=0){var e;try{const{standaloneUri:r}=te.state;r?setTimeout(()=>this.uri=r,0):(await Ke.client().connectWalletConnect(n=>this.uri=n,(e=te.state.selectedChain)==null?void 0:e.id),ht.close())}catch{Nt.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>`}};Ws.styles=[le.globalCss,R8],dd([Fe()],Ws.prototype,"uri",2),Ws=dd([we("w3m-walletconnect-qr")],Ws);const M8=be`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--color-bg-2);box-shadow:inset 0 0 0 1px var(--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(--color-success);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--color-success),inset 0 0 0 1px var(--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(--color-bg-2);padding:11px 20px}`;var U8=Object.defineProperty,F8=Object.getOwnPropertyDescriptor,B8=(t,e,r,n)=>{for(var i=n>1?void 0:n?F8(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 yc=class extends de{onDisconnect(){ht.close(),Ke.client().disconnect(),te.resetAccount()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=te.state.address)!=null?t:""),Nt.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-normal" 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="${ye.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${ye.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};yc.styles=[le.globalCss,M8],yc=B8([we("w3m-account-view")],yc);var j8=Object.defineProperty,k8=Object.getOwnPropertyDescriptor,H8=(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&&j8(e,r,i),i};let bc=class extends de{viewTemplate(){return Te.isAndroid()?V`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Te.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>`}};bc.styles=[le.globalCss],bc=H8([we("w3m-connect-wallet-view")],bc);const z8=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:15px;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 W8=Object.defineProperty,q8=Object.getOwnPropertyDescriptor,fd=(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 qs=class extends de{constructor(){super(),this.uri="",this.createConnectionAndWait()}getRouterData(){var t;const e=(t=Re.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=Te.formatNativeUrl(e,t,n);Te.openHref(i)}else if(r){const i=Te.formatUniversalUrl(r,t,n);Te.openHref(i,"_blank")}}async createConnectionAndWait(t=0){var e;const{standaloneUri:r}=te.state;if(r)this.onFormatAndRedirect(r);else try{await Ke.client().connectWalletConnect(c=>{this.uri=c,this.onFormatAndRedirect(c)},(e=te.state.selectedChain)==null?void 0:e.id);const{name:n,walletId:i,native:s,universal:o,icon:a}=this.getRouterData();ie.setRecentWallet({name:n,id:i,links:{native:s,universal:o},image:a}),ht.close()}catch{Nt.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}onConnectWithMobile(){Re.push("Qrcode")}onGoToWallet(){const{universal:t,name:e}=this.getRouterData();if(t){const r=Te.formatUniversalUrl(t,this.uri,e);Te.openHref(r,"_blank")}}render(){const{name:t,icon:e,universal:r,walletId:n}=this.getRouterData(),i=ie.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="${Ft(n)}"></w3m-wallet-image>`}<div class="w3m-connecting-title"><w3m-spinner></w3m-spinner><w3m-text variant="large-bold" color="secondary">${`Continue in ${i}...`}</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${async()=>this.createConnectionAndWait()}" .iconRight="${ye.RETRY_ICON}">Retry</w3m-button>${r?V`<w3m-button .onClick="${this.onGoToWallet.bind(this)}" .iconLeft="${ye.ARROW_UP_RIGHT_ICON}">Go to Wallet</w3m-button>`:V`<w3m-button .onClick="${this.onConnectWithMobile}" .iconLeft="${ye.MOBILE_ICON}">Connect with Mobile</w3m-button>`}</div></div></w3m-modal-content>`}};qs.styles=[le.globalCss,z8],fd([Fe()],qs.prototype,"uri",2),qs=fd([we("w3m-desktop-connector-view")],qs);const V8=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(--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(--color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var K8=Object.defineProperty,G8=Object.getOwnPropertyDescriptor,Z8=(t,e,r,n)=>{for(var i=n>1?void 0:n?G8(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&&K8(e,r,i),i};let vc=class extends de{constructor(){super(...arguments),this.explorerUrl="https://explorer.walletconnect.com/"}onGet(t){Te.openHref(t,"_blank")}onExplore(){Te.openHref(this.explorerUrl,"_blank")}render(){const{recomendedWallets:t}=at.state,e=ie.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-normal">${i}</w3m-text><w3m-button .iconRight="${ye.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-normal">${i}</w3m-text><w3m-button .iconRight="${ye.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-normal">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="${this.onExplore.bind(this)}" .iconRight="${ye.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};vc.styles=[le.globalCss,V8],vc=Z8([we("w3m-get-wallet-view")],vc);const Y8=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(--color-overlay)}`;var J8=Object.defineProperty,X8=Object.getOwnPropertyDescriptor,Q8=(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 _c=class extends de{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){Re.push("GetWallet")}onLearnMore(){Te.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">${ye.HELP_CHART_IMG} ${ye.HELP_PAINTING_IMG} ${ye.HELP_ETH_IMG}</div><w3m-text variant="medium-normal">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">${ye.HELP_KEY_IMG} ${ye.HELP_USER_IMG} ${ye.HELP_LOCK_IMG}</div><w3m-text variant="medium-normal">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">${ye.HELP_COMPAS_IMG} ${ye.HELP_NOUN_IMG} ${ye.HELP_DAO_IMG}</div><w3m-text variant="medium-normal">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="${ye.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${ye.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};_c.styles=[le.globalCss,Y8],_c=Q8([we("w3m-help-view")],_c);const e_=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:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-injected-error w3m-button{opacity:1}`;var t_=Object.defineProperty,r_=Object.getOwnPropertyDescriptor,Ec=(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&&t_(e,r,i),i};let Mi=class extends de{constructor(){super(),this.connecting=!0,this.error=!1,this.connector=Ke.client().getConnectorById("injected"),this.onConnect()}async onConnect(){const{ready:t}=this.connector;t&&(this.error=!1,this.connecting=!0,await ie.handleConnectorConnection("injected",()=>{this.error=!0,this.connecting=!1}))}render(){const t=ie.getWalletName(this.connector.name),e=ie.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="${Lt(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="large-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="${ye.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Mi.styles=[le.globalCss,e_],Ec([Fe()],Mi.prototype,"connecting",2),Ec([Fe()],Mi.prototype,"error",2),Mi=Ec([we("w3m-injected-connector-view")],Mi);const n_=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 i_=Object.defineProperty,s_=Object.getOwnPropertyDescriptor,o_=(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 xc=class extends de{getRouterData(){var t;const e=(t=Re.state.data)==null?void 0:t.InstallConnector;if(!e)throw new Error("Missing router data");return e}onInstall(){const{url:t}=this.getRouterData();Te.openHref(t,"_blank")}onMobile(){const{name:t}=this.getRouterData();Re.push("ConnectWallet"),Nt.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="large-bold">Install ${t}</w3m-text><w3m-text color="secondary" variant="medium-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="${ye.ARROW_DOWN_ICON}">Install Extension</w3m-button>${r?V`<w3m-button .onClick="${this.onMobile.bind(this)}" .iconLeft="${ye.MOBILE_ICON}">${t} Mobile</w3m-button>`:null}</div></div></w3m-modal-content>`}};xc.styles=[le.globalCss,n_],xc=o_([we("w3m-install-connector-view")],xc);var a_=Object.defineProperty,c_=Object.getOwnPropertyDescriptor,l_=(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 Cc=class extends de{render(){return V`<w3m-modal-header title="Scan the code" .onAction="${ie.handleUriCopy}" .actionIcon="${ye.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Cc.styles=[le.globalCss],Cc=l_([we("w3m-qrcode-view")],Cc);const u_=be`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}`;var h_=Object.defineProperty,d_=Object.getOwnPropertyDescriptor,f_=(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&&h_(e,r,i),i};let Sc=class extends de{onSelectChain(t){const{isConnected:e,selectedChain:r}=te.state;e?r?.id===t.id?Re.replace("Account"):Re.push("SwitchNetwork",{SwitchNetwork:t}):(Re.push("ConnectWallet"),te.setSelectedChain(t))}render(){const{chains:t}=te.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="${()=>this.onSelectChain(e)}">${e.name}</w3m-network-button>`)}</div></w3m-modal-content>`}};Sc.styles=[le.globalCss,u_],Sc=f_([we("w3m-select-network-view")],Sc);const p_=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 g_=Object.defineProperty,m_=Object.getOwnPropertyDescriptor,pd=(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 Vs=class extends de{constructor(){super(),this.error=!1,this.onSwitchNetwork()}getRouterData(){var t;const e=(t=Re.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 Ke.client().switchNetwork({chainId:t.id}),te.setSelectedChain(t),Re.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="${Lt(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="large-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="${ye.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Vs.styles=[le.globalCss,p_],pd([Fe()],Vs.prototype,"error",2),Vs=pd([we("w3m-switch-network-view")],Vs);const w_=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(--color-bg-1);background:linear-gradient(var(--color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--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 y_=Object.defineProperty,b_=Object.getOwnPropertyDescriptor,Ui=(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};const Dc=40;let en=class extends de{constructor(){super(...arguments),this.loading=!at.state.wallets.listings.length,this.firstFetch=!at.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=ie.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,at.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),at.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return ie.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}=at.state,{listings:r,total:n}=this.search?e:t;return n<=Dc||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r}=at.state,n=ie.getExtensionWallets(),{listings:i,total:s,page:o}=this.search?r:e;if(!this.endReached&&(this.firstFetch||s>Dc&&i.length<s))try{this.loading=!0;const a=(t=te.state.standaloneChains)==null?void 0:t.join(","),{listings:c}=await at.getPaginatedWallets({page:this.firstFetch?1:o+1,entries:Dc,device:Te.isMobile()?"mobile":"desktop",search:this.search,version:Te.getWalletConnectVersion(),chains:a}),l=c.map(({image_url:w})=>w.lg),p=n.map(({id:w})=>ie.getWalletIcon(w));await Promise.all([...l.map(async w=>ie.preloadImage(w)),...p.map(async w=>ie.preloadImage(w)),Te.wait(300)]),this.endReached=this.isLastPage()}catch(a){Nt.openToast(ie.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}async onConnectPlatform(t){if(Te.isMobile()){const{id:e,image_url:r}=t,{native:n,universal:i}=t.mobile;await ie.handleMobileLinking({links:{native:n,universal:i},name:t.name,id:e,image:r.lg})}else Re.push("DesktopConnector",{DesktopConnector:{name:t.name,icon:t.image_url.lg,universal:t.desktop.universal||t.homepage,native:t.desktop.native}})}onConnectExtension(t){ie.getWalletId("")===t.id?Re.push("InjectedConnector"):Re.push("InstallConnector",{InstallConnector:t})}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}coinbaseConnectorTemplate(){try{const t=Ke.client().getConnectorById(sr.coinbaseWallet);return V`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${async()=>ie.handleConnectorConnection(sr.coinbaseWallet)}"></w3m-wallet-button>`}catch{return null}}render(){const{wallets:t,search:e}=at.state,{isStandalone:r}=te.state;let{listings:n}=this.search?e:t;n=Zt.allowedExplorerListings(n);const i=this.loading&&!n.length,s=this.search.length>=3,o=!i&&(!s||ie.caseSafeIncludes(sr.coinbaseWallet,this.search));let a=!r&&!Te.isMobile()?ie.getExtensionWallets():[];s&&(a=a.filter(({name:w})=>ie.caseSafeIncludes(w,this.search)));const c=!this.loading&&!n.length&&!a.length&&!o,l=Math.max(a.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="${Lt(p)}"><div class="w3m-grid">${i?null:[...Array(l)].map((w,m)=>V`${a[m]?V`<w3m-wallet-button name="${a[m].name}" walletId="${a[m].id}" .onClick="${()=>this.onConnectExtension(a[m])}"></w3m-wallet-button>`:null} ${n[m]?V`<w3m-wallet-button src="${n[m].image_url.lg}" name="${n[m].name}" walletId="${n[m].id}" .onClick="${async()=>this.onConnectPlatform(n[m])}"></w3m-wallet-button>`:null}`)} ${o?this.coinbaseConnectorTemplate():null}</div><div class="w3m-placeholder-block">${c?V`<w3m-text variant="large-bold" color="secondary">No results found</w3m-text>`:null} ${!c&&this.loading?V`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};en.styles=[le.globalCss,w_],Ui([Fe()],en.prototype,"loading",2),Ui([Fe()],en.prototype,"firstFetch",2),Ui([Fe()],en.prototype,"search",2),Ui([Fe()],en.prototype,"endReached",2),en=Ui([we("w3m-wallet-explorer-view")],en);const v_=be`w3m-modal-content{display:flex;max-height:55vh;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}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(--color-bg-1);background:linear-gradient(var(--color-bg-1),transparent)}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--color-bg-1);background:linear-gradient(transparent,var(--color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var __=Object.defineProperty,E_=Object.getOwnPropertyDescriptor,gd=(t,e,r,n)=>{for(var i=n>1?void 0:n?E_(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,r,i),i};let Ks=class extends de{constructor(){super(...arguments),this.search=""}async onConnectPlatform({name:t,universal:e,native:r,walletId:n}){Te.isMobile()?await ie.handleMobileLinking({links:{native:r,universal:e},name:t,id:n}):Re.push("DesktopConnector",{DesktopConnector:{name:t,walletId:n,universal:e,native:r}})}onSearchChange(t){const{value:e}=t.target;this.search=e}render(){const t=ie.getCustomWallets(),e=this.search.length?t.filter(r=>ie.caseSafeIncludes(r.name,this.search)):t;return V`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${e.map(({id:r,name:n,links:{native:i,universal:s}})=>V`<w3m-wallet-button walletId="${r}" name="${n}" .onClick="${async()=>this.onConnectPlatform({name:n,universal:s,native:i,walletId:r})}"></w3m-wallet-button>`)}</div></w3m-modal-content>`}};Ks.styles=[le.globalCss,v_],gd([Fe()],Ks.prototype,"search",2),Ks=gd([we("w3m-wallet-filter-view")],Ks);var x_=Object.freeze({__proto__:null,get W3mAccountButton(){return $i},get W3mConnectButton(){return Yr},get W3mCoreButton(){return Jr},get W3mModal(){return Xr},get W3mNetworkSwitch(){return Qr}});Or.EthereumProvider=vb,Or.default=ws,Object.defineProperty(Or,"__esModule",{value:!0})});
|
|
131
131
|
//# sourceMappingURL=index.umd.js.map
|