@walletconnect/ethereum-provider 2.4.5 → 2.4.6-793c2c4b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Zt,ut){typeof exports=="object"&&typeof module<"u"?ut(exports):typeof define=="function"&&define.amd?define(["exports"],ut):(Zt=typeof globalThis<"u"?globalThis:Zt||self,ut(Zt["@walletconnect/ethereum-provider"]={}))})(this,function(Zt){"use strict";var ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function $r(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 _t={exports:{}},an=typeof Reflect=="object"?Reflect:null,Fc=an&&typeof an.apply=="function"?an.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},zi;an&&typeof an.ownKeys=="function"?zi=an.ownKeys:Object.getOwnPropertySymbols?zi=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:zi=function(e){return Object.getOwnPropertyNames(e)};function Bd(t){console&&console.warn&&console.warn(t)}var Bc=Number.isNaN||function(e){return e!==e};function He(){He.init.call(this)}_t.exports=He,_t.exports.once=zd,He.EventEmitter=He,He.prototype._events=void 0,He.prototype._eventsCount=0,He.prototype._maxListeners=void 0;var jc=10;function Wi(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(He,"defaultMaxListeners",{enumerable:!0,get:function(){return jc},set:function(t){if(typeof t!="number"||t<0||Bc(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");jc=t}}),He.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},He.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Bc(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 kc(t){return t._maxListeners===void 0?He.defaultMaxListeners:t._maxListeners}He.prototype.getMaxListeners=function(){return kc(this)},He.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")Fc(c,this,r);else for(var l=c.length,p=Vc(c,l),n=0;n<l;++n)Fc(p[n],this,r);return!0};function Hc(t,e,r,n){var i,s,o;if(Wi(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=kc(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,Bd(a)}return t}He.prototype.addListener=function(e,r){return Hc(this,e,r,!1)},He.prototype.on=He.prototype.addListener,He.prototype.prependListener=function(e,r){return Hc(this,e,r,!0)};function jd(){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 zc(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=jd.bind(n);return i.listener=r,n.wrapFn=i,i}He.prototype.once=function(e,r){return Wi(r),this.on(e,zc(this,e,r)),this},He.prototype.prependOnceListener=function(e,r){return Wi(r),this.prependListener(e,zc(this,e,r)),this},He.prototype.removeListener=function(e,r){var n,i,s,o,a;if(Wi(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():kd(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this},He.prototype.off=He.prototype.removeListener,He.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 Wc(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?Hd(i):Vc(i,i.length)}He.prototype.listeners=function(e){return Wc(this,e,!0)},He.prototype.rawListeners=function(e){return Wc(this,e,!1)},He.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):qc.call(t,e)},He.prototype.listenerCount=qc;function qc(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}He.prototype.eventNames=function(){return this._eventsCount>0?zi(this._events):[]};function Vc(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function kd(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Hd(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function zd(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))}Kc(t,e,s,{once:!0}),e!=="error"&&Wd(t,i,{once:!0})})}function Wd(t,e,r){typeof t.on=="function"&&Kc(t,"error",e,r)}function Kc(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 oo={},qi={},ve={},Gc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,p=a&65535,w=c>>>16&65535,y=c&65535;return p*y+(l*y+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}})(Gc),Object.defineProperty(ve,"__esModule",{value:!0});var Yc=Gc;function qd(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}ve.readInt16BE=qd;function Vd(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}ve.readUint16BE=Vd;function Kd(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}ve.readInt16LE=Kd;function Gd(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}ve.readUint16LE=Gd;function Zc(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}ve.writeUint16BE=Zc,ve.writeInt16BE=Zc;function Jc(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}ve.writeUint16LE=Jc,ve.writeInt16LE=Jc;function ao(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}ve.readInt32BE=ao;function co(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}ve.readUint32BE=co;function lo(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}ve.readInt32LE=lo;function uo(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}ve.readUint32LE=uo;function Vi(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}ve.writeUint32BE=Vi,ve.writeInt32BE=Vi;function Ki(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}ve.writeUint32LE=Ki,ve.writeInt32LE=Ki;function Yd(t,e){e===void 0&&(e=0);var r=ao(t,e),n=ao(t,e+4);return r*4294967296+n-(n>>31)*4294967296}ve.readInt64BE=Yd;function Zd(t,e){e===void 0&&(e=0);var r=co(t,e),n=co(t,e+4);return r*4294967296+n}ve.readUint64BE=Zd;function Jd(t,e){e===void 0&&(e=0);var r=lo(t,e),n=lo(t,e+4);return n*4294967296+r-(r>>31)*4294967296}ve.readInt64LE=Jd;function Xd(t,e){e===void 0&&(e=0);var r=uo(t,e),n=uo(t,e+4);return n*4294967296+r}ve.readUint64LE=Xd;function Xc(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Vi(t/4294967296>>>0,e,r),Vi(t>>>0,e,r+4),e}ve.writeUint64BE=Xc,ve.writeInt64BE=Xc;function Qc(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ki(t>>>0,e,r),Ki(t/4294967296>>>0,e,r+4),e}ve.writeUint64LE=Qc,ve.writeInt64LE=Qc;function Qd(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}ve.readUintBE=Qd;function ef(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}ve.readUintLE=ef;function tf(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(!Yc.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}ve.writeUintBE=tf;function rf(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(!Yc.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}ve.writeUintLE=rf;function nf(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}ve.readFloat32BE=nf;function sf(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}ve.readFloat32LE=sf;function of(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}ve.readFloat64BE=of;function af(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}ve.readFloat64LE=af;function cf(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}ve.writeFloat32BE=cf;function lf(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}ve.writeFloat32LE=lf;function uf(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}ve.writeFloat64BE=uf;function hf(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}ve.writeFloat64LE=hf;var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});function df(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Ut.wipe=df,Object.defineProperty(qi,"__esModule",{value:!0});var It=ve,ho=Ut,ff=20;function pf(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],y=r[23]<<24|r[22]<<16|r[21]<<8|r[20],m=r[27]<<24|r[26]<<16|r[25]<<8|r[24],E=r[31]<<24|r[30]<<16|r[29]<<8|r[28],A=e[3]<<24|e[2]<<16|e[1]<<8|e[0],N=e[7]<<24|e[6]<<16|e[5]<<8|e[4],M=e[11]<<24|e[10]<<16|e[9]<<8|e[8],x=e[15]<<24|e[14]<<16|e[13]<<8|e[12],D=n,b=i,I=s,O=o,h=a,_=c,H=l,j=p,q=w,X=y,re=m,C=E,$=A,G=N,K=M,W=x,z=0;z<ff;z+=2)D=D+h|0,$^=D,$=$>>>32-16|$<<16,q=q+$|0,h^=q,h=h>>>32-12|h<<12,b=b+_|0,G^=b,G=G>>>32-16|G<<16,X=X+G|0,_^=X,_=_>>>32-12|_<<12,I=I+H|0,K^=I,K=K>>>32-16|K<<16,re=re+K|0,H^=re,H=H>>>32-12|H<<12,O=O+j|0,W^=O,W=W>>>32-16|W<<16,C=C+W|0,j^=C,j=j>>>32-12|j<<12,I=I+H|0,K^=I,K=K>>>32-8|K<<8,re=re+K|0,H^=re,H=H>>>32-7|H<<7,O=O+j|0,W^=O,W=W>>>32-8|W<<8,C=C+W|0,j^=C,j=j>>>32-7|j<<7,b=b+_|0,G^=b,G=G>>>32-8|G<<8,X=X+G|0,_^=X,_=_>>>32-7|_<<7,D=D+h|0,$^=D,$=$>>>32-8|$<<8,q=q+$|0,h^=q,h=h>>>32-7|h<<7,D=D+_|0,W^=D,W=W>>>32-16|W<<16,re=re+W|0,_^=re,_=_>>>32-12|_<<12,b=b+H|0,$^=b,$=$>>>32-16|$<<16,C=C+$|0,H^=C,H=H>>>32-12|H<<12,I=I+j|0,G^=I,G=G>>>32-16|G<<16,q=q+G|0,j^=q,j=j>>>32-12|j<<12,O=O+h|0,K^=O,K=K>>>32-16|K<<16,X=X+K|0,h^=X,h=h>>>32-12|h<<12,I=I+j|0,G^=I,G=G>>>32-8|G<<8,q=q+G|0,j^=q,j=j>>>32-7|j<<7,O=O+h|0,K^=O,K=K>>>32-8|K<<8,X=X+K|0,h^=X,h=h>>>32-7|h<<7,b=b+H|0,$^=b,$=$>>>32-8|$<<8,C=C+$|0,H^=C,H=H>>>32-7|H<<7,D=D+_|0,W^=D,W=W>>>32-8|W<<8,re=re+W|0,_^=re,_=_>>>32-7|_<<7;It.writeUint32LE(D+n|0,t,0),It.writeUint32LE(b+i|0,t,4),It.writeUint32LE(I+s|0,t,8),It.writeUint32LE(O+o|0,t,12),It.writeUint32LE(h+a|0,t,16),It.writeUint32LE(_+c|0,t,20),It.writeUint32LE(H+l|0,t,24),It.writeUint32LE(j+p|0,t,28),It.writeUint32LE(q+w|0,t,32),It.writeUint32LE(X+y|0,t,36),It.writeUint32LE(re+m|0,t,40),It.writeUint32LE(C+E|0,t,44),It.writeUint32LE($+A|0,t,48),It.writeUint32LE(G+N|0,t,52),It.writeUint32LE(K+M|0,t,56),It.writeUint32LE(W+x|0,t,60)}function el(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){pf(a,s,t);for(var l=c;l<c+64&&l<r.length;l++)n[l]=r[l]^a[l-c];mf(s,0,o)}return ho.wipe(a),i===0&&ho.wipe(s),n}qi.streamXOR=el;function gf(t,e,r,n){return n===void 0&&(n=0),ho.wipe(r),el(t,e,r,r,n)}qi.stream=gf;function mf(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 tl={},gr={};Object.defineProperty(gr,"__esModule",{value:!0});function wf(t,e,r){return~(t-1)&e|t-1&r}gr.select=wf;function yf(t,e){return(t|0)-(e|0)-1>>>31&1}gr.lessOrEqual=yf;function rl(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}gr.compare=rl;function bf(t,e){return t.length===0||e.length===0?!1:rl(t,e)!==0}gr.equal=bf,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=gr,r=Ut;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 y=a[8]|a[9]<<8;this._r[4]=(w>>>4|y<<12)&255,this._r[5]=y>>>1&8190;var m=a[10]|a[11]<<8;this._r[6]=(y>>>14|m<<2)&8191;var E=a[12]|a[13]<<8;this._r[7]=(m>>>11|E<<5)&8065;var A=a[14]|a[15]<<8;this._r[8]=(E>>>8|A<<8)&8191,this._r[9]=A>>>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],y=this._h[1],m=this._h[2],E=this._h[3],A=this._h[4],N=this._h[5],M=this._h[6],x=this._h[7],D=this._h[8],b=this._h[9],I=this._r[0],O=this._r[1],h=this._r[2],_=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[c+0]|a[c+1]<<8;w+=$&8191;var G=a[c+2]|a[c+3]<<8;y+=($>>>13|G<<3)&8191;var K=a[c+4]|a[c+5]<<8;m+=(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;A+=(W>>>4|z<<12)&8191,N+=z>>>1&8191;var J=a[c+10]|a[c+11]<<8;M+=(z>>>14|J<<2)&8191;var Y=a[c+12]|a[c+13]<<8;x+=(J>>>11|Y<<5)&8191;var le=a[c+14]|a[c+15]<<8;D+=(Y>>>8|le<<8)&8191,b+=le>>>5|p;var ee=0,fe=ee;fe+=w*I,fe+=y*(5*C),fe+=m*(5*re),fe+=E*(5*X),fe+=A*(5*q),ee=fe>>>13,fe&=8191,fe+=N*(5*j),fe+=M*(5*H),fe+=x*(5*_),fe+=D*(5*h),fe+=b*(5*O),ee+=fe>>>13,fe&=8191;var ae=ee;ae+=w*O,ae+=y*I,ae+=m*(5*C),ae+=E*(5*re),ae+=A*(5*X),ee=ae>>>13,ae&=8191,ae+=N*(5*q),ae+=M*(5*j),ae+=x*(5*H),ae+=D*(5*_),ae+=b*(5*h),ee+=ae>>>13,ae&=8191;var Ce=ee;Ce+=w*h,Ce+=y*O,Ce+=m*I,Ce+=E*(5*C),Ce+=A*(5*re),ee=Ce>>>13,Ce&=8191,Ce+=N*(5*X),Ce+=M*(5*q),Ce+=x*(5*j),Ce+=D*(5*H),Ce+=b*(5*_),ee+=Ce>>>13,Ce&=8191;var B=ee;B+=w*_,B+=y*h,B+=m*O,B+=E*I,B+=A*(5*C),ee=B>>>13,B&=8191,B+=N*(5*re),B+=M*(5*X),B+=x*(5*q),B+=D*(5*j),B+=b*(5*H),ee+=B>>>13,B&=8191;var F=ee;F+=w*H,F+=y*_,F+=m*h,F+=E*O,F+=A*I,ee=F>>>13,F&=8191,F+=N*(5*C),F+=M*(5*re),F+=x*(5*X),F+=D*(5*q),F+=b*(5*j),ee+=F>>>13,F&=8191;var R=ee;R+=w*j,R+=y*H,R+=m*_,R+=E*h,R+=A*O,ee=R>>>13,R&=8191,R+=N*I,R+=M*(5*C),R+=x*(5*re),R+=D*(5*X),R+=b*(5*q),ee+=R>>>13,R&=8191;var f=ee;f+=w*q,f+=y*j,f+=m*H,f+=E*_,f+=A*h,ee=f>>>13,f&=8191,f+=N*O,f+=M*I,f+=x*(5*C),f+=D*(5*re),f+=b*(5*X),ee+=f>>>13,f&=8191;var P=ee;P+=w*X,P+=y*q,P+=m*j,P+=E*H,P+=A*_,ee=P>>>13,P&=8191,P+=N*h,P+=M*O,P+=x*I,P+=D*(5*C),P+=b*(5*re),ee+=P>>>13,P&=8191;var te=ee;te+=w*re,te+=y*X,te+=m*q,te+=E*j,te+=A*H,ee=te>>>13,te&=8191,te+=N*_,te+=M*h,te+=x*O,te+=D*I,te+=b*(5*C),ee+=te>>>13,te&=8191;var ie=ee;ie+=w*C,ie+=y*re,ie+=m*X,ie+=E*q,ie+=A*j,ee=ie>>>13,ie&=8191,ie+=N*H,ie+=M*_,ie+=x*h,ie+=D*O,ie+=b*I,ee+=ie>>>13,ie&=8191,ee=(ee<<2)+ee|0,ee=ee+fe|0,fe=ee&8191,ee=ee>>>13,ae+=ee,w=fe,y=ae,m=Ce,E=B,A=F,N=R,M=f,x=P,D=te,b=ie,c+=16,l-=16}this._h[0]=w,this._h[1]=y,this._h[2]=m,this._h[3]=E,this._h[4]=A,this._h[5]=N,this._h[6]=M,this._h[7]=x,this._h[8]=D,this._h[9]=b},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),p,w,y,m;if(this._leftover){for(m=this._leftover,this._buffer[m++]=1;m<16;m++)this._buffer[m]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(p=this._h[1]>>>13,this._h[1]&=8191,m=2;m<10;m++)this._h[m]+=p,p=this._h[m]>>>13,this._h[m]&=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,m=1;m<10;m++)l[m]=this._h[m]+p,p=l[m]>>>13,l[m]&=8191;for(l[9]-=1<<13,w=(p^1)-1,m=0;m<10;m++)l[m]&=w;for(w=~w,m=0;m<10;m++)this._h[m]=this._h[m]&w|l[m];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,y=this._h[0]+this._pad[0],this._h[0]=y&65535,m=1;m<8;m++)y=(this._h[m]+this._pad[m]|0)+(y>>>16)|0,this._h[m]=y&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}(tl),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=qi,r=tl,n=Ut,i=ve,s=gr;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,y){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var m=new Uint8Array(16);m.set(l,m.length-l.length);var E=new Uint8Array(32);e.stream(this._key,m,E,4);var A=p.length+this.tagLength,N;if(y){if(y.length!==A)throw new Error("ChaCha20Poly1305: incorrect destination length");N=y}else N=new Uint8Array(A);return e.streamXOR(this._key,m,p,N,4),this._authenticate(N.subarray(N.length-this.tagLength,N.length),E,N.subarray(0,N.length-this.tagLength),w),n.wipe(m),N},c.prototype.open=function(l,p,w,y){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(p.length<this.tagLength)return null;var m=new Uint8Array(16);m.set(l,m.length-l.length);var E=new Uint8Array(32);e.stream(this._key,m,E,4);var A=new Uint8Array(this.tagLength);if(this._authenticate(A,E,p.subarray(0,p.length-this.tagLength),w),!s.equal(A,p.subarray(p.length-this.tagLength,p.length)))return null;var N=p.length-this.tagLength,M;if(y){if(y.length!==N)throw new Error("ChaCha20Poly1305: incorrect destination length");M=y}else M=new Uint8Array(N);return e.streamXOR(this._key,m,p.subarray(0,p.length-this.tagLength),M,4),n.wipe(m),M},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(l,p,w,y){var m=new r.Poly1305(p);y&&(m.update(y),y.length%16>0&&m.update(o.subarray(y.length%16))),m.update(w),w.length%16>0&&m.update(o.subarray(w.length%16));var E=new Uint8Array(8);y&&i.writeUint64LE(y.length,E),m.update(E),i.writeUint64LE(w.length,E),m.update(E);for(var A=m.digest(),N=0;N<A.length;N++)l[N]=A[N];m.clean(),n.wipe(A),n.wipe(E)},c}();t.ChaCha20Poly1305=a}(oo);var nl={},Nn={},fo={};Object.defineProperty(fo,"__esModule",{value:!0});function vf(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}fo.isSerializableHash=vf,Object.defineProperty(Nn,"__esModule",{value:!0});var Qt=fo,_f=gr,Ef=Ut,il=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),Qt.isSerializableHash(this._inner)&&Qt.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Ef.wipe(n)}return t.prototype.reset=function(){if(!Qt.isSerializableHash(this._inner)||!Qt.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(){Qt.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Qt.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(!Qt.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(!Qt.isSerializableHash(this._inner)||!Qt.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(!Qt.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Nn.HMAC=il;function xf(t,e,r){var n=new il(t,e);n.update(r);var i=n.digest();return n.clean(),i}Nn.hmac=xf,Nn.equal=_f.equal,Object.defineProperty(nl,"__esModule",{value:!0});var sl=Nn,ol=Ut,Cf=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=sl.hmac(this._hash,n,r);this._hmac=new sl.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(),ol.wipe(this._buffer),ol.wipe(this._counter),this._bufpos=0},t}(),Sf=nl.HKDF=Cf,cn={},Gi={},Yi={};Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.BrowserRandomSource=void 0;const al=65536;class If{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+=al)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,al)));return r}}Yi.BrowserRandomSource=If;function Df(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 Zi={},Of={},Af=Object.freeze({__proto__:null,default:Of}),$f=$r(Af);Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.NodeRandomSource=void 0;const Pf=Ut;class Tf{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Df<"u"){const e=$f;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,Pf.wipe)(r),n}}Zi.NodeRandomSource=Tf,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.SystemRandomSource=void 0;const Nf=Yi,Rf=Zi;class Lf{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Nf.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Rf.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)}}Gi.SystemRandomSource=Lf,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Gi,r=ve,n=Ut;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 y="";const m=p.length,E=256-256%m;for(;l>0;){const A=i(Math.ceil(l*256/E),w);for(let N=0;N<A.length&&l>0;N++){const M=A[N];M<E&&(y+=p.charAt(M%m),l--)}(0,n.wipe)(A)}return y}t.randomString=a;function c(l,p=o,w=t.defaultRandomSource){const y=Math.ceil(l/(Math.log(p.length)/Math.LN2));return a(y,p,w)}t.randomStringForEntropy=c}(cn);var Ji={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ve,r=Ut;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,y=l<<3,m=l%64<56?64:128;this._buffer[p]=128;for(var E=p+1;E<m-8;E++)this._buffer[E]=0;e.writeUint32BE(w,this._buffer,m-8),e.writeUint32BE(y,this._buffer,m-4),s(this._temp,this._state,this._buffer,0,m),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 y=c[0],m=c[1],E=c[2],A=c[3],N=c[4],M=c[5],x=c[6],D=c[7],b=0;b<16;b++){var I=p+b*4;a[b]=e.readUint32BE(l,I)}for(var b=16;b<64;b++){var O=a[b-2],h=(O>>>17|O<<32-17)^(O>>>19|O<<32-19)^O>>>10;O=a[b-15];var _=(O>>>7|O<<32-7)^(O>>>18|O<<32-18)^O>>>3;a[b]=(h+a[b-7]|0)+(_+a[b-16]|0)}for(var b=0;b<64;b++){var h=(((N>>>6|N<<26)^(N>>>11|N<<21)^(N>>>25|N<<7))+(N&M^~N&x)|0)+(D+(i[b]+a[b]|0)|0)|0,_=((y>>>2|y<<32-2)^(y>>>13|y<<32-13)^(y>>>22|y<<32-22))+(y&m^y&E^m&E)|0;D=x,x=M,M=N,N=A+h|0,A=E,E=m,m=y,y=h+_|0}c[0]+=y,c[1]+=m,c[2]+=E,c[3]+=A,c[4]+=N,c[5]+=M,c[6]+=x,c[7]+=D,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})(Ji);var po={};(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=cn,r=Ut;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(b){const I=new Float64Array(16);if(b)for(let O=0;O<b.length;O++)I[O]=b[O];return I}const i=new Uint8Array(32);i[0]=9;const s=n([56129,1]);function o(b){let I=1;for(let O=0;O<16;O++){let h=b[O]+I+65535;I=Math.floor(h/65536),b[O]=h-I*65536}b[0]+=I-1+37*(I-1)}function a(b,I,O){const h=~(O-1);for(let _=0;_<16;_++){const H=h&(b[_]^I[_]);b[_]^=H,I[_]^=H}}function c(b,I){const O=n(),h=n();for(let _=0;_<16;_++)h[_]=I[_];o(h),o(h),o(h);for(let _=0;_<2;_++){O[0]=h[0]-65517;for(let j=1;j<15;j++)O[j]=h[j]-65535-(O[j-1]>>16&1),O[j-1]&=65535;O[15]=h[15]-32767-(O[14]>>16&1);const H=O[15]>>16&1;O[14]&=65535,a(h,O,1-H)}for(let _=0;_<16;_++)b[2*_]=h[_]&255,b[2*_+1]=h[_]>>8}function l(b,I){for(let O=0;O<16;O++)b[O]=I[2*O]+(I[2*O+1]<<8);b[15]&=32767}function p(b,I,O){for(let h=0;h<16;h++)b[h]=I[h]+O[h]}function w(b,I,O){for(let h=0;h<16;h++)b[h]=I[h]-O[h]}function y(b,I,O){let h,_,H=0,j=0,q=0,X=0,re=0,C=0,$=0,G=0,K=0,W=0,z=0,J=0,Y=0,le=0,ee=0,fe=0,ae=0,Ce=0,B=0,F=0,R=0,f=0,P=0,te=0,ie=0,Ee=0,Le=0,$e=0,Me=0,Ye=0,Ke=0,Pe=O[0],De=O[1],ge=O[2],Se=O[3],Oe=O[4],pe=O[5],xe=O[6],g=O[7],u=O[8],d=O[9],v=O[10],T=O[11],U=O[12],k=O[13],oe=O[14],he=O[15];h=I[0],H+=h*Pe,j+=h*De,q+=h*ge,X+=h*Se,re+=h*Oe,C+=h*pe,$+=h*xe,G+=h*g,K+=h*u,W+=h*d,z+=h*v,J+=h*T,Y+=h*U,le+=h*k,ee+=h*oe,fe+=h*he,h=I[1],j+=h*Pe,q+=h*De,X+=h*ge,re+=h*Se,C+=h*Oe,$+=h*pe,G+=h*xe,K+=h*g,W+=h*u,z+=h*d,J+=h*v,Y+=h*T,le+=h*U,ee+=h*k,fe+=h*oe,ae+=h*he,h=I[2],q+=h*Pe,X+=h*De,re+=h*ge,C+=h*Se,$+=h*Oe,G+=h*pe,K+=h*xe,W+=h*g,z+=h*u,J+=h*d,Y+=h*v,le+=h*T,ee+=h*U,fe+=h*k,ae+=h*oe,Ce+=h*he,h=I[3],X+=h*Pe,re+=h*De,C+=h*ge,$+=h*Se,G+=h*Oe,K+=h*pe,W+=h*xe,z+=h*g,J+=h*u,Y+=h*d,le+=h*v,ee+=h*T,fe+=h*U,ae+=h*k,Ce+=h*oe,B+=h*he,h=I[4],re+=h*Pe,C+=h*De,$+=h*ge,G+=h*Se,K+=h*Oe,W+=h*pe,z+=h*xe,J+=h*g,Y+=h*u,le+=h*d,ee+=h*v,fe+=h*T,ae+=h*U,Ce+=h*k,B+=h*oe,F+=h*he,h=I[5],C+=h*Pe,$+=h*De,G+=h*ge,K+=h*Se,W+=h*Oe,z+=h*pe,J+=h*xe,Y+=h*g,le+=h*u,ee+=h*d,fe+=h*v,ae+=h*T,Ce+=h*U,B+=h*k,F+=h*oe,R+=h*he,h=I[6],$+=h*Pe,G+=h*De,K+=h*ge,W+=h*Se,z+=h*Oe,J+=h*pe,Y+=h*xe,le+=h*g,ee+=h*u,fe+=h*d,ae+=h*v,Ce+=h*T,B+=h*U,F+=h*k,R+=h*oe,f+=h*he,h=I[7],G+=h*Pe,K+=h*De,W+=h*ge,z+=h*Se,J+=h*Oe,Y+=h*pe,le+=h*xe,ee+=h*g,fe+=h*u,ae+=h*d,Ce+=h*v,B+=h*T,F+=h*U,R+=h*k,f+=h*oe,P+=h*he,h=I[8],K+=h*Pe,W+=h*De,z+=h*ge,J+=h*Se,Y+=h*Oe,le+=h*pe,ee+=h*xe,fe+=h*g,ae+=h*u,Ce+=h*d,B+=h*v,F+=h*T,R+=h*U,f+=h*k,P+=h*oe,te+=h*he,h=I[9],W+=h*Pe,z+=h*De,J+=h*ge,Y+=h*Se,le+=h*Oe,ee+=h*pe,fe+=h*xe,ae+=h*g,Ce+=h*u,B+=h*d,F+=h*v,R+=h*T,f+=h*U,P+=h*k,te+=h*oe,ie+=h*he,h=I[10],z+=h*Pe,J+=h*De,Y+=h*ge,le+=h*Se,ee+=h*Oe,fe+=h*pe,ae+=h*xe,Ce+=h*g,B+=h*u,F+=h*d,R+=h*v,f+=h*T,P+=h*U,te+=h*k,ie+=h*oe,Ee+=h*he,h=I[11],J+=h*Pe,Y+=h*De,le+=h*ge,ee+=h*Se,fe+=h*Oe,ae+=h*pe,Ce+=h*xe,B+=h*g,F+=h*u,R+=h*d,f+=h*v,P+=h*T,te+=h*U,ie+=h*k,Ee+=h*oe,Le+=h*he,h=I[12],Y+=h*Pe,le+=h*De,ee+=h*ge,fe+=h*Se,ae+=h*Oe,Ce+=h*pe,B+=h*xe,F+=h*g,R+=h*u,f+=h*d,P+=h*v,te+=h*T,ie+=h*U,Ee+=h*k,Le+=h*oe,$e+=h*he,h=I[13],le+=h*Pe,ee+=h*De,fe+=h*ge,ae+=h*Se,Ce+=h*Oe,B+=h*pe,F+=h*xe,R+=h*g,f+=h*u,P+=h*d,te+=h*v,ie+=h*T,Ee+=h*U,Le+=h*k,$e+=h*oe,Me+=h*he,h=I[14],ee+=h*Pe,fe+=h*De,ae+=h*ge,Ce+=h*Se,B+=h*Oe,F+=h*pe,R+=h*xe,f+=h*g,P+=h*u,te+=h*d,ie+=h*v,Ee+=h*T,Le+=h*U,$e+=h*k,Me+=h*oe,Ye+=h*he,h=I[15],fe+=h*Pe,ae+=h*De,Ce+=h*ge,B+=h*Se,F+=h*Oe,R+=h*pe,f+=h*xe,P+=h*g,te+=h*u,ie+=h*d,Ee+=h*v,Le+=h*T,$e+=h*U,Me+=h*k,Ye+=h*oe,Ke+=h*he,H+=38*ae,j+=38*Ce,q+=38*B,X+=38*F,re+=38*R,C+=38*f,$+=38*P,G+=38*te,K+=38*ie,W+=38*Ee,z+=38*Le,J+=38*$e,Y+=38*Me,le+=38*Ye,ee+=38*Ke,_=1,h=H+_+65535,_=Math.floor(h/65536),H=h-_*65536,h=j+_+65535,_=Math.floor(h/65536),j=h-_*65536,h=q+_+65535,_=Math.floor(h/65536),q=h-_*65536,h=X+_+65535,_=Math.floor(h/65536),X=h-_*65536,h=re+_+65535,_=Math.floor(h/65536),re=h-_*65536,h=C+_+65535,_=Math.floor(h/65536),C=h-_*65536,h=$+_+65535,_=Math.floor(h/65536),$=h-_*65536,h=G+_+65535,_=Math.floor(h/65536),G=h-_*65536,h=K+_+65535,_=Math.floor(h/65536),K=h-_*65536,h=W+_+65535,_=Math.floor(h/65536),W=h-_*65536,h=z+_+65535,_=Math.floor(h/65536),z=h-_*65536,h=J+_+65535,_=Math.floor(h/65536),J=h-_*65536,h=Y+_+65535,_=Math.floor(h/65536),Y=h-_*65536,h=le+_+65535,_=Math.floor(h/65536),le=h-_*65536,h=ee+_+65535,_=Math.floor(h/65536),ee=h-_*65536,h=fe+_+65535,_=Math.floor(h/65536),fe=h-_*65536,H+=_-1+37*(_-1),_=1,h=H+_+65535,_=Math.floor(h/65536),H=h-_*65536,h=j+_+65535,_=Math.floor(h/65536),j=h-_*65536,h=q+_+65535,_=Math.floor(h/65536),q=h-_*65536,h=X+_+65535,_=Math.floor(h/65536),X=h-_*65536,h=re+_+65535,_=Math.floor(h/65536),re=h-_*65536,h=C+_+65535,_=Math.floor(h/65536),C=h-_*65536,h=$+_+65535,_=Math.floor(h/65536),$=h-_*65536,h=G+_+65535,_=Math.floor(h/65536),G=h-_*65536,h=K+_+65535,_=Math.floor(h/65536),K=h-_*65536,h=W+_+65535,_=Math.floor(h/65536),W=h-_*65536,h=z+_+65535,_=Math.floor(h/65536),z=h-_*65536,h=J+_+65535,_=Math.floor(h/65536),J=h-_*65536,h=Y+_+65535,_=Math.floor(h/65536),Y=h-_*65536,h=le+_+65535,_=Math.floor(h/65536),le=h-_*65536,h=ee+_+65535,_=Math.floor(h/65536),ee=h-_*65536,h=fe+_+65535,_=Math.floor(h/65536),fe=h-_*65536,H+=_-1+37*(_-1),b[0]=H,b[1]=j,b[2]=q,b[3]=X,b[4]=re,b[5]=C,b[6]=$,b[7]=G,b[8]=K,b[9]=W,b[10]=z,b[11]=J,b[12]=Y,b[13]=le,b[14]=ee,b[15]=fe}function m(b,I){y(b,I,I)}function E(b,I){const O=n();for(let h=0;h<16;h++)O[h]=I[h];for(let h=253;h>=0;h--)m(O,O),h!==2&&h!==4&&y(O,O,I);for(let h=0;h<16;h++)b[h]=O[h]}function A(b,I){const O=new Uint8Array(32),h=new Float64Array(80),_=n(),H=n(),j=n(),q=n(),X=n(),re=n();for(let K=0;K<31;K++)O[K]=b[K];O[31]=b[31]&127|64,O[0]&=248,l(h,I);for(let K=0;K<16;K++)H[K]=h[K];_[0]=q[0]=1;for(let K=254;K>=0;--K){const W=O[K>>>3]>>>(K&7)&1;a(_,H,W),a(j,q,W),p(X,_,j),w(_,_,j),p(j,H,q),w(H,H,q),m(q,X),m(re,_),y(_,j,_),y(j,H,X),p(X,_,j),w(_,_,j),m(H,_),w(j,q,re),y(_,j,s),p(_,_,q),y(j,j,_),y(_,q,re),y(q,H,h),m(H,X),a(_,H,W),a(j,q,W)}for(let K=0;K<16;K++)h[K+16]=_[K],h[K+32]=j[K],h[K+48]=H[K],h[K+64]=q[K];const C=h.subarray(32),$=h.subarray(16);E(C,C),y($,$,C);const G=new Uint8Array(32);return c(G,$),G}t.scalarMult=A;function N(b){return A(b,i)}t.scalarMultBase=N;function M(b){if(b.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const I=new Uint8Array(b);return{publicKey:N(I),secretKey:I}}t.generateKeyPairFromSeed=M;function x(b){const I=(0,e.randomBytes)(32,b),O=M(I);return(0,r.wipe)(I),O}t.generateKeyPair=x;function D(b,I,O=!1){if(b.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(I.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const h=A(b,I);if(O){let _=0;for(let H=0;H<h.length;H++)_|=h[H];if(_===0)throw new Error("X25519: invalid shared key")}return h}t.sharedKey=D})(po);function cl(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function go(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=cl(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function Mf(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 A=0,N=0,M=0,x=E.length;M!==x&&E[M]===0;)M++,A++;for(var D=(x-M)*p+1>>>0,b=new Uint8Array(D);M!==x;){for(var I=E[M],O=0,h=D-1;(I!==0||O<N)&&h!==-1;h--,O++)I+=256*b[h]>>>0,b[h]=I%a>>>0,I=I/a>>>0;if(I!==0)throw new Error("Non-zero carry");N=O,M++}for(var _=D-N;_!==D&&b[_]===0;)_++;for(var H=c.repeat(A);_<D;++_)H+=t.charAt(b[_]);return H}function y(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return new Uint8Array;var A=0;if(E[A]!==" "){for(var N=0,M=0;E[A]===c;)N++,A++;for(var x=(E.length-A)*l+1>>>0,D=new Uint8Array(x);E[A];){var b=r[E.charCodeAt(A)];if(b===255)return;for(var I=0,O=x-1;(b!==0||I<M)&&O!==-1;O--,I++)b+=a*D[O]>>>0,D[O]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");M=I,A++}if(E[A]!==" "){for(var h=x-M;h!==x&&D[h]===0;)h++;for(var _=new Uint8Array(N+(x-h)),H=N;h!==x;)_[H++]=D[h++];return _}}}function m(E){var A=y(E);if(A)return A;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:y,decode:m}}var Uf=Mf,Ff=Uf;const ll=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")},Bf=t=>new TextEncoder().encode(t),jf=t=>new TextDecoder().decode(t);class kf{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 Hf{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 ul(this,e)}}class zf{constructor(e){this.decoders=e}or(e){return ul(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 ul=(t,e)=>new zf({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Wf{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new kf(e,r,n),this.decoder=new Hf(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Xi=({name:t,prefix:e,encode:r,decode:n})=>new Wf(t,e,r,n),Rn=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Ff(r,e);return Xi({prefix:t,name:e,encode:n,decode:s=>ll(i(s))})},qf=(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},Vf=(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},Et=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Xi({prefix:e,name:t,encode(i){return Vf(i,n,r)},decode(i){return qf(i,n,r,t)}}),Kf=Xi({prefix:"\0",name:"identity",encode:t=>jf(t),decode:t=>Bf(t)});var Gf=Object.freeze({__proto__:null,identity:Kf});const Yf=Et({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Zf=Object.freeze({__proto__:null,base2:Yf});const Jf=Et({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Xf=Object.freeze({__proto__:null,base8:Jf});const Qf=Rn({prefix:"9",name:"base10",alphabet:"0123456789"});var e1=Object.freeze({__proto__:null,base10:Qf});const t1=Et({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),r1=Et({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var n1=Object.freeze({__proto__:null,base16:t1,base16upper:r1});const i1=Et({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),s1=Et({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),o1=Et({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),a1=Et({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),c1=Et({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),l1=Et({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),u1=Et({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),h1=Et({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),d1=Et({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var f1=Object.freeze({__proto__:null,base32:i1,base32upper:s1,base32pad:o1,base32padupper:a1,base32hex:c1,base32hexupper:l1,base32hexpad:u1,base32hexpadupper:h1,base32z:d1});const p1=Rn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),g1=Rn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var m1=Object.freeze({__proto__:null,base36:p1,base36upper:g1});const w1=Rn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),y1=Rn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var b1=Object.freeze({__proto__:null,base58btc:w1,base58flickr:y1});const v1=Et({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),_1=Et({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),E1=Et({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),x1=Et({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var C1=Object.freeze({__proto__:null,base64:v1,base64pad:_1,base64url:E1,base64urlpad:x1});const hl=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}"),S1=hl.reduce((t,e,r)=>(t[r]=e,t),[]),I1=hl.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function D1(t){return t.reduce((e,r)=>(e+=S1[r],e),"")}function O1(t){const e=[];for(const r of t){const n=I1[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const A1=Xi({prefix:"\u{1F680}",name:"base256emoji",encode:D1,decode:O1});var $1=Object.freeze({__proto__:null,base256emoji:A1}),P1=fl,dl=128,T1=127,N1=~T1,R1=Math.pow(2,31);function fl(t,e,r){e=e||[],r=r||0;for(var n=r;t>=R1;)e[r++]=t&255|dl,t/=128;for(;t&N1;)e[r++]=t&255|dl,t>>>=7;return e[r]=t|0,fl.bytes=r-n+1,e}var L1=mo,M1=128,pl=127;function mo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw mo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&pl)<<i:(o&pl)*Math.pow(2,i),i+=7}while(o>=M1);return mo.bytes=s-n,r}var U1=Math.pow(2,7),F1=Math.pow(2,14),B1=Math.pow(2,21),j1=Math.pow(2,28),k1=Math.pow(2,35),H1=Math.pow(2,42),z1=Math.pow(2,49),W1=Math.pow(2,56),q1=Math.pow(2,63),V1=function(t){return t<U1?1:t<F1?2:t<B1?3:t<j1?4:t<k1?5:t<H1?6:t<z1?7:t<W1?8:t<q1?9:10},K1={encode:P1,decode:L1,encodingLength:V1},gl=K1;const ml=(t,e,r=0)=>(gl.encode(t,e,r),e),wl=t=>gl.encodingLength(t),wo=(t,e)=>{const r=e.byteLength,n=wl(t),i=n+wl(r),s=new Uint8Array(i+r);return ml(t,s,0),ml(r,s,n),s.set(e,i),new G1(t,r,e,s)};class G1{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const yl=({name:t,code:e,encode:r})=>new Y1(t,e,r);class Y1{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?wo(this.code,r):r.then(n=>wo(this.code,n))}else throw Error("Unknown type, must be binary type")}}const bl=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Z1=yl({name:"sha2-256",code:18,encode:bl("SHA-256")}),J1=yl({name:"sha2-512",code:19,encode:bl("SHA-512")});var X1=Object.freeze({__proto__:null,sha256:Z1,sha512:J1});const vl=0,Q1="identity",_l=ll;var ep=Object.freeze({__proto__:null,identity:{code:vl,name:Q1,encode:_l,digest:t=>wo(vl,_l(t))}});new TextEncoder,new TextDecoder;const El={...Gf,...Zf,...Xf,...e1,...n1,...f1,...m1,...b1,...C1,...$1};({...X1,...ep});function xl(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Cl=xl("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),yo=xl("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=cl(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Sl={utf8:Cl,"utf-8":Cl,hex:El.base16,latin1:yo,ascii:yo,binary:yo,...El};function Pt(t,e="utf8"){const r=Sl[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 Tt(t,e="utf8"){const r=Sl[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 Il=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))},tp=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),rp=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),np=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}(),ip=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),sp=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),op=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,ap=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Dl=3,cp=[["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",op]],Ol=[["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 lp(t){return t?Al(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new sp:typeof navigator<"u"?Al(navigator.userAgent):dp()}function up(t){return t!==""&&cp.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 Al(t){var e=up(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new ip;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Dl&&(i=Il(Il([],i,!0),fp(Dl-i.length),!0)):i=[];var s=i.join("."),o=hp(t),a=ap.exec(t);return a&&a[1]?new np(r,s,o,a[1]):new tp(r,s,o)}function hp(t){for(var e=0,r=Ol.length;e<r;e++){var n=Ol[e],i=n[0],s=n[1],o=s.exec(t);if(o)return i}return null}function dp(){var t=typeof process<"u"&&process.version;return t?new rp(process.version.slice(1)):null}function fp(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var me={};/*! *****************************************************************************
1
+ (function(Jt,ht){typeof exports=="object"&&typeof module<"u"?ht(exports):typeof define=="function"&&define.amd?define(["exports"],ht):(Jt=typeof globalThis<"u"?globalThis:Jt||self,ht(Jt["@walletconnect/ethereum-provider"]={}))})(this,function(Jt){"use strict";var ht=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kd(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 ut={exports:{}},on=typeof Reflect=="object"?Reflect:null,Bc=on&&typeof on.apply=="function"?on.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Wi;on&&typeof on.ownKeys=="function"?Wi=on.ownKeys:Object.getOwnPropertySymbols?Wi=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Wi=function(e){return Object.getOwnPropertyNames(e)};function Hd(t){console&&console.warn&&console.warn(t)}var jc=Number.isNaN||function(e){return e!==e};function He(){He.init.call(this)}ut.exports=He,ut.exports.once=Vd,He.EventEmitter=He,He.prototype._events=void 0,He.prototype._eventsCount=0,He.prototype._maxListeners=void 0;var kc=10;function qi(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(He,"defaultMaxListeners",{enumerable:!0,get:function(){return kc},set:function(t){if(typeof t!="number"||t<0||jc(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");kc=t}}),He.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},He.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||jc(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 Hc(t){return t._maxListeners===void 0?He.defaultMaxListeners:t._maxListeners}He.prototype.getMaxListeners=function(){return Hc(this)},He.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")Bc(c,this,r);else for(var l=c.length,p=Kc(c,l),n=0;n<l;++n)Bc(p[n],this,r);return!0};function zc(t,e,r,n){var i,s,o;if(qi(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=Hc(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,Hd(a)}return t}He.prototype.addListener=function(e,r){return zc(this,e,r,!1)},He.prototype.on=He.prototype.addListener,He.prototype.prependListener=function(e,r){return zc(this,e,r,!0)};function zd(){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 Wc(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=zd.bind(n);return i.listener=r,n.wrapFn=i,i}He.prototype.once=function(e,r){return qi(r),this.on(e,Wc(this,e,r)),this},He.prototype.prependOnceListener=function(e,r){return qi(r),this.prependListener(e,Wc(this,e,r)),this},He.prototype.removeListener=function(e,r){var n,i,s,o,a;if(qi(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():Wd(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this},He.prototype.off=He.prototype.removeListener,He.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function qc(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?qd(i):Kc(i,i.length)}He.prototype.listeners=function(e){return qc(this,e,!0)},He.prototype.rawListeners=function(e){return qc(this,e,!1)},He.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Vc.call(t,e)},He.prototype.listenerCount=Vc;function Vc(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}He.prototype.eventNames=function(){return this._eventsCount>0?Wi(this._events):[]};function Kc(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Wd(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function qd(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Vd(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))}Gc(t,e,s,{once:!0}),e!=="error"&&Kd(t,i,{once:!0})})}function Kd(t,e,r){typeof t.on=="function"&&Gc(t,"error",e,r)}function Gc(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 co={},Vi={},ve={},Zc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,p=a&65535,w=c>>>16&65535,b=c&65535;return p*b+(l*b+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}})(Zc),Object.defineProperty(ve,"__esModule",{value:!0});var Yc=Zc;function Gd(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}ve.readInt16BE=Gd;function Zd(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}ve.readUint16BE=Zd;function Yd(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}ve.readInt16LE=Yd;function Jd(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}ve.readUint16LE=Jd;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}ve.writeUint16BE=Jc,ve.writeInt16BE=Jc;function Xc(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}ve.writeUint16LE=Xc,ve.writeInt16LE=Xc;function lo(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}ve.readInt32BE=lo;function ho(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}ve.readUint32BE=ho;function uo(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}ve.readInt32LE=uo;function fo(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}ve.readUint32LE=fo;function Ki(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}ve.writeUint32BE=Ki,ve.writeInt32BE=Ki;function Gi(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}ve.writeUint32LE=Gi,ve.writeInt32LE=Gi;function Xd(t,e){e===void 0&&(e=0);var r=lo(t,e),n=lo(t,e+4);return r*4294967296+n-(n>>31)*4294967296}ve.readInt64BE=Xd;function Qd(t,e){e===void 0&&(e=0);var r=ho(t,e),n=ho(t,e+4);return r*4294967296+n}ve.readUint64BE=Qd;function ef(t,e){e===void 0&&(e=0);var r=uo(t,e),n=uo(t,e+4);return n*4294967296+r-(r>>31)*4294967296}ve.readInt64LE=ef;function tf(t,e){e===void 0&&(e=0);var r=fo(t,e),n=fo(t,e+4);return n*4294967296+r}ve.readUint64LE=tf;function Qc(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ki(t/4294967296>>>0,e,r),Ki(t>>>0,e,r+4),e}ve.writeUint64BE=Qc,ve.writeInt64BE=Qc;function el(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Gi(t>>>0,e,r),Gi(t/4294967296>>>0,e,r+4),e}ve.writeUint64LE=el,ve.writeInt64LE=el;function rf(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}ve.readUintBE=rf;function nf(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}ve.readUintLE=nf;function sf(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(!Yc.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}ve.writeUintBE=sf;function of(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(!Yc.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}ve.writeUintLE=of;function af(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}ve.readFloat32BE=af;function cf(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}ve.readFloat32LE=cf;function lf(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}ve.readFloat64BE=lf;function hf(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}ve.readFloat64LE=hf;function uf(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}ve.writeFloat32BE=uf;function df(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}ve.writeFloat32LE=df;function ff(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}ve.writeFloat64BE=ff;function pf(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}ve.writeFloat64LE=pf;var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});function gf(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Ut.wipe=gf,Object.defineProperty(Vi,"__esModule",{value:!0});var It=ve,po=Ut,mf=20;function wf(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],b=r[23]<<24|r[22]<<16|r[21]<<8|r[20],m=r[27]<<24|r[26]<<16|r[25]<<8|r[24],E=r[31]<<24|r[30]<<16|r[29]<<8|r[28],A=e[3]<<24|e[2]<<16|e[1]<<8|e[0],N=e[7]<<24|e[6]<<16|e[5]<<8|e[4],M=e[11]<<24|e[10]<<16|e[9]<<8|e[8],x=e[15]<<24|e[14]<<16|e[13]<<8|e[12],D=n,y=i,I=s,O=o,u=a,_=c,H=l,j=p,q=w,X=b,re=m,C=E,$=A,G=N,K=M,W=x,z=0;z<mf;z+=2)D=D+u|0,$^=D,$=$>>>32-16|$<<16,q=q+$|0,u^=q,u=u>>>32-12|u<<12,y=y+_|0,G^=y,G=G>>>32-16|G<<16,X=X+G|0,_^=X,_=_>>>32-12|_<<12,I=I+H|0,K^=I,K=K>>>32-16|K<<16,re=re+K|0,H^=re,H=H>>>32-12|H<<12,O=O+j|0,W^=O,W=W>>>32-16|W<<16,C=C+W|0,j^=C,j=j>>>32-12|j<<12,I=I+H|0,K^=I,K=K>>>32-8|K<<8,re=re+K|0,H^=re,H=H>>>32-7|H<<7,O=O+j|0,W^=O,W=W>>>32-8|W<<8,C=C+W|0,j^=C,j=j>>>32-7|j<<7,y=y+_|0,G^=y,G=G>>>32-8|G<<8,X=X+G|0,_^=X,_=_>>>32-7|_<<7,D=D+u|0,$^=D,$=$>>>32-8|$<<8,q=q+$|0,u^=q,u=u>>>32-7|u<<7,D=D+_|0,W^=D,W=W>>>32-16|W<<16,re=re+W|0,_^=re,_=_>>>32-12|_<<12,y=y+H|0,$^=y,$=$>>>32-16|$<<16,C=C+$|0,H^=C,H=H>>>32-12|H<<12,I=I+j|0,G^=I,G=G>>>32-16|G<<16,q=q+G|0,j^=q,j=j>>>32-12|j<<12,O=O+u|0,K^=O,K=K>>>32-16|K<<16,X=X+K|0,u^=X,u=u>>>32-12|u<<12,I=I+j|0,G^=I,G=G>>>32-8|G<<8,q=q+G|0,j^=q,j=j>>>32-7|j<<7,O=O+u|0,K^=O,K=K>>>32-8|K<<8,X=X+K|0,u^=X,u=u>>>32-7|u<<7,y=y+H|0,$^=y,$=$>>>32-8|$<<8,C=C+$|0,H^=C,H=H>>>32-7|H<<7,D=D+_|0,W^=D,W=W>>>32-8|W<<8,re=re+W|0,_^=re,_=_>>>32-7|_<<7;It.writeUint32LE(D+n|0,t,0),It.writeUint32LE(y+i|0,t,4),It.writeUint32LE(I+s|0,t,8),It.writeUint32LE(O+o|0,t,12),It.writeUint32LE(u+a|0,t,16),It.writeUint32LE(_+c|0,t,20),It.writeUint32LE(H+l|0,t,24),It.writeUint32LE(j+p|0,t,28),It.writeUint32LE(q+w|0,t,32),It.writeUint32LE(X+b|0,t,36),It.writeUint32LE(re+m|0,t,40),It.writeUint32LE(C+E|0,t,44),It.writeUint32LE($+A|0,t,48),It.writeUint32LE(G+N|0,t,52),It.writeUint32LE(K+M|0,t,56),It.writeUint32LE(W+x|0,t,60)}function tl(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){wf(a,s,t);for(var l=c;l<c+64&&l<r.length;l++)n[l]=r[l]^a[l-c];yf(s,0,o)}return po.wipe(a),i===0&&po.wipe(s),n}Vi.streamXOR=tl;function bf(t,e,r,n){return n===void 0&&(n=0),po.wipe(r),tl(t,e,r,r,n)}Vi.stream=bf;function yf(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 rl={},gr={};Object.defineProperty(gr,"__esModule",{value:!0});function vf(t,e,r){return~(t-1)&e|t-1&r}gr.select=vf;function _f(t,e){return(t|0)-(e|0)-1>>>31&1}gr.lessOrEqual=_f;function nl(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}gr.compare=nl;function Ef(t,e){return t.length===0||e.length===0?!1:nl(t,e)!==0}gr.equal=Ef,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=gr,r=Ut;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 b=a[8]|a[9]<<8;this._r[4]=(w>>>4|b<<12)&255,this._r[5]=b>>>1&8190;var m=a[10]|a[11]<<8;this._r[6]=(b>>>14|m<<2)&8191;var E=a[12]|a[13]<<8;this._r[7]=(m>>>11|E<<5)&8065;var A=a[14]|a[15]<<8;this._r[8]=(E>>>8|A<<8)&8191,this._r[9]=A>>>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],b=this._h[1],m=this._h[2],E=this._h[3],A=this._h[4],N=this._h[5],M=this._h[6],x=this._h[7],D=this._h[8],y=this._h[9],I=this._r[0],O=this._r[1],u=this._r[2],_=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[c+0]|a[c+1]<<8;w+=$&8191;var G=a[c+2]|a[c+3]<<8;b+=($>>>13|G<<3)&8191;var K=a[c+4]|a[c+5]<<8;m+=(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;A+=(W>>>4|z<<12)&8191,N+=z>>>1&8191;var J=a[c+10]|a[c+11]<<8;M+=(z>>>14|J<<2)&8191;var Z=a[c+12]|a[c+13]<<8;x+=(J>>>11|Z<<5)&8191;var le=a[c+14]|a[c+15]<<8;D+=(Z>>>8|le<<8)&8191,y+=le>>>5|p;var ee=0,pe=ee;pe+=w*I,pe+=b*(5*C),pe+=m*(5*re),pe+=E*(5*X),pe+=A*(5*q),ee=pe>>>13,pe&=8191,pe+=N*(5*j),pe+=M*(5*H),pe+=x*(5*_),pe+=D*(5*u),pe+=y*(5*O),ee+=pe>>>13,pe&=8191;var ae=ee;ae+=w*O,ae+=b*I,ae+=m*(5*C),ae+=E*(5*re),ae+=A*(5*X),ee=ae>>>13,ae&=8191,ae+=N*(5*q),ae+=M*(5*j),ae+=x*(5*H),ae+=D*(5*_),ae+=y*(5*u),ee+=ae>>>13,ae&=8191;var Ce=ee;Ce+=w*u,Ce+=b*O,Ce+=m*I,Ce+=E*(5*C),Ce+=A*(5*re),ee=Ce>>>13,Ce&=8191,Ce+=N*(5*X),Ce+=M*(5*q),Ce+=x*(5*j),Ce+=D*(5*H),Ce+=y*(5*_),ee+=Ce>>>13,Ce&=8191;var B=ee;B+=w*_,B+=b*u,B+=m*O,B+=E*I,B+=A*(5*C),ee=B>>>13,B&=8191,B+=N*(5*re),B+=M*(5*X),B+=x*(5*q),B+=D*(5*j),B+=y*(5*H),ee+=B>>>13,B&=8191;var F=ee;F+=w*H,F+=b*_,F+=m*u,F+=E*O,F+=A*I,ee=F>>>13,F&=8191,F+=N*(5*C),F+=M*(5*re),F+=x*(5*X),F+=D*(5*q),F+=y*(5*j),ee+=F>>>13,F&=8191;var R=ee;R+=w*j,R+=b*H,R+=m*_,R+=E*u,R+=A*O,ee=R>>>13,R&=8191,R+=N*I,R+=M*(5*C),R+=x*(5*re),R+=D*(5*X),R+=y*(5*q),ee+=R>>>13,R&=8191;var f=ee;f+=w*q,f+=b*j,f+=m*H,f+=E*_,f+=A*u,ee=f>>>13,f&=8191,f+=N*O,f+=M*I,f+=x*(5*C),f+=D*(5*re),f+=y*(5*X),ee+=f>>>13,f&=8191;var P=ee;P+=w*X,P+=b*q,P+=m*j,P+=E*H,P+=A*_,ee=P>>>13,P&=8191,P+=N*u,P+=M*O,P+=x*I,P+=D*(5*C),P+=y*(5*re),ee+=P>>>13,P&=8191;var te=ee;te+=w*re,te+=b*X,te+=m*q,te+=E*j,te+=A*H,ee=te>>>13,te&=8191,te+=N*_,te+=M*u,te+=x*O,te+=D*I,te+=y*(5*C),ee+=te>>>13,te&=8191;var ie=ee;ie+=w*C,ie+=b*re,ie+=m*X,ie+=E*q,ie+=A*j,ee=ie>>>13,ie&=8191,ie+=N*H,ie+=M*_,ie+=x*u,ie+=D*O,ie+=y*I,ee+=ie>>>13,ie&=8191,ee=(ee<<2)+ee|0,ee=ee+pe|0,pe=ee&8191,ee=ee>>>13,ae+=ee,w=pe,b=ae,m=Ce,E=B,A=F,N=R,M=f,x=P,D=te,y=ie,c+=16,l-=16}this._h[0]=w,this._h[1]=b,this._h[2]=m,this._h[3]=E,this._h[4]=A,this._h[5]=N,this._h[6]=M,this._h[7]=x,this._h[8]=D,this._h[9]=y},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),p,w,b,m;if(this._leftover){for(m=this._leftover,this._buffer[m++]=1;m<16;m++)this._buffer[m]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(p=this._h[1]>>>13,this._h[1]&=8191,m=2;m<10;m++)this._h[m]+=p,p=this._h[m]>>>13,this._h[m]&=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,m=1;m<10;m++)l[m]=this._h[m]+p,p=l[m]>>>13,l[m]&=8191;for(l[9]-=1<<13,w=(p^1)-1,m=0;m<10;m++)l[m]&=w;for(w=~w,m=0;m<10;m++)this._h[m]=this._h[m]&w|l[m];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,b=this._h[0]+this._pad[0],this._h[0]=b&65535,m=1;m<8;m++)b=(this._h[m]+this._pad[m]|0)+(b>>>16)|0,this._h[m]=b&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}(rl),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Vi,r=rl,n=Ut,i=ve,s=gr;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,b){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var m=new Uint8Array(16);m.set(l,m.length-l.length);var E=new Uint8Array(32);e.stream(this._key,m,E,4);var A=p.length+this.tagLength,N;if(b){if(b.length!==A)throw new Error("ChaCha20Poly1305: incorrect destination length");N=b}else N=new Uint8Array(A);return e.streamXOR(this._key,m,p,N,4),this._authenticate(N.subarray(N.length-this.tagLength,N.length),E,N.subarray(0,N.length-this.tagLength),w),n.wipe(m),N},c.prototype.open=function(l,p,w,b){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(p.length<this.tagLength)return null;var m=new Uint8Array(16);m.set(l,m.length-l.length);var E=new Uint8Array(32);e.stream(this._key,m,E,4);var A=new Uint8Array(this.tagLength);if(this._authenticate(A,E,p.subarray(0,p.length-this.tagLength),w),!s.equal(A,p.subarray(p.length-this.tagLength,p.length)))return null;var N=p.length-this.tagLength,M;if(b){if(b.length!==N)throw new Error("ChaCha20Poly1305: incorrect destination length");M=b}else M=new Uint8Array(N);return e.streamXOR(this._key,m,p.subarray(0,p.length-this.tagLength),M,4),n.wipe(m),M},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(l,p,w,b){var m=new r.Poly1305(p);b&&(m.update(b),b.length%16>0&&m.update(o.subarray(b.length%16))),m.update(w),w.length%16>0&&m.update(o.subarray(w.length%16));var E=new Uint8Array(8);b&&i.writeUint64LE(b.length,E),m.update(E),i.writeUint64LE(w.length,E),m.update(E);for(var A=m.digest(),N=0;N<A.length;N++)l[N]=A[N];m.clean(),n.wipe(A),n.wipe(E)},c}();t.ChaCha20Poly1305=a}(co);var il={},Nn={},go={};Object.defineProperty(go,"__esModule",{value:!0});function xf(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}go.isSerializableHash=xf,Object.defineProperty(Nn,"__esModule",{value:!0});var Qt=go,Cf=gr,Sf=Ut,sl=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),Qt.isSerializableHash(this._inner)&&Qt.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Sf.wipe(n)}return t.prototype.reset=function(){if(!Qt.isSerializableHash(this._inner)||!Qt.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(){Qt.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Qt.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(!Qt.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(!Qt.isSerializableHash(this._inner)||!Qt.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(!Qt.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Nn.HMAC=sl;function If(t,e,r){var n=new sl(t,e);n.update(r);var i=n.digest();return n.clean(),i}Nn.hmac=If,Nn.equal=Cf.equal,Object.defineProperty(il,"__esModule",{value:!0});var ol=Nn,al=Ut,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=ol.hmac(this._hash,n,r);this._hmac=new ol.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(),al.wipe(this._buffer),al.wipe(this._counter),this._bufpos=0},t}(),Of=il.HKDF=Df,an={},Zi={},Yi={};Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.BrowserRandomSource=void 0;const cl=65536;class Af{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+=cl)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,cl)));return r}}Yi.BrowserRandomSource=Af;function $f(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 Ji={},Pf={},Tf=Object.freeze({__proto__:null,default:Pf}),Nf=Ar(Tf);Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.NodeRandomSource=void 0;const Rf=Ut;class Lf{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof $f<"u"){const e=Nf;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,Rf.wipe)(r),n}}Ji.NodeRandomSource=Lf,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.SystemRandomSource=void 0;const Mf=Yi,Uf=Ji;class Ff{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Mf.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Uf.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)}}Zi.SystemRandomSource=Ff,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Zi,r=ve,n=Ut;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 b="";const m=p.length,E=256-256%m;for(;l>0;){const A=i(Math.ceil(l*256/E),w);for(let N=0;N<A.length&&l>0;N++){const M=A[N];M<E&&(b+=p.charAt(M%m),l--)}(0,n.wipe)(A)}return b}t.randomString=a;function c(l,p=o,w=t.defaultRandomSource){const b=Math.ceil(l/(Math.log(p.length)/Math.LN2));return a(b,p,w)}t.randomStringForEntropy=c}(an);var Xi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ve,r=Ut;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,b=l<<3,m=l%64<56?64:128;this._buffer[p]=128;for(var E=p+1;E<m-8;E++)this._buffer[E]=0;e.writeUint32BE(w,this._buffer,m-8),e.writeUint32BE(b,this._buffer,m-4),s(this._temp,this._state,this._buffer,0,m),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 b=c[0],m=c[1],E=c[2],A=c[3],N=c[4],M=c[5],x=c[6],D=c[7],y=0;y<16;y++){var I=p+y*4;a[y]=e.readUint32BE(l,I)}for(var y=16;y<64;y++){var O=a[y-2],u=(O>>>17|O<<32-17)^(O>>>19|O<<32-19)^O>>>10;O=a[y-15];var _=(O>>>7|O<<32-7)^(O>>>18|O<<32-18)^O>>>3;a[y]=(u+a[y-7]|0)+(_+a[y-16]|0)}for(var y=0;y<64;y++){var u=(((N>>>6|N<<26)^(N>>>11|N<<21)^(N>>>25|N<<7))+(N&M^~N&x)|0)+(D+(i[y]+a[y]|0)|0)|0,_=((b>>>2|b<<32-2)^(b>>>13|b<<32-13)^(b>>>22|b<<32-22))+(b&m^b&E^m&E)|0;D=x,x=M,M=N,N=A+u|0,A=E,E=m,m=b,b=u+_|0}c[0]+=b,c[1]+=m,c[2]+=E,c[3]+=A,c[4]+=N,c[5]+=M,c[6]+=x,c[7]+=D,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})(Xi);var mo={};(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=Ut;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(y){const I=new Float64Array(16);if(y)for(let O=0;O<y.length;O++)I[O]=y[O];return I}const i=new Uint8Array(32);i[0]=9;const s=n([56129,1]);function o(y){let I=1;for(let O=0;O<16;O++){let u=y[O]+I+65535;I=Math.floor(u/65536),y[O]=u-I*65536}y[0]+=I-1+37*(I-1)}function a(y,I,O){const u=~(O-1);for(let _=0;_<16;_++){const H=u&(y[_]^I[_]);y[_]^=H,I[_]^=H}}function c(y,I){const O=n(),u=n();for(let _=0;_<16;_++)u[_]=I[_];o(u),o(u),o(u);for(let _=0;_<2;_++){O[0]=u[0]-65517;for(let j=1;j<15;j++)O[j]=u[j]-65535-(O[j-1]>>16&1),O[j-1]&=65535;O[15]=u[15]-32767-(O[14]>>16&1);const H=O[15]>>16&1;O[14]&=65535,a(u,O,1-H)}for(let _=0;_<16;_++)y[2*_]=u[_]&255,y[2*_+1]=u[_]>>8}function l(y,I){for(let O=0;O<16;O++)y[O]=I[2*O]+(I[2*O+1]<<8);y[15]&=32767}function p(y,I,O){for(let u=0;u<16;u++)y[u]=I[u]+O[u]}function w(y,I,O){for(let u=0;u<16;u++)y[u]=I[u]-O[u]}function b(y,I,O){let u,_,H=0,j=0,q=0,X=0,re=0,C=0,$=0,G=0,K=0,W=0,z=0,J=0,Z=0,le=0,ee=0,pe=0,ae=0,Ce=0,B=0,F=0,R=0,f=0,P=0,te=0,ie=0,Ee=0,Le=0,$e=0,Me=0,Ze=0,Ke=0,Pe=O[0],De=O[1],me=O[2],Se=O[3],Oe=O[4],ge=O[5],xe=O[6],g=O[7],h=O[8],d=O[9],v=O[10],T=O[11],U=O[12],k=O[13],oe=O[14],ue=O[15];u=I[0],H+=u*Pe,j+=u*De,q+=u*me,X+=u*Se,re+=u*Oe,C+=u*ge,$+=u*xe,G+=u*g,K+=u*h,W+=u*d,z+=u*v,J+=u*T,Z+=u*U,le+=u*k,ee+=u*oe,pe+=u*ue,u=I[1],j+=u*Pe,q+=u*De,X+=u*me,re+=u*Se,C+=u*Oe,$+=u*ge,G+=u*xe,K+=u*g,W+=u*h,z+=u*d,J+=u*v,Z+=u*T,le+=u*U,ee+=u*k,pe+=u*oe,ae+=u*ue,u=I[2],q+=u*Pe,X+=u*De,re+=u*me,C+=u*Se,$+=u*Oe,G+=u*ge,K+=u*xe,W+=u*g,z+=u*h,J+=u*d,Z+=u*v,le+=u*T,ee+=u*U,pe+=u*k,ae+=u*oe,Ce+=u*ue,u=I[3],X+=u*Pe,re+=u*De,C+=u*me,$+=u*Se,G+=u*Oe,K+=u*ge,W+=u*xe,z+=u*g,J+=u*h,Z+=u*d,le+=u*v,ee+=u*T,pe+=u*U,ae+=u*k,Ce+=u*oe,B+=u*ue,u=I[4],re+=u*Pe,C+=u*De,$+=u*me,G+=u*Se,K+=u*Oe,W+=u*ge,z+=u*xe,J+=u*g,Z+=u*h,le+=u*d,ee+=u*v,pe+=u*T,ae+=u*U,Ce+=u*k,B+=u*oe,F+=u*ue,u=I[5],C+=u*Pe,$+=u*De,G+=u*me,K+=u*Se,W+=u*Oe,z+=u*ge,J+=u*xe,Z+=u*g,le+=u*h,ee+=u*d,pe+=u*v,ae+=u*T,Ce+=u*U,B+=u*k,F+=u*oe,R+=u*ue,u=I[6],$+=u*Pe,G+=u*De,K+=u*me,W+=u*Se,z+=u*Oe,J+=u*ge,Z+=u*xe,le+=u*g,ee+=u*h,pe+=u*d,ae+=u*v,Ce+=u*T,B+=u*U,F+=u*k,R+=u*oe,f+=u*ue,u=I[7],G+=u*Pe,K+=u*De,W+=u*me,z+=u*Se,J+=u*Oe,Z+=u*ge,le+=u*xe,ee+=u*g,pe+=u*h,ae+=u*d,Ce+=u*v,B+=u*T,F+=u*U,R+=u*k,f+=u*oe,P+=u*ue,u=I[8],K+=u*Pe,W+=u*De,z+=u*me,J+=u*Se,Z+=u*Oe,le+=u*ge,ee+=u*xe,pe+=u*g,ae+=u*h,Ce+=u*d,B+=u*v,F+=u*T,R+=u*U,f+=u*k,P+=u*oe,te+=u*ue,u=I[9],W+=u*Pe,z+=u*De,J+=u*me,Z+=u*Se,le+=u*Oe,ee+=u*ge,pe+=u*xe,ae+=u*g,Ce+=u*h,B+=u*d,F+=u*v,R+=u*T,f+=u*U,P+=u*k,te+=u*oe,ie+=u*ue,u=I[10],z+=u*Pe,J+=u*De,Z+=u*me,le+=u*Se,ee+=u*Oe,pe+=u*ge,ae+=u*xe,Ce+=u*g,B+=u*h,F+=u*d,R+=u*v,f+=u*T,P+=u*U,te+=u*k,ie+=u*oe,Ee+=u*ue,u=I[11],J+=u*Pe,Z+=u*De,le+=u*me,ee+=u*Se,pe+=u*Oe,ae+=u*ge,Ce+=u*xe,B+=u*g,F+=u*h,R+=u*d,f+=u*v,P+=u*T,te+=u*U,ie+=u*k,Ee+=u*oe,Le+=u*ue,u=I[12],Z+=u*Pe,le+=u*De,ee+=u*me,pe+=u*Se,ae+=u*Oe,Ce+=u*ge,B+=u*xe,F+=u*g,R+=u*h,f+=u*d,P+=u*v,te+=u*T,ie+=u*U,Ee+=u*k,Le+=u*oe,$e+=u*ue,u=I[13],le+=u*Pe,ee+=u*De,pe+=u*me,ae+=u*Se,Ce+=u*Oe,B+=u*ge,F+=u*xe,R+=u*g,f+=u*h,P+=u*d,te+=u*v,ie+=u*T,Ee+=u*U,Le+=u*k,$e+=u*oe,Me+=u*ue,u=I[14],ee+=u*Pe,pe+=u*De,ae+=u*me,Ce+=u*Se,B+=u*Oe,F+=u*ge,R+=u*xe,f+=u*g,P+=u*h,te+=u*d,ie+=u*v,Ee+=u*T,Le+=u*U,$e+=u*k,Me+=u*oe,Ze+=u*ue,u=I[15],pe+=u*Pe,ae+=u*De,Ce+=u*me,B+=u*Se,F+=u*Oe,R+=u*ge,f+=u*xe,P+=u*g,te+=u*h,ie+=u*d,Ee+=u*v,Le+=u*T,$e+=u*U,Me+=u*k,Ze+=u*oe,Ke+=u*ue,H+=38*ae,j+=38*Ce,q+=38*B,X+=38*F,re+=38*R,C+=38*f,$+=38*P,G+=38*te,K+=38*ie,W+=38*Ee,z+=38*Le,J+=38*$e,Z+=38*Me,le+=38*Ze,ee+=38*Ke,_=1,u=H+_+65535,_=Math.floor(u/65536),H=u-_*65536,u=j+_+65535,_=Math.floor(u/65536),j=u-_*65536,u=q+_+65535,_=Math.floor(u/65536),q=u-_*65536,u=X+_+65535,_=Math.floor(u/65536),X=u-_*65536,u=re+_+65535,_=Math.floor(u/65536),re=u-_*65536,u=C+_+65535,_=Math.floor(u/65536),C=u-_*65536,u=$+_+65535,_=Math.floor(u/65536),$=u-_*65536,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=K+_+65535,_=Math.floor(u/65536),K=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=z+_+65535,_=Math.floor(u/65536),z=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=Z+_+65535,_=Math.floor(u/65536),Z=u-_*65536,u=le+_+65535,_=Math.floor(u/65536),le=u-_*65536,u=ee+_+65535,_=Math.floor(u/65536),ee=u-_*65536,u=pe+_+65535,_=Math.floor(u/65536),pe=u-_*65536,H+=_-1+37*(_-1),_=1,u=H+_+65535,_=Math.floor(u/65536),H=u-_*65536,u=j+_+65535,_=Math.floor(u/65536),j=u-_*65536,u=q+_+65535,_=Math.floor(u/65536),q=u-_*65536,u=X+_+65535,_=Math.floor(u/65536),X=u-_*65536,u=re+_+65535,_=Math.floor(u/65536),re=u-_*65536,u=C+_+65535,_=Math.floor(u/65536),C=u-_*65536,u=$+_+65535,_=Math.floor(u/65536),$=u-_*65536,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=K+_+65535,_=Math.floor(u/65536),K=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=z+_+65535,_=Math.floor(u/65536),z=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=Z+_+65535,_=Math.floor(u/65536),Z=u-_*65536,u=le+_+65535,_=Math.floor(u/65536),le=u-_*65536,u=ee+_+65535,_=Math.floor(u/65536),ee=u-_*65536,u=pe+_+65535,_=Math.floor(u/65536),pe=u-_*65536,H+=_-1+37*(_-1),y[0]=H,y[1]=j,y[2]=q,y[3]=X,y[4]=re,y[5]=C,y[6]=$,y[7]=G,y[8]=K,y[9]=W,y[10]=z,y[11]=J,y[12]=Z,y[13]=le,y[14]=ee,y[15]=pe}function m(y,I){b(y,I,I)}function E(y,I){const O=n();for(let u=0;u<16;u++)O[u]=I[u];for(let u=253;u>=0;u--)m(O,O),u!==2&&u!==4&&b(O,O,I);for(let u=0;u<16;u++)y[u]=O[u]}function A(y,I){const O=new Uint8Array(32),u=new Float64Array(80),_=n(),H=n(),j=n(),q=n(),X=n(),re=n();for(let K=0;K<31;K++)O[K]=y[K];O[31]=y[31]&127|64,O[0]&=248,l(u,I);for(let K=0;K<16;K++)H[K]=u[K];_[0]=q[0]=1;for(let K=254;K>=0;--K){const W=O[K>>>3]>>>(K&7)&1;a(_,H,W),a(j,q,W),p(X,_,j),w(_,_,j),p(j,H,q),w(H,H,q),m(q,X),m(re,_),b(_,j,_),b(j,H,X),p(X,_,j),w(_,_,j),m(H,_),w(j,q,re),b(_,j,s),p(_,_,q),b(j,j,_),b(_,q,re),b(q,H,u),m(H,X),a(_,H,W),a(j,q,W)}for(let K=0;K<16;K++)u[K+16]=_[K],u[K+32]=j[K],u[K+48]=H[K],u[K+64]=q[K];const C=u.subarray(32),$=u.subarray(16);E(C,C),b($,$,C);const G=new Uint8Array(32);return c(G,$),G}t.scalarMult=A;function N(y){return A(y,i)}t.scalarMultBase=N;function M(y){if(y.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const I=new Uint8Array(y);return{publicKey:N(I),secretKey:I}}t.generateKeyPairFromSeed=M;function x(y){const I=(0,e.randomBytes)(32,y),O=M(I);return(0,r.wipe)(I),O}t.generateKeyPair=x;function D(y,I,O=!1){if(y.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(I.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const u=A(y,I);if(O){let _=0;for(let H=0;H<u.length;H++)_|=u[H];if(_===0)throw new Error("X25519: invalid shared key")}return u}t.sharedKey=D})(mo);function ll(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function wo(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=ll(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function Bf(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 A=0,N=0,M=0,x=E.length;M!==x&&E[M]===0;)M++,A++;for(var D=(x-M)*p+1>>>0,y=new Uint8Array(D);M!==x;){for(var I=E[M],O=0,u=D-1;(I!==0||O<N)&&u!==-1;u--,O++)I+=256*y[u]>>>0,y[u]=I%a>>>0,I=I/a>>>0;if(I!==0)throw new Error("Non-zero carry");N=O,M++}for(var _=D-N;_!==D&&y[_]===0;)_++;for(var H=c.repeat(A);_<D;++_)H+=t.charAt(y[_]);return H}function b(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return new Uint8Array;var A=0;if(E[A]!==" "){for(var N=0,M=0;E[A]===c;)N++,A++;for(var x=(E.length-A)*l+1>>>0,D=new Uint8Array(x);E[A];){var y=r[E.charCodeAt(A)];if(y===255)return;for(var I=0,O=x-1;(y!==0||I<M)&&O!==-1;O--,I++)y+=a*D[O]>>>0,D[O]=y%256>>>0,y=y/256>>>0;if(y!==0)throw new Error("Non-zero carry");M=I,A++}if(E[A]!==" "){for(var u=x-M;u!==x&&D[u]===0;)u++;for(var _=new Uint8Array(N+(x-u)),H=N;u!==x;)_[H++]=D[u++];return _}}}function m(E){var A=b(E);if(A)return A;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:b,decode:m}}var jf=Bf,kf=jf;const hl=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")},Hf=t=>new TextEncoder().encode(t),zf=t=>new TextDecoder().decode(t);class Wf{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 qf{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 ul(this,e)}}class Vf{constructor(e){this.decoders=e}or(e){return ul(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 ul=(t,e)=>new Vf({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Kf{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Wf(e,r,n),this.decoder=new qf(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Qi=({name:t,prefix:e,encode:r,decode:n})=>new Kf(t,e,r,n),Rn=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=kf(r,e);return Qi({prefix:t,name:e,encode:n,decode:s=>hl(i(s))})},Gf=(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},Zf=(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})=>Qi({prefix:e,name:t,encode(i){return Zf(i,n,r)},decode(i){return Gf(i,n,r,t)}}),Yf=Qi({prefix:"\0",name:"identity",encode:t=>zf(t),decode:t=>Hf(t)});var Jf=Object.freeze({__proto__:null,identity:Yf});const Xf=xt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Qf=Object.freeze({__proto__:null,base2:Xf});const e1=xt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var t1=Object.freeze({__proto__:null,base8:e1});const r1=Rn({prefix:"9",name:"base10",alphabet:"0123456789"});var n1=Object.freeze({__proto__:null,base10:r1});const i1=xt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),s1=xt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var o1=Object.freeze({__proto__:null,base16:i1,base16upper:s1});const a1=xt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),c1=xt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),l1=xt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),h1=xt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),u1=xt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),d1=xt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),f1=xt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),p1=xt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),g1=xt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var m1=Object.freeze({__proto__:null,base32:a1,base32upper:c1,base32pad:l1,base32padupper:h1,base32hex:u1,base32hexupper:d1,base32hexpad:f1,base32hexpadupper:p1,base32z:g1});const w1=Rn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),b1=Rn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var y1=Object.freeze({__proto__:null,base36:w1,base36upper:b1});const v1=Rn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),_1=Rn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var E1=Object.freeze({__proto__:null,base58btc:v1,base58flickr:_1});const x1=xt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),C1=xt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),S1=xt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),I1=xt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var D1=Object.freeze({__proto__:null,base64:x1,base64pad:C1,base64url:S1,base64urlpad:I1});const dl=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}"),O1=dl.reduce((t,e,r)=>(t[r]=e,t),[]),A1=dl.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function $1(t){return t.reduce((e,r)=>(e+=O1[r],e),"")}function P1(t){const e=[];for(const r of t){const n=A1[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const T1=Qi({prefix:"\u{1F680}",name:"base256emoji",encode:$1,decode:P1});var N1=Object.freeze({__proto__:null,base256emoji:T1}),R1=pl,fl=128,L1=127,M1=~L1,U1=Math.pow(2,31);function pl(t,e,r){e=e||[],r=r||0;for(var n=r;t>=U1;)e[r++]=t&255|fl,t/=128;for(;t&M1;)e[r++]=t&255|fl,t>>>=7;return e[r]=t|0,pl.bytes=r-n+1,e}var F1=bo,B1=128,gl=127;function bo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw bo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&gl)<<i:(o&gl)*Math.pow(2,i),i+=7}while(o>=B1);return bo.bytes=s-n,r}var j1=Math.pow(2,7),k1=Math.pow(2,14),H1=Math.pow(2,21),z1=Math.pow(2,28),W1=Math.pow(2,35),q1=Math.pow(2,42),V1=Math.pow(2,49),K1=Math.pow(2,56),G1=Math.pow(2,63),Z1=function(t){return t<j1?1:t<k1?2:t<H1?3:t<z1?4:t<W1?5:t<q1?6:t<V1?7:t<K1?8:t<G1?9:10},Y1={encode:R1,decode:F1,encodingLength:Z1},ml=Y1;const wl=(t,e,r=0)=>(ml.encode(t,e,r),e),bl=t=>ml.encodingLength(t),yo=(t,e)=>{const r=e.byteLength,n=bl(t),i=n+bl(r),s=new Uint8Array(i+r);return wl(t,s,0),wl(r,s,n),s.set(e,i),new J1(t,r,e,s)};class J1{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const yl=({name:t,code:e,encode:r})=>new X1(t,e,r);class X1{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?yo(this.code,r):r.then(n=>yo(this.code,n))}else throw Error("Unknown type, must be binary type")}}const vl=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Q1=yl({name:"sha2-256",code:18,encode:vl("SHA-256")}),ep=yl({name:"sha2-512",code:19,encode:vl("SHA-512")});var tp=Object.freeze({__proto__:null,sha256:Q1,sha512:ep});const _l=0,rp="identity",El=hl;var np=Object.freeze({__proto__:null,identity:{code:_l,name:rp,encode:El,digest:t=>yo(_l,El(t))}});new TextEncoder,new TextDecoder;const xl={...Jf,...Qf,...t1,...n1,...o1,...m1,...y1,...E1,...D1,...N1};({...tp,...np});function Cl(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Sl=Cl("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),vo=Cl("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=ll(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Il={utf8:Sl,"utf-8":Sl,hex:xl.base16,latin1:vo,ascii:vo,binary:vo,...xl};function Pt(t,e="utf8"){const r=Il[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 Tt(t,e="utf8"){const r=Il[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 Dl=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))},ip=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),sp=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),op=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}(),ap=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),cp=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),lp=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,hp=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Ol=3,up=[["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",lp]],Al=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function dp(t){return t?$l(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new cp:typeof navigator<"u"?$l(navigator.userAgent):gp()}function fp(t){return t!==""&&up.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 $l(t){var e=fp(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new ap;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Ol&&(i=Dl(Dl([],i,!0),mp(Ol-i.length),!0)):i=[];var s=i.join("."),o=pp(t),a=hp.exec(t);return a&&a[1]?new op(r,s,o,a[1]):new ip(r,s,o)}function pp(t){for(var e=0,r=Al.length;e<r;e++){var n=Al[e],i=n[0],s=n[1],o=s.exec(t);if(o)return i}return null}function gp(){var t=typeof process<"u"&&process.version;return t?new sp(process.version.slice(1)):null}function mp(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var de={};/*! *****************************************************************************
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 bo=function(t,e){return bo=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])},bo(t,e)};function pp(t,e){bo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var vo=function(){return vo=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},vo.apply(this,arguments)};function gp(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 mp(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 wp(t,e){return function(r,n){e(r,n,t)}}function yp(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function bp(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 vp(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 _p(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Ep(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function _o(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 $l(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 xp(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat($l(arguments[e]));return t}function Cp(){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 Sp(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(y){n[y]&&(i[y]=function(m){return new Promise(function(E,A){s.push([y,m,E,A])>1||a(y,m)})})}function a(y,m){try{c(n[y](m))}catch(E){w(s[0][3],E)}}function c(y){y.value instanceof Ln?Promise.resolve(y.value.v).then(l,p):w(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function w(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Ip(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 Dp(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 _o=="function"?_o(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 Op(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Ap(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 $p(t){return t&&t.__esModule?t:{default:t}}function Pp(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Tp(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 Np=Object.freeze({__proto__:null,__extends:pp,get __assign(){return vo},__rest:gp,__decorate:mp,__param:wp,__metadata:yp,__awaiter:bp,__generator:vp,__createBinding:_p,__exportStar:Ep,__values:_o,__read:$l,__spread:xp,__spreadArrays:Cp,__await:Ln,__asyncGenerator:Sp,__asyncDelegator:Ip,__asyncValues:Dp,__makeTemplateObject:Op,__importStar:Ap,__importDefault:$p,__classPrivateFieldGet:Pp,__classPrivateFieldSet:Tp}),Qi=$r(Np),Eo={},Mn={},Pl;function Rp(){if(Pl)return Mn;Pl=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 Pr={},xo={},Tr={},Tl;function Lp(){return Tl||(Tl=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.ONE_THOUSAND=Tr.ONE_HUNDRED=void 0,Tr.ONE_HUNDRED=100,Tr.ONE_THOUSAND=1e3),Tr}var Co={},Nl;function Mp(){return Nl||(Nl=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}(Co)),Co}var Rl;function Ll(){return Rl||(Rl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Qi;e.__exportStar(Lp(),t),e.__exportStar(Mp(),t)}(xo)),xo}var Ml;function Up(){if(Ml)return Pr;Ml=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.fromMiliseconds=Pr.toMiliseconds=void 0;const t=Ll();function e(n){return n*t.ONE_THOUSAND}Pr.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Pr.fromMiliseconds=r,Pr}var Ul;function Fp(){return Ul||(Ul=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Qi;e.__exportStar(Rp(),t),e.__exportStar(Up(),t)}(Eo)),Eo}var ln={},Fl;function Bp(){if(Fl)return ln;Fl=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.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 ln.Watch=t,ln.default=t,ln}var So={},Un={},Bl;function jp(){if(Bl)return Un;Bl=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.IWatch=void 0;class t{}return Un.IWatch=t,Un}var jl;function kp(){return jl||(jl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Qi.__exportStar(jp(),t)}(So)),So}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Qi;e.__exportStar(Fp(),t),e.__exportStar(Bp(),t),e.__exportStar(kp(),t),e.__exportStar(Ll(),t)})(me);var ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.getLocalStorage=ze.getLocalStorageOrThrow=ze.getCrypto=ze.getCryptoOrThrow=Hl=ze.getLocation=ze.getLocationOrThrow=Io=ze.getNavigator=ze.getNavigatorOrThrow=kl=ze.getDocument=ze.getDocumentOrThrow=ze.getFromWindowOrThrow=ze.getFromWindow=void 0;function Nr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}ze.getFromWindow=Nr;function un(t){const e=Nr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}ze.getFromWindowOrThrow=un;function Hp(){return un("document")}ze.getDocumentOrThrow=Hp;function zp(){return Nr("document")}var kl=ze.getDocument=zp;function Wp(){return un("navigator")}ze.getNavigatorOrThrow=Wp;function qp(){return Nr("navigator")}var Io=ze.getNavigator=qp;function Vp(){return un("location")}ze.getLocationOrThrow=Vp;function Kp(){return Nr("location")}var Hl=ze.getLocation=Kp;function Gp(){return un("crypto")}ze.getCryptoOrThrow=Gp;function Yp(){return Nr("crypto")}ze.getCrypto=Yp;function Zp(){return un("localStorage")}ze.getLocalStorageOrThrow=Zp;function Jp(){return Nr("localStorage")}ze.getLocalStorage=Jp;var Do={};Object.defineProperty(Do,"__esModule",{value:!0});var zl=Do.getWindowMetadata=void 0;const Wl=ze;function Xp(){let t,e;try{t=Wl.getDocumentOrThrow(),e=Wl.getLocationOrThrow()}catch{return null}function r(){const w=t.getElementsByTagName("link"),y=[];for(let m=0;m<w.length;m++){const E=w[m],A=E.getAttribute("rel");if(A&&A.toLowerCase().indexOf("icon")>-1){const N=E.getAttribute("href");if(N)if(N.toLowerCase().indexOf("https:")===-1&&N.toLowerCase().indexOf("http:")===-1&&N.indexOf("//")!==0){let M=e.protocol+"//"+e.host;if(N.indexOf("/")===0)M+=N;else{const x=e.pathname.split("/");x.pop();const D=x.join("/");M+=D+"/"+N}y.push(M)}else if(N.indexOf("//")===0){const M=e.protocol+N;y.push(M)}else y.push(N)}}return y}function n(...w){const y=t.getElementsByTagName("meta");for(let m=0;m<y.length;m++){const E=y[m],A=["itemprop","property","name"].map(N=>E.getAttribute(N)).filter(N=>N?w.includes(N):!1);if(A.length&&A){const N=E.getAttribute("content");if(N)return N}}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}}zl=Do.getWindowMetadata=Xp;var Fn={},Qp=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),ql="%[a-f0-9]{2}",Vl=new RegExp("("+ql+")|([^%]+?)","gi"),Kl=new RegExp("("+ql+")+","gi");function Oo(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([],Oo(r),Oo(n))}function eg(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(Vl)||[],r=1;r<e.length;r++)t=Oo(e,r).join(""),e=t.match(Vl)||[];return t}}function tg(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=Kl.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=eg(r[0]);n!==r[0]&&(e[r[0]]=n)}r=Kl.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 rg=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 tg(t)}},ng=(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)]},ig=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=Qp,r=rg,n=ng,i=ig,s=x=>x==null,o=Symbol("encodeFragmentIdentifier");function a(x){switch(x.arrayFormat){case"index":return D=>(b,I)=>{const O=b.length;return I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?b:I===null?[...b,[p(D,x),"[",O,"]"].join("")]:[...b,[p(D,x),"[",p(O,x),"]=",p(I,x)].join("")]};case"bracket":return D=>(b,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?b:I===null?[...b,[p(D,x),"[]"].join("")]:[...b,[p(D,x),"[]=",p(I,x)].join("")];case"colon-list-separator":return D=>(b,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?b:I===null?[...b,[p(D,x),":list="].join("")]:[...b,[p(D,x),":list=",p(I,x)].join("")];case"comma":case"separator":case"bracket-separator":{const D=x.arrayFormat==="bracket-separator"?"[]=":"=";return b=>(I,O)=>O===void 0||x.skipNull&&O===null||x.skipEmptyString&&O===""?I:(O=O===null?"":O,I.length===0?[[p(b,x),D,p(O,x)].join("")]:[[I,p(O,x)].join(x.arrayFormatSeparator)])}default:return D=>(b,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?b:I===null?[...b,p(D,x)]:[...b,[p(D,x),"=",p(I,x)].join("")]}}function c(x){let D;switch(x.arrayFormat){case"index":return(b,I,O)=>{if(D=/\[(\d*)\]$/.exec(b),b=b.replace(/\[\d*\]$/,""),!D){O[b]=I;return}O[b]===void 0&&(O[b]={}),O[b][D[1]]=I};case"bracket":return(b,I,O)=>{if(D=/(\[\])$/.exec(b),b=b.replace(/\[\]$/,""),!D){O[b]=I;return}if(O[b]===void 0){O[b]=[I];return}O[b]=[].concat(O[b],I)};case"colon-list-separator":return(b,I,O)=>{if(D=/(:list)$/.exec(b),b=b.replace(/:list$/,""),!D){O[b]=I;return}if(O[b]===void 0){O[b]=[I];return}O[b]=[].concat(O[b],I)};case"comma":case"separator":return(b,I,O)=>{const h=typeof I=="string"&&I.includes(x.arrayFormatSeparator),_=typeof I=="string"&&!h&&w(I,x).includes(x.arrayFormatSeparator);I=_?w(I,x):I;const H=h||_?I.split(x.arrayFormatSeparator).map(j=>w(j,x)):I===null?I:w(I,x);O[b]=H};case"bracket-separator":return(b,I,O)=>{const h=/(\[\])$/.test(b);if(b=b.replace(/\[\]$/,""),!h){O[b]=I&&w(I,x);return}const _=I===null?[]:I.split(x.arrayFormatSeparator).map(H=>w(H,x));if(O[b]===void 0){O[b]=_;return}O[b]=[].concat(O[b],_)};default:return(b,I,O)=>{if(O[b]===void 0){O[b]=I;return}O[b]=[].concat(O[b],I)}}}function l(x){if(typeof x!="string"||x.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function p(x,D){return D.encode?D.strict?e(x):encodeURIComponent(x):x}function w(x,D){return D.decode?r(x):x}function y(x){return Array.isArray(x)?x.sort():typeof x=="object"?y(Object.keys(x)).sort((D,b)=>Number(D)-Number(b)).map(D=>x[D]):x}function m(x){const D=x.indexOf("#");return D!==-1&&(x=x.slice(0,D)),x}function E(x){let D="";const b=x.indexOf("#");return b!==-1&&(D=x.slice(b)),D}function A(x){x=m(x);const D=x.indexOf("?");return D===-1?"":x.slice(D+1)}function N(x,D){return D.parseNumbers&&!Number.isNaN(Number(x))&&typeof x=="string"&&x.trim()!==""?x=Number(x):D.parseBooleans&&x!==null&&(x.toLowerCase()==="true"||x.toLowerCase()==="false")&&(x=x.toLowerCase()==="true"),x}function M(x,D){D=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},D),l(D.arrayFormatSeparator);const b=c(D),I=Object.create(null);if(typeof x!="string"||(x=x.trim().replace(/^[?#&]/,""),!x))return I;for(const O of x.split("&")){if(O==="")continue;let[h,_]=n(D.decode?O.replace(/\+/g," "):O,"=");_=_===void 0?null:["comma","separator","bracket-separator"].includes(D.arrayFormat)?_:w(_,D),b(w(h,D),_,I)}for(const O of Object.keys(I)){const h=I[O];if(typeof h=="object"&&h!==null)for(const _ of Object.keys(h))h[_]=N(h[_],D);else I[O]=N(h,D)}return D.sort===!1?I:(D.sort===!0?Object.keys(I).sort():Object.keys(I).sort(D.sort)).reduce((O,h)=>{const _=I[h];return Boolean(_)&&typeof _=="object"&&!Array.isArray(_)?O[h]=y(_):O[h]=_,O},Object.create(null))}t.extract=A,t.parse=M,t.stringify=(x,D)=>{if(!x)return"";D=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},D),l(D.arrayFormatSeparator);const b=_=>D.skipNull&&s(x[_])||D.skipEmptyString&&x[_]==="",I=a(D),O={};for(const _ of Object.keys(x))b(_)||(O[_]=x[_]);const h=Object.keys(O);return D.sort!==!1&&h.sort(D.sort),h.map(_=>{const H=x[_];return H===void 0?"":H===null?p(_,D):Array.isArray(H)?H.length===0&&D.arrayFormat==="bracket-separator"?p(_,D)+"[]":H.reduce(I(_),[]).join("&"):p(_,D)+"="+p(H,D)}).filter(_=>_.length>0).join("&")},t.parseUrl=(x,D)=>{D=Object.assign({decode:!0},D);const[b,I]=n(x,"#");return Object.assign({url:b.split("?")[0]||"",query:M(A(x),D)},D&&D.parseFragmentIdentifier&&I?{fragmentIdentifier:w(I,D)}:{})},t.stringifyUrl=(x,D)=>{D=Object.assign({encode:!0,strict:!0,[o]:!0},D);const b=m(x.url).split("?")[0]||"",I=t.extract(x.url),O=t.parse(I,{sort:!1}),h=Object.assign(O,x.query);let _=t.stringify(h,D);_&&(_=`?${_}`);let H=E(x.url);return x.fragmentIdentifier&&(H=`#${D[o]?p(x.fragmentIdentifier,D):x.fragmentIdentifier}`),`${b}${_}${H}`},t.pick=(x,D,b)=>{b=Object.assign({parseFragmentIdentifier:!0,[o]:!1},b);const{url:I,query:O,fragmentIdentifier:h}=t.parseUrl(x,b);return t.stringifyUrl({url:I,query:i(O,D),fragmentIdentifier:h},b)},t.exclude=(x,D,b)=>{const I=Array.isArray(D)?O=>!D.includes(O):(O,h)=>!D(O,h);return t.pick(x,I,b)}})(Fn);const sg={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 og(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 Ao(t,e){return t.includes(":")?[t]:e.chains||[]}const Gl="base10",Nt="base16",$o="base64pad",Po="utf8",Yl=0,Rr=1,ag=0,Zl=1,To=12,No=32;function cg(){const t=po.generateKeyPair();return{privateKey:Tt(t.secretKey,Nt),publicKey:Tt(t.publicKey,Nt)}}function Ro(){const t=cn.randomBytes(No);return Tt(t,Nt)}function lg(t,e){const r=po.sharedKey(Pt(t,Nt),Pt(e,Nt)),n=new Sf(Ji.SHA256,r).expand(No);return Tt(n,Nt)}function ug(t){const e=Ji.hash(Pt(t,Nt));return Tt(e,Nt)}function es(t){const e=Ji.hash(Pt(t,Po));return Tt(e,Nt)}function hg(t){return Pt(`${t}`,Gl)}function Bn(t){return Number(Tt(t,Gl))}function dg(t){const e=hg(typeof t.type<"u"?t.type:Yl);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"?Pt(t.senderPublicKey,Nt):void 0,n=typeof t.iv<"u"?Pt(t.iv,Nt):cn.randomBytes(To),i=new oo.ChaCha20Poly1305(Pt(t.symKey,Nt)).seal(n,Pt(t.message,Po));return pg({type:e,sealed:i,iv:n,senderPublicKey:r})}function fg(t){const e=new oo.ChaCha20Poly1305(Pt(t.symKey,Nt)),{sealed:r,iv:n}=Lo(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Tt(i,Po)}function pg(t){if(Bn(t.type)===Rr){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Tt(go([t.type,t.senderPublicKey,t.iv,t.sealed]),$o)}return Tt(go([t.type,t.iv,t.sealed]),$o)}function Lo(t){const e=Pt(t,$o),r=e.slice(ag,Zl),n=Zl;if(Bn(r)===Rr){const a=n+No,c=a+To,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+To,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function gg(t,e){const r=Lo(t);return Jl({type:Bn(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Tt(r.senderPublicKey,Nt):void 0,receiverPublicKey:e?.receiverPublicKey})}function Jl(t){const e=t?.type||Yl;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 Xl(t){return t.type===Rr&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var mg=Object.defineProperty,Ql=Object.getOwnPropertySymbols,wg=Object.prototype.hasOwnProperty,yg=Object.prototype.propertyIsEnumerable,eu=(t,e,r)=>e in t?mg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,tu=(t,e)=>{for(var r in e||(e={}))wg.call(e,r)&&eu(t,r,e[r]);if(Ql)for(var r of Ql(e))yg.call(e,r)&&eu(t,r,e[r]);return t};const bg="ReactNative",jn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},vg="js";function ru(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function _g(){return!kl()&&!!Io()&&navigator.product===bg}function Eg(){return!ru()&&!!Io()}function xg(){return _g()?jn.reactNative:ru()?jn.node:Eg()?jn.browser:jn.unknown}function Cg(t,e){let r=Fn.parse(t);return r=tu(tu({},r),e),t=Fn.stringify(r),t}function Sg(){return zl()||{name:"",description:"",url:"",icons:[""]}}function Ig(){const t=lp();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 Dg(){var t;const e=xg();return e===jn.browser?[e,((t=Hl())==null?void 0:t.host)||"unknown"].join(":"):e}function Og(t,e,r){const n=Ig(),i=Dg();return[[t,e].join("-"),[vg,r].join("-"),n,i].join("/")}function Ag({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s}){const o=r.split("?"),a=Og(t,e,n),c={auth:i,ua:a,projectId:s},l=Cg(o[1]||"",c);return o[0]+"?"+l}function mr(t,e){return t.filter(r=>e.includes(r)).length===t.length}function nu(t){return Object.fromEntries(t.entries())}function iu(t){return new Map(Object.entries(t))}function Lr(t){const e=me.toMiliseconds(t||me.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 su(t,e){return new Promise(async(r,n)=>{const i=setTimeout(()=>n(),e),s=await t;clearTimeout(i),r(s)})}function ou(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 $g(t){return ou("topic",t)}function Pg(t){return ou("id",t)}function au(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 er(t,e){return me.fromMiliseconds((e||Date.now())+me.toMiliseconds(t))}function wr(t){return Date.now()>=me.toMiliseconds(t)}function et(t,e){return`${t}${e?`:${e}`:""}`}const Tg="irn";function Mo(t){return t?.relay||{protocol:Tg}}function Uo(t){const e=sg[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Ng=Object.defineProperty,cu=Object.getOwnPropertySymbols,Rg=Object.prototype.hasOwnProperty,Lg=Object.prototype.propertyIsEnumerable,lu=(t,e,r)=>e in t?Ng(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Mg=(t,e)=>{for(var r in e||(e={}))Rg.call(e,r)&&lu(t,r,e[r]);if(cu)for(var r of cu(e))Lg.call(e,r)&&lu(t,r,e[r]);return t};function Ug(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 Fg(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:Ug(o)}}function Bg(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 jg(t){return`${t.protocol}:${t.topic}@${t.version}?`+Fn.stringify(Mg({symKey:t.symKey},Bg(t.relay)))}function kn(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function kg(t){const e=[];return Object.values(t).forEach(r=>{e.push(...kn(r.accounts))}),e}function Hg(t,e){const r=[];return Object.values(t).forEach(n=>{kn(n.accounts).includes(e)&&r.push(...n.methods)}),r}function zg(t,e){const r=[];return Object.values(t).forEach(n=>{kn(n.accounts).includes(e)&&r.push(...n.events)}),r}function Wg(t,e){const r=ts(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 qg={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}},Vg={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}=Vg[t];return{message:e?`${r} ${e}`:r,code:n}}function tt(t,e){const{message:r,code:n}=qg[t];return{message:e?`${r} ${e}`:r,code:n}}function yr(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Hn(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ot(t){return typeof t>"u"}function ht(t,e){return e&&Ot(t)?!0:typeof t=="string"&&Boolean(t.trim().length)}function Fo(t,e){return e&&Ot(t)?!0:typeof t=="number"&&!isNaN(t)}function Kg(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return mr(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],p=kn(a),w=r[o];(!mr(Ao(o,w),p)||!mr(w.methods,c)||!mr(w.events,l))&&(s=!1)}),s):!1}function Bo(t){return ht(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Gg(t){if(ht(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Bo(r)}}return!1}function Yg(t){if(ht(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Zg(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Jg(t){return t?.topic}function Xg(t,e){let r=null;return ht(t?.publicKey,!1)||(r=se("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function uu(t){let e=!0;return yr(t)?t.length&&(e=t.every(r=>ht(r,!1))):e=!1,e}function Qg(t,e,r){let n=null;return yr(e)?e.forEach(i=>{n||(!Bo(i)||!i.includes(t))&&(n=tt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=tt("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function e2(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;const s=Qg(n,Ao(n,i),`${e} requiredNamespace`);s&&(r=s)}),r}function t2(t,e){let r=null;return yr(t)?t.forEach(n=>{r||Gg(n)||(r=tt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=tt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function r2(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=t2(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function n2(t,e){let r=null;return uu(t?.methods)?uu(t?.events)||(r=tt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=tt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function hu(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=n2(n,`${e}, namespace`);i&&(r=i)}),r}function i2(t,e,r){let n=null;if(t&&Hn(t)){const i=hu(t,e);i&&(n=i);const s=e2(t,e);s&&(n=s)}else n=se("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function ts(t,e){let r=null;if(t&&Hn(t)){const n=hu(t,e);n&&(r=n);const i=r2(t,e);i&&(r=i)}else r=se("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function du(t){return ht(t.protocol,!0)}function s2(t,e){let r=!1;return e&&!t?r=!0:t&&yr(t)&&t.length&&t.forEach(n=>{r=du(n)}),r}function o2(t){return typeof t=="number"}function Rt(t){return typeof t<"u"&&typeof t!==null}function a2(t){return!(!t||typeof t!="object"||!t.code||!Fo(t.code,!1)||!t.message||!ht(t.message,!1))}function c2(t){return!(Ot(t)||!ht(t.method,!1))}function l2(t){return!(Ot(t)||Ot(t.result)&&Ot(t.error)||!Fo(t.id,!1)||!ht(t.jsonrpc,!1))}function u2(t){return!(Ot(t)||!ht(t.name,!1))}function fu(t,e){return!(!Bo(e)||!kg(t).includes(e))}function h2(t,e,r){return ht(r,!1)?Hg(t,e).includes(r):!1}function d2(t,e,r){return ht(r,!1)?zg(t,e).includes(r):!1}function jo(t,e,r,n){let i=null;const s=Object.keys(t),o=Object.keys(e);return mr(s,o)?s.forEach(a=>{if(i)return;const c=kn(e[a].accounts);mr(Ao(a,t[a]),c)?mr(t[a].methods,e[a].methods)?mr(t[a].events,e[a].events)||(i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${a}`)):i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${a}`):i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace chains for ${a}`)}):i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy ${n}`),i}function f2(t,e){return Fo(t,!1)&&t<=e.max&&t>=e.min}function p2(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var g2=m2;function m2(t,e,r){var n=r&&r.stringify||p2,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,y=t&&t.length||0,m=0;m<y;){if(t.charCodeAt(m)===37&&m+1<y){switch(w=w>-1?w:0,t.charCodeAt(m+1)){case 100:case 102:if(p>=c||e[p]==null)break;w<m&&(l+=t.slice(w,m)),l+=Number(e[p]),w=m+2,m++;break;case 105:if(p>=c||e[p]==null)break;w<m&&(l+=t.slice(w,m)),l+=Math.floor(Number(e[p])),w=m+2,m++;break;case 79:case 111:case 106:if(p>=c||e[p]===void 0)break;w<m&&(l+=t.slice(w,m));var E=typeof e[p];if(E==="string"){l+="'"+e[p]+"'",w=m+2,m++;break}if(E==="function"){l+=e[p].name||"<anonymous>",w=m+2,m++;break}l+=n(e[p]),w=m+2,m++;break;case 115:if(p>=c)break;w<m&&(l+=t.slice(w,m)),l+=String(e[p]),w=m+2,m++;break;case 37:w<m&&(l+=t.slice(w,m)),l+="%",w=m+2,m++,p--;break}++p}++m}return w===-1?t:(w<y&&(l+=t.slice(w)),l)}const pu=g2;var zn=tr;const Wn=I2().console||{},w2={mapHttpRequest:ns,mapHttpResponse:ns,wrapRequestSerializer:Ho,wrapResponseSerializer:Ho,wrapErrorSerializer:Ho,req:ns,res:ns,err:E2};function y2(t,e){return Array.isArray(t)?t.filter(function(n){return n!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function tr(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||Wn;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=y2(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=qn),Object.defineProperty(c,"levelVal",{get:p}),Object.defineProperty(c,"level",{get:w,set:y});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:x2(t)};c.levels=tr.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=qn,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=m,e&&(c._logEvent=ko());function p(){return this.level==="silent"?1/0:this.levels.values[this.level]}function w(){return this._level}function y(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 m(E,A){if(!E)throw new Error("missing bindings for child Pino");A=A||{},i&&E.serializers&&(A.serializers=E.serializers);const N=A.serializers;if(i&&N){var M=Object.assign({},n,N),x=t.browser.serialize===!0?Object.keys(M):i;delete E.serializers,rs([E],x,M,this._stdErrSerialize)}function D(b){this._childLevel=(b._childLevel|0)+1,this.error=dn(b,E,"error"),this.fatal=dn(b,E,"fatal"),this.warn=dn(b,E,"warn"),this.info=dn(b,E,"info"),this.debug=dn(b,E,"debug"),this.trace=dn(b,E,"trace"),M&&(this.serializers=M,this._serialize=x),e&&(this._logEvent=ko([].concat(b._logEvent.bindings,E)))}return D.prototype=this,new D(this)}return c}tr.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"}},tr.stdSerializers=w2,tr.stdTimeFunctions=Object.assign({},{nullTime:gu,epochTime:mu,unixTime:C2,isoTime:S2});function hn(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?qn:i[r]?i[r]:Wn[r]||Wn[n]||qn,b2(t,e,r)}function b2(t,e,r){!t.transmit&&e[r]===qn||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Wn?Wn:this;for(var c=0;c<o.length;c++)o[c]=arguments[c];if(t.serialize&&!t.asObject&&rs(o,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?n.call(a,v2(this,r,o,s)):n.apply(a,o),t.transmit){const l=t.transmit.level||e.level,p=tr.levels.values[l],w=tr.levels.values[r];if(w<p)return;_2(this,{ts:s,methodLevel:r,methodValue:w,transmitLevel:l,transmitValue:tr.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},o)}}}(e[r]))}function v2(t,e,r,n){t._serialize&&rs(r,t._serialize,t.serializers,t._stdErrSerialize);const i=r.slice();let s=i[0];const o={};n&&(o.time=n),o.level=tr.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?pu(i.shift(),i):void 0}else typeof s=="string"&&(s=pu(i.shift(),i));return s!==void 0&&(o.msg=s),o}function rs(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=tr.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 _2(t,e,r){const n=e.send,i=e.ts,s=e.methodLevel,o=e.methodValue,a=e.val,c=t._logEvent.bindings;rs(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=ko(c)}function ko(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function E2(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 x2(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?gu:mu}function ns(){return{}}function Ho(t){return t}function qn(){}function gu(){return!1}function mu(){return Date.now()}function C2(){return Math.round(Date.now()/1e3)}function S2(){return new Date(Date.now()).toISOString()}function I2(){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 is={};/*! *****************************************************************************
14
+ ***************************************************************************** */var _o=function(t,e){return _o=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])},_o(t,e)};function wp(t,e){_o(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Eo=function(){return Eo=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},Eo.apply(this,arguments)};function bp(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 yp(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 vp(t,e){return function(r,n){e(r,n,t)}}function _p(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Ep(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 xp(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 Cp(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Sp(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function xo(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pl(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 Ip(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Pl(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 Op(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(b){n[b]&&(i[b]=function(m){return new Promise(function(E,A){s.push([b,m,E,A])>1||a(b,m)})})}function a(b,m){try{c(n[b](m))}catch(E){w(s[0][3],E)}}function c(b){b.value instanceof Ln?Promise.resolve(b.value.v).then(l,p):w(s[0][2],b)}function l(b){a("next",b)}function p(b){a("throw",b)}function w(b,m){b(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Ap(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 $p(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof xo=="function"?xo(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Pp(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Tp(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 Np(t){return t&&t.__esModule?t:{default:t}}function Rp(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Lp(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 Mp=Object.freeze({__proto__:null,__extends:wp,get __assign(){return Eo},__rest:bp,__decorate:yp,__param:vp,__metadata:_p,__awaiter:Ep,__generator:xp,__createBinding:Cp,__exportStar:Sp,__values:xo,__read:Pl,__spread:Ip,__spreadArrays:Dp,__await:Ln,__asyncGenerator:Op,__asyncDelegator:Ap,__asyncValues:$p,__makeTemplateObject:Pp,__importStar:Tp,__importDefault:Np,__classPrivateFieldGet:Rp,__classPrivateFieldSet:Lp}),es=Ar(Mp),Co={},Mn={},Tl;function Up(){if(Tl)return Mn;Tl=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={},So={},Pr={},Nl;function Fp(){return Nl||(Nl=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 Io={},Rl;function Bp(){return Rl||(Rl=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}(Io)),Io}var Ll;function Ml(){return Ll||(Ll=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=es;e.__exportStar(Fp(),t),e.__exportStar(Bp(),t)}(So)),So}var Ul;function jp(){if(Ul)return $r;Ul=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.fromMiliseconds=$r.toMiliseconds=void 0;const t=Ml();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 Fl;function kp(){return Fl||(Fl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=es;e.__exportStar(Up(),t),e.__exportStar(jp(),t)}(Co)),Co}var cn={},Bl;function Hp(){if(Bl)return cn;Bl=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 Do={},Un={},jl;function zp(){if(jl)return Un;jl=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.IWatch=void 0;class t{}return Un.IWatch=t,Un}var kl;function Wp(){return kl||(kl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),es.__exportStar(zp(),t)}(Do)),Do}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=es;e.__exportStar(kp(),t),e.__exportStar(Hp(),t),e.__exportStar(Wp(),t),e.__exportStar(Ml(),t)})(de);var ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.getLocalStorage=ze.getLocalStorageOrThrow=ze.getCrypto=ze.getCryptoOrThrow=zl=ze.getLocation=ze.getLocationOrThrow=Oo=ze.getNavigator=ze.getNavigatorOrThrow=Hl=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 qp(){return ln("document")}ze.getDocumentOrThrow=qp;function Vp(){return Tr("document")}var Hl=ze.getDocument=Vp;function Kp(){return ln("navigator")}ze.getNavigatorOrThrow=Kp;function Gp(){return Tr("navigator")}var Oo=ze.getNavigator=Gp;function Zp(){return ln("location")}ze.getLocationOrThrow=Zp;function Yp(){return Tr("location")}var zl=ze.getLocation=Yp;function Jp(){return ln("crypto")}ze.getCryptoOrThrow=Jp;function Xp(){return Tr("crypto")}ze.getCrypto=Xp;function Qp(){return ln("localStorage")}ze.getLocalStorageOrThrow=Qp;function eg(){return Tr("localStorage")}ze.getLocalStorage=eg;var Ao={};Object.defineProperty(Ao,"__esModule",{value:!0});var Wl=Ao.getWindowMetadata=void 0;const ql=ze;function tg(){let t,e;try{t=ql.getDocumentOrThrow(),e=ql.getLocationOrThrow()}catch{return null}function r(){const w=t.getElementsByTagName("link"),b=[];for(let m=0;m<w.length;m++){const E=w[m],A=E.getAttribute("rel");if(A&&A.toLowerCase().indexOf("icon")>-1){const N=E.getAttribute("href");if(N)if(N.toLowerCase().indexOf("https:")===-1&&N.toLowerCase().indexOf("http:")===-1&&N.indexOf("//")!==0){let M=e.protocol+"//"+e.host;if(N.indexOf("/")===0)M+=N;else{const x=e.pathname.split("/");x.pop();const D=x.join("/");M+=D+"/"+N}b.push(M)}else if(N.indexOf("//")===0){const M=e.protocol+N;b.push(M)}else b.push(N)}}return b}function n(...w){const b=t.getElementsByTagName("meta");for(let m=0;m<b.length;m++){const E=b[m],A=["itemprop","property","name"].map(N=>E.getAttribute(N)).filter(N=>N?w.includes(N):!1);if(A.length&&A){const N=E.getAttribute("content");if(N)return N}}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}}Wl=Ao.getWindowMetadata=tg;var Fn={},rg=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Vl="%[a-f0-9]{2}",Kl=new RegExp("("+Vl+")|([^%]+?)","gi"),Gl=new RegExp("("+Vl+")+","gi");function $o(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([],$o(r),$o(n))}function ng(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(Kl)||[],r=1;r<e.length;r++)t=$o(e,r).join(""),e=t.match(Kl)||[];return t}}function ig(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=Gl.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=ng(r[0]);n!==r[0]&&(e[r[0]]=n)}r=Gl.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 sg=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 ig(t)}},og=(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)]},ag=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=rg,r=sg,n=og,i=ag,s=x=>x==null,o=Symbol("encodeFragmentIdentifier");function a(x){switch(x.arrayFormat){case"index":return D=>(y,I)=>{const O=y.length;return I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?y:I===null?[...y,[p(D,x),"[",O,"]"].join("")]:[...y,[p(D,x),"[",p(O,x),"]=",p(I,x)].join("")]};case"bracket":return D=>(y,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?y:I===null?[...y,[p(D,x),"[]"].join("")]:[...y,[p(D,x),"[]=",p(I,x)].join("")];case"colon-list-separator":return D=>(y,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?y:I===null?[...y,[p(D,x),":list="].join("")]:[...y,[p(D,x),":list=",p(I,x)].join("")];case"comma":case"separator":case"bracket-separator":{const D=x.arrayFormat==="bracket-separator"?"[]=":"=";return y=>(I,O)=>O===void 0||x.skipNull&&O===null||x.skipEmptyString&&O===""?I:(O=O===null?"":O,I.length===0?[[p(y,x),D,p(O,x)].join("")]:[[I,p(O,x)].join(x.arrayFormatSeparator)])}default:return D=>(y,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?y:I===null?[...y,p(D,x)]:[...y,[p(D,x),"=",p(I,x)].join("")]}}function c(x){let D;switch(x.arrayFormat){case"index":return(y,I,O)=>{if(D=/\[(\d*)\]$/.exec(y),y=y.replace(/\[\d*\]$/,""),!D){O[y]=I;return}O[y]===void 0&&(O[y]={}),O[y][D[1]]=I};case"bracket":return(y,I,O)=>{if(D=/(\[\])$/.exec(y),y=y.replace(/\[\]$/,""),!D){O[y]=I;return}if(O[y]===void 0){O[y]=[I];return}O[y]=[].concat(O[y],I)};case"colon-list-separator":return(y,I,O)=>{if(D=/(:list)$/.exec(y),y=y.replace(/:list$/,""),!D){O[y]=I;return}if(O[y]===void 0){O[y]=[I];return}O[y]=[].concat(O[y],I)};case"comma":case"separator":return(y,I,O)=>{const u=typeof I=="string"&&I.includes(x.arrayFormatSeparator),_=typeof I=="string"&&!u&&w(I,x).includes(x.arrayFormatSeparator);I=_?w(I,x):I;const H=u||_?I.split(x.arrayFormatSeparator).map(j=>w(j,x)):I===null?I:w(I,x);O[y]=H};case"bracket-separator":return(y,I,O)=>{const u=/(\[\])$/.test(y);if(y=y.replace(/\[\]$/,""),!u){O[y]=I&&w(I,x);return}const _=I===null?[]:I.split(x.arrayFormatSeparator).map(H=>w(H,x));if(O[y]===void 0){O[y]=_;return}O[y]=[].concat(O[y],_)};default:return(y,I,O)=>{if(O[y]===void 0){O[y]=I;return}O[y]=[].concat(O[y],I)}}}function l(x){if(typeof x!="string"||x.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function p(x,D){return D.encode?D.strict?e(x):encodeURIComponent(x):x}function w(x,D){return D.decode?r(x):x}function b(x){return Array.isArray(x)?x.sort():typeof x=="object"?b(Object.keys(x)).sort((D,y)=>Number(D)-Number(y)).map(D=>x[D]):x}function m(x){const D=x.indexOf("#");return D!==-1&&(x=x.slice(0,D)),x}function E(x){let D="";const y=x.indexOf("#");return y!==-1&&(D=x.slice(y)),D}function A(x){x=m(x);const D=x.indexOf("?");return D===-1?"":x.slice(D+1)}function N(x,D){return D.parseNumbers&&!Number.isNaN(Number(x))&&typeof x=="string"&&x.trim()!==""?x=Number(x):D.parseBooleans&&x!==null&&(x.toLowerCase()==="true"||x.toLowerCase()==="false")&&(x=x.toLowerCase()==="true"),x}function M(x,D){D=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},D),l(D.arrayFormatSeparator);const y=c(D),I=Object.create(null);if(typeof x!="string"||(x=x.trim().replace(/^[?#&]/,""),!x))return I;for(const O of x.split("&")){if(O==="")continue;let[u,_]=n(D.decode?O.replace(/\+/g," "):O,"=");_=_===void 0?null:["comma","separator","bracket-separator"].includes(D.arrayFormat)?_:w(_,D),y(w(u,D),_,I)}for(const O of Object.keys(I)){const u=I[O];if(typeof u=="object"&&u!==null)for(const _ of Object.keys(u))u[_]=N(u[_],D);else I[O]=N(u,D)}return D.sort===!1?I:(D.sort===!0?Object.keys(I).sort():Object.keys(I).sort(D.sort)).reduce((O,u)=>{const _=I[u];return Boolean(_)&&typeof _=="object"&&!Array.isArray(_)?O[u]=b(_):O[u]=_,O},Object.create(null))}t.extract=A,t.parse=M,t.stringify=(x,D)=>{if(!x)return"";D=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},D),l(D.arrayFormatSeparator);const y=_=>D.skipNull&&s(x[_])||D.skipEmptyString&&x[_]==="",I=a(D),O={};for(const _ of Object.keys(x))y(_)||(O[_]=x[_]);const u=Object.keys(O);return D.sort!==!1&&u.sort(D.sort),u.map(_=>{const H=x[_];return H===void 0?"":H===null?p(_,D):Array.isArray(H)?H.length===0&&D.arrayFormat==="bracket-separator"?p(_,D)+"[]":H.reduce(I(_),[]).join("&"):p(_,D)+"="+p(H,D)}).filter(_=>_.length>0).join("&")},t.parseUrl=(x,D)=>{D=Object.assign({decode:!0},D);const[y,I]=n(x,"#");return Object.assign({url:y.split("?")[0]||"",query:M(A(x),D)},D&&D.parseFragmentIdentifier&&I?{fragmentIdentifier:w(I,D)}:{})},t.stringifyUrl=(x,D)=>{D=Object.assign({encode:!0,strict:!0,[o]:!0},D);const y=m(x.url).split("?")[0]||"",I=t.extract(x.url),O=t.parse(I,{sort:!1}),u=Object.assign(O,x.query);let _=t.stringify(u,D);_&&(_=`?${_}`);let H=E(x.url);return x.fragmentIdentifier&&(H=`#${D[o]?p(x.fragmentIdentifier,D):x.fragmentIdentifier}`),`${y}${_}${H}`},t.pick=(x,D,y)=>{y=Object.assign({parseFragmentIdentifier:!0,[o]:!1},y);const{url:I,query:O,fragmentIdentifier:u}=t.parseUrl(x,y);return t.stringifyUrl({url:I,query:i(O,D),fragmentIdentifier:u},y)},t.exclude=(x,D,y)=>{const I=Array.isArray(D)?O=>!D.includes(O):(O,u)=>!D(O,u);return t.pick(x,I,y)}})(Fn);const cg={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function lg(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 Po(t,e){return t.includes(":")?[t]:e.chains||[]}const Zl="base10",Nt="base16",To="base64pad",No="utf8",Yl=0,Nr=1,hg=0,Jl=1,Ro=12,Lo=32;function ug(){const t=mo.generateKeyPair();return{privateKey:Tt(t.secretKey,Nt),publicKey:Tt(t.publicKey,Nt)}}function Mo(){const t=an.randomBytes(Lo);return Tt(t,Nt)}function dg(t,e){const r=mo.sharedKey(Pt(t,Nt),Pt(e,Nt)),n=new Of(Xi.SHA256,r).expand(Lo);return Tt(n,Nt)}function Xl(t){const e=Xi.hash(Pt(t,Nt));return Tt(e,Nt)}function ts(t){const e=Xi.hash(Pt(t,No));return Tt(e,Nt)}function fg(t){return Pt(`${t}`,Zl)}function Bn(t){return Number(Tt(t,Zl))}function pg(t){const e=fg(typeof t.type<"u"?t.type:Yl);if(Bn(e)===Nr&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Pt(t.senderPublicKey,Nt):void 0,n=typeof t.iv<"u"?Pt(t.iv,Nt):an.randomBytes(Ro),i=new co.ChaCha20Poly1305(Pt(t.symKey,Nt)).seal(n,Pt(t.message,No));return mg({type:e,sealed:i,iv:n,senderPublicKey:r})}function gg(t){const e=new co.ChaCha20Poly1305(Pt(t.symKey,Nt)),{sealed:r,iv:n}=Uo(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Tt(i,No)}function mg(t){if(Bn(t.type)===Nr){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Tt(wo([t.type,t.senderPublicKey,t.iv,t.sealed]),To)}return Tt(wo([t.type,t.iv,t.sealed]),To)}function Uo(t){const e=Pt(t,To),r=e.slice(hg,Jl),n=Jl;if(Bn(r)===Nr){const a=n+Lo,c=a+Ro,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+Ro,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function wg(t,e){const r=Uo(t);return Ql({type:Bn(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Tt(r.senderPublicKey,Nt):void 0,receiverPublicKey:e?.receiverPublicKey})}function Ql(t){const e=t?.type||Yl;if(e===Nr){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 eh(t){return t.type===Nr&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var bg=Object.defineProperty,th=Object.getOwnPropertySymbols,yg=Object.prototype.hasOwnProperty,vg=Object.prototype.propertyIsEnumerable,rh=(t,e,r)=>e in t?bg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,nh=(t,e)=>{for(var r in e||(e={}))yg.call(e,r)&&rh(t,r,e[r]);if(th)for(var r of th(e))vg.call(e,r)&&rh(t,r,e[r]);return t};const _g="ReactNative",jn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Eg="js";function ih(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function xg(){return!Hl()&&!!Oo()&&navigator.product===_g}function Cg(){return!ih()&&!!Oo()}function Sg(){return xg()?jn.reactNative:ih()?jn.node:Cg()?jn.browser:jn.unknown}function Ig(t,e){let r=Fn.parse(t);return r=nh(nh({},r),e),t=Fn.stringify(r),t}function Dg(){return Wl()||{name:"",description:"",url:"",icons:[""]}}function Og(){const t=dp();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function Ag(){var t;const e=Sg();return e===jn.browser?[e,((t=zl())==null?void 0:t.host)||"unknown"].join(":"):e}function $g(t,e,r){const n=Og(),i=Ag();return[[t,e].join("-"),[Eg,r].join("-"),n,i].join("/")}function Pg({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o}){const a=r.split("?"),c=$g(t,e,n),l={auth:i,ua:c,projectId:s,useOnCloseEvent:o||void 0},p=Ig(a[1]||"",l);return a[0]+"?"+p}function mr(t,e){return t.filter(r=>e.includes(r)).length===t.length}function sh(t){return Object.fromEntries(t.entries())}function oh(t){return new Map(Object.entries(t))}function Rr(t=de.FIVE_MINUTES,e){const r=de.toMiliseconds(t||de.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function Fo(t,e){return new Promise(async(r,n)=>{const i=setTimeout(()=>n(),e),s=await t;clearTimeout(i),r(s)})}function ah(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 Tg(t){return ah("topic",t)}function Ng(t){return ah("id",t)}function ch(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 er(t,e){return de.fromMiliseconds((e||Date.now())+de.toMiliseconds(t))}function wr(t){return Date.now()>=de.toMiliseconds(t)}function et(t,e){return`${t}${e?`:${e}`:""}`}const Rg="irn";function Bo(t){return t?.relay||{protocol:Rg}}function rs(t){const e=cg[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Lg=Object.defineProperty,lh=Object.getOwnPropertySymbols,Mg=Object.prototype.hasOwnProperty,Ug=Object.prototype.propertyIsEnumerable,hh=(t,e,r)=>e in t?Lg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Fg=(t,e)=>{for(var r in e||(e={}))Mg.call(e,r)&&hh(t,r,e[r]);if(lh)for(var r of lh(e))Ug.call(e,r)&&hh(t,r,e[r]);return t};function Bg(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 jg(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=i[0],o=typeof r<"u"?t.substring(r):"",a=Fn.parse(o),c=a.symKey;if(c.length!==64)throw new Error(`Invalid symKey: ${c}`);const l=Xl(c);if(s!==l)throw new Error(`Invalid topic: ${s}`);return{protocol:n,topic:s,version:parseInt(i[1],10),symKey:c,relay:Bg(a)}}function kg(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 Hg(t){return`${t.protocol}:${t.topic}@${t.version}?`+Fn.stringify(Fg({symKey:t.symKey},kg(t.relay)))}function kn(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function zg(t){const e=[];return Object.values(t).forEach(r=>{e.push(...kn(r.accounts))}),e}function Wg(t,e){const r=[];return Object.values(t).forEach(n=>{kn(n.accounts).includes(e)&&r.push(...n.methods)}),r}function qg(t,e){const r=[];return Object.values(t).forEach(n=>{kn(n.accounts).includes(e)&&r.push(...n.events)}),r}function Vg(t,e){const r=ns(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 Kg={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}},Gg={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}=Gg[t];return{message:e?`${r} ${e}`:r,code:n}}function tt(t,e){const{message:r,code:n}=Kg[t];return{message:e?`${r} ${e}`:r,code:n}}function br(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Hn(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ot(t){return typeof t>"u"}function dt(t,e){return e&&Ot(t)?!0:typeof t=="string"&&Boolean(t.trim().length)}function jo(t,e){return e&&Ot(t)?!0:typeof t=="number"&&!isNaN(t)}function Zg(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return mr(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],p=kn(a),w=r[o];(!mr(Po(o,w),p)||!mr(w.methods,c)||!mr(w.events,l))&&(s=!1)}),s):!1}function ko(t){return dt(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Yg(t){if(dt(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&ko(r)}}return!1}function Jg(t){if(dt(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Xg(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Qg(t){return t?.topic}function e2(t,e){let r=null;return dt(t?.publicKey,!1)||(r=se("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function uh(t){let e=!0;return br(t)?t.length&&(e=t.every(r=>dt(r,!1))):e=!1,e}function t2(t,e,r){let n=null;return br(e)?e.forEach(i=>{n||(!ko(i)||!i.includes(t))&&(n=tt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=tt("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function r2(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;const s=t2(n,Po(n,i),`${e} requiredNamespace`);s&&(r=s)}),r}function n2(t,e){let r=null;return br(t)?t.forEach(n=>{r||Yg(n)||(r=tt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=tt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function i2(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=n2(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function s2(t,e){let r=null;return uh(t?.methods)?uh(t?.events)||(r=tt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=tt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function dh(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=s2(n,`${e}, namespace`);i&&(r=i)}),r}function o2(t,e,r){let n=null;if(t&&Hn(t)){const i=dh(t,e);i&&(n=i);const s=r2(t,e);s&&(n=s)}else n=se("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function ns(t,e){let r=null;if(t&&Hn(t)){const n=dh(t,e);n&&(r=n);const i=i2(t,e);i&&(r=i)}else r=se("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function fh(t){return dt(t.protocol,!0)}function a2(t,e){let r=!1;return e&&!t?r=!0:t&&br(t)&&t.length&&t.forEach(n=>{r=fh(n)}),r}function c2(t){return typeof t=="number"}function Rt(t){return typeof t<"u"&&typeof t!==null}function l2(t){return!(!t||typeof t!="object"||!t.code||!jo(t.code,!1)||!t.message||!dt(t.message,!1))}function h2(t){return!(Ot(t)||!dt(t.method,!1))}function u2(t){return!(Ot(t)||Ot(t.result)&&Ot(t.error)||!jo(t.id,!1)||!dt(t.jsonrpc,!1))}function d2(t){return!(Ot(t)||!dt(t.name,!1))}function ph(t,e){return!(!ko(e)||!zg(t).includes(e))}function f2(t,e,r){return dt(r,!1)?Wg(t,e).includes(r):!1}function p2(t,e,r){return dt(r,!1)?qg(t,e).includes(r):!1}function Ho(t,e,r,n){let i=null;const s=Object.keys(t),o=Object.keys(e);return mr(s,o)?s.forEach(a=>{if(i)return;const c=kn(e[a].accounts);mr(Po(a,t[a]),c)?mr(t[a].methods,e[a].methods)?mr(t[a].events,e[a].events)||(i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${a}`)):i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${a}`):i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace chains for ${a}`)}):i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy ${n}`),i}function g2(t,e){return jo(t,!1)&&t<=e.max&&t>=e.min}function m2(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var w2=b2;function b2(t,e,r){var n=r&&r.stringify||m2,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,b=t&&t.length||0,m=0;m<b;){if(t.charCodeAt(m)===37&&m+1<b){switch(w=w>-1?w:0,t.charCodeAt(m+1)){case 100:case 102:if(p>=c||e[p]==null)break;w<m&&(l+=t.slice(w,m)),l+=Number(e[p]),w=m+2,m++;break;case 105:if(p>=c||e[p]==null)break;w<m&&(l+=t.slice(w,m)),l+=Math.floor(Number(e[p])),w=m+2,m++;break;case 79:case 111:case 106:if(p>=c||e[p]===void 0)break;w<m&&(l+=t.slice(w,m));var E=typeof e[p];if(E==="string"){l+="'"+e[p]+"'",w=m+2,m++;break}if(E==="function"){l+=e[p].name||"<anonymous>",w=m+2,m++;break}l+=n(e[p]),w=m+2,m++;break;case 115:if(p>=c)break;w<m&&(l+=t.slice(w,m)),l+=String(e[p]),w=m+2,m++;break;case 37:w<m&&(l+=t.slice(w,m)),l+="%",w=m+2,m++,p--;break}++p}++m}return w===-1?t:(w<b&&(l+=t.slice(w)),l)}const gh=w2;var zn=tr;const Wn=O2().console||{},y2={mapHttpRequest:ss,mapHttpResponse:ss,wrapRequestSerializer:Wo,wrapResponseSerializer:Wo,wrapErrorSerializer:Wo,req:ss,res:ss,err:C2};function v2(t,e){return Array.isArray(t)?t.filter(function(n){return n!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function tr(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||Wn;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=v2(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=qn),Object.defineProperty(c,"levelVal",{get:p}),Object.defineProperty(c,"level",{get:w,set:b});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:S2(t)};c.levels=tr.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=qn,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=m,e&&(c._logEvent=zo());function p(){return this.level==="silent"?1/0:this.levels.values[this.level]}function w(){return this._level}function b(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 m(E,A){if(!E)throw new Error("missing bindings for child Pino");A=A||{},i&&E.serializers&&(A.serializers=E.serializers);const N=A.serializers;if(i&&N){var M=Object.assign({},n,N),x=t.browser.serialize===!0?Object.keys(M):i;delete E.serializers,is([E],x,M,this._stdErrSerialize)}function D(y){this._childLevel=(y._childLevel|0)+1,this.error=un(y,E,"error"),this.fatal=un(y,E,"fatal"),this.warn=un(y,E,"warn"),this.info=un(y,E,"info"),this.debug=un(y,E,"debug"),this.trace=un(y,E,"trace"),M&&(this.serializers=M,this._serialize=x),e&&(this._logEvent=zo([].concat(y._logEvent.bindings,E)))}return D.prototype=this,new D(this)}return c}tr.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"}},tr.stdSerializers=y2,tr.stdTimeFunctions=Object.assign({},{nullTime:mh,epochTime:wh,unixTime:I2,isoTime:D2});function hn(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?qn:i[r]?i[r]:Wn[r]||Wn[n]||qn,_2(t,e,r)}function _2(t,e,r){!t.transmit&&e[r]===qn||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Wn?Wn:this;for(var c=0;c<o.length;c++)o[c]=arguments[c];if(t.serialize&&!t.asObject&&is(o,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?n.call(a,E2(this,r,o,s)):n.apply(a,o),t.transmit){const l=t.transmit.level||e.level,p=tr.levels.values[l],w=tr.levels.values[r];if(w<p)return;x2(this,{ts:s,methodLevel:r,methodValue:w,transmitLevel:l,transmitValue:tr.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},o)}}}(e[r]))}function E2(t,e,r,n){t._serialize&&is(r,t._serialize,t.serializers,t._stdErrSerialize);const i=r.slice();let s=i[0];const o={};n&&(o.time=n),o.level=tr.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?gh(i.shift(),i):void 0}else typeof s=="string"&&(s=gh(i.shift(),i));return s!==void 0&&(o.msg=s),o}function is(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=tr.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 un(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 x2(t,e,r){const n=e.send,i=e.ts,s=e.methodLevel,o=e.methodValue,a=e.val,c=t._logEvent.bindings;is(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=zo(c)}function zo(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function C2(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 S2(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?mh:wh}function ss(){return{}}function Wo(t){return t}function qn(){}function mh(){return!1}function wh(){return Date.now()}function I2(){return Math.round(Date.now()/1e3)}function D2(){return new Date(Date.now()).toISOString()}function O2(){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 os={};/*! *****************************************************************************
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 zo=function(t,e){return zo=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])},zo(t,e)};function D2(t,e){zo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Wo=function(){return Wo=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},Wo.apply(this,arguments)};function O2(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 A2(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 $2(t,e){return function(r,n){e(r,n,t)}}function P2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function T2(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 N2(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 R2(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function L2(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function qo(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 wu(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 M2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(wu(arguments[e]));return t}function U2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Vn(t){return this instanceof Vn?(this.v=t,this):new Vn(t)}function F2(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(y){n[y]&&(i[y]=function(m){return new Promise(function(E,A){s.push([y,m,E,A])>1||a(y,m)})})}function a(y,m){try{c(n[y](m))}catch(E){w(s[0][3],E)}}function c(y){y.value instanceof Vn?Promise.resolve(y.value.v).then(l,p):w(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function w(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function B2(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Vn(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function j2(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 qo=="function"?qo(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 k2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function H2(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 z2(t){return t&&t.__esModule?t:{default:t}}function W2(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function q2(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 V2=Object.freeze({__proto__:null,__extends:D2,get __assign(){return Wo},__rest:O2,__decorate:A2,__param:$2,__metadata:P2,__awaiter:T2,__generator:N2,__createBinding:R2,__exportStar:L2,__values:qo,__read:wu,__spread:M2,__spreadArrays:U2,__await:Vn,__asyncGenerator:F2,__asyncDelegator:B2,__asyncValues:j2,__makeTemplateObject:k2,__importStar:H2,__importDefault:z2,__classPrivateFieldGet:W2,__classPrivateFieldSet:q2}),yu=$r(V2),Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});function K2(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}}Kn.safeJsonParse=K2;function G2(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}Kn.safeJsonStringify=G2;var Gn={exports:{}},bu;function Y2(){return bu||(bu=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?Gn.exports=ut.localStorage:typeof window<"u"&&window.localStorage?Gn.exports=window.localStorage:Gn.exports=new e}()),Gn.exports}var Vo={},Yn={},vu;function Z2(){if(vu)return Yn;vu=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.IKeyValueStorage=void 0;class t{}return Yn.IKeyValueStorage=t,Yn}var Zn={},_u;function J2(){if(_u)return Zn;_u=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.parseEntry=void 0;const t=Kn;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return Zn.parseEntry=e,Zn}var Eu;function X2(){return Eu||(Eu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=yu;e.__exportStar(Z2(),t),e.__exportStar(J2(),t)}(Vo)),Vo}Object.defineProperty(is,"__esModule",{value:!0}),is.KeyValueStorage=void 0;const fn=yu,xu=Kn,Q2=fn.__importDefault(Y2()),e3=X2();class Cu{constructor(){this.localStorage=Q2.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(e3.parseEntry)})}getItem(e){return fn.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return xu.safeJsonParse(r)})}setItem(e,r){return fn.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,xu.safeJsonStringify(r))})}removeItem(e){return fn.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}is.KeyValueStorage=Cu;var t3=is.default=Cu,Jn={};/*! *****************************************************************************
27
+ ***************************************************************************** */var qo=function(t,e){return qo=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])},qo(t,e)};function A2(t,e){qo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Vo=function(){return Vo=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},Vo.apply(this,arguments)};function $2(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 P2(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 T2(t,e){return function(r,n){e(r,n,t)}}function N2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function R2(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 L2(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 M2(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function U2(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Ko(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 bh(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 F2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(bh(arguments[e]));return t}function B2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Vn(t){return this instanceof Vn?(this.v=t,this):new Vn(t)}function j2(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(b){n[b]&&(i[b]=function(m){return new Promise(function(E,A){s.push([b,m,E,A])>1||a(b,m)})})}function a(b,m){try{c(n[b](m))}catch(E){w(s[0][3],E)}}function c(b){b.value instanceof Vn?Promise.resolve(b.value.v).then(l,p):w(s[0][2],b)}function l(b){a("next",b)}function p(b){a("throw",b)}function w(b,m){b(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function k2(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Vn(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function H2(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 Ko=="function"?Ko(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 z2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function W2(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 q2(t){return t&&t.__esModule?t:{default:t}}function V2(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function K2(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 G2=Object.freeze({__proto__:null,__extends:A2,get __assign(){return Vo},__rest:$2,__decorate:P2,__param:T2,__metadata:N2,__awaiter:R2,__generator:L2,__createBinding:M2,__exportStar:U2,__values:Ko,__read:bh,__spread:F2,__spreadArrays:B2,__await:Vn,__asyncGenerator:j2,__asyncDelegator:k2,__asyncValues:H2,__makeTemplateObject:z2,__importStar:W2,__importDefault:q2,__classPrivateFieldGet:V2,__classPrivateFieldSet:K2}),yh=Ar(G2),Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});function Z2(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}}Kn.safeJsonParse=Z2;function Y2(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}Kn.safeJsonStringify=Y2;var Gn={exports:{}},vh;function J2(){return vh||(vh=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 ht<"u"&&ht.localStorage?Gn.exports=ht.localStorage:typeof window<"u"&&window.localStorage?Gn.exports=window.localStorage:Gn.exports=new e}()),Gn.exports}var Go={},Zn={},_h;function X2(){if(_h)return Zn;_h=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.IKeyValueStorage=void 0;class t{}return Zn.IKeyValueStorage=t,Zn}var Yn={},Eh;function Q2(){if(Eh)return Yn;Eh=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.parseEntry=void 0;const t=Kn;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return Yn.parseEntry=e,Yn}var xh;function e3(){return xh||(xh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=yh;e.__exportStar(X2(),t),e.__exportStar(Q2(),t)}(Go)),Go}Object.defineProperty(os,"__esModule",{value:!0}),os.KeyValueStorage=void 0;const dn=yh,Ch=Kn,t3=dn.__importDefault(J2()),r3=e3();class Sh{constructor(){this.localStorage=t3.default}getKeys(){return dn.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return dn.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(r3.parseEntry)})}getItem(e){return dn.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return Ch.safeJsonParse(r)})}setItem(e,r){return dn.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,Ch.safeJsonStringify(r))})}removeItem(e){return dn.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}os.KeyValueStorage=Sh;var n3=os.default=Sh,Jn={};/*! *****************************************************************************
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 r3(t,e){Ko(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 n3(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 i3(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 o3(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function a3(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 c3(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 l3(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function u3(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Yo(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 h3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Su(arguments[e]));return t}function d3(){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 Xn(t){return this instanceof Xn?(this.v=t,this):new Xn(t)}function f3(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(y){n[y]&&(i[y]=function(m){return new Promise(function(E,A){s.push([y,m,E,A])>1||a(y,m)})})}function a(y,m){try{c(n[y](m))}catch(E){w(s[0][3],E)}}function c(y){y.value instanceof Xn?Promise.resolve(y.value.v).then(l,p):w(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function w(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function p3(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:Xn(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function g3(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 Yo=="function"?Yo(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 w3(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 y3(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 v3(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 _3=Object.freeze({__proto__:null,__extends:r3,get __assign(){return Go},__rest:n3,__decorate:i3,__param:s3,__metadata:o3,__awaiter:a3,__generator:c3,__createBinding:l3,__exportStar:u3,__values:Yo,__read:Su,__spread:h3,__spreadArrays:d3,__await:Xn,__asyncGenerator:f3,__asyncDelegator:p3,__asyncValues:g3,__makeTemplateObject:m3,__importStar:w3,__importDefault:y3,__classPrivateFieldGet:b3,__classPrivateFieldSet:v3}),ss=$r(_3),Qn={},Zo={},ei={};class Mr{}var E3=Object.freeze({__proto__:null,IEvents:Mr}),x3=$r(E3),Iu;function C3(){if(Iu)return ei;Iu=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.IHeartBeat=void 0;const t=x3;class e extends t.IEvents{constructor(n){super()}}return ei.IHeartBeat=e,ei}var Du;function Ou(){return Du||(Du=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ss.__exportStar(C3(),t)}(Zo)),Zo}var Jo={},Ur={},Au;function S3(){if(Au)return Ur;Au=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.HEARTBEAT_EVENTS=Ur.HEARTBEAT_INTERVAL=void 0;const t=me;return Ur.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Ur.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Ur}var $u;function Pu(){return $u||($u=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ss.__exportStar(S3(),t)}(Jo)),Jo}var Tu;function I3(){if(Tu)return Qn;Tu=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.HeartBeat=void 0;const t=ss,e=_t.exports,r=me,n=Ou(),i=Pu();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 Qn.HeartBeat=s,Qn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ss;e.__exportStar(I3(),t),e.__exportStar(Ou(),t),e.__exportStar(Pu(),t)})(Jn);var je={};/*! *****************************************************************************
40
+ ***************************************************************************** */var Zo=function(t,e){return Zo=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])},Zo(t,e)};function i3(t,e){Zo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Yo=function(){return Yo=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},Yo.apply(this,arguments)};function s3(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 o3(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 a3(t,e){return function(r,n){e(r,n,t)}}function c3(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function l3(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 h3(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 u3(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function d3(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Jo(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 Ih(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 f3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ih(arguments[e]));return t}function p3(){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 Xn(t){return this instanceof Xn?(this.v=t,this):new Xn(t)}function g3(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(b){n[b]&&(i[b]=function(m){return new Promise(function(E,A){s.push([b,m,E,A])>1||a(b,m)})})}function a(b,m){try{c(n[b](m))}catch(E){w(s[0][3],E)}}function c(b){b.value instanceof Xn?Promise.resolve(b.value.v).then(l,p):w(s[0][2],b)}function l(b){a("next",b)}function p(b){a("throw",b)}function w(b,m){b(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function m3(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:Xn(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function w3(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 Jo=="function"?Jo(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 b3(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function y3(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 v3(t){return t&&t.__esModule?t:{default:t}}function _3(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function E3(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 x3=Object.freeze({__proto__:null,__extends:i3,get __assign(){return Yo},__rest:s3,__decorate:o3,__param:a3,__metadata:c3,__awaiter:l3,__generator:h3,__createBinding:u3,__exportStar:d3,__values:Jo,__read:Ih,__spread:f3,__spreadArrays:p3,__await:Xn,__asyncGenerator:g3,__asyncDelegator:m3,__asyncValues:w3,__makeTemplateObject:b3,__importStar:y3,__importDefault:v3,__classPrivateFieldGet:_3,__classPrivateFieldSet:E3}),as=Ar(x3),Qn={},Xo={},ei={};class Lr{}var C3=Object.freeze({__proto__:null,IEvents:Lr}),S3=Ar(C3),Dh;function I3(){if(Dh)return ei;Dh=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.IHeartBeat=void 0;const t=S3;class e extends t.IEvents{constructor(n){super()}}return ei.IHeartBeat=e,ei}var Oh;function Ah(){return Oh||(Oh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),as.__exportStar(I3(),t)}(Xo)),Xo}var Qo={},Mr={},$h;function D3(){if($h)return Mr;$h=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.HEARTBEAT_EVENTS=Mr.HEARTBEAT_INTERVAL=void 0;const t=de;return Mr.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Mr.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Mr}var Ph;function Th(){return Ph||(Ph=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),as.__exportStar(D3(),t)}(Qo)),Qo}var Nh;function O3(){if(Nh)return Qn;Nh=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.HeartBeat=void 0;const t=as,e=ut.exports,r=de,n=Ah(),i=Th();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 Qn.HeartBeat=s,Qn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=as;e.__exportStar(O3(),t),e.__exportStar(Ah(),t),e.__exportStar(Th(),t)})(Jn);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 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 D3(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 O3(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 A3(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 $3(t,e){return function(r,n){e(r,n,t)}}function P3(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function T3(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 N3(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 R3(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function L3(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 Nu(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 M3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Nu(arguments[e]));return t}function U3(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function ti(t){return this instanceof ti?(this.v=t,this):new ti(t)}function F3(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(y){n[y]&&(i[y]=function(m){return new Promise(function(E,A){s.push([y,m,E,A])>1||a(y,m)})})}function a(y,m){try{c(n[y](m))}catch(E){w(s[0][3],E)}}function c(y){y.value instanceof ti?Promise.resolve(y.value.v).then(l,p):w(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function w(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function B3(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:ti(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function j3(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 k3(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function H3(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 z3(t){return t&&t.__esModule?t:{default:t}}function W3(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function q3(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 V3=Object.freeze({__proto__:null,__extends:D3,get __assign(){return Qo},__rest:O3,__decorate:A3,__param:$3,__metadata:P3,__awaiter:T3,__generator:N3,__createBinding:R3,__exportStar:L3,__values:ea,__read:Nu,__spread:M3,__spreadArrays:U3,__await:ti,__asyncGenerator:F3,__asyncDelegator:B3,__asyncValues:j3,__makeTemplateObject:k3,__importStar:H3,__importDefault:z3,__classPrivateFieldGet:W3,__classPrivateFieldSet:q3}),K3=$r(V3),Fr={},Ru;function Lu(){return Ru||(Ru=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.PINO_CUSTOM_CONTEXT_KEY=Fr.PINO_LOGGER_DEFAULTS=void 0,Fr.PINO_LOGGER_DEFAULTS={level:"info"},Fr.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Fr}var At={},Mu;function G3(){if(Mu)return At;Mu=1,Object.defineProperty(At,"__esModule",{value:!0}),At.generateChildLogger=At.formatChildLoggerContext=At.getLoggerContext=At.setBrowserLoggerContext=At.getBrowserLoggerContext=At.getDefaultLoggerOptions=void 0;const t=Lu();function e(a){return Object.assign(Object.assign({},a),{level:a?.level||t.PINO_LOGGER_DEFAULTS.level})}At.getDefaultLoggerOptions=e;function r(a,c=t.PINO_CUSTOM_CONTEXT_KEY){return a[c]||""}At.getBrowserLoggerContext=r;function n(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){return a[l]=c,a}At.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}At.getLoggerContext=i;function s(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=i(a,l);return p.trim()?`${p}/${c}`:c}At.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 At.generateChildLogger=o,At}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=K3,r=e.__importDefault(zn);Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(Lu(),t),e.__exportStar(G3(),t)})(je);class Y3 extends Mr{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class Z3 extends Mr{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class J3{constructor(e,r){this.logger=e,this.core=r}}class X3 extends Mr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class Q3 extends Mr{constructor(e){super()}}class em{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class tm extends Mr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class rm extends Mr{constructor(e,r){super(),this.core=e,this.logger=r}}class nm{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class im{constructor(e){this.client=e}}function ta(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 ri(t){return typeof t=="string"?t:JSON.stringify(t)}var ra={},Uu={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ve,r=Ut;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,y=l<<3,m=l%128<112?128:256;this._buffer[p]=128;for(var E=p+1;E<m-8;E++)this._buffer[E]=0;e.writeUint32BE(w,this._buffer,m-8),e.writeUint32BE(y,this._buffer,m-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,m),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,y,m){for(var E=l[0],A=l[1],N=l[2],M=l[3],x=l[4],D=l[5],b=l[6],I=l[7],O=p[0],h=p[1],_=p[2],H=p[3],j=p[4],q=p[5],X=p[6],re=p[7],C,$,G,K,W,z,J,Y;m>=128;){for(var le=0;le<16;le++){var ee=8*le+y;a[le]=e.readUint32BE(w,ee),c[le]=e.readUint32BE(w,ee+4)}for(var le=0;le<80;le++){var fe=E,ae=A,Ce=N,B=M,F=x,R=D,f=b,P=I,te=O,ie=h,Ee=_,Le=H,$e=j,Me=q,Ye=X,Ke=re;if(C=I,$=re,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=(x>>>14|j<<32-14)^(x>>>18|j<<32-18)^(j>>>41-32|x<<32-(41-32)),$=(j>>>14|x<<32-14)^(j>>>18|x<<32-18)^(x>>>41-32|j<<32-(41-32)),W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,C=x&D^~x&b,$=j&q^~j&X,W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,C=i[le*2],$=i[le*2+1],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,C=a[le%16],$=c[le%16],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,G=J&65535|Y<<16,K=W&65535|z<<16,C=G,$=K,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=(E>>>28|O<<32-28)^(O>>>34-32|E<<32-(34-32))^(O>>>39-32|E<<32-(39-32)),$=(O>>>28|E<<32-28)^(E>>>34-32|O<<32-(34-32))^(E>>>39-32|O<<32-(39-32)),W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,C=E&A^E&N^A&N,$=O&h^O&_^h&_,W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,P=J&65535|Y<<16,Ke=W&65535|z<<16,C=B,$=Le,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=G,$=K,W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,B=J&65535|Y<<16,Le=W&65535|z<<16,A=fe,N=ae,M=Ce,x=B,D=F,b=R,I=f,E=P,h=te,_=ie,H=Ee,j=Le,q=$e,X=Me,re=Ye,O=Ke,le%16===15)for(var ee=0;ee<16;ee++)C=a[ee],$=c[ee],W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=a[(ee+9)%16],$=c[(ee+9)%16],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,G=a[(ee+1)%16],K=c[(ee+1)%16],C=(G>>>1|K<<32-1)^(G>>>8|K<<32-8)^G>>>7,$=(K>>>1|G<<32-1)^(K>>>8|G<<32-8)^(K>>>7|G<<32-7),W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,G=a[(ee+14)%16],K=c[(ee+14)%16],C=(G>>>19|K<<32-19)^(K>>>61-32|G<<32-(61-32))^G>>>6,$=(K>>>19|G<<32-19)^(G>>>61-32|K<<32-(61-32))^(K>>>6|G<<32-6),W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,a[ee]=J&65535|Y<<16,c[ee]=W&65535|z<<16}C=E,$=O,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[0],$=p[0],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[0]=E=J&65535|Y<<16,p[0]=O=W&65535|z<<16,C=A,$=h,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[1],$=p[1],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[1]=A=J&65535|Y<<16,p[1]=h=W&65535|z<<16,C=N,$=_,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[2],$=p[2],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[2]=N=J&65535|Y<<16,p[2]=_=W&65535|z<<16,C=M,$=H,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[3],$=p[3],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[3]=M=J&65535|Y<<16,p[3]=H=W&65535|z<<16,C=x,$=j,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[4],$=p[4],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[4]=x=J&65535|Y<<16,p[4]=j=W&65535|z<<16,C=D,$=q,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[5],$=p[5],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[5]=D=J&65535|Y<<16,p[5]=q=W&65535|z<<16,C=b,$=X,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[6],$=p[6],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[6]=b=J&65535|Y<<16,p[6]=X=W&65535|z<<16,C=I,$=re,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[7],$=p[7],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[7]=I=J&65535|Y<<16,p[7]=re=W&65535|z<<16,y+=128,m-=128}return y}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Uu),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=cn,r=Uu,n=Ut;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 R=0;R<B.length;R++)F[R]=B[R];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]),y=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m(B,F){for(let R=0;R<16;R++)B[R]=F[R]|0}function E(B){let F=1;for(let R=0;R<16;R++){let f=B[R]+F+65535;F=Math.floor(f/65536),B[R]=f-F*65536}B[0]+=F-1+37*(F-1)}function A(B,F,R){const f=~(R-1);for(let P=0;P<16;P++){const te=f&(B[P]^F[P]);B[P]^=te,F[P]^=te}}function N(B,F){const R=i(),f=i();for(let P=0;P<16;P++)f[P]=F[P];E(f),E(f),E(f);for(let P=0;P<2;P++){R[0]=f[0]-65517;for(let ie=1;ie<15;ie++)R[ie]=f[ie]-65535-(R[ie-1]>>16&1),R[ie-1]&=65535;R[15]=f[15]-32767-(R[14]>>16&1);const te=R[15]>>16&1;R[14]&=65535,A(f,R,1-te)}for(let P=0;P<16;P++)B[2*P]=f[P]&255,B[2*P+1]=f[P]>>8}function M(B,F){let R=0;for(let f=0;f<32;f++)R|=B[f]^F[f];return(1&R-1>>>8)-1}function x(B,F){const R=new Uint8Array(32),f=new Uint8Array(32);return N(R,B),N(f,F),M(R,f)}function D(B){const F=new Uint8Array(32);return N(F,B),F[0]&1}function b(B,F){for(let R=0;R<16;R++)B[R]=F[2*R]+(F[2*R+1]<<8);B[15]&=32767}function I(B,F,R){for(let f=0;f<16;f++)B[f]=F[f]+R[f]}function O(B,F,R){for(let f=0;f<16;f++)B[f]=F[f]-R[f]}function h(B,F,R){let f,P,te=0,ie=0,Ee=0,Le=0,$e=0,Me=0,Ye=0,Ke=0,Pe=0,De=0,ge=0,Se=0,Oe=0,pe=0,xe=0,g=0,u=0,d=0,v=0,T=0,U=0,k=0,oe=0,he=0,Ne=0,Fe=0,Re=0,Ht=0,rn=0,ji=0,Qs=0,rt=R[0],Je=R[1],nt=R[2],it=R[3],st=R[4],Xe=R[5],ft=R[6],pt=R[7],gt=R[8],mt=R[9],wt=R[10],lt=R[11],ot=R[12],Ge=R[13],yt=R[14],bt=R[15];f=F[0],te+=f*rt,ie+=f*Je,Ee+=f*nt,Le+=f*it,$e+=f*st,Me+=f*Xe,Ye+=f*ft,Ke+=f*pt,Pe+=f*gt,De+=f*mt,ge+=f*wt,Se+=f*lt,Oe+=f*ot,pe+=f*Ge,xe+=f*yt,g+=f*bt,f=F[1],ie+=f*rt,Ee+=f*Je,Le+=f*nt,$e+=f*it,Me+=f*st,Ye+=f*Xe,Ke+=f*ft,Pe+=f*pt,De+=f*gt,ge+=f*mt,Se+=f*wt,Oe+=f*lt,pe+=f*ot,xe+=f*Ge,g+=f*yt,u+=f*bt,f=F[2],Ee+=f*rt,Le+=f*Je,$e+=f*nt,Me+=f*it,Ye+=f*st,Ke+=f*Xe,Pe+=f*ft,De+=f*pt,ge+=f*gt,Se+=f*mt,Oe+=f*wt,pe+=f*lt,xe+=f*ot,g+=f*Ge,u+=f*yt,d+=f*bt,f=F[3],Le+=f*rt,$e+=f*Je,Me+=f*nt,Ye+=f*it,Ke+=f*st,Pe+=f*Xe,De+=f*ft,ge+=f*pt,Se+=f*gt,Oe+=f*mt,pe+=f*wt,xe+=f*lt,g+=f*ot,u+=f*Ge,d+=f*yt,v+=f*bt,f=F[4],$e+=f*rt,Me+=f*Je,Ye+=f*nt,Ke+=f*it,Pe+=f*st,De+=f*Xe,ge+=f*ft,Se+=f*pt,Oe+=f*gt,pe+=f*mt,xe+=f*wt,g+=f*lt,u+=f*ot,d+=f*Ge,v+=f*yt,T+=f*bt,f=F[5],Me+=f*rt,Ye+=f*Je,Ke+=f*nt,Pe+=f*it,De+=f*st,ge+=f*Xe,Se+=f*ft,Oe+=f*pt,pe+=f*gt,xe+=f*mt,g+=f*wt,u+=f*lt,d+=f*ot,v+=f*Ge,T+=f*yt,U+=f*bt,f=F[6],Ye+=f*rt,Ke+=f*Je,Pe+=f*nt,De+=f*it,ge+=f*st,Se+=f*Xe,Oe+=f*ft,pe+=f*pt,xe+=f*gt,g+=f*mt,u+=f*wt,d+=f*lt,v+=f*ot,T+=f*Ge,U+=f*yt,k+=f*bt,f=F[7],Ke+=f*rt,Pe+=f*Je,De+=f*nt,ge+=f*it,Se+=f*st,Oe+=f*Xe,pe+=f*ft,xe+=f*pt,g+=f*gt,u+=f*mt,d+=f*wt,v+=f*lt,T+=f*ot,U+=f*Ge,k+=f*yt,oe+=f*bt,f=F[8],Pe+=f*rt,De+=f*Je,ge+=f*nt,Se+=f*it,Oe+=f*st,pe+=f*Xe,xe+=f*ft,g+=f*pt,u+=f*gt,d+=f*mt,v+=f*wt,T+=f*lt,U+=f*ot,k+=f*Ge,oe+=f*yt,he+=f*bt,f=F[9],De+=f*rt,ge+=f*Je,Se+=f*nt,Oe+=f*it,pe+=f*st,xe+=f*Xe,g+=f*ft,u+=f*pt,d+=f*gt,v+=f*mt,T+=f*wt,U+=f*lt,k+=f*ot,oe+=f*Ge,he+=f*yt,Ne+=f*bt,f=F[10],ge+=f*rt,Se+=f*Je,Oe+=f*nt,pe+=f*it,xe+=f*st,g+=f*Xe,u+=f*ft,d+=f*pt,v+=f*gt,T+=f*mt,U+=f*wt,k+=f*lt,oe+=f*ot,he+=f*Ge,Ne+=f*yt,Fe+=f*bt,f=F[11],Se+=f*rt,Oe+=f*Je,pe+=f*nt,xe+=f*it,g+=f*st,u+=f*Xe,d+=f*ft,v+=f*pt,T+=f*gt,U+=f*mt,k+=f*wt,oe+=f*lt,he+=f*ot,Ne+=f*Ge,Fe+=f*yt,Re+=f*bt,f=F[12],Oe+=f*rt,pe+=f*Je,xe+=f*nt,g+=f*it,u+=f*st,d+=f*Xe,v+=f*ft,T+=f*pt,U+=f*gt,k+=f*mt,oe+=f*wt,he+=f*lt,Ne+=f*ot,Fe+=f*Ge,Re+=f*yt,Ht+=f*bt,f=F[13],pe+=f*rt,xe+=f*Je,g+=f*nt,u+=f*it,d+=f*st,v+=f*Xe,T+=f*ft,U+=f*pt,k+=f*gt,oe+=f*mt,he+=f*wt,Ne+=f*lt,Fe+=f*ot,Re+=f*Ge,Ht+=f*yt,rn+=f*bt,f=F[14],xe+=f*rt,g+=f*Je,u+=f*nt,d+=f*it,v+=f*st,T+=f*Xe,U+=f*ft,k+=f*pt,oe+=f*gt,he+=f*mt,Ne+=f*wt,Fe+=f*lt,Re+=f*ot,Ht+=f*Ge,rn+=f*yt,ji+=f*bt,f=F[15],g+=f*rt,u+=f*Je,d+=f*nt,v+=f*it,T+=f*st,U+=f*Xe,k+=f*ft,oe+=f*pt,he+=f*gt,Ne+=f*mt,Fe+=f*wt,Re+=f*lt,Ht+=f*ot,rn+=f*Ge,ji+=f*yt,Qs+=f*bt,te+=38*u,ie+=38*d,Ee+=38*v,Le+=38*T,$e+=38*U,Me+=38*k,Ye+=38*oe,Ke+=38*he,Pe+=38*Ne,De+=38*Fe,ge+=38*Re,Se+=38*Ht,Oe+=38*rn,pe+=38*ji,xe+=38*Qs,P=1,f=te+P+65535,P=Math.floor(f/65536),te=f-P*65536,f=ie+P+65535,P=Math.floor(f/65536),ie=f-P*65536,f=Ee+P+65535,P=Math.floor(f/65536),Ee=f-P*65536,f=Le+P+65535,P=Math.floor(f/65536),Le=f-P*65536,f=$e+P+65535,P=Math.floor(f/65536),$e=f-P*65536,f=Me+P+65535,P=Math.floor(f/65536),Me=f-P*65536,f=Ye+P+65535,P=Math.floor(f/65536),Ye=f-P*65536,f=Ke+P+65535,P=Math.floor(f/65536),Ke=f-P*65536,f=Pe+P+65535,P=Math.floor(f/65536),Pe=f-P*65536,f=De+P+65535,P=Math.floor(f/65536),De=f-P*65536,f=ge+P+65535,P=Math.floor(f/65536),ge=f-P*65536,f=Se+P+65535,P=Math.floor(f/65536),Se=f-P*65536,f=Oe+P+65535,P=Math.floor(f/65536),Oe=f-P*65536,f=pe+P+65535,P=Math.floor(f/65536),pe=f-P*65536,f=xe+P+65535,P=Math.floor(f/65536),xe=f-P*65536,f=g+P+65535,P=Math.floor(f/65536),g=f-P*65536,te+=P-1+37*(P-1),P=1,f=te+P+65535,P=Math.floor(f/65536),te=f-P*65536,f=ie+P+65535,P=Math.floor(f/65536),ie=f-P*65536,f=Ee+P+65535,P=Math.floor(f/65536),Ee=f-P*65536,f=Le+P+65535,P=Math.floor(f/65536),Le=f-P*65536,f=$e+P+65535,P=Math.floor(f/65536),$e=f-P*65536,f=Me+P+65535,P=Math.floor(f/65536),Me=f-P*65536,f=Ye+P+65535,P=Math.floor(f/65536),Ye=f-P*65536,f=Ke+P+65535,P=Math.floor(f/65536),Ke=f-P*65536,f=Pe+P+65535,P=Math.floor(f/65536),Pe=f-P*65536,f=De+P+65535,P=Math.floor(f/65536),De=f-P*65536,f=ge+P+65535,P=Math.floor(f/65536),ge=f-P*65536,f=Se+P+65535,P=Math.floor(f/65536),Se=f-P*65536,f=Oe+P+65535,P=Math.floor(f/65536),Oe=f-P*65536,f=pe+P+65535,P=Math.floor(f/65536),pe=f-P*65536,f=xe+P+65535,P=Math.floor(f/65536),xe=f-P*65536,f=g+P+65535,P=Math.floor(f/65536),g=f-P*65536,te+=P-1+37*(P-1),B[0]=te,B[1]=ie,B[2]=Ee,B[3]=Le,B[4]=$e,B[5]=Me,B[6]=Ye,B[7]=Ke,B[8]=Pe,B[9]=De,B[10]=ge,B[11]=Se,B[12]=Oe,B[13]=pe,B[14]=xe,B[15]=g}function _(B,F){h(B,F,F)}function H(B,F){const R=i();let f;for(f=0;f<16;f++)R[f]=F[f];for(f=253;f>=0;f--)_(R,R),f!==2&&f!==4&&h(R,R,F);for(f=0;f<16;f++)B[f]=R[f]}function j(B,F){const R=i();let f;for(f=0;f<16;f++)R[f]=F[f];for(f=250;f>=0;f--)_(R,R),f!==1&&h(R,R,F);for(f=0;f<16;f++)B[f]=R[f]}function q(B,F){const R=i(),f=i(),P=i(),te=i(),ie=i(),Ee=i(),Le=i(),$e=i(),Me=i();O(R,B[1],B[0]),O(Me,F[1],F[0]),h(R,R,Me),I(f,B[0],B[1]),I(Me,F[0],F[1]),h(f,f,Me),h(P,B[3],F[3]),h(P,P,l),h(te,B[2],F[2]),I(te,te,te),O(ie,f,R),O(Ee,te,P),I(Le,te,P),I($e,f,R),h(B[0],ie,Ee),h(B[1],$e,Le),h(B[2],Le,Ee),h(B[3],ie,$e)}function X(B,F,R){for(let f=0;f<4;f++)A(B[f],F[f],R)}function re(B,F){const R=i(),f=i(),P=i();H(P,F[2]),h(R,F[0],P),h(f,F[1],P),N(B,f),B[31]^=D(R)<<7}function C(B,F,R){m(B[0],o),m(B[1],a),m(B[2],a),m(B[3],o);for(let f=255;f>=0;--f){const P=R[f/8|0]>>(f&7)&1;X(B,F,P),q(F,B),q(B,B),X(B,F,P)}}function $(B,F){const R=[i(),i(),i(),i()];m(R[0],p),m(R[1],w),m(R[2],a),h(R[3],p,w),C(B,R,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 R=new Uint8Array(32),f=[i(),i(),i(),i()];$(f,F),re(R,f);const P=new Uint8Array(64);return P.set(B),P.set(R,32),{publicKey:R,secretKey:P}}t.generateKeyPairFromSeed=G;function K(B){const F=(0,e.randomBytes)(32,B),R=G(F);return(0,n.wipe)(F),R}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 R,f,P,te;for(f=63;f>=32;--f){for(R=0,P=f-32,te=f-12;P<te;++P)F[P]+=R-16*F[f]*z[P-(f-32)],R=Math.floor((F[P]+128)/256),F[P]-=R*256;F[P]+=R,F[f]=0}for(R=0,P=0;P<32;P++)F[P]+=R-(F[31]>>4)*z[P],R=F[P]>>8,F[P]&=255;for(P=0;P<32;P++)F[P]-=R*z[P];for(f=0;f<32;f++)F[f+1]+=F[f]>>8,B[f]=F[f]&255}function Y(B){const F=new Float64Array(64);for(let R=0;R<64;R++)F[R]=B[R];for(let R=0;R<64;R++)B[R]=0;J(B,F)}function le(B,F){const R=new Float64Array(64),f=[i(),i(),i(),i()],P=(0,r.hash)(B.subarray(0,32));P[0]&=248,P[31]&=127,P[31]|=64;const te=new Uint8Array(64);te.set(P.subarray(32),32);const ie=new r.SHA512;ie.update(te.subarray(32)),ie.update(F);const Ee=ie.digest();ie.clean(),Y(Ee),$(f,Ee),re(te,f),ie.reset(),ie.update(te.subarray(0,32)),ie.update(B.subarray(32)),ie.update(F);const Le=ie.digest();Y(Le);for(let $e=0;$e<32;$e++)R[$e]=Ee[$e];for(let $e=0;$e<32;$e++)for(let Me=0;Me<32;Me++)R[$e+Me]+=Le[$e]*P[Me];return J(te.subarray(32),R),te}t.sign=le;function ee(B,F){const R=i(),f=i(),P=i(),te=i(),ie=i(),Ee=i(),Le=i();return m(B[2],a),b(B[1],F),_(P,B[1]),h(te,P,c),O(P,P,B[2]),I(te,B[2],te),_(ie,te),_(Ee,ie),h(Le,Ee,ie),h(R,Le,P),h(R,R,te),j(R,R),h(R,R,P),h(R,R,te),h(R,R,te),h(B[0],R,te),_(f,B[0]),h(f,f,te),x(f,P)&&h(B[0],B[0],y),_(f,B[0]),h(f,f,te),x(f,P)?-1:(D(B[0])===F[31]>>7&&O(B[0],o,B[0]),h(B[3],B[0],B[1]),0)}function fe(B,F,R){const f=new Uint8Array(32),P=[i(),i(),i(),i()],te=[i(),i(),i(),i()];if(R.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ee(te,B))return!1;const ie=new r.SHA512;ie.update(R.subarray(0,32)),ie.update(B),ie.update(F);const Ee=ie.digest();return Y(Ee),C(P,te,Ee),$(te,R.subarray(32)),q(P,te),re(f,P),!M(R,f)}t.verify=fe;function ae(B){let F=[i(),i(),i(),i()];if(ee(F,B))throw new Error("Ed25519: invalid public key");let R=i(),f=i(),P=F[1];I(R,a,P),O(f,a,P),H(f,f),h(R,R,f);let te=new Uint8Array(32);return N(te,R),te}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 R=new Uint8Array(F.subarray(0,32));return(0,n.wipe)(F),R}t.convertSecretKeyToX25519=Ce}(ra);const sm="EdDSA",om="JWT",Fu=".",Bu="base64url",am="utf8",cm="utf8",lm=":",um="did",hm="key",ju="base58btc",dm="z",fm="K36",pm=32;function os(t){return Tt(Pt(ri(t),am),Bu)}function ku(t){const e=Pt(fm,ju),r=dm+Tt(go([e,t]),ju);return[um,hm,r].join(lm)}function gm(t){return Tt(t,Bu)}function mm(t){return Pt([os(t.header),os(t.payload)].join(Fu),cm)}function wm(t){return[os(t.header),os(t.payload),gm(t.signature)].join(Fu)}function Hu(t=cn.randomBytes(pm)){return ra.generateKeyPairFromSeed(t)}async function ym(t,e,r,n,i=me.fromMiliseconds(Date.now())){const s={alg:sm,typ:om},o=ku(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=mm({header:s,payload:c}),p=ra.sign(n.secretKey,l);return wm({header:s,payload:c,signature:p})}const bm="PARSE_ERROR",vm="INVALID_REQUEST",_m="METHOD_NOT_FOUND",Em="INVALID_PARAMS",zu="INTERNAL_ERROR",na="SERVER_ERROR",xm=[-32700,-32600,-32601,-32602,-32603],ni={[bm]:{code:-32700,message:"Parse error"},[vm]:{code:-32600,message:"Invalid Request"},[_m]:{code:-32601,message:"Method not found"},[Em]:{code:-32602,message:"Invalid params"},[zu]:{code:-32603,message:"Internal error"},[na]:{code:-32e3,message:"Server error"}},Wu=na;function Cm(t){return xm.includes(t)}function qu(t){return Object.keys(ni).includes(t)?ni[t]:ni[Wu]}function Sm(t){const e=Object.values(ni).find(r=>r.code===t);return e||ni[Wu]}function Vu(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Ku={};/*! *****************************************************************************
53
+ ***************************************************************************** */var ea=function(t,e){return ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},ea(t,e)};function A3(t,e){ea(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ta=function(){return ta=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},ta.apply(this,arguments)};function $3(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 P3(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 T3(t,e){return function(r,n){e(r,n,t)}}function N3(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function R3(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 L3(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 M3(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function U3(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ra(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rh(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 F3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Rh(arguments[e]));return t}function B3(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function ti(t){return this instanceof ti?(this.v=t,this):new ti(t)}function j3(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(b){n[b]&&(i[b]=function(m){return new Promise(function(E,A){s.push([b,m,E,A])>1||a(b,m)})})}function a(b,m){try{c(n[b](m))}catch(E){w(s[0][3],E)}}function c(b){b.value instanceof ti?Promise.resolve(b.value.v).then(l,p):w(s[0][2],b)}function l(b){a("next",b)}function p(b){a("throw",b)}function w(b,m){b(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function k3(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:ti(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function H3(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ra=="function"?ra(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function z3(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function W3(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 q3(t){return t&&t.__esModule?t:{default:t}}function V3(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function K3(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 G3=Object.freeze({__proto__:null,__extends:A3,get __assign(){return ta},__rest:$3,__decorate:P3,__param:T3,__metadata:N3,__awaiter:R3,__generator:L3,__createBinding:M3,__exportStar:U3,__values:ra,__read:Rh,__spread:F3,__spreadArrays:B3,__await:ti,__asyncGenerator:j3,__asyncDelegator:k3,__asyncValues:H3,__makeTemplateObject:z3,__importStar:W3,__importDefault:q3,__classPrivateFieldGet:V3,__classPrivateFieldSet:K3}),Z3=Ar(G3),Ur={},Lh;function Mh(){return Lh||(Lh=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 At={},Uh;function Y3(){if(Uh)return At;Uh=1,Object.defineProperty(At,"__esModule",{value:!0}),At.generateChildLogger=At.formatChildLoggerContext=At.getLoggerContext=At.setBrowserLoggerContext=At.getBrowserLoggerContext=At.getDefaultLoggerOptions=void 0;const t=Mh();function e(a){return Object.assign(Object.assign({},a),{level:a?.level||t.PINO_LOGGER_DEFAULTS.level})}At.getDefaultLoggerOptions=e;function r(a,c=t.PINO_CUSTOM_CONTEXT_KEY){return a[c]||""}At.getBrowserLoggerContext=r;function n(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){return a[l]=c,a}At.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}At.getLoggerContext=i;function s(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=i(a,l);return p.trim()?`${p}/${c}`:c}At.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 At.generateChildLogger=o,At}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=Z3,r=e.__importDefault(zn);Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(Mh(),t),e.__exportStar(Y3(),t)})(je);class J3 extends Lr{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class X3 extends Lr{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class Q3{constructor(e,r){this.logger=e,this.core=r}}class em extends Lr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class tm extends Lr{constructor(e){super()}}class rm{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class nm extends Lr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class im extends Lr{constructor(e,r){super(),this.core=e,this.logger=r}}class sm{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class om{constructor(e){this.client=e}}function na(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function ri(t){return typeof t=="string"?t:JSON.stringify(t)}var ia={},Fh={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ve,r=Ut;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,b=l<<3,m=l%128<112?128:256;this._buffer[p]=128;for(var E=p+1;E<m-8;E++)this._buffer[E]=0;e.writeUint32BE(w,this._buffer,m-8),e.writeUint32BE(b,this._buffer,m-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,m),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,b,m){for(var E=l[0],A=l[1],N=l[2],M=l[3],x=l[4],D=l[5],y=l[6],I=l[7],O=p[0],u=p[1],_=p[2],H=p[3],j=p[4],q=p[5],X=p[6],re=p[7],C,$,G,K,W,z,J,Z;m>=128;){for(var le=0;le<16;le++){var ee=8*le+b;a[le]=e.readUint32BE(w,ee),c[le]=e.readUint32BE(w,ee+4)}for(var le=0;le<80;le++){var pe=E,ae=A,Ce=N,B=M,F=x,R=D,f=y,P=I,te=O,ie=u,Ee=_,Le=H,$e=j,Me=q,Ze=X,Ke=re;if(C=I,$=re,W=$&65535,z=$>>>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)),$=(j>>>14|x<<32-14)^(j>>>18|x<<32-18)^(x>>>41-32|j<<32-(41-32)),W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,C=x&D^~x&y,$=j&q^~j&X,W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,C=i[le*2],$=i[le*2+1],W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,C=a[le%16],$=c[le%16],W+=$&65535,z+=$>>>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,$=K,W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=(E>>>28|O<<32-28)^(O>>>34-32|E<<32-(34-32))^(O>>>39-32|E<<32-(39-32)),$=(O>>>28|E<<32-28)^(E>>>34-32|O<<32-(34-32))^(E>>>39-32|O<<32-(39-32)),W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,C=E&A^E&N^A&N,$=O&u^O&_^u&_,W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,P=J&65535|Z<<16,Ke=W&65535|z<<16,C=B,$=Le,W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=G,$=K,W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,B=J&65535|Z<<16,Le=W&65535|z<<16,A=pe,N=ae,M=Ce,x=B,D=F,y=R,I=f,E=P,u=te,_=ie,H=Ee,j=Le,q=$e,X=Me,re=Ze,O=Ke,le%16===15)for(var ee=0;ee<16;ee++)C=a[ee],$=c[ee],W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=a[(ee+9)%16],$=c[(ee+9)%16],W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,G=a[(ee+1)%16],K=c[(ee+1)%16],C=(G>>>1|K<<32-1)^(G>>>8|K<<32-8)^G>>>7,$=(K>>>1|G<<32-1)^(K>>>8|G<<32-8)^(K>>>7|G<<32-7),W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,G=a[(ee+14)%16],K=c[(ee+14)%16],C=(G>>>19|K<<32-19)^(K>>>61-32|G<<32-(61-32))^G>>>6,$=(K>>>19|G<<32-19)^(G>>>61-32|K<<32-(61-32))^(K>>>6|G<<32-6),W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,a[ee]=J&65535|Z<<16,c[ee]=W&65535|z<<16}C=E,$=O,W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=l[0],$=p[0],W+=$&65535,z+=$>>>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]=O=W&65535|z<<16,C=A,$=u,W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=l[1],$=p[1],W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[1]=A=J&65535|Z<<16,p[1]=u=W&65535|z<<16,C=N,$=_,W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=l[2],$=p[2],W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[2]=N=J&65535|Z<<16,p[2]=_=W&65535|z<<16,C=M,$=H,W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=l[3],$=p[3],W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[3]=M=J&65535|Z<<16,p[3]=H=W&65535|z<<16,C=x,$=j,W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=l[4],$=p[4],W+=$&65535,z+=$>>>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=D,$=q,W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=l[5],$=p[5],W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[5]=D=J&65535|Z<<16,p[5]=q=W&65535|z<<16,C=y,$=X,W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=l[6],$=p[6],W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[6]=y=J&65535|Z<<16,p[6]=X=W&65535|z<<16,C=I,$=re,W=$&65535,z=$>>>16,J=C&65535,Z=C>>>16,C=l[7],$=p[7],W+=$&65535,z+=$>>>16,J+=C&65535,Z+=C>>>16,z+=W>>>16,J+=z>>>16,Z+=J>>>16,l[7]=I=J&65535|Z<<16,p[7]=re=W&65535|z<<16,b+=128,m-=128}return b}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Fh),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=Fh,n=Ut;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 R=0;R<B.length;R++)F[R]=B[R];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]),b=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m(B,F){for(let R=0;R<16;R++)B[R]=F[R]|0}function E(B){let F=1;for(let R=0;R<16;R++){let f=B[R]+F+65535;F=Math.floor(f/65536),B[R]=f-F*65536}B[0]+=F-1+37*(F-1)}function A(B,F,R){const f=~(R-1);for(let P=0;P<16;P++){const te=f&(B[P]^F[P]);B[P]^=te,F[P]^=te}}function N(B,F){const R=i(),f=i();for(let P=0;P<16;P++)f[P]=F[P];E(f),E(f),E(f);for(let P=0;P<2;P++){R[0]=f[0]-65517;for(let ie=1;ie<15;ie++)R[ie]=f[ie]-65535-(R[ie-1]>>16&1),R[ie-1]&=65535;R[15]=f[15]-32767-(R[14]>>16&1);const te=R[15]>>16&1;R[14]&=65535,A(f,R,1-te)}for(let P=0;P<16;P++)B[2*P]=f[P]&255,B[2*P+1]=f[P]>>8}function M(B,F){let R=0;for(let f=0;f<32;f++)R|=B[f]^F[f];return(1&R-1>>>8)-1}function x(B,F){const R=new Uint8Array(32),f=new Uint8Array(32);return N(R,B),N(f,F),M(R,f)}function D(B){const F=new Uint8Array(32);return N(F,B),F[0]&1}function y(B,F){for(let R=0;R<16;R++)B[R]=F[2*R]+(F[2*R+1]<<8);B[15]&=32767}function I(B,F,R){for(let f=0;f<16;f++)B[f]=F[f]+R[f]}function O(B,F,R){for(let f=0;f<16;f++)B[f]=F[f]-R[f]}function u(B,F,R){let f,P,te=0,ie=0,Ee=0,Le=0,$e=0,Me=0,Ze=0,Ke=0,Pe=0,De=0,me=0,Se=0,Oe=0,ge=0,xe=0,g=0,h=0,d=0,v=0,T=0,U=0,k=0,oe=0,ue=0,Ne=0,Fe=0,Re=0,Ht=0,tn=0,ki=0,to=0,rt=R[0],Je=R[1],nt=R[2],it=R[3],st=R[4],Xe=R[5],gt=R[6],mt=R[7],wt=R[8],bt=R[9],yt=R[10],lt=R[11],ot=R[12],Ge=R[13],vt=R[14],_t=R[15];f=F[0],te+=f*rt,ie+=f*Je,Ee+=f*nt,Le+=f*it,$e+=f*st,Me+=f*Xe,Ze+=f*gt,Ke+=f*mt,Pe+=f*wt,De+=f*bt,me+=f*yt,Se+=f*lt,Oe+=f*ot,ge+=f*Ge,xe+=f*vt,g+=f*_t,f=F[1],ie+=f*rt,Ee+=f*Je,Le+=f*nt,$e+=f*it,Me+=f*st,Ze+=f*Xe,Ke+=f*gt,Pe+=f*mt,De+=f*wt,me+=f*bt,Se+=f*yt,Oe+=f*lt,ge+=f*ot,xe+=f*Ge,g+=f*vt,h+=f*_t,f=F[2],Ee+=f*rt,Le+=f*Je,$e+=f*nt,Me+=f*it,Ze+=f*st,Ke+=f*Xe,Pe+=f*gt,De+=f*mt,me+=f*wt,Se+=f*bt,Oe+=f*yt,ge+=f*lt,xe+=f*ot,g+=f*Ge,h+=f*vt,d+=f*_t,f=F[3],Le+=f*rt,$e+=f*Je,Me+=f*nt,Ze+=f*it,Ke+=f*st,Pe+=f*Xe,De+=f*gt,me+=f*mt,Se+=f*wt,Oe+=f*bt,ge+=f*yt,xe+=f*lt,g+=f*ot,h+=f*Ge,d+=f*vt,v+=f*_t,f=F[4],$e+=f*rt,Me+=f*Je,Ze+=f*nt,Ke+=f*it,Pe+=f*st,De+=f*Xe,me+=f*gt,Se+=f*mt,Oe+=f*wt,ge+=f*bt,xe+=f*yt,g+=f*lt,h+=f*ot,d+=f*Ge,v+=f*vt,T+=f*_t,f=F[5],Me+=f*rt,Ze+=f*Je,Ke+=f*nt,Pe+=f*it,De+=f*st,me+=f*Xe,Se+=f*gt,Oe+=f*mt,ge+=f*wt,xe+=f*bt,g+=f*yt,h+=f*lt,d+=f*ot,v+=f*Ge,T+=f*vt,U+=f*_t,f=F[6],Ze+=f*rt,Ke+=f*Je,Pe+=f*nt,De+=f*it,me+=f*st,Se+=f*Xe,Oe+=f*gt,ge+=f*mt,xe+=f*wt,g+=f*bt,h+=f*yt,d+=f*lt,v+=f*ot,T+=f*Ge,U+=f*vt,k+=f*_t,f=F[7],Ke+=f*rt,Pe+=f*Je,De+=f*nt,me+=f*it,Se+=f*st,Oe+=f*Xe,ge+=f*gt,xe+=f*mt,g+=f*wt,h+=f*bt,d+=f*yt,v+=f*lt,T+=f*ot,U+=f*Ge,k+=f*vt,oe+=f*_t,f=F[8],Pe+=f*rt,De+=f*Je,me+=f*nt,Se+=f*it,Oe+=f*st,ge+=f*Xe,xe+=f*gt,g+=f*mt,h+=f*wt,d+=f*bt,v+=f*yt,T+=f*lt,U+=f*ot,k+=f*Ge,oe+=f*vt,ue+=f*_t,f=F[9],De+=f*rt,me+=f*Je,Se+=f*nt,Oe+=f*it,ge+=f*st,xe+=f*Xe,g+=f*gt,h+=f*mt,d+=f*wt,v+=f*bt,T+=f*yt,U+=f*lt,k+=f*ot,oe+=f*Ge,ue+=f*vt,Ne+=f*_t,f=F[10],me+=f*rt,Se+=f*Je,Oe+=f*nt,ge+=f*it,xe+=f*st,g+=f*Xe,h+=f*gt,d+=f*mt,v+=f*wt,T+=f*bt,U+=f*yt,k+=f*lt,oe+=f*ot,ue+=f*Ge,Ne+=f*vt,Fe+=f*_t,f=F[11],Se+=f*rt,Oe+=f*Je,ge+=f*nt,xe+=f*it,g+=f*st,h+=f*Xe,d+=f*gt,v+=f*mt,T+=f*wt,U+=f*bt,k+=f*yt,oe+=f*lt,ue+=f*ot,Ne+=f*Ge,Fe+=f*vt,Re+=f*_t,f=F[12],Oe+=f*rt,ge+=f*Je,xe+=f*nt,g+=f*it,h+=f*st,d+=f*Xe,v+=f*gt,T+=f*mt,U+=f*wt,k+=f*bt,oe+=f*yt,ue+=f*lt,Ne+=f*ot,Fe+=f*Ge,Re+=f*vt,Ht+=f*_t,f=F[13],ge+=f*rt,xe+=f*Je,g+=f*nt,h+=f*it,d+=f*st,v+=f*Xe,T+=f*gt,U+=f*mt,k+=f*wt,oe+=f*bt,ue+=f*yt,Ne+=f*lt,Fe+=f*ot,Re+=f*Ge,Ht+=f*vt,tn+=f*_t,f=F[14],xe+=f*rt,g+=f*Je,h+=f*nt,d+=f*it,v+=f*st,T+=f*Xe,U+=f*gt,k+=f*mt,oe+=f*wt,ue+=f*bt,Ne+=f*yt,Fe+=f*lt,Re+=f*ot,Ht+=f*Ge,tn+=f*vt,ki+=f*_t,f=F[15],g+=f*rt,h+=f*Je,d+=f*nt,v+=f*it,T+=f*st,U+=f*Xe,k+=f*gt,oe+=f*mt,ue+=f*wt,Ne+=f*bt,Fe+=f*yt,Re+=f*lt,Ht+=f*ot,tn+=f*Ge,ki+=f*vt,to+=f*_t,te+=38*h,ie+=38*d,Ee+=38*v,Le+=38*T,$e+=38*U,Me+=38*k,Ze+=38*oe,Ke+=38*ue,Pe+=38*Ne,De+=38*Fe,me+=38*Re,Se+=38*Ht,Oe+=38*tn,ge+=38*ki,xe+=38*to,P=1,f=te+P+65535,P=Math.floor(f/65536),te=f-P*65536,f=ie+P+65535,P=Math.floor(f/65536),ie=f-P*65536,f=Ee+P+65535,P=Math.floor(f/65536),Ee=f-P*65536,f=Le+P+65535,P=Math.floor(f/65536),Le=f-P*65536,f=$e+P+65535,P=Math.floor(f/65536),$e=f-P*65536,f=Me+P+65535,P=Math.floor(f/65536),Me=f-P*65536,f=Ze+P+65535,P=Math.floor(f/65536),Ze=f-P*65536,f=Ke+P+65535,P=Math.floor(f/65536),Ke=f-P*65536,f=Pe+P+65535,P=Math.floor(f/65536),Pe=f-P*65536,f=De+P+65535,P=Math.floor(f/65536),De=f-P*65536,f=me+P+65535,P=Math.floor(f/65536),me=f-P*65536,f=Se+P+65535,P=Math.floor(f/65536),Se=f-P*65536,f=Oe+P+65535,P=Math.floor(f/65536),Oe=f-P*65536,f=ge+P+65535,P=Math.floor(f/65536),ge=f-P*65536,f=xe+P+65535,P=Math.floor(f/65536),xe=f-P*65536,f=g+P+65535,P=Math.floor(f/65536),g=f-P*65536,te+=P-1+37*(P-1),P=1,f=te+P+65535,P=Math.floor(f/65536),te=f-P*65536,f=ie+P+65535,P=Math.floor(f/65536),ie=f-P*65536,f=Ee+P+65535,P=Math.floor(f/65536),Ee=f-P*65536,f=Le+P+65535,P=Math.floor(f/65536),Le=f-P*65536,f=$e+P+65535,P=Math.floor(f/65536),$e=f-P*65536,f=Me+P+65535,P=Math.floor(f/65536),Me=f-P*65536,f=Ze+P+65535,P=Math.floor(f/65536),Ze=f-P*65536,f=Ke+P+65535,P=Math.floor(f/65536),Ke=f-P*65536,f=Pe+P+65535,P=Math.floor(f/65536),Pe=f-P*65536,f=De+P+65535,P=Math.floor(f/65536),De=f-P*65536,f=me+P+65535,P=Math.floor(f/65536),me=f-P*65536,f=Se+P+65535,P=Math.floor(f/65536),Se=f-P*65536,f=Oe+P+65535,P=Math.floor(f/65536),Oe=f-P*65536,f=ge+P+65535,P=Math.floor(f/65536),ge=f-P*65536,f=xe+P+65535,P=Math.floor(f/65536),xe=f-P*65536,f=g+P+65535,P=Math.floor(f/65536),g=f-P*65536,te+=P-1+37*(P-1),B[0]=te,B[1]=ie,B[2]=Ee,B[3]=Le,B[4]=$e,B[5]=Me,B[6]=Ze,B[7]=Ke,B[8]=Pe,B[9]=De,B[10]=me,B[11]=Se,B[12]=Oe,B[13]=ge,B[14]=xe,B[15]=g}function _(B,F){u(B,F,F)}function H(B,F){const R=i();let f;for(f=0;f<16;f++)R[f]=F[f];for(f=253;f>=0;f--)_(R,R),f!==2&&f!==4&&u(R,R,F);for(f=0;f<16;f++)B[f]=R[f]}function j(B,F){const R=i();let f;for(f=0;f<16;f++)R[f]=F[f];for(f=250;f>=0;f--)_(R,R),f!==1&&u(R,R,F);for(f=0;f<16;f++)B[f]=R[f]}function q(B,F){const R=i(),f=i(),P=i(),te=i(),ie=i(),Ee=i(),Le=i(),$e=i(),Me=i();O(R,B[1],B[0]),O(Me,F[1],F[0]),u(R,R,Me),I(f,B[0],B[1]),I(Me,F[0],F[1]),u(f,f,Me),u(P,B[3],F[3]),u(P,P,l),u(te,B[2],F[2]),I(te,te,te),O(ie,f,R),O(Ee,te,P),I(Le,te,P),I($e,f,R),u(B[0],ie,Ee),u(B[1],$e,Le),u(B[2],Le,Ee),u(B[3],ie,$e)}function X(B,F,R){for(let f=0;f<4;f++)A(B[f],F[f],R)}function re(B,F){const R=i(),f=i(),P=i();H(P,F[2]),u(R,F[0],P),u(f,F[1],P),N(B,f),B[31]^=D(R)<<7}function C(B,F,R){m(B[0],o),m(B[1],a),m(B[2],a),m(B[3],o);for(let f=255;f>=0;--f){const P=R[f/8|0]>>(f&7)&1;X(B,F,P),q(F,B),q(B,B),X(B,F,P)}}function $(B,F){const R=[i(),i(),i(),i()];m(R[0],p),m(R[1],w),m(R[2],a),u(R[3],p,w),C(B,R,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 R=new Uint8Array(32),f=[i(),i(),i(),i()];$(f,F),re(R,f);const P=new Uint8Array(64);return P.set(B),P.set(R,32),{publicKey:R,secretKey:P}}t.generateKeyPairFromSeed=G;function K(B){const F=(0,e.randomBytes)(32,B),R=G(F);return(0,n.wipe)(F),R}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 R,f,P,te;for(f=63;f>=32;--f){for(R=0,P=f-32,te=f-12;P<te;++P)F[P]+=R-16*F[f]*z[P-(f-32)],R=Math.floor((F[P]+128)/256),F[P]-=R*256;F[P]+=R,F[f]=0}for(R=0,P=0;P<32;P++)F[P]+=R-(F[31]>>4)*z[P],R=F[P]>>8,F[P]&=255;for(P=0;P<32;P++)F[P]-=R*z[P];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 R=0;R<64;R++)F[R]=B[R];for(let R=0;R<64;R++)B[R]=0;J(B,F)}function le(B,F){const R=new Float64Array(64),f=[i(),i(),i(),i()],P=(0,r.hash)(B.subarray(0,32));P[0]&=248,P[31]&=127,P[31]|=64;const te=new Uint8Array(64);te.set(P.subarray(32),32);const ie=new r.SHA512;ie.update(te.subarray(32)),ie.update(F);const Ee=ie.digest();ie.clean(),Z(Ee),$(f,Ee),re(te,f),ie.reset(),ie.update(te.subarray(0,32)),ie.update(B.subarray(32)),ie.update(F);const Le=ie.digest();Z(Le);for(let $e=0;$e<32;$e++)R[$e]=Ee[$e];for(let $e=0;$e<32;$e++)for(let Me=0;Me<32;Me++)R[$e+Me]+=Le[$e]*P[Me];return J(te.subarray(32),R),te}t.sign=le;function ee(B,F){const R=i(),f=i(),P=i(),te=i(),ie=i(),Ee=i(),Le=i();return m(B[2],a),y(B[1],F),_(P,B[1]),u(te,P,c),O(P,P,B[2]),I(te,B[2],te),_(ie,te),_(Ee,ie),u(Le,Ee,ie),u(R,Le,P),u(R,R,te),j(R,R),u(R,R,P),u(R,R,te),u(R,R,te),u(B[0],R,te),_(f,B[0]),u(f,f,te),x(f,P)&&u(B[0],B[0],b),_(f,B[0]),u(f,f,te),x(f,P)?-1:(D(B[0])===F[31]>>7&&O(B[0],o,B[0]),u(B[3],B[0],B[1]),0)}function pe(B,F,R){const f=new Uint8Array(32),P=[i(),i(),i(),i()],te=[i(),i(),i(),i()];if(R.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ee(te,B))return!1;const ie=new r.SHA512;ie.update(R.subarray(0,32)),ie.update(B),ie.update(F);const Ee=ie.digest();return Z(Ee),C(P,te,Ee),$(te,R.subarray(32)),q(P,te),re(f,P),!M(R,f)}t.verify=pe;function ae(B){let F=[i(),i(),i(),i()];if(ee(F,B))throw new Error("Ed25519: invalid public key");let R=i(),f=i(),P=F[1];I(R,a,P),O(f,a,P),H(f,f),u(R,R,f);let te=new Uint8Array(32);return N(te,R),te}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 R=new Uint8Array(F.subarray(0,32));return(0,n.wipe)(F),R}t.convertSecretKeyToX25519=Ce}(ia);const am="EdDSA",cm="JWT",Bh=".",jh="base64url",lm="utf8",hm="utf8",um=":",dm="did",fm="key",kh="base58btc",pm="z",gm="K36",mm=32;function cs(t){return Tt(Pt(ri(t),lm),jh)}function Hh(t){const e=Pt(gm,kh),r=pm+Tt(wo([e,t]),kh);return[dm,fm,r].join(um)}function wm(t){return Tt(t,jh)}function bm(t){return Pt([cs(t.header),cs(t.payload)].join(Bh),hm)}function ym(t){return[cs(t.header),cs(t.payload),wm(t.signature)].join(Bh)}function zh(t=an.randomBytes(mm)){return ia.generateKeyPairFromSeed(t)}async function vm(t,e,r,n,i=de.fromMiliseconds(Date.now())){const s={alg:am,typ:cm},o=Hh(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=bm({header:s,payload:c}),p=ia.sign(n.secretKey,l);return ym({header:s,payload:c,signature:p})}const _m="PARSE_ERROR",Em="INVALID_REQUEST",xm="METHOD_NOT_FOUND",Cm="INVALID_PARAMS",Wh="INTERNAL_ERROR",sa="SERVER_ERROR",Sm=[-32700,-32600,-32601,-32602,-32603],ni={[_m]:{code:-32700,message:"Parse error"},[Em]:{code:-32600,message:"Invalid Request"},[xm]:{code:-32601,message:"Method not found"},[Cm]:{code:-32602,message:"Invalid params"},[Wh]:{code:-32603,message:"Internal error"},[sa]:{code:-32e3,message:"Server error"}},qh=sa;function Im(t){return Sm.includes(t)}function Vh(t){return Object.keys(ni).includes(t)?ni[t]:ni[qh]}function Dm(t){const e=Object.values(ni).find(r=>r.code===t);return e||ni[qh]}function Kh(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Gh={};/*! *****************************************************************************
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 ia=function(t,e){return ia=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])},ia(t,e)};function Im(t,e){ia(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var sa=function(){return sa=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},sa.apply(this,arguments)};function Dm(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 Om(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 Am(t,e){return function(r,n){e(r,n,t)}}function $m(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Pm(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 Tm(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 Nm(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Rm(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function oa(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 Gu(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 Lm(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Gu(arguments[e]));return t}function Mm(){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 ii(t){return this instanceof ii?(this.v=t,this):new ii(t)}function Um(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(y){n[y]&&(i[y]=function(m){return new Promise(function(E,A){s.push([y,m,E,A])>1||a(y,m)})})}function a(y,m){try{c(n[y](m))}catch(E){w(s[0][3],E)}}function c(y){y.value instanceof ii?Promise.resolve(y.value.v).then(l,p):w(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function w(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Fm(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:ii(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function Bm(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 oa=="function"?oa(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 jm(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function km(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 Hm(t){return t&&t.__esModule?t:{default:t}}function zm(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Wm(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 qm=Object.freeze({__proto__:null,__extends:Im,get __assign(){return sa},__rest:Dm,__decorate:Om,__param:Am,__metadata:$m,__awaiter:Pm,__generator:Tm,__createBinding:Nm,__exportStar:Rm,__values:oa,__read:Gu,__spread:Lm,__spreadArrays:Mm,__await:ii,__asyncGenerator:Um,__asyncDelegator:Fm,__asyncValues:Bm,__makeTemplateObject:jm,__importStar:km,__importDefault:Hm,__classPrivateFieldGet:zm,__classPrivateFieldSet:Wm}),Vm=$r(qm),lr={},Yu;function Km(){if(Yu)return lr;Yu=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.isBrowserCryptoAvailable=lr.getSubtleCrypto=lr.getBrowerCrypto=void 0;function t(){return ut?.crypto||ut?.msCrypto||{}}lr.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}lr.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return lr.isBrowserCryptoAvailable=r,lr}var ur={},Zu;function Gm(){if(Zu)return ur;Zu=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.isBrowser=ur.isNode=ur.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}ur.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}ur.isNode=e;function r(){return!t()&&!e()}return ur.isBrowser=r,ur}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Vm;e.__exportStar(Km(),t),e.__exportStar(Gm(),t)})(Ku);function Ym(){const t=Date.now()*Math.pow(10,3),e=Math.floor(Math.random()*Math.pow(10,3));return t+e}function as(t,e,r){return{id:r||Ym(),jsonrpc:"2.0",method:t,params:e}}function aa(t,e){return{id:t,jsonrpc:"2.0",result:e}}function cs(t,e,r){return{id:t,jsonrpc:"2.0",error:Zm(e,r)}}function Zm(t,e){return typeof t>"u"?qu(zu):(typeof t=="string"&&(t=Object.assign(Object.assign({},qu(na)),{message:t})),typeof e<"u"&&(t.data=e),Cm(t.code)&&(t=Sm(t.code)),t)}class Jm{}class Xm extends Jm{constructor(){super()}}class Qm extends Xm{constructor(e){super()}}const e5="^https?:",t5="^wss?:";function r5(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Ju(t,e){const r=r5(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Xu(t){return Ju(t,e5)}function Qu(t){return Ju(t,t5)}function n5(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function eh(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function ca(t){return eh(t)&&"method"in t}function la(t){return eh(t)&&(hr(t)||Jt(t))}function hr(t){return"result"in t}function Jt(t){return"error"in t}class si extends Qm{constructor(e){super(e),this.events=new _t.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(as(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=>{Jt(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),la(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 th=10,i5=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),s5=()=>typeof window<"u",o5=i5();class a5{constructor(e){if(this.url=e,this.events=new _t.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(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=()=>{this.onClose(),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ri(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=Ku.isReactNative()?void 0:{rejectUnauthorized:!n5(e)},s=new o5(e,[],i);s5()?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"?ta(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=cs(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Vu(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>th&&this.events.setMaxListeners(th)}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 ua={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]",y="[object Error]",m="[object Function]",E="[object GeneratorFunction]",A="[object Map]",N="[object Number]",M="[object Null]",x="[object Object]",D="[object Promise]",b="[object Proxy]",I="[object RegExp]",O="[object Set]",h="[object String]",_="[object Symbol]",H="[object Undefined]",j="[object WeakMap]",q="[object ArrayBuffer]",X="[object DataView]",re="[object Float32Array]",C="[object Float64Array]",$="[object Int8Array]",G="[object Int16Array]",K="[object Int32Array]",W="[object Uint8Array]",z="[object Uint8ClampedArray]",J="[object Uint16Array]",Y="[object Uint32Array]",le=/[\\^$.*+?()[\]{}|]/g,ee=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,ae={};ae[re]=ae[C]=ae[$]=ae[G]=ae[K]=ae[W]=ae[z]=ae[J]=ae[Y]=!0,ae[a]=ae[c]=ae[q]=ae[p]=ae[X]=ae[w]=ae[y]=ae[m]=ae[A]=ae[N]=ae[x]=ae[I]=ae[O]=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")(),R=e&&!e.nodeType&&e,f=R&&!0&&t&&!t.nodeType&&t,P=f&&f.exports===R,te=P&&Ce.process,ie=function(){try{return te&&te.binding&&te.binding("util")}catch{}}(),Ee=ie&&ie.isTypedArray;function Le(S,L){for(var Z=-1,ce=S==null?0:S.length,We=0,Ie=[];++Z<ce;){var Qe=S[Z];L(Qe,Z,S)&&(Ie[We++]=Qe)}return Ie}function $e(S,L){for(var Z=-1,ce=L.length,We=S.length;++Z<ce;)S[We+Z]=L[Z];return S}function Me(S,L){for(var Z=-1,ce=S==null?0:S.length;++Z<ce;)if(L(S[Z],Z,S))return!0;return!1}function Ye(S,L){for(var Z=-1,ce=Array(S);++Z<S;)ce[Z]=L(Z);return ce}function Ke(S){return function(L){return S(L)}}function Pe(S,L){return S.has(L)}function De(S,L){return S?.[L]}function ge(S){var L=-1,Z=Array(S.size);return S.forEach(function(ce,We){Z[++L]=[We,ce]}),Z}function Se(S,L){return function(Z){return S(L(Z))}}function Oe(S){var L=-1,Z=Array(S.size);return S.forEach(function(ce){Z[++L]=ce}),Z}var pe=Array.prototype,xe=Function.prototype,g=Object.prototype,u=F["__core-js_shared__"],d=xe.toString,v=g.hasOwnProperty,T=function(){var S=/[^.]+$/.exec(u&&u.keys&&u.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),U=g.toString,k=RegExp("^"+d.call(v).replace(le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=P?F.Buffer:void 0,he=F.Symbol,Ne=F.Uint8Array,Fe=g.propertyIsEnumerable,Re=pe.splice,Ht=he?he.toStringTag:void 0,rn=Object.getOwnPropertySymbols,ji=oe?oe.isBuffer:void 0,Qs=Se(Object.keys,Object),rt=Tn(F,"DataView"),Je=Tn(F,"Map"),nt=Tn(F,"Promise"),it=Tn(F,"Set"),st=Tn(F,"WeakMap"),Xe=Tn(Object,"create"),ft=sn(rt),pt=sn(Je),gt=sn(nt),mt=sn(it),wt=sn(st),lt=he?he.prototype:void 0,ot=lt?lt.valueOf:void 0;function Ge(S){var L=-1,Z=S==null?0:S.length;for(this.clear();++L<Z;){var ce=S[L];this.set(ce[0],ce[1])}}function yt(){this.__data__=Xe?Xe(null):{},this.size=0}function bt(S){var L=this.has(S)&&delete this.__data__[S];return this.size-=L?1:0,L}function H_(S){var L=this.__data__;if(Xe){var Z=L[S];return Z===n?void 0:Z}return v.call(L,S)?L[S]:void 0}function z_(S){var L=this.__data__;return Xe?L[S]!==void 0:v.call(L,S)}function W_(S,L){var Z=this.__data__;return this.size+=this.has(S)?0:1,Z[S]=Xe&&L===void 0?n:L,this}Ge.prototype.clear=yt,Ge.prototype.delete=bt,Ge.prototype.get=H_,Ge.prototype.has=z_,Ge.prototype.set=W_;function fr(S){var L=-1,Z=S==null?0:S.length;for(this.clear();++L<Z;){var ce=S[L];this.set(ce[0],ce[1])}}function q_(){this.__data__=[],this.size=0}function V_(S){var L=this.__data__,Z=to(L,S);if(Z<0)return!1;var ce=L.length-1;return Z==ce?L.pop():Re.call(L,Z,1),--this.size,!0}function K_(S){var L=this.__data__,Z=to(L,S);return Z<0?void 0:L[Z][1]}function G_(S){return to(this.__data__,S)>-1}function Y_(S,L){var Z=this.__data__,ce=to(Z,S);return ce<0?(++this.size,Z.push([S,L])):Z[ce][1]=L,this}fr.prototype.clear=q_,fr.prototype.delete=V_,fr.prototype.get=K_,fr.prototype.has=G_,fr.prototype.set=Y_;function nn(S){var L=-1,Z=S==null?0:S.length;for(this.clear();++L<Z;){var ce=S[L];this.set(ce[0],ce[1])}}function Z_(){this.size=0,this.__data__={hash:new Ge,map:new(Je||fr),string:new Ge}}function J_(S){var L=ro(this,S).delete(S);return this.size-=L?1:0,L}function X_(S){return ro(this,S).get(S)}function Q_(S){return ro(this,S).has(S)}function e7(S,L){var Z=ro(this,S),ce=Z.size;return Z.set(S,L),this.size+=Z.size==ce?0:1,this}nn.prototype.clear=Z_,nn.prototype.delete=J_,nn.prototype.get=X_,nn.prototype.has=Q_,nn.prototype.set=e7;function eo(S){var L=-1,Z=S==null?0:S.length;for(this.__data__=new nn;++L<Z;)this.add(S[L])}function t7(S){return this.__data__.set(S,n),this}function r7(S){return this.__data__.has(S)}eo.prototype.add=eo.prototype.push=t7,eo.prototype.has=r7;function Dr(S){var L=this.__data__=new fr(S);this.size=L.size}function n7(){this.__data__=new fr,this.size=0}function i7(S){var L=this.__data__,Z=L.delete(S);return this.size=L.size,Z}function s7(S){return this.__data__.get(S)}function o7(S){return this.__data__.has(S)}function a7(S,L){var Z=this.__data__;if(Z instanceof fr){var ce=Z.__data__;if(!Je||ce.length<r-1)return ce.push([S,L]),this.size=++Z.size,this;Z=this.__data__=new nn(ce)}return Z.set(S,L),this.size=Z.size,this}Dr.prototype.clear=n7,Dr.prototype.delete=i7,Dr.prototype.get=s7,Dr.prototype.has=o7,Dr.prototype.set=a7;function c7(S,L){var Z=no(S),ce=!Z&&x7(S),We=!Z&&!ce&&Uc(S),Ie=!Z&&!ce&&!We&&Md(S),Qe=Z||ce||We||Ie,vt=Qe?Ye(S.length,String):[],St=vt.length;for(var Ze in S)(L||v.call(S,Ze))&&!(Qe&&(Ze=="length"||We&&(Ze=="offset"||Ze=="parent")||Ie&&(Ze=="buffer"||Ze=="byteLength"||Ze=="byteOffset")||y7(Ze,St)))&&vt.push(Ze);return vt}function to(S,L){for(var Z=S.length;Z--;)if(Td(S[Z][0],L))return Z;return-1}function l7(S,L,Z){var ce=L(S);return no(S)?ce:$e(ce,Z(S))}function ki(S){return S==null?S===void 0?H:M:Ht&&Ht in Object(S)?m7(S):E7(S)}function Od(S){return Hi(S)&&ki(S)==a}function Ad(S,L,Z,ce,We){return S===L?!0:S==null||L==null||!Hi(S)&&!Hi(L)?S!==S&&L!==L:u7(S,L,Z,ce,Ad,We)}function u7(S,L,Z,ce,We,Ie){var Qe=no(S),vt=no(L),St=Qe?c:Or(S),Ze=vt?c:Or(L);St=St==a?x:St,Ze=Ze==a?x:Ze;var zt=St==x,Xt=Ze==x,Dt=St==Ze;if(Dt&&Uc(S)){if(!Uc(L))return!1;Qe=!0,zt=!1}if(Dt&&!zt)return Ie||(Ie=new Dr),Qe||Md(S)?$d(S,L,Z,ce,We,Ie):p7(S,L,St,Z,ce,We,Ie);if(!(Z&i)){var Gt=zt&&v.call(S,"__wrapped__"),Yt=Xt&&v.call(L,"__wrapped__");if(Gt||Yt){var Ar=Gt?S.value():S,pr=Yt?L.value():L;return Ie||(Ie=new Dr),We(Ar,pr,Z,ce,Ie)}}return Dt?(Ie||(Ie=new Dr),g7(S,L,Z,ce,We,Ie)):!1}function h7(S){if(!Ld(S)||v7(S))return!1;var L=Nd(S)?k:ee;return L.test(sn(S))}function d7(S){return Hi(S)&&Rd(S.length)&&!!ae[ki(S)]}function f7(S){if(!_7(S))return Qs(S);var L=[];for(var Z in Object(S))v.call(S,Z)&&Z!="constructor"&&L.push(Z);return L}function $d(S,L,Z,ce,We,Ie){var Qe=Z&i,vt=S.length,St=L.length;if(vt!=St&&!(Qe&&St>vt))return!1;var Ze=Ie.get(S);if(Ze&&Ie.get(L))return Ze==L;var zt=-1,Xt=!0,Dt=Z&s?new eo:void 0;for(Ie.set(S,L),Ie.set(L,S);++zt<vt;){var Gt=S[zt],Yt=L[zt];if(ce)var Ar=Qe?ce(Yt,Gt,zt,L,S,Ie):ce(Gt,Yt,zt,S,L,Ie);if(Ar!==void 0){if(Ar)continue;Xt=!1;break}if(Dt){if(!Me(L,function(pr,on){if(!Pe(Dt,on)&&(Gt===pr||We(Gt,pr,Z,ce,Ie)))return Dt.push(on)})){Xt=!1;break}}else if(!(Gt===Yt||We(Gt,Yt,Z,ce,Ie))){Xt=!1;break}}return Ie.delete(S),Ie.delete(L),Xt}function p7(S,L,Z,ce,We,Ie,Qe){switch(Z){case X:if(S.byteLength!=L.byteLength||S.byteOffset!=L.byteOffset)return!1;S=S.buffer,L=L.buffer;case q:return!(S.byteLength!=L.byteLength||!Ie(new Ne(S),new Ne(L)));case p:case w:case N:return Td(+S,+L);case y:return S.name==L.name&&S.message==L.message;case I:case h:return S==L+"";case A:var vt=ge;case O:var St=ce&i;if(vt||(vt=Oe),S.size!=L.size&&!St)return!1;var Ze=Qe.get(S);if(Ze)return Ze==L;ce|=s,Qe.set(S,L);var zt=$d(vt(S),vt(L),ce,We,Ie,Qe);return Qe.delete(S),zt;case _:if(ot)return ot.call(S)==ot.call(L)}return!1}function g7(S,L,Z,ce,We,Ie){var Qe=Z&i,vt=Pd(S),St=vt.length,Ze=Pd(L),zt=Ze.length;if(St!=zt&&!Qe)return!1;for(var Xt=St;Xt--;){var Dt=vt[Xt];if(!(Qe?Dt in L:v.call(L,Dt)))return!1}var Gt=Ie.get(S);if(Gt&&Ie.get(L))return Gt==L;var Yt=!0;Ie.set(S,L),Ie.set(L,S);for(var Ar=Qe;++Xt<St;){Dt=vt[Xt];var pr=S[Dt],on=L[Dt];if(ce)var Ud=Qe?ce(on,pr,Dt,L,S,Ie):ce(pr,on,Dt,S,L,Ie);if(!(Ud===void 0?pr===on||We(pr,on,Z,ce,Ie):Ud)){Yt=!1;break}Ar||(Ar=Dt=="constructor")}if(Yt&&!Ar){var io=S.constructor,so=L.constructor;io!=so&&"constructor"in S&&"constructor"in L&&!(typeof io=="function"&&io instanceof io&&typeof so=="function"&&so instanceof so)&&(Yt=!1)}return Ie.delete(S),Ie.delete(L),Yt}function Pd(S){return l7(S,I7,w7)}function ro(S,L){var Z=S.__data__;return b7(L)?Z[typeof L=="string"?"string":"hash"]:Z.map}function Tn(S,L){var Z=De(S,L);return h7(Z)?Z:void 0}function m7(S){var L=v.call(S,Ht),Z=S[Ht];try{S[Ht]=void 0;var ce=!0}catch{}var We=U.call(S);return ce&&(L?S[Ht]=Z:delete S[Ht]),We}var w7=rn?function(S){return S==null?[]:(S=Object(S),Le(rn(S),function(L){return Fe.call(S,L)}))}:D7,Or=ki;(rt&&Or(new rt(new ArrayBuffer(1)))!=X||Je&&Or(new Je)!=A||nt&&Or(nt.resolve())!=D||it&&Or(new it)!=O||st&&Or(new st)!=j)&&(Or=function(S){var L=ki(S),Z=L==x?S.constructor:void 0,ce=Z?sn(Z):"";if(ce)switch(ce){case ft:return X;case pt:return A;case gt:return D;case mt:return O;case wt:return j}return L});function y7(S,L){return L=L??o,!!L&&(typeof S=="number"||fe.test(S))&&S>-1&&S%1==0&&S<L}function b7(S){var L=typeof S;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?S!=="__proto__":S===null}function v7(S){return!!T&&T in S}function _7(S){var L=S&&S.constructor,Z=typeof L=="function"&&L.prototype||g;return S===Z}function E7(S){return U.call(S)}function sn(S){if(S!=null){try{return d.call(S)}catch{}try{return S+""}catch{}}return""}function Td(S,L){return S===L||S!==S&&L!==L}var x7=Od(function(){return arguments}())?Od:function(S){return Hi(S)&&v.call(S,"callee")&&!Fe.call(S,"callee")},no=Array.isArray;function C7(S){return S!=null&&Rd(S.length)&&!Nd(S)}var Uc=ji||O7;function S7(S,L){return Ad(S,L)}function Nd(S){if(!Ld(S))return!1;var L=ki(S);return L==m||L==E||L==l||L==b}function Rd(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=o}function Ld(S){var L=typeof S;return S!=null&&(L=="object"||L=="function")}function Hi(S){return S!=null&&typeof S=="object"}var Md=Ee?Ke(Ee):d7;function I7(S){return C7(S)?c7(S):f7(S)}function D7(){return[]}function O7(){return!1}t.exports=S7})(ua,ua.exports);var c5=ua.exports,l5=Object.defineProperty,rh=Object.getOwnPropertySymbols,u5=Object.prototype.hasOwnProperty,h5=Object.prototype.propertyIsEnumerable,nh=(t,e,r)=>e in t?l5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$t=(t,e)=>{for(var r in e||(e={}))u5.call(e,r)&&nh(t,r,e[r]);if(rh)for(var r of rh(e))h5.call(e,r)&&nh(t,r,e[r]);return t};function d5(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 A=0,N=0,M=0,x=E.length;M!==x&&E[M]===0;)M++,A++;for(var D=(x-M)*p+1>>>0,b=new Uint8Array(D);M!==x;){for(var I=E[M],O=0,h=D-1;(I!==0||O<N)&&h!==-1;h--,O++)I+=256*b[h]>>>0,b[h]=I%a>>>0,I=I/a>>>0;if(I!==0)throw new Error("Non-zero carry");N=O,M++}for(var _=D-N;_!==D&&b[_]===0;)_++;for(var H=c.repeat(A);_<D;++_)H+=t.charAt(b[_]);return H}function y(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return new Uint8Array;var A=0;if(E[A]!==" "){for(var N=0,M=0;E[A]===c;)N++,A++;for(var x=(E.length-A)*l+1>>>0,D=new Uint8Array(x);E[A];){var b=r[E.charCodeAt(A)];if(b===255)return;for(var I=0,O=x-1;(b!==0||I<M)&&O!==-1;O--,I++)b+=a*D[O]>>>0,D[O]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");M=I,A++}if(E[A]!==" "){for(var h=x-M;h!==x&&D[h]===0;)h++;for(var _=new Uint8Array(N+(x-h)),H=N;h!==x;)_[H++]=D[h++];return _}}}function m(E){var A=y(E);if(A)return A;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:y,decode:m}}var f5=d5,p5=f5;const ih=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")},g5=t=>new TextEncoder().encode(t),m5=t=>new TextDecoder().decode(t);class w5{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 y5{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 sh(this,e)}}class b5{constructor(e){this.decoders=e}or(e){return sh(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 sh=(t,e)=>new b5($t($t({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class v5{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new w5(e,r,n),this.decoder=new y5(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ls=({name:t,prefix:e,encode:r,decode:n})=>new v5(t,e,r,n),oi=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=p5(r,e);return ls({prefix:t,name:e,encode:n,decode:s=>ih(i(s))})},_5=(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},E5=(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})=>ls({prefix:e,name:t,encode(i){return E5(i,n,r)},decode(i){return _5(i,n,r,t)}}),x5=ls({prefix:"\0",name:"identity",encode:t=>m5(t),decode:t=>g5(t)});var C5=Object.freeze({__proto__:null,identity:x5});const S5=xt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var I5=Object.freeze({__proto__:null,base2:S5});const D5=xt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var O5=Object.freeze({__proto__:null,base8:D5});const A5=oi({prefix:"9",name:"base10",alphabet:"0123456789"});var $5=Object.freeze({__proto__:null,base10:A5});const P5=xt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),T5=xt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var N5=Object.freeze({__proto__:null,base16:P5,base16upper:T5});const R5=xt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),L5=xt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),M5=xt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U5=xt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),F5=xt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),B5=xt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),j5=xt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),k5=xt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),H5=xt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var z5=Object.freeze({__proto__:null,base32:R5,base32upper:L5,base32pad:M5,base32padupper:U5,base32hex:F5,base32hexupper:B5,base32hexpad:j5,base32hexpadupper:k5,base32z:H5});const W5=oi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),q5=oi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var V5=Object.freeze({__proto__:null,base36:W5,base36upper:q5});const K5=oi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),G5=oi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Y5=Object.freeze({__proto__:null,base58btc:K5,base58flickr:G5});const Z5=xt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),J5=xt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),X5=xt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Q5=xt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ew=Object.freeze({__proto__:null,base64:Z5,base64pad:J5,base64url:X5,base64urlpad:Q5});const oh=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}"),tw=oh.reduce((t,e,r)=>(t[r]=e,t),[]),rw=oh.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function nw(t){return t.reduce((e,r)=>(e+=tw[r],e),"")}function iw(t){const e=[];for(const r of t){const n=rw[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const sw=ls({prefix:"\u{1F680}",name:"base256emoji",encode:nw,decode:iw});var ow=Object.freeze({__proto__:null,base256emoji:sw}),aw=ch,ah=128,cw=127,lw=~cw,uw=Math.pow(2,31);function ch(t,e,r){e=e||[],r=r||0;for(var n=r;t>=uw;)e[r++]=t&255|ah,t/=128;for(;t&lw;)e[r++]=t&255|ah,t>>>=7;return e[r]=t|0,ch.bytes=r-n+1,e}var hw=ha,dw=128,lh=127;function ha(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw ha.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&lh)<<i:(o&lh)*Math.pow(2,i),i+=7}while(o>=dw);return ha.bytes=s-n,r}var fw=Math.pow(2,7),pw=Math.pow(2,14),gw=Math.pow(2,21),mw=Math.pow(2,28),ww=Math.pow(2,35),yw=Math.pow(2,42),bw=Math.pow(2,49),vw=Math.pow(2,56),_w=Math.pow(2,63),Ew=function(t){return t<fw?1:t<pw?2:t<gw?3:t<mw?4:t<ww?5:t<yw?6:t<bw?7:t<vw?8:t<_w?9:10},xw={encode:aw,decode:hw,encodingLength:Ew},uh=xw;const hh=(t,e,r=0)=>(uh.encode(t,e,r),e),dh=t=>uh.encodingLength(t),da=(t,e)=>{const r=e.byteLength,n=dh(t),i=n+dh(r),s=new Uint8Array(i+r);return hh(t,s,0),hh(r,s,n),s.set(e,i),new Cw(t,r,e,s)};class Cw{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const fh=({name:t,code:e,encode:r})=>new Sw(t,e,r);class Sw{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?da(this.code,r):r.then(n=>da(this.code,n))}else throw Error("Unknown type, must be binary type")}}const ph=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Iw=fh({name:"sha2-256",code:18,encode:ph("SHA-256")}),Dw=fh({name:"sha2-512",code:19,encode:ph("SHA-512")});var Ow=Object.freeze({__proto__:null,sha256:Iw,sha512:Dw});const gh=0,Aw="identity",mh=ih;var $w=Object.freeze({__proto__:null,identity:{code:gh,name:Aw,encode:mh,digest:t=>da(gh,mh(t))}});new TextEncoder,new TextDecoder;const wh=$t($t($t($t($t($t($t($t($t($t({},C5),I5),O5),$5),N5),z5),V5),Y5),ew),ow);$t($t({},Ow),$w);function Pw(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function yh(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const bh=yh("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),fa=yh("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=Pw(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Tw=$t({utf8:bh,"utf-8":bh,hex:wh.base16,latin1:fa,ascii:fa,binary:fa},wh);function Nw(t,e="utf8"){const r=Tw[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 vh="wc",Rw=2,pa="core",br=`${vh}@${2}:${pa}:`,Lw={name:pa,logger:"error"},Mw={database:":memory:"},Uw="crypto",_h="client_ed25519_seed",Fw=me.ONE_DAY,Bw="keychain",jw="0.3",kw="messages",Hw="0.3",zw=me.SIX_HOURS,Ww="publisher",Eh="irn",qw="error",xh="wss://relay.walletconnect.com",Vw="relayer",Ct={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"},Kw="_subscription",us={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},Ch=me.ONE_SECOND,Gw="2.4.5",Yw="0.3",rr={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},Zw="subscription",Jw="0.3",Xw=me.FIVE_SECONDS*1e3,Qw="pairing",ey="0.3",ai={wc_pairingDelete:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:me.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:me.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:me.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:me.ONE_DAY,prompt:!1,tag:0},res:{ttl:me.ONE_DAY,prompt:!1,tag:0}}},nr={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},ty="history",ry="0.3",ny="expirer",Wt={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},iy="0.3";class sy{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=Bw,this.version=jw,this.initialized=!1,this.storagePrefix=br,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=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,nu(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?iu(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 oy{constructor(e,r,n){this.core=e,this.logger=r,this.name=Uw,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=Hu(i);return ku(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=cg();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=Hu(s),a=Ro();return await ym(a,i,Fw,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=lg(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||ug(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=Jl(o),c=ri(s);if(Xl(a)){const y=a.senderPublicKey,m=a.receiverPublicKey;i=await this.generateSharedKey(y,m)}const l=this.getSymKey(i),{type:p,senderPublicKey:w}=a;return dg({type:p,symKey:l,message:c,senderPublicKey:w})},this.decode=async(i,s,o)=>{this.isInitialized();const a=gg(s,o);if(Xl(a)){const p=a.receiverPublicKey,w=a.senderPublicKey;i=await this.generateSharedKey(p,w)}const c=this.getSymKey(i),l=fg({symKey:c,encoded:s});return ta(l)},this.core=e,this.logger=je.generateChildLogger(r,this.name),this.keychain=n||new sy(this.core,this.logger)}get context(){return je.getLoggerContext(this.logger)}getPayloadType(e){const r=Lo(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(_h)}catch{e=Ro(),await this.keychain.set(_h,e)}return Nw(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 ay extends J3{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=kw,this.version=Hw,this.initialized=!1,this.storagePrefix=br,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const s=es(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=es(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,nu(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?iu(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 cy extends X3{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new _t.exports.EventEmitter,this.name=Ww,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||zw,a=Mo(s),c=s?.prompt||!1,l=s?.tag||0,p={topic:n,message:i,opts:{ttl:o,relay:a,prompt:c,tag:l}},w=es(i);this.queue.set(w,p);try{await await su(this.rpcPublish(n,i,o,a,c,l),this.publishTimeout),this.relayer.events.emit(Ct.publish,p)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(Ct.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:Uo(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o}};return Ot((a=w.params)==null?void 0:a.prompt)&&((c=w.params)==null||delete c.prompt),Ot((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(Jn.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()})}}class ly{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 uy=Object.defineProperty,hy=Object.defineProperties,dy=Object.getOwnPropertyDescriptors,Sh=Object.getOwnPropertySymbols,fy=Object.prototype.hasOwnProperty,py=Object.prototype.propertyIsEnumerable,Ih=(t,e,r)=>e in t?uy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hs=(t,e)=>{for(var r in e||(e={}))fy.call(e,r)&&Ih(t,r,e[r]);if(Sh)for(var r of Sh(e))py.call(e,r)&&Ih(t,r,e[r]);return t},ga=(t,e)=>hy(t,dy(e));class gy extends tm{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new ly,this.events=new _t.exports.EventEmitter,this.name=Zw,this.version=Jw,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=br,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=Mo(i),o={topic:n,relay:s};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s);return this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,s)=>{const o=new me.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)>=Xw&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),s(!1))},this.pollingInterval)}),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=je.generateChildLogger(r,this.name),this.clientId=""}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=Mo(n);await this.rpcUnsubscribe(e,r,i);const s=tt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:Uo(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await su(this.relayer.provider.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Ct.connection_stalled)}return es(e+this.clientId)}rpcUnsubscribe(e,r,n){const i={method:Uo(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,ga(hs({},r),{id:e})),this.pending.delete(r.topic)}onResubscribe(e,r){this.addSubscription(e,ga(hs({},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,hs({},r)),this.topicMap.set(r.topic,e),this.events.emit(rr.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(rr.deleted,ga(hs({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(rr.sync)}async reset(){this.cached.length&&await Promise.all(this.cached.map(async e=>await this.resubscribe(e))),this.events.emit(rr.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),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async 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(){this.restartInProgress||(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(Jn.HEARTBEAT_EVENTS.pulse,()=>{this.checkPending()}),this.relayer.on(Ct.connect,async()=>{await this.onConnect()}),this.relayer.on(Ct.disconnect,()=>{this.onDisconnect()}),this.events.on(rr.created,async e=>{const r=rr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(rr.deleted,async e=>{const r=rr.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)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var my=Object.defineProperty,Dh=Object.getOwnPropertySymbols,wy=Object.prototype.hasOwnProperty,yy=Object.prototype.propertyIsEnumerable,Oh=(t,e,r)=>e in t?my(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,by=(t,e)=>{for(var r in e||(e={}))wy.call(e,r)&&Oh(t,r,e[r]);if(Dh)for(var r of Dh(e))yy.call(e,r)&&Oh(t,r,e[r]);return t};class vy extends Q3{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new _t.exports.EventEmitter,this.name=Vw,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?je.generateChildLogger(e.logger,this.name):zn(je.getDefaultLoggerOptions({level:e.logger||qw})),this.messages=new ay(this.logger,e.core),this.subscriber=new gy(this,this.logger),this.publisher=new cy(this,this.logger),this.relayUrl=e?.relayUrl||xh,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(rr.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(Ct.transport_closed))}async transportOpen(e){if(!this.reconnecting){this.relayUrl=e||this.relayUrl,this.transportExplicitlyClosed=!1,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(rr.resubscribed,()=>{r()})}),await Promise.race([new Promise(async r=>{await this.provider.connect(),this.removeListener(Ct.transport_closed,this.rejectTransportOpen),r()}),new Promise(r=>this.once(Ct.transport_closed,this.rejectTransportOpen))])])}catch(r){const n=r;if(!/socket hang up/i.test(n.message))throw r;this.logger.error(r),this.events.emit(Ct.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||(await this.transportClose(),await new Promise(r=>setTimeout(r,Ch)),await this.transportOpen(e))}rejectTransportOpen(){throw new Error("closeTransport called before connection was established")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);return new si(new a5(Ag({sdkVersion:Gw,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}),ca(e)){if(!e.method.endsWith(Kw))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(by({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(Ct.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=aa(e.id,!0);await this.provider.connection.send(r)}registerEventListeners(){this.provider.on(us.payload,e=>this.onProviderPayload(e)),this.provider.on(us.connect,()=>{this.events.emit(Ct.connect)}),this.provider.on(us.disconnect,()=>{this.events.emit(Ct.disconnect),this.attemptToReconnect()}),this.provider.on(us.error,e=>this.events.emit(Ct.error,e)),this.events.on(Ct.connection_stalled,async()=>{await this.restartTransport()})}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.transportOpen()},me.toMiliseconds(Ch))}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var _y=Object.defineProperty,Ah=Object.getOwnPropertySymbols,Ey=Object.prototype.hasOwnProperty,xy=Object.prototype.propertyIsEnumerable,$h=(t,e,r)=>e in t?_y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ph=(t,e)=>{for(var r in e||(e={}))Ey.call(e,r)&&$h(t,r,e[r]);if(Ah)for(var r of Ah(e))xy.call(e,r)&&$h(t,r,e[r]);return t};class ds extends em{constructor(e,r,n,i=br,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=Yw,this.cached=[],this.initialized=!1,this.storagePrefix=br,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{Zg(o)?this.map.set(o.id,o):Jg(o)?this.map.set(o.topic,o):this.getKey&&o!==null&&!Ot(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=>c5(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=Ph(Ph({},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 Cy{constructor(e,r){this.core=e,this.logger=r,this.name=Qw,this.version=ey,this.events=new _t.exports,this.initialized=!1,this.storagePrefix=br,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=Ro(),i=await this.core.crypto.setSymKey(n),s=er(me.FIVE_MINUTES),o={protocol:Eh},a={topic:i,expiry:s,relay:o,active:!1},c=jg({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}=Fg(n.uri),a=er(me.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=er(me.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}=Lr();this.events.once(et("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",tt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const o=as(i,s),a=await this.core.crypto.encode(n,o),c=ai[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=aa(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=ai[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=cs(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=ai[c.request.method]?ai[c.request.method].res:ai.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,tt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>wr(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(()=>{hr(i)?this.events.emit(et("pairing_ping",s),{}):Jt(i)&&this.events.emit(et("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=tt("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(tt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!Rt(n)){const{message:i}=se("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Yg(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(!ht(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(wr(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 ds(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(Ct.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);ca(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):la(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(Wt.expired,async e=>{const{topic:r}=au(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class Sy extends Z3{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new _t.exports.EventEmitter,this.name=ty,this.version=ry,this.cached=[],this.initialized=!1,this.storagePrefix=br,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s};this.records.set(o.id,o),this.events.emit(nr.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=Jt(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(nr.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(nr.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:as(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(nr.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(nr.created,e=>{const r=nr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(nr.updated,e=>{const r=nr.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(nr.deleted,e=>{const r=nr.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 Iy extends rm{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new _t.exports.EventEmitter,this.name=ny,this.version=iy,this.cached=[],this.initialized=!1,this.storagePrefix=br,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Wt.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(Wt.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 $g(e);if(typeof e=="number")return Pg(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(Wt.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;me.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Wt.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Jn.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Wt.created,e=>{const r=Wt.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Wt.expired,e=>{const r=Wt.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Wt.deleted,e=>{const r=Wt.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 Dy=Object.defineProperty,Th=Object.getOwnPropertySymbols,Oy=Object.prototype.hasOwnProperty,Ay=Object.prototype.propertyIsEnumerable,Nh=(t,e,r)=>e in t?Dy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rh=(t,e)=>{for(var r in e||(e={}))Oy.call(e,r)&&Nh(t,r,e[r]);if(Th)for(var r of Th(e))Ay.call(e,r)&&Nh(t,r,e[r]);return t};class ma extends Y3{constructor(e){super(e),this.protocol=vh,this.version=Rw,this.name=pa,this.events=new _t.exports.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||xh;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:zn(je.getDefaultLoggerOptions({level:e?.logger||Lw.logger}));this.logger=je.generateChildLogger(r,this.name),this.heartbeat=new Jn.HeartBeat,this.crypto=new oy(this,this.logger,e?.keychain),this.history=new Sy(this,this.logger),this.expirer=new Iy(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new t3(Rh(Rh({},Mw),e?.storageOptions)),this.relayer=new vy({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Cy(this,this.logger)}static async init(e){const r=new ma(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 $y=ma,Lh="wc",Mh=2,Uh="client",wa=`${Lh}@${Mh}:${Uh}:`,ya={name:Uh,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Py="proposal",Ty="session",fs=me.SEVEN_DAYS,Ny="engine",ci={wc_sessionPropose:{req:{ttl:me.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1104},res:{ttl:me.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1106},res:{ttl:me.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:me.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:me.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1112},res:{ttl:me.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:me.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:me.THIRTY_SECONDS,prompt:!1,tag:1115}}},ba={min:me.FIVE_MINUTES,max:me.SEVEN_DAYS},Ry="request";var Ly=Object.defineProperty,My=Object.defineProperties,Uy=Object.getOwnPropertyDescriptors,Fh=Object.getOwnPropertySymbols,Fy=Object.prototype.hasOwnProperty,By=Object.prototype.propertyIsEnumerable,Bh=(t,e,r)=>e in t?Ly(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qt=(t,e)=>{for(var r in e||(e={}))Fy.call(e,r)&&Bh(t,r,e[r]);if(Fh)for(var r of Fh(e))By.call(e,r)&&Bh(t,r,e[r]);return t},va=(t,e)=>My(t,Uy(e));class jy extends im{constructor(e){super(e),this.name=Ny,this.events=new _t.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(ci)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized();const n=va(qt({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:c}=n;let l=i,p,w=!1;if(l&&(w=this.client.core.pairing.pairings.get(l).active),!l||!w){const{topic:D,uri:b}=await this.client.core.pairing.create();l=D,p=b}const y=await this.client.core.crypto.generateKeyPair(),m=qt({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:Eh}],proposer:{publicKey:y,metadata:this.client.metadata}},a&&{sessionProperties:a}),{reject:E,resolve:A,done:N}=Lr();if(this.events.once(et("session_connect"),async({error:D,session:b})=>{if(D)E(D);else if(b){b.self.publicKey=y;const I=va(qt({},b),{requiredNamespaces:b.requiredNamespaces,optionalNamespaces:b.optionalNamespaces});await this.client.session.set(b.topic,I),await this.setExpiry(b.topic,b.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:b.peer.metadata}),A(I)}}),!l){const{message:D}=se("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(D)}const M=await this.sendRequest(l,"wc_sessionPropose",m),x=er(me.FIVE_MINUTES);return await this.setProposal(M,qt({id:M,expiry:x},m)),{uri:p,approval:N}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:s,sessionProperties:o}=r,a=this.client.proposal.get(n);let{pairingTopic:c,proposer:l,requiredNamespaces:p,optionalNamespaces:w}=a;Hn(p)||(p=Wg(s,"approve()"));const y=await this.client.core.crypto.generateKeyPair(),m=l.publicKey,E=await this.client.core.crypto.generateSharedKey(y,m);c&&n&&(await this.client.core.pairing.updateMetadata({topic:c,metadata:l.metadata}),await this.sendResult(n,c,{relay:{protocol:i??"irn"},responderPublicKey:y}),await this.client.proposal.delete(n,tt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:c}));const A=qt({relay:{protocol:i??"irn"},namespaces:s,requiredNamespaces:p,optionalNamespaces:w,controller:{publicKey:y,metadata:this.client.metadata},expiry:er(fs)},o&&{sessionProperties:o});await this.client.core.relayer.subscribe(E);const N=await this.sendRequest(E,"wc_sessionSettle",A),{done:M,resolve:x,reject:D}=Lr();this.events.once(et("session_approve",N),({error:I})=>{I?D(I):x(this.client.session.get(E))});const b=va(qt({},A),{topic:E,acknowledged:!1,self:A.controller,peer:{publicKey:l.publicKey,metadata:l.metadata},controller:y});return await this.client.session.set(E,b),await this.setExpiry(E,er(fs)),{topic:E,acknowledged:M}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:s}=this.client.proposal.get(n);s&&(await this.sendError(n,s,i),await this.client.proposal.delete(n,tt("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,s=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:o,resolve:a,reject:c}=Lr();return this.events.once(et("session_update",s),({error:l})=>{l?c(l):a()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:o}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:s,resolve:o,reject:a}=Lr();return this.events.once(et("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,er(fs)),{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}=Lr(o);return this.events.once(et("session_request",a),({error:w,result:y})=>{w?p(w):l(y)}),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n}),await c()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i;hr(i)?await this.sendResult(s,n,i.result):Jt(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}=Lr();this.events.once(et("session_ping",i),({error:c})=>{c?a(c):o()}),await s()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:s})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest(n,"wc_sessionDelete",tt("USER_DISCONNECTED")),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Kg(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await Promise.all([this.client.session.delete(r,tt("USER_DISCONNECTED")),this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.deleteSymKey(r),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,tt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=ci.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,er(n))},this.sendRequest=async(r,n,i,s)=>{const o=as(n,i),a=await this.client.core.crypto.encode(r,o),c=ci[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=aa(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=ci[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=cs(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=ci[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=>{wr(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{wr(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(qt({},n.params));const o=er(me.FIVE_MINUTES),a=qt({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(hr(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 Jt(n)&&(await this.client.proposal.delete(i,tt("USER_DISCONNECTED")),this.events.emit(et("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,requiredNamespaces:p,optionalNamespaces:w,sessionProperties:y}=n.params,m=qt({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,requiredNamespaces:p,optionalNamespaces:w,controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},y&&{sessionProperties:y});await this.sendResult(n.id,r,!0),this.events.emit(et("session_connect"),{session:m})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;hr(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(et("session_approve",i),{})):Jt(n)&&(await this.client.session.delete(r,tt("USER_DISCONNECTED")),this.events.emit(et("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidUpdate(qt({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;hr(n)?this.events.emit(et("session_update",i),{}):Jt(n)&&this.events.emit(et("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,er(fs)),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;hr(n)?this.events.emit(et("session_extend",i),{}):Jt(n)&&this.events.emit(et("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{hr(n)?this.events.emit(et("session_ping",i),{}):Jt(n)&&this.events.emit(et("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),this.client.core.relayer.once(Ct.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(qt({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;hr(n)?this.events.emit(et("session_request",i),{result:n.result}):Jt(n)&&this.events.emit(et("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidEmit(qt({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:c}=se("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(Ot(n)||await this.isValidPairingTopic(n),!s2(a,!0)){const{message:c}=se("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!Ot(i)&&Hn(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Ot(s)&&Hn(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Ot(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=i2(r,"connect()",n);if(i)throw new Error(i.message)},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,sessionProperties:o}=r;await this.isValidProposalId(n);const a=this.client.proposal.get(n),c=ts(i,"approve()");if(c)throw new Error(c.message);const l=jo(a.requiredNamespaces,i,"approve()","requiredNamespaces");if(l)throw new Error(l.message);if(!ht(s,!0)){const{message:p}=se("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(p)}if(Object.keys(i).length>Object.keys(a.requiredNamespaces).length){const p=Object.keys(a.optionalNamespaces).filter(m=>i[m]),w={};for(const m in a.optionalNamespaces)p.includes(m)&&(w[m]=a.optionalNamespaces[m]);const y=jo(w,i,"approve()","optionalNamespaces");if(y)throw new Error(y.message)}Ot(o)||this.validateSessionProps(o,"sessionProperties")},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),!a2(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(!du(n)){const{message:l}=se("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=Xg(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=ts(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(wr(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=ts(i,"update()");if(o)throw new Error(o.message);const a=jo(s.requiredNamespaces,i,"update()","requiredNamespaces");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(!fu(a,s)){const{message:c}=se("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!c2(i)){const{message:c}=se("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!h2(a,s,i.method)){const{message:c}=se("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!f2(o,ba)){const{message:c}=se("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${ba.min} and ${ba.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),!l2(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(!fu(o,s)){const{message:a}=se("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!u2(i)){const{message:a}=se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!d2(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)},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!ht(i,!1)){const{message:s}=se("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})}}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(Ct.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);ca(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):la(i)&&(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.client.core.expirer.on(Wt.expired,async e=>{const{topic:r,id:n}=au(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(!ht(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(wr(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=se("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!ht(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(wr(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(ht(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(!o2(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(wr(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=se("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class ky extends ds{constructor(e,r){super(e,r,Py,wa),this.core=e,this.logger=r}}class Hy extends ds{constructor(e,r){super(e,r,Ty,wa),this.core=e,this.logger=r}}class zy extends ds{constructor(e,r){super(e,r,Ry,wa),this.core=e,this.logger=r}}class _a extends nm{constructor(e){super(e),this.protocol=Lh,this.version=Mh,this.name=ya.name,this.events=new _t.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||ya.name,this.metadata=e?.metadata||Sg();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:zn(je.getDefaultLoggerOptions({level:e?.logger||ya.logger}));this.core=e?.core||new $y(e),this.logger=je.generateChildLogger(r,this.name),this.session=new Hy(this.core,this.logger),this.proposal=new ky(this.core,this.logger),this.pendingRequest=new zy(this.core,this.logger),this.engine=new jy(this)}static async init(e){const r=new _a(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 Ea={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 y(C){return typeof C!="string"&&(C=String(C)),C}function m(C){var $={next:function(){var G=C.shift();return{done:G===void 0,value:G}}};return a.iterable&&($[Symbol.iterator]=function(){return $}),$}function E(C){this.map={},C instanceof E?C.forEach(function($,G){this.append(G,$)},this):Array.isArray(C)?C.forEach(function($){this.append($[0],$[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function($){this.append($,C[$])},this)}E.prototype.append=function(C,$){C=w(C),$=y($);var G=this.map[C];this.map[C]=G?G+", "+$:$},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,$){this.map[w(C)]=y($)},E.prototype.forEach=function(C,$){for(var G in this.map)this.map.hasOwnProperty(G)&&C.call($,this.map[G],G,this)},E.prototype.keys=function(){var C=[];return this.forEach(function($,G){C.push(G)}),m(C)},E.prototype.values=function(){var C=[];return this.forEach(function($){C.push($)}),m(C)},E.prototype.entries=function(){var C=[];return this.forEach(function($,G){C.push([G,$])}),m(C)},a.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function A(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}function N(C){return new Promise(function($,G){C.onload=function(){$(C.result)},C.onerror=function(){G(C.error)}})}function M(C){var $=new FileReader,G=N($);return $.readAsArrayBuffer(C),G}function x(C){var $=new FileReader,G=N($);return $.readAsText(C),G}function D(C){for(var $=new Uint8Array(C),G=new Array($.length),K=0;K<$.length;K++)G[K]=String.fromCharCode($[K]);return G.join("")}function b(C){if(C.slice)return C.slice(0);var $=new Uint8Array(C.byteLength);return $.set(new Uint8Array(C)),$.buffer}function I(){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=b(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(C)||p(C))?this._bodyArrayBuffer=b(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=A(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?A(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(M)}),this.text=function(){var C=A(this);if(C)return C;if(this._bodyBlob)return x(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(D(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(H)}),this.json=function(){return this.text().then(JSON.parse)},this}var O=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function h(C){var $=C.toUpperCase();return O.indexOf($)>-1?$:C}function _(C,$){$=$||{};var G=$.body;if(C instanceof _){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,$.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=$.credentials||this.credentials||"same-origin",($.headers||!this.headers)&&(this.headers=new E($.headers)),this.method=h($.method||this.method||"GET"),this.mode=$.mode||this.mode||null,this.signal=$.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)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})};function H(C){var $=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," ");$.append(decodeURIComponent(W),decodeURIComponent(z))}}),$}function j(C){var $=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();$.append(z,J)}}),$}I.call(_.prototype);function q(C,$){$||($={}),this.type="default",this.status=$.status===void 0?200:$.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in $?$.statusText:"OK",this.headers=new E($.headers),this.url=$.url||"",this._initBody(C)}I.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,$){if(X.indexOf($)===-1)throw new RangeError("Invalid status code");return new q(null,{status:$,headers:{location:C}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function($,G){this.message=$,this.name=G;var K=Error($);this.stack=K.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function re(C,$){return new Promise(function(G,K){var W=new _(C,$);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 Y={status:z.status,statusText:z.statusText,headers:j(z.getAllResponseHeaders()||"")};Y.url="responseURL"in z?z.responseURL:Y.headers.get("X-Request-URL");var le="response"in z?z.response:z.responseText;G(new q(le,Y))},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(Y,le){z.setRequestHeader(le,Y)}),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=_,s.Response=q),o.Headers=E,o.Request=_,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})(Ea,Ea.exports);var jh=Fd(Ea.exports);const kh={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Hh=10;class ps{constructor(e){if(this.url=e,this.events=new _t.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Xu(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=ri(e),s=await(await jh(this.url,Object.assign(Object.assign({},kh),{body:n}))).json();this.onPayload({data:s})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Xu(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=ri({id:1,jsonrpc:"2.0",method:"test",params:[]});await jh(e,Object.assign(Object.assign({},kh),{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"?ta(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=cs(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Vu(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Hh&&this.events.setMaxListeners(Hh)}}const zh="error",Wy="wss://relay.walletconnect.com",qy="wc",Vy="universal_provider",Wh=`${qy}@${2}:${Vy}:`,Ky="https://rpc.walletconnect.com/v1",li={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};function vr(t,e,r){let n;const i=xa(t);return e.rpcMap&&(n=e.rpcMap[i]),n||(n=`${Ky}?chainId=eip155:${i}&projectId=${r}`),n}function xa(t){return t.includes("eip155")?Number(t.split(":")[1]):Number(t)}function Gy(t,e){if(!e.includes(t))throw new Error(`Chain '${t}' not approved. Please use one of the following: ${e.toString()}`)}function Yy(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}const gs=(t,e)=>{const r=n=>{n.request!==e.request||n.topic!==e.topic||(t.events.removeListener("session_request_sent",r),Zy())};t.on("session_request_sent",r)};function Zy(){if(typeof window<"u")try{const t=window.localStorage.getItem("WALLETCONNECT_DEEPLINK_CHOICE");if(t){const e=JSON.parse(t);window.open(e.href,"_self","noreferrer noopener")}}catch(t){console.error(t)}}class Jy{constructor(e){this.name="eip155",this.namespace=e.namespace,this.client=e.client,this.events=e.events,this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){var r;switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return this.handleSwitchChain(e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0"),null;case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?(gs(this.client,e),await this.client.request(e)):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){const n=xa(e);if(!this.httpProviders[n]){const i=r||vr(`${this.name}:${n}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${n}`);this.setHttpProvider(n,i)}this.chainId=n,this.events.emit(li.DEFAULT_CHAIN_CHANGED,`${this.name}:${n}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||vr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new si(new ps(n))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=xa(r);e[n]=this.createHttpProvider(n)}),e}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}handleSwitchChain(e){const r=parseInt(e,16),n=`${this.name}:${r}`;Gy(n,this.namespace.chains),this.setDefaultChain(`${r}`)}}class Xy{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?(gs(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||vr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(li.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?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}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||vr(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new si(new ps(n))}}class Qy{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(gs(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||vr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(li.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||vr(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new si(new ps(n))}}class eb{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(gs(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||vr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(li.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||vr(e,this.namespace);return typeof n>"u"?void 0:new si(new ps(n))}}var tb=Object.defineProperty,rb=Object.defineProperties,nb=Object.getOwnPropertyDescriptors,qh=Object.getOwnPropertySymbols,ib=Object.prototype.hasOwnProperty,sb=Object.prototype.propertyIsEnumerable,Vh=(t,e,r)=>e in t?tb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ms=(t,e)=>{for(var r in e||(e={}))ib.call(e,r)&&Vh(t,r,e[r]);if(qh)for(var r of qh(e))sb.call(e,r)&&Vh(t,r,e[r]);return t},Ca=(t,e)=>rb(t,nb(e));class Sa{constructor(e){this.events=new _t.exports,this.rpcProviders={},this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:zn(je.getDefaultLoggerOptions({level:e?.logger||zh}))}static async init(e){const r=new Sa(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:ms({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:tt("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){const{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});return r&&(this.uri=r,this.events.emit("display_uri",r)),this.session=await n(),this.createProviders(),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(yr(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.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await _a.init({logger:this.providerOpts.logger||zh,relayUrl:this.providerOpts.relayUrl||Wy,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=>{var r,n,i;const s=((r=this.session)==null?void 0:r.namespaces[e].accounts)||[],o=Yy(s),a=Ca(ms({},Object.assign(this.namespaces[e],(i=(n=this.optionalNamespaces)==null?void 0:n[e])!=null?i:{})),{accounts:s,chains:o});switch(e){case"eip155":this.rpcProviders[e]=new Jy({client:this.client,namespace:a,events:this.events});break;case"solana":this.rpcProviders[e]=new Xy({client:this.client,namespace:a,events:this.events});break;case"cosmos":this.rpcProviders[e]=new Qy({client:this.client,namespace:a,events:this.events});break;case"polkadot":break;case"cip34":this.rpcProviders[e]=new eb({client:this.client,namespace:a,events:this.events});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?this.events.emit("accountsChanged",n.data):n.name==="chainChanged"?this.onChainChanged(r.chainId):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=Ca(ms({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Ca(ms({},tt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(li.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;if(!r||!Object.keys(r).length)throw new Error("Namespaces must be not empty");this.namespaces=r,this.optionalNamespaces=n,this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(r&&!Object.keys(this.namespaces).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Object.keys(this.namespaces)[0],s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){const[n,i]=this.validateChain(e);r||this.getProvider(n).setDefaultChain(i),this.namespaces[n].defaultChain=i,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i)}onConnect(){this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${Wh}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${Wh}/${e}`)}}const ob=Sa,ab="wc",cb="ethereum_provider",lb=`${ab}@${2}:${cb}:`,ub="https://rpc.walletconnect.com/v1/",ws=["eth_sendTransaction","personal_sign"],hb=["eth_accounts","eth_requestAccounts","eth_call","eth_getBalance","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],ys=["chainChanged","accountsChanged"],db=["message","disconnect","connect"];var fb=Object.defineProperty,pb=Object.defineProperties,gb=Object.getOwnPropertyDescriptors,Kh=Object.getOwnPropertySymbols,mb=Object.prototype.hasOwnProperty,wb=Object.prototype.propertyIsEnumerable,Gh=(t,e,r)=>e in t?fb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Yh=(t,e)=>{for(var r in e||(e={}))mb.call(e,r)&&Gh(t,r,e[r]);if(Kh)for(var r of Kh(e))wb.call(e,r)&&Gh(t,r,e[r]);return t},Zh=(t,e)=>pb(t,gb(e));function Ia(t){return Number(t[0].split(":")[1])}function Da(t){return`0x${t.toString(16)}`}function yb(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!yr(e))throw new Error("Invalid chains");const c=e,l=n||ws,p=s||ys,w={[Ia(c)]:a[Ia(c)]},y={chains:c,methods:l,events:p,rpcMap:w},m=s?.filter(M=>!ys.includes(M)),E=n?.filter(M=>!ws.includes(M));if(!r&&!o&&!i&&!(m!=null&&m.length)&&!(E!=null&&E.length))return{required:y};const A=m?.length&&E?.length||!r,N={chains:[...new Set(A?c.concat(r||[]):r)],methods:[...new Set(l.concat(i||[]))],events:[...new Set(p.concat(o||[]))],rpcMap:a};return{required:y,optional:N}}class bs{constructor(){this.events=new _t.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=lb,this.on=(e,r)=>this.events.on(e,r),this.once=(e,r)=>this.events.once(e,r),this.removeListener=(e,r)=>this.events.removeListener(e,r),this.off=(e,r)=>this.events.off(e,r),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new bs;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=yb(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&a(new Error("Connection request reset. Please try again."))})),await this.signer.connect(Zh(Yh({namespaces:{[this.namespace]:r}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;this.setChainIds(this.rpc.chains);const s=og(i.namespaces,[this.namespace]);this.setAccounts(s),this.events.emit("connect",{chainId:Da(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Da(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Zh(Yh({},tt("USER_DISCONNECTED")),{data:e.topic}))}),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){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Da(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.setHttpProvider(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;return{chains:((r=e.chains)==null?void 0:r.map(i=>this.formatChainId(i)))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map(i=>this.formatChainId(i)):void 0,methods:e?.methods||ws,events:e?.events||ys,optionalMethods:e?.optionalMethods||[],optionalEvents:e?.optionalEvents||[],rpcMap:e?.rpcMap||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),showQrModal:(n=e?.showQrModal)!=null?n:!0,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=Ia(this.rpc.chains),this.signer=await ob.init({projectId:this.rpc.projectId}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){const{Web3Modal:r}=await Promise.resolve().then(function(){return kb});this.modal=new r({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains})}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&yr(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=i?.[s]||this.getRpcUrl(s)})),n&&yr(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=i?.[s]||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${ub}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`);this.setChainIds(e?[this.formatChainId(e)]:this.session.namespaces[this.namespace].accounts),this.setAccounts(this.session.namespaces[this.namespace].accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const bb=bs,vb=Symbol(),Jh=Object.getPrototypeOf,Oa=new WeakMap,_b=t=>t&&(Oa.has(t)?Oa.get(t):Jh(t)===Object.prototype||Jh(t)===Array.prototype),Eb=t=>_b(t)&&t[vb]||null,Xh=(t,e=!0)=>{Oa.set(t,e)},Aa=t=>typeof t=="object"&&t!==null,Br=new WeakMap,vs=new WeakSet,xb=(t=Object.is,e=(l,p)=>new Proxy(l,p),r=l=>Aa(l)&&!vs.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 y=i.get(l);if(y?.[0]===p)return y[1];const m=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Xh(m,!0),i.set(l,[p,m]),Reflect.ownKeys(l).forEach(E=>{const A=Reflect.get(l,E);vs.has(A)?(Xh(A,!1),m[E]=A):A instanceof Promise?Object.defineProperty(m,E,{get(){return w(A)}}):Br.has(A)?m[E]=Sb(A,w):m[E]=A}),Object.freeze(m)},o=new WeakMap,a=[1,1],c=l=>{if(!Aa(l))throw new Error("object required");const p=o.get(l);if(p)return p;let w=a[0];const y=new Set,m=(H,j=++a[0])=>{w!==j&&(w=j,y.forEach(q=>q(H,j)))};let E=a[1];const A=(H=++a[1])=>(E!==H&&!y.size&&(E=H,M.forEach(([j])=>{const q=j[1](H);q>w&&(w=q)})),w),N=H=>(j,q)=>{const X=[...j];X[1]=[H,...X[1]],m(X,q)},M=new Map,x=(H,j)=>{if(void 0!=="production"&&M.has(H))throw new Error("prop listener already exists");if(y.size){const q=j[3](N(H));M.set(H,[j,q])}else M.set(H,[j])},D=H=>{var j;const q=M.get(H);q&&(M.delete(H),(j=q[1])==null||j.call(q))},b=H=>(y.add(H),y.size===1&&M.forEach(([q,X],re)=>{if(void 0!=="production"&&X)throw new Error("remove already exists");const C=q[3](N(re));M.set(re,[q,C])}),()=>{y.delete(H),y.size===0&&M.forEach(([q,X],re)=>{X&&(X(),M.set(re,[q]))})}),I=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),h=e(I,{deleteProperty(H,j){const q=Reflect.get(H,j);D(j);const X=Reflect.deleteProperty(H,j);return X&&m(["delete",[j],q]),X},set(H,j,q,X){var re;const C=Reflect.has(H,j),$=Reflect.get(H,j,X);if(C&&t($,q))return!0;D(j),Aa(q)&&(q=Eb(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,m(["resolve",[j],K])}).catch(K=>{q.status="rejected",q.reason=K,m(["reject",[j],K])});else{!Br.has(q)&&r(q)&&(G=_r(q));const K=!vs.has(G)&&Br.get(G);K&&x(j,K)}return Reflect.set(H,j,G,X),m(["set",[j],q,$]),!0}});o.set(l,h);const _=[I,A,s,b];return Br.set(h,_),Reflect.ownKeys(l).forEach(H=>{const j=Object.getOwnPropertyDescriptor(l,H);j.get||j.set?Object.defineProperty(I,H,j):h[H]=l[H]}),h})=>[c,Br,vs,t,e,r,n,i,s,o,a],[Cb]=xb();function _r(t={}){return Cb(t)}function ui(t,e,r){const n=Br.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 Sb(t,e){const r=Br.get(t);void 0!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}var Qh={},_s={};_s.byteLength=Ob,_s.toByteArray=$b,_s.fromByteArray=Nb;for(var ir=[],Vt=[],Ib=typeof Uint8Array<"u"?Uint8Array:Array,$a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pn=0,Db=$a.length;pn<Db;++pn)ir[pn]=$a[pn],Vt[$a.charCodeAt(pn)]=pn;Vt["-".charCodeAt(0)]=62,Vt["_".charCodeAt(0)]=63;function e0(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 Ob(t){var e=e0(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Ab(t,e,r){return(e+r)*3/4-r}function $b(t){var e,r=e0(t),n=r[0],i=r[1],s=new Ib(Ab(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=Vt[t.charCodeAt(c)]<<18|Vt[t.charCodeAt(c+1)]<<12|Vt[t.charCodeAt(c+2)]<<6|Vt[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Vt[t.charCodeAt(c)]<<2|Vt[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Vt[t.charCodeAt(c)]<<10|Vt[t.charCodeAt(c+1)]<<4|Vt[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Pb(t){return ir[t>>18&63]+ir[t>>12&63]+ir[t>>6&63]+ir[t&63]}function Tb(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(Pb(n));return i.join("")}function Nb(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(Tb(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(ir[e>>2]+ir[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ir[e>>10]+ir[e>>4&63]+ir[e<<2&63]+"=")),i.join("")}var Pa={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Pa.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,y=r?-1:1,m=t[e+w];for(w+=y,s=m&(1<<-p)-1,m>>=-p,p+=a;p>0;s=s*256+t[e+w],w+=y,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+w],w+=y,p-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(m?-1:1)*o*Math.pow(2,s-n)},Pa.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,p=(1<<l)-1,w=p>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:s-1,E=n?1:-1,A=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+=y/c:e+=y*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+m]=a&255,m+=E,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[r+m]=o&255,m+=E,o/=256,l-=8);t[r+m-E]|=A*128};/*!
66
+ ***************************************************************************** */var oa=function(t,e){return oa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},oa(t,e)};function Om(t,e){oa(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var aa=function(){return aa=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},aa.apply(this,arguments)};function Am(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 $m(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 Pm(t,e){return function(r,n){e(r,n,t)}}function Tm(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Nm(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 Rm(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 Lm(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Mm(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ca(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Zh(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 Um(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Zh(arguments[e]));return t}function Fm(){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 ii(t){return this instanceof ii?(this.v=t,this):new ii(t)}function Bm(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(b){n[b]&&(i[b]=function(m){return new Promise(function(E,A){s.push([b,m,E,A])>1||a(b,m)})})}function a(b,m){try{c(n[b](m))}catch(E){w(s[0][3],E)}}function c(b){b.value instanceof ii?Promise.resolve(b.value.v).then(l,p):w(s[0][2],b)}function l(b){a("next",b)}function p(b){a("throw",b)}function w(b,m){b(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function jm(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:ii(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function km(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ca=="function"?ca(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Hm(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function zm(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 Wm(t){return t&&t.__esModule?t:{default:t}}function qm(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Vm(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 Km=Object.freeze({__proto__:null,__extends:Om,get __assign(){return aa},__rest:Am,__decorate:$m,__param:Pm,__metadata:Tm,__awaiter:Nm,__generator:Rm,__createBinding:Lm,__exportStar:Mm,__values:ca,__read:Zh,__spread:Um,__spreadArrays:Fm,__await:ii,__asyncGenerator:Bm,__asyncDelegator:jm,__asyncValues:km,__makeTemplateObject:Hm,__importStar:zm,__importDefault:Wm,__classPrivateFieldGet:qm,__classPrivateFieldSet:Vm}),Gm=Ar(Km),lr={},Yh;function Zm(){if(Yh)return lr;Yh=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.isBrowserCryptoAvailable=lr.getSubtleCrypto=lr.getBrowerCrypto=void 0;function t(){return ht?.crypto||ht?.msCrypto||{}}lr.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}lr.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return lr.isBrowserCryptoAvailable=r,lr}var hr={},Jh;function Ym(){if(Jh)return hr;Jh=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.isBrowser=hr.isNode=hr.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}hr.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}hr.isNode=e;function r(){return!t()&&!e()}return hr.isBrowser=r,hr}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Gm;e.__exportStar(Zm(),t),e.__exportStar(Ym(),t)})(Gh);function Jm(){const t=Date.now()*Math.pow(10,3),e=Math.floor(Math.random()*Math.pow(10,3));return t+e}function si(t,e,r){return{id:r||Jm(),jsonrpc:"2.0",method:t,params:e}}function la(t,e){return{id:t,jsonrpc:"2.0",result:e}}function ls(t,e,r){return{id:t,jsonrpc:"2.0",error:Xm(e,r)}}function Xm(t,e){return typeof t>"u"?Vh(Wh):(typeof t=="string"&&(t=Object.assign(Object.assign({},Vh(sa)),{message:t})),typeof e<"u"&&(t.data=e),Im(t.code)&&(t=Dm(t.code)),t)}class Qm{}class ew extends Qm{constructor(){super()}}class Xh extends ew{constructor(e){super()}}const tw="^https?:",rw="^wss?:";function nw(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Qh(t,e){const r=nw(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function eu(t){return Qh(t,tw)}function tu(t){return Qh(t,rw)}function iw(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function ru(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function ha(t){return ru(t)&&"method"in t}function hs(t){return ru(t)&&(ur(t)||Wt(t))}function ur(t){return"result"in t}function Wt(t){return"error"in t}class sw extends Xh{constructor(e){super(e),this.events=new ut.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(si(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=>{Wt(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),hs(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code!==1e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.hasRegisteredEventListeners=!0)}}const nu=10,ow=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),aw=()=>typeof window<"u",cw=ow();class lw{constructor(e){if(this.url=e,this.events=new ut.exports.EventEmitter,this.registering=!1,!tu(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ri(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!tu(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=Gh.isReactNative()?void 0:{rejectUnauthorized:!iw(e)},s=new cw(e,[],i);aw()?s.onerror=o=>{const a=o;n(this.emitError(a.error))}:s.on("error",o=>{n(this.emitError(o))}),s.onopen=()=>{this.onOpen(s),r(s)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?na(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=ls(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Kh(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>nu&&this.events.setMaxListeners(nu)}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 ua={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]",b="[object Error]",m="[object Function]",E="[object GeneratorFunction]",A="[object Map]",N="[object Number]",M="[object Null]",x="[object Object]",D="[object Promise]",y="[object Proxy]",I="[object RegExp]",O="[object Set]",u="[object String]",_="[object Symbol]",H="[object Undefined]",j="[object WeakMap]",q="[object ArrayBuffer]",X="[object DataView]",re="[object Float32Array]",C="[object Float64Array]",$="[object Int8Array]",G="[object Int16Array]",K="[object Int32Array]",W="[object Uint8Array]",z="[object Uint8ClampedArray]",J="[object Uint16Array]",Z="[object Uint32Array]",le=/[\\^$.*+?()[\]{}|]/g,ee=/^\[object .+?Constructor\]$/,pe=/^(?:0|[1-9]\d*)$/,ae={};ae[re]=ae[C]=ae[$]=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[b]=ae[m]=ae[A]=ae[N]=ae[x]=ae[I]=ae[O]=ae[u]=ae[j]=!1;var Ce=typeof ht=="object"&&ht&&ht.Object===Object&&ht,B=typeof self=="object"&&self&&self.Object===Object&&self,F=Ce||B||Function("return this")(),R=e&&!e.nodeType&&e,f=R&&!0&&t&&!t.nodeType&&t,P=f&&f.exports===R,te=P&&Ce.process,ie=function(){try{return te&&te.binding&&te.binding("util")}catch{}}(),Ee=ie&&ie.isTypedArray;function Le(S,L){for(var Y=-1,ce=S==null?0:S.length,We=0,Ie=[];++Y<ce;){var Qe=S[Y];L(Qe,Y,S)&&(Ie[We++]=Qe)}return Ie}function $e(S,L){for(var Y=-1,ce=L.length,We=S.length;++Y<ce;)S[We+Y]=L[Y];return S}function Me(S,L){for(var Y=-1,ce=S==null?0:S.length;++Y<ce;)if(L(S[Y],Y,S))return!0;return!1}function Ze(S,L){for(var Y=-1,ce=Array(S);++Y<S;)ce[Y]=L(Y);return ce}function Ke(S){return function(L){return S(L)}}function Pe(S,L){return S.has(L)}function De(S,L){return S?.[L]}function me(S){var L=-1,Y=Array(S.size);return S.forEach(function(ce,We){Y[++L]=[We,ce]}),Y}function Se(S,L){return function(Y){return S(L(Y))}}function Oe(S){var L=-1,Y=Array(S.size);return S.forEach(function(ce){Y[++L]=ce}),Y}var ge=Array.prototype,xe=Function.prototype,g=Object.prototype,h=F["__core-js_shared__"],d=xe.toString,v=g.hasOwnProperty,T=function(){var S=/[^.]+$/.exec(h&&h.keys&&h.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),U=g.toString,k=RegExp("^"+d.call(v).replace(le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=P?F.Buffer:void 0,ue=F.Symbol,Ne=F.Uint8Array,Fe=g.propertyIsEnumerable,Re=ge.splice,Ht=ue?ue.toStringTag:void 0,tn=Object.getOwnPropertySymbols,ki=oe?oe.isBuffer:void 0,to=Se(Object.keys,Object),rt=Tn(F,"DataView"),Je=Tn(F,"Map"),nt=Tn(F,"Promise"),it=Tn(F,"Set"),st=Tn(F,"WeakMap"),Xe=Tn(Object,"create"),gt=nn(rt),mt=nn(Je),wt=nn(nt),bt=nn(it),yt=nn(st),lt=ue?ue.prototype:void 0,ot=lt?lt.valueOf:void 0;function Ge(S){var L=-1,Y=S==null?0:S.length;for(this.clear();++L<Y;){var ce=S[L];this.set(ce[0],ce[1])}}function vt(){this.__data__=Xe?Xe(null):{},this.size=0}function _t(S){var L=this.has(S)&&delete this.__data__[S];return this.size-=L?1:0,L}function W_(S){var L=this.__data__;if(Xe){var Y=L[S];return Y===n?void 0:Y}return v.call(L,S)?L[S]:void 0}function q_(S){var L=this.__data__;return Xe?L[S]!==void 0:v.call(L,S)}function V_(S,L){var Y=this.__data__;return this.size+=this.has(S)?0:1,Y[S]=Xe&&L===void 0?n:L,this}Ge.prototype.clear=vt,Ge.prototype.delete=_t,Ge.prototype.get=W_,Ge.prototype.has=q_,Ge.prototype.set=V_;function fr(S){var L=-1,Y=S==null?0:S.length;for(this.clear();++L<Y;){var ce=S[L];this.set(ce[0],ce[1])}}function K_(){this.__data__=[],this.size=0}function G_(S){var L=this.__data__,Y=no(L,S);if(Y<0)return!1;var ce=L.length-1;return Y==ce?L.pop():Re.call(L,Y,1),--this.size,!0}function Z_(S){var L=this.__data__,Y=no(L,S);return Y<0?void 0:L[Y][1]}function Y_(S){return no(this.__data__,S)>-1}function J_(S,L){var Y=this.__data__,ce=no(Y,S);return ce<0?(++this.size,Y.push([S,L])):Y[ce][1]=L,this}fr.prototype.clear=K_,fr.prototype.delete=G_,fr.prototype.get=Z_,fr.prototype.has=Y_,fr.prototype.set=J_;function rn(S){var L=-1,Y=S==null?0:S.length;for(this.clear();++L<Y;){var ce=S[L];this.set(ce[0],ce[1])}}function X_(){this.size=0,this.__data__={hash:new Ge,map:new(Je||fr),string:new Ge}}function Q_(S){var L=io(this,S).delete(S);return this.size-=L?1:0,L}function e7(S){return io(this,S).get(S)}function t7(S){return io(this,S).has(S)}function r7(S,L){var Y=io(this,S),ce=Y.size;return Y.set(S,L),this.size+=Y.size==ce?0:1,this}rn.prototype.clear=X_,rn.prototype.delete=Q_,rn.prototype.get=e7,rn.prototype.has=t7,rn.prototype.set=r7;function ro(S){var L=-1,Y=S==null?0:S.length;for(this.__data__=new rn;++L<Y;)this.add(S[L])}function n7(S){return this.__data__.set(S,n),this}function i7(S){return this.__data__.has(S)}ro.prototype.add=ro.prototype.push=n7,ro.prototype.has=i7;function Ir(S){var L=this.__data__=new fr(S);this.size=L.size}function s7(){this.__data__=new fr,this.size=0}function o7(S){var L=this.__data__,Y=L.delete(S);return this.size=L.size,Y}function a7(S){return this.__data__.get(S)}function c7(S){return this.__data__.has(S)}function l7(S,L){var Y=this.__data__;if(Y instanceof fr){var ce=Y.__data__;if(!Je||ce.length<r-1)return ce.push([S,L]),this.size=++Y.size,this;Y=this.__data__=new rn(ce)}return Y.set(S,L),this.size=Y.size,this}Ir.prototype.clear=s7,Ir.prototype.delete=o7,Ir.prototype.get=a7,Ir.prototype.has=c7,Ir.prototype.set=l7;function h7(S,L){var Y=so(S),ce=!Y&&S7(S),We=!Y&&!ce&&Fc(S),Ie=!Y&&!ce&&!We&&Bd(S),Qe=Y||ce||We||Ie,Et=Qe?Ze(S.length,String):[],St=Et.length;for(var Ye in S)(L||v.call(S,Ye))&&!(Qe&&(Ye=="length"||We&&(Ye=="offset"||Ye=="parent")||Ie&&(Ye=="buffer"||Ye=="byteLength"||Ye=="byteOffset")||v7(Ye,St)))&&Et.push(Ye);return Et}function no(S,L){for(var Y=S.length;Y--;)if(Ld(S[Y][0],L))return Y;return-1}function u7(S,L,Y){var ce=L(S);return so(S)?ce:$e(ce,Y(S))}function Hi(S){return S==null?S===void 0?H:M:Ht&&Ht in Object(S)?b7(S):C7(S)}function Pd(S){return zi(S)&&Hi(S)==a}function Td(S,L,Y,ce,We){return S===L?!0:S==null||L==null||!zi(S)&&!zi(L)?S!==S&&L!==L:d7(S,L,Y,ce,Td,We)}function d7(S,L,Y,ce,We,Ie){var Qe=so(S),Et=so(L),St=Qe?c:Dr(S),Ye=Et?c:Dr(L);St=St==a?x:St,Ye=Ye==a?x:Ye;var zt=St==x,Xt=Ye==x,Dt=St==Ye;if(Dt&&Fc(S)){if(!Fc(L))return!1;Qe=!0,zt=!1}if(Dt&&!zt)return Ie||(Ie=new Ir),Qe||Bd(S)?Nd(S,L,Y,ce,We,Ie):m7(S,L,St,Y,ce,We,Ie);if(!(Y&i)){var Zt=zt&&v.call(S,"__wrapped__"),Yt=Xt&&v.call(L,"__wrapped__");if(Zt||Yt){var Or=Zt?S.value():S,pr=Yt?L.value():L;return Ie||(Ie=new Ir),We(Or,pr,Y,ce,Ie)}}return Dt?(Ie||(Ie=new Ir),w7(S,L,Y,ce,We,Ie)):!1}function f7(S){if(!Fd(S)||E7(S))return!1;var L=Md(S)?k:ee;return L.test(nn(S))}function p7(S){return zi(S)&&Ud(S.length)&&!!ae[Hi(S)]}function g7(S){if(!x7(S))return to(S);var L=[];for(var Y in Object(S))v.call(S,Y)&&Y!="constructor"&&L.push(Y);return L}function Nd(S,L,Y,ce,We,Ie){var Qe=Y&i,Et=S.length,St=L.length;if(Et!=St&&!(Qe&&St>Et))return!1;var Ye=Ie.get(S);if(Ye&&Ie.get(L))return Ye==L;var zt=-1,Xt=!0,Dt=Y&s?new ro:void 0;for(Ie.set(S,L),Ie.set(L,S);++zt<Et;){var Zt=S[zt],Yt=L[zt];if(ce)var Or=Qe?ce(Yt,Zt,zt,L,S,Ie):ce(Zt,Yt,zt,S,L,Ie);if(Or!==void 0){if(Or)continue;Xt=!1;break}if(Dt){if(!Me(L,function(pr,sn){if(!Pe(Dt,sn)&&(Zt===pr||We(Zt,pr,Y,ce,Ie)))return Dt.push(sn)})){Xt=!1;break}}else if(!(Zt===Yt||We(Zt,Yt,Y,ce,Ie))){Xt=!1;break}}return Ie.delete(S),Ie.delete(L),Xt}function m7(S,L,Y,ce,We,Ie,Qe){switch(Y){case X:if(S.byteLength!=L.byteLength||S.byteOffset!=L.byteOffset)return!1;S=S.buffer,L=L.buffer;case q:return!(S.byteLength!=L.byteLength||!Ie(new Ne(S),new Ne(L)));case p:case w:case N:return Ld(+S,+L);case b:return S.name==L.name&&S.message==L.message;case I:case u:return S==L+"";case A:var Et=me;case O:var St=ce&i;if(Et||(Et=Oe),S.size!=L.size&&!St)return!1;var Ye=Qe.get(S);if(Ye)return Ye==L;ce|=s,Qe.set(S,L);var zt=Nd(Et(S),Et(L),ce,We,Ie,Qe);return Qe.delete(S),zt;case _:if(ot)return ot.call(S)==ot.call(L)}return!1}function w7(S,L,Y,ce,We,Ie){var Qe=Y&i,Et=Rd(S),St=Et.length,Ye=Rd(L),zt=Ye.length;if(St!=zt&&!Qe)return!1;for(var Xt=St;Xt--;){var Dt=Et[Xt];if(!(Qe?Dt in L:v.call(L,Dt)))return!1}var Zt=Ie.get(S);if(Zt&&Ie.get(L))return Zt==L;var Yt=!0;Ie.set(S,L),Ie.set(L,S);for(var Or=Qe;++Xt<St;){Dt=Et[Xt];var pr=S[Dt],sn=L[Dt];if(ce)var jd=Qe?ce(sn,pr,Dt,L,S,Ie):ce(pr,sn,Dt,S,L,Ie);if(!(jd===void 0?pr===sn||We(pr,sn,Y,ce,Ie):jd)){Yt=!1;break}Or||(Or=Dt=="constructor")}if(Yt&&!Or){var oo=S.constructor,ao=L.constructor;oo!=ao&&"constructor"in S&&"constructor"in L&&!(typeof oo=="function"&&oo instanceof oo&&typeof ao=="function"&&ao instanceof ao)&&(Yt=!1)}return Ie.delete(S),Ie.delete(L),Yt}function Rd(S){return u7(S,O7,y7)}function io(S,L){var Y=S.__data__;return _7(L)?Y[typeof L=="string"?"string":"hash"]:Y.map}function Tn(S,L){var Y=De(S,L);return f7(Y)?Y:void 0}function b7(S){var L=v.call(S,Ht),Y=S[Ht];try{S[Ht]=void 0;var ce=!0}catch{}var We=U.call(S);return ce&&(L?S[Ht]=Y:delete S[Ht]),We}var y7=tn?function(S){return S==null?[]:(S=Object(S),Le(tn(S),function(L){return Fe.call(S,L)}))}:A7,Dr=Hi;(rt&&Dr(new rt(new ArrayBuffer(1)))!=X||Je&&Dr(new Je)!=A||nt&&Dr(nt.resolve())!=D||it&&Dr(new it)!=O||st&&Dr(new st)!=j)&&(Dr=function(S){var L=Hi(S),Y=L==x?S.constructor:void 0,ce=Y?nn(Y):"";if(ce)switch(ce){case gt:return X;case mt:return A;case wt:return D;case bt:return O;case yt:return j}return L});function v7(S,L){return L=L??o,!!L&&(typeof S=="number"||pe.test(S))&&S>-1&&S%1==0&&S<L}function _7(S){var L=typeof S;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?S!=="__proto__":S===null}function E7(S){return!!T&&T in S}function x7(S){var L=S&&S.constructor,Y=typeof L=="function"&&L.prototype||g;return S===Y}function C7(S){return U.call(S)}function nn(S){if(S!=null){try{return d.call(S)}catch{}try{return S+""}catch{}}return""}function Ld(S,L){return S===L||S!==S&&L!==L}var S7=Pd(function(){return arguments}())?Pd:function(S){return zi(S)&&v.call(S,"callee")&&!Fe.call(S,"callee")},so=Array.isArray;function I7(S){return S!=null&&Ud(S.length)&&!Md(S)}var Fc=ki||$7;function D7(S,L){return Td(S,L)}function Md(S){if(!Fd(S))return!1;var L=Hi(S);return L==m||L==E||L==l||L==y}function Ud(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=o}function Fd(S){var L=typeof S;return S!=null&&(L=="object"||L=="function")}function zi(S){return S!=null&&typeof S=="object"}var Bd=Ee?Ke(Ee):p7;function O7(S){return I7(S)?h7(S):g7(S)}function A7(){return[]}function $7(){return!1}t.exports=D7})(ua,ua.exports);var hw=ua.exports,uw=Object.defineProperty,iu=Object.getOwnPropertySymbols,dw=Object.prototype.hasOwnProperty,fw=Object.prototype.propertyIsEnumerable,su=(t,e,r)=>e in t?uw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$t=(t,e)=>{for(var r in e||(e={}))dw.call(e,r)&&su(t,r,e[r]);if(iu)for(var r of iu(e))fw.call(e,r)&&su(t,r,e[r]);return t};function pw(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 A=0,N=0,M=0,x=E.length;M!==x&&E[M]===0;)M++,A++;for(var D=(x-M)*p+1>>>0,y=new Uint8Array(D);M!==x;){for(var I=E[M],O=0,u=D-1;(I!==0||O<N)&&u!==-1;u--,O++)I+=256*y[u]>>>0,y[u]=I%a>>>0,I=I/a>>>0;if(I!==0)throw new Error("Non-zero carry");N=O,M++}for(var _=D-N;_!==D&&y[_]===0;)_++;for(var H=c.repeat(A);_<D;++_)H+=t.charAt(y[_]);return H}function b(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return new Uint8Array;var A=0;if(E[A]!==" "){for(var N=0,M=0;E[A]===c;)N++,A++;for(var x=(E.length-A)*l+1>>>0,D=new Uint8Array(x);E[A];){var y=r[E.charCodeAt(A)];if(y===255)return;for(var I=0,O=x-1;(y!==0||I<M)&&O!==-1;O--,I++)y+=a*D[O]>>>0,D[O]=y%256>>>0,y=y/256>>>0;if(y!==0)throw new Error("Non-zero carry");M=I,A++}if(E[A]!==" "){for(var u=x-M;u!==x&&D[u]===0;)u++;for(var _=new Uint8Array(N+(x-u)),H=N;u!==x;)_[H++]=D[u++];return _}}}function m(E){var A=b(E);if(A)return A;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:b,decode:m}}var gw=pw,mw=gw;const ou=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")},ww=t=>new TextEncoder().encode(t),bw=t=>new TextDecoder().decode(t);class yw{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 vw{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 au(this,e)}}class _w{constructor(e){this.decoders=e}or(e){return au(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 au=(t,e)=>new _w($t($t({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class Ew{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new yw(e,r,n),this.decoder=new vw(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const us=({name:t,prefix:e,encode:r,decode:n})=>new Ew(t,e,r,n),oi=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=mw(r,e);return us({prefix:t,name:e,encode:n,decode:s=>ou(i(s))})},xw=(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},Cw=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},Ct=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>us({prefix:e,name:t,encode(i){return Cw(i,n,r)},decode(i){return xw(i,n,r,t)}}),Sw=us({prefix:"\0",name:"identity",encode:t=>bw(t),decode:t=>ww(t)});var Iw=Object.freeze({__proto__:null,identity:Sw});const Dw=Ct({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ow=Object.freeze({__proto__:null,base2:Dw});const Aw=Ct({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var $w=Object.freeze({__proto__:null,base8:Aw});const Pw=oi({prefix:"9",name:"base10",alphabet:"0123456789"});var Tw=Object.freeze({__proto__:null,base10:Pw});const Nw=Ct({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Rw=Ct({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Lw=Object.freeze({__proto__:null,base16:Nw,base16upper:Rw});const Mw=Ct({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Uw=Ct({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Fw=Ct({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Bw=Ct({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),jw=Ct({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),kw=Ct({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Hw=Ct({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),zw=Ct({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Ww=Ct({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var qw=Object.freeze({__proto__:null,base32:Mw,base32upper:Uw,base32pad:Fw,base32padupper:Bw,base32hex:jw,base32hexupper:kw,base32hexpad:Hw,base32hexpadupper:zw,base32z:Ww});const Vw=oi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Kw=oi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Gw=Object.freeze({__proto__:null,base36:Vw,base36upper:Kw});const Zw=oi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Yw=oi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Jw=Object.freeze({__proto__:null,base58btc:Zw,base58flickr:Yw});const Xw=Ct({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Qw=Ct({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),e5=Ct({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),t5=Ct({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var r5=Object.freeze({__proto__:null,base64:Xw,base64pad:Qw,base64url:e5,base64urlpad:t5});const cu=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}"),n5=cu.reduce((t,e,r)=>(t[r]=e,t),[]),i5=cu.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function s5(t){return t.reduce((e,r)=>(e+=n5[r],e),"")}function o5(t){const e=[];for(const r of t){const n=i5[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const a5=us({prefix:"\u{1F680}",name:"base256emoji",encode:s5,decode:o5});var c5=Object.freeze({__proto__:null,base256emoji:a5}),l5=hu,lu=128,h5=127,u5=~h5,d5=Math.pow(2,31);function hu(t,e,r){e=e||[],r=r||0;for(var n=r;t>=d5;)e[r++]=t&255|lu,t/=128;for(;t&u5;)e[r++]=t&255|lu,t>>>=7;return e[r]=t|0,hu.bytes=r-n+1,e}var f5=da,p5=128,uu=127;function da(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw da.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&uu)<<i:(o&uu)*Math.pow(2,i),i+=7}while(o>=p5);return da.bytes=s-n,r}var g5=Math.pow(2,7),m5=Math.pow(2,14),w5=Math.pow(2,21),b5=Math.pow(2,28),y5=Math.pow(2,35),v5=Math.pow(2,42),_5=Math.pow(2,49),E5=Math.pow(2,56),x5=Math.pow(2,63),C5=function(t){return t<g5?1:t<m5?2:t<w5?3:t<b5?4:t<y5?5:t<v5?6:t<_5?7:t<E5?8:t<x5?9:10},S5={encode:l5,decode:f5,encodingLength:C5},du=S5;const fu=(t,e,r=0)=>(du.encode(t,e,r),e),pu=t=>du.encodingLength(t),fa=(t,e)=>{const r=e.byteLength,n=pu(t),i=n+pu(r),s=new Uint8Array(i+r);return fu(t,s,0),fu(r,s,n),s.set(e,i),new I5(t,r,e,s)};class I5{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const gu=({name:t,code:e,encode:r})=>new D5(t,e,r);class D5{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?fa(this.code,r):r.then(n=>fa(this.code,n))}else throw Error("Unknown type, must be binary type")}}const mu=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),O5=gu({name:"sha2-256",code:18,encode:mu("SHA-256")}),A5=gu({name:"sha2-512",code:19,encode:mu("SHA-512")});var $5=Object.freeze({__proto__:null,sha256:O5,sha512:A5});const wu=0,P5="identity",bu=ou;var T5=Object.freeze({__proto__:null,identity:{code:wu,name:P5,encode:bu,digest:t=>fa(wu,bu(t))}});new TextEncoder,new TextDecoder;const yu=$t($t($t($t($t($t($t($t($t($t({},Iw),Ow),$w),Tw),Lw),qw),Gw),Jw),r5),c5);$t($t({},$5),T5);function N5(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function vu(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const _u=vu("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),pa=vu("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=N5(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),R5=$t({utf8:_u,"utf-8":_u,hex:yu.base16,latin1:pa,ascii:pa,binary:pa},yu);function L5(t,e="utf8"){const r=R5[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 Eu="wc",M5=2,ga="core",yr=`${Eu}@${2}:${ga}:`,U5={name:ga,logger:"error"},F5={database:":memory:"},B5="crypto",xu="client_ed25519_seed",j5=de.ONE_DAY,k5="keychain",H5="0.3",z5="messages",W5="0.3",q5=de.SIX_HOURS,V5="publisher",Cu="irn",K5="error",Su="wss://relay.walletconnect.com",G5="relayer",ft={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"},Z5="_subscription",ds={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},Iu=de.ONE_SECOND,Y5="2.4.6-793c2c4b",J5="0.3",rr={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},X5="subscription",Q5="0.3",eb=de.FIVE_SECONDS*1e3,tb="pairing",rb="0.3",ai={wc_pairingDelete:{req:{ttl:de.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:de.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:de.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:de.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:de.ONE_DAY,prompt:!1,tag:0},res:{ttl:de.ONE_DAY,prompt:!1,tag:0}}},nr={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},nb="history",ib="0.3",sb="expirer",qt={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},ob="0.3";class ab{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=k5,this.version=H5,this.initialized=!1,this.storagePrefix=yr,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,sh(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?oh(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 cb{constructor(e,r,n){this.core=e,this.logger=r,this.name=B5,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=zh(i);return Hh(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=ug();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=zh(s),a=Mo();return await vm(a,i,j5,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=dg(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||Xl(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=Ql(o),c=ri(s);if(eh(a)){const b=a.senderPublicKey,m=a.receiverPublicKey;i=await this.generateSharedKey(b,m)}const l=this.getSymKey(i),{type:p,senderPublicKey:w}=a;return pg({type:p,symKey:l,message:c,senderPublicKey:w})},this.decode=async(i,s,o)=>{this.isInitialized();const a=wg(s,o);if(eh(a)){const p=a.receiverPublicKey,w=a.senderPublicKey;i=await this.generateSharedKey(p,w)}const c=this.getSymKey(i),l=gg({symKey:c,encoded:s});return na(l)},this.core=e,this.logger=je.generateChildLogger(r,this.name),this.keychain=n||new ab(this.core,this.logger)}get context(){return je.getLoggerContext(this.logger)}getPayloadType(e){const r=Uo(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(xu)}catch{e=Mo(),await this.keychain.set(xu,e)}return L5(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 lb extends Q3{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=z5,this.version=W5,this.initialized=!1,this.storagePrefix=yr,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=ts(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=ts(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,sh(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?oh(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 hb extends em{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new ut.exports.EventEmitter,this.name=V5,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||q5,a=Bo(s),c=s?.prompt||!1,l=s?.tag||0,p={topic:n,message:i,opts:{ttl:o,relay:a,prompt:c,tag:l}},w=ts(i);this.queue.set(w,p);try{await await Fo(this.rpcPublish(n,i,o,a,c,l),this.publishTimeout),this.relayer.events.emit(ft.publish,p)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(ft.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:rs(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o}};return Ot((a=w.params)==null?void 0:a.prompt)&&((c=w.params)==null||delete c.prompt),Ot((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(Jn.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()})}}class ub{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 db=Object.defineProperty,fb=Object.defineProperties,pb=Object.getOwnPropertyDescriptors,Du=Object.getOwnPropertySymbols,gb=Object.prototype.hasOwnProperty,mb=Object.prototype.propertyIsEnumerable,Ou=(t,e,r)=>e in t?db(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ci=(t,e)=>{for(var r in e||(e={}))gb.call(e,r)&&Ou(t,r,e[r]);if(Du)for(var r of Du(e))mb.call(e,r)&&Ou(t,r,e[r]);return t},ma=(t,e)=>fb(t,pb(e));class wb extends nm{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new ub,this.events=new ut.exports.EventEmitter,this.name=X5,this.version=Q5,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=yr,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=Bo(i),o={topic:n,relay:s};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s);return this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,s)=>{const o=new de.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)>=eb&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),s(!1))},this.pollingInterval)}),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=je.generateChildLogger(r,this.name),this.clientId=""}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=Bo(n);await this.rpcUnsubscribe(e,r,i);const s=tt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:rs(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Fo(this.relayer.provider.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(ft.connection_stalled)}return ts(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:rs(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Fo(this.relayer.provider.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(ft.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:rs(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,ma(ci({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,ci({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,ci({},r)),this.topicMap.set(r.topic,e),this.events.emit(rr.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(rr.deleted,ma(ci({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(rr.sync)}async reset(){if(!this.cached.length)return;const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}this.events.emit(rr.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),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);this.onBatchSubscribe(r.map((n,i)=>ma(ci({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Jn.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(ft.connect,async()=>{await this.onConnect()}),this.relayer.on(ft.disconnect,()=>{this.onDisconnect()}),this.events.on(rr.created,async e=>{const r=rr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(rr.deleted,async e=>{const r=rr.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)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var bb=Object.defineProperty,Au=Object.getOwnPropertySymbols,yb=Object.prototype.hasOwnProperty,vb=Object.prototype.propertyIsEnumerable,$u=(t,e,r)=>e in t?bb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_b=(t,e)=>{for(var r in e||(e={}))yb.call(e,r)&&$u(t,r,e[r]);if(Au)for(var r of Au(e))vb.call(e,r)&&$u(t,r,e[r]);return t};class Eb extends tm{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new ut.exports.EventEmitter,this.name=G5,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?je.generateChildLogger(e.logger,this.name):zn(je.getDefaultLoggerOptions({level:e.logger||K5})),this.messages=new lb(this.logger,e.core),this.subscriber=new wb(this,this.logger),this.publisher=new hb(this,this.logger),this.relayUrl=e?.relayUrl||Su,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,publishedAt:Date.now()})}async subscribe(e,r){this.isInitialized();let n="";return await Promise.all([new Promise(i=>{this.subscriber.once(rr.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(ft.transport_closed))}async transportOpen(e){if(!this.reconnecting){this.relayUrl=e||this.relayUrl,this.transportExplicitlyClosed=!1,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(rr.resubscribed,()=>{r()})}),await Promise.race([new Promise(async r=>{await this.provider.connect(),this.removeListener(ft.transport_closed,this.rejectTransportOpen),r()}),new Promise(r=>this.once(ft.transport_closed,this.rejectTransportOpen))])])}catch(r){const n=r;if(!/socket hang up/i.test(n.message))throw r;this.logger.error(r),this.events.emit(ft.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||(await this.transportClose(),await new Promise(r=>setTimeout(r,Iu)),await this.transportOpen(e))}rejectTransportOpen(){throw new Error("closeTransport called before connection was established")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);return new sw(new lw(Pg({sdkVersion:Y5,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0})))}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;return await this.subscriber.isSubscribed(r)?this.messages.has(r,n):!0}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),ha(e)){if(!e.method.endsWith(Z5))return;const r=e.params,{topic:n,message:i,publishedAt:s}=r.data,o={topic:n,message:i,publishedAt:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(_b({type:"event",event:r.id},o)),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(ft.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=la(e.id,!0);await this.provider.connection.send(r)}registerEventListeners(){this.provider.on(ds.payload,e=>this.onProviderPayload(e)),this.provider.on(ds.connect,()=>{this.events.emit(ft.connect)}),this.provider.on(ds.disconnect,()=>{this.events.emit(ft.disconnect),this.attemptToReconnect()}),this.provider.on(ds.error,e=>this.events.emit(ft.error,e)),this.events.on(ft.connection_stalled,async()=>{await this.restartTransport()})}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.transportOpen()},de.toMiliseconds(Iu))}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var xb=Object.defineProperty,Pu=Object.getOwnPropertySymbols,Cb=Object.prototype.hasOwnProperty,Sb=Object.prototype.propertyIsEnumerable,Tu=(t,e,r)=>e in t?xb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nu=(t,e)=>{for(var r in e||(e={}))Cb.call(e,r)&&Tu(t,r,e[r]);if(Pu)for(var r of Pu(e))Sb.call(e,r)&&Tu(t,r,e[r]);return t};class fs extends rm{constructor(e,r,n,i=yr,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=J5,this.cached=[],this.initialized=!1,this.storagePrefix=yr,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{Xg(o)?this.map.set(o.id,o):Qg(o)?this.map.set(o.topic,o):this.getKey&&o!==null&&!Ot(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=>hw(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=Nu(Nu({},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 Ib{constructor(e,r){this.core=e,this.logger=r,this.name=tb,this.version=rb,this.events=new ut.exports,this.initialized=!1,this.storagePrefix=yr,this.ignoredPayloadTypes=[Nr],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=Mo(),i=await this.core.crypto.setSymKey(n),s=er(de.FIVE_MINUTES),o={protocol:Cu},a={topic:i,expiry:s,relay:o,active:!1},c=Hg({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}=jg(n.uri),a=er(de.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=er(de.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}=Rr();this.events.once(et("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",tt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const o=si(i,s),a=await this.core.crypto.encode(n,o),c=ai[i].req;return this.core.history.set(n,o),await this.core.relayer.publish(n,a,c),o.id},this.sendResult=async(n,i,s)=>{const o=la(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=ai[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=ls(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=ai[c.request.method]?ai[c.request.method].res:ai.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,tt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>wr(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(()=>{ur(i)?this.events.emit(et("pairing_ping",s),{}):Wt(i)&&this.events.emit(et("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=tt("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(tt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!Rt(n)){const{message:i}=se("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Jg(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(!dt(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(wr(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 fs(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(ft.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);ha(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):hs(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(qt.expired,async e=>{const{topic:r}=ch(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class Db extends X3{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new ut.exports.EventEmitter,this.name=nb,this.version=ib,this.cached=[],this.initialized=!1,this.storagePrefix=yr,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(nr.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=Wt(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(nr.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(nr.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:si(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(nr.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(nr.created,e=>{const r=nr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(nr.updated,e=>{const r=nr.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(nr.deleted,e=>{const r=nr.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 Ob extends im{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new ut.exports.EventEmitter,this.name=sb,this.version=ob,this.cached=[],this.initialized=!1,this.storagePrefix=yr,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(qt.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(qt.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 Tg(e);if(typeof e=="number")return Ng(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(qt.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;de.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(qt.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Jn.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(qt.created,e=>{const r=qt.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(qt.expired,e=>{const r=qt.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(qt.deleted,e=>{const r=qt.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 Ab=Object.defineProperty,Ru=Object.getOwnPropertySymbols,$b=Object.prototype.hasOwnProperty,Pb=Object.prototype.propertyIsEnumerable,Lu=(t,e,r)=>e in t?Ab(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Mu=(t,e)=>{for(var r in e||(e={}))$b.call(e,r)&&Lu(t,r,e[r]);if(Ru)for(var r of Ru(e))Pb.call(e,r)&&Lu(t,r,e[r]);return t};class wa extends J3{constructor(e){super(e),this.protocol=Eu,this.version=M5,this.name=ga,this.events=new ut.exports.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||Su;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:zn(je.getDefaultLoggerOptions({level:e?.logger||U5.logger}));this.logger=je.generateChildLogger(r,this.name),this.heartbeat=new Jn.HeartBeat,this.crypto=new cb(this,this.logger,e?.keychain),this.history=new Db(this,this.logger),this.expirer=new Ob(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new n3(Mu(Mu({},F5),e?.storageOptions)),this.relayer=new Eb({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Ib(this,this.logger)}static async init(e){const r=new wa(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 Tb=wa,Uu="wc",Fu=2,Bu="client",ba=`${Uu}@${Fu}:${Bu}:`,ya={name:Bu,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Nb="proposal",ju="Proposal expired",Rb="session",ps=de.SEVEN_DAYS,Lb="engine",li={wc_sessionPropose:{req:{ttl:de.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:de.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:de.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:de.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:de.ONE_DAY,prompt:!1,tag:1104},res:{ttl:de.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:de.ONE_DAY,prompt:!1,tag:1106},res:{ttl:de.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:de.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:de.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:de.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:de.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:de.ONE_DAY,prompt:!1,tag:1112},res:{ttl:de.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:de.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:de.THIRTY_SECONDS,prompt:!1,tag:1115}}},va={min:de.FIVE_MINUTES,max:de.SEVEN_DAYS},Mb="request";var Ub=Object.defineProperty,Fb=Object.defineProperties,Bb=Object.getOwnPropertyDescriptors,ku=Object.getOwnPropertySymbols,jb=Object.prototype.hasOwnProperty,kb=Object.prototype.propertyIsEnumerable,Hu=(t,e,r)=>e in t?Ub(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vt=(t,e)=>{for(var r in e||(e={}))jb.call(e,r)&&Hu(t,r,e[r]);if(ku)for(var r of ku(e))kb.call(e,r)&&Hu(t,r,e[r]);return t},_a=(t,e)=>Fb(t,Bb(e));class Hb extends om{constructor(e){super(e),this.name=Lb,this.events=new ut.exports,this.initialized=!1,this.ignoredPayloadTypes=[Nr],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(li)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized();const n=_a(Vt({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:c}=n;let l=i,p,w=!1;if(l&&(w=this.client.core.pairing.pairings.get(l).active),!l||!w){const{topic:D,uri:y}=await this.client.core.pairing.create();l=D,p=y}const b=await this.client.core.crypto.generateKeyPair(),m=Vt({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:Cu}],proposer:{publicKey:b,metadata:this.client.metadata}},a&&{sessionProperties:a}),{reject:E,resolve:A,done:N}=Rr(de.FIVE_MINUTES,ju);if(this.events.once(et("session_connect"),async({error:D,session:y})=>{if(D)E(D);else if(y){y.self.publicKey=b;const I=_a(Vt({},y),{requiredNamespaces:y.requiredNamespaces,optionalNamespaces:y.optionalNamespaces});await this.client.session.set(y.topic,I),await this.setExpiry(y.topic,y.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:y.peer.metadata}),A(I)}}),!l){const{message:D}=se("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(D)}const M=await this.sendRequest(l,"wc_sessionPropose",m),x=er(de.FIVE_MINUTES);return await this.setProposal(M,Vt({id:M,expiry:x},m)),{uri:p,approval:N}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:s,sessionProperties:o}=r,a=this.client.proposal.get(n);let{pairingTopic:c,proposer:l,requiredNamespaces:p,optionalNamespaces:w}=a;Hn(p)||(p=Vg(s,"approve()"));const b=await this.client.core.crypto.generateKeyPair(),m=l.publicKey,E=await this.client.core.crypto.generateSharedKey(b,m);c&&n&&(await this.client.core.pairing.updateMetadata({topic:c,metadata:l.metadata}),await this.sendResult(n,c,{relay:{protocol:i??"irn"},responderPublicKey:b}),await this.client.proposal.delete(n,tt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:c}));const A=Vt({relay:{protocol:i??"irn"},namespaces:s,requiredNamespaces:p,optionalNamespaces:w,controller:{publicKey:b,metadata:this.client.metadata},expiry:er(ps)},o&&{sessionProperties:o});await this.client.core.relayer.subscribe(E);const N=await this.sendRequest(E,"wc_sessionSettle",A),{done:M,resolve:x,reject:D}=Rr();this.events.once(et("session_approve",N),({error:I})=>{I?D(I):x(this.client.session.get(E))});const y=_a(Vt({},A),{topic:E,acknowledged:!1,self:A.controller,peer:{publicKey:l.publicKey,metadata:l.metadata},controller:b});return await this.client.session.set(E,y),await this.setExpiry(E,er(ps)),{topic:E,acknowledged:M}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:s}=this.client.proposal.get(n);s&&(await this.sendError(n,s,i),await this.client.proposal.delete(n,tt("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,s=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:o,resolve:a,reject:c}=Rr();return this.events.once(et("session_update",s),({error:l})=>{l?c(l):a()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:o}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:s,resolve:o,reject:a}=Rr();return this.events.once(et("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,er(ps)),{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}=Rr(o);return this.events.once(et("session_request",a),({error:w,result:b})=>{w?p(w):l(b)}),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n}),await c()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i;ur(i)?await this.sendResult(s,n,i.result):Wt(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}=Rr();this.events.once(et("session_ping",i),({error:c})=>{c?a(c):o()}),await s()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:s})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest(n,"wc_sessionDelete",tt("USER_DISCONNECTED")),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Zg(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await Promise.all([this.client.session.delete(r,tt("USER_DISCONNECTED")),this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.deleteSymKey(r),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,tt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=li.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,er(n))},this.sendRequest=async(r,n,i,s)=>{const o=si(n,i),a=await this.client.core.crypto.encode(r,o),c=li[n].req;return s&&(c.ttl=s),this.client.core.history.set(r,o),this.client.core.relayer.publish(r,a,c),o.id},this.sendResult=async(r,n,i)=>{const s=la(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=li[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=ls(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=li[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=>{wr(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{wr(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(Vt({},n.params));const o=er(de.FIVE_MINUTES),a=Vt({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(ur(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 Wt(n)&&(await this.client.proposal.delete(i,tt("USER_DISCONNECTED")),this.events.emit(et("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,requiredNamespaces:p,optionalNamespaces:w,sessionProperties:b}=n.params,m=Vt({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,requiredNamespaces:p,optionalNamespaces:w,controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},b&&{sessionProperties:b});await this.sendResult(n.id,r,!0),this.events.emit(et("session_connect"),{session:m})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;ur(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(et("session_approve",i),{})):Wt(n)&&(await this.client.session.delete(r,tt("USER_DISCONNECTED")),this.events.emit(et("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidUpdate(Vt({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;ur(n)?this.events.emit(et("session_update",i),{}):Wt(n)&&this.events.emit(et("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,er(ps)),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;ur(n)?this.events.emit(et("session_extend",i),{}):Wt(n)&&this.events.emit(et("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{ur(n)?this.events.emit(et("session_ping",i),{}):Wt(n)&&this.events.emit(et("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),this.client.core.relayer.once(ft.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(Vt({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;ur(n)?this.events.emit(et("session_request",i),{result:n.result}):Wt(n)&&this.events.emit(et("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidEmit(Vt({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:c}=se("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(Ot(n)||await this.isValidPairingTopic(n),!a2(a,!0)){const{message:c}=se("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!Ot(i)&&Hn(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Ot(s)&&Hn(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Ot(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=o2(r,"connect()",n);if(i)throw new Error(i.message)},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,sessionProperties:o}=r;await this.isValidProposalId(n);const a=this.client.proposal.get(n),c=ns(i,"approve()");if(c)throw new Error(c.message);const l=Ho(a.requiredNamespaces,i,"approve()","requiredNamespaces");if(l)throw new Error(l.message);if(!dt(s,!0)){const{message:p}=se("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(p)}if(Object.keys(i).length>Object.keys(a.requiredNamespaces).length){const p=Object.keys(a.optionalNamespaces).filter(m=>i[m]),w={};for(const m in a.optionalNamespaces)p.includes(m)&&(w[m]=a.optionalNamespaces[m]);const b=Ho(w,i,"approve()","optionalNamespaces");if(b)throw new Error(b.message)}Ot(o)||this.validateSessionProps(o,"sessionProperties")},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),!l2(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(!fh(n)){const{message:l}=se("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=e2(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=ns(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(wr(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=ns(i,"update()");if(o)throw new Error(o.message);const a=Ho(s.requiredNamespaces,i,"update()","requiredNamespaces");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(!ph(a,s)){const{message:c}=se("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!h2(i)){const{message:c}=se("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!f2(a,s,i.method)){const{message:c}=se("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!g2(o,va)){const{message:c}=se("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${va.min} and ${va.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),!u2(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(!ph(o,s)){const{message:a}=se("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!d2(i)){const{message:a}=se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!p2(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)},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!dt(i,!1)){const{message:s}=se("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})}}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(ft.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);ha(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):hs(i)&&(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.client.core.expirer.on(qt.expired,async e=>{const{topic:r,id:n}=ch(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(!dt(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(wr(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=se("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!dt(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(wr(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(dt(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(!c2(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(wr(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=se("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class zb extends fs{constructor(e,r){super(e,r,Nb,ba),this.core=e,this.logger=r}}class Wb extends fs{constructor(e,r){super(e,r,Rb,ba),this.core=e,this.logger=r}}class qb extends fs{constructor(e,r){super(e,r,Mb,ba),this.core=e,this.logger=r}}class Ea extends sm{constructor(e){super(e),this.protocol=Uu,this.version=Fu,this.name=ya.name,this.events=new ut.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||ya.name,this.metadata=e?.metadata||Dg();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:zn(je.getDefaultLoggerOptions({level:e?.logger||ya.logger}));this.core=e?.core||new Tb(e),this.logger=je.generateChildLogger(r,this.name),this.session=new Wb(this.core,this.logger),this.proposal=new zb(this.core,this.logger),this.pendingRequest=new qb(this.core,this.logger),this.engine=new Hb(this)}static async init(e){const r=new Ea(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}}}class gs extends Xh{constructor(e){super(e),this.events=new ut.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(si(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=>{Wt(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),hs(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)}}var xa={exports:{}};(function(t,e){var r=typeof self<"u"?self:ht,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 b(C){return typeof C!="string"&&(C=String(C)),C}function m(C){var $={next:function(){var G=C.shift();return{done:G===void 0,value:G}}};return a.iterable&&($[Symbol.iterator]=function(){return $}),$}function E(C){this.map={},C instanceof E?C.forEach(function($,G){this.append(G,$)},this):Array.isArray(C)?C.forEach(function($){this.append($[0],$[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function($){this.append($,C[$])},this)}E.prototype.append=function(C,$){C=w(C),$=b($);var G=this.map[C];this.map[C]=G?G+", "+$:$},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,$){this.map[w(C)]=b($)},E.prototype.forEach=function(C,$){for(var G in this.map)this.map.hasOwnProperty(G)&&C.call($,this.map[G],G,this)},E.prototype.keys=function(){var C=[];return this.forEach(function($,G){C.push(G)}),m(C)},E.prototype.values=function(){var C=[];return this.forEach(function($){C.push($)}),m(C)},E.prototype.entries=function(){var C=[];return this.forEach(function($,G){C.push([G,$])}),m(C)},a.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function A(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}function N(C){return new Promise(function($,G){C.onload=function(){$(C.result)},C.onerror=function(){G(C.error)}})}function M(C){var $=new FileReader,G=N($);return $.readAsArrayBuffer(C),G}function x(C){var $=new FileReader,G=N($);return $.readAsText(C),G}function D(C){for(var $=new Uint8Array(C),G=new Array($.length),K=0;K<$.length;K++)G[K]=String.fromCharCode($[K]);return G.join("")}function y(C){if(C.slice)return C.slice(0);var $=new Uint8Array(C.byteLength);return $.set(new Uint8Array(C)),$.buffer}function I(){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=y(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(C)||p(C))?this._bodyArrayBuffer=y(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=A(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?A(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(M)}),this.text=function(){var C=A(this);if(C)return C;if(this._bodyBlob)return x(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(D(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(H)}),this.json=function(){return this.text().then(JSON.parse)},this}var O=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function u(C){var $=C.toUpperCase();return O.indexOf($)>-1?$:C}function _(C,$){$=$||{};var G=$.body;if(C instanceof _){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,$.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=$.credentials||this.credentials||"same-origin",($.headers||!this.headers)&&(this.headers=new E($.headers)),this.method=u($.method||this.method||"GET"),this.mode=$.mode||this.mode||null,this.signal=$.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&G)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(G)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})};function H(C){var $=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," ");$.append(decodeURIComponent(W),decodeURIComponent(z))}}),$}function j(C){var $=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();$.append(z,J)}}),$}I.call(_.prototype);function q(C,$){$||($={}),this.type="default",this.status=$.status===void 0?200:$.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in $?$.statusText:"OK",this.headers=new E($.headers),this.url=$.url||"",this._initBody(C)}I.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,$){if(X.indexOf($)===-1)throw new RangeError("Invalid status code");return new q(null,{status:$,headers:{location:C}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function($,G){this.message=$,this.name=G;var K=Error($);this.stack=K.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function re(C,$){return new Promise(function(G,K){var W=new _(C,$);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 le="response"in z?z.response:z.responseText;G(new q(le,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,le){z.setRequestHeader(le,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=_,s.Response=q),o.Headers=E,o.Request=_,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})(xa,xa.exports);var zu=kd(xa.exports);const Wu={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},qu=10;class ms{constructor(e){if(this.url=e,this.events=new ut.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!eu(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=ri(e),s=await(await zu(this.url,Object.assign(Object.assign({},Wu),{body:n}))).json();this.onPayload({data:s})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!eu(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=ri({id:1,jsonrpc:"2.0",method:"test",params:[]});await zu(e,Object.assign(Object.assign({},Wu),{body:r})),this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?na(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=ls(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Kh(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>qu&&this.events.setMaxListeners(qu)}}const Vu="error",Vb="wss://relay.walletconnect.com",Kb="wc",Gb="universal_provider",Ku=`${Kb}@${2}:${Gb}:`,Zb="https://rpc.walletconnect.com/v1",hi={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};function fn(t,e,r){let n;const i=Ca(t);return e.rpcMap&&(n=e.rpcMap[i]),n||(n=`${Zb}?chainId=eip155:${i}&projectId=${r}`),n}function Ca(t){return t.includes("eip155")?Number(t.split(":")[1]):Number(t)}function Yb(t,e){if(!e.includes(t))throw new Error(`Chain '${t}' not approved. Please use one of the following: ${e.toString()}`)}function Jb(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}const ws=(t,e)=>{const r=n=>{n.request!==e.request||n.topic!==e.topic||(t.events.removeListener("session_request_sent",r),Xb())};t.on("session_request_sent",r)};function Xb(){if(typeof window<"u")try{const t=window.localStorage.getItem("WALLETCONNECT_DEEPLINK_CHOICE");if(t){const e=JSON.parse(t);window.open(e.href,"_self","noreferrer noopener")}}catch(t){console.error(t)}}class Qb{constructor(e){this.name="eip155",this.namespace=e.namespace,this.client=e.client,this.events=e.events,this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){var r;switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return this.handleSwitchChain(e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0"),null;case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?(ws(this.client,e),await this.client.request(e)):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){const n=Ca(e);if(!this.httpProviders[n]){const i=r||fn(`${this.name}:${n}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${n}`);this.setHttpProvider(n,i)}this.chainId=n,this.events.emit(hi.DEFAULT_CHAIN_CHANGED,`${this.name}:${n}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||fn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new gs(new ms(n))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=Ca(r);e[n]=this.createHttpProvider(n)}),e}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}handleSwitchChain(e){const r=parseInt(e,16),n=`${this.name}:${r}`;Yb(n,this.namespace.chains),this.setDefaultChain(`${r}`)}}class ey{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?(ws(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||fn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(hi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?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}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||fn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new gs(new ms(n))}}class ty{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(ws(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||fn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(hi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||fn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new gs(new ms(n))}}class ry{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(ws(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(hi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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=>{const n=this.getCardanoRPCUrl(r);e[r]=this.createHttpProvider(r,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new gs(new ms(n))}}var ny=Object.defineProperty,iy=Object.defineProperties,sy=Object.getOwnPropertyDescriptors,Gu=Object.getOwnPropertySymbols,oy=Object.prototype.hasOwnProperty,ay=Object.prototype.propertyIsEnumerable,Zu=(t,e,r)=>e in t?ny(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bs=(t,e)=>{for(var r in e||(e={}))oy.call(e,r)&&Zu(t,r,e[r]);if(Gu)for(var r of Gu(e))ay.call(e,r)&&Zu(t,r,e[r]);return t},Sa=(t,e)=>iy(t,sy(e));class Ia{constructor(e){this.events=new ut.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:zn(je.getDefaultLoggerOptions({level:e?.logger||Vu}))}static async init(e){const r=new Ia(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:bs({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:tt("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s}).catch(s=>{if(s.message!==ju)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(br(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Ea.init({logger:this.providerOpts.logger||Vu,relayUrl:this.providerOpts.relayUrl||Vb,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=>{var r,n,i;const s=((r=this.session)==null?void 0:r.namespaces[e].accounts)||[],o=Jb(s),a=Sa(bs({},Object.assign(this.namespaces[e],(i=(n=this.optionalNamespaces)==null?void 0:n[e])!=null?i:{})),{accounts:s,chains:o});switch(e){case"eip155":this.rpcProviders[e]=new Qb({client:this.client,namespace:a,events:this.events});break;case"solana":this.rpcProviders[e]=new ey({client:this.client,namespace:a,events:this.events});break;case"cosmos":this.rpcProviders[e]=new ty({client:this.client,namespace:a,events:this.events});break;case"polkadot":break;case"cip34":this.rpcProviders[e]=new ry({client:this.client,namespace:a,events:this.events});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?this.events.emit("accountsChanged",n.data):n.name==="chainChanged"?this.onChainChanged(r.chainId):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=Sa(bs({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Sa(bs({},tt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(hi.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;if(!r||!Object.keys(r).length)throw new Error("Namespaces must be not empty");this.namespaces=r,this.optionalNamespaces=n,this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(r&&!Object.keys(this.namespaces).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Object.keys(this.namespaces)[0],s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){const[n,i]=this.validateChain(e);r||this.getProvider(n).setDefaultChain(i),this.namespaces[n].defaultChain=i,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${Ku}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${Ku}/${e}`)}}const cy=Ia,ly="wc",hy="ethereum_provider",uy=`${ly}@${2}:${hy}:`,dy="https://rpc.walletconnect.com/v1/",ys=["eth_sendTransaction","personal_sign"],fy=["eth_accounts","eth_requestAccounts","eth_call","eth_getBalance","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],vs=["chainChanged","accountsChanged"],py=["message","disconnect","connect"];var gy=Object.defineProperty,my=Object.defineProperties,wy=Object.getOwnPropertyDescriptors,Yu=Object.getOwnPropertySymbols,by=Object.prototype.hasOwnProperty,yy=Object.prototype.propertyIsEnumerable,Ju=(t,e,r)=>e in t?gy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xu=(t,e)=>{for(var r in e||(e={}))by.call(e,r)&&Ju(t,r,e[r]);if(Yu)for(var r of Yu(e))yy.call(e,r)&&Ju(t,r,e[r]);return t},Qu=(t,e)=>my(t,wy(e));function Da(t){return Number(t[0].split(":")[1])}function Oa(t){return`0x${t.toString(16)}`}function vy(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!br(e))throw new Error("Invalid chains");const c=e,l=n||ys,p=s||vs,w={[Da(c)]:a[Da(c)]},b={chains:c,methods:l,events:p,rpcMap:w},m=s?.filter(M=>!vs.includes(M)),E=n?.filter(M=>!ys.includes(M));if(!r&&!o&&!i&&!(m!=null&&m.length)&&!(E!=null&&E.length))return{required:b};const A=m?.length&&E?.length||!r,N={chains:[...new Set(A?c.concat(r||[]):r)],methods:[...new Set(l.concat(i||[]))],events:[...new Set(p.concat(o||[]))],rpcMap:a};return{required:b,optional:N}}class _s{constructor(){this.events=new ut.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=uy,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new _s;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=vy(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Qu(Xu({namespaces:{[this.namespace]:r}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;this.setChainIds(this.rpc.chains);const s=lg(i.namespaces,[this.namespace]);this.setAccounts(s),this.events.emit("connect",{chainId:Oa(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Oa(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Qu(Xu({},tt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}setHttpProvider(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Oa(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.setHttpProvider(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;return{chains:((r=e.chains)==null?void 0:r.map(i=>this.formatChainId(i)))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map(i=>this.formatChainId(i)):void 0,methods:e?.methods||ys,events:e?.events||vs,optionalMethods:e?.optionalMethods||[],optionalEvents:e?.optionalEvents||[],rpcMap:e?.rpcMap||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),showQrModal:(n=e?.showQrModal)!=null?n:!0,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=Da(this.rpc.chains),this.signer=await cy.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){const{Web3Modal:r}=await Promise.resolve().then(function(){return zy});this.modal=new r({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains})}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&br(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=i?.[s]||this.getRpcUrl(s)})),n&&br(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=i?.[s]||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${dy}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`);this.setChainIds(e?[this.formatChainId(e)]:this.session.namespaces[this.namespace].accounts),this.setAccounts(this.session.namespaces[this.namespace].accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const _y=_s,Ey=Symbol(),e0=Object.getPrototypeOf,Aa=new WeakMap,xy=t=>t&&(Aa.has(t)?Aa.get(t):e0(t)===Object.prototype||e0(t)===Array.prototype),Cy=t=>xy(t)&&t[Ey]||null,t0=(t,e=!0)=>{Aa.set(t,e)},$a=t=>typeof t=="object"&&t!==null,Fr=new WeakMap,Es=new WeakSet,Sy=(t=Object.is,e=(l,p)=>new Proxy(l,p),r=l=>$a(l)&&!Es.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 b=i.get(l);if(b?.[0]===p)return b[1];const m=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return t0(m,!0),i.set(l,[p,m]),Reflect.ownKeys(l).forEach(E=>{const A=Reflect.get(l,E);Es.has(A)?(t0(A,!1),m[E]=A):A instanceof Promise?Object.defineProperty(m,E,{get(){return w(A)}}):Fr.has(A)?m[E]=Dy(A,w):m[E]=A}),Object.freeze(m)},o=new WeakMap,a=[1,1],c=l=>{if(!$a(l))throw new Error("object required");const p=o.get(l);if(p)return p;let w=a[0];const b=new Set,m=(H,j=++a[0])=>{w!==j&&(w=j,b.forEach(q=>q(H,j)))};let E=a[1];const A=(H=++a[1])=>(E!==H&&!b.size&&(E=H,M.forEach(([j])=>{const q=j[1](H);q>w&&(w=q)})),w),N=H=>(j,q)=>{const X=[...j];X[1]=[H,...X[1]],m(X,q)},M=new Map,x=(H,j)=>{if(void 0!=="production"&&M.has(H))throw new Error("prop listener already exists");if(b.size){const q=j[3](N(H));M.set(H,[j,q])}else M.set(H,[j])},D=H=>{var j;const q=M.get(H);q&&(M.delete(H),(j=q[1])==null||j.call(q))},y=H=>(b.add(H),b.size===1&&M.forEach(([q,X],re)=>{if(void 0!=="production"&&X)throw new Error("remove already exists");const C=q[3](N(re));M.set(re,[q,C])}),()=>{b.delete(H),b.size===0&&M.forEach(([q,X],re)=>{X&&(X(),M.set(re,[q]))})}),I=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),u=e(I,{deleteProperty(H,j){const q=Reflect.get(H,j);D(j);const X=Reflect.deleteProperty(H,j);return X&&m(["delete",[j],q]),X},set(H,j,q,X){var re;const C=Reflect.has(H,j),$=Reflect.get(H,j,X);if(C&&t($,q))return!0;D(j),$a(q)&&(q=Cy(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,m(["resolve",[j],K])}).catch(K=>{q.status="rejected",q.reason=K,m(["reject",[j],K])});else{!Fr.has(q)&&r(q)&&(G=vr(q));const K=!Es.has(G)&&Fr.get(G);K&&x(j,K)}return Reflect.set(H,j,G,X),m(["set",[j],q,$]),!0}});o.set(l,u);const _=[I,A,s,y];return Fr.set(u,_),Reflect.ownKeys(l).forEach(H=>{const j=Object.getOwnPropertyDescriptor(l,H);j.get||j.set?Object.defineProperty(I,H,j):u[H]=l[H]}),u})=>[c,Fr,Es,t,e,r,n,i,s,o,a],[Iy]=Sy();function vr(t={}){return Iy(t)}function ui(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 Dy(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 r0={},xs={};xs.byteLength=$y,xs.toByteArray=Ty,xs.fromByteArray=Ly;for(var ir=[],Kt=[],Oy=typeof Uint8Array<"u"?Uint8Array:Array,Pa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pn=0,Ay=Pa.length;pn<Ay;++pn)ir[pn]=Pa[pn],Kt[Pa.charCodeAt(pn)]=pn;Kt["-".charCodeAt(0)]=62,Kt["_".charCodeAt(0)]=63;function n0(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 $y(t){var e=n0(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Py(t,e,r){return(e+r)*3/4-r}function Ty(t){var e,r=n0(t),n=r[0],i=r[1],s=new Oy(Py(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=Kt[t.charCodeAt(c)]<<18|Kt[t.charCodeAt(c+1)]<<12|Kt[t.charCodeAt(c+2)]<<6|Kt[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Kt[t.charCodeAt(c)]<<2|Kt[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Kt[t.charCodeAt(c)]<<10|Kt[t.charCodeAt(c+1)]<<4|Kt[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Ny(t){return ir[t>>18&63]+ir[t>>12&63]+ir[t>>6&63]+ir[t&63]}function Ry(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(Ny(n));return i.join("")}function Ly(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(Ry(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(ir[e>>2]+ir[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ir[e>>10]+ir[e>>4&63]+ir[e<<2&63]+"=")),i.join("")}var Ta={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ta.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,b=r?-1:1,m=t[e+w];for(w+=b,s=m&(1<<-p)-1,m>>=-p,p+=a;p>0;s=s*256+t[e+w],w+=b,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+w],w+=b,p-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(m?-1:1)*o*Math.pow(2,s-n)},Ta.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,p=(1<<l)-1,w=p>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:s-1,E=n?1:-1,A=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+=b/c:e+=b*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+m]=a&255,m+=E,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[r+m]=o&255,m+=E,o/=256,l-=8);t[r+m-E]|=A*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=_s,r=Pa,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 y(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(ge(g,ArrayBuffer)||g&&ge(g.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ge(g,SharedArrayBuffer)||g&&ge(g.buffer,SharedArrayBuffer)))return A(g,u,d);if(typeof g=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const v=g.valueOf&&g.valueOf();if(v!=null&&v!==g)return a.from(v,u,d);const T=N(g);if(T)return T;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:M(g)|0)}a.allocUnsafe=function(g){return w(g)},a.allocUnsafeSlow=function(g){return w(g)};function y(g,u){if((typeof u!="string"||u==="")&&(u="utf8"),!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const d=D(g,u)|0;let v=o(d);const T=v.write(g,u);return T!==d&&(v=v.slice(0,T)),v}function m(g){const u=g.length<0?0:M(g.length)|0,d=o(u);for(let v=0;v<u;v+=1)d[v]=g[v]&255;return d}function E(g){if(ge(g,Uint8Array)){const u=new Uint8Array(g);return A(u.buffer,u.byteOffset,u.byteLength)}return m(g)}function A(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 v;return u===void 0&&d===void 0?v=new Uint8Array(g):d===void 0?v=new Uint8Array(g,u):v=new Uint8Array(g,u,d),Object.setPrototypeOf(v,a.prototype),v}function N(g){if(a.isBuffer(g)){const u=M(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):m(g);if(g.type==="Buffer"&&Array.isArray(g.data))return m(g.data)}function M(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(ge(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),ge(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 v=u.length,T=d.length;for(let U=0,k=Math.min(v,T);U<k;++U)if(u[U]!==d[U]){v=u[U],T=d[U];break}return v<T?-1:T<v?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 v;if(d===void 0)for(d=0,v=0;v<u.length;++v)d+=u[v].length;const T=a.allocUnsafe(d);let U=0;for(v=0;v<u.length;++v){let k=u[v];if(ge(k,Uint8Array))U+k.length>T.length?(a.isBuffer(k)||(k=a.from(k)),k.copy(T,U)):Uint8Array.prototype.set.call(T,k,U);else if(a.isBuffer(k))k.copy(T,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=k.length}return T};function D(g,u){if(a.isBuffer(g))return g.length;if(ArrayBuffer.isView(g)||ge(g,ArrayBuffer))return g.byteLength;if(typeof g!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof g);const d=g.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&d===0)return 0;let T=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return Me(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(T)return v?-1:Me(g).length;u=(""+u).toLowerCase(),T=!0}}a.byteLength=D;function b(g,u,d){let v=!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(v)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),v=!0}}a.prototype._isBuffer=!0;function I(g,u,d){const v=g[u];g[u]=g[d],g[d]=v}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)I(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)I(this,d,d+3),I(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)I(this,d,d+7),I(this,d+1,d+6),I(this,d+2,d+5),I(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):b.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,v,T,U){if(ge(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),v===void 0&&(v=u?u.length:0),T===void 0&&(T=0),U===void 0&&(U=this.length),d<0||v>u.length||T<0||U>this.length)throw new RangeError("out of range index");if(T>=U&&d>=v)return 0;if(T>=U)return-1;if(d>=v)return 1;if(d>>>=0,v>>>=0,T>>>=0,U>>>=0,this===u)return 0;let k=U-T,oe=v-d;const he=Math.min(k,oe),Ne=this.slice(T,U),Fe=u.slice(d,v);for(let Re=0;Re<he;++Re)if(Ne[Re]!==Fe[Re]){k=Ne[Re],oe=Fe[Re];break}return k<oe?-1:oe<k?1:0};function O(g,u,d,v,T){if(g.length===0)return-1;if(typeof d=="string"?(v=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,Se(d)&&(d=T?0:g.length-1),d<0&&(d=g.length+d),d>=g.length){if(T)return-1;d=g.length-1}else if(d<0)if(T)d=0;else return-1;if(typeof u=="string"&&(u=a.from(u,v)),a.isBuffer(u))return u.length===0?-1:h(g,u,d,v,T);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?T?Uint8Array.prototype.indexOf.call(g,u,d):Uint8Array.prototype.lastIndexOf.call(g,u,d):h(g,[u],d,v,T);throw new TypeError("val must be string, number or Buffer")}function h(g,u,d,v,T){let U=1,k=g.length,oe=u.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(g.length<2||u.length<2)return-1;U=2,k/=2,oe/=2,d/=2}function he(Fe,Re){return U===1?Fe[Re]:Fe.readUInt16BE(Re*U)}let Ne;if(T){let Fe=-1;for(Ne=d;Ne<k;Ne++)if(he(g,Ne)===he(u,Fe===-1?0:Ne-Fe)){if(Fe===-1&&(Fe=Ne),Ne-Fe+1===oe)return Fe*U}else Fe!==-1&&(Ne-=Ne-Fe),Fe=-1}else for(d+oe>k&&(d=k-oe),Ne=d;Ne>=0;Ne--){let Fe=!0;for(let Re=0;Re<oe;Re++)if(he(g,Ne+Re)!==he(u,Re)){Fe=!1;break}if(Fe)return Ne}return-1}a.prototype.includes=function(u,d,v){return this.indexOf(u,d,v)!==-1},a.prototype.indexOf=function(u,d,v){return O(this,u,d,v,!0)},a.prototype.lastIndexOf=function(u,d,v){return O(this,u,d,v,!1)};function _(g,u,d,v){d=Number(d)||0;const T=g.length-d;v?(v=Number(v),v>T&&(v=T)):v=T;const U=u.length;v>U/2&&(v=U/2);let k;for(k=0;k<v;++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,v){return De(Me(u,g.length-d),g,d,v)}function j(g,u,d,v){return De(Ye(u),g,d,v)}function q(g,u,d,v){return De(Pe(u),g,d,v)}function X(g,u,d,v){return De(Ke(u,g.length-d),g,d,v)}a.prototype.write=function(u,d,v,T){if(d===void 0)T="utf8",v=this.length,d=0;else if(v===void 0&&typeof d=="string")T=d,v=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(v)?(v=v>>>0,T===void 0&&(T="utf8")):(T=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-d;if((v===void 0||v>U)&&(v=U),u.length>0&&(v<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");T||(T="utf8");let k=!1;for(;;)switch(T){case"hex":return _(this,u,d,v);case"utf8":case"utf-8":return H(this,u,d,v);case"ascii":case"latin1":case"binary":return j(this,u,d,v);case"base64":return q(this,u,d,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,u,d,v);default:if(k)throw new TypeError("Unknown encoding: "+T);T=(""+T).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 v=[];let T=u;for(;T<d;){const U=g[T];let k=null,oe=U>239?4:U>223?3:U>191?2:1;if(T+oe<=d){let he,Ne,Fe,Re;switch(oe){case 1:U<128&&(k=U);break;case 2:he=g[T+1],(he&192)===128&&(Re=(U&31)<<6|he&63,Re>127&&(k=Re));break;case 3:he=g[T+1],Ne=g[T+2],(he&192)===128&&(Ne&192)===128&&(Re=(U&15)<<12|(he&63)<<6|Ne&63,Re>2047&&(Re<55296||Re>57343)&&(k=Re));break;case 4:he=g[T+1],Ne=g[T+2],Fe=g[T+3],(he&192)===128&&(Ne&192)===128&&(Fe&192)===128&&(Re=(U&15)<<18|(he&63)<<12|(Ne&63)<<6|Fe&63,Re>65535&&Re<1114112&&(k=Re))}}k===null?(k=65533,oe=1):k>65535&&(k-=65536,v.push(k>>>10&1023|55296),k=56320|k&1023),v.push(k),T+=oe}return G(v)}const $=4096;function G(g){const u=g.length;if(u<=$)return String.fromCharCode.apply(String,g);let d="",v=0;for(;v<u;)d+=String.fromCharCode.apply(String,g.slice(v,v+=$));return d}function K(g,u,d){let v="";d=Math.min(g.length,d);for(let T=u;T<d;++T)v+=String.fromCharCode(g[T]&127);return v}function W(g,u,d){let v="";d=Math.min(g.length,d);for(let T=u;T<d;++T)v+=String.fromCharCode(g[T]);return v}function z(g,u,d){const v=g.length;(!u||u<0)&&(u=0),(!d||d<0||d>v)&&(d=v);let T="";for(let U=u;U<d;++U)T+=Oe[g[U]];return T}function J(g,u,d){const v=g.slice(u,d);let T="";for(let U=0;U<v.length-1;U+=2)T+=String.fromCharCode(v[U]+v[U+1]*256);return T}a.prototype.slice=function(u,d){const v=this.length;u=~~u,d=d===void 0?v:~~d,u<0?(u+=v,u<0&&(u=0)):u>v&&(u=v),d<0?(d+=v,d<0&&(d=0)):d>v&&(d=v),d<u&&(d=u);const T=this.subarray(u,d);return Object.setPrototypeOf(T,a.prototype),T};function Y(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,v){u=u>>>0,d=d>>>0,v||Y(u,d,this.length);let T=this[u],U=1,k=0;for(;++k<d&&(U*=256);)T+=this[u+k]*U;return T},a.prototype.readUintBE=a.prototype.readUIntBE=function(u,d,v){u=u>>>0,d=d>>>0,v||Y(u,d,this.length);let T=this[u+--d],U=1;for(;d>0&&(U*=256);)T+=this[u+--d]*U;return T},a.prototype.readUint8=a.prototype.readUInt8=function(u,d){return u=u>>>0,d||Y(u,1,this.length),this[u]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(u,d){return u=u>>>0,d||Y(u,2,this.length),this[u]|this[u+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(u,d){return u=u>>>0,d||Y(u,2,this.length),this[u]<<8|this[u+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(u,d){return u=u>>>0,d||Y(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||Y(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,ie(u,"offset");const d=this[u],v=this[u+7];(d===void 0||v===void 0)&&Ee(u,this.length-8);const T=d+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,U=this[++u]+this[++u]*2**8+this[++u]*2**16+v*2**24;return BigInt(T)+(BigInt(U)<<BigInt(32))}),a.prototype.readBigUInt64BE=pe(function(u){u=u>>>0,ie(u,"offset");const d=this[u],v=this[u+7];(d===void 0||v===void 0)&&Ee(u,this.length-8);const T=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+v;return(BigInt(T)<<BigInt(32))+BigInt(U)}),a.prototype.readIntLE=function(u,d,v){u=u>>>0,d=d>>>0,v||Y(u,d,this.length);let T=this[u],U=1,k=0;for(;++k<d&&(U*=256);)T+=this[u+k]*U;return U*=128,T>=U&&(T-=Math.pow(2,8*d)),T},a.prototype.readIntBE=function(u,d,v){u=u>>>0,d=d>>>0,v||Y(u,d,this.length);let T=d,U=1,k=this[u+--T];for(;T>0&&(U*=256);)k+=this[u+--T]*U;return U*=128,k>=U&&(k-=Math.pow(2,8*d)),k},a.prototype.readInt8=function(u,d){return u=u>>>0,d||Y(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},a.prototype.readInt16LE=function(u,d){u=u>>>0,d||Y(u,2,this.length);const v=this[u]|this[u+1]<<8;return v&32768?v|4294901760:v},a.prototype.readInt16BE=function(u,d){u=u>>>0,d||Y(u,2,this.length);const v=this[u+1]|this[u]<<8;return v&32768?v|4294901760:v},a.prototype.readInt32LE=function(u,d){return u=u>>>0,d||Y(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||Y(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,ie(u,"offset");const d=this[u],v=this[u+7];(d===void 0||v===void 0)&&Ee(u,this.length-8);const T=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(v<<24);return(BigInt(T)<<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,ie(u,"offset");const d=this[u],v=this[u+7];(d===void 0||v===void 0)&&Ee(u,this.length-8);const T=(d<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(T)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+v)}),a.prototype.readFloatLE=function(u,d){return u=u>>>0,d||Y(u,4,this.length),r.read(this,u,!0,23,4)},a.prototype.readFloatBE=function(u,d){return u=u>>>0,d||Y(u,4,this.length),r.read(this,u,!1,23,4)},a.prototype.readDoubleLE=function(u,d){return u=u>>>0,d||Y(u,8,this.length),r.read(this,u,!0,52,8)},a.prototype.readDoubleBE=function(u,d){return u=u>>>0,d||Y(u,8,this.length),r.read(this,u,!1,52,8)};function le(g,u,d,v,T,U){if(!a.isBuffer(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>T||u<U)throw new RangeError('"value" argument is out of bounds');if(d+v>g.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(u,d,v,T){if(u=+u,d=d>>>0,v=v>>>0,!T){const oe=Math.pow(2,8*v)-1;le(this,u,d,v,oe,0)}let U=1,k=0;for(this[d]=u&255;++k<v&&(U*=256);)this[d+k]=u/U&255;return d+v},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(u,d,v,T){if(u=+u,d=d>>>0,v=v>>>0,!T){const oe=Math.pow(2,8*v)-1;le(this,u,d,v,oe,0)}let U=v-1,k=1;for(this[d+U]=u&255;--U>=0&&(k*=256);)this[d+U]=u/k&255;return d+v},a.prototype.writeUint8=a.prototype.writeUInt8=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,1,255,0),this[d]=u&255,d+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(u,d,v){return u=+u,d=d>>>0,v||le(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,v){return u=+u,d=d>>>0,v||le(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,v){return u=+u,d=d>>>0,v||le(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,v){return u=+u,d=d>>>0,v||le(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 ee(g,u,d,v,T){te(u,v,T,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,v,T){te(u,v,T,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 ee(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,v,T){if(u=+u,d=d>>>0,!T){const he=Math.pow(2,8*v-1);le(this,u,d,v,he-1,-he)}let U=0,k=1,oe=0;for(this[d]=u&255;++U<v&&(k*=256);)u<0&&oe===0&&this[d+U-1]!==0&&(oe=1),this[d+U]=(u/k>>0)-oe&255;return d+v},a.prototype.writeIntBE=function(u,d,v,T){if(u=+u,d=d>>>0,!T){const he=Math.pow(2,8*v-1);le(this,u,d,v,he-1,-he)}let U=v-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+v},a.prototype.writeInt8=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,1,127,-128),u<0&&(u=255+u+1),this[d]=u&255,d+1},a.prototype.writeInt16LE=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,2,32767,-32768),this[d]=u&255,this[d+1]=u>>>8,d+2},a.prototype.writeInt16BE=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,2,32767,-32768),this[d]=u>>>8,this[d+1]=u&255,d+2},a.prototype.writeInt32LE=function(u,d,v){return u=+u,d=d>>>0,v||le(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,v){return u=+u,d=d>>>0,v||le(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 ee(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,v,T,U){if(d+v>g.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function Ce(g,u,d,v,T){return u=+u,d=d>>>0,T||ae(g,u,d,4),r.write(g,u,d,v,23,4),d+4}a.prototype.writeFloatLE=function(u,d,v){return Ce(this,u,d,!0,v)},a.prototype.writeFloatBE=function(u,d,v){return Ce(this,u,d,!1,v)};function B(g,u,d,v,T){return u=+u,d=d>>>0,T||ae(g,u,d,8),r.write(g,u,d,v,52,8),d+8}a.prototype.writeDoubleLE=function(u,d,v){return B(this,u,d,!0,v)},a.prototype.writeDoubleBE=function(u,d,v){return B(this,u,d,!1,v)},a.prototype.copy=function(u,d,v,T){if(!a.isBuffer(u))throw new TypeError("argument should be a Buffer");if(v||(v=0),!T&&T!==0&&(T=this.length),d>=u.length&&(d=u.length),d||(d=0),T>0&&T<v&&(T=v),T===v||u.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(T<0)throw new RangeError("sourceEnd out of bounds");T>this.length&&(T=this.length),u.length-d<T-v&&(T=u.length-d+v);const U=T-v;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(d,v,T):Uint8Array.prototype.set.call(u,this.subarray(v,T),d),U},a.prototype.fill=function(u,d,v,T){if(typeof u=="string"){if(typeof d=="string"?(T=d,d=0,v=this.length):typeof v=="string"&&(T=v,v=this.length),T!==void 0&&typeof T!="string")throw new TypeError("encoding must be a string");if(typeof T=="string"&&!a.isEncoding(T))throw new TypeError("Unknown encoding: "+T);if(u.length===1){const k=u.charCodeAt(0);(T==="utf8"&&k<128||T==="latin1")&&(u=k)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(d<0||this.length<d||this.length<v)throw new RangeError("Out of range index");if(v<=d)return this;d=d>>>0,v=v===void 0?this.length:v>>>0,u||(u=0);let U;if(typeof u=="number")for(U=d;U<v;++U)this[U]=u;else{const k=a.isBuffer(u)?u:a.from(u,T),oe=k.length;if(oe===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(U=0;U<v-d;++U)this[U+d]=k[U%oe]}return this};const F={};function R(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(T){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:T,writable:!0})}toString(){return`${this.name} [${g}]: ${this.message}`}}}R("ERR_BUFFER_OUT_OF_BOUNDS",function(g){return g?`${g} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),R("ERR_INVALID_ARG_TYPE",function(g,u){return`The "${g}" argument must be of type number. Received type ${typeof u}`},TypeError),R("ERR_OUT_OF_RANGE",function(g,u,d){let v=`The value of "${g}" is out of range.`,T=d;return Number.isInteger(d)&&Math.abs(d)>2**32?T=f(String(d)):typeof d=="bigint"&&(T=String(d),(d>BigInt(2)**BigInt(32)||d<-(BigInt(2)**BigInt(32)))&&(T=f(T)),T+="n"),v+=` It must be ${u}. Received ${T}`,v},RangeError);function f(g){let u="",d=g.length;const v=g[0]==="-"?1:0;for(;d>=v+4;d-=3)u=`_${g.slice(d-3,d)}${u}`;return`${g.slice(0,d)}${u}`}function P(g,u,d){ie(u,"offset"),(g[u]===void 0||g[u+d]===void 0)&&Ee(u,g.length-(d+1))}function te(g,u,d,v,T,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)}P(v,T,U)}function ie(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?(ie(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 Le=/[^+/0-9A-Za-z-_]/g;function $e(g){if(g=g.split("=")[0],g=g.trim().replace(Le,""),g.length<2)return"";for(;g.length%4!==0;)g=g+"=";return g}function Me(g,u){u=u||1/0;let d;const v=g.length;let T=null;const U=[];for(let k=0;k<v;++k){if(d=g.charCodeAt(k),d>55295&&d<57344){if(!T){if(d>56319){(u-=3)>-1&&U.push(239,191,189);continue}else if(k+1===v){(u-=3)>-1&&U.push(239,191,189);continue}T=d;continue}if(d<56320){(u-=3)>-1&&U.push(239,191,189),T=d;continue}d=(T-55296<<10|d-56320)+65536}else T&&(u-=3)>-1&&U.push(239,191,189);if(T=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 Ye(g){const u=[];for(let d=0;d<g.length;++d)u.push(g.charCodeAt(d)&255);return u}function Ke(g,u){let d,v,T;const U=[];for(let k=0;k<g.length&&!((u-=2)<0);++k)d=g.charCodeAt(k),v=d>>8,T=d%256,U.push(T),U.push(v);return U}function Pe(g){return e.toByteArray($e(g))}function De(g,u,d,v){let T;for(T=0;T<v&&!(T+d>=u.length||T>=g.length);++T)u[T+d]=g[T];return T}function ge(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 v=d*16;for(let T=0;T<16;++T)u[v+T]=g[d]+g[T]}return u}();function pe(g){return typeof BigInt>"u"?xe:g}function xe(){throw new Error("BigInt not supported")}})(Qh);const ke=_r({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,isDataLoaded:!1,isUiLoaded:!1,walletConnectVersion:1}),Q={state:ke,subscribe(t){return ui(ke,()=>t(ke))},setChains(t){ke.chains=t},setStandaloneChains(t){ke.standaloneChains=t},setStandaloneUri(t){ke.standaloneUri=t},getSelectedChain(){const t=qe.client().getNetwork().chain;return t&&(ke.selectedChain=t),ke.selectedChain},setSelectedChain(t){ke.selectedChain=t},setIsStandalone(t){ke.isStandalone=t},setIsCustomDesktop(t){ke.isCustomDesktop=t},setIsCustomMobile(t){ke.isCustomMobile=t},getAccount(){const t=qe.client().getAccount();ke.address=t.address,ke.isConnected=t.isConnected},setAddress(t){ke.address=t},setIsConnected(t){ke.isConnected=t},setProfileName(t){ke.profileName=t},setProfileAvatar(t){ke.profileAvatar=t},setProfileLoading(t){ke.profileLoading=t},setBalanceLoading(t){ke.balanceLoading=t},setBalance(t){ke.balance=t},setIsDataLoaded(t){ke.isDataLoaded=t},setIsUiLoaded(t){ke.isUiLoaded=t},setWalletConnectVersion(t){ke.walletConnectVersion=t},resetEnsProfile(){ke.profileName=void 0,ke.profileAvatar=void 0},resetBalance(){ke.balance=void 0},resetAccount(){ke.address=void 0,ke.isConnected=!1,Q.resetEnsProfile(),Q.resetBalance()}},hi=_r({initialized:!1,ethereumClient:void 0}),qe={setEthereumClient(t){!hi.initialized&&t&&(hi.ethereumClient=t,Q.setChains(t.chains),hi.initialized=!0)},client(){if(hi.ethereumClient)return hi.ethereumClient;throw new Error("ClientCtrl has no client set")}},Ue={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 Ue.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(Ue.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(!Ue.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(Ue.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE)},isNull(t){return t===null}};function Rb(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const di=_r({projectId:"",themeMode:Rb()?"dark":"light",themeColor:"default",themeBackground:Ue.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,enableAccountView:!0,defaultChain:void 0,explorerAllowList:void 0,explorerDenyList:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Ve={state:di,subscribe(t){return ui(di,()=>t(di))},setConfig(t){var e,r,n,i;if(Q.setStandaloneChains(t.standaloneChains),Q.setIsStandalone(Boolean((e=t.standaloneChains)==null?void 0:e.length)||Boolean(t.enableStandaloneMode)),Q.setIsCustomMobile(Boolean((r=t.mobileWallets)==null?void 0:r.length)),Q.setIsCustomDesktop(Boolean((n=t.desktopWallets)==null?void 0:n.length)),Q.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),t.defaultChain)Q.setSelectedChain(t.defaultChain);else if(!Q.state.isStandalone){const s=qe.client().getDefaultChain();Q.setSelectedChain(s)}Object.assign(di,t)},setThemeConfig(t){Object.assign(di,t)}},t0="https://explorer-api.walletconnect.com";function Lb(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 Es={async fetchWallets(t,e){const r=Lb(e),n=`${t0}/v3/wallets?projectId=${t}&${r}`;return(await fetch(n)).json()},formatImageUrl(t,e){return`${t0}/v3/logo/lg/${e}?projectId=${t}`}},jr=_r({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},previewWallets:[],recomendedWallets:[]});function xs(){const{projectId:t}=Ve.state;if(!t)throw new Error("projectId is required to work with explorer api");return t}const at={state:jr,async getPreviewWallets(t){const{listings:e}=await Es.fetchWallets(xs(),t);return jr.previewWallets=Object.values(e),jr.previewWallets},async getRecomendedWallets(){const{listings:t}=await Es.fetchWallets(xs(),{page:1,entries:6});jr.recomendedWallets=Object.values(t)},async getPaginatedWallets(t){const{page:e,search:r}=t,{listings:n,total:i}=await Es.fetchWallets(xs(),t),s=Object.values(n),o=r?"search":"wallets";return jr[o]={listings:[...jr[o].listings,...s],total:i,page:e??1},{listings:s,total:i}},getImageUrl(t){return Es.formatImageUrl(xs(),t)},resetSearch(){jr.search={listings:[],total:0,page:1}}},Ft=_r({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Te={state:Ft,subscribe(t){return ui(Ft,()=>t(Ft))},push(t,e){t!==Ft.view&&(Ft.view=t,e&&(Ft.data=e),Ft.history.push(t))},replace(t){Ft.view=t,Ft.history=[t]},goBack(){if(Ft.history.length>1){Ft.history.pop();const[t]=Ft.history.slice(-1);Ft.view=t}}},gn=_r({open:!1}),dt={state:gn,subscribe(t){return ui(gn,()=>t(gn))},async open(t){return new Promise(e=>{const{isConnected:r,isStandalone:n,isUiLoaded:i,isDataLoaded:s}=Q.state,{enableNetworkView:o}=Ve.state;if(n?(Q.setStandaloneUri(t?.uri),Q.setStandaloneChains(t?.standaloneChains),Te.replace("ConnectWallet")):t!=null&&t.route?Te.replace(t.route):r?Te.replace("Account"):o?Te.replace("SelectNetwork"):Te.replace("ConnectWallet"),i&&s)gn.open=!0,e();else{const a=setInterval(()=>{Q.state.isUiLoaded&&Q.state.isDataLoaded&&(clearInterval(a),gn.open=!0,e())},200)}})},close(){gn.open=!1}},kr=_r({open:!1,message:"",variant:"success"}),Lt={state:kr,subscribe(t){return ui(kr,()=>t(kr))},openToast(t,e){kr.open=!0,kr.message=t,kr.variant=e},closeToast(){kr.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=Qh.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var Mb=Object.defineProperty,r0=Object.getOwnPropertySymbols,Ub=Object.prototype.hasOwnProperty,Fb=Object.prototype.propertyIsEnumerable,n0=(t,e,r)=>e in t?Mb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Bb=(t,e)=>{for(var r in e||(e={}))Ub.call(e,r)&&n0(t,r,e[r]);if(r0)for(var r of r0(e))Fb.call(e,r)&&n0(t,r,e[r]);return t};class jb{constructor(e){this.openModal=dt.open,this.closeModal=dt.close,this.subscribeModal=dt.subscribe,this.setTheme=Ve.setThemeConfig,Ve.setConfig(Bb({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return k_});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),Q.setIsUiLoaded(!0)}}}var kb=Object.freeze({__proto__:null,Web3Modal:jb});/**
71
+ */(function(t){const e=xs,r=Ta,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),h={foo:function(){return 42}};return Object.setPrototypeOf(h,Uint8Array.prototype),Object.setPrototypeOf(g,h),g.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(g){if(g>i)throw new RangeError('The value "'+g+'" is invalid for option "size"');const h=new Uint8Array(g);return Object.setPrototypeOf(h,a.prototype),h}function a(g,h,d){if(typeof g=="number"){if(typeof h=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(g)}return c(g,h,d)}a.poolSize=8192;function c(g,h,d){if(typeof g=="string")return b(g,h);if(ArrayBuffer.isView(g))return E(g);if(g==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g);if(me(g,ArrayBuffer)||g&&me(g.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(g,SharedArrayBuffer)||g&&me(g.buffer,SharedArrayBuffer)))return A(g,h,d);if(typeof g=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const v=g.valueOf&&g.valueOf();if(v!=null&&v!==g)return a.from(v,h,d);const T=N(g);if(T)return T;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof g[Symbol.toPrimitive]=="function")return a.from(g[Symbol.toPrimitive]("string"),h,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g)}a.from=function(g,h,d){return c(g,h,d)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(g){if(typeof g!="number")throw new TypeError('"size" argument must be of type number');if(g<0)throw new RangeError('The value "'+g+'" is invalid for option "size"')}function p(g,h,d){return l(g),g<=0?o(g):h!==void 0?typeof d=="string"?o(g).fill(h,d):o(g).fill(h):o(g)}a.alloc=function(g,h,d){return p(g,h,d)};function w(g){return l(g),o(g<0?0:M(g)|0)}a.allocUnsafe=function(g){return w(g)},a.allocUnsafeSlow=function(g){return w(g)};function b(g,h){if((typeof h!="string"||h==="")&&(h="utf8"),!a.isEncoding(h))throw new TypeError("Unknown encoding: "+h);const d=D(g,h)|0;let v=o(d);const T=v.write(g,h);return T!==d&&(v=v.slice(0,T)),v}function m(g){const h=g.length<0?0:M(g.length)|0,d=o(h);for(let v=0;v<h;v+=1)d[v]=g[v]&255;return d}function E(g){if(me(g,Uint8Array)){const h=new Uint8Array(g);return A(h.buffer,h.byteOffset,h.byteLength)}return m(g)}function A(g,h,d){if(h<0||g.byteLength<h)throw new RangeError('"offset" is outside of buffer bounds');if(g.byteLength<h+(d||0))throw new RangeError('"length" is outside of buffer bounds');let v;return h===void 0&&d===void 0?v=new Uint8Array(g):d===void 0?v=new Uint8Array(g,h):v=new Uint8Array(g,h,d),Object.setPrototypeOf(v,a.prototype),v}function N(g){if(a.isBuffer(g)){const h=M(g.length)|0,d=o(h);return d.length===0||g.copy(d,0,0,h),d}if(g.length!==void 0)return typeof g.length!="number"||Se(g.length)?o(0):m(g);if(g.type==="Buffer"&&Array.isArray(g.data))return m(g.data)}function M(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(h){return h!=null&&h._isBuffer===!0&&h!==a.prototype},a.compare=function(h,d){if(me(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),me(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(h)||!a.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===d)return 0;let v=h.length,T=d.length;for(let U=0,k=Math.min(v,T);U<k;++U)if(h[U]!==d[U]){v=h[U],T=d[U];break}return v<T?-1:T<v?1:0},a.isEncoding=function(h){switch(String(h).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(h,d){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return a.alloc(0);let v;if(d===void 0)for(d=0,v=0;v<h.length;++v)d+=h[v].length;const T=a.allocUnsafe(d);let U=0;for(v=0;v<h.length;++v){let k=h[v];if(me(k,Uint8Array))U+k.length>T.length?(a.isBuffer(k)||(k=a.from(k)),k.copy(T,U)):Uint8Array.prototype.set.call(T,k,U);else if(a.isBuffer(k))k.copy(T,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=k.length}return T};function D(g,h){if(a.isBuffer(g))return g.length;if(ArrayBuffer.isView(g)||me(g,ArrayBuffer))return g.byteLength;if(typeof g!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof g);const d=g.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&d===0)return 0;let T=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return Me(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(T)return v?-1:Me(g).length;h=(""+h).toLowerCase(),T=!0}}a.byteLength=D;function y(g,h,d){let v=!1;if((h===void 0||h<0)&&(h=0),h>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,h>>>=0,d<=h))return"";for(g||(g="utf8");;)switch(g){case"hex":return z(this,h,d);case"utf8":case"utf-8":return C(this,h,d);case"ascii":return K(this,h,d);case"latin1":case"binary":return W(this,h,d);case"base64":return re(this,h,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,h,d);default:if(v)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),v=!0}}a.prototype._isBuffer=!0;function I(g,h,d){const v=g[h];g[h]=g[d],g[d]=v}a.prototype.swap16=function(){const h=this.length;if(h%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let d=0;d<h;d+=2)I(this,d,d+1);return this},a.prototype.swap32=function(){const h=this.length;if(h%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let d=0;d<h;d+=4)I(this,d,d+3),I(this,d+1,d+2);return this},a.prototype.swap64=function(){const h=this.length;if(h%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let d=0;d<h;d+=8)I(this,d,d+7),I(this,d+1,d+6),I(this,d+2,d+5),I(this,d+3,d+4);return this},a.prototype.toString=function(){const h=this.length;return h===0?"":arguments.length===0?C(this,0,h):y.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(h){if(!a.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h?!0:a.compare(this,h)===0},a.prototype.inspect=function(){let h="";const d=t.INSPECT_MAX_BYTES;return h=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(h+=" ... "),"<Buffer "+h+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(h,d,v,T,U){if(me(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(d===void 0&&(d=0),v===void 0&&(v=h?h.length:0),T===void 0&&(T=0),U===void 0&&(U=this.length),d<0||v>h.length||T<0||U>this.length)throw new RangeError("out of range index");if(T>=U&&d>=v)return 0;if(T>=U)return-1;if(d>=v)return 1;if(d>>>=0,v>>>=0,T>>>=0,U>>>=0,this===h)return 0;let k=U-T,oe=v-d;const ue=Math.min(k,oe),Ne=this.slice(T,U),Fe=h.slice(d,v);for(let Re=0;Re<ue;++Re)if(Ne[Re]!==Fe[Re]){k=Ne[Re],oe=Fe[Re];break}return k<oe?-1:oe<k?1:0};function O(g,h,d,v,T){if(g.length===0)return-1;if(typeof d=="string"?(v=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,Se(d)&&(d=T?0:g.length-1),d<0&&(d=g.length+d),d>=g.length){if(T)return-1;d=g.length-1}else if(d<0)if(T)d=0;else return-1;if(typeof h=="string"&&(h=a.from(h,v)),a.isBuffer(h))return h.length===0?-1:u(g,h,d,v,T);if(typeof h=="number")return h=h&255,typeof Uint8Array.prototype.indexOf=="function"?T?Uint8Array.prototype.indexOf.call(g,h,d):Uint8Array.prototype.lastIndexOf.call(g,h,d):u(g,[h],d,v,T);throw new TypeError("val must be string, number or Buffer")}function u(g,h,d,v,T){let U=1,k=g.length,oe=h.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(g.length<2||h.length<2)return-1;U=2,k/=2,oe/=2,d/=2}function ue(Fe,Re){return U===1?Fe[Re]:Fe.readUInt16BE(Re*U)}let Ne;if(T){let Fe=-1;for(Ne=d;Ne<k;Ne++)if(ue(g,Ne)===ue(h,Fe===-1?0:Ne-Fe)){if(Fe===-1&&(Fe=Ne),Ne-Fe+1===oe)return Fe*U}else Fe!==-1&&(Ne-=Ne-Fe),Fe=-1}else for(d+oe>k&&(d=k-oe),Ne=d;Ne>=0;Ne--){let Fe=!0;for(let Re=0;Re<oe;Re++)if(ue(g,Ne+Re)!==ue(h,Re)){Fe=!1;break}if(Fe)return Ne}return-1}a.prototype.includes=function(h,d,v){return this.indexOf(h,d,v)!==-1},a.prototype.indexOf=function(h,d,v){return O(this,h,d,v,!0)},a.prototype.lastIndexOf=function(h,d,v){return O(this,h,d,v,!1)};function _(g,h,d,v){d=Number(d)||0;const T=g.length-d;v?(v=Number(v),v>T&&(v=T)):v=T;const U=h.length;v>U/2&&(v=U/2);let k;for(k=0;k<v;++k){const oe=parseInt(h.substr(k*2,2),16);if(Se(oe))return k;g[d+k]=oe}return k}function H(g,h,d,v){return De(Me(h,g.length-d),g,d,v)}function j(g,h,d,v){return De(Ze(h),g,d,v)}function q(g,h,d,v){return De(Pe(h),g,d,v)}function X(g,h,d,v){return De(Ke(h,g.length-d),g,d,v)}a.prototype.write=function(h,d,v,T){if(d===void 0)T="utf8",v=this.length,d=0;else if(v===void 0&&typeof d=="string")T=d,v=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(v)?(v=v>>>0,T===void 0&&(T="utf8")):(T=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-d;if((v===void 0||v>U)&&(v=U),h.length>0&&(v<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");T||(T="utf8");let k=!1;for(;;)switch(T){case"hex":return _(this,h,d,v);case"utf8":case"utf-8":return H(this,h,d,v);case"ascii":case"latin1":case"binary":return j(this,h,d,v);case"base64":return q(this,h,d,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,h,d,v);default:if(k)throw new TypeError("Unknown encoding: "+T);T=(""+T).toLowerCase(),k=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function re(g,h,d){return h===0&&d===g.length?e.fromByteArray(g):e.fromByteArray(g.slice(h,d))}function C(g,h,d){d=Math.min(g.length,d);const v=[];let T=h;for(;T<d;){const U=g[T];let k=null,oe=U>239?4:U>223?3:U>191?2:1;if(T+oe<=d){let ue,Ne,Fe,Re;switch(oe){case 1:U<128&&(k=U);break;case 2:ue=g[T+1],(ue&192)===128&&(Re=(U&31)<<6|ue&63,Re>127&&(k=Re));break;case 3:ue=g[T+1],Ne=g[T+2],(ue&192)===128&&(Ne&192)===128&&(Re=(U&15)<<12|(ue&63)<<6|Ne&63,Re>2047&&(Re<55296||Re>57343)&&(k=Re));break;case 4:ue=g[T+1],Ne=g[T+2],Fe=g[T+3],(ue&192)===128&&(Ne&192)===128&&(Fe&192)===128&&(Re=(U&15)<<18|(ue&63)<<12|(Ne&63)<<6|Fe&63,Re>65535&&Re<1114112&&(k=Re))}}k===null?(k=65533,oe=1):k>65535&&(k-=65536,v.push(k>>>10&1023|55296),k=56320|k&1023),v.push(k),T+=oe}return G(v)}const $=4096;function G(g){const h=g.length;if(h<=$)return String.fromCharCode.apply(String,g);let d="",v=0;for(;v<h;)d+=String.fromCharCode.apply(String,g.slice(v,v+=$));return d}function K(g,h,d){let v="";d=Math.min(g.length,d);for(let T=h;T<d;++T)v+=String.fromCharCode(g[T]&127);return v}function W(g,h,d){let v="";d=Math.min(g.length,d);for(let T=h;T<d;++T)v+=String.fromCharCode(g[T]);return v}function z(g,h,d){const v=g.length;(!h||h<0)&&(h=0),(!d||d<0||d>v)&&(d=v);let T="";for(let U=h;U<d;++U)T+=Oe[g[U]];return T}function J(g,h,d){const v=g.slice(h,d);let T="";for(let U=0;U<v.length-1;U+=2)T+=String.fromCharCode(v[U]+v[U+1]*256);return T}a.prototype.slice=function(h,d){const v=this.length;h=~~h,d=d===void 0?v:~~d,h<0?(h+=v,h<0&&(h=0)):h>v&&(h=v),d<0?(d+=v,d<0&&(d=0)):d>v&&(d=v),d<h&&(d=h);const T=this.subarray(h,d);return Object.setPrototypeOf(T,a.prototype),T};function Z(g,h,d){if(g%1!==0||g<0)throw new RangeError("offset is not uint");if(g+h>d)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(h,d,v){h=h>>>0,d=d>>>0,v||Z(h,d,this.length);let T=this[h],U=1,k=0;for(;++k<d&&(U*=256);)T+=this[h+k]*U;return T},a.prototype.readUintBE=a.prototype.readUIntBE=function(h,d,v){h=h>>>0,d=d>>>0,v||Z(h,d,this.length);let T=this[h+--d],U=1;for(;d>0&&(U*=256);)T+=this[h+--d]*U;return T},a.prototype.readUint8=a.prototype.readUInt8=function(h,d){return h=h>>>0,d||Z(h,1,this.length),this[h]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(h,d){return h=h>>>0,d||Z(h,2,this.length),this[h]|this[h+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(h,d){return h=h>>>0,d||Z(h,2,this.length),this[h]<<8|this[h+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(h,d){return h=h>>>0,d||Z(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(h,d){return h=h>>>0,d||Z(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},a.prototype.readBigUInt64LE=ge(function(h){h=h>>>0,ie(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const T=d+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,U=this[++h]+this[++h]*2**8+this[++h]*2**16+v*2**24;return BigInt(T)+(BigInt(U)<<BigInt(32))}),a.prototype.readBigUInt64BE=ge(function(h){h=h>>>0,ie(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const T=d*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],U=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+v;return(BigInt(T)<<BigInt(32))+BigInt(U)}),a.prototype.readIntLE=function(h,d,v){h=h>>>0,d=d>>>0,v||Z(h,d,this.length);let T=this[h],U=1,k=0;for(;++k<d&&(U*=256);)T+=this[h+k]*U;return U*=128,T>=U&&(T-=Math.pow(2,8*d)),T},a.prototype.readIntBE=function(h,d,v){h=h>>>0,d=d>>>0,v||Z(h,d,this.length);let T=d,U=1,k=this[h+--T];for(;T>0&&(U*=256);)k+=this[h+--T]*U;return U*=128,k>=U&&(k-=Math.pow(2,8*d)),k},a.prototype.readInt8=function(h,d){return h=h>>>0,d||Z(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},a.prototype.readInt16LE=function(h,d){h=h>>>0,d||Z(h,2,this.length);const v=this[h]|this[h+1]<<8;return v&32768?v|4294901760:v},a.prototype.readInt16BE=function(h,d){h=h>>>0,d||Z(h,2,this.length);const v=this[h+1]|this[h]<<8;return v&32768?v|4294901760:v},a.prototype.readInt32LE=function(h,d){return h=h>>>0,d||Z(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},a.prototype.readInt32BE=function(h,d){return h=h>>>0,d||Z(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},a.prototype.readBigInt64LE=ge(function(h){h=h>>>0,ie(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const T=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(v<<24);return(BigInt(T)<<BigInt(32))+BigInt(d+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),a.prototype.readBigInt64BE=ge(function(h){h=h>>>0,ie(h,"offset");const d=this[h],v=this[h+7];(d===void 0||v===void 0)&&Ee(h,this.length-8);const T=(d<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(T)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+v)}),a.prototype.readFloatLE=function(h,d){return h=h>>>0,d||Z(h,4,this.length),r.read(this,h,!0,23,4)},a.prototype.readFloatBE=function(h,d){return h=h>>>0,d||Z(h,4,this.length),r.read(this,h,!1,23,4)},a.prototype.readDoubleLE=function(h,d){return h=h>>>0,d||Z(h,8,this.length),r.read(this,h,!0,52,8)},a.prototype.readDoubleBE=function(h,d){return h=h>>>0,d||Z(h,8,this.length),r.read(this,h,!1,52,8)};function le(g,h,d,v,T,U){if(!a.isBuffer(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(h>T||h<U)throw new RangeError('"value" argument is out of bounds');if(d+v>g.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(h,d,v,T){if(h=+h,d=d>>>0,v=v>>>0,!T){const oe=Math.pow(2,8*v)-1;le(this,h,d,v,oe,0)}let U=1,k=0;for(this[d]=h&255;++k<v&&(U*=256);)this[d+k]=h/U&255;return d+v},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(h,d,v,T){if(h=+h,d=d>>>0,v=v>>>0,!T){const oe=Math.pow(2,8*v)-1;le(this,h,d,v,oe,0)}let U=v-1,k=1;for(this[d+U]=h&255;--U>=0&&(k*=256);)this[d+U]=h/k&255;return d+v},a.prototype.writeUint8=a.prototype.writeUInt8=function(h,d,v){return h=+h,d=d>>>0,v||le(this,h,d,1,255,0),this[d]=h&255,d+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(h,d,v){return h=+h,d=d>>>0,v||le(this,h,d,2,65535,0),this[d]=h&255,this[d+1]=h>>>8,d+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(h,d,v){return h=+h,d=d>>>0,v||le(this,h,d,2,65535,0),this[d]=h>>>8,this[d+1]=h&255,d+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(h,d,v){return h=+h,d=d>>>0,v||le(this,h,d,4,4294967295,0),this[d+3]=h>>>24,this[d+2]=h>>>16,this[d+1]=h>>>8,this[d]=h&255,d+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(h,d,v){return h=+h,d=d>>>0,v||le(this,h,d,4,4294967295,0),this[d]=h>>>24,this[d+1]=h>>>16,this[d+2]=h>>>8,this[d+3]=h&255,d+4};function ee(g,h,d,v,T){te(h,v,T,g,d,7);let U=Number(h&BigInt(4294967295));g[d++]=U,U=U>>8,g[d++]=U,U=U>>8,g[d++]=U,U=U>>8,g[d++]=U;let k=Number(h>>BigInt(32)&BigInt(4294967295));return g[d++]=k,k=k>>8,g[d++]=k,k=k>>8,g[d++]=k,k=k>>8,g[d++]=k,d}function pe(g,h,d,v,T){te(h,v,T,g,d,7);let U=Number(h&BigInt(4294967295));g[d+7]=U,U=U>>8,g[d+6]=U,U=U>>8,g[d+5]=U,U=U>>8,g[d+4]=U;let k=Number(h>>BigInt(32)&BigInt(4294967295));return g[d+3]=k,k=k>>8,g[d+2]=k,k=k>>8,g[d+1]=k,k=k>>8,g[d]=k,d+8}a.prototype.writeBigUInt64LE=ge(function(h,d=0){return ee(this,h,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ge(function(h,d=0){return pe(this,h,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(h,d,v,T){if(h=+h,d=d>>>0,!T){const ue=Math.pow(2,8*v-1);le(this,h,d,v,ue-1,-ue)}let U=0,k=1,oe=0;for(this[d]=h&255;++U<v&&(k*=256);)h<0&&oe===0&&this[d+U-1]!==0&&(oe=1),this[d+U]=(h/k>>0)-oe&255;return d+v},a.prototype.writeIntBE=function(h,d,v,T){if(h=+h,d=d>>>0,!T){const ue=Math.pow(2,8*v-1);le(this,h,d,v,ue-1,-ue)}let U=v-1,k=1,oe=0;for(this[d+U]=h&255;--U>=0&&(k*=256);)h<0&&oe===0&&this[d+U+1]!==0&&(oe=1),this[d+U]=(h/k>>0)-oe&255;return d+v},a.prototype.writeInt8=function(h,d,v){return h=+h,d=d>>>0,v||le(this,h,d,1,127,-128),h<0&&(h=255+h+1),this[d]=h&255,d+1},a.prototype.writeInt16LE=function(h,d,v){return h=+h,d=d>>>0,v||le(this,h,d,2,32767,-32768),this[d]=h&255,this[d+1]=h>>>8,d+2},a.prototype.writeInt16BE=function(h,d,v){return h=+h,d=d>>>0,v||le(this,h,d,2,32767,-32768),this[d]=h>>>8,this[d+1]=h&255,d+2},a.prototype.writeInt32LE=function(h,d,v){return h=+h,d=d>>>0,v||le(this,h,d,4,2147483647,-2147483648),this[d]=h&255,this[d+1]=h>>>8,this[d+2]=h>>>16,this[d+3]=h>>>24,d+4},a.prototype.writeInt32BE=function(h,d,v){return h=+h,d=d>>>0,v||le(this,h,d,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[d]=h>>>24,this[d+1]=h>>>16,this[d+2]=h>>>8,this[d+3]=h&255,d+4},a.prototype.writeBigInt64LE=ge(function(h,d=0){return ee(this,h,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ge(function(h,d=0){return pe(this,h,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ae(g,h,d,v,T,U){if(d+v>g.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function Ce(g,h,d,v,T){return h=+h,d=d>>>0,T||ae(g,h,d,4),r.write(g,h,d,v,23,4),d+4}a.prototype.writeFloatLE=function(h,d,v){return Ce(this,h,d,!0,v)},a.prototype.writeFloatBE=function(h,d,v){return Ce(this,h,d,!1,v)};function B(g,h,d,v,T){return h=+h,d=d>>>0,T||ae(g,h,d,8),r.write(g,h,d,v,52,8),d+8}a.prototype.writeDoubleLE=function(h,d,v){return B(this,h,d,!0,v)},a.prototype.writeDoubleBE=function(h,d,v){return B(this,h,d,!1,v)},a.prototype.copy=function(h,d,v,T){if(!a.isBuffer(h))throw new TypeError("argument should be a Buffer");if(v||(v=0),!T&&T!==0&&(T=this.length),d>=h.length&&(d=h.length),d||(d=0),T>0&&T<v&&(T=v),T===v||h.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(T<0)throw new RangeError("sourceEnd out of bounds");T>this.length&&(T=this.length),h.length-d<T-v&&(T=h.length-d+v);const U=T-v;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(d,v,T):Uint8Array.prototype.set.call(h,this.subarray(v,T),d),U},a.prototype.fill=function(h,d,v,T){if(typeof h=="string"){if(typeof d=="string"?(T=d,d=0,v=this.length):typeof v=="string"&&(T=v,v=this.length),T!==void 0&&typeof T!="string")throw new TypeError("encoding must be a string");if(typeof T=="string"&&!a.isEncoding(T))throw new TypeError("Unknown encoding: "+T);if(h.length===1){const k=h.charCodeAt(0);(T==="utf8"&&k<128||T==="latin1")&&(h=k)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(d<0||this.length<d||this.length<v)throw new RangeError("Out of range index");if(v<=d)return this;d=d>>>0,v=v===void 0?this.length:v>>>0,h||(h=0);let U;if(typeof h=="number")for(U=d;U<v;++U)this[U]=h;else{const k=a.isBuffer(h)?h:a.from(h,T),oe=k.length;if(oe===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(U=0;U<v-d;++U)this[U+d]=k[U%oe]}return this};const F={};function R(g,h,d){F[g]=class extends d{constructor(){super(),Object.defineProperty(this,"message",{value:h.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${g}]`,this.stack,delete this.name}get code(){return g}set code(T){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:T,writable:!0})}toString(){return`${this.name} [${g}]: ${this.message}`}}}R("ERR_BUFFER_OUT_OF_BOUNDS",function(g){return g?`${g} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),R("ERR_INVALID_ARG_TYPE",function(g,h){return`The "${g}" argument must be of type number. Received type ${typeof h}`},TypeError),R("ERR_OUT_OF_RANGE",function(g,h,d){let v=`The value of "${g}" is out of range.`,T=d;return Number.isInteger(d)&&Math.abs(d)>2**32?T=f(String(d)):typeof d=="bigint"&&(T=String(d),(d>BigInt(2)**BigInt(32)||d<-(BigInt(2)**BigInt(32)))&&(T=f(T)),T+="n"),v+=` It must be ${h}. Received ${T}`,v},RangeError);function f(g){let h="",d=g.length;const v=g[0]==="-"?1:0;for(;d>=v+4;d-=3)h=`_${g.slice(d-3,d)}${h}`;return`${g.slice(0,d)}${h}`}function P(g,h,d){ie(h,"offset"),(g[h]===void 0||g[h+d]===void 0)&&Ee(h,g.length-(d+1))}function te(g,h,d,v,T,U){if(g>d||g<h){const k=typeof h=="bigint"?"n":"";let oe;throw U>3?h===0||h===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=`>= ${h}${k} and <= ${d}${k}`,new F.ERR_OUT_OF_RANGE("value",oe,g)}P(v,T,U)}function ie(g,h){if(typeof g!="number")throw new F.ERR_INVALID_ARG_TYPE(h,"number",g)}function Ee(g,h,d){throw Math.floor(g)!==g?(ie(g,d),new F.ERR_OUT_OF_RANGE(d||"offset","an integer",g)):h<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE(d||"offset",`>= ${d?1:0} and <= ${h}`,g)}const Le=/[^+/0-9A-Za-z-_]/g;function $e(g){if(g=g.split("=")[0],g=g.trim().replace(Le,""),g.length<2)return"";for(;g.length%4!==0;)g=g+"=";return g}function Me(g,h){h=h||1/0;let d;const v=g.length;let T=null;const U=[];for(let k=0;k<v;++k){if(d=g.charCodeAt(k),d>55295&&d<57344){if(!T){if(d>56319){(h-=3)>-1&&U.push(239,191,189);continue}else if(k+1===v){(h-=3)>-1&&U.push(239,191,189);continue}T=d;continue}if(d<56320){(h-=3)>-1&&U.push(239,191,189),T=d;continue}d=(T-55296<<10|d-56320)+65536}else T&&(h-=3)>-1&&U.push(239,191,189);if(T=null,d<128){if((h-=1)<0)break;U.push(d)}else if(d<2048){if((h-=2)<0)break;U.push(d>>6|192,d&63|128)}else if(d<65536){if((h-=3)<0)break;U.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((h-=4)<0)break;U.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return U}function Ze(g){const h=[];for(let d=0;d<g.length;++d)h.push(g.charCodeAt(d)&255);return h}function Ke(g,h){let d,v,T;const U=[];for(let k=0;k<g.length&&!((h-=2)<0);++k)d=g.charCodeAt(k),v=d>>8,T=d%256,U.push(T),U.push(v);return U}function Pe(g){return e.toByteArray($e(g))}function De(g,h,d,v){let T;for(T=0;T<v&&!(T+d>=h.length||T>=g.length);++T)h[T+d]=g[T];return T}function me(g,h){return g instanceof h||g!=null&&g.constructor!=null&&g.constructor.name!=null&&g.constructor.name===h.name}function Se(g){return g!==g}const Oe=function(){const g="0123456789abcdef",h=new Array(256);for(let d=0;d<16;++d){const v=d*16;for(let T=0;T<16;++T)h[v+T]=g[d]+g[T]}return h}();function ge(g){return typeof BigInt>"u"?xe:g}function xe(){throw new Error("BigInt not supported")}})(r0);const ke=vr({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,isDataLoaded:!1,isUiLoaded:!1,walletConnectVersion:1}),Q={state:ke,subscribe(t){return ui(ke,()=>t(ke))},setChains(t){ke.chains=t},setStandaloneChains(t){ke.standaloneChains=t},setStandaloneUri(t){ke.standaloneUri=t},getSelectedChain(){const t=qe.client().getNetwork().chain;return t&&(ke.selectedChain=t),ke.selectedChain},setSelectedChain(t){ke.selectedChain=t},setIsStandalone(t){ke.isStandalone=t},setIsCustomDesktop(t){ke.isCustomDesktop=t},setIsCustomMobile(t){ke.isCustomMobile=t},getAccount(){const t=qe.client().getAccount();ke.address=t.address,ke.isConnected=t.isConnected},setAddress(t){ke.address=t},setIsConnected(t){ke.isConnected=t},setProfileName(t){ke.profileName=t},setProfileAvatar(t){ke.profileAvatar=t},setProfileLoading(t){ke.profileLoading=t},setBalanceLoading(t){ke.balanceLoading=t},setBalance(t){ke.balance=t},setIsDataLoaded(t){ke.isDataLoaded=t},setIsUiLoaded(t){ke.isUiLoaded=t},setWalletConnectVersion(t){ke.walletConnectVersion=t},resetEnsProfile(){ke.profileName=void 0,ke.profileAvatar=void 0},resetBalance(){ke.balance=void 0},resetAccount(){ke.address=void 0,ke.isConnected=!1,Q.resetEnsProfile(),Q.resetBalance()}},di=vr({initialized:!1,ethereumClient:void 0}),qe={setEthereumClient(t){!di.initialized&&t&&(di.ethereumClient=t,Q.setChains(t.chains),di.initialized=!0)},client(){if(di.ethereumClient)return di.ethereumClient;throw new Error("ClientCtrl has no client set")}},Ue={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 Ue.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(Ue.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(!Ue.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(Ue.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE)},isNull(t){return t===null}};function My(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const fi=vr({projectId:"",themeMode:My()?"dark":"light",themeColor:"default",themeBackground:Ue.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,enableAccountView:!0,defaultChain:void 0,explorerAllowList:void 0,explorerDenyList:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Ve={state:fi,subscribe(t){return ui(fi,()=>t(fi))},setConfig(t){var e,r,n,i;if(Q.setStandaloneChains(t.standaloneChains),Q.setIsStandalone(Boolean((e=t.standaloneChains)==null?void 0:e.length)||Boolean(t.enableStandaloneMode)),Q.setIsCustomMobile(Boolean((r=t.mobileWallets)==null?void 0:r.length)),Q.setIsCustomDesktop(Boolean((n=t.desktopWallets)==null?void 0:n.length)),Q.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),t.defaultChain)Q.setSelectedChain(t.defaultChain);else if(!Q.state.isStandalone){const s=qe.client().getDefaultChain();Q.setSelectedChain(s)}Object.assign(fi,t)},setThemeConfig(t){Object.assign(fi,t)}},i0="https://explorer-api.walletconnect.com";function Uy(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 Cs={async fetchWallets(t,e){const r=Uy(e),n=`${i0}/v3/wallets?projectId=${t}&${r}`;return(await fetch(n)).json()},formatImageUrl(t,e){return`${i0}/v3/logo/lg/${e}?projectId=${t}`}},Br=vr({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},previewWallets:[],recomendedWallets:[]});function Ss(){const{projectId:t}=Ve.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 Cs.fetchWallets(Ss(),t);return Br.previewWallets=Object.values(e),Br.previewWallets},async getRecomendedWallets(){const{listings:t}=await Cs.fetchWallets(Ss(),{page:1,entries:6});Br.recomendedWallets=Object.values(t)},async getPaginatedWallets(t){const{page:e,search:r}=t,{listings:n,total:i}=await Cs.fetchWallets(Ss(),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 Cs.formatImageUrl(Ss(),t)},resetSearch(){Br.search={listings:[],total:0,page:1}}},Ft=vr({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Te={state:Ft,subscribe(t){return ui(Ft,()=>t(Ft))},push(t,e){t!==Ft.view&&(Ft.view=t,e&&(Ft.data=e),Ft.history.push(t))},replace(t){Ft.view=t,Ft.history=[t]},goBack(){if(Ft.history.length>1){Ft.history.pop();const[t]=Ft.history.slice(-1);Ft.view=t}}},gn=vr({open:!1}),pt={state:gn,subscribe(t){return ui(gn,()=>t(gn))},async open(t){return new Promise(e=>{const{isConnected:r,isStandalone:n,isUiLoaded:i,isDataLoaded:s}=Q.state,{enableNetworkView:o}=Ve.state;if(n?(Q.setStandaloneUri(t?.uri),Q.setStandaloneChains(t?.standaloneChains),Te.replace("ConnectWallet")):t!=null&&t.route?Te.replace(t.route):r?Te.replace("Account"):o?Te.replace("SelectNetwork"):Te.replace("ConnectWallet"),i&&s)gn.open=!0,e();else{const a=setInterval(()=>{Q.state.isUiLoaded&&Q.state.isDataLoaded&&(clearInterval(a),gn.open=!0,e())},200)}})},close(){gn.open=!1}},jr=vr({open:!1,message:"",variant:"success"}),Lt={state:jr,subscribe(t){return ui(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=r0.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var Fy=Object.defineProperty,s0=Object.getOwnPropertySymbols,By=Object.prototype.hasOwnProperty,jy=Object.prototype.propertyIsEnumerable,o0=(t,e,r)=>e in t?Fy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ky=(t,e)=>{for(var r in e||(e={}))By.call(e,r)&&o0(t,r,e[r]);if(s0)for(var r of s0(e))jy.call(e,r)&&o0(t,r,e[r]);return t};class Hy{constructor(e){this.openModal=pt.open,this.closeModal=pt.close,this.subscribeModal=pt.subscribe,this.setTheme=Ve.setThemeConfig,Ve.setConfig(ky({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return z_});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),Q.setIsUiLoaded(!0)}}}var zy=Object.freeze({__proto__:null,Web3Modal:Hy});/**
72
72
  * @license
73
73
  * Copyright 2019 Google LLC
74
74
  * SPDX-License-Identifier: BSD-3-Clause
75
- */const Cs=window,Ta=Cs.ShadowRoot&&(Cs.ShadyCSS===void 0||Cs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Na=Symbol(),i0=new WeakMap;class s0{constructor(e,r,n){if(this._$cssResult$=!0,n!==Na)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(Ta&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=i0.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&i0.set(r,e))}return e}toString(){return this.cssText}}const Hb=t=>new s0(typeof t=="string"?t:t+"",void 0,Na),_e=(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 s0(r,t,Na)},zb=(t,e)=>{Ta?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=Cs.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},o0=Ta?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return Hb(r)})(t):t;/**
75
+ */const Is=window,Na=Is.ShadowRoot&&(Is.ShadyCSS===void 0||Is.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ra=Symbol(),a0=new WeakMap;class c0{constructor(e,r,n){if(this._$cssResult$=!0,n!==Ra)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(Na&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=a0.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&a0.set(r,e))}return e}toString(){return this.cssText}}const Wy=t=>new c0(typeof t=="string"?t:t+"",void 0,Ra),_e=(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 c0(r,t,Ra)},qy=(t,e)=>{Na?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=Is.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},l0=Na?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return Wy(r)})(t):t;/**
76
76
  * @license
77
77
  * Copyright 2017 Google LLC
78
78
  * SPDX-License-Identifier: BSD-3-Clause
79
- */var Ra;const Ss=window,a0=Ss.trustedTypes,Wb=a0?a0.emptyScript:"",c0=Ss.reactiveElementPolyfillSupport,La={toAttribute(t,e){switch(e){case Boolean:t=t?Wb: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}},l0=(t,e)=>e!==t&&(e==e||t==t),Ma={attribute:!0,type:String,converter:La,reflect:!1,hasChanged:l0};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=Ma){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)||Ma}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(o0(i))}else e!==void 0&&r.push(o0(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 zb(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=Ma){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:La).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:La;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||l0)(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"},c0?.({ReactiveElement:mn}),((Ra=Ss.reactiveElementVersions)!==null&&Ra!==void 0?Ra:Ss.reactiveElementVersions=[]).push("1.6.1");/**
79
+ */var La;const Ds=window,h0=Ds.trustedTypes,Vy=h0?h0.emptyScript:"",u0=Ds.reactiveElementPolyfillSupport,Ma={toAttribute(t,e){switch(e){case Boolean:t=t?Vy: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}},d0=(t,e)=>e!==t&&(e==e||t==t),Ua={attribute:!0,type:String,converter:Ma,reflect:!1,hasChanged:d0};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=Ua){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)||Ua}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(l0(i))}else e!==void 0&&r.push(l0(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 qy(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=Ua){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:Ma).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:Ma;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||d0)(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"},u0?.({ReactiveElement:mn}),((La=Ds.reactiveElementVersions)!==null&&La!==void 0?La:Ds.reactiveElementVersions=[]).push("1.6.1");/**
80
80
  * @license
81
81
  * Copyright 2017 Google LLC
82
82
  * SPDX-License-Identifier: BSD-3-Clause
83
- */var Ua;const Is=window,wn=Is.trustedTypes,u0=wn?wn.createPolicy("lit-html",{createHTML:t=>t}):void 0,Er=`lit$${(Math.random()+"").slice(9)}$`,h0="?"+Er,qb=`<${h0}>`,yn=document,fi=(t="")=>yn.createComment(t),pi=t=>t===null||typeof t!="object"&&typeof t!="function",d0=Array.isArray,Vb=t=>d0(t)||typeof t?.[Symbol.iterator]=="function",gi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,f0=/-->/g,p0=/>/g,Hr=RegExp(`>|[
83
+ */var Fa;const Os=window,wn=Os.trustedTypes,f0=wn?wn.createPolicy("lit-html",{createHTML:t=>t}):void 0,_r=`lit$${(Math.random()+"").slice(9)}$`,p0="?"+_r,Ky=`<${p0}>`,bn=document,pi=(t="")=>bn.createComment(t),gi=t=>t===null||typeof t!="object"&&typeof t!="function",g0=Array.isArray,Gy=t=>g0(t)||typeof t?.[Symbol.iterator]=="function",mi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,m0=/-->/g,w0=/>/g,kr=RegExp(`>|[
84
84
  \f\r](?:([^\\s"'>=/]+)([
85
85
  \f\r]*=[
86
86
  \f\r]*(?:[^
87
- \f\r"'\`<>=]|("|')|))|$)`,"g"),g0=/'/g,m0=/"/g,w0=/^(?:script|style|textarea|title)$/i,y0=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),V=y0(1),Ae=y0(2),zr=Symbol.for("lit-noChange"),ct=Symbol.for("lit-nothing"),b0=new WeakMap,bn=yn.createTreeWalker(yn,129,null,!1),Kb=(t,e)=>{const r=t.length-1,n=[];let i,s=e===2?"<svg>":"",o=gi;for(let c=0;c<r;c++){const l=t[c];let p,w,y=-1,m=0;for(;m<l.length&&(o.lastIndex=m,w=o.exec(l),w!==null);)m=o.lastIndex,o===gi?w[1]==="!--"?o=f0:w[1]!==void 0?o=p0:w[2]!==void 0?(w0.test(w[2])&&(i=RegExp("</"+w[2],"g")),o=Hr):w[3]!==void 0&&(o=Hr):o===Hr?w[0]===">"?(o=i??gi,y=-1):w[1]===void 0?y=-2:(y=o.lastIndex-w[2].length,p=w[1],o=w[3]===void 0?Hr:w[3]==='"'?m0:g0):o===m0||o===g0?o=Hr:o===f0||o===p0?o=gi:(o=Hr,i=void 0);const E=o===Hr&&t[c+1].startsWith("/>")?" ":"";s+=o===gi?l+qb:y>=0?(n.push(p),l.slice(0,y)+"$lit$"+l.slice(y)+Er+E):l+Er+(y===-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[u0!==void 0?u0.createHTML(a):a,n]};class mi{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]=Kb(e,r);if(this.el=mi.createElement(l,n),bn.currentNode=this.el.content,r===2){const w=this.el.content,y=w.firstChild;y.remove(),w.append(...y.childNodes)}for(;(i=bn.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes()){const w=[];for(const y of i.getAttributeNames())if(y.endsWith("$lit$")||y.startsWith(Er)){const m=p[o++];if(w.push(y),m!==void 0){const E=i.getAttribute(m.toLowerCase()+"$lit$").split(Er),A=/([.?@])?(.*)/.exec(m);c.push({type:1,index:s,name:A[2],strings:E,ctor:A[1]==="."?Yb:A[1]==="?"?Jb:A[1]==="@"?Xb:Ds})}else c.push({type:6,index:s})}for(const y of w)i.removeAttribute(y)}if(w0.test(i.tagName)){const w=i.textContent.split(Er),y=w.length-1;if(y>0){i.textContent=wn?wn.emptyScript:"";for(let m=0;m<y;m++)i.append(w[m],fi()),bn.nextNode(),c.push({type:2,index:++s});i.append(w[y],fi())}}}else if(i.nodeType===8)if(i.data===h0)c.push({type:2,index:s});else{let w=-1;for(;(w=i.data.indexOf(Er,w+1))!==-1;)c.push({type:7,index:s}),w+=Er.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===zr)return e;let c=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const l=pi(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 Gb{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 wi(o,o.nextSibling,this,e):l.type===1?p=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(p=new Qb(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 wi{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),pi(e)?e===ct||e==null||e===""?(this._$AH!==ct&&this._$AR(),this._$AH=ct):e!==this._$AH&&e!==zr&&this.g(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Vb(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&&pi(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=mi.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 Gb(s,this),a=o.v(this.options);o.p(n),this.T(a),this._$AH=o}}_$AC(e){let r=b0.get(e.strings);return r===void 0&&b0.set(e.strings,r=new mi(e)),r}k(e){d0(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 wi(this.O(fi()),this.O(fi()),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 Ds{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=!pi(e)||e!==this._$AH&&e!==zr,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===zr&&(l=this._$AH[c]),o||(o=!pi(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 Yb extends Ds{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ct?void 0:e}}const Zb=wn?wn.emptyScript:"";class Jb extends Ds{constructor(){super(...arguments),this.type=4}j(e){e&&e!==ct?this.element.setAttribute(this.name,Zb):this.element.removeAttribute(this.name)}}class Xb extends Ds{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)===zr)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 Qb{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 v0=Is.litHtmlPolyfillSupport;v0?.(mi,wi),((Ua=Is.litHtmlVersions)!==null&&Ua!==void 0?Ua:Is.litHtmlVersions=[]).push("2.6.1");const ev=(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 wi(e.insertBefore(fi(),a),a,void 0,r??{})}return o._$AI(t),o};/**
87
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),b0=/'/g,y0=/"/g,v0=/^(?:script|style|textarea|title)$/i,_0=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),V=_0(1),Ae=_0(2),Hr=Symbol.for("lit-noChange"),ct=Symbol.for("lit-nothing"),E0=new WeakMap,yn=bn.createTreeWalker(bn,129,null,!1),Zy=(t,e)=>{const r=t.length-1,n=[];let i,s=e===2?"<svg>":"",o=mi;for(let c=0;c<r;c++){const l=t[c];let p,w,b=-1,m=0;for(;m<l.length&&(o.lastIndex=m,w=o.exec(l),w!==null);)m=o.lastIndex,o===mi?w[1]==="!--"?o=m0:w[1]!==void 0?o=w0:w[2]!==void 0?(v0.test(w[2])&&(i=RegExp("</"+w[2],"g")),o=kr):w[3]!==void 0&&(o=kr):o===kr?w[0]===">"?(o=i??mi,b=-1):w[1]===void 0?b=-2:(b=o.lastIndex-w[2].length,p=w[1],o=w[3]===void 0?kr:w[3]==='"'?y0:b0):o===y0||o===b0?o=kr:o===m0||o===w0?o=mi:(o=kr,i=void 0);const E=o===kr&&t[c+1].startsWith("/>")?" ":"";s+=o===mi?l+Ky:b>=0?(n.push(p),l.slice(0,b)+"$lit$"+l.slice(b)+_r+E):l+_r+(b===-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[f0!==void 0?f0.createHTML(a):a,n]};class wi{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]=Zy(e,r);if(this.el=wi.createElement(l,n),yn.currentNode=this.el.content,r===2){const w=this.el.content,b=w.firstChild;b.remove(),w.append(...b.childNodes)}for(;(i=yn.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes()){const w=[];for(const b of i.getAttributeNames())if(b.endsWith("$lit$")||b.startsWith(_r)){const m=p[o++];if(w.push(b),m!==void 0){const E=i.getAttribute(m.toLowerCase()+"$lit$").split(_r),A=/([.?@])?(.*)/.exec(m);c.push({type:1,index:s,name:A[2],strings:E,ctor:A[1]==="."?Jy:A[1]==="?"?Qy:A[1]==="@"?ev:As})}else c.push({type:6,index:s})}for(const b of w)i.removeAttribute(b)}if(v0.test(i.tagName)){const w=i.textContent.split(_r),b=w.length-1;if(b>0){i.textContent=wn?wn.emptyScript:"";for(let m=0;m<b;m++)i.append(w[m],pi()),yn.nextNode(),c.push({type:2,index:++s});i.append(w[b],pi())}}}else if(i.nodeType===8)if(i.data===p0)c.push({type:2,index:s});else{let w=-1;for(;(w=i.data.indexOf(_r,w+1))!==-1;)c.push({type:7,index:s}),w+=_r.length-1}s++}}static createElement(e,r){const n=bn.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=gi(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 Yy{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:bn).importNode(n,!0);yn.currentNode=s;let o=yn.nextNode(),a=0,c=0,l=i[0];for(;l!==void 0;){if(a===l.index){let p;l.type===2?p=new bi(o,o.nextSibling,this,e):l.type===1?p=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(p=new tv(o,this,e)),this.u.push(p),l=i[++c]}a!==l?.index&&(o=yn.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 bi{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),gi(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):Gy(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&&gi(this._$AH)?this._$AA.nextSibling.data=e:this.T(bn.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=wi.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 Yy(s,this),a=o.v(this.options);o.p(n),this.T(a),this._$AH=o}}_$AC(e){let r=E0.get(e.strings);return r===void 0&&E0.set(e.strings,r=new wi(e)),r}k(e){g0(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 bi(this.O(pi()),this.O(pi()),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 As{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=!gi(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=!gi(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 Jy extends As{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ct?void 0:e}}const Xy=wn?wn.emptyScript:"";class Qy extends As{constructor(){super(...arguments),this.type=4}j(e){e&&e!==ct?this.element.setAttribute(this.name,Xy):this.element.removeAttribute(this.name)}}class ev extends As{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 tv{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 x0=Os.litHtmlPolyfillSupport;x0?.(wi,bi),((Fa=Os.litHtmlVersions)!==null&&Fa!==void 0?Fa:Os.litHtmlVersions=[]).push("2.6.1");const rv=(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 bi(e.insertBefore(pi(),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 Fa,Ba;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=ev(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 zr}}de.finalized=!0,de._$litElement$=!0,(Fa=globalThis.litElementHydrateSupport)===null||Fa===void 0||Fa.call(globalThis,{LitElement:de});const _0=globalThis.litElementPolyfillSupport;_0?.({LitElement:de}),((Ba=globalThis.litElementVersions)!==null&&Ba!==void 0?Ba:globalThis.litElementVersions=[]).push("3.2.2");/**
91
+ */var Ba,ja;class fe 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=rv(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}}fe.finalized=!0,fe._$litElement$=!0,(Ba=globalThis.litElementHydrateSupport)===null||Ba===void 0||Ba.call(globalThis,{LitElement:fe});const C0=globalThis.litElementPolyfillSupport;C0?.({LitElement:fe}),((ja=globalThis.litElementVersions)!==null&&ja!==void 0?ja:globalThis.litElementVersions=[]).push("3.2.2");/**
92
92
  * @license
93
93
  * Copyright 2017 Google LLC
94
94
  * SPDX-License-Identifier: BSD-3-Clause
@@ -96,36 +96,36 @@
96
96
  * @license
97
97
  * Copyright 2017 Google LLC
98
98
  * SPDX-License-Identifier: BSD-3-Clause
99
- */const tv=(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 be(t){return(e,r)=>r!==void 0?((n,i,s)=>{i.constructor.createProperty(s,n)})(t,e,r):tv(t,e)}/**
99
+ */const nv=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}};function ye(t){return(e,r)=>r!==void 0?((n,i,s)=>{i.constructor.createProperty(s,n)})(t,e,r):nv(t,e)}/**
100
100
  * @license
101
101
  * Copyright 2017 Google LLC
102
102
  * SPDX-License-Identifier: BSD-3-Clause
103
- */function Be(t){return be({...t,state:!0})}/**
103
+ */function Be(t){return ye({...t,state:!0})}/**
104
104
  * @license
105
105
  * Copyright 2021 Google LLC
106
106
  * SPDX-License-Identifier: BSD-3-Clause
107
- */var ja;((ja=window.HTMLSlotElement)===null||ja===void 0?void 0:ja.prototype.assignedElements)!=null;/**
107
+ */var ka;((ka=window.HTMLSlotElement)===null||ka===void 0?void 0:ka.prototype.assignedElements)!=null;/**
108
108
  * @license
109
109
  * Copyright 2017 Google LLC
110
110
  * SPDX-License-Identifier: BSD-3-Clause
111
- */const rv={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},nv=t=>(...e)=>({_$litDirective$:t,values:e});class iv{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)}}/**
111
+ */const iv={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},sv=t=>(...e)=>({_$litDirective$:t,values:e});class ov{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 Mt=nv(class extends iv{constructor(t){var e;if(super(t),t.type!==rv.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.nt===void 0){this.nt=new Set,t.strings!==void 0&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!(!((r=this.st)===null||r===void 0)&&r.has(s))&&this.nt.add(s);return this.render(e)}const i=t.element.classList;this.nt.forEach(s=>{s in e||(i.remove(s),this.nt.delete(s))});for(const s in e){const o=!!e[s];o===this.nt.has(s)||!((n=this.st)===null||n===void 0)&&n.has(s)||(o?(i.add(s),this.nt.add(s)):(i.remove(s),this.nt.delete(s)))}return zr}});function sv(t,e){t.indexOf(e)===-1&&t.push(e)}const E0=(t,e,r)=>Math.min(Math.max(r,t),e),Kt={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},yi=t=>typeof t=="number",_n=t=>Array.isArray(t)&&!yi(t[0]),ov=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function av(t,e){return _n(t)?t[ov(0,t.length,e)]:t}const x0=(t,e,r)=>-r*t+r*e+t,C0=()=>{},sr=t=>t,ka=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function S0(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=ka(0,e,n);t.push(x0(r,1,i))}}function cv(t){const e=[0];return S0(e,t-1),e}function lv(t,e=cv(t.length),r=sr){const n=t.length,i=n-e.length;return i>0&&S0(e,i),s=>{let o=0;for(;o<n-2&&!(s<e[o+1]);o++);let a=E0(0,1,ka(e[o],e[o+1],s));return a=av(r,o)(a),x0(t[o],t[o+1],a)}}const I0=t=>Array.isArray(t)&&yi(t[0]),Ha=t=>typeof t=="object"&&Boolean(t.createAnimation),Wr=t=>typeof t=="function",D0=t=>typeof t=="string",En={ms:t=>t*1e3,s:t=>t/1e3};function uv(t,e){return e?t*(1e3/e):0}const O0=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,hv=1e-7,dv=12;function fv(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=O0(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>hv&&++a<dv);return o}function bi(t,e,r,n){if(t===e&&r===n)return sr;const i=s=>fv(s,0,1,t,r);return s=>s===0||s===1?s:O0(i(s),e,n)}const pv=(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 E0(0,1,i/t)},A0={ease:bi(.25,.1,.25,1),"ease-in":bi(.42,0,1,1),"ease-in-out":bi(.42,0,.58,1),"ease-out":bi(0,0,.58,1)},gv=/\((.*?)\)/;function $0(t){if(Wr(t))return t;if(I0(t))return bi(...t);if(A0[t])return A0[t];if(t.startsWith("steps")){const e=gv.exec(t);if(e){const r=e[1].split(",");return pv(parseFloat(r[0]),r[1].trim())}}return sr}class P0{constructor(e,r=[0,1],{easing:n,duration:i=Kt.duration,delay:s=Kt.delay,endDelay:o=Kt.endDelay,repeat:a=Kt.repeat,offset:c,direction:l="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=sr,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((w,y)=>{this.resolve=w,this.reject=y}),n=n||Kt.easing,Ha(n)){const w=n.createAnimation(r);n=w.easing,r=w.keyframes||r,i=w.duration||i}this.repeat=a,this.easing=_n(n)?sr:$0(n),this.updateDuration(i);const p=lv(r,c,_n(n)?n.map($0):sr);this.tick=w=>{var y;s=s;let m=0;this.pauseTime!==void 0?m=this.pauseTime:m=(w-this.startTime)*this.rate,this.t=m,m/=1e3,m=Math.max(m-s,0),this.playState==="finished"&&this.pauseTime===void 0&&(m=this.totalDuration);const E=m/this.duration;let A=Math.floor(E),N=E%1;!N&&E>=1&&(N=1),N===1&&A--;const M=A%2;(l==="reverse"||l==="alternate"&&M||l==="alternate-reverse"&&!M)&&(N=1-N);const x=m>=this.totalDuration?1:Math.min(N,1),D=p(this.easing(x));e(D),this.pauseTime===void 0&&(this.playState==="finished"||m>=this.totalDuration+o)?(this.playState="finished",(y=this.resolve)===null||y===void 0||y.call(this,D)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var za=function(){};process.env.NODE_ENV!=="production"&&(za=function(t,e){if(!t)throw new Error(e)});class mv{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Wa=new WeakMap;function T0(t){return Wa.has(t)||Wa.set(t,{transforms:[],values:new Map}),Wa.get(t)}function wv(t,e){return t.has(e)||t.set(e,new mv),t.get(e)}const yv=["","X","Y","Z"],bv=["translate","scale","rotate","skew"],Os={x:"translateX",y:"translateY",z:"translateZ"},N0={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},vv={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:N0,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:sr},skew:N0},xn=new Map,qa=t=>`--motion-${t}`,As=["x","y","z"];bv.forEach(t=>{yv.forEach(e=>{As.push(t+e),xn.set(qa(t+e),vv[t])})});const _v=(t,e)=>As.indexOf(t)-As.indexOf(e),Ev=new Set(As),R0=t=>Ev.has(t),xv=(t,e)=>{Os[e]&&(e=Os[e]);const{transforms:r}=T0(t);sv(r,e),t.style.transform=Cv(r)},Cv=t=>t.sort(_v).reduce(Sv,"").trim(),Sv=(t,e)=>`${t} ${e}(var(${qa(e)}))`,Va=t=>t.startsWith("--"),L0=new Set;function Iv(t){if(!L0.has(t)){L0.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 Ka=(t,e)=>document.createElement("div").animate(t,e),M0={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ka({opacity:[1]})}catch{return!1}return!0},finished:()=>Boolean(Ka({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{Ka({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Ga={},Cn={};for(const t in M0)Cn[t]=()=>(Ga[t]===void 0&&(Ga[t]=M0[t]()),Ga[t]);const Dv=.015,Ov=(t,e)=>{let r="";const n=Math.round(e/Dv);for(let i=0;i<n;i++)r+=t(ka(0,n-1,i))+", ";return r.substring(0,r.length-2)},U0=(t,e)=>Wr(t)?Cn.linearEasing()?`linear(${Ov(t,e)})`:Kt.easing:I0(t)?Av(t):t,Av=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function $v(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const Pv=t=>Array.isArray(t)?t:[t];function $s(t){return Os[t]&&(t=Os[t]),R0(t)?qa(t):t}const Ps={get:(t,e)=>{e=$s(e);let r=Va(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=$s(e),Va(e)?t.style.setProperty(e,r):t.style[e]=r}};function F0(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function B0(t,e){var r;let n=e?.toDefaultUnit||sr;const i=t[t.length-1];if(D0(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 Tv(){return window.__MOTION_DEV_TOOLS_RECORD}function Nv(t,e,r,n={},i){const s=Tv(),o=n.record!==!1&&s;let a,{duration:c=Kt.duration,delay:l=Kt.delay,endDelay:p=Kt.endDelay,repeat:w=Kt.repeat,easing:y=Kt.easing,persist:m=!1,direction:E,offset:A,allowWebkitAcceleration:N=!1}=n;const M=T0(t),x=R0(e);let D=Cn.waapi();x&&xv(t,e);const b=$s(e),I=wv(M.values,b),O=xn.get(b);return F0(I.animation,!(Ha(y)&&I.generator)&&n.record!==!1),()=>{const h=()=>{var j,q;return(q=(j=Ps.get(t,b))!==null&&j!==void 0?j:O?.initialValue)!==null&&q!==void 0?q:0};let _=$v(Pv(r),h);const H=B0(_,O);if(Ha(y)){const j=y.createAnimation(_,e!=="opacity",h,b,I);y=j.easing,_=j.keyframes||_,c=j.duration||c}if(Va(b)&&(Cn.cssRegisterProperty()?Iv(b):D=!1),x&&!Cn.linearEasing()&&(Wr(y)||_n(y)&&y.some(Wr))&&(D=!1),D){O&&(_=_.map(X=>yi(X)?O.toDefaultUnit(X):X)),_.length===1&&(!Cn.partialKeyframes()||o)&&_.unshift(h());const j={delay:En.ms(l),duration:En.ms(c),endDelay:En.ms(p),easing:_n(y)?void 0:U0(y,c),direction:E,iterations:w+1,fill:"both"};a=t.animate({[b]:_,offset:A,easing:_n(y)?y.map(X=>U0(X,c)):void 0},j),a.finished||(a.finished=new Promise((X,re)=>{a.onfinish=X,a.oncancel=re}));const q=_[_.length-1];a.finished.then(()=>{m||(Ps.set(t,b,q),a.cancel())}).catch(C0),N||(a.playbackRate=1.000001)}else if(i&&x)_=_.map(j=>typeof j=="string"?parseFloat(j):j),_.length===1&&_.unshift(parseFloat(h())),a=new i(j=>{Ps.set(t,b,H?H(j):j)},_,Object.assign(Object.assign({},n),{duration:c,easing:y}));else{const j=_[_.length-1];Ps.set(t,b,O&&yi(j)?O.toDefaultUnit(j):j)}return o&&s(t,e,_,{duration:c,delay:l,easing:y,repeat:w,offset:A},"motion-one"),I.setAnimation(a),a}}const Rv=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function j0(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 Lv=t=>t(),k0=(t,e,r=Kt.duration)=>new Proxy({animations:t.map(Lv).filter(Boolean),duration:r,options:e},Uv),Mv=t=>t.animations[0],Uv={get:(t,e)=>{const r=Mv(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(Fv)).catch(C0)),t.finished;case"stop":return()=>{t.animations.forEach(n=>F0(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}},Fv=t=>t.finished;function Bv(t,e,r){return Wr(t)?t(e,r):t}function jv(t){return function(r,n,i={}){r=j0(r);const s=r.length;za(Boolean(s),"No valid element provided."),za(Boolean(n),"No keyframes defined.");const o=[];for(let a=0;a<s;a++){const c=r[a];for(const l in n){const p=Rv(i,l);p.delay=Bv(p.delay,a,s);const w=Nv(c,l,n[l],p,t);o.push(w)}}return k0(o,i,i.duration)}}const kv=jv(P0);function Hv(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 zv=5;function H0(t,e,r){const n=Math.max(e-zv,0);return uv(r-t(n),e-n)}const Sn={stiffness:100,damping:10,mass:1},Wv=(t=Sn.stiffness,e=Sn.damping,r=Sn.mass)=>e/(2*Math.sqrt(t*r));function qv(t,e,r){return t<e&&r>=e||t>e&&r<=e}const Vv=({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=Wv(t,e,r);let y;if(w<1){const m=p*Math.sqrt(1-w*w);y=E=>i-Math.exp(-w*p*E)*((-s+w*p*l)/m*Math.sin(m*E)+l*Math.cos(m*E))}else y=m=>i-Math.exp(-p*m)*(l+(-s+p*l)*m);return m=>{c.current=y(m);const E=m===0?s:H0(y,m,c.current),A=Math.abs(E)<=o,N=Math.abs(i-c.current)<=a;return c.done=A&&N,c.hasReachedTarget=qv(n,i,c.current),c}},Ya=10,Kv=1e4;function Gv(t,e=sr){let r,n=Ya,i=t(0);const s=[e(i.current)];for(;!i.done&&n<Kv;)i=t(n),s.push(e(i.done?i.target:i.current)),r===void 0&&i.hasReachedTarget&&(r=n),n+=Ya;const o=n-Ya;return s.length===1&&s.push(i.current),{keyframes:s,duration:o/1e3,overshootDuration:(r??o)/1e3}}function z0(t){return yi(t)&&!isNaN(t)}function Za(t){return D0(t)?parseFloat(t):t}function Yv(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,Gv(o,a)),e.get(o));return{createAnimation:(o,a=!0,c,l,p)=>{let w,y,m,E=0,A=sr;const N=o.length;if(a){A=B0(o,l?xn.get($s(l)):void 0);const M=o[N-1];if(m=Za(M),N>1&&o[0]!==null)y=Za(o[0]);else{const x=p?.generator;if(x){const{animation:D,generatorStartTime:b}=p,I=D?.startTime||b||0,O=D?.currentTime||performance.now()-I,h=x(O).current;y=h,E=H0(_=>x(_).current,O,h)}else c&&(y=Za(c()))}}if(z0(y)&&z0(m)){const M=i(y,m,E,l?.includes("scale"));w=Object.assign(Object.assign({},s(M,A)),{easing:"linear"}),p&&(p.generator=M,p.generatorStartTime=performance.now())}return w||(w={easing:"ease",duration:s(i(0,100)).overshootDuration}),w}}}}const Ts=Yv(Vv),Zv={any:0,all:1};function Jv(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const s=j0(t),o=new WeakMap,a=l=>{l.forEach(p=>{const w=o.get(p.target);if(p.isIntersecting!==Boolean(w))if(p.isIntersecting){const y=e(p);Wr(y)?o.set(p.target,y):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:Zv[i]});return s.forEach(l=>c.observe(l)),()=>c.disconnect()}function Ja(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function W0(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const Xv={isActive:t=>Boolean(t.inView),subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,s=Hv(n,["once"]);return Jv(t,o=>{if(e(),W0(t,"viewenter",o),!i)return a=>{r(),W0(t,"viewleave",a)}},s)}},q0=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),Ja(t,e,n))};[...Object.keys({inView:Xv,hover:{isActive:t=>Boolean(t.hover),subscribe:(t,{enable:e,disable:r})=>{const n=q0(t,"hoverstart",e),i=q0(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(),Ja(t,"pressend",s),window.removeEventListener("pointerup",n)},i=s=>{e(),Ja(t,"pressstart",s),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function Qv(t,e={}){return k0([()=>{const r=new P0(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function xr(t,e,r){return(Wr(t)?Qv:kv)(t,e,r)}/**
115
+ */const Mt=sv(class extends ov{constructor(t){var e;if(super(t),t.type!==iv.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 av(t,e){t.indexOf(e)===-1&&t.push(e)}const S0=(t,e,r)=>Math.min(Math.max(r,t),e),Gt={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},yi=t=>typeof t=="number",_n=t=>Array.isArray(t)&&!yi(t[0]),cv=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function lv(t,e){return _n(t)?t[cv(0,t.length,e)]:t}const I0=(t,e,r)=>-r*t+r*e+t,D0=()=>{},sr=t=>t,Ha=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function O0(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Ha(0,e,n);t.push(I0(r,1,i))}}function hv(t){const e=[0];return O0(e,t-1),e}function uv(t,e=hv(t.length),r=sr){const n=t.length,i=n-e.length;return i>0&&O0(e,i),s=>{let o=0;for(;o<n-2&&!(s<e[o+1]);o++);let a=S0(0,1,Ha(e[o],e[o+1],s));return a=lv(r,o)(a),I0(t[o],t[o+1],a)}}const A0=t=>Array.isArray(t)&&yi(t[0]),za=t=>typeof t=="object"&&Boolean(t.createAnimation),zr=t=>typeof t=="function",$0=t=>typeof t=="string",En={ms:t=>t*1e3,s:t=>t/1e3};function dv(t,e){return e?t*(1e3/e):0}const P0=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,fv=1e-7,pv=12;function gv(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=P0(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>fv&&++a<pv);return o}function vi(t,e,r,n){if(t===e&&r===n)return sr;const i=s=>gv(s,0,1,t,r);return s=>s===0||s===1?s:P0(i(s),e,n)}const mv=(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 S0(0,1,i/t)},T0={ease:vi(.25,.1,.25,1),"ease-in":vi(.42,0,1,1),"ease-in-out":vi(.42,0,.58,1),"ease-out":vi(0,0,.58,1)},wv=/\((.*?)\)/;function N0(t){if(zr(t))return t;if(A0(t))return vi(...t);if(T0[t])return T0[t];if(t.startsWith("steps")){const e=wv.exec(t);if(e){const r=e[1].split(",");return mv(parseFloat(r[0]),r[1].trim())}}return sr}class R0{constructor(e,r=[0,1],{easing:n,duration:i=Gt.duration,delay:s=Gt.delay,endDelay:o=Gt.endDelay,repeat:a=Gt.repeat,offset:c,direction:l="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=sr,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((w,b)=>{this.resolve=w,this.reject=b}),n=n||Gt.easing,za(n)){const w=n.createAnimation(r);n=w.easing,r=w.keyframes||r,i=w.duration||i}this.repeat=a,this.easing=_n(n)?sr:N0(n),this.updateDuration(i);const p=uv(r,c,_n(n)?n.map(N0):sr);this.tick=w=>{var b;s=s;let m=0;this.pauseTime!==void 0?m=this.pauseTime:m=(w-this.startTime)*this.rate,this.t=m,m/=1e3,m=Math.max(m-s,0),this.playState==="finished"&&this.pauseTime===void 0&&(m=this.totalDuration);const E=m/this.duration;let A=Math.floor(E),N=E%1;!N&&E>=1&&(N=1),N===1&&A--;const M=A%2;(l==="reverse"||l==="alternate"&&M||l==="alternate-reverse"&&!M)&&(N=1-N);const x=m>=this.totalDuration?1:Math.min(N,1),D=p(this.easing(x));e(D),this.pauseTime===void 0&&(this.playState==="finished"||m>=this.totalDuration+o)?(this.playState="finished",(b=this.resolve)===null||b===void 0||b.call(this,D)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var Wa=function(){};process.env.NODE_ENV!=="production"&&(Wa=function(t,e){if(!t)throw new Error(e)});class bv{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const qa=new WeakMap;function L0(t){return qa.has(t)||qa.set(t,{transforms:[],values:new Map}),qa.get(t)}function yv(t,e){return t.has(e)||t.set(e,new bv),t.get(e)}const vv=["","X","Y","Z"],_v=["translate","scale","rotate","skew"],$s={x:"translateX",y:"translateY",z:"translateZ"},M0={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},Ev={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:M0,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:sr},skew:M0},xn=new Map,Va=t=>`--motion-${t}`,Ps=["x","y","z"];_v.forEach(t=>{vv.forEach(e=>{Ps.push(t+e),xn.set(Va(t+e),Ev[t])})});const xv=(t,e)=>Ps.indexOf(t)-Ps.indexOf(e),Cv=new Set(Ps),U0=t=>Cv.has(t),Sv=(t,e)=>{$s[e]&&(e=$s[e]);const{transforms:r}=L0(t);av(r,e),t.style.transform=Iv(r)},Iv=t=>t.sort(xv).reduce(Dv,"").trim(),Dv=(t,e)=>`${t} ${e}(var(${Va(e)}))`,Ka=t=>t.startsWith("--"),F0=new Set;function Ov(t){if(!F0.has(t)){F0.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 Ga=(t,e)=>document.createElement("div").animate(t,e),B0={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ga({opacity:[1]})}catch{return!1}return!0},finished:()=>Boolean(Ga({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{Ga({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Za={},Cn={};for(const t in B0)Cn[t]=()=>(Za[t]===void 0&&(Za[t]=B0[t]()),Za[t]);const Av=.015,$v=(t,e)=>{let r="";const n=Math.round(e/Av);for(let i=0;i<n;i++)r+=t(Ha(0,n-1,i))+", ";return r.substring(0,r.length-2)},j0=(t,e)=>zr(t)?Cn.linearEasing()?`linear(${$v(t,e)})`:Gt.easing:A0(t)?Pv(t):t,Pv=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function Tv(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const Nv=t=>Array.isArray(t)?t:[t];function Ts(t){return $s[t]&&(t=$s[t]),U0(t)?Va(t):t}const Ns={get:(t,e)=>{e=Ts(e);let r=Ka(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=Ts(e),Ka(e)?t.style.setProperty(e,r):t.style[e]=r}};function k0(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function H0(t,e){var r;let n=e?.toDefaultUnit||sr;const i=t[t.length-1];if($0(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 Rv(){return window.__MOTION_DEV_TOOLS_RECORD}function Lv(t,e,r,n={},i){const s=Rv(),o=n.record!==!1&&s;let a,{duration:c=Gt.duration,delay:l=Gt.delay,endDelay:p=Gt.endDelay,repeat:w=Gt.repeat,easing:b=Gt.easing,persist:m=!1,direction:E,offset:A,allowWebkitAcceleration:N=!1}=n;const M=L0(t),x=U0(e);let D=Cn.waapi();x&&Sv(t,e);const y=Ts(e),I=yv(M.values,y),O=xn.get(y);return k0(I.animation,!(za(b)&&I.generator)&&n.record!==!1),()=>{const u=()=>{var j,q;return(q=(j=Ns.get(t,y))!==null&&j!==void 0?j:O?.initialValue)!==null&&q!==void 0?q:0};let _=Tv(Nv(r),u);const H=H0(_,O);if(za(b)){const j=b.createAnimation(_,e!=="opacity",u,y,I);b=j.easing,_=j.keyframes||_,c=j.duration||c}if(Ka(y)&&(Cn.cssRegisterProperty()?Ov(y):D=!1),x&&!Cn.linearEasing()&&(zr(b)||_n(b)&&b.some(zr))&&(D=!1),D){O&&(_=_.map(X=>yi(X)?O.toDefaultUnit(X):X)),_.length===1&&(!Cn.partialKeyframes()||o)&&_.unshift(u());const j={delay:En.ms(l),duration:En.ms(c),endDelay:En.ms(p),easing:_n(b)?void 0:j0(b,c),direction:E,iterations:w+1,fill:"both"};a=t.animate({[y]:_,offset:A,easing:_n(b)?b.map(X=>j0(X,c)):void 0},j),a.finished||(a.finished=new Promise((X,re)=>{a.onfinish=X,a.oncancel=re}));const q=_[_.length-1];a.finished.then(()=>{m||(Ns.set(t,y,q),a.cancel())}).catch(D0),N||(a.playbackRate=1.000001)}else if(i&&x)_=_.map(j=>typeof j=="string"?parseFloat(j):j),_.length===1&&_.unshift(parseFloat(u())),a=new i(j=>{Ns.set(t,y,H?H(j):j)},_,Object.assign(Object.assign({},n),{duration:c,easing:b}));else{const j=_[_.length-1];Ns.set(t,y,O&&yi(j)?O.toDefaultUnit(j):j)}return o&&s(t,e,_,{duration:c,delay:l,easing:b,repeat:w,offset:A},"motion-one"),I.setAnimation(a),a}}const Mv=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function z0(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 Uv=t=>t(),W0=(t,e,r=Gt.duration)=>new Proxy({animations:t.map(Uv).filter(Boolean),duration:r,options:e},Bv),Fv=t=>t.animations[0],Bv={get:(t,e)=>{const r=Fv(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(jv)).catch(D0)),t.finished;case"stop":return()=>{t.animations.forEach(n=>k0(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}},jv=t=>t.finished;function kv(t,e,r){return zr(t)?t(e,r):t}function Hv(t){return function(r,n,i={}){r=z0(r);const s=r.length;Wa(Boolean(s),"No valid element provided."),Wa(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=Mv(i,l);p.delay=kv(p.delay,a,s);const w=Lv(c,l,n[l],p,t);o.push(w)}}return W0(o,i,i.duration)}}const zv=Hv(R0);function Wv(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 qv=5;function q0(t,e,r){const n=Math.max(e-qv,0);return dv(r-t(n),e-n)}const Sn={stiffness:100,damping:10,mass:1},Vv=(t=Sn.stiffness,e=Sn.damping,r=Sn.mass)=>e/(2*Math.sqrt(t*r));function Kv(t,e,r){return t<e&&r>=e||t>e&&r<=e}const Gv=({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=Vv(t,e,r);let b;if(w<1){const m=p*Math.sqrt(1-w*w);b=E=>i-Math.exp(-w*p*E)*((-s+w*p*l)/m*Math.sin(m*E)+l*Math.cos(m*E))}else b=m=>i-Math.exp(-p*m)*(l+(-s+p*l)*m);return m=>{c.current=b(m);const E=m===0?s:q0(b,m,c.current),A=Math.abs(E)<=o,N=Math.abs(i-c.current)<=a;return c.done=A&&N,c.hasReachedTarget=Kv(n,i,c.current),c}},Ya=10,Zv=1e4;function Yv(t,e=sr){let r,n=Ya,i=t(0);const s=[e(i.current)];for(;!i.done&&n<Zv;)i=t(n),s.push(e(i.done?i.target:i.current)),r===void 0&&i.hasReachedTarget&&(r=n),n+=Ya;const o=n-Ya;return s.length===1&&s.push(i.current),{keyframes:s,duration:o/1e3,overshootDuration:(r??o)/1e3}}function V0(t){return yi(t)&&!isNaN(t)}function Ja(t){return $0(t)?parseFloat(t):t}function Jv(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,Yv(o,a)),e.get(o));return{createAnimation:(o,a=!0,c,l,p)=>{let w,b,m,E=0,A=sr;const N=o.length;if(a){A=H0(o,l?xn.get(Ts(l)):void 0);const M=o[N-1];if(m=Ja(M),N>1&&o[0]!==null)b=Ja(o[0]);else{const x=p?.generator;if(x){const{animation:D,generatorStartTime:y}=p,I=D?.startTime||y||0,O=D?.currentTime||performance.now()-I,u=x(O).current;b=u,E=q0(_=>x(_).current,O,u)}else c&&(b=Ja(c()))}}if(V0(b)&&V0(m)){const M=i(b,m,E,l?.includes("scale"));w=Object.assign(Object.assign({},s(M,A)),{easing:"linear"}),p&&(p.generator=M,p.generatorStartTime=performance.now())}return w||(w={easing:"ease",duration:s(i(0,100)).overshootDuration}),w}}}}const Rs=Jv(Gv),Xv={any:0,all:1};function Qv(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const s=z0(t),o=new WeakMap,a=l=>{l.forEach(p=>{const w=o.get(p.target);if(p.isIntersecting!==Boolean(w))if(p.isIntersecting){const b=e(p);zr(b)?o.set(p.target,b):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:Xv[i]});return s.forEach(l=>c.observe(l)),()=>c.disconnect()}function Xa(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function K0(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const e6={isActive:t=>Boolean(t.inView),subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,s=Wv(n,["once"]);return Qv(t,o=>{if(e(),K0(t,"viewenter",o),!i)return a=>{r(),K0(t,"viewleave",a)}},s)}},G0=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),Xa(t,e,n))};[...Object.keys({inView:e6,hover:{isActive:t=>Boolean(t.hover),subscribe:(t,{enable:e,disable:r})=>{const n=G0(t,"hoverstart",e),i=G0(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(),Xa(t,"pressend",s),window.removeEventListener("pointerup",n)},i=s=>{e(),Xa(t,"pressstart",s),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function t6(t,e={}){return W0([()=>{const r=new R0(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function Er(t,e,r){return(zr(t)?t6:zv)(t,e,r)}/**
116
116
  * @license
117
117
  * Copyright 2018 Google LLC
118
118
  * SPDX-License-Identifier: BSD-3-Clause
119
- */const Bt=t=>t??ct;var vi={},e6=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},V0={},jt={};let Xa;const t6=[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];jt.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},jt.getSymbolTotalCodewords=function(e){return t6[e]},jt.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},jt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Xa=e},jt.isKanjiModeEnabled=function(){return typeof Xa<"u"},jt.toSJIS=function(e){return Xa(e)};var Ns={};(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}}})(Ns);function K0(){this.buffer=[],this.length=0}K0.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 r6=K0;function _i(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}_i.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},_i.prototype.get=function(t,e){return this.data[t*this.size+e]},_i.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},_i.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var n6=_i,G0={};(function(t){const e=jt.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}})(G0);var Y0={};const i6=jt.getSymbolSize,Z0=7;Y0.getPositions=function(e){const r=i6(e);return[[0,0],[r-Z0,0],[0,r-Z0]]};var J0={};(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 y=0;y<s;y++){let m=i.get(w,y);m===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=m,a=1),m=i.get(y,w),m===p?c++:(c>=5&&(o+=e.N1+(c-5)),p=m,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}})(J0);var Rs={};const Cr=Ns,Ls=[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],Ms=[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];Rs.getBlocksCount=function(e,r){switch(r){case Cr.L:return Ls[(e-1)*4+0];case Cr.M:return Ls[(e-1)*4+1];case Cr.Q:return Ls[(e-1)*4+2];case Cr.H:return Ls[(e-1)*4+3];default:return}},Rs.getTotalCodewordsCount=function(e,r){switch(r){case Cr.L:return Ms[(e-1)*4+0];case Cr.M:return Ms[(e-1)*4+1];case Cr.Q:return Ms[(e-1)*4+2];case Cr.H:return Ms[(e-1)*4+3];default:return}};var X0={},Us={};const Ei=new Uint8Array(512),Fs=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)Ei[r]=e,Fs[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)Ei[r]=Ei[r-255]})(),Us.log=function(e){if(e<1)throw new Error("log("+e+")");return Fs[e]},Us.exp=function(e){return Ei[e]},Us.mul=function(e,r){return e===0||r===0?0:Ei[Fs[e]+Fs[r]]},function(t){const e=Us;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}}(X0);const Q0=X0;function Qa(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Qa.prototype.initialize=function(e){this.degree=e,this.genPoly=Q0.generateECPolynomial(this.degree)},Qa.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=Q0.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 s6=Qa,ed={},Sr={},ec={};ec.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var or={};const td="[0-9]+",o6="[A-Z $%*+\\-./:]+";let xi="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";xi=xi.replace(/u/g,"\\u");const a6="(?:(?![A-Z0-9 $%*+\\-./:]|"+xi+`)(?:.|[\r
120
- ]))+`;or.KANJI=new RegExp(xi,"g"),or.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),or.BYTE=new RegExp(a6,"g"),or.NUMERIC=new RegExp(td,"g"),or.ALPHANUMERIC=new RegExp(o6,"g");const c6=new RegExp("^"+xi+"$"),l6=new RegExp("^"+td+"$"),u6=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");or.testKanji=function(e){return c6.test(e)},or.testNumeric=function(e){return l6.test(e)},or.testAlphanumeric=function(e){return u6.test(e)},function(t){const e=ec,r=or;t.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(s,o){if(t.isValid(s))return s;try{return n(s)}catch{return o}}}(Sr),function(t){const e=jt,r=Rs,n=Ns,i=Sr,s=ec,o=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,a=e.getBCHDigit(o);function c(y,m,E){for(let A=1;A<=40;A++)if(m<=t.getCapacity(A,E,y))return A}function l(y,m){return i.getCharCountIndicator(y,m)+4}function p(y,m){let E=0;return y.forEach(function(A){const N=l(A.mode,m);E+=N+A.getBitsLength()}),E}function w(y,m){for(let E=1;E<=40;E++)if(p(y,E)<=t.getCapacity(E,m,i.MIXED))return E}t.from=function(m,E){return s.isValid(m)?parseInt(m,10):E},t.getCapacity=function(m,E,A){if(!s.isValid(m))throw new Error("Invalid QR Code version");typeof A>"u"&&(A=i.BYTE);const N=e.getSymbolTotalCodewords(m),M=r.getTotalCodewordsCount(m,E),x=(N-M)*8;if(A===i.MIXED)return x;const D=x-l(A,m);switch(A){case i.NUMERIC:return Math.floor(D/10*3);case i.ALPHANUMERIC:return Math.floor(D/11*2);case i.KANJI:return Math.floor(D/13);case i.BYTE:default:return Math.floor(D/8)}},t.getBestVersionForData=function(m,E){let A;const N=n.from(E,n.M);if(Array.isArray(m)){if(m.length>1)return w(m,N);if(m.length===0)return 1;A=m[0]}else A=m;return c(A.mode,A.getLength(),N)},t.getEncodedBits=function(m){if(!s.isValid(m)||m<7)throw new Error("Invalid QR Code version");let E=m<<12;for(;e.getBCHDigit(E)-a>=0;)E^=o<<e.getBCHDigit(E)-a;return m<<12|E}}(ed);var rd={};const tc=jt,nd=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,h6=1<<14|1<<12|1<<10|1<<4|1<<1,id=tc.getBCHDigit(nd);rd.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;tc.getBCHDigit(i)-id>=0;)i^=nd<<tc.getBCHDigit(i)-id;return(n<<10|i)^h6};var sd={};const d6=Sr;function In(t){this.mode=d6.NUMERIC,this.data=t.toString()}In.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},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,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 f6=In;const p6=Sr,rc=["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 Dn(t){this.mode=p6.ALPHANUMERIC,this.data=t}Dn.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},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;for(r=0;r+2<=this.data.length;r+=2){let n=rc.indexOf(this.data[r])*45;n+=rc.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(rc.indexOf(this.data[r]),6)};var g6=Dn,m6=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 w6=m6,y6=Sr;function On(t){this.mode=y6.BYTE,typeof t=="string"&&(t=w6(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 b6=On;const v6=Sr,_6=jt;function An(t){this.mode=v6.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=_6.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 E6=An,od={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,y,m,E,A,N;!a.empty();){c=a.pop(),l=c.value,w=c.cost,y=r[l]||{};for(p in y)y.hasOwnProperty(p)&&(m=y[p],E=w+m,A=o[p],N=typeof o[p]>"u",(N||A>E)&&(o[p]=E,a.push(p,E),s[p]=l))}if(typeof i<"u"&&typeof o[i]>"u"){var M=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(M)}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})(od),function(t){const e=Sr,r=f6,n=g6,i=b6,s=E6,o=or,a=jt,c=od.exports;function l(M){return unescape(encodeURIComponent(M)).length}function p(M,x,D){const b=[];let I;for(;(I=M.exec(D))!==null;)b.push({data:I[0],index:I.index,mode:x,length:I[0].length});return b}function w(M){const x=p(o.NUMERIC,e.NUMERIC,M),D=p(o.ALPHANUMERIC,e.ALPHANUMERIC,M);let b,I;return a.isKanjiModeEnabled()?(b=p(o.BYTE,e.BYTE,M),I=p(o.KANJI,e.KANJI,M)):(b=p(o.BYTE_KANJI,e.BYTE,M),I=[]),x.concat(D,b,I).sort(function(h,_){return h.index-_.index}).map(function(h){return{data:h.data,mode:h.mode,length:h.length}})}function y(M,x){switch(x){case e.NUMERIC:return r.getBitsLength(M);case e.ALPHANUMERIC:return n.getBitsLength(M);case e.KANJI:return s.getBitsLength(M);case e.BYTE:return i.getBitsLength(M)}}function m(M){return M.reduce(function(x,D){const b=x.length-1>=0?x[x.length-1]:null;return b&&b.mode===D.mode?(x[x.length-1].data+=D.data,x):(x.push(D),x)},[])}function E(M){const x=[];for(let D=0;D<M.length;D++){const b=M[D];switch(b.mode){case e.NUMERIC:x.push([b,{data:b.data,mode:e.ALPHANUMERIC,length:b.length},{data:b.data,mode:e.BYTE,length:b.length}]);break;case e.ALPHANUMERIC:x.push([b,{data:b.data,mode:e.BYTE,length:b.length}]);break;case e.KANJI:x.push([b,{data:b.data,mode:e.BYTE,length:l(b.data)}]);break;case e.BYTE:x.push([{data:b.data,mode:e.BYTE,length:l(b.data)}])}}return x}function A(M,x){const D={},b={start:{}};let I=["start"];for(let O=0;O<M.length;O++){const h=M[O],_=[];for(let H=0;H<h.length;H++){const j=h[H],q=""+O+H;_.push(q),D[q]={node:j,lastCount:0},b[q]={};for(let X=0;X<I.length;X++){const re=I[X];D[re]&&D[re].node.mode===j.mode?(b[re][q]=y(D[re].lastCount+j.length,j.mode)-y(D[re].lastCount,j.mode),D[re].lastCount+=j.length):(D[re]&&(D[re].lastCount=j.length),b[re][q]=y(j.length,j.mode)+4+e.getCharCountIndicator(j.mode,x))}}I=_}for(let O=0;O<I.length;O++)b[I[O]].end=0;return{map:b,table:D}}function N(M,x){let D;const b=e.getBestModeForData(M);if(D=e.from(x,b),D!==e.BYTE&&D.bit<b.bit)throw new Error('"'+M+'" cannot be encoded with mode '+e.toString(D)+`.
122
- Suggested mode is: `+e.toString(b));switch(D===e.KANJI&&!a.isKanjiModeEnabled()&&(D=e.BYTE),D){case e.NUMERIC:return new r(M);case e.ALPHANUMERIC:return new n(M);case e.KANJI:return new s(M);case e.BYTE:return new i(M)}}t.fromArray=function(x){return x.reduce(function(D,b){return typeof b=="string"?D.push(N(b,null)):b.data&&D.push(N(b.data,b.mode)),D},[])},t.fromString=function(x,D){const b=w(x,a.isKanjiModeEnabled()),I=E(b),O=A(I,D),h=c.find_path(O.map,"start","end"),_=[];for(let H=1;H<h.length-1;H++)_.push(O.table[h[H]].node);return t.fromArray(m(_))},t.rawSplit=function(x){return t.fromArray(w(x,a.isKanjiModeEnabled()))}}(sd);const Bs=jt,nc=Ns,x6=r6,C6=n6,S6=G0,I6=Y0,ic=J0,sc=Rs,D6=s6,js=ed,O6=rd,A6=Sr,oc=sd;function $6(t,e){const r=t.size,n=I6.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 P6(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 T6(t,e){const r=S6.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 N6(t,e){const r=t.size,n=js.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 ac(t,e,r){const n=t.size,i=O6.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 R6(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 L6(t,e,r){const n=new x6;r.forEach(function(c){n.put(c.mode.bit,4),n.put(c.getLength(),A6.getCharCountIndicator(c.mode,t)),c.write(n)});const i=Bs.getSymbolTotalCodewords(t),s=sc.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 M6(n,t,e)}function M6(t,e,r){const n=Bs.getSymbolTotalCodewords(e),i=sc.getTotalCodewordsCount(e,r),s=n-i,o=sc.getBlocksCount(e,r),a=n%o,c=o-a,l=Math.floor(n/o),p=Math.floor(s/o),w=p+1,y=l-p,m=new D6(y);let E=0;const A=new Array(o),N=new Array(o);let M=0;const x=new Uint8Array(t.buffer);for(let h=0;h<o;h++){const _=h<c?p:w;A[h]=x.slice(E,E+_),N[h]=m.encode(A[h]),E+=_,M=Math.max(M,_)}const D=new Uint8Array(n);let b=0,I,O;for(I=0;I<M;I++)for(O=0;O<o;O++)I<A[O].length&&(D[b++]=A[O][I]);for(I=0;I<y;I++)for(O=0;O<o;O++)D[b++]=N[O][I];return D}function U6(t,e,r,n){let i;if(Array.isArray(t))i=oc.fromArray(t);else if(typeof t=="string"){let l=e;if(!l){const p=oc.rawSplit(t);l=js.getBestVersionForData(p,r)}i=oc.fromString(t,l||40)}else throw new Error("Invalid data");const s=js.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(`
119
+ */const Bt=t=>t??ct;var _i={},r6=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Z0={},jt={};let Qa;const n6=[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];jt.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},jt.getSymbolTotalCodewords=function(e){return n6[e]},jt.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},jt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Qa=e},jt.isKanjiModeEnabled=function(){return typeof Qa<"u"},jt.toSJIS=function(e){return Qa(e)};var Ls={};(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}}})(Ls);function Y0(){this.buffer=[],this.length=0}Y0.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 i6=Y0;function Ei(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)}Ei.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},Ei.prototype.get=function(t,e){return this.data[t*this.size+e]},Ei.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},Ei.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var s6=Ei,J0={};(function(t){const e=jt.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}})(J0);var X0={};const o6=jt.getSymbolSize,Q0=7;X0.getPositions=function(e){const r=o6(e);return[[0,0],[r-Q0,0],[0,r-Q0]]};var ed={};(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 b=0;b<s;b++){let m=i.get(w,b);m===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=m,a=1),m=i.get(b,w),m===p?c++:(c>=5&&(o+=e.N1+(c-5)),p=m,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}})(ed);var Ms={};const xr=Ls,Us=[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],Fs=[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];Ms.getBlocksCount=function(e,r){switch(r){case xr.L:return Us[(e-1)*4+0];case xr.M:return Us[(e-1)*4+1];case xr.Q:return Us[(e-1)*4+2];case xr.H:return Us[(e-1)*4+3];default:return}},Ms.getTotalCodewordsCount=function(e,r){switch(r){case xr.L:return Fs[(e-1)*4+0];case xr.M:return Fs[(e-1)*4+1];case xr.Q:return Fs[(e-1)*4+2];case xr.H:return Fs[(e-1)*4+3];default:return}};var td={},Bs={};const xi=new Uint8Array(512),js=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)xi[r]=e,js[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)xi[r]=xi[r-255]})(),Bs.log=function(e){if(e<1)throw new Error("log("+e+")");return js[e]},Bs.exp=function(e){return xi[e]},Bs.mul=function(e,r){return e===0||r===0?0:xi[js[e]+js[r]]},function(t){const e=Bs;t.mul=function(n,i){const s=new Uint8Array(n.length+i.length-1);for(let o=0;o<n.length;o++)for(let a=0;a<i.length;a++)s[o+a]^=e.mul(n[o],i[a]);return s},t.mod=function(n,i){let s=new Uint8Array(n);for(;s.length-i.length>=0;){const o=s[0];for(let c=0;c<i.length;c++)s[c]^=e.mul(i[c],o);let a=0;for(;a<s.length&&s[a]===0;)a++;s=s.slice(a)}return s},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let s=0;s<n;s++)i=t.mul(i,new Uint8Array([1,e.exp(s)]));return i}}(td);const rd=td;function ec(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}ec.prototype.initialize=function(e){this.degree=e,this.genPoly=rd.generateECPolynomial(this.degree)},ec.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const n=rd.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const s=new Uint8Array(this.degree);return s.set(n,i),s}return n};var a6=ec,nd={},Cr={},tc={};tc.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var or={};const id="[0-9]+",c6="[A-Z $%*+\\-./:]+";let Ci="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ci=Ci.replace(/u/g,"\\u");const l6="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ci+`)(?:.|[\r
120
+ ]))+`;or.KANJI=new RegExp(Ci,"g"),or.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),or.BYTE=new RegExp(l6,"g"),or.NUMERIC=new RegExp(id,"g"),or.ALPHANUMERIC=new RegExp(c6,"g");const h6=new RegExp("^"+Ci+"$"),u6=new RegExp("^"+id+"$"),d6=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");or.testKanji=function(e){return h6.test(e)},or.testNumeric=function(e){return u6.test(e)},or.testAlphanumeric=function(e){return d6.test(e)},function(t){const e=tc,r=or;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}}}(Cr),function(t){const e=jt,r=Ms,n=Ls,i=Cr,s=tc,o=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,a=e.getBCHDigit(o);function c(b,m,E){for(let A=1;A<=40;A++)if(m<=t.getCapacity(A,E,b))return A}function l(b,m){return i.getCharCountIndicator(b,m)+4}function p(b,m){let E=0;return b.forEach(function(A){const N=l(A.mode,m);E+=N+A.getBitsLength()}),E}function w(b,m){for(let E=1;E<=40;E++)if(p(b,E)<=t.getCapacity(E,m,i.MIXED))return E}t.from=function(m,E){return s.isValid(m)?parseInt(m,10):E},t.getCapacity=function(m,E,A){if(!s.isValid(m))throw new Error("Invalid QR Code version");typeof A>"u"&&(A=i.BYTE);const N=e.getSymbolTotalCodewords(m),M=r.getTotalCodewordsCount(m,E),x=(N-M)*8;if(A===i.MIXED)return x;const D=x-l(A,m);switch(A){case i.NUMERIC:return Math.floor(D/10*3);case i.ALPHANUMERIC:return Math.floor(D/11*2);case i.KANJI:return Math.floor(D/13);case i.BYTE:default:return Math.floor(D/8)}},t.getBestVersionForData=function(m,E){let A;const N=n.from(E,n.M);if(Array.isArray(m)){if(m.length>1)return w(m,N);if(m.length===0)return 1;A=m[0]}else A=m;return c(A.mode,A.getLength(),N)},t.getEncodedBits=function(m){if(!s.isValid(m)||m<7)throw new Error("Invalid QR Code version");let E=m<<12;for(;e.getBCHDigit(E)-a>=0;)E^=o<<e.getBCHDigit(E)-a;return m<<12|E}}(nd);var sd={};const rc=jt,od=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,f6=1<<14|1<<12|1<<10|1<<4|1<<1,ad=rc.getBCHDigit(od);sd.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;rc.getBCHDigit(i)-ad>=0;)i^=od<<rc.getBCHDigit(i)-ad;return(n<<10|i)^f6};var cd={};const p6=Cr;function In(t){this.mode=p6.NUMERIC,this.data=t.toString()}In.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},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,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 g6=In;const m6=Cr,nc=["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 Dn(t){this.mode=m6.ALPHANUMERIC,this.data=t}Dn.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},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;for(r=0;r+2<=this.data.length;r+=2){let n=nc.indexOf(this.data[r])*45;n+=nc.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(nc.indexOf(this.data[r]),6)};var w6=Dn,b6=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 y6=b6,v6=Cr;function On(t){this.mode=v6.BYTE,typeof t=="string"&&(t=y6(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 _6=On;const E6=Cr,x6=jt;function An(t){this.mode=E6.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=x6.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 C6=An,ld={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,b,m,E,A,N;!a.empty();){c=a.pop(),l=c.value,w=c.cost,b=r[l]||{};for(p in b)b.hasOwnProperty(p)&&(m=b[p],E=w+m,A=o[p],N=typeof o[p]>"u",(N||A>E)&&(o[p]=E,a.push(p,E),s[p]=l))}if(typeof i<"u"&&typeof o[i]>"u"){var M=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(M)}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})(ld),function(t){const e=Cr,r=g6,n=w6,i=_6,s=C6,o=or,a=jt,c=ld.exports;function l(M){return unescape(encodeURIComponent(M)).length}function p(M,x,D){const y=[];let I;for(;(I=M.exec(D))!==null;)y.push({data:I[0],index:I.index,mode:x,length:I[0].length});return y}function w(M){const x=p(o.NUMERIC,e.NUMERIC,M),D=p(o.ALPHANUMERIC,e.ALPHANUMERIC,M);let y,I;return a.isKanjiModeEnabled()?(y=p(o.BYTE,e.BYTE,M),I=p(o.KANJI,e.KANJI,M)):(y=p(o.BYTE_KANJI,e.BYTE,M),I=[]),x.concat(D,y,I).sort(function(u,_){return u.index-_.index}).map(function(u){return{data:u.data,mode:u.mode,length:u.length}})}function b(M,x){switch(x){case e.NUMERIC:return r.getBitsLength(M);case e.ALPHANUMERIC:return n.getBitsLength(M);case e.KANJI:return s.getBitsLength(M);case e.BYTE:return i.getBitsLength(M)}}function m(M){return M.reduce(function(x,D){const y=x.length-1>=0?x[x.length-1]:null;return y&&y.mode===D.mode?(x[x.length-1].data+=D.data,x):(x.push(D),x)},[])}function E(M){const x=[];for(let D=0;D<M.length;D++){const y=M[D];switch(y.mode){case e.NUMERIC:x.push([y,{data:y.data,mode:e.ALPHANUMERIC,length:y.length},{data:y.data,mode:e.BYTE,length:y.length}]);break;case e.ALPHANUMERIC:x.push([y,{data:y.data,mode:e.BYTE,length:y.length}]);break;case e.KANJI:x.push([y,{data:y.data,mode:e.BYTE,length:l(y.data)}]);break;case e.BYTE:x.push([{data:y.data,mode:e.BYTE,length:l(y.data)}])}}return x}function A(M,x){const D={},y={start:{}};let I=["start"];for(let O=0;O<M.length;O++){const u=M[O],_=[];for(let H=0;H<u.length;H++){const j=u[H],q=""+O+H;_.push(q),D[q]={node:j,lastCount:0},y[q]={};for(let X=0;X<I.length;X++){const re=I[X];D[re]&&D[re].node.mode===j.mode?(y[re][q]=b(D[re].lastCount+j.length,j.mode)-b(D[re].lastCount,j.mode),D[re].lastCount+=j.length):(D[re]&&(D[re].lastCount=j.length),y[re][q]=b(j.length,j.mode)+4+e.getCharCountIndicator(j.mode,x))}}I=_}for(let O=0;O<I.length;O++)y[I[O]].end=0;return{map:y,table:D}}function N(M,x){let D;const y=e.getBestModeForData(M);if(D=e.from(x,y),D!==e.BYTE&&D.bit<y.bit)throw new Error('"'+M+'" cannot be encoded with mode '+e.toString(D)+`.
122
+ Suggested mode is: `+e.toString(y));switch(D===e.KANJI&&!a.isKanjiModeEnabled()&&(D=e.BYTE),D){case e.NUMERIC:return new r(M);case e.ALPHANUMERIC:return new n(M);case e.KANJI:return new s(M);case e.BYTE:return new i(M)}}t.fromArray=function(x){return x.reduce(function(D,y){return typeof y=="string"?D.push(N(y,null)):y.data&&D.push(N(y.data,y.mode)),D},[])},t.fromString=function(x,D){const y=w(x,a.isKanjiModeEnabled()),I=E(y),O=A(I,D),u=c.find_path(O.map,"start","end"),_=[];for(let H=1;H<u.length-1;H++)_.push(O.table[u[H]].node);return t.fromArray(m(_))},t.rawSplit=function(x){return t.fromArray(w(x,a.isKanjiModeEnabled()))}}(cd);const ks=jt,ic=Ls,S6=i6,I6=s6,D6=J0,O6=X0,sc=ed,oc=Ms,A6=a6,Hs=nd,$6=sd,P6=Cr,ac=cd;function T6(t,e){const r=t.size,n=O6.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 N6(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 R6(t,e){const r=D6.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 L6(t,e){const r=t.size,n=Hs.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 cc(t,e,r){const n=t.size,i=$6.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 M6(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 U6(t,e,r){const n=new S6;r.forEach(function(c){n.put(c.mode.bit,4),n.put(c.getLength(),P6.getCharCountIndicator(c.mode,t)),c.write(n)});const i=ks.getSymbolTotalCodewords(t),s=oc.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 F6(n,t,e)}function F6(t,e,r){const n=ks.getSymbolTotalCodewords(e),i=oc.getTotalCodewordsCount(e,r),s=n-i,o=oc.getBlocksCount(e,r),a=n%o,c=o-a,l=Math.floor(n/o),p=Math.floor(s/o),w=p+1,b=l-p,m=new A6(b);let E=0;const A=new Array(o),N=new Array(o);let M=0;const x=new Uint8Array(t.buffer);for(let u=0;u<o;u++){const _=u<c?p:w;A[u]=x.slice(E,E+_),N[u]=m.encode(A[u]),E+=_,M=Math.max(M,_)}const D=new Uint8Array(n);let y=0,I,O;for(I=0;I<M;I++)for(O=0;O<o;O++)I<A[O].length&&(D[y++]=A[O][I]);for(I=0;I<b;I++)for(O=0;O<o;O++)D[y++]=N[O][I];return D}function B6(t,e,r,n){let i;if(Array.isArray(t))i=ac.fromArray(t);else if(typeof t=="string"){let l=e;if(!l){const p=ac.rawSplit(t);l=Hs.getBestVersionForData(p,r)}i=ac.fromString(t,l||40)}else throw new Error("Invalid data");const s=Hs.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=L6(e,r,i),a=Bs.getSymbolSize(e),c=new C6(a);return $6(c,e),P6(c),T6(c,e),ac(c,r,0),e>=7&&N6(c,e),R6(c,o),isNaN(n)&&(n=ic.getBestMask(c,ac.bind(null,c,r))),ic.applyMask(n,c),ac(c,r,n),{modules:c,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}V0.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=nc.M,i,s;return typeof r<"u"&&(n=nc.from(r.errorCorrectionLevel,nc.M),i=js.from(r.version),s=ic.from(r.maskPattern),r.toSJISFunc&&Bs.setToSJISFunction(r.toSJISFunc)),U6(e,i,n,s)};var ad={},cc={};(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 y=0;y<l;y++)for(let m=0;m<l;m++){let E=(y*l+m)*4,A=s.color.light;if(y>=p&&m>=p&&y<l-p&&m<l-p){const N=Math.floor((y-p)/c),M=Math.floor((m-p)/c);A=w[a[N*o+M]?1:0]}n[E++]=A.r,n[E++]=A.g,n[E++]=A.b,n[E]=A.a}}})(cc),function(t){const e=cc;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"),y=w.createImageData(p,p);return e.qrToImageData(y.data,s,c),r(w,l,p),w.putImageData(y,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)}}(ad);var cd={};const F6=cc;function ld(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function lc(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function B6(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?lc("M",c+r,.5+l+r):lc("m",i,0),i=0,s=!1),c+1<e&&t[a+1]||(n+=lc("h",o),o=0)):i++}return n}cd.render=function(e,r,n){const i=F6.getOptions(r),s=e.modules.size,o=e.modules.data,a=s+i.margin*2,c=i.color.light.a?"<path "+ld(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+ld(i.color.dark,"stroke")+' d="'+B6(o,s,i.margin)+'"/>',p='viewBox="0 0 '+a+" "+a+'"',y='<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,y),y};const j6=e6,uc=V0,ud=ad,k6=cd;function hc(t,e,r,n,i){const s=[].slice.call(arguments,1),o=s.length,a=typeof s[o-1]=="function";if(!a&&!j6())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=uc.create(r,n);c(t(p,e,n))}catch(p){l(p)}})}try{const c=uc.create(r,n);i(null,t(c,e,n))}catch(c){i(c)}}vi.create=uc.create,vi.toCanvas=hc.bind(null,ud.render),vi.toDataURL=hc.bind(null,ud.renderToDataURL),vi.toString=hc.bind(null,function(t,e,r){return k6.render(t,r)});var H6=Object.defineProperty,hd=Object.getOwnPropertySymbols,z6=Object.prototype.hasOwnProperty,W6=Object.prototype.propertyIsEnumerable,dd=(t,e,r)=>e in t?H6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fd=(t,e)=>{for(var r in e||(e={}))z6.call(e,r)&&dd(t,r,e[r]);if(hd)for(var r of hd(e))W6.call(e,r)&&dd(t,r,e[r]);return t};function pd(){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 q6(){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 V6(){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 ue={color(){var t,e;const r=(t=Ve.state.themeColor)!=null?t:"default",n=(e=Ve.state.themeMode)!=null?e:"dark",i=pd()[r][n],s=q6()[n],o=V6()[r];return{foreground:fd({accent:i.foreground,inverse:i.inverse},s.foreground),background:fd({accent:i.background},s.background),gradient:o,overlay:s.overlay,error:"rgb(242, 90, 103)"}},setTheme(){const t=document.querySelector(":root"),{themeZIndex:e}=Ve.state;if(t){const r={"--w3m-color-fg-accent":ue.color().foreground.accent,"--w3m-color-fg-inverse":ue.color().foreground.inverse,"--w3m-color-fg-1":ue.color().foreground[1],"--w3m-color-fg-2":ue.color().foreground[2],"--w3m-color-fg-3":ue.color().foreground[3],"--w3m-color-bg-1":ue.color().background[1],"--w3m-color-bg-2":ue.color().background[2],"--w3m-color-bg-3":ue.color().background[3],"--w3m-color-overlay":ue.color().overlay,"--w3m-color-err":ue.color().error,"--w3m-color-success":pd().green.light.foreground,"--w3m-gradient-1":ue.color().gradient[1],"--w3m-gradient-2":ue.color().gradient[2],"--w3m-gradient-3":ue.color().gradient[3],"--w3m-gradient-4":ue.color().gradient[4],"--w3m-modal-z-index":`${e}`};Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:_e`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent}button::after{content:'';position:absolute;inset:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-color-fg-inverse);background:var(--w3m-color-fg-accent)}`},K6=_e`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(--w3m-color-overlay)}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-fg-accent);border-radius:50%;margin-bottom:4px}button path{fill:var(--w3m-color-fg-inverse)}`;var G6=Object.defineProperty,Y6=Object.getOwnPropertyDescriptor,ks=(t,e,r,n)=>{for(var i=n>1?void 0:n?Y6(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 $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=[ue.globalCss,K6],ks([be()],$n.prototype,"icon",2),ks([be()],$n.prototype,"label",2),ks([be()],$n.prototype,"onClick",2),$n=ks([we("w3m-box-button")],$n);const Z6=_e`button{border-radius:28px;height:28px;padding:0 10px;background-color:var(--w3m-color-fg-accent)}button path{fill:var(--w3m-color-fg-inverse)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{background-color:var(--w3m-color-bg-3)}`;var J6=Object.defineProperty,X6=Object.getOwnPropertyDescriptor,Ci=(t,e,r,n)=>{for(var i=n>1?void 0:n?X6(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 qr=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="${Mt(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-normal" color="inverse"><slot></slot></w3m-text>${this.iconRight}</button>`}};qr.styles=[ue.globalCss,Z6],Ci([be()],qr.prototype,"disabled",2),Ci([be()],qr.prototype,"iconLeft",2),Ci([be()],qr.prototype,"iconRight",2),Ci([be()],qr.prototype,"onClick",2),qr=Ci([we("w3m-button")],qr);const Q6=_e`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:10px;color:var(--w3m-color-fg-inverse);background-color:var(--w3m-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(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-color-fg-accent);background-color:transparent}.w3m-secondary::after{display:none}`;var e4=Object.defineProperty,t4=Object.getOwnPropertyDescriptor,dc=(t,e,r,n)=>{for(var i=n>1?void 0:n?t4(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&&e4(e,r,i),i};let Si=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="${Mt(t)}"><slot></slot></button>`}};Si.styles=[ue.globalCss,Q6],dc([be()],Si.prototype,"disabled",2),dc([be()],Si.prototype,"variant",2),Si=dc([we("w3m-button-big")],Si);let r4=class{constructor(...t){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,gd(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}),gd(this,"animate",e=>{if(this.playing){if(this.shouldSkipFrame(e)||(this.t+=Math.min(e-this.last,1e3/15),this.last=e,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(t){this.el=t,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=U6(e,r,i),a=ks.getSymbolSize(e),c=new I6(a);return T6(c,e),N6(c),R6(c,e),cc(c,r,0),e>=7&&L6(c,e),M6(c,o),isNaN(n)&&(n=sc.getBestMask(c,cc.bind(null,c,r))),sc.applyMask(n,c),cc(c,r,n),{modules:c,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}Z0.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=ic.M,i,s;return typeof r<"u"&&(n=ic.from(r.errorCorrectionLevel,ic.M),i=Hs.from(r.version),s=sc.from(r.maskPattern),r.toSJISFunc&&ks.setToSJISFunction(r.toSJISFunc)),B6(e,i,n,s)};var hd={},lc={};(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 b=0;b<l;b++)for(let m=0;m<l;m++){let E=(b*l+m)*4,A=s.color.light;if(b>=p&&m>=p&&b<l-p&&m<l-p){const N=Math.floor((b-p)/c),M=Math.floor((m-p)/c);A=w[a[N*o+M]?1:0]}n[E++]=A.r,n[E++]=A.g,n[E++]=A.b,n[E]=A.a}}})(lc),function(t){const e=lc;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"),b=w.createImageData(p,p);return e.qrToImageData(b.data,s,c),r(w,l,p),w.putImageData(b,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)}}(hd);var ud={};const j6=lc;function dd(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function hc(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function k6(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?hc("M",c+r,.5+l+r):hc("m",i,0),i=0,s=!1),c+1<e&&t[a+1]||(n+=hc("h",o),o=0)):i++}return n}ud.render=function(e,r,n){const i=j6.getOptions(r),s=e.modules.size,o=e.modules.data,a=s+i.margin*2,c=i.color.light.a?"<path "+dd(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+dd(i.color.dark,"stroke")+' d="'+k6(o,s,i.margin)+'"/>',p='viewBox="0 0 '+a+" "+a+'"',b='<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,b),b};const H6=r6,uc=Z0,fd=hd,z6=ud;function dc(t,e,r,n,i){const s=[].slice.call(arguments,1),o=s.length,a=typeof s[o-1]=="function";if(!a&&!H6())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=uc.create(r,n);c(t(p,e,n))}catch(p){l(p)}})}try{const c=uc.create(r,n);i(null,t(c,e,n))}catch(c){i(c)}}_i.create=uc.create,_i.toCanvas=dc.bind(null,fd.render),_i.toDataURL=dc.bind(null,fd.renderToDataURL),_i.toString=dc.bind(null,function(t,e,r){return z6.render(t,r)});var W6=Object.defineProperty,pd=Object.getOwnPropertySymbols,q6=Object.prototype.hasOwnProperty,V6=Object.prototype.propertyIsEnumerable,gd=(t,e,r)=>e in t?W6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,md=(t,e)=>{for(var r in e||(e={}))q6.call(e,r)&&gd(t,r,e[r]);if(pd)for(var r of pd(e))V6.call(e,r)&&gd(t,r,e[r]);return t};function wd(){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 K6(){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 G6(){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 he={color(){var t,e;const r=(t=Ve.state.themeColor)!=null?t:"default",n=(e=Ve.state.themeMode)!=null?e:"dark",i=wd()[r][n],s=K6()[n],o=G6()[r];return{foreground:md({accent:i.foreground,inverse:i.inverse},s.foreground),background:md({accent:i.background},s.background),gradient:o,overlay:s.overlay,error:"rgb(242, 90, 103)"}},setTheme(){const t=document.querySelector(":root"),{themeZIndex:e}=Ve.state;if(t){const r={"--w3m-color-fg-accent":he.color().foreground.accent,"--w3m-color-fg-inverse":he.color().foreground.inverse,"--w3m-color-fg-1":he.color().foreground[1],"--w3m-color-fg-2":he.color().foreground[2],"--w3m-color-fg-3":he.color().foreground[3],"--w3m-color-bg-1":he.color().background[1],"--w3m-color-bg-2":he.color().background[2],"--w3m-color-bg-3":he.color().background[3],"--w3m-color-overlay":he.color().overlay,"--w3m-color-err":he.color().error,"--w3m-color-success":wd().green.light.foreground,"--w3m-gradient-1":he.color().gradient[1],"--w3m-gradient-2":he.color().gradient[2],"--w3m-gradient-3":he.color().gradient[3],"--w3m-gradient-4":he.color().gradient[4],"--w3m-modal-z-index":`${e}`};Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:_e`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent}button::after{content:'';position:absolute;inset:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-color-fg-inverse);background:var(--w3m-color-fg-accent)}`},Z6=_e`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(--w3m-color-overlay)}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-fg-accent);border-radius:50%;margin-bottom:4px}button path{fill:var(--w3m-color-fg-inverse)}`;var Y6=Object.defineProperty,J6=Object.getOwnPropertyDescriptor,zs=(t,e,r,n)=>{for(var i=n>1?void 0:n?J6(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&&Y6(e,r,i),i};let $n=class extends fe{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=[he.globalCss,Z6],zs([ye()],$n.prototype,"icon",2),zs([ye()],$n.prototype,"label",2),zs([ye()],$n.prototype,"onClick",2),$n=zs([we("w3m-box-button")],$n);const X6=_e`button{border-radius:28px;height:28px;padding:0 10px;background-color:var(--w3m-color-fg-accent)}button path{fill:var(--w3m-color-fg-inverse)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{background-color:var(--w3m-color-bg-3)}`;var Q6=Object.defineProperty,e4=Object.getOwnPropertyDescriptor,Si=(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&&Q6(e,r,i),i};let Wr=class extends fe{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="${Mt(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=[he.globalCss,X6],Si([ye()],Wr.prototype,"disabled",2),Si([ye()],Wr.prototype,"iconLeft",2),Si([ye()],Wr.prototype,"iconRight",2),Si([ye()],Wr.prototype,"onClick",2),Wr=Si([we("w3m-button")],Wr);const t4=_e`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:10px;color:var(--w3m-color-fg-inverse);background-color:var(--w3m-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(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-color-fg-accent);background-color:transparent}.w3m-secondary::after{display:none}`;var r4=Object.defineProperty,n4=Object.getOwnPropertyDescriptor,fc=(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 Ii=class extends fe{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return V`<button ?disabled="${this.disabled}" class="${Mt(t)}"><slot></slot></button>`}};Ii.styles=[he.globalCss,t4],fc([ye()],Ii.prototype,"disabled",2),fc([ye()],Ii.prototype,"variant",2),Ii=fc([we("w3m-button-big")],Ii);let i4=class{constructor(...t){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,bd(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}),bd(this,"animate",e=>{if(this.playing){if(this.shouldSkipFrame(e)||(this.t+=Math.min(e-this.last,1e3/15),this.last=e,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(t){this.el=t,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 i4(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 t=1;t<this.sectionColors.length;t+=1)this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({value:{color:new this.minigl.Uniform({value:this.sectionColors[t],type:"vec3"}),noiseFreq:new this.minigl.Uniform({value:[2+t/this.sectionColors.length,3+t/this.sectionColors.length],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:11+.3*t}),noiseFlow:new this.minigl.Uniform({value:6.5+.3*t}),noiseSeed:new this.minigl.Uniform({value:this.seed+10*t}),noiseFloor:new this.minigl.Uniform({value:.1}),noiseCeil:new this.minigl.Uniform({value:.63+.07*t})},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(t){return!!window.document.hidden||parseInt(t,10)%2==0||void 0}updateFrequency(t){this.freqX+=t,this.freqY+=t}toggleColor(t){this.activeColors[t]=this.activeColors[t]===0?1:0}init(){this.playing=!0,this.initGradientColors(),this.initMesh(),this.resize(),requestAnimationFrame(this.animate)}waitForCssVars(){this.computedCanvasStyle&&this.computedCanvasStyle.getPropertyValue("--w3m-gradient-1").indexOf("#")!==-1?this.init():this.init()}initGradientColors(){this.sectionColors=["--w3m-gradient-1","--w3m-gradient-2","--w3m-gradient-3","--w3m-gradient-4"].map(t=>{let e=this.computedCanvasStyle.getPropertyValue(t).trim();return e.length===4&&(e=`#${e.substr(1).split("").map(r=>r+r).join("")}`),e&&`0x${e.substr(1)}`}).filter(Boolean).map(n4)}};function n4(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]}function gd(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}let i4=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(m,E){const A=i.createShader(m);return i.shaderSource(A,E),i.compileShader(A),i.getShaderParameter(A,i.COMPILE_STATUS)||console.error(i.getShaderInfoLog(A)),A}function w(m,E){return Object.entries(m).map(([A,N])=>N.getDeclaration(A,E)).join("")}l.uniforms=c,l.uniformInstances=[];const y="precision highp float;";l.vertexSource=`${y} attribute vec4 position;attribute vec2 uv;attribute vec2 uvNorm;${w(n.commonUniforms,"vertex")} ${w(c,"vertex")} ${o}`,l.Source=`${y} ${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,y])=>y.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 y=l*c.xSegCount+p;c.attributes.index.values[6*y]=w,c.attributes.index.values[6*y+1]=w+1+c.xSegCount,c.attributes.index.values[6*y+2]=w+1,c.attributes.index.values[6*y+3]=w+1,c.attributes.index.values[6*y+4]=w+1+c.xSegCount,c.attributes.index.values[6*y+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,y=o/l.xSegCount,m=a/l.ySegCount;for(let E=0;E<=l.ySegCount;E++){const A=w+E*m;for(let N=0;N<=l.xSegCount;N++){const M=p+N*y,x=E*(l.xSegCount+1)+N;l.attributes.position.values[3*x+"xyz".indexOf(c[0])]=M,l.attributes.position.values[3*x+"xyz".indexOf(c[1])]=-A}}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>`},s4={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00"};var ar=(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))(ar||{});const Vr={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=Vr.getInjectedId("");return(r=(e=Vr.injectedPreset[n])==null?void 0:e.name)!=null?r:"Injected"}},o4={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}};var a4=Object.defineProperty,md=Object.getOwnPropertySymbols,c4=Object.prototype.hasOwnProperty,l4=Object.prototype.propertyIsEnumerable,wd=(t,e,r)=>e in t?a4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u4=(t,e)=>{for(var r in e||(e={}))c4.call(e,r)&&wd(t,r,e[r]);if(md)for(var r of md(e))l4.call(e,r)&&wd(t,r,e[r]);return t};const ne={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET:"W3M_RECENT_WALLET",rejectStandaloneButtonComponent(){const{isStandalone:t}=Q.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 Vr.getInjectedId(t)},getWalletIcon(t){var e,r;const n=(e=Vr.injectedPreset[t])==null?void 0:e.icon,{projectId:i,walletImages:s}=Ve.state;return(r=s?.[t])!=null?r:i&&n?at.getImageUrl(n):""},getWalletName(t,e=!1){const r=Vr.getInjectedName(t);return e?r.split(" ")[0]:r},getChainIcon(t){var e;const r=s4[t],{projectId:n,chainImages:i}=Ve.state;return(e=i?.[t])!=null?e:n&&r?at.getImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=o4[t])==null?void 0:e.icon,{projectId:i,tokenImages:s}=Ve.state;return(r=s?.[t])!=null?r:i&&n?at.getImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=ne.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}=Q.state,{links:n,name:i}=t;function s(o){let a="";n!=null&&n.universal?a=Ue.formatUniversalUrl(n.universal,o,i):n!=null&&n.native&&(a=Ue.formatNativeUrl(n.native,o,i)),Ue.openHref(a)}e?(ne.setRecentWallet(t),s(e)):(await qe.client().connectWalletConnect(o=>{s(o)},r?.id),ne.setRecentWallet(t),dt.close())},async handleAndroidLinking(){const{standaloneUri:t,selectedChain:e}=Q.state;t?Ue.openHref(t):(await qe.client().connectWalletConnect(r=>{Ue.setWalletConnectAndroidDeepLink(r),Ue.openHref(r)},e?.id),dt.close())},async handleUriCopy(){const{standaloneUri:t}=Q.state;if(t)await navigator.clipboard.writeText(t);else{const e=qe.client().walletConnectUri;await navigator.clipboard.writeText(e)}Lt.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=Q.state;await qe.client().connectConnector(t,r?.id),dt.close()}catch(r){console.error(r),e?e():Lt.openToast(ne.getErrorMessage(r),"error")}},getCustomWallets(){var t;const{desktopWallets:e,mobileWallets:r}=Ve.state;return(t=Ue.isMobile()?r:e)!=null?t:[]},getCustomImageUrls(){const{chainImages:t,walletImages:e}=Ve.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},getConnectorImageUrls(){return qe.client().getConnectors().map(({id:t})=>Vr.getInjectedId(t)).map(t=>ne.getWalletIcon(t))},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;const r=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),n=[];r?.forEach(s=>{let o=0;for(let c=0;c<s.length;c+=1)o=s.charCodeAt(c)+((o<<5)-o),o=o&o;const a=[0,0,0];for(let c=0;c<3;c+=1){const l=o>>c*8&255;a[c]=l}n.push(`rgb(${a[0]}, ${a[1]}, ${a[2]})`)});const i=document.querySelector(":root");if(i){const s={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(s).forEach(([o,a])=>i.style.setProperty(o,a))}},setRecentWallet(t){const{walletConnectVersion:e}=Q.state;localStorage.setItem(ne.W3M_RECENT_WALLET,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(ne.W3M_RECENT_WALLET);if(t){const{walletConnectVersion:e}=Q.state,r=JSON.parse(t);if(r[e])return r[e]}},getExtensionWallets(){const t=[];for(const[e,r]of Object.entries(Vr.injectedPreset))e!==ar.coinbaseWallet&&r&&r.isInjected&&!r.isDesktop&&t.push(u4({id:e},r));return t},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())}},h4=_e`#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(--w3m-gradient-1),var(--w3m-gradient-2),var(--w3m-gradient-3),var(--w3m-gradient-4))}.w3m-color-placeholder{background-color:var(--w3m-color-fg-accent)}.w3m-highlight{border:1px solid var(--w3m-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(--w3m-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(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-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(--w3m-color-bg-2)}.w3m-action-btn svg{display:block;object-position:center}.w3m-action-btn path{fill:var(--w3m-color-fg-1)}.w3m-actions{display:flex}.w3m-actions button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}`;var d4=Object.defineProperty,f4=Object.getOwnPropertyDescriptor,fc=(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};const yd=new r4;let Ii=class extends de{constructor(){super(),this.open=!1,this.isHelp=!1,this.unsubscribeRouter=void 0,this.playTimeout=void 0,this.unsubscribeRouter=Te.subscribe(t=>{this.isHelp=t.view==="Help"})}firstUpdated(){const{themeBackground:t}=Ve.state;t==="gradient"&&(this.playTimeout=setTimeout(()=>{yd.play(this.canvasEl),this.open=!0},800))}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this),clearTimeout(this.playTimeout),yd.stop()}get canvasEl(){return ne.getShadowRootElement(this,".w3m-canvas")}onHelp(){Te.push("Help")}render(){const{themeBackground:t}=Ve.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="${Mt(e)}"></canvas>${ye.NOISE_TEXTURE}`:null}<div class="w3m-highlight"></div><div class="w3m-toolbar">${ye.WALLET_CONNECT_LOGO}<div class="${Mt(r)}"><button class="w3m-action-btn" @click="${this.onHelp}">${ye.HELP_ICON}</button> <button class="w3m-action-btn" @click="${dt.close}">${ye.CROSS_ICON}</button></div></div>`}};Ii.styles=[ue.globalCss,h4],fc([Be()],Ii.prototype,"open",2),fc([Be()],Ii.prototype,"isHelp",2),Ii=fc([we("w3m-modal-backcard")],Ii);const p4=_e`main{padding:20px;padding-top:0;width:100%}`;var g4=Object.defineProperty,m4=Object.getOwnPropertyDescriptor,w4=(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 pc=class extends de{render(){return V`<main><slot></slot></main>`}};pc.styles=[ue.globalCss,p4],pc=w4([we("w3m-modal-content")],pc);const y4=_e`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var b4=Object.defineProperty,v4=Object.getOwnPropertyDescriptor,_4=(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&&b4(e,r,i),i};let gc=class extends de{render(){return V`<footer><slot></slot></footer>`}};gc.styles=[ue.globalCss,y4],gc=_4([we("w3m-modal-footer")],gc);const E4=_e`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px;transition:opacity .2s ease}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-color-fg-accent)}`;var x4=Object.defineProperty,C4=Object.getOwnPropertyDescriptor,Di=(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 Kr=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="${Te.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=Te.state.history.length>1,r=this.title?V`<w3m-text variant="large-bold">${this.title}</w3m-text>`:V`<slot></slot>`;return V`<header class="${Mt(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Kr.styles=[ue.globalCss,E4],Di([be()],Kr.prototype,"title",2),Di([be()],Kr.prototype,"onAction",2),Di([be()],Kr.prototype,"actionIcon",2),Di([be()],Kr.prototype,"border",2),Kr=Di([we("w3m-modal-header")],Kr);const S4=_e`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var I4=Object.defineProperty,D4=Object.getOwnPropertyDescriptor,mc=(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&&I4(e,r,i),i};let Oi=class extends de{constructor(){super(),this.view=Te.state.view,this.prevView=Te.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Te.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&(xr(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),xr(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 ne.getShadowRootElement(this,".w3m-router")}get contentEl(){return ne.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return V`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return V`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnector":return V`<w3m-injected-connector-view></w3m-injected-connector-view>`;case"InstallConnector":return V`<w3m-install-connector-view></w3m-install-connector-view>`;case"GetWallet":return V`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"DesktopConnector":return V`<w3m-desktop-connector-view></w3m-desktop-connector-view>`;case"WalletExplorer":return V`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return V`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return V`<w3m-help-view></w3m-help-view>`;case"Account":return V`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return V`<w3m-switch-network-view></w3m-switch-network-view>`;default:return V`<div>Not Found</div>`}}async onChangeRoute(){await xr(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15}).finished,this.view=Te.state.view}render(){return V`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};Oi.styles=[ue.globalCss,S4],mc([Be()],Oi.prototype,"view",2),mc([Be()],Oi.prototype,"prevView",2),Oi=mc([we("w3m-modal-router")],Oi);const O4=_e`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(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-color-fg-accent)}.w3m-error path{fill:var(--w3m-color-err)}`;var A4=Object.defineProperty,$4=Object.getOwnPropertyDescriptor,bd=(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&&A4(e,r,i),i};let Hs=class extends de{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Lt.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Lt.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Lt.closeToast()}render(){const{message:t,variant:e}=Lt.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?V`<div class="${Mt(r)}">${e==="success"?ye.CHECKMARK_ICON:null} ${e==="error"?ye.CROSS_ICON:null}<w3m-text variant="small-normal">${t}</w3m-text></div>`:null}};Hs.styles=[ue.globalCss,O4],bd([Be()],Hs.prototype,"open",2),Hs=bd([we("w3m-modal-toast")],Hs);const P4=_e`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(--w3m-color-overlay)}`;var T4=Object.defineProperty,N4=Object.getOwnPropertyDescriptor,zs=(t,e,r,n)=>{for(var i=n>1?void 0:n?N4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&T4(e,r,i),i};let 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=[ue.globalCss,P4],zs([be()],Pn.prototype,"onClick",2),zs([be()],Pn.prototype,"name",2),zs([be()],Pn.prototype,"chainId",2),Pn=zs([we("w3m-network-button")],Pn);const R4=_e`div{width:inherit;height:inherit}.polygon-stroke{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var L4=Object.defineProperty,M4=Object.getOwnPropertyDescriptor,vd=(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&&L4(e,r,i),i};let Ws=class extends de{constructor(){super(...arguments),this.chainId=""}render(){const t=ne.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}`}};Ws.styles=[ue.globalCss,R4],vd([be()],Ws.prototype,"chainId",2),Ws=vd([we("w3m-network-image")],Ws);const U4=.1,_d=2.5,dr=7;function wc(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+U4}function F4(t,e){const r=Array.prototype.slice.call(vi.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 B4={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",s=n==="light"?"#fff":"#141414",o=[],a=F4(t,"Q"),c=e/a.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:A,y:N})=>{const M=(a.length-dr)*c*A,x=(a.length-dr)*c*N,D=.32;for(let b=0;b<l.length;b+=1){const I=c*(dr-b*2);o.push(Ae`<rect fill="${b%2===0?i:s}" height="${I}" rx="${I*D}" ry="${I*D}" width="${I}" x="${M+c*b}" y="${x+c*b}">`)}});const p=Math.floor((r+25)/c),w=a.length/2-p/2,y=a.length/2+p/2-1,m=[];a.forEach((A,N)=>{A.forEach((M,x)=>{if(a[N][x]&&!(N<dr&&x<dr||N>a.length-(dr+1)&&x<dr||N<dr&&x>a.length-(dr+1))&&!(N>w&&N<y&&x>w&&x<y)){const D=N*c+c/2,b=x*c+c/2;m.push([D,b])}})});const E={};return m.forEach(([A,N])=>{E[A]?E[A].push(N):E[A]=[N]}),Object.entries(E).map(([A,N])=>{const M=N.filter(x=>N.every(D=>!wc(x,D,c)));return[Number(A),M]}).forEach(([A,N])=>{N.forEach(M=>{o.push(Ae`<circle cx="${A}" cy="${M}" fill="${i}" r="${c/_d}">`)})}),Object.entries(E).filter(([A,N])=>N.length>1).map(([A,N])=>{const M=N.filter(x=>N.some(D=>wc(x,D,c)));return[Number(A),M]}).map(([A,N])=>{N.sort((x,D)=>x<D?-1:1);const M=[];for(const x of N){const D=M.find(b=>b.some(I=>wc(x,I,c)));D?D.push(x):M.push([x])}return[A,M.map(x=>[x[0],x[x.length-1]])]}).forEach(([A,N])=>{N.forEach(([M,x])=>{o.push(Ae`<line x1="${A}" x2="${A}" y1="${M}" y2="${x}" stroke="${i}" stroke-width="${c/(_d/2)}" stroke-linecap="round">`)})}),o}},j4=_e`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:15px}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-color-fg-accent)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var k4=Object.defineProperty,H4=Object.getOwnPropertyDescriptor,Ai=(t,e,r,n)=>{for(var i=n>1?void 0:n?H4(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&&k4(e,r,i),i};let Gr=class extends de{constructor(){super(...arguments),this.uri="",this.size=0,this.logoSrc="",this.walletId=""}svgTemplate(){var t;const e=(t=Ve.state.themeMode)!=null?t:"light";return Ae`<svg height="${this.size}" width="${this.size}">${B4.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return V`<div>${this.walletId||this.logoSrc?V`<w3m-wallet-image walletId="${Bt(this.walletId)}" src="${Bt(this.logoSrc)}"></w3m-wallet-image>`:ye.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Gr.styles=[ue.globalCss,j4],Ai([be()],Gr.prototype,"uri",2),Ai([be({type:Number})],Gr.prototype,"size",2),Ai([be()],Gr.prototype,"logoSrc",2),Ai([be()],Gr.prototype,"walletId",2),Gr=Ai([we("w3m-qrcode")],Gr);const z4=_e`: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(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}input::placeholder{color:transparent}svg{margin-right:4px}.w3m-placeholder{top:0;left:50%;transform:translateX(-50%);transition:.2s all ease;pointer-events:none;display:flex;align-items:center;justify-content:center;height:100%;width:fit-content;position:relative}input:focus-within+.w3m-placeholder,input:not(:placeholder-shown)+.w3m-placeholder{transform:translateX(10px);left:0}w3m-text{opacity:1;transition:.2s opacity ease}input:focus-within+.w3m-placeholder w3m-text,input:not(:placeholder-shown)+.w3m-placeholder w3m-text{opacity:0}input:focus-within,input:not(:placeholder-shown){color:var(--w3m-color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-color-fg-accent)}path{fill:var(--w3m-color-fg-2)}`;var W4=Object.defineProperty,q4=Object.getOwnPropertyDescriptor,Ed=(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&&W4(e,r,i),i};let qs=class extends de{constructor(){super(...arguments),this.onChange=()=>null}render(){const t=Ue.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>`}};qs.styles=[ue.globalCss,z4],Ed([be()],qs.prototype,"onChange",2),qs=Ed([we("w3m-search-input")],qs);const V4=_e`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-color-fg-accent)}`;var K4=Object.defineProperty,G4=Object.getOwnPropertyDescriptor,Y4=(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&&K4(e,r,i),i};let yc=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>`}};yc.styles=[ue.globalCss,V4],yc=Y4([we("w3m-spinner")],yc);const Z4=_e`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(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-color-fg-inverse)}.w3m-color-accnt{color:var(--w3m-color-fg-accent)}.w3m-color-error{color:var(--w3m-color-err)}`;var J4=Object.defineProperty,X4=Object.getOwnPropertyDescriptor,bc=(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 $i=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="${Mt(t)}"><slot></slot></span>`}};$i.styles=[ue.globalCss,Z4],bc([be()],$i.prototype,"variant",2),bc([be()],$i.prototype,"color",2),$i=bc([we("w3m-text")],$i);const Q4=_e`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;inset:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var e8=Object.defineProperty,t8=Object.getOwnPropertyDescriptor,xd=(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&&e8(e,r,i),i};let Vs=class extends de{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=ne.getTokenIcon((t=this.symbol)!=null?t:"");return e?V`<div><img src="${e}" alt="${this.id}"></div>`:ye.TOKEN_PLACEHOLDER}};Vs.styles=[ue.globalCss,Q4],xd([be()],Vs.prototype,"symbol",2),Vs=xd([we("w3m-token-image")],Vs);const r8=_e`button{transition:all .2s ease;width:100%;height:100%;border-radius:10px;display:flex;align-items:flex-start}button:hover{background-color:var(--w3m-color-overlay)}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:15px;margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var n8=Object.defineProperty,i8=Object.getOwnPropertyDescriptor,Ir=(t,e,r,n)=>{for(var i=n>1?void 0:n?i8(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 cr=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:ne.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};cr.styles=[ue.globalCss,r8],Ir([be()],cr.prototype,"onClick",2),Ir([be()],cr.prototype,"name",2),Ir([be()],cr.prototype,"walletId",2),Ir([be()],cr.prototype,"label",2),Ir([be()],cr.prototype,"src",2),Ir([be()],cr.prototype,"installed",2),Ir([be()],cr.prototype,"recent",2),cr=Ir([we("w3m-wallet-button")],cr);const s8=_e`div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;inset:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var o8=Object.defineProperty,a8=Object.getOwnPropertyDescriptor,vc=(t,e,r,n)=>{for(var i=n>1?void 0:n?a8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&o8(e,r,i),i};let Pi=class extends de{constructor(){super(...arguments),this.walletId=void 0,this.src=void 0}render(){var t;const e=ne.getWalletId((t=this.walletId)!=null?t:""),r=ne.getWalletId(e),n=this.src?this.src:ne.getWalletIcon(r);return V`${n.length?V`<div><img src="${n}" alt="${this.id}"></div>`:ye.WALLET_PLACEHOLDER}`}};Pi.styles=[ue.globalCss,s8],vc([be()],Pi.prototype,"walletId",2),vc([be()],Pi.prototype,"src",2),Pi=vc([we("w3m-wallet-image")],Pi);const c8=_e`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:10px;padding:4px 4px 4px 8px}div button{border-radius:16px;padding:4px 8px 4px 4px;height:auto;margin-left:10px;color:var(--w3m-color-fg-inverse);background-color:var(--w3m-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(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var l8=Object.defineProperty,u8=Object.getOwnPropertyDescriptor,Cd=(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 Ti=class extends de{constructor(){super(),this.balance="hide",ne.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=Q.state;t||dt.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>`}};Ti.styles=[ue.globalCss,c8],Cd([be()],Ti.prototype,"balance",2),Ti=Cd([we("w3m-account-button")],Ti);const h8=_e`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(--w3m-color-overlay)}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var d8=Object.defineProperty,f8=Object.getOwnPropertyDescriptor,_c=(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 Ni=class extends de{constructor(){super(),this.chainId="",this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=Q.state;this.chainId=t?.id.toString(),this.label=t?.name,this.unsubscribeNetwork=Q.subscribe(({selectedChain:e})=>{this.chainId=e?.id.toString(),this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){Te.push("SelectNetwork")}render(){const{chains:t}=Q.state,e=t&&t.length>1;return V`<button @click="${this.onClick}" ?disabled="${!e}"><w3m-network-image chainId="${Bt(this.chainId)}"></w3m-network-image><w3m-text variant="xsmall-normal" color="accent">${this.label}</w3m-text></button>`}};Ni.styles=[ue.globalCss,h8],_c([Be()],Ni.prototype,"chainId",2),_c([Be()],Ni.prototype,"label",2),Ni=_c([we("w3m-account-network-button")],Ni);const p8=_e`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var g8=Object.defineProperty,m8=Object.getOwnPropertyDescriptor,Ri=(t,e,r,n)=>{for(var i=n>1?void 0:n?m8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&g8(e,r,i),i};let Yr=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=Q.state.address,this.name=Q.state.profileName,this.loading=Boolean(Q.state.profileLoading),this.unsubscribeAccount=Q.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="${Mt(r)}" variant="${e?"medium-normal":"large-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:ne.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};Yr.styles=[ue.globalCss,p8],Ri([Be()],Yr.prototype,"address",2),Ri([Be()],Yr.prototype,"name",2),Ri([Be()],Yr.prototype,"loading",2),Ri([be()],Yr.prototype,"variant",2),Yr=Ri([we("w3m-address-text")],Yr);const w8=_e`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 10),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px}.w3m-slider::after,.w3m-slider::before{content:'';height:100%;width:50px;z-index:2;position:absolute;background:linear-gradient(to right,var(--w3m-color-bg-1) 0,transparent 100%);top:0}.w3m-slider::before{left:0}.w3m-slider::after{right:0;transform:rotateZ(180deg)}.w3m-track{display:flex;width:calc(70px * 20);animation:scroll 20s linear infinite}.w3m-action{padding:30px 0 10px 0;display:flex;justify-content:center;align-items:center;flex-direction:column}.w3m-action w3m-button-big:last-child{margin-top:10px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;box-shadow:0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08);border-radius:15px}`;var y8=Object.defineProperty,b8=Object.getOwnPropertyDescriptor,v8=(t,e,r,n)=>{for(var i=n>1?void 0:n?b8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&y8(e,r,i),i};let Ec=class extends de{onGoToQrcode(){Te.push("Qrcode")}onGoToGetWallet(){Te.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="${ne.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>`}};Ec.styles=[ue.globalCss,w8],Ec=v8([we("w3m-android-wallet-selection")],Ec);const _8=_e`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var E8=Object.defineProperty,x8=Object.getOwnPropertyDescriptor,Li=(t,e,r,n)=>{for(var i=n>1?void 0:n?x8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&E8(e,r,i),i};let Zr=class extends de{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=Q.state.address,this.avatar=Q.state.profileAvatar,this.loading=Boolean(Q.state.profileLoading),this.unsubscribeAccount=Q.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="${Mt(t)}" src="${this.avatar}">`:this.address?(ne.generateAvatarColors(this.address),V`<div class="${Mt(t)}">${this.loading?V`<div class="w3m-loader"></div>`:null}</div>`):null}};Zr.styles=[ue.globalCss,_8],Li([Be()],Zr.prototype,"address",2),Li([Be()],Zr.prototype,"avatar",2),Li([Be()],Zr.prototype,"loading",2),Li([be()],Zr.prototype,"size",2),Zr=Li([we("w3m-avatar")],Zr);const C8=_e`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var S8=Object.defineProperty,I8=Object.getOwnPropertyDescriptor,xc=(t,e,r,n)=>{for(var i=n>1?void 0:n?I8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&S8(e,r,i),i};let Mi=class extends de{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=Q.state.balance)==null?void 0:t.symbol,this.amount=(e=Q.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=Q.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="${Bt(this.symbol)}"></w3m-token-image><w3m-text variant="medium-normal" color="primary">${t} ${this.symbol}</w3m-text></div>`}};Mi.styles=[ue.globalCss,C8],xc([Be()],Mi.prototype,"symbol",2),xc([Be()],Mi.prototype,"amount",2),Mi=xc([we("w3m-balance")],Mi);const D8=_e`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-color-fg-inverse)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var O8=Object.defineProperty,A8=Object.getOwnPropertyDescriptor,Ks=(t,e,r,n)=>{for(var i=n>1?void 0:n?A8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&O8(e,r,i),i};let Jr=class extends de{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,ne.rejectStandaloneButtonComponent(),this.modalUnsub=dt.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}onClick(){Q.state.isConnected?this.onDisconnect():this.onConnect()}onConnect(){this.loading=!0;const{enableNetworkView:t}=Ve.state,{chains:e,selectedChain:r}=Q.state,n=e?.length&&e.length>1;t||n&&!r?dt.open({route:"SelectNetwork"}):dt.open({route:"ConnectWallet"})}onDisconnect(){qe.client().disconnect(),Q.resetAccount()}render(){return V`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${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>`}};Jr.styles=[ue.globalCss,D8],Ks([Be()],Jr.prototype,"loading",2),Ks([be()],Jr.prototype,"label",2),Ks([be()],Jr.prototype,"icon",2),Jr=Ks([we("w3m-connect-button")],Jr);var $8=Object.defineProperty,P8=Object.getOwnPropertyDescriptor,Ui=(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 Xr=class extends de{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.balance="hide",this.unsubscribeAccount=void 0,ne.rejectStandaloneButtonComponent(),this.isConnected=Q.state.isConnected,this.unsubscribeAccount=Q.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=Ve.state;return this.isConnected&&t?V`<w3m-account-button balance="${Bt(this.balance)}"></w3m-account-button>`:V`<w3m-connect-button label="${this.isConnected?"Disconnect":Bt(this.label)}" icon="${Bt(this.icon)}"></w3m-connect-button>`}};Ui([Be()],Xr.prototype,"isConnected",2),Ui([be()],Xr.prototype,"label",2),Ui([be()],Xr.prototype,"icon",2),Ui([be()],Xr.prototype,"balance",2),Xr=Ui([we("w3m-core-button")],Xr);const kt={allowedExplorerListings(t){const{explorerAllowList:e,explorerDenyList:r}=Ve.state;let n=[...t];return e&&(n=n.filter(i=>e.includes(i.id))),r&&(n=n.filter(i=>!r.includes(i.id))),n},walletsWithInjected(t){let e=[...t??[]];if(window.ethereum){const r=ne.getWalletName("");e=e.filter(({name:n})=>!ne.caseSafeIncludes(n,r))}return e},connectorWallets(){const{isStandalone:t}=Q.state;if(t)return[];let e=qe.client().getConnectors();return!window.ethereum&&Ue.isMobile()&&(e=e.filter(({id:r})=>r!=="injected"&&r!==ar.metaMask)),e},walletTemplatesWithRecent(t,e){let r=[...t];if(e){const n=ne.getRecentWallet();r=r.filter(i=>!i.values.includes(n?.name)),r.splice(1,0,e)}return r},deduplicateExplorerListingsFromConnectors(t){const{isStandalone:e}=Q.state;if(e)return t;const r=qe.client().getConnectors().map(({name:n})=>n.toUpperCase());return t.filter(({name:n})=>!r.includes(n.toUpperCase()))}},T8=_e`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-color-fg-accent)}`;var N8=Object.defineProperty,R8=Object.getOwnPropertyDescriptor,L8=(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&&N8(e,r,i),i};let Cc=class extends de{onDesktopWallet(t){Te.push("DesktopConnector",{DesktopConnector:t})}onInjectedWallet(){Te.push("InjectedConnector")}onInstallConnector(){Te.push("InstallConnector",{InstallConnector:{id:"metaMask",name:"MetaMask",isMobile:!0,url:"https://metamask.io"}})}async onConnectorWallet(t){window.ethereum?t==="injected"||t===ar.metaMask?this.onInjectedWallet():await ne.handleConnectorConnection(t):this.onInstallConnector()}desktopWalletsTemplate(){const{desktopWallets:t}=Ve.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=kt.allowedExplorerListings(at.state.previewWallets);return t=kt.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 kt.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=ne.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Bt(e)}" src="${Bt(i)}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n?.universal,native:n?.native,icon:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=Q.state,e=this.desktopWalletsTemplate(),r=this.previewWalletsTemplate(),n=this.connectorWalletsTemplate(),i=this.recentWalletTemplate(),s=[...e??[],...r],o=[...n,...s],a=kt.walletTemplatesWithRecent(o,i),c=kt.walletTemplatesWithRecent(s,i),l=t?c:a,p=l.length>4;let w=[];p?w=l.filter(m=>!m.values.includes(ar.coinbaseWallet)).slice(0,3):w=l;const y=Boolean(w.length);return V`<w3m-modal-header border="${!0}" title="Connect your wallet" .onAction="${ne.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>${y?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">${w} ${p?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};Cc.styles=[ue.globalCss,T8],Cc=L8([we("w3m-desktop-wallet-selection")],Cc);const M8=_e`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-color-fg-accent);text-decoration:none;transition:opacity .2s ease-in-out}a:hover{opacity:.8}`;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 Sc=class extends de{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=Ve.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}};Sc.styles=[ue.globalCss,M8],Sc=B8([we("w3m-legal-notice")],Sc);const j8=_e`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var k8=Object.defineProperty,H8=Object.getOwnPropertyDescriptor,z8=(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 Ic=class extends de{onGoToQrcode(){Te.push("Qrcode")}async onConnectorWallet(t){await ne.handleConnectorConnection(t)}mobileWalletsTemplate(){const{mobileWallets:t}=Ve.state,e=kt.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()=>ne.handleMobileLinking({links:{native:s,universal:i},name:n,id:r})}"></w3m-wallet-button>`)}previewWalletsTemplate(){const{previewWallets:t}=at.state;let e=kt.walletsWithInjected(t);return e=kt.allowedExplorerListings(e),e=kt.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()=>ne.handleMobileLinking({links:{native:i,universal:s},name:n,id:o,image:r.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){let t=kt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==ar.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=ne.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Bt(e)}" src="${Bt(i)}" .onClick="${async()=>ne.handleMobileLinking({name:r,id:e,links:n,image:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=Q.state,e=this.connectorWalletsTemplate(),r=this.mobileWalletsTemplate(),n=this.previewWalletsTemplate(),i=this.recentWalletTemplate(),s=r??n,o=[...e,...s],a=kt.walletTemplatesWithRecent(o,i),c=kt.walletTemplatesWithRecent(s,i),l=t?c:a,p=l.length>8;let w=[];p?w=l.filter(A=>!A.values.includes(ar.coinbaseWallet)).slice(0,7):w=l;const y=w.slice(0,4),m=w.slice(4,8),E=Boolean(w.length);return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ye.QRCODE_ICON}"></w3m-modal-header>${E?V`<w3m-modal-content><div class="w3m-grid">${y} ${m.length?V`${m} ${p?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}`:null}</div></w3m-modal-content>`:null}`}};Ic.styles=[ue.globalCss,j8],Ic=z8([we("w3m-mobile-wallet-selection")],Ic);const W8=_e`:host{all:initial}.w3m-overlay{inset:0;position:fixed;z-index:var(--w3m-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(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px}.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 q8=Object.defineProperty,V8=Object.getOwnPropertyDescriptor,Gs=(t,e,r,n)=>{for(var i=n>1?void 0:n?V8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&q8(e,r,i),i};let Qr=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,ue.setTheme(),this.unsubscribeConfig=Ve.subscribe(ue.setTheme),this.unsubscribeModal=dt.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()}),!Q.state.isStandalone){Q.getAccount();const t=Q.getSelectedChain();this.activeChainId=t?.id,this.fetchEnsProfile(),this.fetchBalance(),this.unwatchNetwork=qe.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(Q.setSelectedChain(r),this.activeChainId=r.id,Q.resetBalance(),this.fetchBalance())}),this.unwatchAccount=qe.client().watchAccount(e=>{const{address:r}=Q.state;e.address!==r&&(this.fetchEnsProfile(e.address),this.fetchBalance(e.address)),Q.setAddress(e.address),Q.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 ne.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return ne.getShadowRootElement(this,".w3m-container")}async fetchEnsProfile(t){try{if(Ve.state.enableAccountView){Q.setProfileLoading(!0);const e=t??Q.state.address,{id:r}=qe.client().getDefaultChain();if(e&&r===1){const[n,i]=await Promise.all([qe.client().fetchEnsName({address:e,chainId:1}),qe.client().fetchEnsAvatar({address:e,chainId:1})]);i&&await ne.preloadImage(i),Q.setProfileName(n),Q.setProfileAvatar(i)}}}catch(e){console.error(e),Lt.openToast(ne.getErrorMessage(e),"error")}finally{Q.setProfileLoading(!1)}}async fetchBalance(t){try{if(Ve.state.enableAccountView){Q.setBalanceLoading(!0);const e=t??Q.state.address;if(e){const r=await qe.client().fetchBalance({address:e});Q.setBalance({amount:r.formatted,symbol:r.symbol})}}}catch(e){console.error(e),Lt.openToast(ne.getErrorMessage(e),"error")}finally{Q.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,walletConnectVersion:n}=Q.state,i=e?.join(",");await Promise.all([at.getPreviewWallets({page:1,entries:10,chains:i,device:Ue.isMobile()?"mobile":"desktop",version:n}),at.getRecomendedWallets()]),Q.setIsDataLoaded(!0);const{previewWallets:s,recomendedWallets:o}=at.state,a=(t=r?.map(l=>ne.getChainIcon(l.id)))!=null?t:[],c=[...s,...o].map(l=>l.image_url.lg);await this.preloadExplorerImages([...a,...c])}async preloadExplorerImages(t){t.length&&await Promise.all(t.map(async e=>ne.preloadImage(e)))}async preloadCustomImages(){const t=ne.getCustomImageUrls();t.length&&await Promise.all(t.map(async e=>ne.preloadImage(e)))}async preloadConnectorImages(){if(!Q.state.isStandalone){const t=ne.getConnectorImageUrls();t.length&&await Promise.all(t.map(async e=>ne.preloadImage(e)))}}async preloadModalData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadExplorerData(),this.preloadCustomImages(),this.preloadConnectorImages()]))}catch(t){console.error(t),Lt.openToast("Failed preloading","error")}}onCloseModal(t){t.target===t.currentTarget&&dt.close()}async onOpenModalEvent(){await this.preloadModalData(),this.toggleBodyScroll(!1);const t=.2;await xr(this.containerEl,{y:0},{duration:0}).finished,xr(this.overlayEl,{opacity:[0,1]},{duration:.2,delay:t}),xr(this.containerEl,ne.isMobileAnimation()?{y:["50vh",0]}:{scale:[.98,1]},{scale:{easing:Ts({velocity:.4})},y:{easing:Ts({mass:.5})},delay:t}),this.addKeyboardEvents(),this.open=!0}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents(),await Promise.all([xr(this.containerEl,ne.isMobileAnimation()?{y:[0,"50vh"]}:{scale:[1,.98]},{scale:{easing:Ts({velocity:0})},y:{easing:Ts({mass:.5})}}).finished,xr(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"?dt.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="${Mt(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>`}};Qr.styles=[ue.globalCss,W8],Gs([Be()],Qr.prototype,"open",2),Gs([Be()],Qr.prototype,"preload",2),Gs([Be()],Qr.prototype,"activeChainId",2),Qr=Gs([we("w3m-modal")],Qr);const K8=_e`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var G8=Object.defineProperty,Y8=Object.getOwnPropertyDescriptor,Ys=(t,e,r,n)=>{for(var i=n>1?void 0:n?Y8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&G8(e,r,i),i};let en=class extends de{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,ne.rejectStandaloneButtonComponent();const{selectedChain:t}=Q.state;this.onSetChainData(t),this.unsubscribeNetwork=Q.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=Q.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(){dt.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=Q.state,r=e&&e.length>1;return V`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${Bt(this.chainId)}"></w3m-network-image><w3m-text variant="medium-normal" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};en.styles=[ue.globalCss,K8],Ys([Be()],en.prototype,"chainId",2),Ys([Be()],en.prototype,"label",2),Ys([Be()],en.prototype,"wrongNetwork",2),en=Ys([we("w3m-network-switch")],en);const Z8=_e`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(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:hover{background-color:var(--w3m-color-overlay)}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:8px;border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var 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 Dc=class extends de{onClick(){Te.push("WalletExplorer")}render(){const{previewWallets:t}=at.state,e=ne.getCustomWallets(),r=[...t,...e].reverse().slice(0,4);return V`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{var i;const s=(i=n.image_url)==null?void 0:i.lg;if(s)return V`<img src="${s}">`;const o=ne.getWalletId(n.id),a=ne.getWalletIcon(o);return a?V`<img src="${a}">`:ye.WALLET_PLACEHOLDER})}</div><w3m-text variant="xsmall-normal">View All</w3m-text></button>`}};Dc.styles=[ue.globalCss,Z8],Dc=Q8([we("w3m-view-all-wallets-button")],Dc);const e_=_e`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var t_=Object.defineProperty,r_=Object.getOwnPropertyDescriptor,Sd=(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 Zs=class extends de{constructor(){super(),this.uri="",this.createConnectionAndWait()}get overlayEl(){return ne.getShadowRootElement(this,".w3m-qr-container")}async createConnectionAndWait(t=0){var e;try{const{standaloneUri:r}=Q.state;r?setTimeout(()=>this.uri=r,0):(await qe.client().connectWalletConnect(n=>this.uri=n,(e=Q.state.selectedChain)==null?void 0:e.id),dt.close())}catch(r){console.error(r),Lt.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>`}};Zs.styles=[ue.globalCss,e_],Sd([Be()],Zs.prototype,"uri",2),Zs=Sd([we("w3m-walletconnect-qr")],Zs);const n_=_e`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-color-success);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-color-success),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var 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 Oc=class extends de{onDisconnect(){dt.close(),qe.client().disconnect(),Q.resetAccount()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=Q.state.address)!=null?t:""),Lt.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>`}};Oc.styles=[ue.globalCss,n_],Oc=o_([we("w3m-account-view")],Oc);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 Ac=class extends de{viewTemplate(){return Ue.isAndroid()?V`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Ue.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>`}};Ac.styles=[ue.globalCss],Ac=l_([we("w3m-connect-wallet-view")],Ac);const u_=_e`.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 h_=Object.defineProperty,d_=Object.getOwnPropertyDescriptor,Id=(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 Js=class extends de{constructor(){super(),this.uri="",this.createConnectionAndWait()}getRouterData(){var t;const e=(t=Te.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=Ue.formatNativeUrl(e,t,n);Ue.openHref(i)}else if(r){const i=Ue.formatUniversalUrl(r,t,n);Ue.openHref(i,"_blank")}}async createConnectionAndWait(t=0){var e;const{standaloneUri:r}=Q.state,{name:n,walletId:i,native:s,universal:o,icon:a}=this.getRouterData(),c={name:n,id:i,links:{native:s,universal:o},image:a};if(r)ne.setRecentWallet(c),this.onFormatAndRedirect(r);else try{await qe.client().connectWalletConnect(l=>{this.uri=l,this.onFormatAndRedirect(l)},(e=Q.state.selectedChain)==null?void 0:e.id),ne.setRecentWallet(c),dt.close()}catch(l){console.error(l),Lt.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}onConnectWithMobile(){Te.push("Qrcode")}onGoToWallet(){const{universal:t,name:e}=this.getRouterData();if(t){const r=Ue.formatUniversalUrl(t,this.uri,e);Ue.openHref(r,"_blank")}}render(){const{name:t,icon:e,universal:r,walletId:n}=this.getRouterData(),i=ne.getWalletName(t);return V`<w3m-modal-header title="${i}"></w3m-modal-header><w3m-modal-content><div class="w3m-wrapper">${e?V`<w3m-wallet-image src="${e}" size="lg"></w3m-wallet-image>`:V`<w3m-wallet-image size="lg" walletid="${Bt(n)}"></w3m-wallet-image>`}<div class="w3m-connecting-title"><w3m-spinner></w3m-spinner><w3m-text variant="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>`}};Js.styles=[ue.globalCss,u_],Id([Be()],Js.prototype,"uri",2),Js=Id([we("w3m-desktop-connector-view")],Js);const f_=_e`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var 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 $c=class extends de{constructor(){super(...arguments),this.explorerUrl="https://explorer.walletconnect.com/"}onGet(t){Ue.openHref(t,"_blank")}onExplore(){Ue.openHref(this.explorerUrl,"_blank")}render(){const{recomendedWallets:t}=at.state,e=ne.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>`}};$c.styles=[ue.globalCss,f_],$c=m_([we("w3m-get-wallet-view")],$c);const w_=_e`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;var 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 Pc=class extends de{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){Te.push("GetWallet")}onLearnMore(){Ue.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>`}};Pc.styles=[ue.globalCss,w_],Pc=v_([we("w3m-help-view")],Pc);const __=_e`.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 E_=Object.defineProperty,x_=Object.getOwnPropertyDescriptor,Tc=(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 Fi=class extends de{constructor(){super(),this.connecting=!0,this.error=!1,this.connector=qe.client().getConnectorById("injected"),this.onConnect()}async onConnect(){const{ready:t}=this.connector;t&&(this.error=!1,this.connecting=!0,await ne.handleConnectorConnection("injected",()=>{this.error=!0,this.connecting=!1}))}render(){const t=ne.getWalletName(this.connector.name),e=ne.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="${Mt(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>`}};Fi.styles=[ue.globalCss,__],Tc([Be()],Fi.prototype,"connecting",2),Tc([Be()],Fi.prototype,"error",2),Fi=Tc([we("w3m-injected-connector-view")],Fi);const C_=_e`.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 S_=Object.defineProperty,I_=Object.getOwnPropertyDescriptor,D_=(t,e,r,n)=>{for(var i=n>1?void 0:n?I_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&S_(e,r,i),i};let Nc=class extends de{getRouterData(){var t;const e=(t=Te.state.data)==null?void 0:t.InstallConnector;if(!e)throw new Error("Missing router data");return e}onInstall(){const{url:t}=this.getRouterData();Ue.openHref(t,"_blank")}onMobile(){const{name:t}=this.getRouterData();Te.push("ConnectWallet"),Lt.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>`}};Nc.styles=[ue.globalCss,C_],Nc=D_([we("w3m-install-connector-view")],Nc);var O_=Object.defineProperty,A_=Object.getOwnPropertyDescriptor,$_=(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 Rc=class extends de{render(){return V`<w3m-modal-header title="Scan the code" .onAction="${ne.handleUriCopy}" .actionIcon="${ye.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Rc.styles=[ue.globalCss],Rc=$_([we("w3m-qrcode-view")],Rc);const P_=_e`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}`;var T_=Object.defineProperty,N_=Object.getOwnPropertyDescriptor,R_=(t,e,r,n)=>{for(var i=n>1?void 0:n?N_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&T_(e,r,i),i};let Lc=class extends de{async onSelectChain(t){const{isConnected:e,selectedChain:r,walletConnectVersion:n}=Q.state;e?r?.id===t.id?Te.replace("Account"):n===2?(await qe.client().switchNetwork({chainId:t.id}),Te.replace("Account")):Te.push("SwitchNetwork",{SwitchNetwork:t}):(Te.push("ConnectWallet"),Q.setSelectedChain(t))}render(){const{chains:t}=Q.state;return V`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${t?.map(e=>V`<w3m-network-button name="${e.name}" chainId="${e.id}" .onClick="${async()=>this.onSelectChain(e)}">${e.name}</w3m-network-button>`)}</div></w3m-modal-content>`}};Lc.styles=[ue.globalCss,P_],Lc=R_([we("w3m-select-network-view")],Lc);const L_=_e`.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 M_=Object.defineProperty,U_=Object.getOwnPropertyDescriptor,Dd=(t,e,r,n)=>{for(var i=n>1?void 0:n?U_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&M_(e,r,i),i};let Xs=class extends de{constructor(){super(),this.error=!1,this.onSwitchNetwork()}getRouterData(){var t;const e=(t=Te.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error("Missing router data");return e}async onSwitchNetwork(){try{this.error=!1;const t=this.getRouterData();await qe.client().switchNetwork({chainId:t.id}),Q.setSelectedChain(t),Te.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="${Mt(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>`}};Xs.styles=[ue.globalCss,L_],Dd([Be()],Xs.prototype,"error",2),Xs=Dd([we("w3m-switch-network-view")],Xs);const F_=_e`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var B_=Object.defineProperty,j_=Object.getOwnPropertyDescriptor,Bi=(t,e,r,n)=>{for(var i=n>1?void 0:n?j_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&B_(e,r,i),i};const Mc=40;let tn=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=ne.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 ne.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<=Mc||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r}=at.state,n=ne.getExtensionWallets(),{listings:i,total:s,page:o}=this.search?r:e;if(!this.endReached&&(this.firstFetch||s>Mc&&i.length<s))try{this.loading=!0;const a=(t=Q.state.standaloneChains)==null?void 0:t.join(","),{listings:c}=await at.getPaginatedWallets({page:this.firstFetch?1:o+1,entries:Mc,device:Ue.isMobile()?"mobile":"desktop",search:this.search,version:Q.state.walletConnectVersion,chains:a}),l=c.map(({image_url:w})=>w.lg),p=n.map(({id:w})=>ne.getWalletIcon(w));await Promise.all([...l.map(async w=>ne.preloadImage(w)),...p.map(async w=>ne.preloadImage(w)),Ue.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),Lt.openToast(ne.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnectCustom({name:t,id:e,links:r}){Ue.isMobile()?ne.handleMobileLinking({links:r,name:t,id:e}):Te.push("DesktopConnector",{DesktopConnector:{name:t,walletId:e,universal:r.universal,native:r.native}})}onConnectListing(t){if(Ue.isMobile()){const{id:e,image_url:r}=t,{native:n,universal:i}=t.mobile;ne.handleMobileLinking({links:{native:n,universal:i},name:t.name,id:e,image:r.lg})}else Te.push("DesktopConnector",{DesktopConnector:{name:t.name,icon:t.image_url.lg,universal:t.desktop.universal||t.homepage,native:t.desktop.native}})}onConnectExtension(t){ne.getWalletId("")===t.id?Te.push("InjectedConnector"):Te.push("InstallConnector",{InstallConnector:t})}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}coinbaseConnectorTemplate(){try{const t=qe.client().getConnectorById(ar.coinbaseWallet);return V`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${async()=>ne.handleConnectorConnection(ar.coinbaseWallet)}"></w3m-wallet-button>`}catch{return null}}render(){const{wallets:t,search:e}=at.state,{isStandalone:r}=Q.state;let{listings:n}=this.search?e:t;n=kt.allowedExplorerListings(n);const i=this.loading&&!n.length,s=this.search.length>=3,o=!i&&(!s||ne.caseSafeIncludes(ar.coinbaseWallet,this.search));let a=!r&&!Ue.isMobile()?ne.getExtensionWallets():[],c=ne.getCustomWallets();s&&(a=a.filter(({name:y})=>ne.caseSafeIncludes(y,this.search)),c=c.filter(({name:y})=>ne.caseSafeIncludes(y,this.search)));const l=!this.loading&&!n.length&&!a.length&&!o,p=Math.max(a.length,n.length),w={"w3m-loading":i,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":l};return V`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Mt(w)}"><div class="w3m-grid">${i?null:[...Array(p)].map((y,m)=>V`${c[m]?V`<w3m-wallet-button name="${c[m].name}" walletId="${c[m].id}" .onClick="${()=>this.onConnectCustom(c[m])}"></w3m-wallet-button>`:null} ${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="${()=>this.onConnectListing(n[m])}"></w3m-wallet-button>`:null}`)} ${o?this.coinbaseConnectorTemplate():null}</div><div class="w3m-placeholder-block">${l?V`<w3m-text variant="large-bold" color="secondary">No results found</w3m-text>`:null} ${!l&&this.loading?V`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};tn.styles=[ue.globalCss,F_],Bi([Be()],tn.prototype,"loading",2),Bi([Be()],tn.prototype,"firstFetch",2),Bi([Be()],tn.prototype,"search",2),Bi([Be()],tn.prototype,"endReached",2),tn=Bi([we("w3m-wallet-explorer-view")],tn);var k_=Object.freeze({__proto__:null,get W3mAccountButton(){return Ti},get W3mConnectButton(){return Jr},get W3mCoreButton(){return Xr},get W3mModal(){return Qr},get W3mNetworkSwitch(){return en}});Zt.EthereumProvider=bb,Zt.OPTIONAL_EVENTS=db,Zt.OPTIONAL_METHODS=hb,Zt.REQUIRED_EVENTS=ys,Zt.REQUIRED_METHODS=ws,Zt.default=bs,Object.defineProperty(Zt,"__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 o4(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 t=1;t<this.sectionColors.length;t+=1)this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({value:{color:new this.minigl.Uniform({value:this.sectionColors[t],type:"vec3"}),noiseFreq:new this.minigl.Uniform({value:[2+t/this.sectionColors.length,3+t/this.sectionColors.length],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:11+.3*t}),noiseFlow:new this.minigl.Uniform({value:6.5+.3*t}),noiseSeed:new this.minigl.Uniform({value:this.seed+10*t}),noiseFloor:new this.minigl.Uniform({value:.1}),noiseCeil:new this.minigl.Uniform({value:.63+.07*t})},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(t){return!!window.document.hidden||parseInt(t,10)%2==0||void 0}updateFrequency(t){this.freqX+=t,this.freqY+=t}toggleColor(t){this.activeColors[t]=this.activeColors[t]===0?1:0}init(){this.playing=!0,this.initGradientColors(),this.initMesh(),this.resize(),requestAnimationFrame(this.animate)}waitForCssVars(){this.computedCanvasStyle&&this.computedCanvasStyle.getPropertyValue("--w3m-gradient-1").indexOf("#")!==-1?this.init():this.init()}initGradientColors(){this.sectionColors=["--w3m-gradient-1","--w3m-gradient-2","--w3m-gradient-3","--w3m-gradient-4"].map(t=>{let e=this.computedCanvasStyle.getPropertyValue(t).trim();return e.length===4&&(e=`#${e.substr(1).split("").map(r=>r+r).join("")}`),e&&`0x${e.substr(1)}`}).filter(Boolean).map(s4)}};function s4(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]}function bd(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}let o4=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(m,E){const A=i.createShader(m);return i.shaderSource(A,E),i.compileShader(A),i.getShaderParameter(A,i.COMPILE_STATUS)||console.error(i.getShaderInfoLog(A)),A}function w(m,E){return Object.entries(m).map(([A,N])=>N.getDeclaration(A,E)).join("")}l.uniforms=c,l.uniformInstances=[];const b="precision highp float;";l.vertexSource=`${b} attribute vec4 position;attribute vec2 uv;attribute vec2 uvNorm;${w(n.commonUniforms,"vertex")} ${w(c,"vertex")} ${o}`,l.Source=`${b} ${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,b])=>b.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 b=l*c.xSegCount+p;c.attributes.index.values[6*b]=w,c.attributes.index.values[6*b+1]=w+1+c.xSegCount,c.attributes.index.values[6*b+2]=w+1,c.attributes.index.values[6*b+3]=w+1,c.attributes.index.values[6*b+4]=w+1+c.xSegCount,c.attributes.index.values[6*b+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,b=o/l.xSegCount,m=a/l.ySegCount;for(let E=0;E<=l.ySegCount;E++){const A=w+E*m;for(let N=0;N<=l.xSegCount;N++){const M=p+N*b,x=E*(l.xSegCount+1)+N;l.attributes.position.values[3*x+"xyz".indexOf(c[0])]=M,l.attributes.position.values[3*x+"xyz".indexOf(c[1])]=-A}}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 be={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>`},a4={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00"};var ar=(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))(ar||{});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"}},c4={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}};var l4=Object.defineProperty,yd=Object.getOwnPropertySymbols,h4=Object.prototype.hasOwnProperty,u4=Object.prototype.propertyIsEnumerable,vd=(t,e,r)=>e in t?l4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d4=(t,e)=>{for(var r in e||(e={}))h4.call(e,r)&&vd(t,r,e[r]);if(yd)for(var r of yd(e))u4.call(e,r)&&vd(t,r,e[r]);return t};const ne={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET:"W3M_RECENT_WALLET",rejectStandaloneButtonComponent(){const{isStandalone:t}=Q.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}=Ve.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=a4[t],{projectId:n,chainImages:i}=Ve.state;return(e=i?.[t])!=null?e:n&&r?at.getImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=c4[t])==null?void 0:e.icon,{projectId:i,tokenImages:s}=Ve.state;return(r=s?.[t])!=null?r:i&&n?at.getImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=ne.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}=Q.state,{links:n,name:i}=t;function s(o){let a="";n!=null&&n.universal?a=Ue.formatUniversalUrl(n.universal,o,i):n!=null&&n.native&&(a=Ue.formatNativeUrl(n.native,o,i)),Ue.openHref(a)}e?(ne.setRecentWallet(t),s(e)):(await qe.client().connectWalletConnect(o=>{s(o)},r?.id),ne.setRecentWallet(t),pt.close())},async handleAndroidLinking(){const{standaloneUri:t,selectedChain:e}=Q.state;t?Ue.openHref(t):(await qe.client().connectWalletConnect(r=>{Ue.setWalletConnectAndroidDeepLink(r),Ue.openHref(r)},e?.id),pt.close())},async handleUriCopy(){const{standaloneUri:t}=Q.state;if(t)await navigator.clipboard.writeText(t);else{const e=qe.client().walletConnectUri;await navigator.clipboard.writeText(e)}Lt.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=Q.state;await qe.client().connectConnector(t,r?.id),pt.close()}catch(r){console.error(r),e?e():Lt.openToast(ne.getErrorMessage(r),"error")}},getCustomWallets(){var t;const{desktopWallets:e,mobileWallets:r}=Ve.state;return(t=Ue.isMobile()?r:e)!=null?t:[]},getCustomImageUrls(){const{chainImages:t,walletImages:e}=Ve.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},getConnectorImageUrls(){return qe.client().getConnectors().map(({id:t})=>qr.getInjectedId(t)).map(t=>ne.getWalletIcon(t))},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;const r=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),n=[];r?.forEach(s=>{let o=0;for(let c=0;c<s.length;c+=1)o=s.charCodeAt(c)+((o<<5)-o),o=o&o;const a=[0,0,0];for(let c=0;c<3;c+=1){const l=o>>c*8&255;a[c]=l}n.push(`rgb(${a[0]}, ${a[1]}, ${a[2]})`)});const i=document.querySelector(":root");if(i){const s={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(s).forEach(([o,a])=>i.style.setProperty(o,a))}},setRecentWallet(t){const{walletConnectVersion:e}=Q.state;localStorage.setItem(ne.W3M_RECENT_WALLET,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(ne.W3M_RECENT_WALLET);if(t){const{walletConnectVersion:e}=Q.state,r=JSON.parse(t);if(r[e])return r[e]}},getExtensionWallets(){const t=[];for(const[e,r]of Object.entries(qr.injectedPreset))e!==ar.coinbaseWallet&&r&&r.isInjected&&!r.isDesktop&&t.push(d4({id:e},r));return t},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())}},f4=_e`#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(--w3m-gradient-1),var(--w3m-gradient-2),var(--w3m-gradient-3),var(--w3m-gradient-4))}.w3m-color-placeholder{background-color:var(--w3m-color-fg-accent)}.w3m-highlight{border:1px solid var(--w3m-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(--w3m-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(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-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(--w3m-color-bg-2)}.w3m-action-btn svg{display:block;object-position:center}.w3m-action-btn path{fill:var(--w3m-color-fg-1)}.w3m-actions{display:flex}.w3m-actions button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}`;var p4=Object.defineProperty,g4=Object.getOwnPropertyDescriptor,pc=(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};const _d=new i4;let Di=class extends fe{constructor(){super(),this.open=!1,this.isHelp=!1,this.unsubscribeRouter=void 0,this.playTimeout=void 0,this.unsubscribeRouter=Te.subscribe(t=>{this.isHelp=t.view==="Help"})}firstUpdated(){const{themeBackground:t}=Ve.state;t==="gradient"&&(this.playTimeout=setTimeout(()=>{_d.play(this.canvasEl),this.open=!0},800))}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this),clearTimeout(this.playTimeout),_d.stop()}get canvasEl(){return ne.getShadowRootElement(this,".w3m-canvas")}onHelp(){Te.push("Help")}render(){const{themeBackground:t}=Ve.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="${Mt(e)}"></canvas>${be.NOISE_TEXTURE}`:null}<div class="w3m-highlight"></div><div class="w3m-toolbar">${be.WALLET_CONNECT_LOGO}<div class="${Mt(r)}"><button class="w3m-action-btn" @click="${this.onHelp}">${be.HELP_ICON}</button> <button class="w3m-action-btn" @click="${pt.close}">${be.CROSS_ICON}</button></div></div>`}};Di.styles=[he.globalCss,f4],pc([Be()],Di.prototype,"open",2),pc([Be()],Di.prototype,"isHelp",2),Di=pc([we("w3m-modal-backcard")],Di);const m4=_e`main{padding:20px;padding-top:0;width:100%}`;var w4=Object.defineProperty,b4=Object.getOwnPropertyDescriptor,y4=(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&&w4(e,r,i),i};let gc=class extends fe{render(){return V`<main><slot></slot></main>`}};gc.styles=[he.globalCss,m4],gc=y4([we("w3m-modal-content")],gc);const v4=_e`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var _4=Object.defineProperty,E4=Object.getOwnPropertyDescriptor,x4=(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 mc=class extends fe{render(){return V`<footer><slot></slot></footer>`}};mc.styles=[he.globalCss,v4],mc=x4([we("w3m-modal-footer")],mc);const C4=_e`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px;transition:opacity .2s ease}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-color-fg-accent)}`;var S4=Object.defineProperty,I4=Object.getOwnPropertyDescriptor,Oi=(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&&S4(e,r,i),i};let Vr=class extends fe{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="${Te.goBack}">${be.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=Te.state.history.length>1,r=this.title?V`<w3m-text variant="large-bold">${this.title}</w3m-text>`:V`<slot></slot>`;return V`<header class="${Mt(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Vr.styles=[he.globalCss,C4],Oi([ye()],Vr.prototype,"title",2),Oi([ye()],Vr.prototype,"onAction",2),Oi([ye()],Vr.prototype,"actionIcon",2),Oi([ye()],Vr.prototype,"border",2),Vr=Oi([we("w3m-modal-header")],Vr);const D4=_e`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var O4=Object.defineProperty,A4=Object.getOwnPropertyDescriptor,wc=(t,e,r,n)=>{for(var i=n>1?void 0:n?A4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&O4(e,r,i),i};let Ai=class extends fe{constructor(){super(),this.view=Te.state.view,this.prevView=Te.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Te.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&(Er(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),Er(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 ne.getShadowRootElement(this,".w3m-router")}get contentEl(){return ne.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return V`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return V`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnector":return V`<w3m-injected-connector-view></w3m-injected-connector-view>`;case"InstallConnector":return V`<w3m-install-connector-view></w3m-install-connector-view>`;case"GetWallet":return V`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"DesktopConnector":return V`<w3m-desktop-connector-view></w3m-desktop-connector-view>`;case"WalletExplorer":return V`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return V`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return V`<w3m-help-view></w3m-help-view>`;case"Account":return V`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return V`<w3m-switch-network-view></w3m-switch-network-view>`;default:return V`<div>Not Found</div>`}}async onChangeRoute(){await Er(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15}).finished,this.view=Te.state.view}render(){return V`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};Ai.styles=[he.globalCss,D4],wc([Be()],Ai.prototype,"view",2),wc([Be()],Ai.prototype,"prevView",2),Ai=wc([we("w3m-modal-router")],Ai);const $4=_e`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(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-color-fg-accent)}.w3m-error path{fill:var(--w3m-color-err)}`;var P4=Object.defineProperty,T4=Object.getOwnPropertyDescriptor,Ed=(t,e,r,n)=>{for(var i=n>1?void 0:n?T4(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 Ws=class extends fe{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Lt.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Lt.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Lt.closeToast()}render(){const{message:t,variant:e}=Lt.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?V`<div class="${Mt(r)}">${e==="success"?be.CHECKMARK_ICON:null} ${e==="error"?be.CROSS_ICON:null}<w3m-text variant="small-normal">${t}</w3m-text></div>`:null}};Ws.styles=[he.globalCss,$4],Ed([Be()],Ws.prototype,"open",2),Ws=Ed([we("w3m-modal-toast")],Ws);const N4=_e`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(--w3m-color-overlay)}`;var R4=Object.defineProperty,L4=Object.getOwnPropertyDescriptor,qs=(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&&R4(e,r,i),i};let Pn=class extends fe{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=[he.globalCss,N4],qs([ye()],Pn.prototype,"onClick",2),qs([ye()],Pn.prototype,"name",2),qs([ye()],Pn.prototype,"chainId",2),Pn=qs([we("w3m-network-button")],Pn);const M4=_e`div{width:inherit;height:inherit}.polygon-stroke{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var U4=Object.defineProperty,F4=Object.getOwnPropertyDescriptor,xd=(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 Vs=class extends fe{constructor(){super(...arguments),this.chainId=""}render(){const t=ne.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`${be.NETWORK_PLACEHOLDER}`}};Vs.styles=[he.globalCss,M4],xd([ye()],Vs.prototype,"chainId",2),Vs=xd([we("w3m-network-image")],Vs);const B4=.1,Cd=2.5,dr=7;function bc(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+B4}function j4(t,e){const r=Array.prototype.slice.call(_i.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 k4={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",s=n==="light"?"#fff":"#141414",o=[],a=j4(t,"Q"),c=e/a.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:A,y:N})=>{const M=(a.length-dr)*c*A,x=(a.length-dr)*c*N,D=.32;for(let y=0;y<l.length;y+=1){const I=c*(dr-y*2);o.push(Ae`<rect fill="${y%2===0?i:s}" height="${I}" rx="${I*D}" ry="${I*D}" width="${I}" x="${M+c*y}" y="${x+c*y}">`)}});const p=Math.floor((r+25)/c),w=a.length/2-p/2,b=a.length/2+p/2-1,m=[];a.forEach((A,N)=>{A.forEach((M,x)=>{if(a[N][x]&&!(N<dr&&x<dr||N>a.length-(dr+1)&&x<dr||N<dr&&x>a.length-(dr+1))&&!(N>w&&N<b&&x>w&&x<b)){const D=N*c+c/2,y=x*c+c/2;m.push([D,y])}})});const E={};return m.forEach(([A,N])=>{E[A]?E[A].push(N):E[A]=[N]}),Object.entries(E).map(([A,N])=>{const M=N.filter(x=>N.every(D=>!bc(x,D,c)));return[Number(A),M]}).forEach(([A,N])=>{N.forEach(M=>{o.push(Ae`<circle cx="${A}" cy="${M}" fill="${i}" r="${c/Cd}">`)})}),Object.entries(E).filter(([A,N])=>N.length>1).map(([A,N])=>{const M=N.filter(x=>N.some(D=>bc(x,D,c)));return[Number(A),M]}).map(([A,N])=>{N.sort((x,D)=>x<D?-1:1);const M=[];for(const x of N){const D=M.find(y=>y.some(I=>bc(x,I,c)));D?D.push(x):M.push([x])}return[A,M.map(x=>[x[0],x[x.length-1]])]}).forEach(([A,N])=>{N.forEach(([M,x])=>{o.push(Ae`<line x1="${A}" x2="${A}" y1="${M}" y2="${x}" stroke="${i}" stroke-width="${c/(Cd/2)}" stroke-linecap="round">`)})}),o}},H4=_e`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:15px}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-color-fg-accent)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var z4=Object.defineProperty,W4=Object.getOwnPropertyDescriptor,$i=(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 Kr=class extends fe{constructor(){super(...arguments),this.uri="",this.size=0,this.logoSrc="",this.walletId=""}svgTemplate(){var t;const e=(t=Ve.state.themeMode)!=null?t:"light";return Ae`<svg height="${this.size}" width="${this.size}">${k4.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return V`<div>${this.walletId||this.logoSrc?V`<w3m-wallet-image walletId="${Bt(this.walletId)}" src="${Bt(this.logoSrc)}"></w3m-wallet-image>`:be.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Kr.styles=[he.globalCss,H4],$i([ye()],Kr.prototype,"uri",2),$i([ye({type:Number})],Kr.prototype,"size",2),$i([ye()],Kr.prototype,"logoSrc",2),$i([ye()],Kr.prototype,"walletId",2),Kr=$i([we("w3m-qrcode")],Kr);const q4=_e`: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(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}input::placeholder{color:transparent}svg{margin-right:4px}.w3m-placeholder{top:0;left:50%;transform:translateX(-50%);transition:.2s all ease;pointer-events:none;display:flex;align-items:center;justify-content:center;height:100%;width:fit-content;position:relative}input:focus-within+.w3m-placeholder,input:not(:placeholder-shown)+.w3m-placeholder{transform:translateX(10px);left:0}w3m-text{opacity:1;transition:.2s opacity ease}input:focus-within+.w3m-placeholder w3m-text,input:not(:placeholder-shown)+.w3m-placeholder w3m-text{opacity:0}input:focus-within,input:not(:placeholder-shown){color:var(--w3m-color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-color-fg-accent)}path{fill:var(--w3m-color-fg-2)}`;var V4=Object.defineProperty,K4=Object.getOwnPropertyDescriptor,Sd=(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 Ks=class extends fe{constructor(){super(...arguments),this.onChange=()=>null}render(){const t=Ue.isMobile()?"Search mobile wallets":"Search desktop wallets";return V`<input type="text" @input="${this.onChange}" placeholder="${t}"><div class="w3m-placeholder">${be.SEARCH_ICON}<w3m-text color="secondary" variant="medium-thin">${t}</w3m-text></div>`}};Ks.styles=[he.globalCss,q4],Sd([ye()],Ks.prototype,"onChange",2),Ks=Sd([we("w3m-search-input")],Ks);const G4=_e`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-color-fg-accent)}`;var Z4=Object.defineProperty,Y4=Object.getOwnPropertyDescriptor,J4=(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 yc=class extends fe{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>`}};yc.styles=[he.globalCss,G4],yc=J4([we("w3m-spinner")],yc);const X4=_e`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(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-color-fg-inverse)}.w3m-color-accnt{color:var(--w3m-color-fg-accent)}.w3m-color-error{color:var(--w3m-color-err)}`;var Q4=Object.defineProperty,e8=Object.getOwnPropertyDescriptor,vc=(t,e,r,n)=>{for(var i=n>1?void 0:n?e8(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 fe{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="${Mt(t)}"><slot></slot></span>`}};Pi.styles=[he.globalCss,X4],vc([ye()],Pi.prototype,"variant",2),vc([ye()],Pi.prototype,"color",2),Pi=vc([we("w3m-text")],Pi);const t8=_e`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;inset:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var r8=Object.defineProperty,n8=Object.getOwnPropertyDescriptor,Id=(t,e,r,n)=>{for(var i=n>1?void 0:n?n8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&r8(e,r,i),i};let Gs=class extends fe{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=ne.getTokenIcon((t=this.symbol)!=null?t:"");return e?V`<div><img src="${e}" alt="${this.id}"></div>`:be.TOKEN_PLACEHOLDER}};Gs.styles=[he.globalCss,t8],Id([ye()],Gs.prototype,"symbol",2),Gs=Id([we("w3m-token-image")],Gs);const i8=_e`button{transition:all .2s ease;width:100%;height:100%;border-radius:10px;display:flex;align-items:flex-start}button:hover{background-color:var(--w3m-color-overlay)}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:15px;margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var s8=Object.defineProperty,o8=Object.getOwnPropertyDescriptor,Sr=(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&&s8(e,r,i),i};let cr=class extends fe{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:ne.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};cr.styles=[he.globalCss,i8],Sr([ye()],cr.prototype,"onClick",2),Sr([ye()],cr.prototype,"name",2),Sr([ye()],cr.prototype,"walletId",2),Sr([ye()],cr.prototype,"label",2),Sr([ye()],cr.prototype,"src",2),Sr([ye()],cr.prototype,"installed",2),Sr([ye()],cr.prototype,"recent",2),cr=Sr([we("w3m-wallet-button")],cr);const a8=_e`div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;inset:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var c8=Object.defineProperty,l8=Object.getOwnPropertyDescriptor,_c=(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 Ti=class extends fe{constructor(){super(...arguments),this.walletId=void 0,this.src=void 0}render(){var t;const e=ne.getWalletId((t=this.walletId)!=null?t:""),r=ne.getWalletId(e),n=this.src?this.src:ne.getWalletIcon(r);return V`${n.length?V`<div><img src="${n}" alt="${this.id}"></div>`:be.WALLET_PLACEHOLDER}`}};Ti.styles=[he.globalCss,a8],_c([ye()],Ti.prototype,"walletId",2),_c([ye()],Ti.prototype,"src",2),Ti=_c([we("w3m-wallet-image")],Ti);const h8=_e`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:10px;padding:4px 4px 4px 8px}div button{border-radius:16px;padding:4px 8px 4px 4px;height:auto;margin-left:10px;color:var(--w3m-color-fg-inverse);background-color:var(--w3m-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(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var u8=Object.defineProperty,d8=Object.getOwnPropertyDescriptor,Dd=(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&&u8(e,r,i),i};let Ni=class extends fe{constructor(){super(),this.balance="hide",ne.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=Q.state;t||pt.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>`}};Ni.styles=[he.globalCss,h8],Dd([ye()],Ni.prototype,"balance",2),Ni=Dd([we("w3m-account-button")],Ni);const f8=_e`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(--w3m-color-overlay)}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var p8=Object.defineProperty,g8=Object.getOwnPropertyDescriptor,Ec=(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 Ri=class extends fe{constructor(){super(),this.chainId="",this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=Q.state;this.chainId=t?.id.toString(),this.label=t?.name,this.unsubscribeNetwork=Q.subscribe(({selectedChain:e})=>{this.chainId=e?.id.toString(),this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){Te.push("SelectNetwork")}render(){const{chains:t}=Q.state,e=t&&t.length>1;return V`<button @click="${this.onClick}" ?disabled="${!e}"><w3m-network-image chainId="${Bt(this.chainId)}"></w3m-network-image><w3m-text variant="xsmall-normal" color="accent">${this.label}</w3m-text></button>`}};Ri.styles=[he.globalCss,f8],Ec([Be()],Ri.prototype,"chainId",2),Ec([Be()],Ri.prototype,"label",2),Ri=Ec([we("w3m-account-network-button")],Ri);const m8=_e`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var w8=Object.defineProperty,b8=Object.getOwnPropertyDescriptor,Li=(t,e,r,n)=>{for(var i=n>1?void 0:n?b8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&w8(e,r,i),i};let Gr=class extends fe{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=Q.state.address,this.name=Q.state.profileName,this.loading=Boolean(Q.state.profileLoading),this.unsubscribeAccount=Q.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="${Mt(r)}" variant="${e?"medium-normal":"large-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:ne.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};Gr.styles=[he.globalCss,m8],Li([Be()],Gr.prototype,"address",2),Li([Be()],Gr.prototype,"name",2),Li([Be()],Gr.prototype,"loading",2),Li([ye()],Gr.prototype,"variant",2),Gr=Li([we("w3m-address-text")],Gr);const y8=_e`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 10),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px}.w3m-slider::after,.w3m-slider::before{content:'';height:100%;width:50px;z-index:2;position:absolute;background:linear-gradient(to right,var(--w3m-color-bg-1) 0,transparent 100%);top:0}.w3m-slider::before{left:0}.w3m-slider::after{right:0;transform:rotateZ(180deg)}.w3m-track{display:flex;width:calc(70px * 20);animation:scroll 20s linear infinite}.w3m-action{padding:30px 0 10px 0;display:flex;justify-content:center;align-items:center;flex-direction:column}.w3m-action w3m-button-big:last-child{margin-top:10px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;box-shadow:0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08);border-radius:15px}`;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 xc=class extends fe{onGoToQrcode(){Te.push("Qrcode")}onGoToGetWallet(){Te.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="${be.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="${ne.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>`}};xc.styles=[he.globalCss,y8],xc=E8([we("w3m-android-wallet-selection")],xc);const x8=_e`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var C8=Object.defineProperty,S8=Object.getOwnPropertyDescriptor,Mi=(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 Zr=class extends fe{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=Q.state.address,this.avatar=Q.state.profileAvatar,this.loading=Boolean(Q.state.profileLoading),this.unsubscribeAccount=Q.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="${Mt(t)}" src="${this.avatar}">`:this.address?(ne.generateAvatarColors(this.address),V`<div class="${Mt(t)}">${this.loading?V`<div class="w3m-loader"></div>`:null}</div>`):null}};Zr.styles=[he.globalCss,x8],Mi([Be()],Zr.prototype,"address",2),Mi([Be()],Zr.prototype,"avatar",2),Mi([Be()],Zr.prototype,"loading",2),Mi([ye()],Zr.prototype,"size",2),Zr=Mi([we("w3m-avatar")],Zr);const I8=_e`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var D8=Object.defineProperty,O8=Object.getOwnPropertyDescriptor,Cc=(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&&D8(e,r,i),i};let Ui=class extends fe{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=Q.state.balance)==null?void 0:t.symbol,this.amount=(e=Q.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=Q.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="${Bt(this.symbol)}"></w3m-token-image><w3m-text variant="medium-normal" color="primary">${t} ${this.symbol}</w3m-text></div>`}};Ui.styles=[he.globalCss,I8],Cc([Be()],Ui.prototype,"symbol",2),Cc([Be()],Ui.prototype,"amount",2),Ui=Cc([we("w3m-balance")],Ui);const A8=_e`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-color-fg-inverse)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var $8=Object.defineProperty,P8=Object.getOwnPropertyDescriptor,Zs=(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 Yr=class extends fe{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,ne.rejectStandaloneButtonComponent(),this.modalUnsub=pt.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"?be.WALLET_CONNECT_ICON:null}onClick(){Q.state.isConnected?this.onDisconnect():this.onConnect()}onConnect(){this.loading=!0;const{enableNetworkView:t}=Ve.state,{chains:e,selectedChain:r}=Q.state,n=e?.length&&e.length>1;t||n&&!r?pt.open({route:"SelectNetwork"}):pt.open({route:"ConnectWallet"})}onDisconnect(){qe.client().disconnect(),Q.resetAccount()}render(){return V`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${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=[he.globalCss,A8],Zs([Be()],Yr.prototype,"loading",2),Zs([ye()],Yr.prototype,"label",2),Zs([ye()],Yr.prototype,"icon",2),Yr=Zs([we("w3m-connect-button")],Yr);var T8=Object.defineProperty,N8=Object.getOwnPropertyDescriptor,Fi=(t,e,r,n)=>{for(var i=n>1?void 0:n?N8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&T8(e,r,i),i};let Jr=class extends fe{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.balance="hide",this.unsubscribeAccount=void 0,ne.rejectStandaloneButtonComponent(),this.isConnected=Q.state.isConnected,this.unsubscribeAccount=Q.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=Ve.state;return this.isConnected&&t?V`<w3m-account-button balance="${Bt(this.balance)}"></w3m-account-button>`:V`<w3m-connect-button label="${this.isConnected?"Disconnect":Bt(this.label)}" icon="${Bt(this.icon)}"></w3m-connect-button>`}};Fi([Be()],Jr.prototype,"isConnected",2),Fi([ye()],Jr.prototype,"label",2),Fi([ye()],Jr.prototype,"icon",2),Fi([ye()],Jr.prototype,"balance",2),Jr=Fi([we("w3m-core-button")],Jr);const kt={allowedExplorerListings(t){const{explorerAllowList:e,explorerDenyList:r}=Ve.state;let n=[...t];return e&&(n=n.filter(i=>e.includes(i.id))),r&&(n=n.filter(i=>!r.includes(i.id))),n},walletsWithInjected(t){let e=[...t??[]];if(window.ethereum){const r=ne.getWalletName("");e=e.filter(({name:n})=>!ne.caseSafeIncludes(n,r))}return e},connectorWallets(){const{isStandalone:t}=Q.state;if(t)return[];let e=qe.client().getConnectors();return!window.ethereum&&Ue.isMobile()&&(e=e.filter(({id:r})=>r!=="injected"&&r!==ar.metaMask)),e},walletTemplatesWithRecent(t,e){let r=[...t];if(e){const n=ne.getRecentWallet();r=r.filter(i=>!i.values.includes(n?.name)),r.splice(1,0,e)}return r},deduplicateExplorerListingsFromConnectors(t){const{isStandalone:e}=Q.state;if(e)return t;const r=qe.client().getConnectors().map(({name:n})=>n.toUpperCase());return t.filter(({name:n})=>!r.includes(n.toUpperCase()))}},R8=_e`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-color-fg-accent)}`;var L8=Object.defineProperty,M8=Object.getOwnPropertyDescriptor,U8=(t,e,r,n)=>{for(var i=n>1?void 0:n?M8(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 Sc=class extends fe{onDesktopWallet(t){Te.push("DesktopConnector",{DesktopConnector:t})}onInjectedWallet(){Te.push("InjectedConnector")}onInstallConnector(){Te.push("InstallConnector",{InstallConnector:{id:"metaMask",name:"MetaMask",isMobile:!0,url:"https://metamask.io"}})}async onConnectorWallet(t){window.ethereum?t==="injected"||t===ar.metaMask?this.onInjectedWallet():await ne.handleConnectorConnection(t):this.onInstallConnector()}desktopWalletsTemplate(){const{desktopWallets:t}=Ve.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=kt.allowedExplorerListings(at.state.previewWallets);return t=kt.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 kt.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=ne.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Bt(e)}" src="${Bt(i)}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n?.universal,native:n?.native,icon:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=Q.state,e=this.desktopWalletsTemplate(),r=this.previewWalletsTemplate(),n=this.connectorWalletsTemplate(),i=this.recentWalletTemplate(),s=[...e??[],...r],o=[...n,...s],a=kt.walletTemplatesWithRecent(o,i),c=kt.walletTemplatesWithRecent(s,i),l=t?c:a,p=l.length>4;let w=[];p?w=l.filter(m=>!m.values.includes(ar.coinbaseWallet)).slice(0,3):w=l;const b=Boolean(w.length);return V`<w3m-modal-header border="${!0}" title="Connect your wallet" .onAction="${ne.handleUriCopy}" .actionIcon="${be.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${be.MOBILE_ICON}<w3m-text variant="small-normal" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${be.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>${b?V`<w3m-modal-footer><div class="w3m-desktop-title">${be.DESKTOP_ICON}<w3m-text variant="small-normal" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${w} ${p?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};Sc.styles=[he.globalCss,R8],Sc=U8([we("w3m-desktop-wallet-selection")],Sc);const F8=_e`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-color-fg-accent);text-decoration:none;transition:opacity .2s ease-in-out}a:hover{opacity:.8}`;var B8=Object.defineProperty,j8=Object.getOwnPropertyDescriptor,k8=(t,e,r,n)=>{for(var i=n>1?void 0:n?j8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&B8(e,r,i),i};let Ic=class extends fe{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=Ve.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}};Ic.styles=[he.globalCss,F8],Ic=k8([we("w3m-legal-notice")],Ic);const H8=_e`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var z8=Object.defineProperty,W8=Object.getOwnPropertyDescriptor,q8=(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&&z8(e,r,i),i};let Dc=class extends fe{onGoToQrcode(){Te.push("Qrcode")}async onConnectorWallet(t){await ne.handleConnectorConnection(t)}mobileWalletsTemplate(){const{mobileWallets:t}=Ve.state,e=kt.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()=>ne.handleMobileLinking({links:{native:s,universal:i},name:n,id:r})}"></w3m-wallet-button>`)}previewWalletsTemplate(){const{previewWallets:t}=at.state;let e=kt.walletsWithInjected(t);return e=kt.allowedExplorerListings(e),e=kt.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()=>ne.handleMobileLinking({links:{native:i,universal:s},name:n,id:o,image:r.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){let t=kt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==ar.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=ne.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Bt(e)}" src="${Bt(i)}" .onClick="${async()=>ne.handleMobileLinking({name:r,id:e,links:n,image:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=Q.state,e=this.connectorWalletsTemplate(),r=this.mobileWalletsTemplate(),n=this.previewWalletsTemplate(),i=this.recentWalletTemplate(),s=r??n,o=[...e,...s],a=kt.walletTemplatesWithRecent(o,i),c=kt.walletTemplatesWithRecent(s,i),l=t?c:a,p=l.length>8;let w=[];p?w=l.filter(A=>!A.values.includes(ar.coinbaseWallet)).slice(0,7):w=l;const b=w.slice(0,4),m=w.slice(4,8),E=Boolean(w.length);return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${be.QRCODE_ICON}"></w3m-modal-header>${E?V`<w3m-modal-content><div class="w3m-grid">${b} ${m.length?V`${m} ${p?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}`:null}</div></w3m-modal-content>`:null}`}};Dc.styles=[he.globalCss,H8],Dc=q8([we("w3m-mobile-wallet-selection")],Dc);const V8=_e`:host{all:initial}.w3m-overlay{inset:0;position:fixed;z-index:var(--w3m-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(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px}.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 K8=Object.defineProperty,G8=Object.getOwnPropertyDescriptor,Ys=(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 Xr=class extends fe{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,he.setTheme(),this.unsubscribeConfig=Ve.subscribe(he.setTheme),this.unsubscribeModal=pt.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()}),!Q.state.isStandalone){Q.getAccount();const t=Q.getSelectedChain();this.activeChainId=t?.id,this.fetchEnsProfile(),this.fetchBalance(),this.unwatchNetwork=qe.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(Q.setSelectedChain(r),this.activeChainId=r.id,Q.resetBalance(),this.fetchBalance())}),this.unwatchAccount=qe.client().watchAccount(e=>{const{address:r}=Q.state;e.address!==r&&(this.fetchEnsProfile(e.address),this.fetchBalance(e.address)),Q.setAddress(e.address),Q.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 ne.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return ne.getShadowRootElement(this,".w3m-container")}async fetchEnsProfile(t){try{if(Ve.state.enableAccountView){Q.setProfileLoading(!0);const e=t??Q.state.address,{id:r}=qe.client().getDefaultChain();if(e&&r===1){const[n,i]=await Promise.all([qe.client().fetchEnsName({address:e,chainId:1}),qe.client().fetchEnsAvatar({address:e,chainId:1})]);i&&await ne.preloadImage(i),Q.setProfileName(n),Q.setProfileAvatar(i)}}}catch(e){console.error(e),Lt.openToast(ne.getErrorMessage(e),"error")}finally{Q.setProfileLoading(!1)}}async fetchBalance(t){try{if(Ve.state.enableAccountView){Q.setBalanceLoading(!0);const e=t??Q.state.address;if(e){const r=await qe.client().fetchBalance({address:e});Q.setBalance({amount:r.formatted,symbol:r.symbol})}}}catch(e){console.error(e),Lt.openToast(ne.getErrorMessage(e),"error")}finally{Q.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,walletConnectVersion:n}=Q.state,i=e?.join(",");await Promise.all([at.getPreviewWallets({page:1,entries:10,chains:i,device:Ue.isMobile()?"mobile":"desktop",version:n}),at.getRecomendedWallets()]),Q.setIsDataLoaded(!0);const{previewWallets:s,recomendedWallets:o}=at.state,a=(t=r?.map(l=>ne.getChainIcon(l.id)))!=null?t:[],c=[...s,...o].map(l=>l.image_url.lg);await this.preloadExplorerImages([...a,...c])}async preloadExplorerImages(t){t.length&&await Promise.all(t.map(async e=>ne.preloadImage(e)))}async preloadCustomImages(){const t=ne.getCustomImageUrls();t.length&&await Promise.all(t.map(async e=>ne.preloadImage(e)))}async preloadConnectorImages(){if(!Q.state.isStandalone){const t=ne.getConnectorImageUrls();t.length&&await Promise.all(t.map(async e=>ne.preloadImage(e)))}}async preloadModalData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadExplorerData(),this.preloadCustomImages(),this.preloadConnectorImages()]))}catch(t){console.error(t),Lt.openToast("Failed preloading","error")}}onCloseModal(t){t.target===t.currentTarget&&pt.close()}async onOpenModalEvent(){await this.preloadModalData(),this.toggleBodyScroll(!1);const t=.2;await Er(this.containerEl,{y:0},{duration:0}).finished,Er(this.overlayEl,{opacity:[0,1]},{duration:.2,delay:t}),Er(this.containerEl,ne.isMobileAnimation()?{y:["50vh",0]}:{scale:[.98,1]},{scale:{easing:Rs({velocity:.4})},y:{easing:Rs({mass:.5})},delay:t}),this.addKeyboardEvents(),this.open=!0}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents(),await Promise.all([Er(this.containerEl,ne.isMobileAnimation()?{y:[0,"50vh"]}:{scale:[1,.98]},{scale:{easing:Rs({velocity:0})},y:{easing:Rs({mass:.5})}}).finished,Er(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"?pt.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="${Mt(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=[he.globalCss,V8],Ys([Be()],Xr.prototype,"open",2),Ys([Be()],Xr.prototype,"preload",2),Ys([Be()],Xr.prototype,"activeChainId",2),Xr=Ys([we("w3m-modal")],Xr);const Z8=_e`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var Y8=Object.defineProperty,J8=Object.getOwnPropertyDescriptor,Js=(t,e,r,n)=>{for(var i=n>1?void 0:n?J8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Y8(e,r,i),i};let Qr=class extends fe{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,ne.rejectStandaloneButtonComponent();const{selectedChain:t}=Q.state;this.onSetChainData(t),this.unsubscribeNetwork=Q.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=Q.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(){pt.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=Q.state,r=e&&e.length>1;return V`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${Bt(this.chainId)}"></w3m-network-image><w3m-text variant="medium-normal" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};Qr.styles=[he.globalCss,Z8],Js([Be()],Qr.prototype,"chainId",2),Js([Be()],Qr.prototype,"label",2),Js([Be()],Qr.prototype,"wrongNetwork",2),Qr=Js([we("w3m-network-switch")],Qr);const X8=_e`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(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:hover{background-color:var(--w3m-color-overlay)}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:8px;border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var Q8=Object.defineProperty,e_=Object.getOwnPropertyDescriptor,t_=(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&&Q8(e,r,i),i};let Oc=class extends fe{onClick(){Te.push("WalletExplorer")}render(){const{previewWallets:t}=at.state,e=ne.getCustomWallets(),r=[...t,...e].reverse().slice(0,4);return V`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{var i;const s=(i=n.image_url)==null?void 0:i.lg;if(s)return V`<img src="${s}">`;const o=ne.getWalletId(n.id),a=ne.getWalletIcon(o);return a?V`<img src="${a}">`:be.WALLET_PLACEHOLDER})}</div><w3m-text variant="xsmall-normal">View All</w3m-text></button>`}};Oc.styles=[he.globalCss,X8],Oc=t_([we("w3m-view-all-wallets-button")],Oc);const r_=_e`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var n_=Object.defineProperty,i_=Object.getOwnPropertyDescriptor,Od=(t,e,r,n)=>{for(var i=n>1?void 0:n?i_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&n_(e,r,i),i};let Xs=class extends fe{constructor(){super(),this.uri="",this.createConnectionAndWait()}get overlayEl(){return ne.getShadowRootElement(this,".w3m-qr-container")}async createConnectionAndWait(t=0){var e;try{const{standaloneUri:r}=Q.state;r?setTimeout(()=>this.uri=r,0):(await qe.client().connectWalletConnect(n=>this.uri=n,(e=Q.state.selectedChain)==null?void 0:e.id),pt.close())}catch(r){console.error(r),Lt.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>`}};Xs.styles=[he.globalCss,r_],Od([Be()],Xs.prototype,"uri",2),Xs=Od([we("w3m-walletconnect-qr")],Xs);const s_=_e`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-color-success);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-color-success),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var o_=Object.defineProperty,a_=Object.getOwnPropertyDescriptor,c_=(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 Ac=class extends fe{onDisconnect(){pt.close(),qe.client().disconnect(),Q.resetAccount()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=Q.state.address)!=null?t:""),Lt.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="${be.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${be.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};Ac.styles=[he.globalCss,s_],Ac=c_([we("w3m-account-view")],Ac);var l_=Object.defineProperty,h_=Object.getOwnPropertyDescriptor,u_=(t,e,r,n)=>{for(var i=n>1?void 0:n?h_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&l_(e,r,i),i};let $c=class extends fe{viewTemplate(){return Ue.isAndroid()?V`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Ue.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>`}};$c.styles=[he.globalCss],$c=u_([we("w3m-connect-wallet-view")],$c);const d_=_e`.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 f_=Object.defineProperty,p_=Object.getOwnPropertyDescriptor,Ad=(t,e,r,n)=>{for(var i=n>1?void 0:n?p_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&f_(e,r,i),i};let Qs=class extends fe{constructor(){super(),this.uri="",this.createConnectionAndWait()}getRouterData(){var t;const e=(t=Te.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=Ue.formatNativeUrl(e,t,n);Ue.openHref(i)}else if(r){const i=Ue.formatUniversalUrl(r,t,n);Ue.openHref(i,"_blank")}}async createConnectionAndWait(t=0){var e;const{standaloneUri:r}=Q.state,{name:n,walletId:i,native:s,universal:o,icon:a}=this.getRouterData(),c={name:n,id:i,links:{native:s,universal:o},image:a};if(r)ne.setRecentWallet(c),this.onFormatAndRedirect(r);else try{await qe.client().connectWalletConnect(l=>{this.uri=l,this.onFormatAndRedirect(l)},(e=Q.state.selectedChain)==null?void 0:e.id),ne.setRecentWallet(c),pt.close()}catch(l){console.error(l),Lt.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}onConnectWithMobile(){Te.push("Qrcode")}onGoToWallet(){const{universal:t,name:e}=this.getRouterData();if(t){const r=Ue.formatUniversalUrl(t,this.uri,e);Ue.openHref(r,"_blank")}}render(){const{name:t,icon:e,universal:r,walletId:n}=this.getRouterData(),i=ne.getWalletName(t);return V`<w3m-modal-header title="${i}"></w3m-modal-header><w3m-modal-content><div class="w3m-wrapper">${e?V`<w3m-wallet-image src="${e}" size="lg"></w3m-wallet-image>`:V`<w3m-wallet-image size="lg" walletid="${Bt(n)}"></w3m-wallet-image>`}<div class="w3m-connecting-title"><w3m-spinner></w3m-spinner><w3m-text variant="large-bold" color="secondary">${`Continue in ${i}...`}</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${async()=>this.createConnectionAndWait()}" .iconRight="${be.RETRY_ICON}">Retry</w3m-button>${r?V`<w3m-button .onClick="${this.onGoToWallet.bind(this)}" .iconLeft="${be.ARROW_UP_RIGHT_ICON}">Go to Wallet</w3m-button>`:V`<w3m-button .onClick="${this.onConnectWithMobile}" .iconLeft="${be.MOBILE_ICON}">Connect with Mobile</w3m-button>`}</div></div></w3m-modal-content>`}};Qs.styles=[he.globalCss,d_],Ad([Be()],Qs.prototype,"uri",2),Qs=Ad([we("w3m-desktop-connector-view")],Qs);const g_=_e`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var m_=Object.defineProperty,w_=Object.getOwnPropertyDescriptor,b_=(t,e,r,n)=>{for(var i=n>1?void 0:n?w_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&m_(e,r,i),i};let Pc=class extends fe{constructor(){super(...arguments),this.explorerUrl="https://explorer.walletconnect.com/"}onGet(t){Ue.openHref(t,"_blank")}onExplore(){Ue.openHref(this.explorerUrl,"_blank")}render(){const{recomendedWallets:t}=at.state,e=ne.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="${be.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="${be.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="${be.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Pc.styles=[he.globalCss,g_],Pc=b_([we("w3m-get-wallet-view")],Pc);const y_=_e`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;var v_=Object.defineProperty,__=Object.getOwnPropertyDescriptor,E_=(t,e,r,n)=>{for(var i=n>1?void 0:n?__(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&v_(e,r,i),i};let Tc=class extends fe{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){Te.push("GetWallet")}onLearnMore(){Ue.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">${be.HELP_CHART_IMG} ${be.HELP_PAINTING_IMG} ${be.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">${be.HELP_KEY_IMG} ${be.HELP_USER_IMG} ${be.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">${be.HELP_COMPAS_IMG} ${be.HELP_NOUN_IMG} ${be.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="${be.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${be.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};Tc.styles=[he.globalCss,y_],Tc=E_([we("w3m-help-view")],Tc);const x_=_e`.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,S_=Object.getOwnPropertyDescriptor,Nc=(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&&C_(e,r,i),i};let Bi=class extends fe{constructor(){super(),this.connecting=!0,this.error=!1,this.connector=qe.client().getConnectorById("injected"),this.onConnect()}async onConnect(){const{ready:t}=this.connector;t&&(this.error=!1,this.connecting=!0,await ne.handleConnectorConnection("injected",()=>{this.error=!0,this.connecting=!1}))}render(){const t=ne.getWalletName(this.connector.name),e=ne.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="${Mt(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="${be.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Bi.styles=[he.globalCss,x_],Nc([Be()],Bi.prototype,"connecting",2),Nc([Be()],Bi.prototype,"error",2),Bi=Nc([we("w3m-injected-connector-view")],Bi);const I_=_e`.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 D_=Object.defineProperty,O_=Object.getOwnPropertyDescriptor,A_=(t,e,r,n)=>{for(var i=n>1?void 0:n?O_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&D_(e,r,i),i};let Rc=class extends fe{getRouterData(){var t;const e=(t=Te.state.data)==null?void 0:t.InstallConnector;if(!e)throw new Error("Missing router data");return e}onInstall(){const{url:t}=this.getRouterData();Ue.openHref(t,"_blank")}onMobile(){const{name:t}=this.getRouterData();Te.push("ConnectWallet"),Lt.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="${be.ARROW_DOWN_ICON}">Install Extension</w3m-button>${r?V`<w3m-button .onClick="${this.onMobile.bind(this)}" .iconLeft="${be.MOBILE_ICON}">${t} Mobile</w3m-button>`:null}</div></div></w3m-modal-content>`}};Rc.styles=[he.globalCss,I_],Rc=A_([we("w3m-install-connector-view")],Rc);var $_=Object.defineProperty,P_=Object.getOwnPropertyDescriptor,T_=(t,e,r,n)=>{for(var i=n>1?void 0:n?P_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&$_(e,r,i),i};let Lc=class extends fe{render(){return V`<w3m-modal-header title="Scan the code" .onAction="${ne.handleUriCopy}" .actionIcon="${be.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Lc.styles=[he.globalCss],Lc=T_([we("w3m-qrcode-view")],Lc);const N_=_e`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}`;var R_=Object.defineProperty,L_=Object.getOwnPropertyDescriptor,M_=(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&&R_(e,r,i),i};let Mc=class extends fe{async onSelectChain(t){const{isConnected:e,selectedChain:r,walletConnectVersion:n}=Q.state;e?r?.id===t.id?Te.replace("Account"):n===2?(await qe.client().switchNetwork({chainId:t.id}),Te.replace("Account")):Te.push("SwitchNetwork",{SwitchNetwork:t}):(Te.push("ConnectWallet"),Q.setSelectedChain(t))}render(){const{chains:t}=Q.state;return V`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${t?.map(e=>V`<w3m-network-button name="${e.name}" chainId="${e.id}" .onClick="${async()=>this.onSelectChain(e)}">${e.name}</w3m-network-button>`)}</div></w3m-modal-content>`}};Mc.styles=[he.globalCss,N_],Mc=M_([we("w3m-select-network-view")],Mc);const U_=_e`.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 F_=Object.defineProperty,B_=Object.getOwnPropertyDescriptor,$d=(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&&F_(e,r,i),i};let eo=class extends fe{constructor(){super(),this.error=!1,this.onSwitchNetwork()}getRouterData(){var t;const e=(t=Te.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error("Missing router data");return e}async onSwitchNetwork(){try{this.error=!1;const t=this.getRouterData();await qe.client().switchNetwork({chainId:t.id}),Q.setSelectedChain(t),Te.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="${Mt(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="${be.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};eo.styles=[he.globalCss,U_],$d([Be()],eo.prototype,"error",2),eo=$d([we("w3m-switch-network-view")],eo);const j_=_e`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var k_=Object.defineProperty,H_=Object.getOwnPropertyDescriptor,ji=(t,e,r,n)=>{for(var i=n>1?void 0:n?H_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&k_(e,r,i),i};const Uc=40;let en=class extends fe{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=ne.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 ne.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<=Uc||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r}=at.state,n=ne.getExtensionWallets(),{listings:i,total:s,page:o}=this.search?r:e;if(!this.endReached&&(this.firstFetch||s>Uc&&i.length<s))try{this.loading=!0;const a=(t=Q.state.standaloneChains)==null?void 0:t.join(","),{listings:c}=await at.getPaginatedWallets({page:this.firstFetch?1:o+1,entries:Uc,device:Ue.isMobile()?"mobile":"desktop",search:this.search,version:Q.state.walletConnectVersion,chains:a}),l=c.map(({image_url:w})=>w.lg),p=n.map(({id:w})=>ne.getWalletIcon(w));await Promise.all([...l.map(async w=>ne.preloadImage(w)),...p.map(async w=>ne.preloadImage(w)),Ue.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),Lt.openToast(ne.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnectCustom({name:t,id:e,links:r}){Ue.isMobile()?ne.handleMobileLinking({links:r,name:t,id:e}):Te.push("DesktopConnector",{DesktopConnector:{name:t,walletId:e,universal:r.universal,native:r.native}})}onConnectListing(t){if(Ue.isMobile()){const{id:e,image_url:r}=t,{native:n,universal:i}=t.mobile;ne.handleMobileLinking({links:{native:n,universal:i},name:t.name,id:e,image:r.lg})}else Te.push("DesktopConnector",{DesktopConnector:{name:t.name,icon:t.image_url.lg,universal:t.desktop.universal||t.homepage,native:t.desktop.native}})}onConnectExtension(t){ne.getWalletId("")===t.id?Te.push("InjectedConnector"):Te.push("InstallConnector",{InstallConnector:t})}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}coinbaseConnectorTemplate(){try{const t=qe.client().getConnectorById(ar.coinbaseWallet);return V`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${async()=>ne.handleConnectorConnection(ar.coinbaseWallet)}"></w3m-wallet-button>`}catch{return null}}render(){const{wallets:t,search:e}=at.state,{isStandalone:r}=Q.state;let{listings:n}=this.search?e:t;n=kt.allowedExplorerListings(n);const i=this.loading&&!n.length,s=this.search.length>=3,o=!i&&(!s||ne.caseSafeIncludes(ar.coinbaseWallet,this.search));let a=!r&&!Ue.isMobile()?ne.getExtensionWallets():[],c=ne.getCustomWallets();s&&(a=a.filter(({name:b})=>ne.caseSafeIncludes(b,this.search)),c=c.filter(({name:b})=>ne.caseSafeIncludes(b,this.search)));const l=!this.loading&&!n.length&&!a.length&&!o,p=Math.max(a.length,n.length),w={"w3m-loading":i,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":l};return V`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Mt(w)}"><div class="w3m-grid">${i?null:[...Array(p)].map((b,m)=>V`${c[m]?V`<w3m-wallet-button name="${c[m].name}" walletId="${c[m].id}" .onClick="${()=>this.onConnectCustom(c[m])}"></w3m-wallet-button>`:null} ${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="${()=>this.onConnectListing(n[m])}"></w3m-wallet-button>`:null}`)} ${o?this.coinbaseConnectorTemplate():null}</div><div class="w3m-placeholder-block">${l?V`<w3m-text variant="large-bold" color="secondary">No results found</w3m-text>`:null} ${!l&&this.loading?V`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};en.styles=[he.globalCss,j_],ji([Be()],en.prototype,"loading",2),ji([Be()],en.prototype,"firstFetch",2),ji([Be()],en.prototype,"search",2),ji([Be()],en.prototype,"endReached",2),en=ji([we("w3m-wallet-explorer-view")],en);var z_=Object.freeze({__proto__:null,get W3mAccountButton(){return Ni},get W3mConnectButton(){return Yr},get W3mCoreButton(){return Jr},get W3mModal(){return Xr},get W3mNetworkSwitch(){return Qr}});Jt.EthereumProvider=_y,Jt.OPTIONAL_EVENTS=py,Jt.OPTIONAL_METHODS=fy,Jt.REQUIRED_EVENTS=vs,Jt.REQUIRED_METHODS=ys,Jt.default=_s,Object.defineProperty(Jt,"__esModule",{value:!0})});
131
131
  //# sourceMappingURL=index.umd.js.map