@walletconnect/ethereum-provider 2.7.8 → 2.7.9-7fa58fba
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +29 -29
- package/dist/index.umd.js.map +1 -1
- package/dist/types/EthereumProvider.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(_n,pr){typeof exports=="object"&&typeof module<"u"?pr(exports):typeof define=="function"&&define.amd?define(["exports"],pr):(_n=typeof globalThis<"u"?globalThis:_n||self,pr(_n["@walletconnect/ethereum-provider"]={}))})(this,function(_n){"use strict";var pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Mi(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 br={exports:{}},xs=typeof Reflect=="object"?Reflect:null,ld=xs&&typeof xs.apply=="function"?xs.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Ma;xs&&typeof xs.ownKeys=="function"?Ma=xs.ownKeys:Object.getOwnPropertySymbols?Ma=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ma=function(e){return Object.getOwnPropertyNames(e)};function mw(t){console&&console.warn&&console.warn(t)}var ud=Number.isNaN||function(e){return e!==e};function _t(){_t.init.call(this)}br.exports=_t,br.exports.once=bw,_t.EventEmitter=_t,_t.prototype._events=void 0,_t.prototype._eventsCount=0,_t.prototype._maxListeners=void 0;var hd=10;function Ua(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(_t,"defaultMaxListeners",{enumerable:!0,get:function(){return hd},set:function(t){if(typeof t!="number"||t<0||ud(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");hd=t}}),_t.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},_t.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||ud(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 fd(t){return t._maxListeners===void 0?_t.defaultMaxListeners:t._maxListeners}_t.prototype.getMaxListeners=function(){return fd(this)},_t.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var c;if(r.length>0&&(c=r[0]),c instanceof Error)throw c;var l=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw l.context=c,l}var h=o[e];if(h===void 0)return!1;if(typeof h=="function")ld(h,this,r);else for(var d=h.length,v=wd(h,d),n=0;n<d;++n)ld(v[n],this,r);return!0};function dd(t,e,r,n){var i,o,c;if(Ua(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),c=o[e]),c===void 0)c=o[e]=r,++t._eventsCount;else if(typeof c=="function"?c=o[e]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),i=fd(t),i>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=c.length,mw(l)}return t}_t.prototype.addListener=function(e,r){return dd(this,e,r,!1)},_t.prototype.on=_t.prototype.addListener,_t.prototype.prependListener=function(e,r){return dd(this,e,r,!0)};function ww(){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 pd(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=ww.bind(n);return i.listener=r,n.wrapFn=i,i}_t.prototype.once=function(e,r){return Ua(r),this.on(e,pd(this,e,r)),this},_t.prototype.prependOnceListener=function(e,r){return Ua(r),this.prependListener(e,pd(this,e,r)),this},_t.prototype.removeListener=function(e,r){var n,i,o,c,l;if(Ua(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(o=-1,c=n.length-1;c>=0;c--)if(n[c]===r||n[c].listener===r){l=n[c].listener,o=c;break}if(o<0)return this;o===0?n.shift():vw(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},_t.prototype.off=_t.prototype.removeListener,_t.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 o=Object.keys(n),c;for(i=0;i<o.length;++i)c=o[i],c!=="removeListener"&&this.removeAllListeners(c);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 gd(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?yw(i):wd(i,i.length)}_t.prototype.listeners=function(e){return gd(this,e,!0)},_t.prototype.rawListeners=function(e){return gd(this,e,!1)},_t.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):md.call(t,e)},_t.prototype.listenerCount=md;function md(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}_t.prototype.eventNames=function(){return this._eventsCount>0?Ma(this._events):[]};function wd(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function vw(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function yw(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function bw(t,e){return new Promise(function(r,n){function i(c){t.removeListener(e,o),n(c)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}vd(t,e,o,{once:!0}),e!=="error"&&_w(t,i,{once:!0})})}function _w(t,e,r){typeof t.on=="function"&&vd(t,"error",e,r)}function vd(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(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var Ql={},ja={},et={},yd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,h){var d=l>>>16&65535,v=l&65535,E=h>>>16&65535,_=h&65535;return v*_+(d*_+v*E<<16>>>0)|0}t.mul=Math.imul||e;function r(l,h){return l+h|0}t.add=r;function n(l,h){return l-h|0}t.sub=n;function i(l,h){return l<<h|l>>>32-h}t.rotl=i;function o(l,h){return l<<32-h|l>>>h}t.rotr=o;function c(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}t.isInteger=Number.isInteger||c,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(l){return t.isInteger(l)&&l>=-t.MAX_SAFE_INTEGER&&l<=t.MAX_SAFE_INTEGER}})(yd),Object.defineProperty(et,"__esModule",{value:!0});var bd=yd;function Ew(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}et.readInt16BE=Ew;function xw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}et.readUint16BE=xw;function Cw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}et.readInt16LE=Cw;function Iw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}et.readUint16LE=Iw;function _d(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}et.writeUint16BE=_d,et.writeInt16BE=_d;function Ed(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}et.writeUint16LE=Ed,et.writeInt16LE=Ed;function eu(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}et.readInt32BE=eu;function tu(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}et.readUint32BE=tu;function ru(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}et.readInt32LE=ru;function nu(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}et.readUint32LE=nu;function Fa(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}et.writeUint32BE=Fa,et.writeInt32BE=Fa;function Ba(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}et.writeUint32LE=Ba,et.writeInt32LE=Ba;function Ow(t,e){e===void 0&&(e=0);var r=eu(t,e),n=eu(t,e+4);return r*4294967296+n-(n>>31)*4294967296}et.readInt64BE=Ow;function Aw(t,e){e===void 0&&(e=0);var r=tu(t,e),n=tu(t,e+4);return r*4294967296+n}et.readUint64BE=Aw;function Sw(t,e){e===void 0&&(e=0);var r=ru(t,e),n=ru(t,e+4);return n*4294967296+r-(r>>31)*4294967296}et.readInt64LE=Sw;function Dw(t,e){e===void 0&&(e=0);var r=nu(t,e),n=nu(t,e+4);return n*4294967296+r}et.readUint64LE=Dw;function xd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Fa(t/4294967296>>>0,e,r),Fa(t>>>0,e,r+4),e}et.writeUint64BE=xd,et.writeInt64BE=xd;function Cd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ba(t>>>0,e,r),Ba(t/4294967296>>>0,e,r+4),e}et.writeUint64LE=Cd,et.writeInt64LE=Cd;function $w(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,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}et.readUintBE=$w;function Pw(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,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}et.readUintLE=Pw;function Tw(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(!bd.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}et.writeUintBE=Tw;function Rw(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(!bd.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}et.writeUintLE=Rw;function Nw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}et.readFloat32BE=Nw;function Lw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}et.readFloat32LE=Lw;function Mw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}et.readFloat64BE=Mw;function Uw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}et.readFloat64LE=Uw;function jw(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}et.writeFloat32BE=jw;function Fw(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}et.writeFloat32LE=Fw;function Bw(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}et.writeFloat64BE=Bw;function kw(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}et.writeFloat64LE=kw;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});function Hw(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Yr.wipe=Hw,Object.defineProperty(ja,"__esModule",{value:!0});var Ir=et,iu=Yr,zw=20;function Ww(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,c=1797285236,l=r[3]<<24|r[2]<<16|r[1]<<8|r[0],h=r[7]<<24|r[6]<<16|r[5]<<8|r[4],d=r[11]<<24|r[10]<<16|r[9]<<8|r[8],v=r[15]<<24|r[14]<<16|r[13]<<8|r[12],E=r[19]<<24|r[18]<<16|r[17]<<8|r[16],_=r[23]<<24|r[22]<<16|r[21]<<8|r[20],A=r[27]<<24|r[26]<<16|r[25]<<8|r[24],P=r[31]<<24|r[30]<<16|r[29]<<8|r[28],U=e[3]<<24|e[2]<<16|e[1]<<8|e[0],H=e[7]<<24|e[6]<<16|e[5]<<8|e[4],G=e[11]<<24|e[10]<<16|e[9]<<8|e[8],N=e[15]<<24|e[14]<<16|e[13]<<8|e[12],L=n,$=i,T=o,I=c,f=l,x=h,J=d,z=v,ee=E,de=_,me=A,O=P,j=U,ce=H,le=G,re=N,ne=0;ne<zw;ne+=2)L=L+f|0,j^=L,j=j>>>32-16|j<<16,ee=ee+j|0,f^=ee,f=f>>>32-12|f<<12,$=$+x|0,ce^=$,ce=ce>>>32-16|ce<<16,de=de+ce|0,x^=de,x=x>>>32-12|x<<12,T=T+J|0,le^=T,le=le>>>32-16|le<<16,me=me+le|0,J^=me,J=J>>>32-12|J<<12,I=I+z|0,re^=I,re=re>>>32-16|re<<16,O=O+re|0,z^=O,z=z>>>32-12|z<<12,T=T+J|0,le^=T,le=le>>>32-8|le<<8,me=me+le|0,J^=me,J=J>>>32-7|J<<7,I=I+z|0,re^=I,re=re>>>32-8|re<<8,O=O+re|0,z^=O,z=z>>>32-7|z<<7,$=$+x|0,ce^=$,ce=ce>>>32-8|ce<<8,de=de+ce|0,x^=de,x=x>>>32-7|x<<7,L=L+f|0,j^=L,j=j>>>32-8|j<<8,ee=ee+j|0,f^=ee,f=f>>>32-7|f<<7,L=L+x|0,re^=L,re=re>>>32-16|re<<16,me=me+re|0,x^=me,x=x>>>32-12|x<<12,$=$+J|0,j^=$,j=j>>>32-16|j<<16,O=O+j|0,J^=O,J=J>>>32-12|J<<12,T=T+z|0,ce^=T,ce=ce>>>32-16|ce<<16,ee=ee+ce|0,z^=ee,z=z>>>32-12|z<<12,I=I+f|0,le^=I,le=le>>>32-16|le<<16,de=de+le|0,f^=de,f=f>>>32-12|f<<12,T=T+z|0,ce^=T,ce=ce>>>32-8|ce<<8,ee=ee+ce|0,z^=ee,z=z>>>32-7|z<<7,I=I+f|0,le^=I,le=le>>>32-8|le<<8,de=de+le|0,f^=de,f=f>>>32-7|f<<7,$=$+J|0,j^=$,j=j>>>32-8|j<<8,O=O+j|0,J^=O,J=J>>>32-7|J<<7,L=L+x|0,re^=L,re=re>>>32-8|re<<8,me=me+re|0,x^=me,x=x>>>32-7|x<<7;Ir.writeUint32LE(L+n|0,t,0),Ir.writeUint32LE($+i|0,t,4),Ir.writeUint32LE(T+o|0,t,8),Ir.writeUint32LE(I+c|0,t,12),Ir.writeUint32LE(f+l|0,t,16),Ir.writeUint32LE(x+h|0,t,20),Ir.writeUint32LE(J+d|0,t,24),Ir.writeUint32LE(z+v|0,t,28),Ir.writeUint32LE(ee+E|0,t,32),Ir.writeUint32LE(de+_|0,t,36),Ir.writeUint32LE(me+A|0,t,40),Ir.writeUint32LE(O+P|0,t,44),Ir.writeUint32LE(j+U|0,t,48),Ir.writeUint32LE(ce+H|0,t,52),Ir.writeUint32LE(le+G|0,t,56),Ir.writeUint32LE(re+N|0,t,60)}function Id(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 o,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),c=o.length-e.length,o.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,c=i}for(var l=new Uint8Array(64),h=0;h<r.length;h+=64){Ww(l,o,t);for(var d=h;d<h+64&&d<r.length;d++)n[d]=r[d]^l[d-h];Vw(o,0,c)}return iu.wipe(l),i===0&&iu.wipe(o),n}ja.streamXOR=Id;function qw(t,e,r,n){return n===void 0&&(n=0),iu.wipe(r),Id(t,e,r,r,n)}ja.stream=qw;function Vw(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 Od={},li={};Object.defineProperty(li,"__esModule",{value:!0});function Kw(t,e,r){return~(t-1)&e|t-1&r}li.select=Kw;function Gw(t,e){return(t|0)-(e|0)-1>>>31&1}li.lessOrEqual=Gw;function Ad(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}li.compare=Ad;function Zw(t,e){return t.length===0||e.length===0?!1:Ad(t,e)!==0}li.equal=Zw,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=li,r=Yr;t.DIGEST_LENGTH=16;var n=function(){function c(l){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 h=l[0]|l[1]<<8;this._r[0]=h&8191;var d=l[2]|l[3]<<8;this._r[1]=(h>>>13|d<<3)&8191;var v=l[4]|l[5]<<8;this._r[2]=(d>>>10|v<<6)&7939;var E=l[6]|l[7]<<8;this._r[3]=(v>>>7|E<<9)&8191;var _=l[8]|l[9]<<8;this._r[4]=(E>>>4|_<<12)&255,this._r[5]=_>>>1&8190;var A=l[10]|l[11]<<8;this._r[6]=(_>>>14|A<<2)&8191;var P=l[12]|l[13]<<8;this._r[7]=(A>>>11|P<<5)&8065;var U=l[14]|l[15]<<8;this._r[8]=(P>>>8|U<<8)&8191,this._r[9]=U>>>5&127,this._pad[0]=l[16]|l[17]<<8,this._pad[1]=l[18]|l[19]<<8,this._pad[2]=l[20]|l[21]<<8,this._pad[3]=l[22]|l[23]<<8,this._pad[4]=l[24]|l[25]<<8,this._pad[5]=l[26]|l[27]<<8,this._pad[6]=l[28]|l[29]<<8,this._pad[7]=l[30]|l[31]<<8}return c.prototype._blocks=function(l,h,d){for(var v=this._fin?0:2048,E=this._h[0],_=this._h[1],A=this._h[2],P=this._h[3],U=this._h[4],H=this._h[5],G=this._h[6],N=this._h[7],L=this._h[8],$=this._h[9],T=this._r[0],I=this._r[1],f=this._r[2],x=this._r[3],J=this._r[4],z=this._r[5],ee=this._r[6],de=this._r[7],me=this._r[8],O=this._r[9];d>=16;){var j=l[h+0]|l[h+1]<<8;E+=j&8191;var ce=l[h+2]|l[h+3]<<8;_+=(j>>>13|ce<<3)&8191;var le=l[h+4]|l[h+5]<<8;A+=(ce>>>10|le<<6)&8191;var re=l[h+6]|l[h+7]<<8;P+=(le>>>7|re<<9)&8191;var ne=l[h+8]|l[h+9]<<8;U+=(re>>>4|ne<<12)&8191,H+=ne>>>1&8191;var ae=l[h+10]|l[h+11]<<8;G+=(ne>>>14|ae<<2)&8191;var ie=l[h+12]|l[h+13]<<8;N+=(ae>>>11|ie<<5)&8191;var Se=l[h+14]|l[h+15]<<8;L+=(ie>>>8|Se<<8)&8191,$+=Se>>>5|v;var ge=0,Fe=ge;Fe+=E*T,Fe+=_*(5*O),Fe+=A*(5*me),Fe+=P*(5*de),Fe+=U*(5*ee),ge=Fe>>>13,Fe&=8191,Fe+=H*(5*z),Fe+=G*(5*J),Fe+=N*(5*x),Fe+=L*(5*f),Fe+=$*(5*I),ge+=Fe>>>13,Fe&=8191;var ye=ge;ye+=E*I,ye+=_*T,ye+=A*(5*O),ye+=P*(5*me),ye+=U*(5*de),ge=ye>>>13,ye&=8191,ye+=H*(5*ee),ye+=G*(5*z),ye+=N*(5*J),ye+=L*(5*x),ye+=$*(5*f),ge+=ye>>>13,ye&=8191;var Le=ge;Le+=E*f,Le+=_*I,Le+=A*T,Le+=P*(5*O),Le+=U*(5*me),ge=Le>>>13,Le&=8191,Le+=H*(5*de),Le+=G*(5*ee),Le+=N*(5*z),Le+=L*(5*J),Le+=$*(5*x),ge+=Le>>>13,Le&=8191;var X=ge;X+=E*x,X+=_*f,X+=A*I,X+=P*T,X+=U*(5*O),ge=X>>>13,X&=8191,X+=H*(5*me),X+=G*(5*de),X+=N*(5*ee),X+=L*(5*z),X+=$*(5*J),ge+=X>>>13,X&=8191;var Y=ge;Y+=E*J,Y+=_*x,Y+=A*f,Y+=P*I,Y+=U*T,ge=Y>>>13,Y&=8191,Y+=H*(5*O),Y+=G*(5*me),Y+=N*(5*de),Y+=L*(5*ee),Y+=$*(5*z),ge+=Y>>>13,Y&=8191;var W=ge;W+=E*z,W+=_*J,W+=A*x,W+=P*f,W+=U*I,ge=W>>>13,W&=8191,W+=H*T,W+=G*(5*O),W+=N*(5*me),W+=L*(5*de),W+=$*(5*ee),ge+=W>>>13,W&=8191;var w=ge;w+=E*ee,w+=_*z,w+=A*J,w+=P*x,w+=U*f,ge=w>>>13,w&=8191,w+=H*I,w+=G*T,w+=N*(5*O),w+=L*(5*me),w+=$*(5*de),ge+=w>>>13,w&=8191;var F=ge;F+=E*de,F+=_*ee,F+=A*z,F+=P*J,F+=U*x,ge=F>>>13,F&=8191,F+=H*f,F+=G*I,F+=N*T,F+=L*(5*O),F+=$*(5*me),ge+=F>>>13,F&=8191;var we=ge;we+=E*me,we+=_*de,we+=A*ee,we+=P*z,we+=U*J,ge=we>>>13,we&=8191,we+=H*x,we+=G*f,we+=N*I,we+=L*T,we+=$*(5*O),ge+=we>>>13,we&=8191;var ve=ge;ve+=E*O,ve+=_*me,ve+=A*de,ve+=P*ee,ve+=U*z,ge=ve>>>13,ve&=8191,ve+=H*J,ve+=G*x,ve+=N*f,ve+=L*I,ve+=$*T,ge+=ve>>>13,ve&=8191,ge=(ge<<2)+ge|0,ge=ge+Fe|0,Fe=ge&8191,ge=ge>>>13,ye+=ge,E=Fe,_=ye,A=Le,P=X,U=Y,H=W,G=w,N=F,L=we,$=ve,h+=16,d-=16}this._h[0]=E,this._h[1]=_,this._h[2]=A,this._h[3]=P,this._h[4]=U,this._h[5]=H,this._h[6]=G,this._h[7]=N,this._h[8]=L,this._h[9]=$},c.prototype.finish=function(l,h){h===void 0&&(h=0);var d=new Uint16Array(10),v,E,_,A;if(this._leftover){for(A=this._leftover,this._buffer[A++]=1;A<16;A++)this._buffer[A]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(v=this._h[1]>>>13,this._h[1]&=8191,A=2;A<10;A++)this._h[A]+=v,v=this._h[A]>>>13,this._h[A]&=8191;for(this._h[0]+=v*5,v=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=v,v=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=v,d[0]=this._h[0]+5,v=d[0]>>>13,d[0]&=8191,A=1;A<10;A++)d[A]=this._h[A]+v,v=d[A]>>>13,d[A]&=8191;for(d[9]-=1<<13,E=(v^1)-1,A=0;A<10;A++)d[A]&=E;for(E=~E,A=0;A<10;A++)this._h[A]=this._h[A]&E|d[A];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,_=this._h[0]+this._pad[0],this._h[0]=_&65535,A=1;A<8;A++)_=(this._h[A]+this._pad[A]|0)+(_>>>16)|0,this._h[A]=_&65535;return l[h+0]=this._h[0]>>>0,l[h+1]=this._h[0]>>>8,l[h+2]=this._h[1]>>>0,l[h+3]=this._h[1]>>>8,l[h+4]=this._h[2]>>>0,l[h+5]=this._h[2]>>>8,l[h+6]=this._h[3]>>>0,l[h+7]=this._h[3]>>>8,l[h+8]=this._h[4]>>>0,l[h+9]=this._h[4]>>>8,l[h+10]=this._h[5]>>>0,l[h+11]=this._h[5]>>>8,l[h+12]=this._h[6]>>>0,l[h+13]=this._h[6]>>>8,l[h+14]=this._h[7]>>>0,l[h+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(l){var h=0,d=l.length,v;if(this._leftover){v=16-this._leftover,v>d&&(v=d);for(var E=0;E<v;E++)this._buffer[this._leftover+E]=l[h+E];if(d-=v,h+=v,this._leftover+=v,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(d>=16&&(v=d-d%16,this._blocks(l,h,v),h+=v,d-=v),d){for(var E=0;E<d;E++)this._buffer[this._leftover+E]=l[h+E];this._leftover+=d}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var l=new Uint8Array(16);return this.finish(l),l},c.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},c}();t.Poly1305=n;function i(c,l){var h=new n(c);h.update(l);var d=h.digest();return h.clean(),d}t.oneTimeAuth=i;function o(c,l){return c.length!==t.DIGEST_LENGTH||l.length!==t.DIGEST_LENGTH?!1:e.equal(c,l)}t.equal=o}(Od),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ja,r=Od,n=Yr,i=et,o=li;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function h(d){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,d.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(d)}return h.prototype.seal=function(d,v,E,_){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var A=new Uint8Array(16);A.set(d,A.length-d.length);var P=new Uint8Array(32);e.stream(this._key,A,P,4);var U=v.length+this.tagLength,H;if(_){if(_.length!==U)throw new Error("ChaCha20Poly1305: incorrect destination length");H=_}else H=new Uint8Array(U);return e.streamXOR(this._key,A,v,H,4),this._authenticate(H.subarray(H.length-this.tagLength,H.length),P,H.subarray(0,H.length-this.tagLength),E),n.wipe(A),H},h.prototype.open=function(d,v,E,_){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(v.length<this.tagLength)return null;var A=new Uint8Array(16);A.set(d,A.length-d.length);var P=new Uint8Array(32);e.stream(this._key,A,P,4);var U=new Uint8Array(this.tagLength);if(this._authenticate(U,P,v.subarray(0,v.length-this.tagLength),E),!o.equal(U,v.subarray(v.length-this.tagLength,v.length)))return null;var H=v.length-this.tagLength,G;if(_){if(_.length!==H)throw new Error("ChaCha20Poly1305: incorrect destination length");G=_}else G=new Uint8Array(H);return e.streamXOR(this._key,A,v.subarray(0,v.length-this.tagLength),G,4),n.wipe(A),G},h.prototype.clean=function(){return n.wipe(this._key),this},h.prototype._authenticate=function(d,v,E,_){var A=new r.Poly1305(v);_&&(A.update(_),_.length%16>0&&A.update(c.subarray(_.length%16))),A.update(E),E.length%16>0&&A.update(c.subarray(E.length%16));var P=new Uint8Array(8);_&&i.writeUint64LE(_.length,P),A.update(P),i.writeUint64LE(E.length,P),A.update(P);for(var U=A.digest(),H=0;H<U.length;H++)d[H]=U[H];A.clean(),n.wipe(U),n.wipe(P)},h}();t.ChaCha20Poly1305=l}(Ql);var Sd={},bo={},su={};Object.defineProperty(su,"__esModule",{value:!0});function Yw(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}su.isSerializableHash=Yw,Object.defineProperty(bo,"__esModule",{value:!0});var Dn=su,Jw=li,Xw=Yr,Dd=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),Dn.isSerializableHash(this._inner)&&Dn.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Xw.wipe(n)}return t.prototype.reset=function(){if(!Dn.isSerializableHash(this._inner)||!Dn.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(){Dn.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Dn.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(!Dn.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(!Dn.isSerializableHash(this._inner)||!Dn.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(!Dn.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();bo.HMAC=Dd;function Qw(t,e,r){var n=new Dd(t,e);n.update(r);var i=n.digest();return n.clean(),i}bo.hmac=Qw,bo.equal=Jw.equal,Object.defineProperty(Sd,"__esModule",{value:!0});var $d=bo,Pd=Yr,ev=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 o=$d.hmac(this._hash,n,r);this._hmac=new $d.HMAC(e,o),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(),Pd.wipe(this._buffer),Pd.wipe(this._counter),this._bufpos=0},t}(),tv=Sd.HKDF=ev,Cs={},ka={},Ha={};Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.BrowserRandomSource=void 0;const Td=65536;class rv{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+=Td)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Td)));return r}}Ha.BrowserRandomSource=rv;function nv(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 za={},iv={},sv=Object.freeze({__proto__:null,default:iv}),ov=Mi(sv);Object.defineProperty(za,"__esModule",{value:!0}),za.NodeRandomSource=void 0;const av=Yr;class cv{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof nv<"u"){const e=ov;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,av.wipe)(r),n}}za.NodeRandomSource=cv,Object.defineProperty(ka,"__esModule",{value:!0}),ka.SystemRandomSource=void 0;const lv=Ha,uv=za;class hv{constructor(){if(this.isAvailable=!1,this.name="",this._source=new lv.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new uv.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)}}ka.SystemRandomSource=hv,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=ka,r=et,n=Yr;t.defaultRandomSource=new e.SystemRandomSource;function i(d,v=t.defaultRandomSource){return v.randomBytes(d)}t.randomBytes=i;function o(d=t.defaultRandomSource){const v=i(4,d),E=(0,r.readUint32LE)(v);return(0,n.wipe)(v),E}t.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(d,v=c,E=t.defaultRandomSource){if(v.length<2)throw new Error("randomString charset is too short");if(v.length>256)throw new Error("randomString charset is too long");let _="";const A=v.length,P=256-256%A;for(;d>0;){const U=i(Math.ceil(d*256/P),E);for(let H=0;H<U.length&&d>0;H++){const G=U[H];G<P&&(_+=v.charAt(G%A),d--)}(0,n.wipe)(U)}return _}t.randomString=l;function h(d,v=c,E=t.defaultRandomSource){const _=Math.ceil(d/(Math.log(v.length)/Math.LN2));return l(_,v,E)}t.randomStringForEntropy=h}(Cs);var Wa={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Yr;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function l(){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 l.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},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},l.prototype.update=function(h,d){if(d===void 0&&(d=h.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var v=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&d>0;)this._buffer[this._bufferLength++]=h[v++],d--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(v=o(this._temp,this._state,h,v,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=h[v++],d--;return this},l.prototype.finish=function(h){if(!this._finished){var d=this._bytesHashed,v=this._bufferLength,E=d/536870912|0,_=d<<3,A=d%64<56?64:128;this._buffer[v]=128;for(var P=v+1;P<A-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,A-8),e.writeUint32BE(_,this._buffer,A-4),o(this._temp,this._state,this._buffer,0,A),this._finished=!0}for(var P=0;P<this.digestLength/4;P++)e.writeUint32BE(this._state[P],h,P*4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.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}},l.prototype.restoreState=function(h){return this._state.set(h.state),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.state),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();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 o(l,h,d,v,E){for(;E>=64;){for(var _=h[0],A=h[1],P=h[2],U=h[3],H=h[4],G=h[5],N=h[6],L=h[7],$=0;$<16;$++){var T=v+$*4;l[$]=e.readUint32BE(d,T)}for(var $=16;$<64;$++){var I=l[$-2],f=(I>>>17|I<<32-17)^(I>>>19|I<<32-19)^I>>>10;I=l[$-15];var x=(I>>>7|I<<32-7)^(I>>>18|I<<32-18)^I>>>3;l[$]=(f+l[$-7]|0)+(x+l[$-16]|0)}for(var $=0;$<64;$++){var f=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&G^~H&N)|0)+(L+(i[$]+l[$]|0)|0)|0,x=((_>>>2|_<<32-2)^(_>>>13|_<<32-13)^(_>>>22|_<<32-22))+(_&A^_&P^A&P)|0;L=N,N=G,G=H,H=U+f|0,U=P,P=A,A=_,_=f+x|0}h[0]+=_,h[1]+=A,h[2]+=P,h[3]+=U,h[4]+=H,h[5]+=G,h[6]+=N,h[7]+=L,v+=64,E-=64}return v}function c(l){var h=new n;h.update(l);var d=h.digest();return h.clean(),d}t.hash=c})(Wa);var ou={};(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=Cs,r=Yr;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n($){const T=new Float64Array(16);if($)for(let I=0;I<$.length;I++)T[I]=$[I];return T}const i=new Uint8Array(32);i[0]=9;const o=n([56129,1]);function c($){let T=1;for(let I=0;I<16;I++){let f=$[I]+T+65535;T=Math.floor(f/65536),$[I]=f-T*65536}$[0]+=T-1+37*(T-1)}function l($,T,I){const f=~(I-1);for(let x=0;x<16;x++){const J=f&($[x]^T[x]);$[x]^=J,T[x]^=J}}function h($,T){const I=n(),f=n();for(let x=0;x<16;x++)f[x]=T[x];c(f),c(f),c(f);for(let x=0;x<2;x++){I[0]=f[0]-65517;for(let z=1;z<15;z++)I[z]=f[z]-65535-(I[z-1]>>16&1),I[z-1]&=65535;I[15]=f[15]-32767-(I[14]>>16&1);const J=I[15]>>16&1;I[14]&=65535,l(f,I,1-J)}for(let x=0;x<16;x++)$[2*x]=f[x]&255,$[2*x+1]=f[x]>>8}function d($,T){for(let I=0;I<16;I++)$[I]=T[2*I]+(T[2*I+1]<<8);$[15]&=32767}function v($,T,I){for(let f=0;f<16;f++)$[f]=T[f]+I[f]}function E($,T,I){for(let f=0;f<16;f++)$[f]=T[f]-I[f]}function _($,T,I){let f,x,J=0,z=0,ee=0,de=0,me=0,O=0,j=0,ce=0,le=0,re=0,ne=0,ae=0,ie=0,Se=0,ge=0,Fe=0,ye=0,Le=0,X=0,Y=0,W=0,w=0,F=0,we=0,ve=0,Me=0,nt=0,at=0,Ge=0,Dt=0,$t=0,Je=I[0],He=I[1],Be=I[2],Ke=I[3],rt=I[4],Ue=I[5],Ze=I[6],b=I[7],p=I[8],m=I[9],D=I[10],B=I[11],K=I[12],Q=I[13],Ee=I[14],Te=I[15];f=T[0],J+=f*Je,z+=f*He,ee+=f*Be,de+=f*Ke,me+=f*rt,O+=f*Ue,j+=f*Ze,ce+=f*b,le+=f*p,re+=f*m,ne+=f*D,ae+=f*B,ie+=f*K,Se+=f*Q,ge+=f*Ee,Fe+=f*Te,f=T[1],z+=f*Je,ee+=f*He,de+=f*Be,me+=f*Ke,O+=f*rt,j+=f*Ue,ce+=f*Ze,le+=f*b,re+=f*p,ne+=f*m,ae+=f*D,ie+=f*B,Se+=f*K,ge+=f*Q,Fe+=f*Ee,ye+=f*Te,f=T[2],ee+=f*Je,de+=f*He,me+=f*Be,O+=f*Ke,j+=f*rt,ce+=f*Ue,le+=f*Ze,re+=f*b,ne+=f*p,ae+=f*m,ie+=f*D,Se+=f*B,ge+=f*K,Fe+=f*Q,ye+=f*Ee,Le+=f*Te,f=T[3],de+=f*Je,me+=f*He,O+=f*Be,j+=f*Ke,ce+=f*rt,le+=f*Ue,re+=f*Ze,ne+=f*b,ae+=f*p,ie+=f*m,Se+=f*D,ge+=f*B,Fe+=f*K,ye+=f*Q,Le+=f*Ee,X+=f*Te,f=T[4],me+=f*Je,O+=f*He,j+=f*Be,ce+=f*Ke,le+=f*rt,re+=f*Ue,ne+=f*Ze,ae+=f*b,ie+=f*p,Se+=f*m,ge+=f*D,Fe+=f*B,ye+=f*K,Le+=f*Q,X+=f*Ee,Y+=f*Te,f=T[5],O+=f*Je,j+=f*He,ce+=f*Be,le+=f*Ke,re+=f*rt,ne+=f*Ue,ae+=f*Ze,ie+=f*b,Se+=f*p,ge+=f*m,Fe+=f*D,ye+=f*B,Le+=f*K,X+=f*Q,Y+=f*Ee,W+=f*Te,f=T[6],j+=f*Je,ce+=f*He,le+=f*Be,re+=f*Ke,ne+=f*rt,ae+=f*Ue,ie+=f*Ze,Se+=f*b,ge+=f*p,Fe+=f*m,ye+=f*D,Le+=f*B,X+=f*K,Y+=f*Q,W+=f*Ee,w+=f*Te,f=T[7],ce+=f*Je,le+=f*He,re+=f*Be,ne+=f*Ke,ae+=f*rt,ie+=f*Ue,Se+=f*Ze,ge+=f*b,Fe+=f*p,ye+=f*m,Le+=f*D,X+=f*B,Y+=f*K,W+=f*Q,w+=f*Ee,F+=f*Te,f=T[8],le+=f*Je,re+=f*He,ne+=f*Be,ae+=f*Ke,ie+=f*rt,Se+=f*Ue,ge+=f*Ze,Fe+=f*b,ye+=f*p,Le+=f*m,X+=f*D,Y+=f*B,W+=f*K,w+=f*Q,F+=f*Ee,we+=f*Te,f=T[9],re+=f*Je,ne+=f*He,ae+=f*Be,ie+=f*Ke,Se+=f*rt,ge+=f*Ue,Fe+=f*Ze,ye+=f*b,Le+=f*p,X+=f*m,Y+=f*D,W+=f*B,w+=f*K,F+=f*Q,we+=f*Ee,ve+=f*Te,f=T[10],ne+=f*Je,ae+=f*He,ie+=f*Be,Se+=f*Ke,ge+=f*rt,Fe+=f*Ue,ye+=f*Ze,Le+=f*b,X+=f*p,Y+=f*m,W+=f*D,w+=f*B,F+=f*K,we+=f*Q,ve+=f*Ee,Me+=f*Te,f=T[11],ae+=f*Je,ie+=f*He,Se+=f*Be,ge+=f*Ke,Fe+=f*rt,ye+=f*Ue,Le+=f*Ze,X+=f*b,Y+=f*p,W+=f*m,w+=f*D,F+=f*B,we+=f*K,ve+=f*Q,Me+=f*Ee,nt+=f*Te,f=T[12],ie+=f*Je,Se+=f*He,ge+=f*Be,Fe+=f*Ke,ye+=f*rt,Le+=f*Ue,X+=f*Ze,Y+=f*b,W+=f*p,w+=f*m,F+=f*D,we+=f*B,ve+=f*K,Me+=f*Q,nt+=f*Ee,at+=f*Te,f=T[13],Se+=f*Je,ge+=f*He,Fe+=f*Be,ye+=f*Ke,Le+=f*rt,X+=f*Ue,Y+=f*Ze,W+=f*b,w+=f*p,F+=f*m,we+=f*D,ve+=f*B,Me+=f*K,nt+=f*Q,at+=f*Ee,Ge+=f*Te,f=T[14],ge+=f*Je,Fe+=f*He,ye+=f*Be,Le+=f*Ke,X+=f*rt,Y+=f*Ue,W+=f*Ze,w+=f*b,F+=f*p,we+=f*m,ve+=f*D,Me+=f*B,nt+=f*K,at+=f*Q,Ge+=f*Ee,Dt+=f*Te,f=T[15],Fe+=f*Je,ye+=f*He,Le+=f*Be,X+=f*Ke,Y+=f*rt,W+=f*Ue,w+=f*Ze,F+=f*b,we+=f*p,ve+=f*m,Me+=f*D,nt+=f*B,at+=f*K,Ge+=f*Q,Dt+=f*Ee,$t+=f*Te,J+=38*ye,z+=38*Le,ee+=38*X,de+=38*Y,me+=38*W,O+=38*w,j+=38*F,ce+=38*we,le+=38*ve,re+=38*Me,ne+=38*nt,ae+=38*at,ie+=38*Ge,Se+=38*Dt,ge+=38*$t,x=1,f=J+x+65535,x=Math.floor(f/65536),J=f-x*65536,f=z+x+65535,x=Math.floor(f/65536),z=f-x*65536,f=ee+x+65535,x=Math.floor(f/65536),ee=f-x*65536,f=de+x+65535,x=Math.floor(f/65536),de=f-x*65536,f=me+x+65535,x=Math.floor(f/65536),me=f-x*65536,f=O+x+65535,x=Math.floor(f/65536),O=f-x*65536,f=j+x+65535,x=Math.floor(f/65536),j=f-x*65536,f=ce+x+65535,x=Math.floor(f/65536),ce=f-x*65536,f=le+x+65535,x=Math.floor(f/65536),le=f-x*65536,f=re+x+65535,x=Math.floor(f/65536),re=f-x*65536,f=ne+x+65535,x=Math.floor(f/65536),ne=f-x*65536,f=ae+x+65535,x=Math.floor(f/65536),ae=f-x*65536,f=ie+x+65535,x=Math.floor(f/65536),ie=f-x*65536,f=Se+x+65535,x=Math.floor(f/65536),Se=f-x*65536,f=ge+x+65535,x=Math.floor(f/65536),ge=f-x*65536,f=Fe+x+65535,x=Math.floor(f/65536),Fe=f-x*65536,J+=x-1+37*(x-1),x=1,f=J+x+65535,x=Math.floor(f/65536),J=f-x*65536,f=z+x+65535,x=Math.floor(f/65536),z=f-x*65536,f=ee+x+65535,x=Math.floor(f/65536),ee=f-x*65536,f=de+x+65535,x=Math.floor(f/65536),de=f-x*65536,f=me+x+65535,x=Math.floor(f/65536),me=f-x*65536,f=O+x+65535,x=Math.floor(f/65536),O=f-x*65536,f=j+x+65535,x=Math.floor(f/65536),j=f-x*65536,f=ce+x+65535,x=Math.floor(f/65536),ce=f-x*65536,f=le+x+65535,x=Math.floor(f/65536),le=f-x*65536,f=re+x+65535,x=Math.floor(f/65536),re=f-x*65536,f=ne+x+65535,x=Math.floor(f/65536),ne=f-x*65536,f=ae+x+65535,x=Math.floor(f/65536),ae=f-x*65536,f=ie+x+65535,x=Math.floor(f/65536),ie=f-x*65536,f=Se+x+65535,x=Math.floor(f/65536),Se=f-x*65536,f=ge+x+65535,x=Math.floor(f/65536),ge=f-x*65536,f=Fe+x+65535,x=Math.floor(f/65536),Fe=f-x*65536,J+=x-1+37*(x-1),$[0]=J,$[1]=z,$[2]=ee,$[3]=de,$[4]=me,$[5]=O,$[6]=j,$[7]=ce,$[8]=le,$[9]=re,$[10]=ne,$[11]=ae,$[12]=ie,$[13]=Se,$[14]=ge,$[15]=Fe}function A($,T){_($,T,T)}function P($,T){const I=n();for(let f=0;f<16;f++)I[f]=T[f];for(let f=253;f>=0;f--)A(I,I),f!==2&&f!==4&&_(I,I,T);for(let f=0;f<16;f++)$[f]=I[f]}function U($,T){const I=new Uint8Array(32),f=new Float64Array(80),x=n(),J=n(),z=n(),ee=n(),de=n(),me=n();for(let le=0;le<31;le++)I[le]=$[le];I[31]=$[31]&127|64,I[0]&=248,d(f,T);for(let le=0;le<16;le++)J[le]=f[le];x[0]=ee[0]=1;for(let le=254;le>=0;--le){const re=I[le>>>3]>>>(le&7)&1;l(x,J,re),l(z,ee,re),v(de,x,z),E(x,x,z),v(z,J,ee),E(J,J,ee),A(ee,de),A(me,x),_(x,z,x),_(z,J,de),v(de,x,z),E(x,x,z),A(J,x),E(z,ee,me),_(x,z,o),v(x,x,ee),_(z,z,x),_(x,ee,me),_(ee,J,f),A(J,de),l(x,J,re),l(z,ee,re)}for(let le=0;le<16;le++)f[le+16]=x[le],f[le+32]=z[le],f[le+48]=J[le],f[le+64]=ee[le];const O=f.subarray(32),j=f.subarray(16);P(O,O),_(j,j,O);const ce=new Uint8Array(32);return h(ce,j),ce}t.scalarMult=U;function H($){return U($,i)}t.scalarMultBase=H;function G($){if($.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const T=new Uint8Array($);return{publicKey:H(T),secretKey:T}}t.generateKeyPairFromSeed=G;function N($){const T=(0,e.randomBytes)(32,$),I=G(T);return(0,r.wipe)(T),I}t.generateKeyPair=N;function L($,T,I=!1){if($.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(T.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const f=U($,T);if(I){let x=0;for(let J=0;J<f.length;J++)x|=f[J];if(x===0)throw new Error("X25519: invalid shared key")}return f}t.sharedKey=L})(ou);function au(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Rd(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?au(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function cu(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=Rd(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return au(r)}function fv(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 o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),d=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function E(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var U=0,H=0,G=0,N=P.length;G!==N&&P[G]===0;)G++,U++;for(var L=(N-G)*v+1>>>0,$=new Uint8Array(L);G!==N;){for(var T=P[G],I=0,f=L-1;(T!==0||I<H)&&f!==-1;f--,I++)T+=256*$[f]>>>0,$[f]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,G++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(U);x<L;++x)J+=t.charAt($[x]);return J}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var U=0;if(P[U]!==" "){for(var H=0,G=0;P[U]===h;)H++,U++;for(var N=(P.length-U)*d+1>>>0,L=new Uint8Array(N);P[U];){var $=r[P.charCodeAt(U)];if($===255)return;for(var T=0,I=N-1;($!==0||T<G)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");G=T,U++}if(P[U]!==" "){for(var f=N-G;f!==N&&L[f]===0;)f++;for(var x=new Uint8Array(H+(N-f)),J=H;f!==N;)x[J++]=L[f++];return x}}}function A(P){var U=_(P);if(U)return U;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:A}}var dv=fv,pv=dv;const Nd=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")},gv=t=>new TextEncoder().encode(t),mv=t=>new TextDecoder().decode(t);class wv{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 vv{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 Ld(this,e)}}class yv{constructor(e){this.decoders=e}or(e){return Ld(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 Ld=(t,e)=>new yv({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class bv{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new wv(e,r,n),this.decoder=new vv(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const qa=({name:t,prefix:e,encode:r,decode:n})=>new bv(t,e,r,n),_o=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=pv(r,e);return qa({prefix:t,name:e,encode:n,decode:o=>Nd(i(o))})},_v=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,d=0;for(let v=0;v<o;++v){const E=i[t[v]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|E,l+=r,l>=8&&(l-=8,c[d++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},Ev=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},_r=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>qa({prefix:e,name:t,encode(i){return Ev(i,n,r)},decode(i){return _v(i,n,r,t)}}),xv=qa({prefix:"\0",name:"identity",encode:t=>mv(t),decode:t=>gv(t)});var Cv=Object.freeze({__proto__:null,identity:xv});const Iv=_r({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ov=Object.freeze({__proto__:null,base2:Iv});const Av=_r({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Sv=Object.freeze({__proto__:null,base8:Av});const Dv=_o({prefix:"9",name:"base10",alphabet:"0123456789"});var $v=Object.freeze({__proto__:null,base10:Dv});const Pv=_r({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Tv=_r({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Rv=Object.freeze({__proto__:null,base16:Pv,base16upper:Tv});const Nv=_r({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Lv=_r({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Mv=_r({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Uv=_r({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),jv=_r({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Fv=_r({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Bv=_r({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),kv=_r({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Hv=_r({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var zv=Object.freeze({__proto__:null,base32:Nv,base32upper:Lv,base32pad:Mv,base32padupper:Uv,base32hex:jv,base32hexupper:Fv,base32hexpad:Bv,base32hexpadupper:kv,base32z:Hv});const Wv=_o({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),qv=_o({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Vv=Object.freeze({__proto__:null,base36:Wv,base36upper:qv});const Kv=_o({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Gv=_o({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Zv=Object.freeze({__proto__:null,base58btc:Kv,base58flickr:Gv});const Yv=_r({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Jv=_r({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Xv=_r({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Qv=_r({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ey=Object.freeze({__proto__:null,base64:Yv,base64pad:Jv,base64url:Xv,base64urlpad:Qv});const Md=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}"),ty=Md.reduce((t,e,r)=>(t[r]=e,t),[]),ry=Md.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function ny(t){return t.reduce((e,r)=>(e+=ty[r],e),"")}function iy(t){const e=[];for(const r of t){const n=ry[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const sy=qa({prefix:"\u{1F680}",name:"base256emoji",encode:ny,decode:iy});var oy=Object.freeze({__proto__:null,base256emoji:sy}),ay=jd,Ud=128,cy=127,ly=~cy,uy=Math.pow(2,31);function jd(t,e,r){e=e||[],r=r||0;for(var n=r;t>=uy;)e[r++]=t&255|Ud,t/=128;for(;t&ly;)e[r++]=t&255|Ud,t>>>=7;return e[r]=t|0,jd.bytes=r-n+1,e}var hy=lu,fy=128,Fd=127;function lu(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw lu.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Fd)<<i:(c&Fd)*Math.pow(2,i),i+=7}while(c>=fy);return lu.bytes=o-n,r}var dy=Math.pow(2,7),py=Math.pow(2,14),gy=Math.pow(2,21),my=Math.pow(2,28),wy=Math.pow(2,35),vy=Math.pow(2,42),yy=Math.pow(2,49),by=Math.pow(2,56),_y=Math.pow(2,63),Ey=function(t){return t<dy?1:t<py?2:t<gy?3:t<my?4:t<wy?5:t<vy?6:t<yy?7:t<by?8:t<_y?9:10},xy={encode:ay,decode:hy,encodingLength:Ey},Bd=xy;const kd=(t,e,r=0)=>(Bd.encode(t,e,r),e),Hd=t=>Bd.encodingLength(t),uu=(t,e)=>{const r=e.byteLength,n=Hd(t),i=n+Hd(r),o=new Uint8Array(i+r);return kd(t,o,0),kd(r,o,n),o.set(e,i),new Cy(t,r,e,o)};class Cy{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const zd=({name:t,code:e,encode:r})=>new Iy(t,e,r);class Iy{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?uu(this.code,r):r.then(n=>uu(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Wd=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Oy=zd({name:"sha2-256",code:18,encode:Wd("SHA-256")}),Ay=zd({name:"sha2-512",code:19,encode:Wd("SHA-512")});var Sy=Object.freeze({__proto__:null,sha256:Oy,sha512:Ay});const qd=0,Dy="identity",Vd=Nd;var $y=Object.freeze({__proto__:null,identity:{code:qd,name:Dy,encode:Vd,digest:t=>uu(qd,Vd(t))}});new TextEncoder,new TextDecoder;const Kd={...Cv,...Ov,...Sv,...$v,...Rv,...zv,...Vv,...Zv,...ey,...oy};({...Sy,...$y});function Gd(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Zd=Gd("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),hu=Gd("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=Rd(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Yd={utf8:Zd,"utf-8":Zd,hex:Kd.base16,latin1:hu,ascii:hu,binary:hu,...Kd};function Hr(t,e="utf8"){const r=Yd[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?au(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Dr(t,e="utf8"){const r=Yd[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 Jd=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},Py=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),Ty=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),Ry=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}(),Ny=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Ly=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),My=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Uy=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Xd=3,jy=[["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",My]],Qd=[["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 Fy(t){return t?e1(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Ly:typeof navigator<"u"?e1(navigator.userAgent):Hy()}function By(t){return t!==""&&jy.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]},!1)}function e1(t){var e=By(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new Ny;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Xd&&(i=Jd(Jd([],i,!0),zy(Xd-i.length),!0)):i=[];var o=i.join("."),c=ky(t),l=Uy.exec(t);return l&&l[1]?new Ry(r,o,c,l[1]):new Py(r,o,c)}function ky(t){for(var e=0,r=Qd.length;e<r;e++){var n=Qd[e],i=n[0],o=n[1],c=o.exec(t);if(c)return i}return null}function Hy(){var t=typeof process<"u"&&process.version;return t?new Ty(process.version.slice(1)):null}function zy(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var ke={};/*! *****************************************************************************
|
|
1
|
+
(function(_n,pr){typeof exports=="object"&&typeof module<"u"?pr(exports):typeof define=="function"&&define.amd?define(["exports"],pr):(_n=typeof globalThis<"u"?globalThis:_n||self,pr(_n["@walletconnect/ethereum-provider"]={}))})(this,function(_n){"use strict";var pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Mi(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 br={exports:{}},Es=typeof Reflect=="object"?Reflect:null,cd=Es&&typeof Es.apply=="function"?Es.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},La;Es&&typeof Es.ownKeys=="function"?La=Es.ownKeys:Object.getOwnPropertySymbols?La=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:La=function(e){return Object.getOwnPropertyNames(e)};function gw(t){console&&console.warn&&console.warn(t)}var ld=Number.isNaN||function(e){return e!==e};function _t(){_t.init.call(this)}br.exports=_t,br.exports.once=yw,_t.EventEmitter=_t,_t.prototype._events=void 0,_t.prototype._eventsCount=0,_t.prototype._maxListeners=void 0;var ud=10;function Ma(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(_t,"defaultMaxListeners",{enumerable:!0,get:function(){return ud},set:function(t){if(typeof t!="number"||t<0||ld(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ud=t}}),_t.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},_t.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||ld(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 hd(t){return t._maxListeners===void 0?_t.defaultMaxListeners:t._maxListeners}_t.prototype.getMaxListeners=function(){return hd(this)},_t.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var c;if(r.length>0&&(c=r[0]),c instanceof Error)throw c;var l=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw l.context=c,l}var h=o[e];if(h===void 0)return!1;if(typeof h=="function")cd(h,this,r);else for(var d=h.length,v=md(h,d),n=0;n<d;++n)cd(v[n],this,r);return!0};function fd(t,e,r,n){var i,o,c;if(Ma(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),c=o[e]),c===void 0)c=o[e]=r,++t._eventsCount;else if(typeof c=="function"?c=o[e]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),i=hd(t),i>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=c.length,gw(l)}return t}_t.prototype.addListener=function(e,r){return fd(this,e,r,!1)},_t.prototype.on=_t.prototype.addListener,_t.prototype.prependListener=function(e,r){return fd(this,e,r,!0)};function mw(){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 dd(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=mw.bind(n);return i.listener=r,n.wrapFn=i,i}_t.prototype.once=function(e,r){return Ma(r),this.on(e,dd(this,e,r)),this},_t.prototype.prependOnceListener=function(e,r){return Ma(r),this.prependListener(e,dd(this,e,r)),this},_t.prototype.removeListener=function(e,r){var n,i,o,c,l;if(Ma(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(o=-1,c=n.length-1;c>=0;c--)if(n[c]===r||n[c].listener===r){l=n[c].listener,o=c;break}if(o<0)return this;o===0?n.shift():ww(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},_t.prototype.off=_t.prototype.removeListener,_t.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 o=Object.keys(n),c;for(i=0;i<o.length;++i)c=o[i],c!=="removeListener"&&this.removeAllListeners(c);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 pd(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?vw(i):md(i,i.length)}_t.prototype.listeners=function(e){return pd(this,e,!0)},_t.prototype.rawListeners=function(e){return pd(this,e,!1)},_t.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):gd.call(t,e)},_t.prototype.listenerCount=gd;function gd(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}_t.prototype.eventNames=function(){return this._eventsCount>0?La(this._events):[]};function md(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function ww(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function vw(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function yw(t,e){return new Promise(function(r,n){function i(c){t.removeListener(e,o),n(c)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}wd(t,e,o,{once:!0}),e!=="error"&&bw(t,i,{once:!0})})}function bw(t,e,r){typeof t.on=="function"&&wd(t,"error",e,r)}function wd(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(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var Xl={},Ua={},et={},vd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,h){var d=l>>>16&65535,v=l&65535,E=h>>>16&65535,_=h&65535;return v*_+(d*_+v*E<<16>>>0)|0}t.mul=Math.imul||e;function r(l,h){return l+h|0}t.add=r;function n(l,h){return l-h|0}t.sub=n;function i(l,h){return l<<h|l>>>32-h}t.rotl=i;function o(l,h){return l<<32-h|l>>>h}t.rotr=o;function c(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}t.isInteger=Number.isInteger||c,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(l){return t.isInteger(l)&&l>=-t.MAX_SAFE_INTEGER&&l<=t.MAX_SAFE_INTEGER}})(vd),Object.defineProperty(et,"__esModule",{value:!0});var yd=vd;function _w(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}et.readInt16BE=_w;function Ew(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}et.readUint16BE=Ew;function xw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}et.readInt16LE=xw;function Cw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}et.readUint16LE=Cw;function bd(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}et.writeUint16BE=bd,et.writeInt16BE=bd;function _d(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}et.writeUint16LE=_d,et.writeInt16LE=_d;function Ql(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}et.readInt32BE=Ql;function eu(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}et.readUint32BE=eu;function tu(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}et.readInt32LE=tu;function ru(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}et.readUint32LE=ru;function ja(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}et.writeUint32BE=ja,et.writeInt32BE=ja;function Fa(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}et.writeUint32LE=Fa,et.writeInt32LE=Fa;function Iw(t,e){e===void 0&&(e=0);var r=Ql(t,e),n=Ql(t,e+4);return r*4294967296+n-(n>>31)*4294967296}et.readInt64BE=Iw;function Ow(t,e){e===void 0&&(e=0);var r=eu(t,e),n=eu(t,e+4);return r*4294967296+n}et.readUint64BE=Ow;function Aw(t,e){e===void 0&&(e=0);var r=tu(t,e),n=tu(t,e+4);return n*4294967296+r-(r>>31)*4294967296}et.readInt64LE=Aw;function Sw(t,e){e===void 0&&(e=0);var r=ru(t,e),n=ru(t,e+4);return n*4294967296+r}et.readUint64LE=Sw;function Ed(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ja(t/4294967296>>>0,e,r),ja(t>>>0,e,r+4),e}et.writeUint64BE=Ed,et.writeInt64BE=Ed;function xd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Fa(t>>>0,e,r),Fa(t/4294967296>>>0,e,r+4),e}et.writeUint64LE=xd,et.writeInt64LE=xd;function Dw(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,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}et.readUintBE=Dw;function $w(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,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}et.readUintLE=$w;function Pw(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(!yd.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}et.writeUintBE=Pw;function Tw(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(!yd.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}et.writeUintLE=Tw;function Rw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}et.readFloat32BE=Rw;function Nw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}et.readFloat32LE=Nw;function Lw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}et.readFloat64BE=Lw;function Mw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}et.readFloat64LE=Mw;function Uw(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}et.writeFloat32BE=Uw;function jw(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}et.writeFloat32LE=jw;function Fw(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}et.writeFloat64BE=Fw;function Bw(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}et.writeFloat64LE=Bw;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});function kw(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Yr.wipe=kw,Object.defineProperty(Ua,"__esModule",{value:!0});var Ir=et,nu=Yr,Hw=20;function zw(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,c=1797285236,l=r[3]<<24|r[2]<<16|r[1]<<8|r[0],h=r[7]<<24|r[6]<<16|r[5]<<8|r[4],d=r[11]<<24|r[10]<<16|r[9]<<8|r[8],v=r[15]<<24|r[14]<<16|r[13]<<8|r[12],E=r[19]<<24|r[18]<<16|r[17]<<8|r[16],_=r[23]<<24|r[22]<<16|r[21]<<8|r[20],A=r[27]<<24|r[26]<<16|r[25]<<8|r[24],P=r[31]<<24|r[30]<<16|r[29]<<8|r[28],U=e[3]<<24|e[2]<<16|e[1]<<8|e[0],H=e[7]<<24|e[6]<<16|e[5]<<8|e[4],G=e[11]<<24|e[10]<<16|e[9]<<8|e[8],N=e[15]<<24|e[14]<<16|e[13]<<8|e[12],L=n,$=i,T=o,I=c,f=l,x=h,J=d,z=v,ee=E,de=_,me=A,O=P,j=U,ce=H,le=G,re=N,ne=0;ne<Hw;ne+=2)L=L+f|0,j^=L,j=j>>>32-16|j<<16,ee=ee+j|0,f^=ee,f=f>>>32-12|f<<12,$=$+x|0,ce^=$,ce=ce>>>32-16|ce<<16,de=de+ce|0,x^=de,x=x>>>32-12|x<<12,T=T+J|0,le^=T,le=le>>>32-16|le<<16,me=me+le|0,J^=me,J=J>>>32-12|J<<12,I=I+z|0,re^=I,re=re>>>32-16|re<<16,O=O+re|0,z^=O,z=z>>>32-12|z<<12,T=T+J|0,le^=T,le=le>>>32-8|le<<8,me=me+le|0,J^=me,J=J>>>32-7|J<<7,I=I+z|0,re^=I,re=re>>>32-8|re<<8,O=O+re|0,z^=O,z=z>>>32-7|z<<7,$=$+x|0,ce^=$,ce=ce>>>32-8|ce<<8,de=de+ce|0,x^=de,x=x>>>32-7|x<<7,L=L+f|0,j^=L,j=j>>>32-8|j<<8,ee=ee+j|0,f^=ee,f=f>>>32-7|f<<7,L=L+x|0,re^=L,re=re>>>32-16|re<<16,me=me+re|0,x^=me,x=x>>>32-12|x<<12,$=$+J|0,j^=$,j=j>>>32-16|j<<16,O=O+j|0,J^=O,J=J>>>32-12|J<<12,T=T+z|0,ce^=T,ce=ce>>>32-16|ce<<16,ee=ee+ce|0,z^=ee,z=z>>>32-12|z<<12,I=I+f|0,le^=I,le=le>>>32-16|le<<16,de=de+le|0,f^=de,f=f>>>32-12|f<<12,T=T+z|0,ce^=T,ce=ce>>>32-8|ce<<8,ee=ee+ce|0,z^=ee,z=z>>>32-7|z<<7,I=I+f|0,le^=I,le=le>>>32-8|le<<8,de=de+le|0,f^=de,f=f>>>32-7|f<<7,$=$+J|0,j^=$,j=j>>>32-8|j<<8,O=O+j|0,J^=O,J=J>>>32-7|J<<7,L=L+x|0,re^=L,re=re>>>32-8|re<<8,me=me+re|0,x^=me,x=x>>>32-7|x<<7;Ir.writeUint32LE(L+n|0,t,0),Ir.writeUint32LE($+i|0,t,4),Ir.writeUint32LE(T+o|0,t,8),Ir.writeUint32LE(I+c|0,t,12),Ir.writeUint32LE(f+l|0,t,16),Ir.writeUint32LE(x+h|0,t,20),Ir.writeUint32LE(J+d|0,t,24),Ir.writeUint32LE(z+v|0,t,28),Ir.writeUint32LE(ee+E|0,t,32),Ir.writeUint32LE(de+_|0,t,36),Ir.writeUint32LE(me+A|0,t,40),Ir.writeUint32LE(O+P|0,t,44),Ir.writeUint32LE(j+U|0,t,48),Ir.writeUint32LE(ce+H|0,t,52),Ir.writeUint32LE(le+G|0,t,56),Ir.writeUint32LE(re+N|0,t,60)}function Cd(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 o,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),c=o.length-e.length,o.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,c=i}for(var l=new Uint8Array(64),h=0;h<r.length;h+=64){zw(l,o,t);for(var d=h;d<h+64&&d<r.length;d++)n[d]=r[d]^l[d-h];qw(o,0,c)}return nu.wipe(l),i===0&&nu.wipe(o),n}Ua.streamXOR=Cd;function Ww(t,e,r,n){return n===void 0&&(n=0),nu.wipe(r),Cd(t,e,r,r,n)}Ua.stream=Ww;function qw(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 Id={},li={};Object.defineProperty(li,"__esModule",{value:!0});function Vw(t,e,r){return~(t-1)&e|t-1&r}li.select=Vw;function Kw(t,e){return(t|0)-(e|0)-1>>>31&1}li.lessOrEqual=Kw;function Od(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}li.compare=Od;function Gw(t,e){return t.length===0||e.length===0?!1:Od(t,e)!==0}li.equal=Gw,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=li,r=Yr;t.DIGEST_LENGTH=16;var n=function(){function c(l){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 h=l[0]|l[1]<<8;this._r[0]=h&8191;var d=l[2]|l[3]<<8;this._r[1]=(h>>>13|d<<3)&8191;var v=l[4]|l[5]<<8;this._r[2]=(d>>>10|v<<6)&7939;var E=l[6]|l[7]<<8;this._r[3]=(v>>>7|E<<9)&8191;var _=l[8]|l[9]<<8;this._r[4]=(E>>>4|_<<12)&255,this._r[5]=_>>>1&8190;var A=l[10]|l[11]<<8;this._r[6]=(_>>>14|A<<2)&8191;var P=l[12]|l[13]<<8;this._r[7]=(A>>>11|P<<5)&8065;var U=l[14]|l[15]<<8;this._r[8]=(P>>>8|U<<8)&8191,this._r[9]=U>>>5&127,this._pad[0]=l[16]|l[17]<<8,this._pad[1]=l[18]|l[19]<<8,this._pad[2]=l[20]|l[21]<<8,this._pad[3]=l[22]|l[23]<<8,this._pad[4]=l[24]|l[25]<<8,this._pad[5]=l[26]|l[27]<<8,this._pad[6]=l[28]|l[29]<<8,this._pad[7]=l[30]|l[31]<<8}return c.prototype._blocks=function(l,h,d){for(var v=this._fin?0:2048,E=this._h[0],_=this._h[1],A=this._h[2],P=this._h[3],U=this._h[4],H=this._h[5],G=this._h[6],N=this._h[7],L=this._h[8],$=this._h[9],T=this._r[0],I=this._r[1],f=this._r[2],x=this._r[3],J=this._r[4],z=this._r[5],ee=this._r[6],de=this._r[7],me=this._r[8],O=this._r[9];d>=16;){var j=l[h+0]|l[h+1]<<8;E+=j&8191;var ce=l[h+2]|l[h+3]<<8;_+=(j>>>13|ce<<3)&8191;var le=l[h+4]|l[h+5]<<8;A+=(ce>>>10|le<<6)&8191;var re=l[h+6]|l[h+7]<<8;P+=(le>>>7|re<<9)&8191;var ne=l[h+8]|l[h+9]<<8;U+=(re>>>4|ne<<12)&8191,H+=ne>>>1&8191;var ae=l[h+10]|l[h+11]<<8;G+=(ne>>>14|ae<<2)&8191;var ie=l[h+12]|l[h+13]<<8;N+=(ae>>>11|ie<<5)&8191;var Se=l[h+14]|l[h+15]<<8;L+=(ie>>>8|Se<<8)&8191,$+=Se>>>5|v;var ge=0,Fe=ge;Fe+=E*T,Fe+=_*(5*O),Fe+=A*(5*me),Fe+=P*(5*de),Fe+=U*(5*ee),ge=Fe>>>13,Fe&=8191,Fe+=H*(5*z),Fe+=G*(5*J),Fe+=N*(5*x),Fe+=L*(5*f),Fe+=$*(5*I),ge+=Fe>>>13,Fe&=8191;var ye=ge;ye+=E*I,ye+=_*T,ye+=A*(5*O),ye+=P*(5*me),ye+=U*(5*de),ge=ye>>>13,ye&=8191,ye+=H*(5*ee),ye+=G*(5*z),ye+=N*(5*J),ye+=L*(5*x),ye+=$*(5*f),ge+=ye>>>13,ye&=8191;var Le=ge;Le+=E*f,Le+=_*I,Le+=A*T,Le+=P*(5*O),Le+=U*(5*me),ge=Le>>>13,Le&=8191,Le+=H*(5*de),Le+=G*(5*ee),Le+=N*(5*z),Le+=L*(5*J),Le+=$*(5*x),ge+=Le>>>13,Le&=8191;var X=ge;X+=E*x,X+=_*f,X+=A*I,X+=P*T,X+=U*(5*O),ge=X>>>13,X&=8191,X+=H*(5*me),X+=G*(5*de),X+=N*(5*ee),X+=L*(5*z),X+=$*(5*J),ge+=X>>>13,X&=8191;var Y=ge;Y+=E*J,Y+=_*x,Y+=A*f,Y+=P*I,Y+=U*T,ge=Y>>>13,Y&=8191,Y+=H*(5*O),Y+=G*(5*me),Y+=N*(5*de),Y+=L*(5*ee),Y+=$*(5*z),ge+=Y>>>13,Y&=8191;var W=ge;W+=E*z,W+=_*J,W+=A*x,W+=P*f,W+=U*I,ge=W>>>13,W&=8191,W+=H*T,W+=G*(5*O),W+=N*(5*me),W+=L*(5*de),W+=$*(5*ee),ge+=W>>>13,W&=8191;var w=ge;w+=E*ee,w+=_*z,w+=A*J,w+=P*x,w+=U*f,ge=w>>>13,w&=8191,w+=H*I,w+=G*T,w+=N*(5*O),w+=L*(5*me),w+=$*(5*de),ge+=w>>>13,w&=8191;var F=ge;F+=E*de,F+=_*ee,F+=A*z,F+=P*J,F+=U*x,ge=F>>>13,F&=8191,F+=H*f,F+=G*I,F+=N*T,F+=L*(5*O),F+=$*(5*me),ge+=F>>>13,F&=8191;var we=ge;we+=E*me,we+=_*de,we+=A*ee,we+=P*z,we+=U*J,ge=we>>>13,we&=8191,we+=H*x,we+=G*f,we+=N*I,we+=L*T,we+=$*(5*O),ge+=we>>>13,we&=8191;var ve=ge;ve+=E*O,ve+=_*me,ve+=A*de,ve+=P*ee,ve+=U*z,ge=ve>>>13,ve&=8191,ve+=H*J,ve+=G*x,ve+=N*f,ve+=L*I,ve+=$*T,ge+=ve>>>13,ve&=8191,ge=(ge<<2)+ge|0,ge=ge+Fe|0,Fe=ge&8191,ge=ge>>>13,ye+=ge,E=Fe,_=ye,A=Le,P=X,U=Y,H=W,G=w,N=F,L=we,$=ve,h+=16,d-=16}this._h[0]=E,this._h[1]=_,this._h[2]=A,this._h[3]=P,this._h[4]=U,this._h[5]=H,this._h[6]=G,this._h[7]=N,this._h[8]=L,this._h[9]=$},c.prototype.finish=function(l,h){h===void 0&&(h=0);var d=new Uint16Array(10),v,E,_,A;if(this._leftover){for(A=this._leftover,this._buffer[A++]=1;A<16;A++)this._buffer[A]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(v=this._h[1]>>>13,this._h[1]&=8191,A=2;A<10;A++)this._h[A]+=v,v=this._h[A]>>>13,this._h[A]&=8191;for(this._h[0]+=v*5,v=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=v,v=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=v,d[0]=this._h[0]+5,v=d[0]>>>13,d[0]&=8191,A=1;A<10;A++)d[A]=this._h[A]+v,v=d[A]>>>13,d[A]&=8191;for(d[9]-=8192,E=(v^1)-1,A=0;A<10;A++)d[A]&=E;for(E=~E,A=0;A<10;A++)this._h[A]=this._h[A]&E|d[A];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,_=this._h[0]+this._pad[0],this._h[0]=_&65535,A=1;A<8;A++)_=(this._h[A]+this._pad[A]|0)+(_>>>16)|0,this._h[A]=_&65535;return l[h+0]=this._h[0]>>>0,l[h+1]=this._h[0]>>>8,l[h+2]=this._h[1]>>>0,l[h+3]=this._h[1]>>>8,l[h+4]=this._h[2]>>>0,l[h+5]=this._h[2]>>>8,l[h+6]=this._h[3]>>>0,l[h+7]=this._h[3]>>>8,l[h+8]=this._h[4]>>>0,l[h+9]=this._h[4]>>>8,l[h+10]=this._h[5]>>>0,l[h+11]=this._h[5]>>>8,l[h+12]=this._h[6]>>>0,l[h+13]=this._h[6]>>>8,l[h+14]=this._h[7]>>>0,l[h+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(l){var h=0,d=l.length,v;if(this._leftover){v=16-this._leftover,v>d&&(v=d);for(var E=0;E<v;E++)this._buffer[this._leftover+E]=l[h+E];if(d-=v,h+=v,this._leftover+=v,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(d>=16&&(v=d-d%16,this._blocks(l,h,v),h+=v,d-=v),d){for(var E=0;E<d;E++)this._buffer[this._leftover+E]=l[h+E];this._leftover+=d}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var l=new Uint8Array(16);return this.finish(l),l},c.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},c}();t.Poly1305=n;function i(c,l){var h=new n(c);h.update(l);var d=h.digest();return h.clean(),d}t.oneTimeAuth=i;function o(c,l){return c.length!==t.DIGEST_LENGTH||l.length!==t.DIGEST_LENGTH?!1:e.equal(c,l)}t.equal=o}(Id),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ua,r=Id,n=Yr,i=et,o=li;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function h(d){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,d.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(d)}return h.prototype.seal=function(d,v,E,_){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var A=new Uint8Array(16);A.set(d,A.length-d.length);var P=new Uint8Array(32);e.stream(this._key,A,P,4);var U=v.length+this.tagLength,H;if(_){if(_.length!==U)throw new Error("ChaCha20Poly1305: incorrect destination length");H=_}else H=new Uint8Array(U);return e.streamXOR(this._key,A,v,H,4),this._authenticate(H.subarray(H.length-this.tagLength,H.length),P,H.subarray(0,H.length-this.tagLength),E),n.wipe(A),H},h.prototype.open=function(d,v,E,_){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(v.length<this.tagLength)return null;var A=new Uint8Array(16);A.set(d,A.length-d.length);var P=new Uint8Array(32);e.stream(this._key,A,P,4);var U=new Uint8Array(this.tagLength);if(this._authenticate(U,P,v.subarray(0,v.length-this.tagLength),E),!o.equal(U,v.subarray(v.length-this.tagLength,v.length)))return null;var H=v.length-this.tagLength,G;if(_){if(_.length!==H)throw new Error("ChaCha20Poly1305: incorrect destination length");G=_}else G=new Uint8Array(H);return e.streamXOR(this._key,A,v.subarray(0,v.length-this.tagLength),G,4),n.wipe(A),G},h.prototype.clean=function(){return n.wipe(this._key),this},h.prototype._authenticate=function(d,v,E,_){var A=new r.Poly1305(v);_&&(A.update(_),_.length%16>0&&A.update(c.subarray(_.length%16))),A.update(E),E.length%16>0&&A.update(c.subarray(E.length%16));var P=new Uint8Array(8);_&&i.writeUint64LE(_.length,P),A.update(P),i.writeUint64LE(E.length,P),A.update(P);for(var U=A.digest(),H=0;H<U.length;H++)d[H]=U[H];A.clean(),n.wipe(U),n.wipe(P)},h}();t.ChaCha20Poly1305=l}(Xl);var Ad={},yo={},iu={};Object.defineProperty(iu,"__esModule",{value:!0});function Zw(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}iu.isSerializableHash=Zw,Object.defineProperty(yo,"__esModule",{value:!0});var Dn=iu,Yw=li,Jw=Yr,Sd=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),Dn.isSerializableHash(this._inner)&&Dn.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Jw.wipe(n)}return t.prototype.reset=function(){if(!Dn.isSerializableHash(this._inner)||!Dn.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(){Dn.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Dn.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(!Dn.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(!Dn.isSerializableHash(this._inner)||!Dn.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(!Dn.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();yo.HMAC=Sd;function Xw(t,e,r){var n=new Sd(t,e);n.update(r);var i=n.digest();return n.clean(),i}yo.hmac=Xw,yo.equal=Yw.equal,Object.defineProperty(Ad,"__esModule",{value:!0});var Dd=yo,$d=Yr,Qw=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 o=Dd.hmac(this._hash,n,r);this._hmac=new Dd.HMAC(e,o),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(),$d.wipe(this._buffer),$d.wipe(this._counter),this._bufpos=0},t}(),ev=Ad.HKDF=Qw,xs={},Ba={},ka={};Object.defineProperty(ka,"__esModule",{value:!0}),ka.BrowserRandomSource=void 0;const Pd=65536;class tv{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+=Pd)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Pd)));return r}}ka.BrowserRandomSource=tv;function rv(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 Ha={},nv={},iv=Object.freeze({__proto__:null,default:nv}),sv=Mi(iv);Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.NodeRandomSource=void 0;const ov=Yr;class av{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof rv<"u"){const e=sv;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,ov.wipe)(r),n}}Ha.NodeRandomSource=av,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.SystemRandomSource=void 0;const cv=ka,lv=Ha;class uv{constructor(){if(this.isAvailable=!1,this.name="",this._source=new cv.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new lv.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)}}Ba.SystemRandomSource=uv,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Ba,r=et,n=Yr;t.defaultRandomSource=new e.SystemRandomSource;function i(d,v=t.defaultRandomSource){return v.randomBytes(d)}t.randomBytes=i;function o(d=t.defaultRandomSource){const v=i(4,d),E=(0,r.readUint32LE)(v);return(0,n.wipe)(v),E}t.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(d,v=c,E=t.defaultRandomSource){if(v.length<2)throw new Error("randomString charset is too short");if(v.length>256)throw new Error("randomString charset is too long");let _="";const A=v.length,P=256-256%A;for(;d>0;){const U=i(Math.ceil(d*256/P),E);for(let H=0;H<U.length&&d>0;H++){const G=U[H];G<P&&(_+=v.charAt(G%A),d--)}(0,n.wipe)(U)}return _}t.randomString=l;function h(d,v=c,E=t.defaultRandomSource){const _=Math.ceil(d/(Math.log(v.length)/Math.LN2));return l(_,v,E)}t.randomStringForEntropy=h}(xs);var za={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Yr;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function l(){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 l.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},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},l.prototype.update=function(h,d){if(d===void 0&&(d=h.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var v=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&d>0;)this._buffer[this._bufferLength++]=h[v++],d--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(v=o(this._temp,this._state,h,v,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=h[v++],d--;return this},l.prototype.finish=function(h){if(!this._finished){var d=this._bytesHashed,v=this._bufferLength,E=d/536870912|0,_=d<<3,A=d%64<56?64:128;this._buffer[v]=128;for(var P=v+1;P<A-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,A-8),e.writeUint32BE(_,this._buffer,A-4),o(this._temp,this._state,this._buffer,0,A),this._finished=!0}for(var P=0;P<this.digestLength/4;P++)e.writeUint32BE(this._state[P],h,P*4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.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}},l.prototype.restoreState=function(h){return this._state.set(h.state),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.state),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();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 o(l,h,d,v,E){for(;E>=64;){for(var _=h[0],A=h[1],P=h[2],U=h[3],H=h[4],G=h[5],N=h[6],L=h[7],$=0;$<16;$++){var T=v+$*4;l[$]=e.readUint32BE(d,T)}for(var $=16;$<64;$++){var I=l[$-2],f=(I>>>17|I<<32-17)^(I>>>19|I<<32-19)^I>>>10;I=l[$-15];var x=(I>>>7|I<<32-7)^(I>>>18|I<<32-18)^I>>>3;l[$]=(f+l[$-7]|0)+(x+l[$-16]|0)}for(var $=0;$<64;$++){var f=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&G^~H&N)|0)+(L+(i[$]+l[$]|0)|0)|0,x=((_>>>2|_<<32-2)^(_>>>13|_<<32-13)^(_>>>22|_<<32-22))+(_&A^_&P^A&P)|0;L=N,N=G,G=H,H=U+f|0,U=P,P=A,A=_,_=f+x|0}h[0]+=_,h[1]+=A,h[2]+=P,h[3]+=U,h[4]+=H,h[5]+=G,h[6]+=N,h[7]+=L,v+=64,E-=64}return v}function c(l){var h=new n;h.update(l);var d=h.digest();return h.clean(),d}t.hash=c})(za);var su={};(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=xs,r=Yr;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n($){const T=new Float64Array(16);if($)for(let I=0;I<$.length;I++)T[I]=$[I];return T}const i=new Uint8Array(32);i[0]=9;const o=n([56129,1]);function c($){let T=1;for(let I=0;I<16;I++){let f=$[I]+T+65535;T=Math.floor(f/65536),$[I]=f-T*65536}$[0]+=T-1+37*(T-1)}function l($,T,I){const f=~(I-1);for(let x=0;x<16;x++){const J=f&($[x]^T[x]);$[x]^=J,T[x]^=J}}function h($,T){const I=n(),f=n();for(let x=0;x<16;x++)f[x]=T[x];c(f),c(f),c(f);for(let x=0;x<2;x++){I[0]=f[0]-65517;for(let z=1;z<15;z++)I[z]=f[z]-65535-(I[z-1]>>16&1),I[z-1]&=65535;I[15]=f[15]-32767-(I[14]>>16&1);const J=I[15]>>16&1;I[14]&=65535,l(f,I,1-J)}for(let x=0;x<16;x++)$[2*x]=f[x]&255,$[2*x+1]=f[x]>>8}function d($,T){for(let I=0;I<16;I++)$[I]=T[2*I]+(T[2*I+1]<<8);$[15]&=32767}function v($,T,I){for(let f=0;f<16;f++)$[f]=T[f]+I[f]}function E($,T,I){for(let f=0;f<16;f++)$[f]=T[f]-I[f]}function _($,T,I){let f,x,J=0,z=0,ee=0,de=0,me=0,O=0,j=0,ce=0,le=0,re=0,ne=0,ae=0,ie=0,Se=0,ge=0,Fe=0,ye=0,Le=0,X=0,Y=0,W=0,w=0,F=0,we=0,ve=0,Me=0,nt=0,at=0,Ge=0,Dt=0,$t=0,Je=I[0],He=I[1],Be=I[2],Ke=I[3],rt=I[4],Ue=I[5],Ze=I[6],b=I[7],p=I[8],m=I[9],D=I[10],B=I[11],K=I[12],Q=I[13],Ee=I[14],Te=I[15];f=T[0],J+=f*Je,z+=f*He,ee+=f*Be,de+=f*Ke,me+=f*rt,O+=f*Ue,j+=f*Ze,ce+=f*b,le+=f*p,re+=f*m,ne+=f*D,ae+=f*B,ie+=f*K,Se+=f*Q,ge+=f*Ee,Fe+=f*Te,f=T[1],z+=f*Je,ee+=f*He,de+=f*Be,me+=f*Ke,O+=f*rt,j+=f*Ue,ce+=f*Ze,le+=f*b,re+=f*p,ne+=f*m,ae+=f*D,ie+=f*B,Se+=f*K,ge+=f*Q,Fe+=f*Ee,ye+=f*Te,f=T[2],ee+=f*Je,de+=f*He,me+=f*Be,O+=f*Ke,j+=f*rt,ce+=f*Ue,le+=f*Ze,re+=f*b,ne+=f*p,ae+=f*m,ie+=f*D,Se+=f*B,ge+=f*K,Fe+=f*Q,ye+=f*Ee,Le+=f*Te,f=T[3],de+=f*Je,me+=f*He,O+=f*Be,j+=f*Ke,ce+=f*rt,le+=f*Ue,re+=f*Ze,ne+=f*b,ae+=f*p,ie+=f*m,Se+=f*D,ge+=f*B,Fe+=f*K,ye+=f*Q,Le+=f*Ee,X+=f*Te,f=T[4],me+=f*Je,O+=f*He,j+=f*Be,ce+=f*Ke,le+=f*rt,re+=f*Ue,ne+=f*Ze,ae+=f*b,ie+=f*p,Se+=f*m,ge+=f*D,Fe+=f*B,ye+=f*K,Le+=f*Q,X+=f*Ee,Y+=f*Te,f=T[5],O+=f*Je,j+=f*He,ce+=f*Be,le+=f*Ke,re+=f*rt,ne+=f*Ue,ae+=f*Ze,ie+=f*b,Se+=f*p,ge+=f*m,Fe+=f*D,ye+=f*B,Le+=f*K,X+=f*Q,Y+=f*Ee,W+=f*Te,f=T[6],j+=f*Je,ce+=f*He,le+=f*Be,re+=f*Ke,ne+=f*rt,ae+=f*Ue,ie+=f*Ze,Se+=f*b,ge+=f*p,Fe+=f*m,ye+=f*D,Le+=f*B,X+=f*K,Y+=f*Q,W+=f*Ee,w+=f*Te,f=T[7],ce+=f*Je,le+=f*He,re+=f*Be,ne+=f*Ke,ae+=f*rt,ie+=f*Ue,Se+=f*Ze,ge+=f*b,Fe+=f*p,ye+=f*m,Le+=f*D,X+=f*B,Y+=f*K,W+=f*Q,w+=f*Ee,F+=f*Te,f=T[8],le+=f*Je,re+=f*He,ne+=f*Be,ae+=f*Ke,ie+=f*rt,Se+=f*Ue,ge+=f*Ze,Fe+=f*b,ye+=f*p,Le+=f*m,X+=f*D,Y+=f*B,W+=f*K,w+=f*Q,F+=f*Ee,we+=f*Te,f=T[9],re+=f*Je,ne+=f*He,ae+=f*Be,ie+=f*Ke,Se+=f*rt,ge+=f*Ue,Fe+=f*Ze,ye+=f*b,Le+=f*p,X+=f*m,Y+=f*D,W+=f*B,w+=f*K,F+=f*Q,we+=f*Ee,ve+=f*Te,f=T[10],ne+=f*Je,ae+=f*He,ie+=f*Be,Se+=f*Ke,ge+=f*rt,Fe+=f*Ue,ye+=f*Ze,Le+=f*b,X+=f*p,Y+=f*m,W+=f*D,w+=f*B,F+=f*K,we+=f*Q,ve+=f*Ee,Me+=f*Te,f=T[11],ae+=f*Je,ie+=f*He,Se+=f*Be,ge+=f*Ke,Fe+=f*rt,ye+=f*Ue,Le+=f*Ze,X+=f*b,Y+=f*p,W+=f*m,w+=f*D,F+=f*B,we+=f*K,ve+=f*Q,Me+=f*Ee,nt+=f*Te,f=T[12],ie+=f*Je,Se+=f*He,ge+=f*Be,Fe+=f*Ke,ye+=f*rt,Le+=f*Ue,X+=f*Ze,Y+=f*b,W+=f*p,w+=f*m,F+=f*D,we+=f*B,ve+=f*K,Me+=f*Q,nt+=f*Ee,at+=f*Te,f=T[13],Se+=f*Je,ge+=f*He,Fe+=f*Be,ye+=f*Ke,Le+=f*rt,X+=f*Ue,Y+=f*Ze,W+=f*b,w+=f*p,F+=f*m,we+=f*D,ve+=f*B,Me+=f*K,nt+=f*Q,at+=f*Ee,Ge+=f*Te,f=T[14],ge+=f*Je,Fe+=f*He,ye+=f*Be,Le+=f*Ke,X+=f*rt,Y+=f*Ue,W+=f*Ze,w+=f*b,F+=f*p,we+=f*m,ve+=f*D,Me+=f*B,nt+=f*K,at+=f*Q,Ge+=f*Ee,Dt+=f*Te,f=T[15],Fe+=f*Je,ye+=f*He,Le+=f*Be,X+=f*Ke,Y+=f*rt,W+=f*Ue,w+=f*Ze,F+=f*b,we+=f*p,ve+=f*m,Me+=f*D,nt+=f*B,at+=f*K,Ge+=f*Q,Dt+=f*Ee,$t+=f*Te,J+=38*ye,z+=38*Le,ee+=38*X,de+=38*Y,me+=38*W,O+=38*w,j+=38*F,ce+=38*we,le+=38*ve,re+=38*Me,ne+=38*nt,ae+=38*at,ie+=38*Ge,Se+=38*Dt,ge+=38*$t,x=1,f=J+x+65535,x=Math.floor(f/65536),J=f-x*65536,f=z+x+65535,x=Math.floor(f/65536),z=f-x*65536,f=ee+x+65535,x=Math.floor(f/65536),ee=f-x*65536,f=de+x+65535,x=Math.floor(f/65536),de=f-x*65536,f=me+x+65535,x=Math.floor(f/65536),me=f-x*65536,f=O+x+65535,x=Math.floor(f/65536),O=f-x*65536,f=j+x+65535,x=Math.floor(f/65536),j=f-x*65536,f=ce+x+65535,x=Math.floor(f/65536),ce=f-x*65536,f=le+x+65535,x=Math.floor(f/65536),le=f-x*65536,f=re+x+65535,x=Math.floor(f/65536),re=f-x*65536,f=ne+x+65535,x=Math.floor(f/65536),ne=f-x*65536,f=ae+x+65535,x=Math.floor(f/65536),ae=f-x*65536,f=ie+x+65535,x=Math.floor(f/65536),ie=f-x*65536,f=Se+x+65535,x=Math.floor(f/65536),Se=f-x*65536,f=ge+x+65535,x=Math.floor(f/65536),ge=f-x*65536,f=Fe+x+65535,x=Math.floor(f/65536),Fe=f-x*65536,J+=x-1+37*(x-1),x=1,f=J+x+65535,x=Math.floor(f/65536),J=f-x*65536,f=z+x+65535,x=Math.floor(f/65536),z=f-x*65536,f=ee+x+65535,x=Math.floor(f/65536),ee=f-x*65536,f=de+x+65535,x=Math.floor(f/65536),de=f-x*65536,f=me+x+65535,x=Math.floor(f/65536),me=f-x*65536,f=O+x+65535,x=Math.floor(f/65536),O=f-x*65536,f=j+x+65535,x=Math.floor(f/65536),j=f-x*65536,f=ce+x+65535,x=Math.floor(f/65536),ce=f-x*65536,f=le+x+65535,x=Math.floor(f/65536),le=f-x*65536,f=re+x+65535,x=Math.floor(f/65536),re=f-x*65536,f=ne+x+65535,x=Math.floor(f/65536),ne=f-x*65536,f=ae+x+65535,x=Math.floor(f/65536),ae=f-x*65536,f=ie+x+65535,x=Math.floor(f/65536),ie=f-x*65536,f=Se+x+65535,x=Math.floor(f/65536),Se=f-x*65536,f=ge+x+65535,x=Math.floor(f/65536),ge=f-x*65536,f=Fe+x+65535,x=Math.floor(f/65536),Fe=f-x*65536,J+=x-1+37*(x-1),$[0]=J,$[1]=z,$[2]=ee,$[3]=de,$[4]=me,$[5]=O,$[6]=j,$[7]=ce,$[8]=le,$[9]=re,$[10]=ne,$[11]=ae,$[12]=ie,$[13]=Se,$[14]=ge,$[15]=Fe}function A($,T){_($,T,T)}function P($,T){const I=n();for(let f=0;f<16;f++)I[f]=T[f];for(let f=253;f>=0;f--)A(I,I),f!==2&&f!==4&&_(I,I,T);for(let f=0;f<16;f++)$[f]=I[f]}function U($,T){const I=new Uint8Array(32),f=new Float64Array(80),x=n(),J=n(),z=n(),ee=n(),de=n(),me=n();for(let le=0;le<31;le++)I[le]=$[le];I[31]=$[31]&127|64,I[0]&=248,d(f,T);for(let le=0;le<16;le++)J[le]=f[le];x[0]=ee[0]=1;for(let le=254;le>=0;--le){const re=I[le>>>3]>>>(le&7)&1;l(x,J,re),l(z,ee,re),v(de,x,z),E(x,x,z),v(z,J,ee),E(J,J,ee),A(ee,de),A(me,x),_(x,z,x),_(z,J,de),v(de,x,z),E(x,x,z),A(J,x),E(z,ee,me),_(x,z,o),v(x,x,ee),_(z,z,x),_(x,ee,me),_(ee,J,f),A(J,de),l(x,J,re),l(z,ee,re)}for(let le=0;le<16;le++)f[le+16]=x[le],f[le+32]=z[le],f[le+48]=J[le],f[le+64]=ee[le];const O=f.subarray(32),j=f.subarray(16);P(O,O),_(j,j,O);const ce=new Uint8Array(32);return h(ce,j),ce}t.scalarMult=U;function H($){return U($,i)}t.scalarMultBase=H;function G($){if($.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const T=new Uint8Array($);return{publicKey:H(T),secretKey:T}}t.generateKeyPairFromSeed=G;function N($){const T=(0,e.randomBytes)(32,$),I=G(T);return(0,r.wipe)(T),I}t.generateKeyPair=N;function L($,T,I=!1){if($.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(T.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const f=U($,T);if(I){let x=0;for(let J=0;J<f.length;J++)x|=f[J];if(x===0)throw new Error("X25519: invalid shared key")}return f}t.sharedKey=L})(su);function ou(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Td(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?ou(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function au(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=Td(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return ou(r)}function hv(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 o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),d=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function E(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var U=0,H=0,G=0,N=P.length;G!==N&&P[G]===0;)G++,U++;for(var L=(N-G)*v+1>>>0,$=new Uint8Array(L);G!==N;){for(var T=P[G],I=0,f=L-1;(T!==0||I<H)&&f!==-1;f--,I++)T+=256*$[f]>>>0,$[f]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,G++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(U);x<L;++x)J+=t.charAt($[x]);return J}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var U=0;if(P[U]!==" "){for(var H=0,G=0;P[U]===h;)H++,U++;for(var N=(P.length-U)*d+1>>>0,L=new Uint8Array(N);P[U];){var $=r[P.charCodeAt(U)];if($===255)return;for(var T=0,I=N-1;($!==0||T<G)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");G=T,U++}if(P[U]!==" "){for(var f=N-G;f!==N&&L[f]===0;)f++;for(var x=new Uint8Array(H+(N-f)),J=H;f!==N;)x[J++]=L[f++];return x}}}function A(P){var U=_(P);if(U)return U;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:A}}var fv=hv,dv=fv;const Rd=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")},pv=t=>new TextEncoder().encode(t),gv=t=>new TextDecoder().decode(t);class mv{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 wv{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 Nd(this,e)}}class vv{constructor(e){this.decoders=e}or(e){return Nd(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 Nd=(t,e)=>new vv({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class yv{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new mv(e,r,n),this.decoder=new wv(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Wa=({name:t,prefix:e,encode:r,decode:n})=>new yv(t,e,r,n),bo=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=dv(r,e);return Wa({prefix:t,name:e,encode:n,decode:o=>Rd(i(o))})},bv=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,d=0;for(let v=0;v<o;++v){const E=i[t[v]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|E,l+=r,l>=8&&(l-=8,c[d++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},_v=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},_r=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Wa({prefix:e,name:t,encode(i){return _v(i,n,r)},decode(i){return bv(i,n,r,t)}}),Ev=Wa({prefix:"\0",name:"identity",encode:t=>gv(t),decode:t=>pv(t)});var xv=Object.freeze({__proto__:null,identity:Ev});const Cv=_r({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Iv=Object.freeze({__proto__:null,base2:Cv});const Ov=_r({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Av=Object.freeze({__proto__:null,base8:Ov});const Sv=bo({prefix:"9",name:"base10",alphabet:"0123456789"});var Dv=Object.freeze({__proto__:null,base10:Sv});const $v=_r({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pv=_r({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Tv=Object.freeze({__proto__:null,base16:$v,base16upper:Pv});const Rv=_r({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Nv=_r({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Lv=_r({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Mv=_r({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Uv=_r({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),jv=_r({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Fv=_r({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Bv=_r({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),kv=_r({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Hv=Object.freeze({__proto__:null,base32:Rv,base32upper:Nv,base32pad:Lv,base32padupper:Mv,base32hex:Uv,base32hexupper:jv,base32hexpad:Fv,base32hexpadupper:Bv,base32z:kv});const zv=bo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Wv=bo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var qv=Object.freeze({__proto__:null,base36:zv,base36upper:Wv});const Vv=bo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Kv=bo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Gv=Object.freeze({__proto__:null,base58btc:Vv,base58flickr:Kv});const Zv=_r({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Yv=_r({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Jv=_r({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Xv=_r({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Qv=Object.freeze({__proto__:null,base64:Zv,base64pad:Yv,base64url:Jv,base64urlpad:Xv});const Ld=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}"),ey=Ld.reduce((t,e,r)=>(t[r]=e,t),[]),ty=Ld.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function ry(t){return t.reduce((e,r)=>(e+=ey[r],e),"")}function ny(t){const e=[];for(const r of t){const n=ty[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const iy=Wa({prefix:"\u{1F680}",name:"base256emoji",encode:ry,decode:ny});var sy=Object.freeze({__proto__:null,base256emoji:iy}),oy=Ud,Md=128,ay=127,cy=~ay,ly=Math.pow(2,31);function Ud(t,e,r){e=e||[],r=r||0;for(var n=r;t>=ly;)e[r++]=t&255|Md,t/=128;for(;t&cy;)e[r++]=t&255|Md,t>>>=7;return e[r]=t|0,Ud.bytes=r-n+1,e}var uy=cu,hy=128,jd=127;function cu(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw cu.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&jd)<<i:(c&jd)*Math.pow(2,i),i+=7}while(c>=hy);return cu.bytes=o-n,r}var fy=Math.pow(2,7),dy=Math.pow(2,14),py=Math.pow(2,21),gy=Math.pow(2,28),my=Math.pow(2,35),wy=Math.pow(2,42),vy=Math.pow(2,49),yy=Math.pow(2,56),by=Math.pow(2,63),_y=function(t){return t<fy?1:t<dy?2:t<py?3:t<gy?4:t<my?5:t<wy?6:t<vy?7:t<yy?8:t<by?9:10},Ey={encode:oy,decode:uy,encodingLength:_y},Fd=Ey;const Bd=(t,e,r=0)=>(Fd.encode(t,e,r),e),kd=t=>Fd.encodingLength(t),lu=(t,e)=>{const r=e.byteLength,n=kd(t),i=n+kd(r),o=new Uint8Array(i+r);return Bd(t,o,0),Bd(r,o,n),o.set(e,i),new xy(t,r,e,o)};class xy{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Hd=({name:t,code:e,encode:r})=>new Cy(t,e,r);class Cy{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?lu(this.code,r):r.then(n=>lu(this.code,n))}else throw Error("Unknown type, must be binary type")}}const zd=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Iy=Hd({name:"sha2-256",code:18,encode:zd("SHA-256")}),Oy=Hd({name:"sha2-512",code:19,encode:zd("SHA-512")});var Ay=Object.freeze({__proto__:null,sha256:Iy,sha512:Oy});const Wd=0,Sy="identity",qd=Rd;var Dy=Object.freeze({__proto__:null,identity:{code:Wd,name:Sy,encode:qd,digest:t=>lu(Wd,qd(t))}});new TextEncoder,new TextDecoder;const Vd={...xv,...Iv,...Av,...Dv,...Tv,...Hv,...qv,...Gv,...Qv,...sy};({...Ay,...Dy});function Kd(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Gd=Kd("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),uu=Kd("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=Td(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Zd={utf8:Gd,"utf-8":Gd,hex:Vd.base16,latin1:uu,ascii:uu,binary:uu,...Vd};function Hr(t,e="utf8"){const r=Zd[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ou(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Dr(t,e="utf8"){const r=Zd[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 Yd=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},$y=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),Py=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),Ty=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}(),Ry=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Ny=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Ly=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,My=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Jd=3,Uy=[["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",Ly]],Xd=[["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 jy(t){return t?Qd(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Ny:typeof navigator<"u"?Qd(navigator.userAgent):ky()}function Fy(t){return t!==""&&Uy.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]},!1)}function Qd(t){var e=Fy(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new Ry;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Jd&&(i=Yd(Yd([],i,!0),Hy(Jd-i.length),!0)):i=[];var o=i.join("."),c=By(t),l=My.exec(t);return l&&l[1]?new Ty(r,o,c,l[1]):new $y(r,o,c)}function By(t){for(var e=0,r=Xd.length;e<r;e++){var n=Xd[e],i=n[0],o=n[1],c=o.exec(t);if(c)return i}return null}function ky(){var t=typeof process<"u"&&process.version;return t?new Py(process.version.slice(1)):null}function Hy(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var ke={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */var fu=function(t,e){return fu=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])},fu(t,e)};function Wy(t,e){fu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var du=function(){return du=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},du.apply(this,arguments)};function qy(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 Vy(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function Ky(t,e){return function(r,n){e(r,n,t)}}function Gy(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Zy(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(E){c(E)}}function h(v){try{d(n.throw(v))}catch(E){c(E)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function Yy(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Jy(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Xy(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function pu(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 t1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function Qy(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(t1(arguments[e]));return t}function e5(){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 o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Eo(t){return this instanceof Eo?(this.v=t,this):new Eo(t)}function t5(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,U){o.push([_,A,P,U])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Eo?Promise.resolve(_.value.v).then(d,v):E(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function E(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function r5(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:Eo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function n5(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 pu=="function"?pu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function i5(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function s5(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 o5(t){return t&&t.__esModule?t:{default:t}}function a5(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function c5(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 l5=Object.freeze({__proto__:null,__extends:Wy,get __assign(){return du},__rest:qy,__decorate:Vy,__param:Ky,__metadata:Gy,__awaiter:Zy,__generator:Yy,__createBinding:Jy,__exportStar:Xy,__values:pu,__read:t1,__spread:Qy,__spreadArrays:e5,__await:Eo,__asyncGenerator:t5,__asyncDelegator:r5,__asyncValues:n5,__makeTemplateObject:i5,__importStar:s5,__importDefault:o5,__classPrivateFieldGet:a5,__classPrivateFieldSet:c5}),Va=Mi(l5),gu={},xo={},r1;function u5(){if(r1)return xo;r1=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return xo.delay=t,xo}var Ui={},mu={},ji={},n1;function h5(){return n1||(n1=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.ONE_THOUSAND=ji.ONE_HUNDRED=void 0,ji.ONE_HUNDRED=100,ji.ONE_THOUSAND=1e3),ji}var wu={},i1;function f5(){return i1||(i1=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}(wu)),wu}var s1;function o1(){return s1||(s1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Va;e.__exportStar(h5(),t),e.__exportStar(f5(),t)}(mu)),mu}var a1;function d5(){if(a1)return Ui;a1=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.fromMiliseconds=Ui.toMiliseconds=void 0;const t=o1();function e(n){return n*t.ONE_THOUSAND}Ui.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Ui.fromMiliseconds=r,Ui}var c1;function p5(){return c1||(c1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Va;e.__exportStar(u5(),t),e.__exportStar(d5(),t)}(gu)),gu}var Is={},l1;function g5(){if(l1)return Is;l1=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.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 Is.Watch=t,Is.default=t,Is}var vu={},Co={},u1;function m5(){if(u1)return Co;u1=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.IWatch=void 0;class t{}return Co.IWatch=t,Co}var h1;function w5(){return h1||(h1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Va.__exportStar(m5(),t)}(vu)),vu}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Va;e.__exportStar(p5(),t),e.__exportStar(g5(),t),e.__exportStar(w5(),t),e.__exportStar(o1(),t)})(ke);var St={};Object.defineProperty(St,"__esModule",{value:!0}),St.getLocalStorage=St.getLocalStorageOrThrow=St.getCrypto=St.getCryptoOrThrow=d1=St.getLocation=St.getLocationOrThrow=yu=St.getNavigator=St.getNavigatorOrThrow=f1=St.getDocument=St.getDocumentOrThrow=St.getFromWindowOrThrow=St.getFromWindow=void 0;function Fi(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}St.getFromWindow=Fi;function Os(t){const e=Fi(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}St.getFromWindowOrThrow=Os;function v5(){return Os("document")}St.getDocumentOrThrow=v5;function y5(){return Fi("document")}var f1=St.getDocument=y5;function b5(){return Os("navigator")}St.getNavigatorOrThrow=b5;function _5(){return Fi("navigator")}var yu=St.getNavigator=_5;function E5(){return Os("location")}St.getLocationOrThrow=E5;function x5(){return Fi("location")}var d1=St.getLocation=x5;function C5(){return Os("crypto")}St.getCryptoOrThrow=C5;function I5(){return Fi("crypto")}St.getCrypto=I5;function O5(){return Os("localStorage")}St.getLocalStorageOrThrow=O5;function A5(){return Fi("localStorage")}St.getLocalStorage=A5;var bu={};Object.defineProperty(bu,"__esModule",{value:!0});var p1=bu.getWindowMetadata=void 0;const g1=St;function S5(){let t,e;try{t=g1.getDocumentOrThrow(),e=g1.getLocationOrThrow()}catch{return null}function r(){const E=t.getElementsByTagName("link"),_=[];for(let A=0;A<E.length;A++){const P=E[A],U=P.getAttribute("rel");if(U&&U.toLowerCase().indexOf("icon")>-1){const H=P.getAttribute("href");if(H)if(H.toLowerCase().indexOf("https:")===-1&&H.toLowerCase().indexOf("http:")===-1&&H.indexOf("//")!==0){let G=e.protocol+"//"+e.host;if(H.indexOf("/")===0)G+=H;else{const N=e.pathname.split("/");N.pop();const L=N.join("/");G+=L+"/"+H}_.push(G)}else if(H.indexOf("//")===0){const G=e.protocol+H;_.push(G)}else _.push(H)}}return _}function n(...E){const _=t.getElementsByTagName("meta");for(let A=0;A<_.length;A++){const P=_[A],U=["itemprop","property","name"].map(H=>P.getAttribute(H)).filter(H=>H?E.includes(H):!1);if(U.length&&U){const H=P.getAttribute("content");if(H)return H}}return""}function i(){let E=n("name","og:site_name","og:title","twitter:title");return E||(E=t.title),E}function o(){return n("description","og:description","twitter:description","keywords")}const c=i(),l=o(),h=e.origin,d=r();return{description:l,url:h,icons:d,name:c}}p1=bu.getWindowMetadata=S5;var Io={},D5=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),m1="%[a-f0-9]{2}",w1=new RegExp("("+m1+")|([^%]+?)","gi"),v1=new RegExp("("+m1+")+","gi");function _u(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([],_u(r),_u(n))}function $5(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(w1)||[],r=1;r<e.length;r++)t=_u(e,r).join(""),e=t.match(w1)||[];return t}}function P5(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=v1.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=$5(r[0]);n!==r[0]&&(e[r[0]]=n)}r=v1.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var c=i[o];t=t.replace(new RegExp(c,"g"),e[c])}return t}var T5=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 P5(t)}},R5=(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)]},N5=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var c=n[o],l=t[c];(i?e.indexOf(c)!==-1:e(c,l,t))&&(r[c]=l)}return r};(function(t){const e=D5,r=T5,n=R5,i=N5,o=N=>N==null,c=Symbol("encodeFragmentIdentifier");function l(N){switch(N.arrayFormat){case"index":return L=>($,T)=>{const I=$.length;return T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,[v(L,N),"[",I,"]"].join("")]:[...$,[v(L,N),"[",v(I,N),"]=",v(T,N)].join("")]};case"bracket":return L=>($,T)=>T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,[v(L,N),"[]"].join("")]:[...$,[v(L,N),"[]=",v(T,N)].join("")];case"colon-list-separator":return L=>($,T)=>T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,[v(L,N),":list="].join("")]:[...$,[v(L,N),":list=",v(T,N)].join("")];case"comma":case"separator":case"bracket-separator":{const L=N.arrayFormat==="bracket-separator"?"[]=":"=";return $=>(T,I)=>I===void 0||N.skipNull&&I===null||N.skipEmptyString&&I===""?T:(I=I===null?"":I,T.length===0?[[v($,N),L,v(I,N)].join("")]:[[T,v(I,N)].join(N.arrayFormatSeparator)])}default:return L=>($,T)=>T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,v(L,N)]:[...$,[v(L,N),"=",v(T,N)].join("")]}}function h(N){let L;switch(N.arrayFormat){case"index":return($,T,I)=>{if(L=/\[(\d*)\]$/.exec($),$=$.replace(/\[\d*\]$/,""),!L){I[$]=T;return}I[$]===void 0&&(I[$]={}),I[$][L[1]]=T};case"bracket":return($,T,I)=>{if(L=/(\[\])$/.exec($),$=$.replace(/\[\]$/,""),!L){I[$]=T;return}if(I[$]===void 0){I[$]=[T];return}I[$]=[].concat(I[$],T)};case"colon-list-separator":return($,T,I)=>{if(L=/(:list)$/.exec($),$=$.replace(/:list$/,""),!L){I[$]=T;return}if(I[$]===void 0){I[$]=[T];return}I[$]=[].concat(I[$],T)};case"comma":case"separator":return($,T,I)=>{const f=typeof T=="string"&&T.includes(N.arrayFormatSeparator),x=typeof T=="string"&&!f&&E(T,N).includes(N.arrayFormatSeparator);T=x?E(T,N):T;const J=f||x?T.split(N.arrayFormatSeparator).map(z=>E(z,N)):T===null?T:E(T,N);I[$]=J};case"bracket-separator":return($,T,I)=>{const f=/(\[\])$/.test($);if($=$.replace(/\[\]$/,""),!f){I[$]=T&&E(T,N);return}const x=T===null?[]:T.split(N.arrayFormatSeparator).map(J=>E(J,N));if(I[$]===void 0){I[$]=x;return}I[$]=[].concat(I[$],x)};default:return($,T,I)=>{if(I[$]===void 0){I[$]=T;return}I[$]=[].concat(I[$],T)}}}function d(N){if(typeof N!="string"||N.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function v(N,L){return L.encode?L.strict?e(N):encodeURIComponent(N):N}function E(N,L){return L.decode?r(N):N}function _(N){return Array.isArray(N)?N.sort():typeof N=="object"?_(Object.keys(N)).sort((L,$)=>Number(L)-Number($)).map(L=>N[L]):N}function A(N){const L=N.indexOf("#");return L!==-1&&(N=N.slice(0,L)),N}function P(N){let L="";const $=N.indexOf("#");return $!==-1&&(L=N.slice($)),L}function U(N){N=A(N);const L=N.indexOf("?");return L===-1?"":N.slice(L+1)}function H(N,L){return L.parseNumbers&&!Number.isNaN(Number(N))&&typeof N=="string"&&N.trim()!==""?N=Number(N):L.parseBooleans&&N!==null&&(N.toLowerCase()==="true"||N.toLowerCase()==="false")&&(N=N.toLowerCase()==="true"),N}function G(N,L){L=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},L),d(L.arrayFormatSeparator);const $=h(L),T=Object.create(null);if(typeof N!="string"||(N=N.trim().replace(/^[?#&]/,""),!N))return T;for(const I of N.split("&")){if(I==="")continue;let[f,x]=n(L.decode?I.replace(/\+/g," "):I,"=");x=x===void 0?null:["comma","separator","bracket-separator"].includes(L.arrayFormat)?x:E(x,L),$(E(f,L),x,T)}for(const I of Object.keys(T)){const f=T[I];if(typeof f=="object"&&f!==null)for(const x of Object.keys(f))f[x]=H(f[x],L);else T[I]=H(f,L)}return L.sort===!1?T:(L.sort===!0?Object.keys(T).sort():Object.keys(T).sort(L.sort)).reduce((I,f)=>{const x=T[f];return Boolean(x)&&typeof x=="object"&&!Array.isArray(x)?I[f]=_(x):I[f]=x,I},Object.create(null))}t.extract=U,t.parse=G,t.stringify=(N,L)=>{if(!N)return"";L=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},L),d(L.arrayFormatSeparator);const $=x=>L.skipNull&&o(N[x])||L.skipEmptyString&&N[x]==="",T=l(L),I={};for(const x of Object.keys(N))$(x)||(I[x]=N[x]);const f=Object.keys(I);return L.sort!==!1&&f.sort(L.sort),f.map(x=>{const J=N[x];return J===void 0?"":J===null?v(x,L):Array.isArray(J)?J.length===0&&L.arrayFormat==="bracket-separator"?v(x,L)+"[]":J.reduce(T(x),[]).join("&"):v(x,L)+"="+v(J,L)}).filter(x=>x.length>0).join("&")},t.parseUrl=(N,L)=>{L=Object.assign({decode:!0},L);const[$,T]=n(N,"#");return Object.assign({url:$.split("?")[0]||"",query:G(U(N),L)},L&&L.parseFragmentIdentifier&&T?{fragmentIdentifier:E(T,L)}:{})},t.stringifyUrl=(N,L)=>{L=Object.assign({encode:!0,strict:!0,[c]:!0},L);const $=A(N.url).split("?")[0]||"",T=t.extract(N.url),I=t.parse(T,{sort:!1}),f=Object.assign(I,N.query);let x=t.stringify(f,L);x&&(x=`?${x}`);let J=P(N.url);return N.fragmentIdentifier&&(J=`#${L[c]?v(N.fragmentIdentifier,L):N.fragmentIdentifier}`),`${$}${x}${J}`},t.pick=(N,L,$)=>{$=Object.assign({parseFragmentIdentifier:!0,[c]:!1},$);const{url:T,query:I,fragmentIdentifier:f}=t.parseUrl(N,$);return t.stringifyUrl({url:T,query:i(I,L),fragmentIdentifier:f},$)},t.exclude=(N,L,$)=>{const T=Array.isArray(L)?I=>!L.includes(I):(I,f)=>!L(I,f);return t.pick(N,T,$)}})(Io);const L5={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 M5(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 y1(t,e){return t.includes(":")?[t]:e.chains||[]}const b1="base10",$r="base16",Eu="base64pad",xu="utf8",_1=0,Bi=1,U5=0,E1=1,Cu=12,Iu=32;function j5(){const t=ou.generateKeyPair();return{privateKey:Dr(t.secretKey,$r),publicKey:Dr(t.publicKey,$r)}}function Ou(){const t=Cs.randomBytes(Iu);return Dr(t,$r)}function F5(t,e){const r=ou.sharedKey(Hr(t,$r),Hr(e,$r)),n=new tv(Wa.SHA256,r).expand(Iu);return Dr(n,$r)}function B5(t){const e=Wa.hash(Hr(t,$r));return Dr(e,$r)}function As(t){const e=Wa.hash(Hr(t,xu));return Dr(e,$r)}function k5(t){return Hr(`${t}`,b1)}function Oo(t){return Number(Dr(t,b1))}function H5(t){const e=k5(typeof t.type<"u"?t.type:_1);if(Oo(e)===Bi&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Hr(t.senderPublicKey,$r):void 0,n=typeof t.iv<"u"?Hr(t.iv,$r):Cs.randomBytes(Cu),i=new Ql.ChaCha20Poly1305(Hr(t.symKey,$r)).seal(n,Hr(t.message,xu));return W5({type:e,sealed:i,iv:n,senderPublicKey:r})}function z5(t){const e=new Ql.ChaCha20Poly1305(Hr(t.symKey,$r)),{sealed:r,iv:n}=Ka(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Dr(i,xu)}function W5(t){if(Oo(t.type)===Bi){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Dr(cu([t.type,t.senderPublicKey,t.iv,t.sealed]),Eu)}return Dr(cu([t.type,t.iv,t.sealed]),Eu)}function Ka(t){const e=Hr(t,Eu),r=e.slice(U5,E1),n=E1;if(Oo(r)===Bi){const l=n+Iu,h=l+Cu,d=e.slice(n,l),v=e.slice(l,h),E=e.slice(h);return{type:r,sealed:E,iv:v,senderPublicKey:d}}const i=n+Cu,o=e.slice(n,i),c=e.slice(i);return{type:r,sealed:c,iv:o}}function q5(t,e){const r=Ka(t);return x1({type:Oo(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Dr(r.senderPublicKey,$r):void 0,receiverPublicKey:e?.receiverPublicKey})}function x1(t){const e=t?.type||_1;if(e===Bi){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 C1(t){return t.type===Bi&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var V5=Object.defineProperty,I1=Object.getOwnPropertySymbols,K5=Object.prototype.hasOwnProperty,G5=Object.prototype.propertyIsEnumerable,O1=(t,e,r)=>e in t?V5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A1=(t,e)=>{for(var r in e||(e={}))K5.call(e,r)&&O1(t,r,e[r]);if(I1)for(var r of I1(e))G5.call(e,r)&&O1(t,r,e[r]);return t};const Z5="ReactNative",ki={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Y5="js";function Au(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function S1(){return!f1()&&!!yu()&&navigator.product===Z5}function Su(){return!Au()&&!!yu()}function D1(){return S1()?ki.reactNative:Au()?ki.node:Su()?ki.browser:ki.unknown}function J5(t,e){let r=Io.parse(t);return r=A1(A1({},r),e),t=Io.stringify(r),t}function X5(){return p1()||{name:"",description:"",url:"",icons:[""]}}function Q5(){const t=Fy();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 eb(){var t;const e=D1();return e===ki.browser?[e,((t=d1())==null?void 0:t.host)||"unknown"].join(":"):e}function tb(t,e,r){const n=Q5(),i=eb();return[[t,e].join("-"),[Y5,r].join("-"),n,i].join("/")}function rb({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c}){const l=r.split("?"),h=tb(t,e,n),d={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0},v=J5(l[1]||"",d);return l[0]+"?"+v}function Hi(t,e){return t.filter(r=>e.includes(r)).length===t.length}function $1(t){return Object.fromEntries(t.entries())}function P1(t){return new Map(Object.entries(t))}function Ss(t=ke.FIVE_MINUTES,e){const r=ke.toMiliseconds(t||ke.FIVE_MINUTES);let n,i,o;return{resolve:c=>{o&&n&&(clearTimeout(o),n(c))},reject:c=>{o&&i&&(clearTimeout(o),i(c))},done:()=>new Promise((c,l)=>{o=setTimeout(()=>{l(new Error(e))},r),n=c,i=l})}}function Ga(t,e,r){return new Promise(async(n,i)=>{const o=setTimeout(()=>i(new Error(r)),e);try{const c=await t;n(c)}catch(c){i(c)}clearTimeout(o)})}function T1(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 nb(t){return T1("topic",t)}function ib(t){return T1("id",t)}function R1(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 $n(t,e){return ke.fromMiliseconds((e||Date.now())+ke.toMiliseconds(t))}function ui(t){return Date.now()>=ke.toMiliseconds(t)}function tr(t,e){return`${t}${e?`:${e}`:""}`}function Du(t=[],e=[]){return[...new Set([...t,...e])]}const sb="irn";function $u(t){return t?.relay||{protocol:sb}}function Za(t){const e=L5[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var ob=Object.defineProperty,N1=Object.getOwnPropertySymbols,ab=Object.prototype.hasOwnProperty,cb=Object.prototype.propertyIsEnumerable,L1=(t,e,r)=>e in t?ob(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lb=(t,e)=>{for(var r in e||(e={}))ab.call(e,r)&&L1(t,r,e[r]);if(N1)for(var r of N1(e))cb.call(e,r)&&L1(t,r,e[r]);return t};function ub(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const o=i.replace(n,""),c=t[i];r[o]=c}}),r}function hb(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("@"),o=typeof r<"u"?t.substring(r):"",c=Io.parse(o);return{protocol:n,topic:fb(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:ub(c)}}function fb(t){return t.startsWith("//")?t.substring(2):t}function db(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const o=r+e+i;t[i]&&(n[o]=t[i])}),n}function pb(t){return`${t.protocol}:${t.topic}@${t.version}?`+Io.stringify(lb({symKey:t.symKey},db(t.relay)))}function Ds(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function gb(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Ds(r.accounts))}),e}function mb(t,e){const r=[];return Object.values(t).forEach(n=>{Ds(n.accounts).includes(e)&&r.push(...n.methods)}),r}function wb(t,e){const r=[];return Object.values(t).forEach(n=>{Ds(n.accounts).includes(e)&&r.push(...n.events)}),r}function vb(t,e){const r=Ja(t,e);if(r)throw new Error(r.message);const n={};for(const[i,o]of Object.entries(t))n[i]={methods:o.methods,events:o.events,chains:o.accounts.map(c=>`${c.split(":")[0]}:${c.split(":")[1]}`)};return n}function M1(t){return t.includes(":")}function Ya(t){return M1(t)?t.split(":")[0]:t}const yb={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}},bb={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 _e(t,e){const{message:r,code:n}=bb[t];return{message:e?`${r} ${e}`:r,code:n}}function Zt(t,e){const{message:r,code:n}=yb[t];return{message:e?`${r} ${e}`:r,code:n}}function zn(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function $s(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Pr(t){return typeof t>"u"}function gr(t,e){return e&&Pr(t)?!0:typeof t=="string"&&Boolean(t.trim().length)}function Pu(t,e){return e&&Pr(t)?!0:typeof t=="number"&&!isNaN(t)}function _b(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return Hi(i,n)?(n.forEach(c=>{const{accounts:l,methods:h,events:d}=t.namespaces[c],v=Ds(l),E=r[c];(!Hi(y1(c,E),v)||!Hi(E.methods,h)||!Hi(E.events,d))&&(o=!1)}),o):!1}function Tu(t){return gr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Eb(t){if(gr(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Tu(r)}}return!1}function xb(t){if(gr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Cb(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Ib(t){return t?.topic}function Ob(t,e){let r=null;return gr(t?.publicKey,!1)||(r=_e("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function U1(t){let e=!0;return zn(t)?t.length&&(e=t.every(r=>gr(r,!1))):e=!1,e}function Ab(t,e,r){let n=null;return zn(e)?e.forEach(i=>{n||(!Tu(i)||!i.includes(t))&&(n=Zt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=Zt("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function Sb(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;const o=Ab(n,y1(n,i),`${e} requiredNamespace`);o&&(r=o)}),r}function Db(t,e){let r=null;return zn(t)?t.forEach(n=>{r||Eb(n)||(r=Zt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Zt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function $b(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Db(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function Pb(t,e){let r=null;return U1(t?.methods)?U1(t?.events)||(r=Zt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Zt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function j1(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Pb(n,`${e}, namespace`);i&&(r=i)}),r}function Tb(t,e,r){let n=null;if(t&&$s(t)){const i=j1(t,e);i&&(n=i);const o=Sb(t,e);o&&(n=o)}else n=_e("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function Ja(t,e){let r=null;if(t&&$s(t)){const n=j1(t,e);n&&(r=n);const i=$b(t,e);i&&(r=i)}else r=_e("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function F1(t){return gr(t.protocol,!0)}function Rb(t,e){let r=!1;return e&&!t?r=!0:t&&zn(t)&&t.length&&t.forEach(n=>{r=F1(n)}),r}function Nb(t){return typeof t=="number"}function zr(t){return typeof t<"u"&&typeof t!==null}function Lb(t){return!(!t||typeof t!="object"||!t.code||!Pu(t.code,!1)||!t.message||!gr(t.message,!1))}function Mb(t){return!(Pr(t)||!gr(t.method,!1))}function Ub(t){return!(Pr(t)||Pr(t.result)&&Pr(t.error)||!Pu(t.id,!1)||!gr(t.jsonrpc,!1))}function jb(t){return!(Pr(t)||!gr(t.name,!1))}function B1(t,e){return!(!Tu(e)||!gb(t).includes(e))}function Fb(t,e,r){return gr(r,!1)?mb(t,e).includes(r):!1}function Bb(t,e,r){return gr(r,!1)?wb(t,e).includes(r):!1}function k1(t,e,r){let n=null;const i=kb(t),o=Hb(e),c=Object.keys(i),l=Object.keys(o),h=H1(Object.keys(t)),d=H1(Object.keys(e)),v=h.filter(E=>!d.includes(E));return v.length&&(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
14
|
+
***************************************************************************** */var hu=function(t,e){return hu=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])},hu(t,e)};function zy(t,e){hu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var fu=function(){return fu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},fu.apply(this,arguments)};function Wy(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 qy(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function Vy(t,e){return function(r,n){e(r,n,t)}}function Ky(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Gy(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(E){c(E)}}function h(v){try{d(n.throw(v))}catch(E){c(E)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function Zy(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Yy(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Jy(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function du(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 e1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function Xy(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(e1(arguments[e]));return t}function Qy(){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 o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function _o(t){return this instanceof _o?(this.v=t,this):new _o(t)}function e5(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,U){o.push([_,A,P,U])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof _o?Promise.resolve(_.value.v).then(d,v):E(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function E(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function t5(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:_o(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function r5(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 du=="function"?du(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function n5(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function i5(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 s5(t){return t&&t.__esModule?t:{default:t}}function o5(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function a5(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 c5=Object.freeze({__proto__:null,__extends:zy,get __assign(){return fu},__rest:Wy,__decorate:qy,__param:Vy,__metadata:Ky,__awaiter:Gy,__generator:Zy,__createBinding:Yy,__exportStar:Jy,__values:du,__read:e1,__spread:Xy,__spreadArrays:Qy,__await:_o,__asyncGenerator:e5,__asyncDelegator:t5,__asyncValues:r5,__makeTemplateObject:n5,__importStar:i5,__importDefault:s5,__classPrivateFieldGet:o5,__classPrivateFieldSet:a5}),qa=Mi(c5),pu={},Eo={},t1;function l5(){if(t1)return Eo;t1=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Eo.delay=t,Eo}var Ui={},gu={},ji={},r1;function u5(){return r1||(r1=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.ONE_THOUSAND=ji.ONE_HUNDRED=void 0,ji.ONE_HUNDRED=100,ji.ONE_THOUSAND=1e3),ji}var mu={},n1;function h5(){return n1||(n1=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}(mu)),mu}var i1;function s1(){return i1||(i1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qa;e.__exportStar(u5(),t),e.__exportStar(h5(),t)}(gu)),gu}var o1;function f5(){if(o1)return Ui;o1=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.fromMiliseconds=Ui.toMiliseconds=void 0;const t=s1();function e(n){return n*t.ONE_THOUSAND}Ui.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Ui.fromMiliseconds=r,Ui}var a1;function d5(){return a1||(a1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qa;e.__exportStar(l5(),t),e.__exportStar(f5(),t)}(pu)),pu}var Cs={},c1;function p5(){if(c1)return Cs;c1=1,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.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 Cs.Watch=t,Cs.default=t,Cs}var wu={},xo={},l1;function g5(){if(l1)return xo;l1=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.IWatch=void 0;class t{}return xo.IWatch=t,xo}var u1;function m5(){return u1||(u1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),qa.__exportStar(g5(),t)}(wu)),wu}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qa;e.__exportStar(d5(),t),e.__exportStar(p5(),t),e.__exportStar(m5(),t),e.__exportStar(s1(),t)})(ke);var St={};Object.defineProperty(St,"__esModule",{value:!0}),St.getLocalStorage=St.getLocalStorageOrThrow=St.getCrypto=St.getCryptoOrThrow=f1=St.getLocation=St.getLocationOrThrow=vu=St.getNavigator=St.getNavigatorOrThrow=h1=St.getDocument=St.getDocumentOrThrow=St.getFromWindowOrThrow=St.getFromWindow=void 0;function Fi(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}St.getFromWindow=Fi;function Is(t){const e=Fi(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}St.getFromWindowOrThrow=Is;function w5(){return Is("document")}St.getDocumentOrThrow=w5;function v5(){return Fi("document")}var h1=St.getDocument=v5;function y5(){return Is("navigator")}St.getNavigatorOrThrow=y5;function b5(){return Fi("navigator")}var vu=St.getNavigator=b5;function _5(){return Is("location")}St.getLocationOrThrow=_5;function E5(){return Fi("location")}var f1=St.getLocation=E5;function x5(){return Is("crypto")}St.getCryptoOrThrow=x5;function C5(){return Fi("crypto")}St.getCrypto=C5;function I5(){return Is("localStorage")}St.getLocalStorageOrThrow=I5;function O5(){return Fi("localStorage")}St.getLocalStorage=O5;var yu={};Object.defineProperty(yu,"__esModule",{value:!0});var d1=yu.getWindowMetadata=void 0;const p1=St;function A5(){let t,e;try{t=p1.getDocumentOrThrow(),e=p1.getLocationOrThrow()}catch{return null}function r(){const E=t.getElementsByTagName("link"),_=[];for(let A=0;A<E.length;A++){const P=E[A],U=P.getAttribute("rel");if(U&&U.toLowerCase().indexOf("icon")>-1){const H=P.getAttribute("href");if(H)if(H.toLowerCase().indexOf("https:")===-1&&H.toLowerCase().indexOf("http:")===-1&&H.indexOf("//")!==0){let G=e.protocol+"//"+e.host;if(H.indexOf("/")===0)G+=H;else{const N=e.pathname.split("/");N.pop();const L=N.join("/");G+=L+"/"+H}_.push(G)}else if(H.indexOf("//")===0){const G=e.protocol+H;_.push(G)}else _.push(H)}}return _}function n(...E){const _=t.getElementsByTagName("meta");for(let A=0;A<_.length;A++){const P=_[A],U=["itemprop","property","name"].map(H=>P.getAttribute(H)).filter(H=>H?E.includes(H):!1);if(U.length&&U){const H=P.getAttribute("content");if(H)return H}}return""}function i(){let E=n("name","og:site_name","og:title","twitter:title");return E||(E=t.title),E}function o(){return n("description","og:description","twitter:description","keywords")}const c=i(),l=o(),h=e.origin,d=r();return{description:l,url:h,icons:d,name:c}}d1=yu.getWindowMetadata=A5;var Co={},S5=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),g1="%[a-f0-9]{2}",m1=new RegExp("("+g1+")|([^%]+?)","gi"),w1=new RegExp("("+g1+")+","gi");function bu(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([],bu(r),bu(n))}function D5(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(m1)||[],r=1;r<e.length;r++)t=bu(e,r).join(""),e=t.match(m1)||[];return t}}function $5(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=w1.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=D5(r[0]);n!==r[0]&&(e[r[0]]=n)}r=w1.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var c=i[o];t=t.replace(new RegExp(c,"g"),e[c])}return t}var P5=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 $5(t)}},T5=(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)]},R5=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var c=n[o],l=t[c];(i?e.indexOf(c)!==-1:e(c,l,t))&&(r[c]=l)}return r};(function(t){const e=S5,r=P5,n=T5,i=R5,o=N=>N==null,c=Symbol("encodeFragmentIdentifier");function l(N){switch(N.arrayFormat){case"index":return L=>($,T)=>{const I=$.length;return T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,[v(L,N),"[",I,"]"].join("")]:[...$,[v(L,N),"[",v(I,N),"]=",v(T,N)].join("")]};case"bracket":return L=>($,T)=>T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,[v(L,N),"[]"].join("")]:[...$,[v(L,N),"[]=",v(T,N)].join("")];case"colon-list-separator":return L=>($,T)=>T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,[v(L,N),":list="].join("")]:[...$,[v(L,N),":list=",v(T,N)].join("")];case"comma":case"separator":case"bracket-separator":{const L=N.arrayFormat==="bracket-separator"?"[]=":"=";return $=>(T,I)=>I===void 0||N.skipNull&&I===null||N.skipEmptyString&&I===""?T:(I=I===null?"":I,T.length===0?[[v($,N),L,v(I,N)].join("")]:[[T,v(I,N)].join(N.arrayFormatSeparator)])}default:return L=>($,T)=>T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,v(L,N)]:[...$,[v(L,N),"=",v(T,N)].join("")]}}function h(N){let L;switch(N.arrayFormat){case"index":return($,T,I)=>{if(L=/\[(\d*)\]$/.exec($),$=$.replace(/\[\d*\]$/,""),!L){I[$]=T;return}I[$]===void 0&&(I[$]={}),I[$][L[1]]=T};case"bracket":return($,T,I)=>{if(L=/(\[\])$/.exec($),$=$.replace(/\[\]$/,""),!L){I[$]=T;return}if(I[$]===void 0){I[$]=[T];return}I[$]=[].concat(I[$],T)};case"colon-list-separator":return($,T,I)=>{if(L=/(:list)$/.exec($),$=$.replace(/:list$/,""),!L){I[$]=T;return}if(I[$]===void 0){I[$]=[T];return}I[$]=[].concat(I[$],T)};case"comma":case"separator":return($,T,I)=>{const f=typeof T=="string"&&T.includes(N.arrayFormatSeparator),x=typeof T=="string"&&!f&&E(T,N).includes(N.arrayFormatSeparator);T=x?E(T,N):T;const J=f||x?T.split(N.arrayFormatSeparator).map(z=>E(z,N)):T===null?T:E(T,N);I[$]=J};case"bracket-separator":return($,T,I)=>{const f=/(\[\])$/.test($);if($=$.replace(/\[\]$/,""),!f){I[$]=T&&E(T,N);return}const x=T===null?[]:T.split(N.arrayFormatSeparator).map(J=>E(J,N));if(I[$]===void 0){I[$]=x;return}I[$]=[].concat(I[$],x)};default:return($,T,I)=>{if(I[$]===void 0){I[$]=T;return}I[$]=[].concat(I[$],T)}}}function d(N){if(typeof N!="string"||N.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function v(N,L){return L.encode?L.strict?e(N):encodeURIComponent(N):N}function E(N,L){return L.decode?r(N):N}function _(N){return Array.isArray(N)?N.sort():typeof N=="object"?_(Object.keys(N)).sort((L,$)=>Number(L)-Number($)).map(L=>N[L]):N}function A(N){const L=N.indexOf("#");return L!==-1&&(N=N.slice(0,L)),N}function P(N){let L="";const $=N.indexOf("#");return $!==-1&&(L=N.slice($)),L}function U(N){N=A(N);const L=N.indexOf("?");return L===-1?"":N.slice(L+1)}function H(N,L){return L.parseNumbers&&!Number.isNaN(Number(N))&&typeof N=="string"&&N.trim()!==""?N=Number(N):L.parseBooleans&&N!==null&&(N.toLowerCase()==="true"||N.toLowerCase()==="false")&&(N=N.toLowerCase()==="true"),N}function G(N,L){L=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},L),d(L.arrayFormatSeparator);const $=h(L),T=Object.create(null);if(typeof N!="string"||(N=N.trim().replace(/^[?#&]/,""),!N))return T;for(const I of N.split("&")){if(I==="")continue;let[f,x]=n(L.decode?I.replace(/\+/g," "):I,"=");x=x===void 0?null:["comma","separator","bracket-separator"].includes(L.arrayFormat)?x:E(x,L),$(E(f,L),x,T)}for(const I of Object.keys(T)){const f=T[I];if(typeof f=="object"&&f!==null)for(const x of Object.keys(f))f[x]=H(f[x],L);else T[I]=H(f,L)}return L.sort===!1?T:(L.sort===!0?Object.keys(T).sort():Object.keys(T).sort(L.sort)).reduce((I,f)=>{const x=T[f];return x&&typeof x=="object"&&!Array.isArray(x)?I[f]=_(x):I[f]=x,I},Object.create(null))}t.extract=U,t.parse=G,t.stringify=(N,L)=>{if(!N)return"";L=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},L),d(L.arrayFormatSeparator);const $=x=>L.skipNull&&o(N[x])||L.skipEmptyString&&N[x]==="",T=l(L),I={};for(const x of Object.keys(N))$(x)||(I[x]=N[x]);const f=Object.keys(I);return L.sort!==!1&&f.sort(L.sort),f.map(x=>{const J=N[x];return J===void 0?"":J===null?v(x,L):Array.isArray(J)?J.length===0&&L.arrayFormat==="bracket-separator"?v(x,L)+"[]":J.reduce(T(x),[]).join("&"):v(x,L)+"="+v(J,L)}).filter(x=>x.length>0).join("&")},t.parseUrl=(N,L)=>{L=Object.assign({decode:!0},L);const[$,T]=n(N,"#");return Object.assign({url:$.split("?")[0]||"",query:G(U(N),L)},L&&L.parseFragmentIdentifier&&T?{fragmentIdentifier:E(T,L)}:{})},t.stringifyUrl=(N,L)=>{L=Object.assign({encode:!0,strict:!0,[c]:!0},L);const $=A(N.url).split("?")[0]||"",T=t.extract(N.url),I=t.parse(T,{sort:!1}),f=Object.assign(I,N.query);let x=t.stringify(f,L);x&&(x=`?${x}`);let J=P(N.url);return N.fragmentIdentifier&&(J=`#${L[c]?v(N.fragmentIdentifier,L):N.fragmentIdentifier}`),`${$}${x}${J}`},t.pick=(N,L,$)=>{$=Object.assign({parseFragmentIdentifier:!0,[c]:!1},$);const{url:T,query:I,fragmentIdentifier:f}=t.parseUrl(N,$);return t.stringifyUrl({url:T,query:i(I,L),fragmentIdentifier:f},$)},t.exclude=(N,L,$)=>{const T=Array.isArray(L)?I=>!L.includes(I):(I,f)=>!L(I,f);return t.pick(N,T,$)}})(Co);const N5={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 L5(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 v1(t,e){return t.includes(":")?[t]:e.chains||[]}const y1="base10",$r="base16",_u="base64pad",Eu="utf8",b1=0,Bi=1,M5=0,_1=1,xu=12,Cu=32;function U5(){const t=su.generateKeyPair();return{privateKey:Dr(t.secretKey,$r),publicKey:Dr(t.publicKey,$r)}}function Iu(){const t=xs.randomBytes(Cu);return Dr(t,$r)}function j5(t,e){const r=su.sharedKey(Hr(t,$r),Hr(e,$r)),n=new ev(za.SHA256,r).expand(Cu);return Dr(n,$r)}function F5(t){const e=za.hash(Hr(t,$r));return Dr(e,$r)}function Os(t){const e=za.hash(Hr(t,Eu));return Dr(e,$r)}function B5(t){return Hr(`${t}`,y1)}function Io(t){return Number(Dr(t,y1))}function k5(t){const e=B5(typeof t.type<"u"?t.type:b1);if(Io(e)===Bi&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Hr(t.senderPublicKey,$r):void 0,n=typeof t.iv<"u"?Hr(t.iv,$r):xs.randomBytes(xu),i=new Xl.ChaCha20Poly1305(Hr(t.symKey,$r)).seal(n,Hr(t.message,Eu));return z5({type:e,sealed:i,iv:n,senderPublicKey:r})}function H5(t){const e=new Xl.ChaCha20Poly1305(Hr(t.symKey,$r)),{sealed:r,iv:n}=Va(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Dr(i,Eu)}function z5(t){if(Io(t.type)===Bi){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Dr(au([t.type,t.senderPublicKey,t.iv,t.sealed]),_u)}return Dr(au([t.type,t.iv,t.sealed]),_u)}function Va(t){const e=Hr(t,_u),r=e.slice(M5,_1),n=_1;if(Io(r)===Bi){const l=n+Cu,h=l+xu,d=e.slice(n,l),v=e.slice(l,h),E=e.slice(h);return{type:r,sealed:E,iv:v,senderPublicKey:d}}const i=n+xu,o=e.slice(n,i),c=e.slice(i);return{type:r,sealed:c,iv:o}}function W5(t,e){const r=Va(t);return E1({type:Io(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Dr(r.senderPublicKey,$r):void 0,receiverPublicKey:e?.receiverPublicKey})}function E1(t){const e=t?.type||b1;if(e===Bi){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 x1(t){return t.type===Bi&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var q5=Object.defineProperty,C1=Object.getOwnPropertySymbols,V5=Object.prototype.hasOwnProperty,K5=Object.prototype.propertyIsEnumerable,I1=(t,e,r)=>e in t?q5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,O1=(t,e)=>{for(var r in e||(e={}))V5.call(e,r)&&I1(t,r,e[r]);if(C1)for(var r of C1(e))K5.call(e,r)&&I1(t,r,e[r]);return t};const G5="ReactNative",ki={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Z5="js";function Ou(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function A1(){return!h1()&&!!vu()&&navigator.product===G5}function Au(){return!Ou()&&!!vu()}function S1(){return A1()?ki.reactNative:Ou()?ki.node:Au()?ki.browser:ki.unknown}function Y5(t,e){let r=Co.parse(t);return r=O1(O1({},r),e),t=Co.stringify(r),t}function J5(){return d1()||{name:"",description:"",url:"",icons:[""]}}function X5(){const t=jy();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 Q5(){var t;const e=S1();return e===ki.browser?[e,((t=f1())==null?void 0:t.host)||"unknown"].join(":"):e}function eb(t,e,r){const n=X5(),i=Q5();return[[t,e].join("-"),[Z5,r].join("-"),n,i].join("/")}function tb({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c}){const l=r.split("?"),h=eb(t,e,n),d={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0},v=Y5(l[1]||"",d);return l[0]+"?"+v}function Hi(t,e){return t.filter(r=>e.includes(r)).length===t.length}function D1(t){return Object.fromEntries(t.entries())}function $1(t){return new Map(Object.entries(t))}function As(t=ke.FIVE_MINUTES,e){const r=ke.toMiliseconds(t||ke.FIVE_MINUTES);let n,i,o;return{resolve:c=>{o&&n&&(clearTimeout(o),n(c))},reject:c=>{o&&i&&(clearTimeout(o),i(c))},done:()=>new Promise((c,l)=>{o=setTimeout(()=>{l(new Error(e))},r),n=c,i=l})}}function Ka(t,e,r){return new Promise(async(n,i)=>{const o=setTimeout(()=>i(new Error(r)),e);try{const c=await t;n(c)}catch(c){i(c)}clearTimeout(o)})}function P1(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 rb(t){return P1("topic",t)}function nb(t){return P1("id",t)}function T1(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 $n(t,e){return ke.fromMiliseconds((e||Date.now())+ke.toMiliseconds(t))}function ui(t){return Date.now()>=ke.toMiliseconds(t)}function tr(t,e){return`${t}${e?`:${e}`:""}`}function Su(t=[],e=[]){return[...new Set([...t,...e])]}async function ib({id:t,topic:e,store:r}){try{const n=await r.getItem("WALLETCONNECT_DEEPLINK_CHOICE");if(!n)return;const i=typeof n=="string"?JSON.parse(n):n;let o=i?.href;if(typeof o!="string")return;o.endsWith("/")&&(o=o.slice(0,-1));const c=`${o}/wc?requestId=${t}&sessionTopic=${e}`,l=S1();l===ki.browser?window.open(c,"_self","noreferrer noopener"):l===ki.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(c)}catch(n){console.error(n)}}const sb="irn";function Du(t){return t?.relay||{protocol:sb}}function Ga(t){const e=N5[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var ob=Object.defineProperty,R1=Object.getOwnPropertySymbols,ab=Object.prototype.hasOwnProperty,cb=Object.prototype.propertyIsEnumerable,N1=(t,e,r)=>e in t?ob(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lb=(t,e)=>{for(var r in e||(e={}))ab.call(e,r)&&N1(t,r,e[r]);if(R1)for(var r of R1(e))cb.call(e,r)&&N1(t,r,e[r]);return t};function ub(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const o=i.replace(n,""),c=t[i];r[o]=c}}),r}function hb(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("@"),o=typeof r<"u"?t.substring(r):"",c=Co.parse(o);return{protocol:n,topic:fb(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:ub(c)}}function fb(t){return t.startsWith("//")?t.substring(2):t}function db(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const o=r+e+i;t[i]&&(n[o]=t[i])}),n}function pb(t){return`${t.protocol}:${t.topic}@${t.version}?`+Co.stringify(lb({symKey:t.symKey},db(t.relay)))}function Ss(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function gb(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Ss(r.accounts))}),e}function mb(t,e){const r=[];return Object.values(t).forEach(n=>{Ss(n.accounts).includes(e)&&r.push(...n.methods)}),r}function wb(t,e){const r=[];return Object.values(t).forEach(n=>{Ss(n.accounts).includes(e)&&r.push(...n.events)}),r}function vb(t,e){const r=Ya(t,e);if(r)throw new Error(r.message);const n={};for(const[i,o]of Object.entries(t))n[i]={methods:o.methods,events:o.events,chains:o.accounts.map(c=>`${c.split(":")[0]}:${c.split(":")[1]}`)};return n}function L1(t){return t.includes(":")}function Za(t){return L1(t)?t.split(":")[0]:t}const yb={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}},bb={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 _e(t,e){const{message:r,code:n}=bb[t];return{message:e?`${r} ${e}`:r,code:n}}function Zt(t,e){const{message:r,code:n}=yb[t];return{message:e?`${r} ${e}`:r,code:n}}function zn(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Ds(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Pr(t){return typeof t>"u"}function gr(t,e){return e&&Pr(t)?!0:typeof t=="string"&&!!t.trim().length}function $u(t,e){return e&&Pr(t)?!0:typeof t=="number"&&!isNaN(t)}function _b(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return Hi(i,n)?(n.forEach(c=>{const{accounts:l,methods:h,events:d}=t.namespaces[c],v=Ss(l),E=r[c];(!Hi(v1(c,E),v)||!Hi(E.methods,h)||!Hi(E.events,d))&&(o=!1)}),o):!1}function Pu(t){return gr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Eb(t){if(gr(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Pu(r)}}return!1}function xb(t){if(gr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Cb(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Ib(t){return t?.topic}function Ob(t,e){let r=null;return gr(t?.publicKey,!1)||(r=_e("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function M1(t){let e=!0;return zn(t)?t.length&&(e=t.every(r=>gr(r,!1))):e=!1,e}function Ab(t,e,r){let n=null;return zn(e)?e.forEach(i=>{n||(!Pu(i)||!i.includes(t))&&(n=Zt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=Zt("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function Sb(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;const o=Ab(n,v1(n,i),`${e} requiredNamespace`);o&&(r=o)}),r}function Db(t,e){let r=null;return zn(t)?t.forEach(n=>{r||Eb(n)||(r=Zt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Zt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function $b(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Db(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function Pb(t,e){let r=null;return M1(t?.methods)?M1(t?.events)||(r=Zt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Zt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function U1(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Pb(n,`${e}, namespace`);i&&(r=i)}),r}function Tb(t,e,r){let n=null;if(t&&Ds(t)){const i=U1(t,e);i&&(n=i);const o=Sb(t,e);o&&(n=o)}else n=_e("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function Ya(t,e){let r=null;if(t&&Ds(t)){const n=U1(t,e);n&&(r=n);const i=$b(t,e);i&&(r=i)}else r=_e("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function j1(t){return gr(t.protocol,!0)}function Rb(t,e){let r=!1;return e&&!t?r=!0:t&&zn(t)&&t.length&&t.forEach(n=>{r=j1(n)}),r}function Nb(t){return typeof t=="number"}function zr(t){return typeof t<"u"&&typeof t!==null}function Lb(t){return!(!t||typeof t!="object"||!t.code||!$u(t.code,!1)||!t.message||!gr(t.message,!1))}function Mb(t){return!(Pr(t)||!gr(t.method,!1))}function Ub(t){return!(Pr(t)||Pr(t.result)&&Pr(t.error)||!$u(t.id,!1)||!gr(t.jsonrpc,!1))}function jb(t){return!(Pr(t)||!gr(t.name,!1))}function F1(t,e){return!(!Pu(e)||!gb(t).includes(e))}function Fb(t,e,r){return gr(r,!1)?mb(t,e).includes(r):!1}function Bb(t,e,r){return gr(r,!1)?wb(t,e).includes(r):!1}function B1(t,e,r){let n=null;const i=kb(t),o=Hb(e),c=Object.keys(i),l=Object.keys(o),h=k1(Object.keys(t)),d=k1(Object.keys(e)),v=h.filter(E=>!d.includes(E));return v.length&&(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
15
15
|
Required: ${v.toString()}
|
|
16
16
|
Received: ${Object.keys(e).toString()}`)),Hi(c,l)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
|
|
17
17
|
Required: ${c.toString()}
|
|
18
|
-
Approved: ${l.toString()}`)),Object.keys(e).forEach(E=>{if(!E.includes(":")||n)return;const _=
|
|
18
|
+
Approved: ${l.toString()}`)),Object.keys(e).forEach(E=>{if(!E.includes(":")||n)return;const _=Ss(e[E].accounts);_.includes(E)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${E}
|
|
19
19
|
Required: ${E}
|
|
20
|
-
Approved: ${_.toString()}`))}),c.forEach(E=>{n||(Hi(i[E].methods,o[E].methods)?Hi(i[E].events,o[E].events)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${E}`)):n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${E}`))}),n}function kb(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function
|
|
20
|
+
Approved: ${_.toString()}`))}),c.forEach(E=>{n||(Hi(i[E].methods,o[E].methods)?Hi(i[E].events,o[E].events)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${E}`)):n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${E}`))}),n}function kb(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function k1(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function Hb(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Ss(t[r].accounts);n?.forEach(i=>{e[i]={accounts:t[r].accounts.filter(o=>o.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function zb(t,e){return $u(t,!1)&&t<=e.max&&t>=e.min}var Ja={};/*! *****************************************************************************
|
|
21
21
|
Copyright (c) Microsoft Corporation.
|
|
22
22
|
|
|
23
23
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
31
31
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
32
32
|
PERFORMANCE OF THIS SOFTWARE.
|
|
33
|
-
***************************************************************************** */var
|
|
33
|
+
***************************************************************************** */var Tu=function(t,e){return Tu=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])},Tu(t,e)};function Wb(t,e){Tu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Ru=function(){return Ru=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Ru.apply(this,arguments)};function qb(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 Vb(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function Kb(t,e){return function(r,n){e(r,n,t)}}function Gb(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Zb(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(E){c(E)}}function h(v){try{d(n.throw(v))}catch(E){c(E)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function Yb(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Jb(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Xb(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Nu(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 H1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function Qb(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(H1(arguments[e]));return t}function e6(){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 o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Oo(t){return this instanceof Oo?(this.v=t,this):new Oo(t)}function t6(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,U){o.push([_,A,P,U])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Oo?Promise.resolve(_.value.v).then(d,v):E(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function E(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function r6(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:Oo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function n6(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 Nu=="function"?Nu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function i6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function s6(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 o6(t){return t&&t.__esModule?t:{default:t}}function a6(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function c6(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 l6=Object.freeze({__proto__:null,__extends:Wb,get __assign(){return Ru},__rest:qb,__decorate:Vb,__param:Kb,__metadata:Gb,__awaiter:Zb,__generator:Yb,__createBinding:Jb,__exportStar:Xb,__values:Nu,__read:H1,__spread:Qb,__spreadArrays:e6,__await:Oo,__asyncGenerator:t6,__asyncDelegator:r6,__asyncValues:n6,__makeTemplateObject:i6,__importStar:s6,__importDefault:o6,__classPrivateFieldGet:a6,__classPrivateFieldSet:c6}),z1=Mi(l6),Ao={};Object.defineProperty(Ao,"__esModule",{value:!0});function u6(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}}Ao.safeJsonParse=u6;function h6(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}Ao.safeJsonStringify=h6;var So={exports:{}},W1;function f6(){return W1||(W1=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 pr<"u"&&pr.localStorage?So.exports=pr.localStorage:typeof window<"u"&&window.localStorage?So.exports=window.localStorage:So.exports=new e}()),So.exports}var Lu={},Do={},q1;function d6(){if(q1)return Do;q1=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.IKeyValueStorage=void 0;class t{}return Do.IKeyValueStorage=t,Do}var $o={},V1;function p6(){if(V1)return $o;V1=1,Object.defineProperty($o,"__esModule",{value:!0}),$o.parseEntry=void 0;const t=Ao;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return $o.parseEntry=e,$o}var K1;function g6(){return K1||(K1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=z1;e.__exportStar(d6(),t),e.__exportStar(p6(),t)}(Lu)),Lu}Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.KeyValueStorage=void 0;const $s=z1,G1=Ao,m6=$s.__importDefault(f6()),w6=g6();class Z1{constructor(){this.localStorage=m6.default}getKeys(){return $s.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return $s.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(w6.parseEntry)})}getItem(e){return $s.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return G1.safeJsonParse(r)})}setItem(e,r){return $s.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,G1.safeJsonStringify(r))})}removeItem(e){return $s.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}Ja.KeyValueStorage=Z1;var v6=Ja.default=Z1,Po={};/*! *****************************************************************************
|
|
34
34
|
Copyright (c) Microsoft Corporation.
|
|
35
35
|
|
|
36
36
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
44
44
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
45
45
|
PERFORMANCE OF THIS SOFTWARE.
|
|
46
|
-
***************************************************************************** */var
|
|
46
|
+
***************************************************************************** */var Mu=function(t,e){return Mu=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])},Mu(t,e)};function y6(t,e){Mu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Uu=function(){return Uu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Uu.apply(this,arguments)};function b6(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function _6(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function E6(t,e){return function(r,n){e(r,n,t)}}function x6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function C6(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(E){c(E)}}function h(v){try{d(n.throw(v))}catch(E){c(E)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function I6(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function O6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function A6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ju(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 Y1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function S6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Y1(arguments[e]));return t}function D6(){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 o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function To(t){return this instanceof To?(this.v=t,this):new To(t)}function $6(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,U){o.push([_,A,P,U])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof To?Promise.resolve(_.value.v).then(d,v):E(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function E(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function P6(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:To(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function T6(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 ju=="function"?ju(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function R6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function N6(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 L6(t){return t&&t.__esModule?t:{default:t}}function M6(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function U6(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 j6=Object.freeze({__proto__:null,__extends:y6,get __assign(){return Uu},__rest:b6,__decorate:_6,__param:E6,__metadata:x6,__awaiter:C6,__generator:I6,__createBinding:O6,__exportStar:A6,__values:ju,__read:Y1,__spread:S6,__spreadArrays:D6,__await:To,__asyncGenerator:$6,__asyncDelegator:P6,__asyncValues:T6,__makeTemplateObject:R6,__importStar:N6,__importDefault:L6,__classPrivateFieldGet:M6,__classPrivateFieldSet:U6}),Xa=Mi(j6),Ro={},Fu={},No={};class zi{}var F6=Object.freeze({__proto__:null,IEvents:zi}),B6=Mi(F6),J1;function k6(){if(J1)return No;J1=1,Object.defineProperty(No,"__esModule",{value:!0}),No.IHeartBeat=void 0;const t=B6;class e extends t.IEvents{constructor(n){super()}}return No.IHeartBeat=e,No}var X1;function Q1(){return X1||(X1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Xa.__exportStar(k6(),t)}(Fu)),Fu}var Bu={},Wi={},ep;function H6(){if(ep)return Wi;ep=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.HEARTBEAT_EVENTS=Wi.HEARTBEAT_INTERVAL=void 0;const t=ke;return Wi.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Wi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Wi}var tp;function rp(){return tp||(tp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Xa.__exportStar(H6(),t)}(Bu)),Bu}var np;function z6(){if(np)return Ro;np=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.HeartBeat=void 0;const t=Xa,e=br.exports,r=ke,n=Q1(),i=rp();class o extends n.IHeartBeat{constructor(l){super(l),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=l?.interval||i.HEARTBEAT_INTERVAL}static init(l){return t.__awaiter(this,void 0,void 0,function*(){const h=new o(l);return yield h.init(),h})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(l,h){this.events.on(l,h)}once(l,h){this.events.once(l,h)}off(l,h){this.events.off(l,h)}removeListener(l,h){this.events.removeListener(l,h)}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 Ro.HeartBeat=o,Ro}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xa;e.__exportStar(z6(),t),e.__exportStar(Q1(),t),e.__exportStar(rp(),t)})(Po);var pt={};/*! *****************************************************************************
|
|
47
47
|
Copyright (c) Microsoft Corporation.
|
|
48
48
|
|
|
49
49
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
57
57
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
58
58
|
PERFORMANCE OF THIS SOFTWARE.
|
|
59
|
-
***************************************************************************** */var Hu=function(t,e){return Hu=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])},Hu(t,e)};function W6(t,e){Hu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var zu=function(){return zu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},zu.apply(this,arguments)};function q6(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 V6(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function K6(t,e){return function(r,n){e(r,n,t)}}function G6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Z6(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(E){c(E)}}function h(v){try{d(n.throw(v))}catch(E){c(E)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function Y6(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function J6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function X6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Wu(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 sp(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function Q6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(sp(arguments[e]));return t}function e4(){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 o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Mo(t){return this instanceof Mo?(this.v=t,this):new Mo(t)}function t4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,U){o.push([_,A,P,U])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Mo?Promise.resolve(_.value.v).then(d,v):E(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function E(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function r4(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:Mo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function n4(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 Wu=="function"?Wu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function i4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function s4(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 o4(t){return t&&t.__esModule?t:{default:t}}function a4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function c4(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 l4=Object.freeze({__proto__:null,__extends:W6,get __assign(){return zu},__rest:q6,__decorate:V6,__param:K6,__metadata:G6,__awaiter:Z6,__generator:Y6,__createBinding:J6,__exportStar:X6,__values:Wu,__read:sp,__spread:Q6,__spreadArrays:e4,__await:Mo,__asyncGenerator:t4,__asyncDelegator:r4,__asyncValues:n4,__makeTemplateObject:i4,__importStar:s4,__importDefault:o4,__classPrivateFieldGet:a4,__classPrivateFieldSet:c4}),u4=Mi(l4),qu,op;function h4(){if(op)return qu;op=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}qu=e;function e(r,n,i){var o=i&&i.stringify||t,c=1;if(typeof r=="object"&&r!==null){var l=n.length+c;if(l===1)return r;var h=new Array(l);h[0]=o(r);for(var d=1;d<l;d++)h[d]=o(n[d]);return h.join(" ")}if(typeof r!="string")return r;var v=n.length;if(v===0)return r;for(var E="",_=1-c,A=-1,P=r&&r.length||0,U=0;U<P;){if(r.charCodeAt(U)===37&&U+1<P){switch(A=A>-1?A:0,r.charCodeAt(U+1)){case 100:case 102:if(_>=v||n[_]==null)break;A<U&&(E+=r.slice(A,U)),E+=Number(n[_]),A=U+2,U++;break;case 105:if(_>=v||n[_]==null)break;A<U&&(E+=r.slice(A,U)),E+=Math.floor(Number(n[_])),A=U+2,U++;break;case 79:case 111:case 106:if(_>=v||n[_]===void 0)break;A<U&&(E+=r.slice(A,U));var H=typeof n[_];if(H==="string"){E+="'"+n[_]+"'",A=U+2,U++;break}if(H==="function"){E+=n[_].name||"<anonymous>",A=U+2,U++;break}E+=o(n[_]),A=U+2,U++;break;case 115:if(_>=v)break;A<U&&(E+=r.slice(A,U)),E+=String(n[_]),A=U+2,U++;break;case 37:A<U&&(E+=r.slice(A,U)),E+="%",A=U+2,U++,_--;break}++_}++U}return A===-1?r:(A<P&&(E+=r.slice(A)),E)}return qu}var Vu,ap;function f4(){if(ap)return Vu;ap=1;const t=h4();Vu=i;const e=T().console||{},r={mapHttpRequest:P,mapHttpResponse:P,wrapRequestSerializer:U,wrapResponseSerializer:U,wrapErrorSerializer:U,req:P,res:P,err:_};function n(I,f){return Array.isArray(I)?I.filter(function(J){return J!=="!stdSerializers.err"}):I===!0?Object.keys(f):!1}function i(I){I=I||{},I.browser=I.browser||{};const f=I.browser.transmit;if(f&&typeof f.send!="function")throw Error("pino: transmit option must have a send function");const x=I.browser.write||e;I.browser.write&&(I.browser.asObject=!0);const J=I.serializers||{},z=n(I.browser.serialize,J);let ee=I.browser.serialize;Array.isArray(I.browser.serialize)&&I.browser.serialize.indexOf("!stdSerializers.err")>-1&&(ee=!1);const de=["error","fatal","warn","info","debug","trace"];typeof x=="function"&&(x.error=x.fatal=x.warn=x.info=x.debug=x.trace=x),I.enabled===!1&&(I.level="silent");const me=I.level||"info",O=Object.create(x);O.log||(O.log=H),Object.defineProperty(O,"levelVal",{get:ce}),Object.defineProperty(O,"level",{get:le,set:re});const j={transmit:f,serialize:z,asObject:I.browser.asObject,levels:de,timestamp:A(I)};O.levels=i.levels,O.level=me,O.setMaxListeners=O.getMaxListeners=O.emit=O.addListener=O.on=O.prependListener=O.once=O.prependOnceListener=O.removeListener=O.removeAllListeners=O.listeners=O.listenerCount=O.eventNames=O.write=O.flush=H,O.serializers=J,O._serialize=z,O._stdErrSerialize=ee,O.child=ne,f&&(O._logEvent=E());function ce(){return this.level==="silent"?1/0:this.levels.values[this.level]}function le(){return this._level}function re(ae){if(ae!=="silent"&&!this.levels.values[ae])throw Error("unknown level "+ae);this._level=ae,o(j,O,"error","log"),o(j,O,"fatal","error"),o(j,O,"warn","error"),o(j,O,"info","log"),o(j,O,"debug","log"),o(j,O,"trace","log")}function ne(ae,ie){if(!ae)throw new Error("missing bindings for child Pino");ie=ie||{},z&&ae.serializers&&(ie.serializers=ae.serializers);const Se=ie.serializers;if(z&&Se){var ge=Object.assign({},J,Se),Fe=I.browser.serialize===!0?Object.keys(ge):z;delete ae.serializers,h([ae],Fe,ge,this._stdErrSerialize)}function ye(Le){this._childLevel=(Le._childLevel|0)+1,this.error=d(Le,ae,"error"),this.fatal=d(Le,ae,"fatal"),this.warn=d(Le,ae,"warn"),this.info=d(Le,ae,"info"),this.debug=d(Le,ae,"debug"),this.trace=d(Le,ae,"trace"),ge&&(this.serializers=ge,this._serialize=Fe),f&&(this._logEvent=E([].concat(Le._logEvent.bindings,ae)))}return ye.prototype=this,new ye(this)}return O}i.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"}},i.stdSerializers=r,i.stdTimeFunctions=Object.assign({},{nullTime:G,epochTime:N,unixTime:L,isoTime:$});function o(I,f,x,J){const z=Object.getPrototypeOf(f);f[x]=f.levelVal>f.levels.values[x]?H:z[x]?z[x]:e[x]||e[J]||H,c(I,f,x)}function c(I,f,x){!I.transmit&&f[x]===H||(f[x]=function(J){return function(){const ee=I.timestamp(),de=new Array(arguments.length),me=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var O=0;O<de.length;O++)de[O]=arguments[O];if(I.serialize&&!I.asObject&&h(de,this._serialize,this.serializers,this._stdErrSerialize),I.asObject?J.call(me,l(this,x,de,ee)):J.apply(me,de),I.transmit){const j=I.transmit.level||f.level,ce=i.levels.values[j],le=i.levels.values[x];if(le<ce)return;v(this,{ts:ee,methodLevel:x,methodValue:le,transmitLevel:j,transmitValue:i.levels.values[I.transmit.level||f.level],send:I.transmit.send,val:f.levelVal},de)}}}(f[x]))}function l(I,f,x,J){I._serialize&&h(x,I._serialize,I.serializers,I._stdErrSerialize);const z=x.slice();let ee=z[0];const de={};J&&(de.time=J),de.level=i.levels.values[f];let me=(I._childLevel|0)+1;if(me<1&&(me=1),ee!==null&&typeof ee=="object"){for(;me--&&typeof z[0]=="object";)Object.assign(de,z.shift());ee=z.length?t(z.shift(),z):void 0}else typeof ee=="string"&&(ee=t(z.shift(),z));return ee!==void 0&&(de.msg=ee),de}function h(I,f,x,J){for(const z in I)if(J&&I[z]instanceof Error)I[z]=i.stdSerializers.err(I[z]);else if(typeof I[z]=="object"&&!Array.isArray(I[z]))for(const ee in I[z])f&&f.indexOf(ee)>-1&&ee in x&&(I[z][ee]=x[ee](I[z][ee]))}function d(I,f,x){return function(){const J=new Array(1+arguments.length);J[0]=f;for(var z=1;z<J.length;z++)J[z]=arguments[z-1];return I[x].apply(this,J)}}function v(I,f,x){const J=f.send,z=f.ts,ee=f.methodLevel,de=f.methodValue,me=f.val,O=I._logEvent.bindings;h(x,I._serialize||Object.keys(I.serializers),I.serializers,I._stdErrSerialize===void 0?!0:I._stdErrSerialize),I._logEvent.ts=z,I._logEvent.messages=x.filter(function(j){return O.indexOf(j)===-1}),I._logEvent.level.label=ee,I._logEvent.level.value=de,J(ee,I._logEvent,me),I._logEvent=E(O)}function E(I){return{ts:0,messages:[],bindings:I||[],level:{label:"",value:0}}}function _(I){const f={type:I.constructor.name,msg:I.message,stack:I.stack};for(const x in I)f[x]===void 0&&(f[x]=I[x]);return f}function A(I){return typeof I.timestamp=="function"?I.timestamp:I.timestamp===!1?G:N}function P(){return{}}function U(I){return I}function H(){}function G(){return!1}function N(){return Date.now()}function L(){return Math.round(Date.now()/1e3)}function $(){return new Date(Date.now()).toISOString()}function T(){function I(f){return typeof f<"u"&&f}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 I(self)||I(window)||I(this)||{}}}return Vu}var qi={},cp;function lp(){return cp||(cp=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.PINO_CUSTOM_CONTEXT_KEY=qi.PINO_LOGGER_DEFAULTS=void 0,qi.PINO_LOGGER_DEFAULTS={level:"info"},qi.PINO_CUSTOM_CONTEXT_KEY="custom_context"),qi}var Tr={},up;function d4(){if(up)return Tr;up=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.generateChildLogger=Tr.formatChildLoggerContext=Tr.getLoggerContext=Tr.setBrowserLoggerContext=Tr.getBrowserLoggerContext=Tr.getDefaultLoggerOptions=void 0;const t=lp();function e(l){return Object.assign(Object.assign({},l),{level:l?.level||t.PINO_LOGGER_DEFAULTS.level})}Tr.getDefaultLoggerOptions=e;function r(l,h=t.PINO_CUSTOM_CONTEXT_KEY){return l[h]||""}Tr.getBrowserLoggerContext=r;function n(l,h,d=t.PINO_CUSTOM_CONTEXT_KEY){return l[d]=h,l}Tr.setBrowserLoggerContext=n;function i(l,h=t.PINO_CUSTOM_CONTEXT_KEY){let d="";return typeof l.bindings>"u"?d=r(l,h):d=l.bindings().context||"",d}Tr.getLoggerContext=i;function o(l,h,d=t.PINO_CUSTOM_CONTEXT_KEY){const v=i(l,d);return v.trim()?`${v}/${h}`:h}Tr.formatChildLoggerContext=o;function c(l,h,d=t.PINO_CUSTOM_CONTEXT_KEY){const v=o(l,h,d),E=l.child({context:v});return n(E,v,d)}return Tr.generateChildLogger=c,Tr}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=u4,r=e.__importDefault(f4());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(lp(),t),e.__exportStar(d4(),t)})(pt);class p4 extends zi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class g4 extends zi{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class m4{constructor(e,r){this.logger=e,this.core=r}}class w4 extends zi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class v4 extends zi{constructor(e){super()}}class y4{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class b4 extends zi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class _4 extends zi{constructor(e,r){super(),this.core=e,this.logger=r}}class E4{constructor(e,r){this.projectId=e,this.logger=r}}class x4{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class C4{constructor(e){this.client=e}}const I4=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),O4=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Ku(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return O4(t)}catch{return t}}function Uo(t){return typeof t=="string"?t:I4(t)||""}var Gu={},hp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Yr;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function l(){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 l.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},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},l.prototype.update=function(h,d){if(d===void 0&&(d=h.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var v=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&d>0;)this._buffer[this._bufferLength++]=h[v++],d--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(v=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,h,v,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=h[v++],d--;return this},l.prototype.finish=function(h){if(!this._finished){var d=this._bytesHashed,v=this._bufferLength,E=d/536870912|0,_=d<<3,A=d%128<112?128:256;this._buffer[v]=128;for(var P=v+1;P<A-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,A-8),e.writeUint32BE(_,this._buffer,A-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,A),this._finished=!0}for(var P=0;P<this.digestLength/8;P++)e.writeUint32BE(this._stateHi[P],h,P*8),e.writeUint32BE(this._stateLo[P],h,P*8+4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.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}},l.prototype.restoreState=function(h){return this._stateHi.set(h.stateHi),this._stateLo.set(h.stateLo),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.stateHi),r.wipe(h.stateLo),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();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 o(l,h,d,v,E,_,A){for(var P=d[0],U=d[1],H=d[2],G=d[3],N=d[4],L=d[5],$=d[6],T=d[7],I=v[0],f=v[1],x=v[2],J=v[3],z=v[4],ee=v[5],de=v[6],me=v[7],O,j,ce,le,re,ne,ae,ie;A>=128;){for(var Se=0;Se<16;Se++){var ge=8*Se+_;l[Se]=e.readUint32BE(E,ge),h[Se]=e.readUint32BE(E,ge+4)}for(var Se=0;Se<80;Se++){var Fe=P,ye=U,Le=H,X=G,Y=N,W=L,w=$,F=T,we=I,ve=f,Me=x,nt=J,at=z,Ge=ee,Dt=de,$t=me;if(O=T,j=me,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=(N>>>14|z<<32-14)^(N>>>18|z<<32-18)^(z>>>41-32|N<<32-(41-32)),j=(z>>>14|N<<32-14)^(z>>>18|N<<32-18)^(N>>>41-32|z<<32-(41-32)),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=N&L^~N&$,j=z&ee^~z&de,re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=i[Se*2],j=i[Se*2+1],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=l[Se%16],j=h[Se%16],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,ce=ae&65535|ie<<16,le=re&65535|ne<<16,O=ce,j=le,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=(P>>>28|I<<32-28)^(I>>>34-32|P<<32-(34-32))^(I>>>39-32|P<<32-(39-32)),j=(I>>>28|P<<32-28)^(P>>>34-32|I<<32-(34-32))^(P>>>39-32|I<<32-(39-32)),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=P&U^P&H^U&H,j=I&f^I&x^f&x,re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,F=ae&65535|ie<<16,$t=re&65535|ne<<16,O=X,j=nt,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=ce,j=le,re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,X=ae&65535|ie<<16,nt=re&65535|ne<<16,U=Fe,H=ye,G=Le,N=X,L=Y,$=W,T=w,P=F,f=we,x=ve,J=Me,z=nt,ee=at,de=Ge,me=Dt,I=$t,Se%16===15)for(var ge=0;ge<16;ge++)O=l[ge],j=h[ge],re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=l[(ge+9)%16],j=h[(ge+9)%16],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ce=l[(ge+1)%16],le=h[(ge+1)%16],O=(ce>>>1|le<<32-1)^(ce>>>8|le<<32-8)^ce>>>7,j=(le>>>1|ce<<32-1)^(le>>>8|ce<<32-8)^(le>>>7|ce<<32-7),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ce=l[(ge+14)%16],le=h[(ge+14)%16],O=(ce>>>19|le<<32-19)^(le>>>61-32|ce<<32-(61-32))^ce>>>6,j=(le>>>19|ce<<32-19)^(ce>>>61-32|le<<32-(61-32))^(le>>>6|ce<<32-6),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,l[ge]=ae&65535|ie<<16,h[ge]=re&65535|ne<<16}O=P,j=I,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[0],j=v[0],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[0]=P=ae&65535|ie<<16,v[0]=I=re&65535|ne<<16,O=U,j=f,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[1],j=v[1],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[1]=U=ae&65535|ie<<16,v[1]=f=re&65535|ne<<16,O=H,j=x,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[2],j=v[2],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[2]=H=ae&65535|ie<<16,v[2]=x=re&65535|ne<<16,O=G,j=J,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[3],j=v[3],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[3]=G=ae&65535|ie<<16,v[3]=J=re&65535|ne<<16,O=N,j=z,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[4],j=v[4],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[4]=N=ae&65535|ie<<16,v[4]=z=re&65535|ne<<16,O=L,j=ee,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[5],j=v[5],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[5]=L=ae&65535|ie<<16,v[5]=ee=re&65535|ne<<16,O=$,j=de,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[6],j=v[6],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[6]=$=ae&65535|ie<<16,v[6]=de=re&65535|ne<<16,O=T,j=me,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[7],j=v[7],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[7]=T=ae&65535|ie<<16,v[7]=me=re&65535|ne<<16,_+=128,A-=128}return _}function c(l){var h=new n;h.update(l);var d=h.digest();return h.clean(),d}t.hash=c})(hp),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=Cs,r=hp,n=Yr;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(X){const Y=new Float64Array(16);if(X)for(let W=0;W<X.length;W++)Y[W]=X[W];return Y}const o=new Uint8Array(32);o[0]=9;const c=i(),l=i([1]),h=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),d=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),E=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),_=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function A(X,Y){for(let W=0;W<16;W++)X[W]=Y[W]|0}function P(X){let Y=1;for(let W=0;W<16;W++){let w=X[W]+Y+65535;Y=Math.floor(w/65536),X[W]=w-Y*65536}X[0]+=Y-1+37*(Y-1)}function U(X,Y,W){const w=~(W-1);for(let F=0;F<16;F++){const we=w&(X[F]^Y[F]);X[F]^=we,Y[F]^=we}}function H(X,Y){const W=i(),w=i();for(let F=0;F<16;F++)w[F]=Y[F];P(w),P(w),P(w);for(let F=0;F<2;F++){W[0]=w[0]-65517;for(let ve=1;ve<15;ve++)W[ve]=w[ve]-65535-(W[ve-1]>>16&1),W[ve-1]&=65535;W[15]=w[15]-32767-(W[14]>>16&1);const we=W[15]>>16&1;W[14]&=65535,U(w,W,1-we)}for(let F=0;F<16;F++)X[2*F]=w[F]&255,X[2*F+1]=w[F]>>8}function G(X,Y){let W=0;for(let w=0;w<32;w++)W|=X[w]^Y[w];return(1&W-1>>>8)-1}function N(X,Y){const W=new Uint8Array(32),w=new Uint8Array(32);return H(W,X),H(w,Y),G(W,w)}function L(X){const Y=new Uint8Array(32);return H(Y,X),Y[0]&1}function $(X,Y){for(let W=0;W<16;W++)X[W]=Y[2*W]+(Y[2*W+1]<<8);X[15]&=32767}function T(X,Y,W){for(let w=0;w<16;w++)X[w]=Y[w]+W[w]}function I(X,Y,W){for(let w=0;w<16;w++)X[w]=Y[w]-W[w]}function f(X,Y,W){let w,F,we=0,ve=0,Me=0,nt=0,at=0,Ge=0,Dt=0,$t=0,Je=0,He=0,Be=0,Ke=0,rt=0,Ue=0,Ze=0,b=0,p=0,m=0,D=0,B=0,K=0,Q=0,Ee=0,Te=0,st=0,ht=0,lt=0,Ur=0,Jn=0,Ii=0,ls=0,Ht=W[0],Lt=W[1],zt=W[2],Wt=W[3],Ft=W[4],Mt=W[5],ir=W[6],sr=W[7],qt=W[8],or=W[9],Vt=W[10],Jt=W[11],Kt=W[12],Pt=W[13],ar=W[14],cr=W[15];w=Y[0],we+=w*Ht,ve+=w*Lt,Me+=w*zt,nt+=w*Wt,at+=w*Ft,Ge+=w*Mt,Dt+=w*ir,$t+=w*sr,Je+=w*qt,He+=w*or,Be+=w*Vt,Ke+=w*Jt,rt+=w*Kt,Ue+=w*Pt,Ze+=w*ar,b+=w*cr,w=Y[1],ve+=w*Ht,Me+=w*Lt,nt+=w*zt,at+=w*Wt,Ge+=w*Ft,Dt+=w*Mt,$t+=w*ir,Je+=w*sr,He+=w*qt,Be+=w*or,Ke+=w*Vt,rt+=w*Jt,Ue+=w*Kt,Ze+=w*Pt,b+=w*ar,p+=w*cr,w=Y[2],Me+=w*Ht,nt+=w*Lt,at+=w*zt,Ge+=w*Wt,Dt+=w*Ft,$t+=w*Mt,Je+=w*ir,He+=w*sr,Be+=w*qt,Ke+=w*or,rt+=w*Vt,Ue+=w*Jt,Ze+=w*Kt,b+=w*Pt,p+=w*ar,m+=w*cr,w=Y[3],nt+=w*Ht,at+=w*Lt,Ge+=w*zt,Dt+=w*Wt,$t+=w*Ft,Je+=w*Mt,He+=w*ir,Be+=w*sr,Ke+=w*qt,rt+=w*or,Ue+=w*Vt,Ze+=w*Jt,b+=w*Kt,p+=w*Pt,m+=w*ar,D+=w*cr,w=Y[4],at+=w*Ht,Ge+=w*Lt,Dt+=w*zt,$t+=w*Wt,Je+=w*Ft,He+=w*Mt,Be+=w*ir,Ke+=w*sr,rt+=w*qt,Ue+=w*or,Ze+=w*Vt,b+=w*Jt,p+=w*Kt,m+=w*Pt,D+=w*ar,B+=w*cr,w=Y[5],Ge+=w*Ht,Dt+=w*Lt,$t+=w*zt,Je+=w*Wt,He+=w*Ft,Be+=w*Mt,Ke+=w*ir,rt+=w*sr,Ue+=w*qt,Ze+=w*or,b+=w*Vt,p+=w*Jt,m+=w*Kt,D+=w*Pt,B+=w*ar,K+=w*cr,w=Y[6],Dt+=w*Ht,$t+=w*Lt,Je+=w*zt,He+=w*Wt,Be+=w*Ft,Ke+=w*Mt,rt+=w*ir,Ue+=w*sr,Ze+=w*qt,b+=w*or,p+=w*Vt,m+=w*Jt,D+=w*Kt,B+=w*Pt,K+=w*ar,Q+=w*cr,w=Y[7],$t+=w*Ht,Je+=w*Lt,He+=w*zt,Be+=w*Wt,Ke+=w*Ft,rt+=w*Mt,Ue+=w*ir,Ze+=w*sr,b+=w*qt,p+=w*or,m+=w*Vt,D+=w*Jt,B+=w*Kt,K+=w*Pt,Q+=w*ar,Ee+=w*cr,w=Y[8],Je+=w*Ht,He+=w*Lt,Be+=w*zt,Ke+=w*Wt,rt+=w*Ft,Ue+=w*Mt,Ze+=w*ir,b+=w*sr,p+=w*qt,m+=w*or,D+=w*Vt,B+=w*Jt,K+=w*Kt,Q+=w*Pt,Ee+=w*ar,Te+=w*cr,w=Y[9],He+=w*Ht,Be+=w*Lt,Ke+=w*zt,rt+=w*Wt,Ue+=w*Ft,Ze+=w*Mt,b+=w*ir,p+=w*sr,m+=w*qt,D+=w*or,B+=w*Vt,K+=w*Jt,Q+=w*Kt,Ee+=w*Pt,Te+=w*ar,st+=w*cr,w=Y[10],Be+=w*Ht,Ke+=w*Lt,rt+=w*zt,Ue+=w*Wt,Ze+=w*Ft,b+=w*Mt,p+=w*ir,m+=w*sr,D+=w*qt,B+=w*or,K+=w*Vt,Q+=w*Jt,Ee+=w*Kt,Te+=w*Pt,st+=w*ar,ht+=w*cr,w=Y[11],Ke+=w*Ht,rt+=w*Lt,Ue+=w*zt,Ze+=w*Wt,b+=w*Ft,p+=w*Mt,m+=w*ir,D+=w*sr,B+=w*qt,K+=w*or,Q+=w*Vt,Ee+=w*Jt,Te+=w*Kt,st+=w*Pt,ht+=w*ar,lt+=w*cr,w=Y[12],rt+=w*Ht,Ue+=w*Lt,Ze+=w*zt,b+=w*Wt,p+=w*Ft,m+=w*Mt,D+=w*ir,B+=w*sr,K+=w*qt,Q+=w*or,Ee+=w*Vt,Te+=w*Jt,st+=w*Kt,ht+=w*Pt,lt+=w*ar,Ur+=w*cr,w=Y[13],Ue+=w*Ht,Ze+=w*Lt,b+=w*zt,p+=w*Wt,m+=w*Ft,D+=w*Mt,B+=w*ir,K+=w*sr,Q+=w*qt,Ee+=w*or,Te+=w*Vt,st+=w*Jt,ht+=w*Kt,lt+=w*Pt,Ur+=w*ar,Jn+=w*cr,w=Y[14],Ze+=w*Ht,b+=w*Lt,p+=w*zt,m+=w*Wt,D+=w*Ft,B+=w*Mt,K+=w*ir,Q+=w*sr,Ee+=w*qt,Te+=w*or,st+=w*Vt,ht+=w*Jt,lt+=w*Kt,Ur+=w*Pt,Jn+=w*ar,Ii+=w*cr,w=Y[15],b+=w*Ht,p+=w*Lt,m+=w*zt,D+=w*Wt,B+=w*Ft,K+=w*Mt,Q+=w*ir,Ee+=w*sr,Te+=w*qt,st+=w*or,ht+=w*Vt,lt+=w*Jt,Ur+=w*Kt,Jn+=w*Pt,Ii+=w*ar,ls+=w*cr,we+=38*p,ve+=38*m,Me+=38*D,nt+=38*B,at+=38*K,Ge+=38*Q,Dt+=38*Ee,$t+=38*Te,Je+=38*st,He+=38*ht,Be+=38*lt,Ke+=38*Ur,rt+=38*Jn,Ue+=38*Ii,Ze+=38*ls,F=1,w=we+F+65535,F=Math.floor(w/65536),we=w-F*65536,w=ve+F+65535,F=Math.floor(w/65536),ve=w-F*65536,w=Me+F+65535,F=Math.floor(w/65536),Me=w-F*65536,w=nt+F+65535,F=Math.floor(w/65536),nt=w-F*65536,w=at+F+65535,F=Math.floor(w/65536),at=w-F*65536,w=Ge+F+65535,F=Math.floor(w/65536),Ge=w-F*65536,w=Dt+F+65535,F=Math.floor(w/65536),Dt=w-F*65536,w=$t+F+65535,F=Math.floor(w/65536),$t=w-F*65536,w=Je+F+65535,F=Math.floor(w/65536),Je=w-F*65536,w=He+F+65535,F=Math.floor(w/65536),He=w-F*65536,w=Be+F+65535,F=Math.floor(w/65536),Be=w-F*65536,w=Ke+F+65535,F=Math.floor(w/65536),Ke=w-F*65536,w=rt+F+65535,F=Math.floor(w/65536),rt=w-F*65536,w=Ue+F+65535,F=Math.floor(w/65536),Ue=w-F*65536,w=Ze+F+65535,F=Math.floor(w/65536),Ze=w-F*65536,w=b+F+65535,F=Math.floor(w/65536),b=w-F*65536,we+=F-1+37*(F-1),F=1,w=we+F+65535,F=Math.floor(w/65536),we=w-F*65536,w=ve+F+65535,F=Math.floor(w/65536),ve=w-F*65536,w=Me+F+65535,F=Math.floor(w/65536),Me=w-F*65536,w=nt+F+65535,F=Math.floor(w/65536),nt=w-F*65536,w=at+F+65535,F=Math.floor(w/65536),at=w-F*65536,w=Ge+F+65535,F=Math.floor(w/65536),Ge=w-F*65536,w=Dt+F+65535,F=Math.floor(w/65536),Dt=w-F*65536,w=$t+F+65535,F=Math.floor(w/65536),$t=w-F*65536,w=Je+F+65535,F=Math.floor(w/65536),Je=w-F*65536,w=He+F+65535,F=Math.floor(w/65536),He=w-F*65536,w=Be+F+65535,F=Math.floor(w/65536),Be=w-F*65536,w=Ke+F+65535,F=Math.floor(w/65536),Ke=w-F*65536,w=rt+F+65535,F=Math.floor(w/65536),rt=w-F*65536,w=Ue+F+65535,F=Math.floor(w/65536),Ue=w-F*65536,w=Ze+F+65535,F=Math.floor(w/65536),Ze=w-F*65536,w=b+F+65535,F=Math.floor(w/65536),b=w-F*65536,we+=F-1+37*(F-1),X[0]=we,X[1]=ve,X[2]=Me,X[3]=nt,X[4]=at,X[5]=Ge,X[6]=Dt,X[7]=$t,X[8]=Je,X[9]=He,X[10]=Be,X[11]=Ke,X[12]=rt,X[13]=Ue,X[14]=Ze,X[15]=b}function x(X,Y){f(X,Y,Y)}function J(X,Y){const W=i();let w;for(w=0;w<16;w++)W[w]=Y[w];for(w=253;w>=0;w--)x(W,W),w!==2&&w!==4&&f(W,W,Y);for(w=0;w<16;w++)X[w]=W[w]}function z(X,Y){const W=i();let w;for(w=0;w<16;w++)W[w]=Y[w];for(w=250;w>=0;w--)x(W,W),w!==1&&f(W,W,Y);for(w=0;w<16;w++)X[w]=W[w]}function ee(X,Y){const W=i(),w=i(),F=i(),we=i(),ve=i(),Me=i(),nt=i(),at=i(),Ge=i();I(W,X[1],X[0]),I(Ge,Y[1],Y[0]),f(W,W,Ge),T(w,X[0],X[1]),T(Ge,Y[0],Y[1]),f(w,w,Ge),f(F,X[3],Y[3]),f(F,F,d),f(we,X[2],Y[2]),T(we,we,we),I(ve,w,W),I(Me,we,F),T(nt,we,F),T(at,w,W),f(X[0],ve,Me),f(X[1],at,nt),f(X[2],nt,Me),f(X[3],ve,at)}function de(X,Y,W){for(let w=0;w<4;w++)U(X[w],Y[w],W)}function me(X,Y){const W=i(),w=i(),F=i();J(F,Y[2]),f(W,Y[0],F),f(w,Y[1],F),H(X,w),X[31]^=L(W)<<7}function O(X,Y,W){A(X[0],c),A(X[1],l),A(X[2],l),A(X[3],c);for(let w=255;w>=0;--w){const F=W[w/8|0]>>(w&7)&1;de(X,Y,F),ee(Y,X),ee(X,X),de(X,Y,F)}}function j(X,Y){const W=[i(),i(),i(),i()];A(W[0],v),A(W[1],E),A(W[2],l),f(W[3],v,E),O(X,W,Y)}function ce(X){if(X.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const Y=(0,r.hash)(X);Y[0]&=248,Y[31]&=127,Y[31]|=64;const W=new Uint8Array(32),w=[i(),i(),i(),i()];j(w,Y),me(W,w);const F=new Uint8Array(64);return F.set(X),F.set(W,32),{publicKey:W,secretKey:F}}t.generateKeyPairFromSeed=ce;function le(X){const Y=(0,e.randomBytes)(32,X),W=ce(Y);return(0,n.wipe)(Y),W}t.generateKeyPair=le;function re(X){if(X.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(X.subarray(32))}t.extractPublicKeyFromSecretKey=re;const ne=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 ae(X,Y){let W,w,F,we;for(w=63;w>=32;--w){for(W=0,F=w-32,we=w-12;F<we;++F)Y[F]+=W-16*Y[w]*ne[F-(w-32)],W=Math.floor((Y[F]+128)/256),Y[F]-=W*256;Y[F]+=W,Y[w]=0}for(W=0,F=0;F<32;F++)Y[F]+=W-(Y[31]>>4)*ne[F],W=Y[F]>>8,Y[F]&=255;for(F=0;F<32;F++)Y[F]-=W*ne[F];for(w=0;w<32;w++)Y[w+1]+=Y[w]>>8,X[w]=Y[w]&255}function ie(X){const Y=new Float64Array(64);for(let W=0;W<64;W++)Y[W]=X[W];for(let W=0;W<64;W++)X[W]=0;ae(X,Y)}function Se(X,Y){const W=new Float64Array(64),w=[i(),i(),i(),i()],F=(0,r.hash)(X.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const we=new Uint8Array(64);we.set(F.subarray(32),32);const ve=new r.SHA512;ve.update(we.subarray(32)),ve.update(Y);const Me=ve.digest();ve.clean(),ie(Me),j(w,Me),me(we,w),ve.reset(),ve.update(we.subarray(0,32)),ve.update(X.subarray(32)),ve.update(Y);const nt=ve.digest();ie(nt);for(let at=0;at<32;at++)W[at]=Me[at];for(let at=0;at<32;at++)for(let Ge=0;Ge<32;Ge++)W[at+Ge]+=nt[at]*F[Ge];return ae(we.subarray(32),W),we}t.sign=Se;function ge(X,Y){const W=i(),w=i(),F=i(),we=i(),ve=i(),Me=i(),nt=i();return A(X[2],l),$(X[1],Y),x(F,X[1]),f(we,F,h),I(F,F,X[2]),T(we,X[2],we),x(ve,we),x(Me,ve),f(nt,Me,ve),f(W,nt,F),f(W,W,we),z(W,W),f(W,W,F),f(W,W,we),f(W,W,we),f(X[0],W,we),x(w,X[0]),f(w,w,we),N(w,F)&&f(X[0],X[0],_),x(w,X[0]),f(w,w,we),N(w,F)?-1:(L(X[0])===Y[31]>>7&&I(X[0],c,X[0]),f(X[3],X[0],X[1]),0)}function Fe(X,Y,W){const w=new Uint8Array(32),F=[i(),i(),i(),i()],we=[i(),i(),i(),i()];if(W.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ge(we,X))return!1;const ve=new r.SHA512;ve.update(W.subarray(0,32)),ve.update(X),ve.update(Y);const Me=ve.digest();return ie(Me),O(F,we,Me),j(we,W.subarray(32)),ee(F,we),me(w,F),!G(W,w)}t.verify=Fe;function ye(X){let Y=[i(),i(),i(),i()];if(ge(Y,X))throw new Error("Ed25519: invalid public key");let W=i(),w=i(),F=Y[1];T(W,l,F),I(w,l,F),J(w,w),f(W,W,w);let we=new Uint8Array(32);return H(we,W),we}t.convertPublicKeyToX25519=ye;function Le(X){const Y=(0,r.hash)(X.subarray(0,32));Y[0]&=248,Y[31]&=127,Y[31]|=64;const W=new Uint8Array(Y.subarray(0,32));return(0,n.wipe)(Y),W}t.convertSecretKeyToX25519=Le}(Gu);const A4="EdDSA",S4="JWT",fp=".",dp="base64url",D4="utf8",$4="utf8",P4=":",T4="did",R4="key",pp="base58btc",N4="z",L4="K36",M4=32;function ec(t){return Dr(Hr(Uo(t),D4),dp)}function gp(t){const e=Hr(L4,pp),r=N4+Dr(cu([e,t]),pp);return[T4,R4,r].join(P4)}function U4(t){return Dr(t,dp)}function j4(t){return Hr([ec(t.header),ec(t.payload)].join(fp),$4)}function F4(t){return[ec(t.header),ec(t.payload),U4(t.signature)].join(fp)}function mp(t=Cs.randomBytes(M4)){return Gu.generateKeyPairFromSeed(t)}async function B4(t,e,r,n,i=ke.fromMiliseconds(Date.now())){const o={alg:A4,typ:S4},c=gp(n.publicKey),l=i+r,h={iss:c,sub:t,aud:e,iat:i,exp:l},d=j4({header:o,payload:h}),v=Gu.sign(n.secretKey,d);return F4({header:o,payload:h,signature:v})}const k4="PARSE_ERROR",H4="INVALID_REQUEST",z4="METHOD_NOT_FOUND",W4="INVALID_PARAMS",wp="INTERNAL_ERROR",Zu="SERVER_ERROR",q4=[-32700,-32600,-32601,-32602,-32603],jo={[k4]:{code:-32700,message:"Parse error"},[H4]:{code:-32600,message:"Invalid Request"},[z4]:{code:-32601,message:"Method not found"},[W4]:{code:-32602,message:"Invalid params"},[wp]:{code:-32603,message:"Internal error"},[Zu]:{code:-32e3,message:"Server error"}},vp=Zu;function V4(t){return q4.includes(t)}function yp(t){return Object.keys(jo).includes(t)?jo[t]:jo[vp]}function K4(t){const e=Object.values(jo).find(r=>r.code===t);return e||jo[vp]}function bp(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var _p={};/*! *****************************************************************************
|
|
59
|
+
***************************************************************************** */var ku=function(t,e){return ku=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])},ku(t,e)};function W6(t,e){ku(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Hu=function(){return Hu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Hu.apply(this,arguments)};function q6(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 V6(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function K6(t,e){return function(r,n){e(r,n,t)}}function G6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Z6(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(E){c(E)}}function h(v){try{d(n.throw(v))}catch(E){c(E)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function Y6(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function J6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function X6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function zu(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 ip(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function Q6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(ip(arguments[e]));return t}function e4(){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 o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Lo(t){return this instanceof Lo?(this.v=t,this):new Lo(t)}function t4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,U){o.push([_,A,P,U])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Lo?Promise.resolve(_.value.v).then(d,v):E(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function E(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function r4(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:Lo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function n4(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 zu=="function"?zu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function i4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function s4(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 o4(t){return t&&t.__esModule?t:{default:t}}function a4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function c4(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 l4=Object.freeze({__proto__:null,__extends:W6,get __assign(){return Hu},__rest:q6,__decorate:V6,__param:K6,__metadata:G6,__awaiter:Z6,__generator:Y6,__createBinding:J6,__exportStar:X6,__values:zu,__read:ip,__spread:Q6,__spreadArrays:e4,__await:Lo,__asyncGenerator:t4,__asyncDelegator:r4,__asyncValues:n4,__makeTemplateObject:i4,__importStar:s4,__importDefault:o4,__classPrivateFieldGet:a4,__classPrivateFieldSet:c4}),u4=Mi(l4),Wu,sp;function h4(){if(sp)return Wu;sp=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}Wu=e;function e(r,n,i){var o=i&&i.stringify||t,c=1;if(typeof r=="object"&&r!==null){var l=n.length+c;if(l===1)return r;var h=new Array(l);h[0]=o(r);for(var d=1;d<l;d++)h[d]=o(n[d]);return h.join(" ")}if(typeof r!="string")return r;var v=n.length;if(v===0)return r;for(var E="",_=1-c,A=-1,P=r&&r.length||0,U=0;U<P;){if(r.charCodeAt(U)===37&&U+1<P){switch(A=A>-1?A:0,r.charCodeAt(U+1)){case 100:case 102:if(_>=v||n[_]==null)break;A<U&&(E+=r.slice(A,U)),E+=Number(n[_]),A=U+2,U++;break;case 105:if(_>=v||n[_]==null)break;A<U&&(E+=r.slice(A,U)),E+=Math.floor(Number(n[_])),A=U+2,U++;break;case 79:case 111:case 106:if(_>=v||n[_]===void 0)break;A<U&&(E+=r.slice(A,U));var H=typeof n[_];if(H==="string"){E+="'"+n[_]+"'",A=U+2,U++;break}if(H==="function"){E+=n[_].name||"<anonymous>",A=U+2,U++;break}E+=o(n[_]),A=U+2,U++;break;case 115:if(_>=v)break;A<U&&(E+=r.slice(A,U)),E+=String(n[_]),A=U+2,U++;break;case 37:A<U&&(E+=r.slice(A,U)),E+="%",A=U+2,U++,_--;break}++_}++U}return A===-1?r:(A<P&&(E+=r.slice(A)),E)}return Wu}var qu,op;function f4(){if(op)return qu;op=1;const t=h4();qu=i;const e=T().console||{},r={mapHttpRequest:P,mapHttpResponse:P,wrapRequestSerializer:U,wrapResponseSerializer:U,wrapErrorSerializer:U,req:P,res:P,err:_};function n(I,f){return Array.isArray(I)?I.filter(function(J){return J!=="!stdSerializers.err"}):I===!0?Object.keys(f):!1}function i(I){I=I||{},I.browser=I.browser||{};const f=I.browser.transmit;if(f&&typeof f.send!="function")throw Error("pino: transmit option must have a send function");const x=I.browser.write||e;I.browser.write&&(I.browser.asObject=!0);const J=I.serializers||{},z=n(I.browser.serialize,J);let ee=I.browser.serialize;Array.isArray(I.browser.serialize)&&I.browser.serialize.indexOf("!stdSerializers.err")>-1&&(ee=!1);const de=["error","fatal","warn","info","debug","trace"];typeof x=="function"&&(x.error=x.fatal=x.warn=x.info=x.debug=x.trace=x),I.enabled===!1&&(I.level="silent");const me=I.level||"info",O=Object.create(x);O.log||(O.log=H),Object.defineProperty(O,"levelVal",{get:ce}),Object.defineProperty(O,"level",{get:le,set:re});const j={transmit:f,serialize:z,asObject:I.browser.asObject,levels:de,timestamp:A(I)};O.levels=i.levels,O.level=me,O.setMaxListeners=O.getMaxListeners=O.emit=O.addListener=O.on=O.prependListener=O.once=O.prependOnceListener=O.removeListener=O.removeAllListeners=O.listeners=O.listenerCount=O.eventNames=O.write=O.flush=H,O.serializers=J,O._serialize=z,O._stdErrSerialize=ee,O.child=ne,f&&(O._logEvent=E());function ce(){return this.level==="silent"?1/0:this.levels.values[this.level]}function le(){return this._level}function re(ae){if(ae!=="silent"&&!this.levels.values[ae])throw Error("unknown level "+ae);this._level=ae,o(j,O,"error","log"),o(j,O,"fatal","error"),o(j,O,"warn","error"),o(j,O,"info","log"),o(j,O,"debug","log"),o(j,O,"trace","log")}function ne(ae,ie){if(!ae)throw new Error("missing bindings for child Pino");ie=ie||{},z&&ae.serializers&&(ie.serializers=ae.serializers);const Se=ie.serializers;if(z&&Se){var ge=Object.assign({},J,Se),Fe=I.browser.serialize===!0?Object.keys(ge):z;delete ae.serializers,h([ae],Fe,ge,this._stdErrSerialize)}function ye(Le){this._childLevel=(Le._childLevel|0)+1,this.error=d(Le,ae,"error"),this.fatal=d(Le,ae,"fatal"),this.warn=d(Le,ae,"warn"),this.info=d(Le,ae,"info"),this.debug=d(Le,ae,"debug"),this.trace=d(Le,ae,"trace"),ge&&(this.serializers=ge,this._serialize=Fe),f&&(this._logEvent=E([].concat(Le._logEvent.bindings,ae)))}return ye.prototype=this,new ye(this)}return O}i.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"}},i.stdSerializers=r,i.stdTimeFunctions=Object.assign({},{nullTime:G,epochTime:N,unixTime:L,isoTime:$});function o(I,f,x,J){const z=Object.getPrototypeOf(f);f[x]=f.levelVal>f.levels.values[x]?H:z[x]?z[x]:e[x]||e[J]||H,c(I,f,x)}function c(I,f,x){!I.transmit&&f[x]===H||(f[x]=function(J){return function(){const ee=I.timestamp(),de=new Array(arguments.length),me=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var O=0;O<de.length;O++)de[O]=arguments[O];if(I.serialize&&!I.asObject&&h(de,this._serialize,this.serializers,this._stdErrSerialize),I.asObject?J.call(me,l(this,x,de,ee)):J.apply(me,de),I.transmit){const j=I.transmit.level||f.level,ce=i.levels.values[j],le=i.levels.values[x];if(le<ce)return;v(this,{ts:ee,methodLevel:x,methodValue:le,transmitLevel:j,transmitValue:i.levels.values[I.transmit.level||f.level],send:I.transmit.send,val:f.levelVal},de)}}}(f[x]))}function l(I,f,x,J){I._serialize&&h(x,I._serialize,I.serializers,I._stdErrSerialize);const z=x.slice();let ee=z[0];const de={};J&&(de.time=J),de.level=i.levels.values[f];let me=(I._childLevel|0)+1;if(me<1&&(me=1),ee!==null&&typeof ee=="object"){for(;me--&&typeof z[0]=="object";)Object.assign(de,z.shift());ee=z.length?t(z.shift(),z):void 0}else typeof ee=="string"&&(ee=t(z.shift(),z));return ee!==void 0&&(de.msg=ee),de}function h(I,f,x,J){for(const z in I)if(J&&I[z]instanceof Error)I[z]=i.stdSerializers.err(I[z]);else if(typeof I[z]=="object"&&!Array.isArray(I[z]))for(const ee in I[z])f&&f.indexOf(ee)>-1&&ee in x&&(I[z][ee]=x[ee](I[z][ee]))}function d(I,f,x){return function(){const J=new Array(1+arguments.length);J[0]=f;for(var z=1;z<J.length;z++)J[z]=arguments[z-1];return I[x].apply(this,J)}}function v(I,f,x){const J=f.send,z=f.ts,ee=f.methodLevel,de=f.methodValue,me=f.val,O=I._logEvent.bindings;h(x,I._serialize||Object.keys(I.serializers),I.serializers,I._stdErrSerialize===void 0?!0:I._stdErrSerialize),I._logEvent.ts=z,I._logEvent.messages=x.filter(function(j){return O.indexOf(j)===-1}),I._logEvent.level.label=ee,I._logEvent.level.value=de,J(ee,I._logEvent,me),I._logEvent=E(O)}function E(I){return{ts:0,messages:[],bindings:I||[],level:{label:"",value:0}}}function _(I){const f={type:I.constructor.name,msg:I.message,stack:I.stack};for(const x in I)f[x]===void 0&&(f[x]=I[x]);return f}function A(I){return typeof I.timestamp=="function"?I.timestamp:I.timestamp===!1?G:N}function P(){return{}}function U(I){return I}function H(){}function G(){return!1}function N(){return Date.now()}function L(){return Math.round(Date.now()/1e3)}function $(){return new Date(Date.now()).toISOString()}function T(){function I(f){return typeof f<"u"&&f}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 I(self)||I(window)||I(this)||{}}}return qu}var qi={},ap;function cp(){return ap||(ap=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.PINO_CUSTOM_CONTEXT_KEY=qi.PINO_LOGGER_DEFAULTS=void 0,qi.PINO_LOGGER_DEFAULTS={level:"info"},qi.PINO_CUSTOM_CONTEXT_KEY="custom_context"),qi}var Tr={},lp;function d4(){if(lp)return Tr;lp=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.generateChildLogger=Tr.formatChildLoggerContext=Tr.getLoggerContext=Tr.setBrowserLoggerContext=Tr.getBrowserLoggerContext=Tr.getDefaultLoggerOptions=void 0;const t=cp();function e(l){return Object.assign(Object.assign({},l),{level:l?.level||t.PINO_LOGGER_DEFAULTS.level})}Tr.getDefaultLoggerOptions=e;function r(l,h=t.PINO_CUSTOM_CONTEXT_KEY){return l[h]||""}Tr.getBrowserLoggerContext=r;function n(l,h,d=t.PINO_CUSTOM_CONTEXT_KEY){return l[d]=h,l}Tr.setBrowserLoggerContext=n;function i(l,h=t.PINO_CUSTOM_CONTEXT_KEY){let d="";return typeof l.bindings>"u"?d=r(l,h):d=l.bindings().context||"",d}Tr.getLoggerContext=i;function o(l,h,d=t.PINO_CUSTOM_CONTEXT_KEY){const v=i(l,d);return v.trim()?`${v}/${h}`:h}Tr.formatChildLoggerContext=o;function c(l,h,d=t.PINO_CUSTOM_CONTEXT_KEY){const v=o(l,h,d),E=l.child({context:v});return n(E,v,d)}return Tr.generateChildLogger=c,Tr}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=u4,r=e.__importDefault(f4());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(cp(),t),e.__exportStar(d4(),t)})(pt);class p4 extends zi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class g4 extends zi{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class m4{constructor(e,r){this.logger=e,this.core=r}}class w4 extends zi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class v4 extends zi{constructor(e){super()}}class y4{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class b4 extends zi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class _4 extends zi{constructor(e,r){super(),this.core=e,this.logger=r}}class E4{constructor(e,r){this.projectId=e,this.logger=r}}class x4{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class C4{constructor(e){this.client=e}}const I4=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),O4=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Vu(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return O4(t)}catch{return t}}function Mo(t){return typeof t=="string"?t:I4(t)||""}var Ku={},up={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Yr;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function l(){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 l.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},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},l.prototype.update=function(h,d){if(d===void 0&&(d=h.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var v=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&d>0;)this._buffer[this._bufferLength++]=h[v++],d--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(v=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,h,v,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=h[v++],d--;return this},l.prototype.finish=function(h){if(!this._finished){var d=this._bytesHashed,v=this._bufferLength,E=d/536870912|0,_=d<<3,A=d%128<112?128:256;this._buffer[v]=128;for(var P=v+1;P<A-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,A-8),e.writeUint32BE(_,this._buffer,A-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,A),this._finished=!0}for(var P=0;P<this.digestLength/8;P++)e.writeUint32BE(this._stateHi[P],h,P*8),e.writeUint32BE(this._stateLo[P],h,P*8+4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.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}},l.prototype.restoreState=function(h){return this._stateHi.set(h.stateHi),this._stateLo.set(h.stateLo),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.stateHi),r.wipe(h.stateLo),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();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 o(l,h,d,v,E,_,A){for(var P=d[0],U=d[1],H=d[2],G=d[3],N=d[4],L=d[5],$=d[6],T=d[7],I=v[0],f=v[1],x=v[2],J=v[3],z=v[4],ee=v[5],de=v[6],me=v[7],O,j,ce,le,re,ne,ae,ie;A>=128;){for(var Se=0;Se<16;Se++){var ge=8*Se+_;l[Se]=e.readUint32BE(E,ge),h[Se]=e.readUint32BE(E,ge+4)}for(var Se=0;Se<80;Se++){var Fe=P,ye=U,Le=H,X=G,Y=N,W=L,w=$,F=T,we=I,ve=f,Me=x,nt=J,at=z,Ge=ee,Dt=de,$t=me;if(O=T,j=me,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=(N>>>14|z<<32-14)^(N>>>18|z<<32-18)^(z>>>41-32|N<<32-(41-32)),j=(z>>>14|N<<32-14)^(z>>>18|N<<32-18)^(N>>>41-32|z<<32-(41-32)),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=N&L^~N&$,j=z&ee^~z&de,re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=i[Se*2],j=i[Se*2+1],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=l[Se%16],j=h[Se%16],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,ce=ae&65535|ie<<16,le=re&65535|ne<<16,O=ce,j=le,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=(P>>>28|I<<32-28)^(I>>>34-32|P<<32-(34-32))^(I>>>39-32|P<<32-(39-32)),j=(I>>>28|P<<32-28)^(P>>>34-32|I<<32-(34-32))^(P>>>39-32|I<<32-(39-32)),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=P&U^P&H^U&H,j=I&f^I&x^f&x,re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,F=ae&65535|ie<<16,$t=re&65535|ne<<16,O=X,j=nt,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=ce,j=le,re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,X=ae&65535|ie<<16,nt=re&65535|ne<<16,U=Fe,H=ye,G=Le,N=X,L=Y,$=W,T=w,P=F,f=we,x=ve,J=Me,z=nt,ee=at,de=Ge,me=Dt,I=$t,Se%16===15)for(var ge=0;ge<16;ge++)O=l[ge],j=h[ge],re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=l[(ge+9)%16],j=h[(ge+9)%16],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ce=l[(ge+1)%16],le=h[(ge+1)%16],O=(ce>>>1|le<<32-1)^(ce>>>8|le<<32-8)^ce>>>7,j=(le>>>1|ce<<32-1)^(le>>>8|ce<<32-8)^(le>>>7|ce<<32-7),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ce=l[(ge+14)%16],le=h[(ge+14)%16],O=(ce>>>19|le<<32-19)^(le>>>61-32|ce<<32-(61-32))^ce>>>6,j=(le>>>19|ce<<32-19)^(ce>>>61-32|le<<32-(61-32))^(le>>>6|ce<<32-6),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,l[ge]=ae&65535|ie<<16,h[ge]=re&65535|ne<<16}O=P,j=I,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[0],j=v[0],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[0]=P=ae&65535|ie<<16,v[0]=I=re&65535|ne<<16,O=U,j=f,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[1],j=v[1],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[1]=U=ae&65535|ie<<16,v[1]=f=re&65535|ne<<16,O=H,j=x,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[2],j=v[2],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[2]=H=ae&65535|ie<<16,v[2]=x=re&65535|ne<<16,O=G,j=J,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[3],j=v[3],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[3]=G=ae&65535|ie<<16,v[3]=J=re&65535|ne<<16,O=N,j=z,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[4],j=v[4],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[4]=N=ae&65535|ie<<16,v[4]=z=re&65535|ne<<16,O=L,j=ee,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[5],j=v[5],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[5]=L=ae&65535|ie<<16,v[5]=ee=re&65535|ne<<16,O=$,j=de,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[6],j=v[6],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[6]=$=ae&65535|ie<<16,v[6]=de=re&65535|ne<<16,O=T,j=me,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=d[7],j=v[7],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[7]=T=ae&65535|ie<<16,v[7]=me=re&65535|ne<<16,_+=128,A-=128}return _}function c(l){var h=new n;h.update(l);var d=h.digest();return h.clean(),d}t.hash=c})(up),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=xs,r=up,n=Yr;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(X){const Y=new Float64Array(16);if(X)for(let W=0;W<X.length;W++)Y[W]=X[W];return Y}const o=new Uint8Array(32);o[0]=9;const c=i(),l=i([1]),h=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),d=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),E=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),_=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function A(X,Y){for(let W=0;W<16;W++)X[W]=Y[W]|0}function P(X){let Y=1;for(let W=0;W<16;W++){let w=X[W]+Y+65535;Y=Math.floor(w/65536),X[W]=w-Y*65536}X[0]+=Y-1+37*(Y-1)}function U(X,Y,W){const w=~(W-1);for(let F=0;F<16;F++){const we=w&(X[F]^Y[F]);X[F]^=we,Y[F]^=we}}function H(X,Y){const W=i(),w=i();for(let F=0;F<16;F++)w[F]=Y[F];P(w),P(w),P(w);for(let F=0;F<2;F++){W[0]=w[0]-65517;for(let ve=1;ve<15;ve++)W[ve]=w[ve]-65535-(W[ve-1]>>16&1),W[ve-1]&=65535;W[15]=w[15]-32767-(W[14]>>16&1);const we=W[15]>>16&1;W[14]&=65535,U(w,W,1-we)}for(let F=0;F<16;F++)X[2*F]=w[F]&255,X[2*F+1]=w[F]>>8}function G(X,Y){let W=0;for(let w=0;w<32;w++)W|=X[w]^Y[w];return(1&W-1>>>8)-1}function N(X,Y){const W=new Uint8Array(32),w=new Uint8Array(32);return H(W,X),H(w,Y),G(W,w)}function L(X){const Y=new Uint8Array(32);return H(Y,X),Y[0]&1}function $(X,Y){for(let W=0;W<16;W++)X[W]=Y[2*W]+(Y[2*W+1]<<8);X[15]&=32767}function T(X,Y,W){for(let w=0;w<16;w++)X[w]=Y[w]+W[w]}function I(X,Y,W){for(let w=0;w<16;w++)X[w]=Y[w]-W[w]}function f(X,Y,W){let w,F,we=0,ve=0,Me=0,nt=0,at=0,Ge=0,Dt=0,$t=0,Je=0,He=0,Be=0,Ke=0,rt=0,Ue=0,Ze=0,b=0,p=0,m=0,D=0,B=0,K=0,Q=0,Ee=0,Te=0,st=0,ht=0,lt=0,Ur=0,Jn=0,Ii=0,cs=0,Ht=W[0],Lt=W[1],zt=W[2],Wt=W[3],Ft=W[4],Mt=W[5],ir=W[6],sr=W[7],qt=W[8],or=W[9],Vt=W[10],Jt=W[11],Kt=W[12],Pt=W[13],ar=W[14],cr=W[15];w=Y[0],we+=w*Ht,ve+=w*Lt,Me+=w*zt,nt+=w*Wt,at+=w*Ft,Ge+=w*Mt,Dt+=w*ir,$t+=w*sr,Je+=w*qt,He+=w*or,Be+=w*Vt,Ke+=w*Jt,rt+=w*Kt,Ue+=w*Pt,Ze+=w*ar,b+=w*cr,w=Y[1],ve+=w*Ht,Me+=w*Lt,nt+=w*zt,at+=w*Wt,Ge+=w*Ft,Dt+=w*Mt,$t+=w*ir,Je+=w*sr,He+=w*qt,Be+=w*or,Ke+=w*Vt,rt+=w*Jt,Ue+=w*Kt,Ze+=w*Pt,b+=w*ar,p+=w*cr,w=Y[2],Me+=w*Ht,nt+=w*Lt,at+=w*zt,Ge+=w*Wt,Dt+=w*Ft,$t+=w*Mt,Je+=w*ir,He+=w*sr,Be+=w*qt,Ke+=w*or,rt+=w*Vt,Ue+=w*Jt,Ze+=w*Kt,b+=w*Pt,p+=w*ar,m+=w*cr,w=Y[3],nt+=w*Ht,at+=w*Lt,Ge+=w*zt,Dt+=w*Wt,$t+=w*Ft,Je+=w*Mt,He+=w*ir,Be+=w*sr,Ke+=w*qt,rt+=w*or,Ue+=w*Vt,Ze+=w*Jt,b+=w*Kt,p+=w*Pt,m+=w*ar,D+=w*cr,w=Y[4],at+=w*Ht,Ge+=w*Lt,Dt+=w*zt,$t+=w*Wt,Je+=w*Ft,He+=w*Mt,Be+=w*ir,Ke+=w*sr,rt+=w*qt,Ue+=w*or,Ze+=w*Vt,b+=w*Jt,p+=w*Kt,m+=w*Pt,D+=w*ar,B+=w*cr,w=Y[5],Ge+=w*Ht,Dt+=w*Lt,$t+=w*zt,Je+=w*Wt,He+=w*Ft,Be+=w*Mt,Ke+=w*ir,rt+=w*sr,Ue+=w*qt,Ze+=w*or,b+=w*Vt,p+=w*Jt,m+=w*Kt,D+=w*Pt,B+=w*ar,K+=w*cr,w=Y[6],Dt+=w*Ht,$t+=w*Lt,Je+=w*zt,He+=w*Wt,Be+=w*Ft,Ke+=w*Mt,rt+=w*ir,Ue+=w*sr,Ze+=w*qt,b+=w*or,p+=w*Vt,m+=w*Jt,D+=w*Kt,B+=w*Pt,K+=w*ar,Q+=w*cr,w=Y[7],$t+=w*Ht,Je+=w*Lt,He+=w*zt,Be+=w*Wt,Ke+=w*Ft,rt+=w*Mt,Ue+=w*ir,Ze+=w*sr,b+=w*qt,p+=w*or,m+=w*Vt,D+=w*Jt,B+=w*Kt,K+=w*Pt,Q+=w*ar,Ee+=w*cr,w=Y[8],Je+=w*Ht,He+=w*Lt,Be+=w*zt,Ke+=w*Wt,rt+=w*Ft,Ue+=w*Mt,Ze+=w*ir,b+=w*sr,p+=w*qt,m+=w*or,D+=w*Vt,B+=w*Jt,K+=w*Kt,Q+=w*Pt,Ee+=w*ar,Te+=w*cr,w=Y[9],He+=w*Ht,Be+=w*Lt,Ke+=w*zt,rt+=w*Wt,Ue+=w*Ft,Ze+=w*Mt,b+=w*ir,p+=w*sr,m+=w*qt,D+=w*or,B+=w*Vt,K+=w*Jt,Q+=w*Kt,Ee+=w*Pt,Te+=w*ar,st+=w*cr,w=Y[10],Be+=w*Ht,Ke+=w*Lt,rt+=w*zt,Ue+=w*Wt,Ze+=w*Ft,b+=w*Mt,p+=w*ir,m+=w*sr,D+=w*qt,B+=w*or,K+=w*Vt,Q+=w*Jt,Ee+=w*Kt,Te+=w*Pt,st+=w*ar,ht+=w*cr,w=Y[11],Ke+=w*Ht,rt+=w*Lt,Ue+=w*zt,Ze+=w*Wt,b+=w*Ft,p+=w*Mt,m+=w*ir,D+=w*sr,B+=w*qt,K+=w*or,Q+=w*Vt,Ee+=w*Jt,Te+=w*Kt,st+=w*Pt,ht+=w*ar,lt+=w*cr,w=Y[12],rt+=w*Ht,Ue+=w*Lt,Ze+=w*zt,b+=w*Wt,p+=w*Ft,m+=w*Mt,D+=w*ir,B+=w*sr,K+=w*qt,Q+=w*or,Ee+=w*Vt,Te+=w*Jt,st+=w*Kt,ht+=w*Pt,lt+=w*ar,Ur+=w*cr,w=Y[13],Ue+=w*Ht,Ze+=w*Lt,b+=w*zt,p+=w*Wt,m+=w*Ft,D+=w*Mt,B+=w*ir,K+=w*sr,Q+=w*qt,Ee+=w*or,Te+=w*Vt,st+=w*Jt,ht+=w*Kt,lt+=w*Pt,Ur+=w*ar,Jn+=w*cr,w=Y[14],Ze+=w*Ht,b+=w*Lt,p+=w*zt,m+=w*Wt,D+=w*Ft,B+=w*Mt,K+=w*ir,Q+=w*sr,Ee+=w*qt,Te+=w*or,st+=w*Vt,ht+=w*Jt,lt+=w*Kt,Ur+=w*Pt,Jn+=w*ar,Ii+=w*cr,w=Y[15],b+=w*Ht,p+=w*Lt,m+=w*zt,D+=w*Wt,B+=w*Ft,K+=w*Mt,Q+=w*ir,Ee+=w*sr,Te+=w*qt,st+=w*or,ht+=w*Vt,lt+=w*Jt,Ur+=w*Kt,Jn+=w*Pt,Ii+=w*ar,cs+=w*cr,we+=38*p,ve+=38*m,Me+=38*D,nt+=38*B,at+=38*K,Ge+=38*Q,Dt+=38*Ee,$t+=38*Te,Je+=38*st,He+=38*ht,Be+=38*lt,Ke+=38*Ur,rt+=38*Jn,Ue+=38*Ii,Ze+=38*cs,F=1,w=we+F+65535,F=Math.floor(w/65536),we=w-F*65536,w=ve+F+65535,F=Math.floor(w/65536),ve=w-F*65536,w=Me+F+65535,F=Math.floor(w/65536),Me=w-F*65536,w=nt+F+65535,F=Math.floor(w/65536),nt=w-F*65536,w=at+F+65535,F=Math.floor(w/65536),at=w-F*65536,w=Ge+F+65535,F=Math.floor(w/65536),Ge=w-F*65536,w=Dt+F+65535,F=Math.floor(w/65536),Dt=w-F*65536,w=$t+F+65535,F=Math.floor(w/65536),$t=w-F*65536,w=Je+F+65535,F=Math.floor(w/65536),Je=w-F*65536,w=He+F+65535,F=Math.floor(w/65536),He=w-F*65536,w=Be+F+65535,F=Math.floor(w/65536),Be=w-F*65536,w=Ke+F+65535,F=Math.floor(w/65536),Ke=w-F*65536,w=rt+F+65535,F=Math.floor(w/65536),rt=w-F*65536,w=Ue+F+65535,F=Math.floor(w/65536),Ue=w-F*65536,w=Ze+F+65535,F=Math.floor(w/65536),Ze=w-F*65536,w=b+F+65535,F=Math.floor(w/65536),b=w-F*65536,we+=F-1+37*(F-1),F=1,w=we+F+65535,F=Math.floor(w/65536),we=w-F*65536,w=ve+F+65535,F=Math.floor(w/65536),ve=w-F*65536,w=Me+F+65535,F=Math.floor(w/65536),Me=w-F*65536,w=nt+F+65535,F=Math.floor(w/65536),nt=w-F*65536,w=at+F+65535,F=Math.floor(w/65536),at=w-F*65536,w=Ge+F+65535,F=Math.floor(w/65536),Ge=w-F*65536,w=Dt+F+65535,F=Math.floor(w/65536),Dt=w-F*65536,w=$t+F+65535,F=Math.floor(w/65536),$t=w-F*65536,w=Je+F+65535,F=Math.floor(w/65536),Je=w-F*65536,w=He+F+65535,F=Math.floor(w/65536),He=w-F*65536,w=Be+F+65535,F=Math.floor(w/65536),Be=w-F*65536,w=Ke+F+65535,F=Math.floor(w/65536),Ke=w-F*65536,w=rt+F+65535,F=Math.floor(w/65536),rt=w-F*65536,w=Ue+F+65535,F=Math.floor(w/65536),Ue=w-F*65536,w=Ze+F+65535,F=Math.floor(w/65536),Ze=w-F*65536,w=b+F+65535,F=Math.floor(w/65536),b=w-F*65536,we+=F-1+37*(F-1),X[0]=we,X[1]=ve,X[2]=Me,X[3]=nt,X[4]=at,X[5]=Ge,X[6]=Dt,X[7]=$t,X[8]=Je,X[9]=He,X[10]=Be,X[11]=Ke,X[12]=rt,X[13]=Ue,X[14]=Ze,X[15]=b}function x(X,Y){f(X,Y,Y)}function J(X,Y){const W=i();let w;for(w=0;w<16;w++)W[w]=Y[w];for(w=253;w>=0;w--)x(W,W),w!==2&&w!==4&&f(W,W,Y);for(w=0;w<16;w++)X[w]=W[w]}function z(X,Y){const W=i();let w;for(w=0;w<16;w++)W[w]=Y[w];for(w=250;w>=0;w--)x(W,W),w!==1&&f(W,W,Y);for(w=0;w<16;w++)X[w]=W[w]}function ee(X,Y){const W=i(),w=i(),F=i(),we=i(),ve=i(),Me=i(),nt=i(),at=i(),Ge=i();I(W,X[1],X[0]),I(Ge,Y[1],Y[0]),f(W,W,Ge),T(w,X[0],X[1]),T(Ge,Y[0],Y[1]),f(w,w,Ge),f(F,X[3],Y[3]),f(F,F,d),f(we,X[2],Y[2]),T(we,we,we),I(ve,w,W),I(Me,we,F),T(nt,we,F),T(at,w,W),f(X[0],ve,Me),f(X[1],at,nt),f(X[2],nt,Me),f(X[3],ve,at)}function de(X,Y,W){for(let w=0;w<4;w++)U(X[w],Y[w],W)}function me(X,Y){const W=i(),w=i(),F=i();J(F,Y[2]),f(W,Y[0],F),f(w,Y[1],F),H(X,w),X[31]^=L(W)<<7}function O(X,Y,W){A(X[0],c),A(X[1],l),A(X[2],l),A(X[3],c);for(let w=255;w>=0;--w){const F=W[w/8|0]>>(w&7)&1;de(X,Y,F),ee(Y,X),ee(X,X),de(X,Y,F)}}function j(X,Y){const W=[i(),i(),i(),i()];A(W[0],v),A(W[1],E),A(W[2],l),f(W[3],v,E),O(X,W,Y)}function ce(X){if(X.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const Y=(0,r.hash)(X);Y[0]&=248,Y[31]&=127,Y[31]|=64;const W=new Uint8Array(32),w=[i(),i(),i(),i()];j(w,Y),me(W,w);const F=new Uint8Array(64);return F.set(X),F.set(W,32),{publicKey:W,secretKey:F}}t.generateKeyPairFromSeed=ce;function le(X){const Y=(0,e.randomBytes)(32,X),W=ce(Y);return(0,n.wipe)(Y),W}t.generateKeyPair=le;function re(X){if(X.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(X.subarray(32))}t.extractPublicKeyFromSecretKey=re;const ne=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 ae(X,Y){let W,w,F,we;for(w=63;w>=32;--w){for(W=0,F=w-32,we=w-12;F<we;++F)Y[F]+=W-16*Y[w]*ne[F-(w-32)],W=Math.floor((Y[F]+128)/256),Y[F]-=W*256;Y[F]+=W,Y[w]=0}for(W=0,F=0;F<32;F++)Y[F]+=W-(Y[31]>>4)*ne[F],W=Y[F]>>8,Y[F]&=255;for(F=0;F<32;F++)Y[F]-=W*ne[F];for(w=0;w<32;w++)Y[w+1]+=Y[w]>>8,X[w]=Y[w]&255}function ie(X){const Y=new Float64Array(64);for(let W=0;W<64;W++)Y[W]=X[W];for(let W=0;W<64;W++)X[W]=0;ae(X,Y)}function Se(X,Y){const W=new Float64Array(64),w=[i(),i(),i(),i()],F=(0,r.hash)(X.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const we=new Uint8Array(64);we.set(F.subarray(32),32);const ve=new r.SHA512;ve.update(we.subarray(32)),ve.update(Y);const Me=ve.digest();ve.clean(),ie(Me),j(w,Me),me(we,w),ve.reset(),ve.update(we.subarray(0,32)),ve.update(X.subarray(32)),ve.update(Y);const nt=ve.digest();ie(nt);for(let at=0;at<32;at++)W[at]=Me[at];for(let at=0;at<32;at++)for(let Ge=0;Ge<32;Ge++)W[at+Ge]+=nt[at]*F[Ge];return ae(we.subarray(32),W),we}t.sign=Se;function ge(X,Y){const W=i(),w=i(),F=i(),we=i(),ve=i(),Me=i(),nt=i();return A(X[2],l),$(X[1],Y),x(F,X[1]),f(we,F,h),I(F,F,X[2]),T(we,X[2],we),x(ve,we),x(Me,ve),f(nt,Me,ve),f(W,nt,F),f(W,W,we),z(W,W),f(W,W,F),f(W,W,we),f(W,W,we),f(X[0],W,we),x(w,X[0]),f(w,w,we),N(w,F)&&f(X[0],X[0],_),x(w,X[0]),f(w,w,we),N(w,F)?-1:(L(X[0])===Y[31]>>7&&I(X[0],c,X[0]),f(X[3],X[0],X[1]),0)}function Fe(X,Y,W){const w=new Uint8Array(32),F=[i(),i(),i(),i()],we=[i(),i(),i(),i()];if(W.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ge(we,X))return!1;const ve=new r.SHA512;ve.update(W.subarray(0,32)),ve.update(X),ve.update(Y);const Me=ve.digest();return ie(Me),O(F,we,Me),j(we,W.subarray(32)),ee(F,we),me(w,F),!G(W,w)}t.verify=Fe;function ye(X){let Y=[i(),i(),i(),i()];if(ge(Y,X))throw new Error("Ed25519: invalid public key");let W=i(),w=i(),F=Y[1];T(W,l,F),I(w,l,F),J(w,w),f(W,W,w);let we=new Uint8Array(32);return H(we,W),we}t.convertPublicKeyToX25519=ye;function Le(X){const Y=(0,r.hash)(X.subarray(0,32));Y[0]&=248,Y[31]&=127,Y[31]|=64;const W=new Uint8Array(Y.subarray(0,32));return(0,n.wipe)(Y),W}t.convertSecretKeyToX25519=Le}(Ku);const A4="EdDSA",S4="JWT",hp=".",fp="base64url",D4="utf8",$4="utf8",P4=":",T4="did",R4="key",dp="base58btc",N4="z",L4="K36",M4=32;function Qa(t){return Dr(Hr(Mo(t),D4),fp)}function pp(t){const e=Hr(L4,dp),r=N4+Dr(au([e,t]),dp);return[T4,R4,r].join(P4)}function U4(t){return Dr(t,fp)}function j4(t){return Hr([Qa(t.header),Qa(t.payload)].join(hp),$4)}function F4(t){return[Qa(t.header),Qa(t.payload),U4(t.signature)].join(hp)}function gp(t=xs.randomBytes(M4)){return Ku.generateKeyPairFromSeed(t)}async function B4(t,e,r,n,i=ke.fromMiliseconds(Date.now())){const o={alg:A4,typ:S4},c=pp(n.publicKey),l=i+r,h={iss:c,sub:t,aud:e,iat:i,exp:l},d=j4({header:o,payload:h}),v=Ku.sign(n.secretKey,d);return F4({header:o,payload:h,signature:v})}const k4="PARSE_ERROR",H4="INVALID_REQUEST",z4="METHOD_NOT_FOUND",W4="INVALID_PARAMS",mp="INTERNAL_ERROR",Gu="SERVER_ERROR",q4=[-32700,-32600,-32601,-32602,-32603],Uo={[k4]:{code:-32700,message:"Parse error"},[H4]:{code:-32600,message:"Invalid Request"},[z4]:{code:-32601,message:"Method not found"},[W4]:{code:-32602,message:"Invalid params"},[mp]:{code:-32603,message:"Internal error"},[Gu]:{code:-32e3,message:"Server error"}},wp=Gu;function V4(t){return q4.includes(t)}function vp(t){return Object.keys(Uo).includes(t)?Uo[t]:Uo[wp]}function K4(t){const e=Object.values(Uo).find(r=>r.code===t);return e||Uo[wp]}function yp(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var bp={};/*! *****************************************************************************
|
|
60
60
|
Copyright (c) Microsoft Corporation.
|
|
61
61
|
|
|
62
62
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -69,17 +69,17 @@
|
|
|
69
69
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
70
70
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
71
71
|
PERFORMANCE OF THIS SOFTWARE.
|
|
72
|
-
***************************************************************************** */var Yu=function(t,e){return Yu=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])},Yu(t,e)};function G4(t,e){Yu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Ju=function(){return Ju=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Ju.apply(this,arguments)};function Z4(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 Y4(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function J4(t,e){return function(r,n){e(r,n,t)}}function X4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Q4(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(E){c(E)}}function h(v){try{d(n.throw(v))}catch(E){c(E)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function e_(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function t_(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function r_(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Xu(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 Ep(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function n_(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ep(arguments[e]));return t}function i_(){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 o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Fo(t){return this instanceof Fo?(this.v=t,this):new Fo(t)}function s_(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,U){o.push([_,A,P,U])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Fo?Promise.resolve(_.value.v).then(d,v):E(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function E(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function o_(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:Fo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function a_(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 Xu=="function"?Xu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function c_(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function l_(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 u_(t){return t&&t.__esModule?t:{default:t}}function h_(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function f_(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 d_=Object.freeze({__proto__:null,__extends:G4,get __assign(){return Ju},__rest:Z4,__decorate:Y4,__param:J4,__metadata:X4,__awaiter:Q4,__generator:e_,__createBinding:t_,__exportStar:r_,__values:Xu,__read:Ep,__spread:n_,__spreadArrays:i_,__await:Fo,__asyncGenerator:s_,__asyncDelegator:o_,__asyncValues:a_,__makeTemplateObject:c_,__importStar:l_,__importDefault:u_,__classPrivateFieldGet:h_,__classPrivateFieldSet:f_}),p_=Mi(d_),Wn={},xp;function g_(){if(xp)return Wn;xp=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.isBrowserCryptoAvailable=Wn.getSubtleCrypto=Wn.getBrowerCrypto=void 0;function t(){return pr?.crypto||pr?.msCrypto||{}}Wn.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Wn.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Wn.isBrowserCryptoAvailable=r,Wn}var qn={},Cp;function m_(){if(Cp)return qn;Cp=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.isBrowser=qn.isNode=qn.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}qn.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}qn.isNode=e;function r(){return!t()&&!e()}return qn.isBrowser=r,qn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=p_;e.__exportStar(g_(),t),e.__exportStar(m_(),t)})(_p);function Ip(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Op(t=6){return BigInt(Ip(t))}function tc(t,e,r){return{id:r||Ip(),jsonrpc:"2.0",method:t,params:e}}function Qu(t,e){return{id:t,jsonrpc:"2.0",result:e}}function rc(t,e,r){return{id:t,jsonrpc:"2.0",error:w_(e,r)}}function w_(t,e){return typeof t>"u"?yp(wp):(typeof t=="string"&&(t=Object.assign(Object.assign({},yp(Zu)),{message:t})),typeof e<"u"&&(t.data=e),V4(t.code)&&(t=K4(t.code)),t)}class v_{}class y_ extends v_{constructor(){super()}}class b_ extends y_{constructor(e){super()}}const __="^https?:",E_="^wss?:";function x_(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Ap(t,e){const r=x_(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Sp(t){return Ap(t,__)}function Dp(t){return Ap(t,E_)}function C_(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function $p(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function eh(t){return $p(t)&&"method"in t}function nc(t){return $p(t)&&(Vn(t)||En(t))}function Vn(t){return"result"in t}function En(t){return"error"in t}class hi extends b_{constructor(e){super(e),this.events=new br.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(tc(e.method,e.params||[],e.id||Op().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${e.id}`,o=>{En(o)?i(o.error):n(o.result)});try{await this.connection.send(e,r)}catch(o){i(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),nc(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const Pp=10,I_=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),O_=()=>typeof window<"u",A_=I_();class S_{constructor(e){if(this.url=e,this.events=new br.exports.EventEmitter,this.registering=!1,!Dp(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(Uo(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!Dp(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",o=>{this.resetMaxListeners(),i(o)}),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=_p.isReactNative()?void 0:{rejectUnauthorized:!C_(e)},o=new A_(e,[],i);O_()?o.onerror=c=>{const l=c;n(this.emitError(l.error))}:o.on("error",c=>{n(this.emitError(c))}),o.onopen=()=>{this.onOpen(o),r(o)}})}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"?Ku(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=rc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return bp(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>Pp&&this.events.setMaxListeners(Pp)}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 th={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,c=9007199254740991,l="[object Arguments]",h="[object Array]",d="[object AsyncFunction]",v="[object Boolean]",E="[object Date]",_="[object Error]",A="[object Function]",P="[object GeneratorFunction]",U="[object Map]",H="[object Number]",G="[object Null]",N="[object Object]",L="[object Promise]",$="[object Proxy]",T="[object RegExp]",I="[object Set]",f="[object String]",x="[object Symbol]",J="[object Undefined]",z="[object WeakMap]",ee="[object ArrayBuffer]",de="[object DataView]",me="[object Float32Array]",O="[object Float64Array]",j="[object Int8Array]",ce="[object Int16Array]",le="[object Int32Array]",re="[object Uint8Array]",ne="[object Uint8ClampedArray]",ae="[object Uint16Array]",ie="[object Uint32Array]",Se=/[\\^$.*+?()[\]{}|]/g,ge=/^\[object .+?Constructor\]$/,Fe=/^(?:0|[1-9]\d*)$/,ye={};ye[me]=ye[O]=ye[j]=ye[ce]=ye[le]=ye[re]=ye[ne]=ye[ae]=ye[ie]=!0,ye[l]=ye[h]=ye[ee]=ye[v]=ye[de]=ye[E]=ye[_]=ye[A]=ye[U]=ye[H]=ye[N]=ye[T]=ye[I]=ye[f]=ye[z]=!1;var Le=typeof pr=="object"&&pr&&pr.Object===Object&&pr,X=typeof self=="object"&&self&&self.Object===Object&&self,Y=Le||X||Function("return this")(),W=e&&!e.nodeType&&e,w=W&&!0&&t&&!t.nodeType&&t,F=w&&w.exports===W,we=F&&Le.process,ve=function(){try{return we&&we.binding&&we.binding("util")}catch{}}(),Me=ve&&ve.isTypedArray;function nt(R,q){for(var fe=-1,Ce=R==null?0:R.length,It=0,Xe=[];++fe<Ce;){var Tt=R[fe];q(Tt,fe,R)&&(Xe[It++]=Tt)}return Xe}function at(R,q){for(var fe=-1,Ce=q.length,It=R.length;++fe<Ce;)R[It+fe]=q[fe];return R}function Ge(R,q){for(var fe=-1,Ce=R==null?0:R.length;++fe<Ce;)if(q(R[fe],fe,R))return!0;return!1}function Dt(R,q){for(var fe=-1,Ce=Array(R);++fe<R;)Ce[fe]=q(fe);return Ce}function $t(R){return function(q){return R(q)}}function Je(R,q){return R.has(q)}function He(R,q){return R?.[q]}function Be(R){var q=-1,fe=Array(R.size);return R.forEach(function(Ce,It){fe[++q]=[It,Ce]}),fe}function Ke(R,q){return function(fe){return R(q(fe))}}function rt(R){var q=-1,fe=Array(R.size);return R.forEach(function(Ce){fe[++q]=Ce}),fe}var Ue=Array.prototype,Ze=Function.prototype,b=Object.prototype,p=Y["__core-js_shared__"],m=Ze.toString,D=b.hasOwnProperty,B=function(){var R=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return R?"Symbol(src)_1."+R:""}(),K=b.toString,Q=RegExp("^"+m.call(D).replace(Se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=F?Y.Buffer:void 0,Te=Y.Symbol,st=Y.Uint8Array,ht=b.propertyIsEnumerable,lt=Ue.splice,Ur=Te?Te.toStringTag:void 0,Jn=Object.getOwnPropertySymbols,Ii=Ee?Ee.isBuffer:void 0,ls=Ke(Object.keys,Object),Ht=Qr(Y,"DataView"),Lt=Qr(Y,"Map"),zt=Qr(Y,"Promise"),Wt=Qr(Y,"Set"),Ft=Qr(Y,"WeakMap"),Mt=Qr(Object,"create"),ir=Qn(Ht),sr=Qn(Lt),qt=Qn(zt),or=Qn(Wt),Vt=Qn(Ft),Jt=Te?Te.prototype:void 0,Kt=Jt?Jt.valueOf:void 0;function Pt(R){var q=-1,fe=R==null?0:R.length;for(this.clear();++q<fe;){var Ce=R[q];this.set(Ce[0],Ce[1])}}function ar(){this.__data__=Mt?Mt(null):{},this.size=0}function cr(R){var q=this.has(R)&&delete this.__data__[R];return this.size-=q?1:0,q}function Ff(R){var q=this.__data__;if(Mt){var fe=q[R];return fe===n?void 0:fe}return D.call(q,R)?q[R]:void 0}function Bf(R){var q=this.__data__;return Mt?q[R]!==void 0:D.call(q,R)}function kf(R,q){var fe=this.__data__;return this.size+=this.has(R)?0:1,fe[R]=Mt&&q===void 0?n:q,this}Pt.prototype.clear=ar,Pt.prototype.delete=cr,Pt.prototype.get=Ff,Pt.prototype.has=Bf,Pt.prototype.set=kf;function fn(R){var q=-1,fe=R==null?0:R.length;for(this.clear();++q<fe;){var Ce=R[q];this.set(Ce[0],Ce[1])}}function Hf(){this.__data__=[],this.size=0}function zf(R){var q=this.__data__,fe=us(q,R);if(fe<0)return!1;var Ce=q.length-1;return fe==Ce?q.pop():lt.call(q,fe,1),--this.size,!0}function Wf(R){var q=this.__data__,fe=us(q,R);return fe<0?void 0:q[fe][1]}function qf(R){return us(this.__data__,R)>-1}function Vf(R,q){var fe=this.__data__,Ce=us(fe,R);return Ce<0?(++this.size,fe.push([R,q])):fe[Ce][1]=q,this}fn.prototype.clear=Hf,fn.prototype.delete=zf,fn.prototype.get=Wf,fn.prototype.has=qf,fn.prototype.set=Vf;function Xn(R){var q=-1,fe=R==null?0:R.length;for(this.clear();++q<fe;){var Ce=R[q];this.set(Ce[0],Ce[1])}}function Qs(){this.size=0,this.__data__={hash:new Pt,map:new(Lt||fn),string:new Pt}}function Kf(R){var q=Oi(this,R).delete(R);return this.size-=q?1:0,q}function eo(R){return Oi(this,R).get(R)}function Gf(R){return Oi(this,R).has(R)}function Zf(R,q){var fe=Oi(this,R),Ce=fe.size;return fe.set(R,q),this.size+=fe.size==Ce?0:1,this}Xn.prototype.clear=Qs,Xn.prototype.delete=Kf,Xn.prototype.get=eo,Xn.prototype.has=Gf,Xn.prototype.set=Zf;function to(R){var q=-1,fe=R==null?0:R.length;for(this.__data__=new Xn;++q<fe;)this.add(R[q])}function Zc(R){return this.__data__.set(R,n),this}function Yc(R){return this.__data__.has(R)}to.prototype.add=to.prototype.push=Zc,to.prototype.has=Yc;function xn(R){var q=this.__data__=new fn(R);this.size=q.size}function Yf(){this.__data__=new fn,this.size=0}function Jf(R){var q=this.__data__,fe=q.delete(R);return this.size=q.size,fe}function Xf(R){return this.__data__.get(R)}function Qf(R){return this.__data__.has(R)}function Jc(R,q){var fe=this.__data__;if(fe instanceof fn){var Ce=fe.__data__;if(!Lt||Ce.length<r-1)return Ce.push([R,q]),this.size=++fe.size,this;fe=this.__data__=new Xn(Ce)}return fe.set(R,q),this.size=fe.size,this}xn.prototype.clear=Yf,xn.prototype.delete=Jf,xn.prototype.get=Xf,xn.prototype.has=Qf,xn.prototype.set=Jc;function Xc(R,q){var fe=io(R),Ce=!fe&&ul(R),It=!fe&&!Ce&&ya(R),Xe=!fe&&!Ce&&!It&&dl(R),Tt=fe||Ce||It||Xe,lr=Tt?Dt(R.length,String):[],mt=lr.length;for(var Ot in R)(q||D.call(R,Ot))&&!(Tt&&(Ot=="length"||It&&(Ot=="offset"||Ot=="parent")||Xe&&(Ot=="buffer"||Ot=="byteLength"||Ot=="byteOffset")||sl(Ot,mt)))&&lr.push(Ot);return lr}function us(R,q){for(var fe=R.length;fe--;)if(ll(R[fe][0],q))return fe;return-1}function wa(R,q,fe){var Ce=q(R);return io(R)?Ce:at(Ce,fe(R))}function hs(R){return R==null?R===void 0?J:G:Ur&&Ur in Object(R)?nl(R):r0(R)}function va(R){return ds(R)&&hs(R)==l}function fs(R,q,fe,Ce,It){return R===q?!0:R==null||q==null||!ds(R)&&!ds(q)?R!==R&&q!==q:Qc(R,q,fe,Ce,fs,It)}function Qc(R,q,fe,Ce,It,Xe){var Tt=io(R),lr=io(q),mt=Tt?h:jn(R),Ot=lr?h:jn(q);mt=mt==l?N:mt,Ot=Ot==l?N:Ot;var Xt=mt==N,qr=Ot==N,ur=mt==Ot;if(ur&&ya(R)){if(!ya(q))return!1;Tt=!0,Xt=!1}if(ur&&!Xt)return Xe||(Xe=new xn),Tt||dl(R)?ro(R,q,fe,Ce,It,Xe):t0(R,q,mt,fe,Ce,It,Xe);if(!(fe&i)){var Rt=Xt&&D.call(R,"__wrapped__"),jr=qr&&D.call(q,"__wrapped__");if(Rt||jr){var Cn=Rt?R.value():R,dn=jr?q.value():q;return Xe||(Xe=new xn),It(Cn,dn,fe,Ce,Xe)}}return ur?(Xe||(Xe=new xn),rl(R,q,fe,Ce,It,Xe)):!1}function e0(R){if(!fl(R)||al(R))return!1;var q=so(R)?Q:ge;return q.test(Qn(R))}function el(R){return ds(R)&&hl(R.length)&&!!ye[hs(R)]}function tl(R){if(!cl(R))return ls(R);var q=[];for(var fe in Object(R))D.call(R,fe)&&fe!="constructor"&&q.push(fe);return q}function ro(R,q,fe,Ce,It,Xe){var Tt=fe&i,lr=R.length,mt=q.length;if(lr!=mt&&!(Tt&&mt>lr))return!1;var Ot=Xe.get(R);if(Ot&&Xe.get(q))return Ot==q;var Xt=-1,qr=!0,ur=fe&o?new to:void 0;for(Xe.set(R,q),Xe.set(q,R);++Xt<lr;){var Rt=R[Xt],jr=q[Xt];if(Ce)var Cn=Tt?Ce(jr,Rt,Xt,q,R,Xe):Ce(Rt,jr,Xt,R,q,Xe);if(Cn!==void 0){if(Cn)continue;qr=!1;break}if(ur){if(!Ge(q,function(dn,Fn){if(!Je(ur,Fn)&&(Rt===dn||It(Rt,dn,fe,Ce,Xe)))return ur.push(Fn)})){qr=!1;break}}else if(!(Rt===jr||It(Rt,jr,fe,Ce,Xe))){qr=!1;break}}return Xe.delete(R),Xe.delete(q),qr}function t0(R,q,fe,Ce,It,Xe,Tt){switch(fe){case de:if(R.byteLength!=q.byteLength||R.byteOffset!=q.byteOffset)return!1;R=R.buffer,q=q.buffer;case ee:return!(R.byteLength!=q.byteLength||!Xe(new st(R),new st(q)));case v:case E:case H:return ll(+R,+q);case _:return R.name==q.name&&R.message==q.message;case T:case f:return R==q+"";case U:var lr=Be;case I:var mt=Ce&i;if(lr||(lr=rt),R.size!=q.size&&!mt)return!1;var Ot=Tt.get(R);if(Ot)return Ot==q;Ce|=o,Tt.set(R,q);var Xt=ro(lr(R),lr(q),Ce,It,Xe,Tt);return Tt.delete(R),Xt;case x:if(Kt)return Kt.call(R)==Kt.call(q)}return!1}function rl(R,q,fe,Ce,It,Xe){var Tt=fe&i,lr=no(R),mt=lr.length,Ot=no(q),Xt=Ot.length;if(mt!=Xt&&!Tt)return!1;for(var qr=mt;qr--;){var ur=lr[qr];if(!(Tt?ur in q:D.call(q,ur)))return!1}var Rt=Xe.get(R);if(Rt&&Xe.get(q))return Rt==q;var jr=!0;Xe.set(R,q),Xe.set(q,R);for(var Cn=Tt;++qr<mt;){ur=lr[qr];var dn=R[ur],Fn=q[ur];if(Ce)var ba=Tt?Ce(Fn,dn,ur,q,R,Xe):Ce(dn,Fn,ur,R,q,Xe);if(!(ba===void 0?dn===Fn||It(dn,Fn,fe,Ce,Xe):ba)){jr=!1;break}Cn||(Cn=ur=="constructor")}if(jr&&!Cn){var ps=R.constructor,vr=q.constructor;ps!=vr&&"constructor"in R&&"constructor"in q&&!(typeof ps=="function"&&ps instanceof ps&&typeof vr=="function"&&vr instanceof vr)&&(jr=!1)}return Xe.delete(R),Xe.delete(q),jr}function no(R){return wa(R,s0,il)}function Oi(R,q){var fe=R.__data__;return ol(q)?fe[typeof q=="string"?"string":"hash"]:fe.map}function Qr(R,q){var fe=He(R,q);return e0(fe)?fe:void 0}function nl(R){var q=D.call(R,Ur),fe=R[Ur];try{R[Ur]=void 0;var Ce=!0}catch{}var It=K.call(R);return Ce&&(q?R[Ur]=fe:delete R[Ur]),It}var il=Jn?function(R){return R==null?[]:(R=Object(R),nt(Jn(R),function(q){return ht.call(R,q)}))}:Ct,jn=hs;(Ht&&jn(new Ht(new ArrayBuffer(1)))!=de||Lt&&jn(new Lt)!=U||zt&&jn(zt.resolve())!=L||Wt&&jn(new Wt)!=I||Ft&&jn(new Ft)!=z)&&(jn=function(R){var q=hs(R),fe=q==N?R.constructor:void 0,Ce=fe?Qn(fe):"";if(Ce)switch(Ce){case ir:return de;case sr:return U;case qt:return L;case or:return I;case Vt:return z}return q});function sl(R,q){return q=q??c,!!q&&(typeof R=="number"||Fe.test(R))&&R>-1&&R%1==0&&R<q}function ol(R){var q=typeof R;return q=="string"||q=="number"||q=="symbol"||q=="boolean"?R!=="__proto__":R===null}function al(R){return!!B&&B in R}function cl(R){var q=R&&R.constructor,fe=typeof q=="function"&&q.prototype||b;return R===fe}function r0(R){return K.call(R)}function Qn(R){if(R!=null){try{return m.call(R)}catch{}try{return R+""}catch{}}return""}function ll(R,q){return R===q||R!==R&&q!==q}var ul=va(function(){return arguments}())?va:function(R){return ds(R)&&D.call(R,"callee")&&!ht.call(R,"callee")},io=Array.isArray;function n0(R){return R!=null&&hl(R.length)&&!so(R)}var ya=Ii||xt;function i0(R,q){return fs(R,q)}function so(R){if(!fl(R))return!1;var q=hs(R);return q==A||q==P||q==d||q==$}function hl(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=c}function fl(R){var q=typeof R;return R!=null&&(q=="object"||q=="function")}function ds(R){return R!=null&&typeof R=="object"}var dl=Me?$t(Me):el;function s0(R){return n0(R)?Xc(R):tl(R)}function Ct(){return[]}function xt(){return!1}t.exports=i0})(th,th.exports);var D_=th.exports,$_=Object.defineProperty,Tp=Object.getOwnPropertySymbols,P_=Object.prototype.hasOwnProperty,T_=Object.prototype.propertyIsEnumerable,Rp=(t,e,r)=>e in t?$_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rr=(t,e)=>{for(var r in e||(e={}))P_.call(e,r)&&Rp(t,r,e[r]);if(Tp)for(var r of Tp(e))T_.call(e,r)&&Rp(t,r,e[r]);return t};function R_(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 o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),d=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function E(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var U=0,H=0,G=0,N=P.length;G!==N&&P[G]===0;)G++,U++;for(var L=(N-G)*v+1>>>0,$=new Uint8Array(L);G!==N;){for(var T=P[G],I=0,f=L-1;(T!==0||I<H)&&f!==-1;f--,I++)T+=256*$[f]>>>0,$[f]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,G++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(U);x<L;++x)J+=t.charAt($[x]);return J}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var U=0;if(P[U]!==" "){for(var H=0,G=0;P[U]===h;)H++,U++;for(var N=(P.length-U)*d+1>>>0,L=new Uint8Array(N);P[U];){var $=r[P.charCodeAt(U)];if($===255)return;for(var T=0,I=N-1;($!==0||T<G)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");G=T,U++}if(P[U]!==" "){for(var f=N-G;f!==N&&L[f]===0;)f++;for(var x=new Uint8Array(H+(N-f)),J=H;f!==N;)x[J++]=L[f++];return x}}}function A(P){var U=_(P);if(U)return U;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:A}}var N_=R_,L_=N_;const Np=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")},M_=t=>new TextEncoder().encode(t),U_=t=>new TextDecoder().decode(t);class j_{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class F_{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Lp(this,e)}}class B_{constructor(e){this.decoders=e}or(e){return Lp(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 Lp=(t,e)=>new B_(Rr(Rr({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class k_{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new j_(e,r,n),this.decoder=new F_(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ic=({name:t,prefix:e,encode:r,decode:n})=>new k_(t,e,r,n),Bo=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=L_(r,e);return ic({prefix:t,name:e,encode:n,decode:o=>Np(i(o))})},H_=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,d=0;for(let v=0;v<o;++v){const E=i[t[v]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|E,l+=r,l>=8&&(l-=8,c[d++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},z_=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},Er=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>ic({prefix:e,name:t,encode(i){return z_(i,n,r)},decode(i){return H_(i,n,r,t)}}),W_=ic({prefix:"\0",name:"identity",encode:t=>U_(t),decode:t=>M_(t)});var q_=Object.freeze({__proto__:null,identity:W_});const V_=Er({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var K_=Object.freeze({__proto__:null,base2:V_});const G_=Er({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Z_=Object.freeze({__proto__:null,base8:G_});const Y_=Bo({prefix:"9",name:"base10",alphabet:"0123456789"});var J_=Object.freeze({__proto__:null,base10:Y_});const X_=Er({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Q_=Er({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var e8=Object.freeze({__proto__:null,base16:X_,base16upper:Q_});const t8=Er({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),r8=Er({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),n8=Er({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),i8=Er({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),s8=Er({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),o8=Er({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),a8=Er({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),c8=Er({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),l8=Er({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var u8=Object.freeze({__proto__:null,base32:t8,base32upper:r8,base32pad:n8,base32padupper:i8,base32hex:s8,base32hexupper:o8,base32hexpad:a8,base32hexpadupper:c8,base32z:l8});const h8=Bo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),f8=Bo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var d8=Object.freeze({__proto__:null,base36:h8,base36upper:f8});const p8=Bo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),g8=Bo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var m8=Object.freeze({__proto__:null,base58btc:p8,base58flickr:g8});const w8=Er({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),v8=Er({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),y8=Er({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),b8=Er({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var _8=Object.freeze({__proto__:null,base64:w8,base64pad:v8,base64url:y8,base64urlpad:b8});const Mp=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}"),E8=Mp.reduce((t,e,r)=>(t[r]=e,t),[]),x8=Mp.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function C8(t){return t.reduce((e,r)=>(e+=E8[r],e),"")}function I8(t){const e=[];for(const r of t){const n=x8[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const O8=ic({prefix:"\u{1F680}",name:"base256emoji",encode:C8,decode:I8});var A8=Object.freeze({__proto__:null,base256emoji:O8}),S8=jp,Up=128,D8=127,$8=~D8,P8=Math.pow(2,31);function jp(t,e,r){e=e||[],r=r||0;for(var n=r;t>=P8;)e[r++]=t&255|Up,t/=128;for(;t&$8;)e[r++]=t&255|Up,t>>>=7;return e[r]=t|0,jp.bytes=r-n+1,e}var T8=rh,R8=128,Fp=127;function rh(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw rh.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Fp)<<i:(c&Fp)*Math.pow(2,i),i+=7}while(c>=R8);return rh.bytes=o-n,r}var N8=Math.pow(2,7),L8=Math.pow(2,14),M8=Math.pow(2,21),U8=Math.pow(2,28),j8=Math.pow(2,35),F8=Math.pow(2,42),B8=Math.pow(2,49),k8=Math.pow(2,56),H8=Math.pow(2,63),z8=function(t){return t<N8?1:t<L8?2:t<M8?3:t<U8?4:t<j8?5:t<F8?6:t<B8?7:t<k8?8:t<H8?9:10},W8={encode:S8,decode:T8,encodingLength:z8},Bp=W8;const kp=(t,e,r=0)=>(Bp.encode(t,e,r),e),Hp=t=>Bp.encodingLength(t),nh=(t,e)=>{const r=e.byteLength,n=Hp(t),i=n+Hp(r),o=new Uint8Array(i+r);return kp(t,o,0),kp(r,o,n),o.set(e,i),new q8(t,r,e,o)};class q8{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const zp=({name:t,code:e,encode:r})=>new V8(t,e,r);class V8{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?nh(this.code,r):r.then(n=>nh(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Wp=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),K8=zp({name:"sha2-256",code:18,encode:Wp("SHA-256")}),G8=zp({name:"sha2-512",code:19,encode:Wp("SHA-512")});var Z8=Object.freeze({__proto__:null,sha256:K8,sha512:G8});const qp=0,Y8="identity",Vp=Np;var J8=Object.freeze({__proto__:null,identity:{code:qp,name:Y8,encode:Vp,digest:t=>nh(qp,Vp(t))}});new TextEncoder,new TextDecoder;const Kp=Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr({},q_),K_),Z_),J_),e8),u8),d8),m8),_8),A8);Rr(Rr({},Z8),J8);function Gp(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function X8(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Gp(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Zp(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Yp=Zp("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),ih=Zp("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=X8(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Q8=Rr({utf8:Yp,"utf-8":Yp,hex:Kp.base16,latin1:ih,ascii:ih,binary:ih},Kp);function eE(t,e="utf8"){const r=Q8[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Gp(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const Jp="wc",tE=2,sh="core",fi=`${Jp}@${2}:${sh}:`,rE={name:sh,logger:"error"},nE={database:":memory:"},iE="crypto",Xp="client_ed25519_seed",sE=ke.ONE_DAY,oE="keychain",aE="0.3",cE="messages",lE="0.3",uE=ke.SIX_HOURS,hE="publisher",Qp="irn",fE="error",eg="wss://relay.walletconnect.com",dE="relayer",rr={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},pE="_subscription",ko={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},gE=ke.ONE_SECOND/2,mE="2.7.8",wE=1e4,vE="0.3",Pn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},yE="subscription",bE="0.3",_E=ke.FIVE_SECONDS*1e3,EE="pairing",xE="0.3",Ho={wc_pairingDelete:{req:{ttl:ke.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ke.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ke.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ke.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ke.ONE_DAY,prompt:!1,tag:0},res:{ttl:ke.ONE_DAY,prompt:!1,tag:0}}},Tn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},CE="history",IE="0.3",OE="expirer",on={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},AE="0.3",oh="verify-api",tg="https://verify.walletconnect.com";class SE{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=oE,this.version=aE,this.initialized=!1,this.storagePrefix=fi,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:o}=_e("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(o)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,$1(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?P1(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class DE{constructor(e,r,n){this.core=e,this.logger=r,this.name=iE,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(),o=mp(i);return gp(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=j5();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=mp(o),l=Ou();return await B4(l,i,sE,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),h=F5(l,o);return this.setSymKey(h,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||B5(i);return await this.keychain.set(c,i),c},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,o,c)=>{this.isInitialized();const l=x1(c),h=Uo(o);if(C1(l)){const _=l.senderPublicKey,A=l.receiverPublicKey;i=await this.generateSharedKey(_,A)}const d=this.getSymKey(i),{type:v,senderPublicKey:E}=l;return H5({type:v,symKey:d,message:h,senderPublicKey:E})},this.decode=async(i,o,c)=>{this.isInitialized();const l=q5(o,c);if(C1(l)){const v=l.receiverPublicKey,E=l.senderPublicKey;i=await this.generateSharedKey(v,E)}const h=this.getSymKey(i),d=z5({symKey:h,encoded:o});return Ku(d)},this.getPayloadType=i=>{const o=Ka(i);return Oo(o.type)},this.getPayloadSenderPublicKey=i=>{const o=Ka(i);return o.senderPublicKey?Dr(o.senderPublicKey,$r):void 0},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.keychain=n||new SE(this.core,this.logger)}get context(){return pt.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Xp)}catch{e=Ou(),await this.keychain.set(Xp,e)}return eE(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class $E extends m4{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=cE,this.version=lE,this.initialized=!1,this.storagePrefix=fi,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 o=As(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[o]<"u"||(c[o]=i,this.messages.set(n,c),await this.persist()),o},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const o=this.get(n),c=As(i);return typeof o[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=pt.generateChildLogger(e,this.name),this.core=r}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,$1(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?P1(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class PE extends w4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new br.exports.EventEmitter,this.name=hE,this.queue=new Map,this.publishTimeout=1e4,this.publish=async(n,i,o)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});try{const c=o?.ttl||uE,l=$u(o),h=o?.prompt||!1,d=o?.tag||0,v=o?.id||Op().toString(),E={topic:n,message:i,opts:{ttl:c,relay:l,prompt:h,tag:d,id:v}};this.queue.set(v,E);try{await await Ga(this.rpcPublish(n,i,c,l,h,d,v),this.publishTimeout),this.relayer.events.emit(rr.publish,E)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(rr.connection_stalled);return}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}})}catch(c){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(c),c}},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=pt.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return pt.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,o,c,l){var h,d,v,E;const _={method:Za(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:o,tag:c},id:l};return Pr((h=_.params)==null?void 0:h.prompt)&&((d=_.params)==null||delete d.prompt),Pr((v=_.params)==null?void 0:v.tag)&&((E=_.params)==null||delete E.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:_}),this.relayer.request(_)}onPublish(e){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(To.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()}),this.relayer.on(rr.message_ack,e=>{this.onPublish(e.id.toString())})}}class TE{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(o=>o!==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 RE=Object.defineProperty,NE=Object.defineProperties,LE=Object.getOwnPropertyDescriptors,rg=Object.getOwnPropertySymbols,ME=Object.prototype.hasOwnProperty,UE=Object.prototype.propertyIsEnumerable,ng=(t,e,r)=>e in t?RE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zo=(t,e)=>{for(var r in e||(e={}))ME.call(e,r)&&ng(t,r,e[r]);if(rg)for(var r of rg(e))UE.call(e,r)&&ng(t,r,e[r]);return t},ah=(t,e)=>NE(t,LE(e));class jE extends b4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new TE,this.events=new br.exports.EventEmitter,this.name=yE,this.version=bE,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=fi,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 o=$u(i),c={topic:n,relay:o};this.pending.set(n,c);const l=await this.rpcSubscribe(n,o);return this.onSubscribe(l,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),l}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}},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,o)=>{const c=new ke.Watch;c.start(this.pendingSubscriptionWatchLabel);const l=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(l),c.stop(this.pendingSubscriptionWatchLabel),i(!0)),c.elapsed(this.pendingSubscriptionWatchLabel)>=_E&&(clearInterval(l),c.stop(this.pendingSubscriptionWatchLabel),o(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!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.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=pt.generateChildLogger(r,this.name),this.clientId=""}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=$u(n);await this.rpcUnsubscribe(e,r,i);const o=Zt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,o),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:Za(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Ga(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(rr.connection_stalled)}return As(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:Za(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 Ga(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(rr.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:Za(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,ah(zo({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,zo({},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,zo({},r)),this.topicMap.set(r.topic,e),this.events.emit(Pn.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}=_e("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(Pn.deleted,ah(zo({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Pn.sync)}async reset(){if(this.cached.length){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(Pn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=_e("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);zn(r)&&this.onBatchSubscribe(r.map((n,i)=>ah(zo({},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(To.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(rr.connect,async()=>{await this.onConnect()}),this.relayer.on(rr.disconnect,()=>{this.onDisconnect()}),this.events.on(Pn.created,async e=>{const r=Pn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Pn.deleted,async e=>{const r=Pn.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}=_e("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 FE=Object.defineProperty,ig=Object.getOwnPropertySymbols,BE=Object.prototype.hasOwnProperty,kE=Object.prototype.propertyIsEnumerable,sg=(t,e,r)=>e in t?FE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,HE=(t,e)=>{for(var r in e||(e={}))BE.call(e,r)&&sg(t,r,e[r]);if(ig)for(var r of ig(e))kE.call(e,r)&&sg(t,r,e[r]);return t};class zE extends v4{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new br.exports.EventEmitter,this.name=dE,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?pt.generateChildLogger(e.logger,this.name):pt.pino(pt.getDefaultLoggerOptions({level:e.logger||fE})),this.messages=new $E(this.logger,e.core),this.subscriber=new jE(this,this.logger),this.publisher=new PE(this,this.logger),this.relayUrl=e?.relayUrl||eg,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribted to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},wE)}get context(){return pt.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){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";return i||(await Promise.all([new Promise(o=>{this.subscriber.once(Pn.created,c=>{c.topic===e&&o()})}),new Promise(async o=>{i=await this.subscriber.subscribe(e,r),o()})]),i)}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(rr.transport_closed))}async transportOpen(e){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=e||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(Pn.resubscribed,()=>{r()})}),await Promise.race([new Promise(async(r,n)=>{await Ga(this.provider.connect(),5e3,"socket stalled").catch(i=>n(i)).then(()=>r()).finally(()=>this.removeListener(rr.transport_closed,this.rejectTransportOpen))}),new Promise(r=>this.once(rr.transport_closed,this.rejectTransportOpen))])])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.events.emit(rr.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=e||this.relayUrl,this.connected&&await Promise.all([new Promise(r=>{this.provider.once(ko.disconnect,()=>{r()})}),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}rejectTransportOpen(){throw new Error("closeTransport called before connection was established")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new hi(new S_(rb({sdkVersion:mE,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;return await this.subscriber.isSubscribed(r)?this.messages.has(r,n):!0}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),eh(e)){if(!e.method.endsWith(pE))return;const r=e.params,{topic:n,message:i,publishedAt:o}=r.data,c={topic:n,message:i,publishedAt:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(HE({type:"event",event:r.id},c)),this.events.emit(r.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else nc(e)&&this.events.emit(rr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(rr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=Qu(e.id,!0);await this.provider.connection.send(r)}registerProviderListeners(){this.provider.on(ko.payload,e=>this.onProviderPayload(e)),this.provider.on(ko.connect,()=>{this.events.emit(rr.connect)}),this.provider.on(ko.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(ko.error,e=>{this.logger.error(e),this.events.emit(rr.error,e)})}registerEventListeners(){this.events.on(rr.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(rr.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},ke.toMiliseconds(gE))}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var WE=Object.defineProperty,og=Object.getOwnPropertySymbols,qE=Object.prototype.hasOwnProperty,VE=Object.prototype.propertyIsEnumerable,ag=(t,e,r)=>e in t?WE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cg=(t,e)=>{for(var r in e||(e={}))qE.call(e,r)&&ag(t,r,e[r]);if(og)for(var r of og(e))VE.call(e,r)&&ag(t,r,e[r]);return t};class sc extends y4{constructor(e,r,n,i=fi,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=vE,this.cached=[],this.initialized=!1,this.storagePrefix=fi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!Pr(c)?this.map.set(this.getKey(c),c):Cb(c)?this.map.set(c.id,c):Ib(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,l)=>{this.isInitialized(),this.map.has(c)?await this.update(c,l):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:l}),this.map.set(c,l),await this.persist())},this.get=c=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:c}),this.getData(c)),this.getAll=c=>(this.isInitialized(),c?this.values.filter(l=>Object.keys(c).every(h=>D_(l[h],c[h]))):this.values),this.update=async(c,l)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:l});const h=cg(cg({},this.getData(c)),l);this.map.set(c,h),await this.persist()},this.delete=async(c,l)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:l}),this.map.delete(c),await this.persist())},this.logger=pt.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return pt.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}=_e("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}=_e("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}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class KE{constructor(e,r){this.core=e,this.logger=r,this.name=EE,this.version=xE,this.events=new br.exports,this.initialized=!1,this.storagePrefix=fi,this.ignoredPayloadTypes=[Bi],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=Ou(),i=await this.core.crypto.setSymKey(n),o=$n(ke.FIVE_MINUTES),c={protocol:Qp},l={topic:i,expiry:o,relay:c,active:!1},h=pb({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:c});return await this.pairings.set(i,l),await this.core.relayer.subscribe(i),this.core.expirer.set(i,o),{topic:i,uri:h}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:o,relay:c}=hb(n.uri);if(this.pairings.keys.includes(i))throw new Error(`Pairing already exists: ${i}`);if(this.core.crypto.hasKeys(i))throw new Error(`Keychain already exists: ${i}`);const l=$n(ke.FIVE_MINUTES),h={topic:i,relay:c,expiry:l,active:!1};return await this.pairings.set(i,h),await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:c}),this.core.expirer.set(i,l),n.activatePairing&&await this.activate({topic:i}),h},this.activate=async({topic:n})=>{this.isInitialized();const i=$n(ke.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 o=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:l,reject:h}=Ss();this.events.once(tr("pairing_ping",o),({error:d})=>{d?h(d):l()}),await c()}},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",Zt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,o)=>{const c=tc(i,o),l=await this.core.crypto.encode(n,c),h=Ho[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,l,h),c.id},this.sendResult=async(n,i,o)=>{const c=Qu(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),d=Ho[h.request.method].res;await this.core.relayer.publish(i,l,d),await this.core.history.resolve(c)},this.sendError=async(n,i,o)=>{const c=rc(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),d=Ho[h.request.method]?Ho[h.request.method].res:Ho.unregistered_method.res;await this.core.relayer.publish(i,l,d),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Zt("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=>ui(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:o}=n,c=o.method;if(this.pairings.keys.includes(i))switch(c){case"wc_pairingPing":return this.onPairingPingRequest(i,o);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,o);default:return this.onUnknownRpcMethodRequest(i,o)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:o}=n,c=(await this.core.history.get(i,o.id)).request.method;if(this.pairings.keys.includes(i))switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,o);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:o}=i;try{this.isValidPing({topic:n}),await this.sendResult(o,n,!0),this.events.emit("pairing_ping",{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:o}=i;setTimeout(()=>{Vn(i)?this.events.emit(tr("pairing_ping",o),{}):En(i)&&this.events.emit(tr("pairing_ping",o),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:o}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:o,method:c}=i;try{if(this.registeredMethods.includes(c))return;const l=Zt("WC_METHOD_UNSUPPORTED",c);await this.sendError(o,n,l),this.logger.error(l)}catch(l){await this.sendError(o,n,l),this.logger.error(l)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Zt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!zr(n)){const{message:i}=_e("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!xb(n.uri)){const{message:i}=_e("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!zr(n)){const{message:o}=_e("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!zr(n)){const{message:o}=_e("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!gr(n,!1)){const{message:i}=_e("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=_e("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(ui(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=_e("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.pairings=new sc(this.core,this.logger,this.name,this.storagePrefix)}get context(){return pt.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(rr.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);eh(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):nc(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(on.expired,async e=>{const{topic:r}=R1(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class GE extends g4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new br.exports.EventEmitter,this.name=CE,this.version=IE,this.cached=[],this.initialized=!1,this.storagePrefix=fi,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,o)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:o}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:o};this.records.set(c.id,c),this.events.emit(Tn.created,c)},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=En(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(Tn.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(o=>{if(o.topic===n){if(typeof i<"u"&&o.id!==i)return;this.records.delete(o.id),this.events.emit(Tn.deleted,o)}})},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=pt.generateChildLogger(r,this.name)}get context(){return pt.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:tc(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}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Tn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=_e("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(Tn.created,e=>{const r=Tn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Tn.updated,e=>{const r=Tn.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Tn.deleted,e=>{const r=Tn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ZE extends _4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new br.exports.EventEmitter,this.name=OE,this.version=AE,this.cached=[],this.initialized=!1,this.storagePrefix=fi,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 o=this.formatTarget(n),c={target:o,expiry:i};this.expirations.set(o,c),this.checkExpiry(o,c),this.events.emit(on.created,{target:o,expiration:c})},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),o=this.getExpiration(i);this.expirations.delete(i),this.events.emit(on.deleted,{target:i,expiration: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.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.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 nb(e);if(typeof e=="number")return ib(e);const{message:r}=_e("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(on.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=_e("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}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ke.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(on.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(To.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(on.created,e=>{const r=on.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(on.expired,e=>{const r=on.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(on.deleted,e=>{const r=on.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class YE extends E4{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=oh,this.initialized=!1,this.init=async n=>{S1()||!Su()||(this.verifyUrl=n?.verifyUrl||tg,await this.createIframe())},this.register=async n=>{var i;this.initialized||await this.init(),this.iframe&&((i=this.iframe.contentWindow)==null||i.postMessage(n.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${n.attestationId} ${this.verifyUrl}`))},this.resolve=async n=>{var i;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${n.attestationId}`);const o=this.startAbortTimer(ke.FIVE_SECONDS),c=await fetch(`${this.verifyUrl}/attestation/${n.attestationId}`,{signal:this.abortController.signal});return clearTimeout(o),c.status===200?(i=await c.json())==null?void 0:i.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise((n,i)=>{if(document.getElementById(oh))return n();const o=document.createElement("iframe");o.setAttribute("id",oh),o.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),o.style.display="none",o.addEventListener("load",()=>{this.initialized=!0,n()}),o.addEventListener("error",c=>{i(c)}),document.body.append(o),this.iframe=o}),new Promise(n=>{setTimeout(()=>n("iframe load timeout"),ke.toMiliseconds(ke.ONE_SECOND/2))})])}catch(n){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(n)}},this.logger=pt.generateChildLogger(r,this.name),this.verifyUrl=tg,this.abortController=new AbortController,this.isDevEnv=Au()&&process.env.IS_VITEST}get context(){return pt.getLoggerContext(this.logger)}startAbortTimer(e){return setTimeout(()=>this.abortController.abort(),ke.toMiliseconds(e))}}var JE=Object.defineProperty,lg=Object.getOwnPropertySymbols,XE=Object.prototype.hasOwnProperty,QE=Object.prototype.propertyIsEnumerable,ug=(t,e,r)=>e in t?JE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hg=(t,e)=>{for(var r in e||(e={}))XE.call(e,r)&&ug(t,r,e[r]);if(lg)for(var r of lg(e))QE.call(e,r)&&ug(t,r,e[r]);return t};class ch extends p4{constructor(e){super(e),this.protocol=Jp,this.version=tE,this.name=sh,this.events=new br.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||eg;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||rE.logger}));this.logger=pt.generateChildLogger(r,this.name),this.heartbeat=new To.HeartBeat,this.crypto=new DE(this,this.logger,e?.keychain),this.history=new GE(this,this.logger),this.expirer=new ZE(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new v6(hg(hg({},nE),e?.storageOptions)),this.relayer=new zE({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new KE(this,this.logger),this.verify=new YE(this.projectId||"",this.logger)}static async init(e){const r=new ch(e);return await r.initialize(),r}get context(){return pt.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 e7=ch,fg="wc",dg=2,pg="client",lh=`${fg}@${dg}:${pg}:`,uh={name:pg,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},t7="proposal",gg="Proposal expired",r7="session",oc=ke.SEVEN_DAYS,n7="engine",Wo={wc_sessionPropose:{req:{ttl:ke.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ke.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ke.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ke.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ke.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ke.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ke.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ke.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ke.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ke.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ke.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ke.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ke.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ke.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ke.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ke.THIRTY_SECONDS,prompt:!1,tag:1115}}},hh={min:ke.FIVE_MINUTES,max:ke.SEVEN_DAYS},i7="request",s7=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var o7=Object.defineProperty,a7=Object.defineProperties,c7=Object.getOwnPropertyDescriptors,mg=Object.getOwnPropertySymbols,l7=Object.prototype.hasOwnProperty,u7=Object.prototype.propertyIsEnumerable,wg=(t,e,r)=>e in t?o7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,an=(t,e)=>{for(var r in e||(e={}))l7.call(e,r)&&wg(t,r,e[r]);if(mg)for(var r of mg(e))u7.call(e,r)&&wg(t,r,e[r]);return t},fh=(t,e)=>a7(t,c7(e));class h7 extends C4{constructor(e){super(e),this.name=n7,this.events=new br.exports,this.initialized=!1,this.ignoredPayloadTypes=[Bi],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Wo)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized();const n=fh(an({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:h}=n;let d=i,v,E=!1;if(d&&(E=this.client.core.pairing.pairings.get(d).active),!d||!E){const{topic:L,uri:$}=await this.client.core.pairing.create();d=L,v=$}const _=await this.client.core.crypto.generateKeyPair(),A=an({requiredNamespaces:o,optionalNamespaces:c,relays:h??[{protocol:Qp}],proposer:{publicKey:_,metadata:this.client.metadata}},l&&{sessionProperties:l}),{reject:P,resolve:U,done:H}=Ss(ke.FIVE_MINUTES,gg);if(this.events.once(tr("session_connect"),async({error:L,session:$})=>{if(L)P(L);else if($){$.self.publicKey=_;const T=fh(an({},$),{requiredNamespaces:$.requiredNamespaces,optionalNamespaces:$.optionalNamespaces});await this.client.session.set($.topic,T),await this.setExpiry($.topic,$.expiry),d&&await this.client.core.pairing.updateMetadata({topic:d,metadata:$.peer.metadata}),U(T)}}),!d){const{message:L}=_e("NO_MATCHING_KEY",`connect() pairing topic: ${d}`);throw new Error(L)}const G=await this.sendRequest(d,"wc_sessionPropose",A),N=$n(ke.FIVE_MINUTES);return await this.setProposal(G,an({id:G,expiry:N},A)),{uri:v,approval:H}},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:o,sessionProperties:c}=r,l=this.client.proposal.get(n);let{pairingTopic:h,proposer:d,requiredNamespaces:v,optionalNamespaces:E}=l;h=h||"",$s(v)||(v=vb(o,"approve()"));const _=await this.client.core.crypto.generateKeyPair(),A=d.publicKey,P=await this.client.core.crypto.generateSharedKey(_,A);h&&n&&(await this.client.core.pairing.updateMetadata({topic:h,metadata:d.metadata}),await this.sendResult(n,h,{relay:{protocol:i??"irn"},responderPublicKey:_}),await this.client.proposal.delete(n,Zt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}));const U=an({relay:{protocol:i??"irn"},namespaces:o,requiredNamespaces:v,optionalNamespaces:E,pairingTopic:h,controller:{publicKey:_,metadata:this.client.metadata},expiry:$n(oc)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(P),await this.sendRequest(P,"wc_sessionSettle",U);const H=fh(an({},U),{topic:P,pairingTopic:h,acknowledged:!1,self:U.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:_});return await this.client.session.set(P,H),await this.setExpiry(P,$n(oc)),{topic:P,acknowledged:()=>new Promise(G=>setTimeout(()=>G(this.client.session.get(P)),500))}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:o}=this.client.proposal.get(n);o&&(await this.sendError(n,o,i),await this.client.proposal.delete(n,Zt("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,o=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:c,resolve:l,reject:h}=Ss();return this.events.once(tr("session_update",o),({error:d})=>{d?h(d):l()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:c}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:o,resolve:c,reject:l}=Ss();return this.events.once(tr("session_extend",i),({error:h})=>{h?l(h):c()}),await this.setExpiry(n,$n(oc)),{acknowledged:o}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:o,expiry:c}=r,l=await this.sendRequest(o,"wc_sessionRequest",{request:i,chainId:n},c),{done:h,resolve:d,reject:v}=Ss(c);return this.events.once(tr("session_request",l),({error:E,result:_})=>{E?v(E):d(_)}),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:l}),await h()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;Vn(i)?await this.sendResult(o,n,i.result):En(i)&&await this.sendError(o,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:o,resolve:c,reject:l}=Ss();this.events.once(tr("session_ping",i),({error:h})=>{h?l(h):c()}),await o()}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:o}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:o})},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",Zt("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=>_b(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(o=>{var c,l;return((c=o.peerMetadata)==null?void 0:c.url)&&((l=o.peerMetadata)==null?void 0:l.url)===r.peer.metadata.url&&o.topic&&o.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(o=>this.client.core.pairing.disconnect({topic:o.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},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,Zt("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,Zt("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=Wo.wc_sessionRequest.req.ttl,{id:i,topic:o,params:c}=r;await this.client.pendingRequest.set(i,{id:i,topic:o,params:c}),n&&this.client.core.expirer.set(i,$n(n))},this.sendRequest=async(r,n,i,o)=>{const c=tc(n,i);if(Su()&&s7.includes(n)){const d=As(JSON.stringify(c));await this.client.core.verify.register({attestationId:d})}const l=await this.client.core.crypto.encode(r,c),h=Wo[n].req;return o&&(h.ttl=o),this.client.core.history.set(r,c),this.client.core.relayer.publish(r,l,h),c.id},this.sendResult=async(r,n,i)=>{const o=Qu(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),h=Wo[l.request.method].res;this.client.core.relayer.publish(n,c,h),await this.client.core.history.resolve(o)},this.sendError=async(r,n,i)=>{const o=rc(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),h=Wo[l.request.method].res;this.client.core.relayer.publish(n,c,h),await this.client.core.history.resolve(o)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{ui(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{ui(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,o=i.method;switch(o){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 ${o}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){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 ${o}`)}},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidConnect(an({},n.params));const c=$n(ke.FIVE_MINUTES),l=an({id:o,pairingTopic:r,expiry:c},i);await this.setProposal(o,l);const h=As(JSON.stringify(n)),d=await this.getVerifyContext(h,l.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:l,verifyContext:d})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(Vn(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const l=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const h=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:h});const d=await this.client.core.crypto.generateSharedKey(l,h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:d});const v=await this.client.core.relayer.subscribe(d);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:v}),await this.client.core.pairing.activate({topic:r})}else En(n)&&(await this.client.proposal.delete(i,Zt("USER_DISCONNECTED")),this.events.emit(tr("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidSessionSettleRequest(o);const{relay:c,controller:l,expiry:h,namespaces:d,requiredNamespaces:v,optionalNamespaces:E,sessionProperties:_,pairingTopic:A}=n.params,P=an({topic:r,relay:c,expiry:h,namespaces:d,acknowledged:!0,pairingTopic:A,requiredNamespaces:v,optionalNamespaces:E,controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},_&&{sessionProperties:_});await this.sendResult(n.id,r,!0),this.events.emit(tr("session_connect"),{session:P}),this.cleanupDuplicatePairings(P)}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Vn(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(tr("session_approve",i),{})):En(n)&&(await this.client.session.delete(r,Zt("USER_DISCONNECTED")),this.events.emit(tr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidUpdate(an({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(o,r,!0),this.client.events.emit("session_update",{id:o,topic:r,params:i})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(tr("session_update",i),{}):En(n)&&this.events.emit(tr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,$n(oc)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(tr("session_extend",i),{}):En(n)&&this.events.emit(tr("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(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{Vn(n)?this.events.emit(tr("session_ping",i),{}):En(n)&&this.events.emit(tr("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(o=>{this.client.core.relayer.once(rr.publish,async()=>{o(await this.deleteSession(r))})}),this.sendResult(i,r,!0)]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidRequest(an({topic:r},o)),await this.setPendingSessionRequest({id:i,topic:r,params:o});const c=As(JSON.stringify(n)),l=this.client.session.get(r),h=await this.getVerifyContext(c,l.peer.metadata);this.client.events.emit("session_request",{id:i,topic:r,params:o,verifyContext:h})}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(tr("session_request",i),{result:n.result}):En(n)&&this.events.emit(tr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidEmit(an({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o})}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.isValidConnect=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(h)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:o,sessionProperties:c,relays:l}=r;if(Pr(n)||await this.isValidPairingTopic(n),!Rb(l,!0)){const{message:h}=_e("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(h)}!Pr(i)&&$s(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Pr(o)&&$s(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Pr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=Tb(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!zr(r))throw new Error(_e("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:o,sessionProperties:c}=r;await this.isValidProposalId(n);const l=this.client.proposal.get(n),h=Ja(i,"approve()");if(h)throw new Error(h.message);const d=k1(l.requiredNamespaces,i,"approve()");if(d)throw new Error(d.message);if(!gr(o,!0)){const{message:v}=_e("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(v)}Pr(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async r=>{if(!zr(r)){const{message:o}=_e("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!Lb(i)){const{message:o}=_e("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!zr(r)){const{message:d}=_e("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(d)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!F1(n)){const{message:d}=_e("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(d)}const l=Ob(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const h=Ja(o,"onSessionSettleRequest()");if(h)throw new Error(h.message);if(ui(c)){const{message:d}=_e("EXPIRED","onSessionSettleRequest()");throw new Error(d)}},this.isValidUpdate=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(h)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const o=this.client.session.get(n),c=Ja(i,"update()");if(c)throw new Error(c.message);const l=k1(o.requiredNamespaces,i,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(h)}const{topic:n,request:i,chainId:o,expiry:c}=r;await this.isValidSessionTopic(n);const{namespaces:l}=this.client.session.get(n);if(!B1(l,o)){const{message:h}=_e("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(h)}if(!Mb(i)){const{message:h}=_e("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(h)}if(!Fb(l,o,i.method)){const{message:h}=_e("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(h)}if(c&&!zb(c,hh)){const{message:h}=_e("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${hh.min} and ${hh.max}`);throw new Error(h)}},this.isValidRespond=async r=>{if(!zr(r)){const{message:o}=_e("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!Ub(i)){const{message:o}=_e("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!zr(r)){const{message:l}=_e("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(l)}const{topic:n,event:i,chainId:o}=r;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!B1(c,o)){const{message:l}=_e("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!jb(i)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!Bb(c,o,i.name)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}},this.isValidDisconnect=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||"",validation:"UNKNOWN",origin:n.url||""}};try{const o=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});o&&(i.verified.origin=o,i.verified.validation=o===n.url?"VALID":"INVALID")}catch(o){this.client.logger.error(o)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!gr(i,!1)){const{message:o}=_e("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(o)}})}}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(rr.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);eh(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):nc(i)&&(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.client.core.expirer.on(on.expired,async e=>{const{topic:r,id:n}=R1(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,_e("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(!gr(e,!1)){const{message:r}=_e("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}=_e("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(ui(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=_e("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!gr(e,!1)){const{message:r}=_e("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(ui(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=_e("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(gr(e,!1)){const{message:r}=_e("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=_e("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!Nb(e)){const{message:r}=_e("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(ui(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=_e("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class f7 extends sc{constructor(e,r){super(e,r,t7,lh),this.core=e,this.logger=r}}class d7 extends sc{constructor(e,r){super(e,r,r7,lh),this.core=e,this.logger=r}}class p7 extends sc{constructor(e,r){super(e,r,i7,lh,n=>n.id),this.core=e,this.logger=r}}class dh extends x4{constructor(e){super(e),this.protocol=fg,this.version=dg,this.name=uh.name,this.events=new br.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||uh.name,this.metadata=e?.metadata||X5();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||uh.logger}));this.core=e?.core||new e7(e),this.logger=pt.generateChildLogger(r,this.name),this.session=new d7(this.core,this.logger),this.proposal=new f7(this.core,this.logger),this.pendingRequest=new p7(this.core,this.logger),this.engine=new h7(this)}static async init(e){const r=new dh(e);return await r.initialize(),r}get context(){return pt.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.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var ph={exports:{}};(function(t,e){var r=typeof self<"u"?self:pr,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(c){var l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function h(O){return O&&DataView.prototype.isPrototypeOf(O)}if(l.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=ArrayBuffer.isView||function(O){return O&&d.indexOf(Object.prototype.toString.call(O))>-1};function E(O){if(typeof O!="string"&&(O=String(O)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(O))throw new TypeError("Invalid character in header field name");return O.toLowerCase()}function _(O){return typeof O!="string"&&(O=String(O)),O}function A(O){var j={next:function(){var ce=O.shift();return{done:ce===void 0,value:ce}}};return l.iterable&&(j[Symbol.iterator]=function(){return j}),j}function P(O){this.map={},O instanceof P?O.forEach(function(j,ce){this.append(ce,j)},this):Array.isArray(O)?O.forEach(function(j){this.append(j[0],j[1])},this):O&&Object.getOwnPropertyNames(O).forEach(function(j){this.append(j,O[j])},this)}P.prototype.append=function(O,j){O=E(O),j=_(j);var ce=this.map[O];this.map[O]=ce?ce+", "+j:j},P.prototype.delete=function(O){delete this.map[E(O)]},P.prototype.get=function(O){return O=E(O),this.has(O)?this.map[O]:null},P.prototype.has=function(O){return this.map.hasOwnProperty(E(O))},P.prototype.set=function(O,j){this.map[E(O)]=_(j)},P.prototype.forEach=function(O,j){for(var ce in this.map)this.map.hasOwnProperty(ce)&&O.call(j,this.map[ce],ce,this)},P.prototype.keys=function(){var O=[];return this.forEach(function(j,ce){O.push(ce)}),A(O)},P.prototype.values=function(){var O=[];return this.forEach(function(j){O.push(j)}),A(O)},P.prototype.entries=function(){var O=[];return this.forEach(function(j,ce){O.push([ce,j])}),A(O)},l.iterable&&(P.prototype[Symbol.iterator]=P.prototype.entries);function U(O){if(O.bodyUsed)return Promise.reject(new TypeError("Already read"));O.bodyUsed=!0}function H(O){return new Promise(function(j,ce){O.onload=function(){j(O.result)},O.onerror=function(){ce(O.error)}})}function G(O){var j=new FileReader,ce=H(j);return j.readAsArrayBuffer(O),ce}function N(O){var j=new FileReader,ce=H(j);return j.readAsText(O),ce}function L(O){for(var j=new Uint8Array(O),ce=new Array(j.length),le=0;le<j.length;le++)ce[le]=String.fromCharCode(j[le]);return ce.join("")}function $(O){if(O.slice)return O.slice(0);var j=new Uint8Array(O.byteLength);return j.set(new Uint8Array(O)),j.buffer}function T(){return this.bodyUsed=!1,this._initBody=function(O){this._bodyInit=O,O?typeof O=="string"?this._bodyText=O:l.blob&&Blob.prototype.isPrototypeOf(O)?this._bodyBlob=O:l.formData&&FormData.prototype.isPrototypeOf(O)?this._bodyFormData=O:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(O)?this._bodyText=O.toString():l.arrayBuffer&&l.blob&&h(O)?(this._bodyArrayBuffer=$(O.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(O)||v(O))?this._bodyArrayBuffer=$(O):this._bodyText=O=Object.prototype.toString.call(O):this._bodyText="",this.headers.get("content-type")||(typeof O=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(O)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var O=U(this);if(O)return O;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?U(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(G)}),this.text=function(){var O=U(this);if(O)return O;if(this._bodyBlob)return N(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(J)}),this.json=function(){return this.text().then(JSON.parse)},this}var I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function f(O){var j=O.toUpperCase();return I.indexOf(j)>-1?j:O}function x(O,j){j=j||{};var ce=j.body;if(O instanceof x){if(O.bodyUsed)throw new TypeError("Already read");this.url=O.url,this.credentials=O.credentials,j.headers||(this.headers=new P(O.headers)),this.method=O.method,this.mode=O.mode,this.signal=O.signal,!ce&&O._bodyInit!=null&&(ce=O._bodyInit,O.bodyUsed=!0)}else this.url=String(O);if(this.credentials=j.credentials||this.credentials||"same-origin",(j.headers||!this.headers)&&(this.headers=new P(j.headers)),this.method=f(j.method||this.method||"GET"),this.mode=j.mode||this.mode||null,this.signal=j.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ce)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ce)}x.prototype.clone=function(){return new x(this,{body:this._bodyInit})};function J(O){var j=new FormData;return O.trim().split("&").forEach(function(ce){if(ce){var le=ce.split("="),re=le.shift().replace(/\+/g," "),ne=le.join("=").replace(/\+/g," ");j.append(decodeURIComponent(re),decodeURIComponent(ne))}}),j}function z(O){var j=new P,ce=O.replace(/\r?\n[\t ]+/g," ");return ce.split(/\r?\n/).forEach(function(le){var re=le.split(":"),ne=re.shift().trim();if(ne){var ae=re.join(":").trim();j.append(ne,ae)}}),j}T.call(x.prototype);function ee(O,j){j||(j={}),this.type="default",this.status=j.status===void 0?200:j.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in j?j.statusText:"OK",this.headers=new P(j.headers),this.url=j.url||"",this._initBody(O)}T.call(ee.prototype),ee.prototype.clone=function(){return new ee(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new P(this.headers),url:this.url})},ee.error=function(){var O=new ee(null,{status:0,statusText:""});return O.type="error",O};var de=[301,302,303,307,308];ee.redirect=function(O,j){if(de.indexOf(j)===-1)throw new RangeError("Invalid status code");return new ee(null,{status:j,headers:{location:O}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(j,ce){this.message=j,this.name=ce;var le=Error(j);this.stack=le.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function me(O,j){return new Promise(function(ce,le){var re=new x(O,j);if(re.signal&&re.signal.aborted)return le(new c.DOMException("Aborted","AbortError"));var ne=new XMLHttpRequest;function ae(){ne.abort()}ne.onload=function(){var ie={status:ne.status,statusText:ne.statusText,headers:z(ne.getAllResponseHeaders()||"")};ie.url="responseURL"in ne?ne.responseURL:ie.headers.get("X-Request-URL");var Se="response"in ne?ne.response:ne.responseText;ce(new ee(Se,ie))},ne.onerror=function(){le(new TypeError("Network request failed"))},ne.ontimeout=function(){le(new TypeError("Network request failed"))},ne.onabort=function(){le(new c.DOMException("Aborted","AbortError"))},ne.open(re.method,re.url,!0),re.credentials==="include"?ne.withCredentials=!0:re.credentials==="omit"&&(ne.withCredentials=!1),"responseType"in ne&&l.blob&&(ne.responseType="blob"),re.headers.forEach(function(ie,Se){ne.setRequestHeader(Se,ie)}),re.signal&&(re.signal.addEventListener("abort",ae),ne.onreadystatechange=function(){ne.readyState===4&&re.signal.removeEventListener("abort",ae)}),ne.send(typeof re._bodyInit>"u"?null:re._bodyInit)})}return me.polyfill=!0,o.fetch||(o.fetch=me,o.Headers=P,o.Request=x,o.Response=ee),c.Headers=P,c.Request=x,c.Response=ee,c.fetch=me,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(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})(ph,ph.exports);var vg=gw(ph.exports);const yg={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},bg=10;class Vi{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new br.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Sp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}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=Uo(e),o=await(await vg(this.url,Object.assign(Object.assign({},yg),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Sp(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",o=>{this.resetMaxListeners(),i(o)}),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{if(!this.disableProviderPing){const r=Uo({id:1,jsonrpc:"2.0",method:"test",params:[]});await vg(e,Object.assign(Object.assign({},yg),{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"?Ku(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=rc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return bp(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>bg&&this.events.setMaxListeners(bg)}}const _g="error",g7="wss://relay.walletconnect.com",m7="wc",w7="universal_provider",Eg=`${m7}@${2}:${w7}:`,v7="https://rpc.walletconnect.com/v1",di={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var qo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},gh={exports:{}};/**
|
|
72
|
+
***************************************************************************** */var Zu=function(t,e){return Zu=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])},Zu(t,e)};function G4(t,e){Zu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Yu=function(){return Yu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Yu.apply(this,arguments)};function Z4(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 Y4(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function J4(t,e){return function(r,n){e(r,n,t)}}function X4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Q4(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(E){c(E)}}function h(v){try{d(n.throw(v))}catch(E){c(E)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function e_(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function t_(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function r_(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Ju(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 _p(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function n_(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_p(arguments[e]));return t}function i_(){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 o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function jo(t){return this instanceof jo?(this.v=t,this):new jo(t)}function s_(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,U){o.push([_,A,P,U])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof jo?Promise.resolve(_.value.v).then(d,v):E(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function E(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function o_(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,o){e[i]=t[i]?function(c){return(r=!r)?{value:jo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function a_(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 Ju=="function"?Ju(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function c_(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function l_(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 u_(t){return t&&t.__esModule?t:{default:t}}function h_(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function f_(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 d_=Object.freeze({__proto__:null,__extends:G4,get __assign(){return Yu},__rest:Z4,__decorate:Y4,__param:J4,__metadata:X4,__awaiter:Q4,__generator:e_,__createBinding:t_,__exportStar:r_,__values:Ju,__read:_p,__spread:n_,__spreadArrays:i_,__await:jo,__asyncGenerator:s_,__asyncDelegator:o_,__asyncValues:a_,__makeTemplateObject:c_,__importStar:l_,__importDefault:u_,__classPrivateFieldGet:h_,__classPrivateFieldSet:f_}),p_=Mi(d_),Wn={},Ep;function g_(){if(Ep)return Wn;Ep=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.isBrowserCryptoAvailable=Wn.getSubtleCrypto=Wn.getBrowerCrypto=void 0;function t(){return pr?.crypto||pr?.msCrypto||{}}Wn.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Wn.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Wn.isBrowserCryptoAvailable=r,Wn}var qn={},xp;function m_(){if(xp)return qn;xp=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.isBrowser=qn.isNode=qn.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}qn.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}qn.isNode=e;function r(){return!t()&&!e()}return qn.isBrowser=r,qn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=p_;e.__exportStar(g_(),t),e.__exportStar(m_(),t)})(bp);function Cp(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Ip(t=6){return BigInt(Cp(t))}function ec(t,e,r){return{id:r||Cp(),jsonrpc:"2.0",method:t,params:e}}function Xu(t,e){return{id:t,jsonrpc:"2.0",result:e}}function tc(t,e,r){return{id:t,jsonrpc:"2.0",error:w_(e,r)}}function w_(t,e){return typeof t>"u"?vp(mp):(typeof t=="string"&&(t=Object.assign(Object.assign({},vp(Gu)),{message:t})),typeof e<"u"&&(t.data=e),V4(t.code)&&(t=K4(t.code)),t)}class v_{}class y_ extends v_{constructor(){super()}}class b_ extends y_{constructor(e){super()}}const __="^https?:",E_="^wss?:";function x_(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Op(t,e){const r=x_(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Ap(t){return Op(t,__)}function Sp(t){return Op(t,E_)}function C_(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Dp(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Qu(t){return Dp(t)&&"method"in t}function rc(t){return Dp(t)&&(Vn(t)||En(t))}function Vn(t){return"result"in t}function En(t){return"error"in t}class hi extends b_{constructor(e){super(e),this.events=new br.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(ec(e.method,e.params||[],e.id||Ip().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${e.id}`,o=>{En(o)?i(o.error):n(o.result)});try{await this.connection.send(e,r)}catch(o){i(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),rc(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const $p=10,I_=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),O_=()=>typeof window<"u",A_=I_();class S_{constructor(e){if(this.url=e,this.events=new br.exports.EventEmitter,this.registering=!1,!Sp(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(Mo(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!Sp(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",o=>{this.resetMaxListeners(),i(o)}),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=bp.isReactNative()?void 0:{rejectUnauthorized:!C_(e)},o=new A_(e,[],i);O_()?o.onerror=c=>{const l=c;n(this.emitError(l.error))}:o.on("error",c=>{n(this.emitError(c))}),o.onopen=()=>{this.onOpen(o),r(o)}})}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"?Vu(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=tc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return yp(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>$p&&this.events.setMaxListeners($p)}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 eh={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,c=9007199254740991,l="[object Arguments]",h="[object Array]",d="[object AsyncFunction]",v="[object Boolean]",E="[object Date]",_="[object Error]",A="[object Function]",P="[object GeneratorFunction]",U="[object Map]",H="[object Number]",G="[object Null]",N="[object Object]",L="[object Promise]",$="[object Proxy]",T="[object RegExp]",I="[object Set]",f="[object String]",x="[object Symbol]",J="[object Undefined]",z="[object WeakMap]",ee="[object ArrayBuffer]",de="[object DataView]",me="[object Float32Array]",O="[object Float64Array]",j="[object Int8Array]",ce="[object Int16Array]",le="[object Int32Array]",re="[object Uint8Array]",ne="[object Uint8ClampedArray]",ae="[object Uint16Array]",ie="[object Uint32Array]",Se=/[\\^$.*+?()[\]{}|]/g,ge=/^\[object .+?Constructor\]$/,Fe=/^(?:0|[1-9]\d*)$/,ye={};ye[me]=ye[O]=ye[j]=ye[ce]=ye[le]=ye[re]=ye[ne]=ye[ae]=ye[ie]=!0,ye[l]=ye[h]=ye[ee]=ye[v]=ye[de]=ye[E]=ye[_]=ye[A]=ye[U]=ye[H]=ye[N]=ye[T]=ye[I]=ye[f]=ye[z]=!1;var Le=typeof pr=="object"&&pr&&pr.Object===Object&&pr,X=typeof self=="object"&&self&&self.Object===Object&&self,Y=Le||X||Function("return this")(),W=e&&!e.nodeType&&e,w=W&&!0&&t&&!t.nodeType&&t,F=w&&w.exports===W,we=F&&Le.process,ve=function(){try{return we&&we.binding&&we.binding("util")}catch{}}(),Me=ve&&ve.isTypedArray;function nt(R,q){for(var fe=-1,Ce=R==null?0:R.length,It=0,Xe=[];++fe<Ce;){var Tt=R[fe];q(Tt,fe,R)&&(Xe[It++]=Tt)}return Xe}function at(R,q){for(var fe=-1,Ce=q.length,It=R.length;++fe<Ce;)R[It+fe]=q[fe];return R}function Ge(R,q){for(var fe=-1,Ce=R==null?0:R.length;++fe<Ce;)if(q(R[fe],fe,R))return!0;return!1}function Dt(R,q){for(var fe=-1,Ce=Array(R);++fe<R;)Ce[fe]=q(fe);return Ce}function $t(R){return function(q){return R(q)}}function Je(R,q){return R.has(q)}function He(R,q){return R?.[q]}function Be(R){var q=-1,fe=Array(R.size);return R.forEach(function(Ce,It){fe[++q]=[It,Ce]}),fe}function Ke(R,q){return function(fe){return R(q(fe))}}function rt(R){var q=-1,fe=Array(R.size);return R.forEach(function(Ce){fe[++q]=Ce}),fe}var Ue=Array.prototype,Ze=Function.prototype,b=Object.prototype,p=Y["__core-js_shared__"],m=Ze.toString,D=b.hasOwnProperty,B=function(){var R=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return R?"Symbol(src)_1."+R:""}(),K=b.toString,Q=RegExp("^"+m.call(D).replace(Se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=F?Y.Buffer:void 0,Te=Y.Symbol,st=Y.Uint8Array,ht=b.propertyIsEnumerable,lt=Ue.splice,Ur=Te?Te.toStringTag:void 0,Jn=Object.getOwnPropertySymbols,Ii=Ee?Ee.isBuffer:void 0,cs=Ke(Object.keys,Object),Ht=Qr(Y,"DataView"),Lt=Qr(Y,"Map"),zt=Qr(Y,"Promise"),Wt=Qr(Y,"Set"),Ft=Qr(Y,"WeakMap"),Mt=Qr(Object,"create"),ir=Qn(Ht),sr=Qn(Lt),qt=Qn(zt),or=Qn(Wt),Vt=Qn(Ft),Jt=Te?Te.prototype:void 0,Kt=Jt?Jt.valueOf:void 0;function Pt(R){var q=-1,fe=R==null?0:R.length;for(this.clear();++q<fe;){var Ce=R[q];this.set(Ce[0],Ce[1])}}function ar(){this.__data__=Mt?Mt(null):{},this.size=0}function cr(R){var q=this.has(R)&&delete this.__data__[R];return this.size-=q?1:0,q}function jf(R){var q=this.__data__;if(Mt){var fe=q[R];return fe===n?void 0:fe}return D.call(q,R)?q[R]:void 0}function Ff(R){var q=this.__data__;return Mt?q[R]!==void 0:D.call(q,R)}function Bf(R,q){var fe=this.__data__;return this.size+=this.has(R)?0:1,fe[R]=Mt&&q===void 0?n:q,this}Pt.prototype.clear=ar,Pt.prototype.delete=cr,Pt.prototype.get=jf,Pt.prototype.has=Ff,Pt.prototype.set=Bf;function fn(R){var q=-1,fe=R==null?0:R.length;for(this.clear();++q<fe;){var Ce=R[q];this.set(Ce[0],Ce[1])}}function kf(){this.__data__=[],this.size=0}function Hf(R){var q=this.__data__,fe=ls(q,R);if(fe<0)return!1;var Ce=q.length-1;return fe==Ce?q.pop():lt.call(q,fe,1),--this.size,!0}function zf(R){var q=this.__data__,fe=ls(q,R);return fe<0?void 0:q[fe][1]}function Wf(R){return ls(this.__data__,R)>-1}function qf(R,q){var fe=this.__data__,Ce=ls(fe,R);return Ce<0?(++this.size,fe.push([R,q])):fe[Ce][1]=q,this}fn.prototype.clear=kf,fn.prototype.delete=Hf,fn.prototype.get=zf,fn.prototype.has=Wf,fn.prototype.set=qf;function Xn(R){var q=-1,fe=R==null?0:R.length;for(this.clear();++q<fe;){var Ce=R[q];this.set(Ce[0],Ce[1])}}function Xs(){this.size=0,this.__data__={hash:new Pt,map:new(Lt||fn),string:new Pt}}function Vf(R){var q=Oi(this,R).delete(R);return this.size-=q?1:0,q}function Qs(R){return Oi(this,R).get(R)}function Kf(R){return Oi(this,R).has(R)}function Gf(R,q){var fe=Oi(this,R),Ce=fe.size;return fe.set(R,q),this.size+=fe.size==Ce?0:1,this}Xn.prototype.clear=Xs,Xn.prototype.delete=Vf,Xn.prototype.get=Qs,Xn.prototype.has=Kf,Xn.prototype.set=Gf;function eo(R){var q=-1,fe=R==null?0:R.length;for(this.__data__=new Xn;++q<fe;)this.add(R[q])}function Gc(R){return this.__data__.set(R,n),this}function Zc(R){return this.__data__.has(R)}eo.prototype.add=eo.prototype.push=Gc,eo.prototype.has=Zc;function xn(R){var q=this.__data__=new fn(R);this.size=q.size}function Zf(){this.__data__=new fn,this.size=0}function Yf(R){var q=this.__data__,fe=q.delete(R);return this.size=q.size,fe}function Jf(R){return this.__data__.get(R)}function Xf(R){return this.__data__.has(R)}function Yc(R,q){var fe=this.__data__;if(fe instanceof fn){var Ce=fe.__data__;if(!Lt||Ce.length<r-1)return Ce.push([R,q]),this.size=++fe.size,this;fe=this.__data__=new Xn(Ce)}return fe.set(R,q),this.size=fe.size,this}xn.prototype.clear=Zf,xn.prototype.delete=Yf,xn.prototype.get=Jf,xn.prototype.has=Xf,xn.prototype.set=Yc;function Jc(R,q){var fe=no(R),Ce=!fe&&ll(R),It=!fe&&!Ce&&va(R),Xe=!fe&&!Ce&&!It&&fl(R),Tt=fe||Ce||It||Xe,lr=Tt?Dt(R.length,String):[],mt=lr.length;for(var Ot in R)(q||D.call(R,Ot))&&!(Tt&&(Ot=="length"||It&&(Ot=="offset"||Ot=="parent")||Xe&&(Ot=="buffer"||Ot=="byteLength"||Ot=="byteOffset")||il(Ot,mt)))&&lr.push(Ot);return lr}function ls(R,q){for(var fe=R.length;fe--;)if(cl(R[fe][0],q))return fe;return-1}function ma(R,q,fe){var Ce=q(R);return no(R)?Ce:at(Ce,fe(R))}function us(R){return R==null?R===void 0?J:G:Ur&&Ur in Object(R)?rl(R):t0(R)}function wa(R){return fs(R)&&us(R)==l}function hs(R,q,fe,Ce,It){return R===q?!0:R==null||q==null||!fs(R)&&!fs(q)?R!==R&&q!==q:Xc(R,q,fe,Ce,hs,It)}function Xc(R,q,fe,Ce,It,Xe){var Tt=no(R),lr=no(q),mt=Tt?h:jn(R),Ot=lr?h:jn(q);mt=mt==l?N:mt,Ot=Ot==l?N:Ot;var Xt=mt==N,qr=Ot==N,ur=mt==Ot;if(ur&&va(R)){if(!va(q))return!1;Tt=!0,Xt=!1}if(ur&&!Xt)return Xe||(Xe=new xn),Tt||fl(R)?to(R,q,fe,Ce,It,Xe):e0(R,q,mt,fe,Ce,It,Xe);if(!(fe&i)){var Rt=Xt&&D.call(R,"__wrapped__"),jr=qr&&D.call(q,"__wrapped__");if(Rt||jr){var Cn=Rt?R.value():R,dn=jr?q.value():q;return Xe||(Xe=new xn),It(Cn,dn,fe,Ce,Xe)}}return ur?(Xe||(Xe=new xn),tl(R,q,fe,Ce,It,Xe)):!1}function Qf(R){if(!hl(R)||ol(R))return!1;var q=io(R)?Q:ge;return q.test(Qn(R))}function Qc(R){return fs(R)&&ul(R.length)&&!!ye[us(R)]}function el(R){if(!al(R))return cs(R);var q=[];for(var fe in Object(R))D.call(R,fe)&&fe!="constructor"&&q.push(fe);return q}function to(R,q,fe,Ce,It,Xe){var Tt=fe&i,lr=R.length,mt=q.length;if(lr!=mt&&!(Tt&&mt>lr))return!1;var Ot=Xe.get(R);if(Ot&&Xe.get(q))return Ot==q;var Xt=-1,qr=!0,ur=fe&o?new eo:void 0;for(Xe.set(R,q),Xe.set(q,R);++Xt<lr;){var Rt=R[Xt],jr=q[Xt];if(Ce)var Cn=Tt?Ce(jr,Rt,Xt,q,R,Xe):Ce(Rt,jr,Xt,R,q,Xe);if(Cn!==void 0){if(Cn)continue;qr=!1;break}if(ur){if(!Ge(q,function(dn,Fn){if(!Je(ur,Fn)&&(Rt===dn||It(Rt,dn,fe,Ce,Xe)))return ur.push(Fn)})){qr=!1;break}}else if(!(Rt===jr||It(Rt,jr,fe,Ce,Xe))){qr=!1;break}}return Xe.delete(R),Xe.delete(q),qr}function e0(R,q,fe,Ce,It,Xe,Tt){switch(fe){case de:if(R.byteLength!=q.byteLength||R.byteOffset!=q.byteOffset)return!1;R=R.buffer,q=q.buffer;case ee:return!(R.byteLength!=q.byteLength||!Xe(new st(R),new st(q)));case v:case E:case H:return cl(+R,+q);case _:return R.name==q.name&&R.message==q.message;case T:case f:return R==q+"";case U:var lr=Be;case I:var mt=Ce&i;if(lr||(lr=rt),R.size!=q.size&&!mt)return!1;var Ot=Tt.get(R);if(Ot)return Ot==q;Ce|=o,Tt.set(R,q);var Xt=to(lr(R),lr(q),Ce,It,Xe,Tt);return Tt.delete(R),Xt;case x:if(Kt)return Kt.call(R)==Kt.call(q)}return!1}function tl(R,q,fe,Ce,It,Xe){var Tt=fe&i,lr=ro(R),mt=lr.length,Ot=ro(q),Xt=Ot.length;if(mt!=Xt&&!Tt)return!1;for(var qr=mt;qr--;){var ur=lr[qr];if(!(Tt?ur in q:D.call(q,ur)))return!1}var Rt=Xe.get(R);if(Rt&&Xe.get(q))return Rt==q;var jr=!0;Xe.set(R,q),Xe.set(q,R);for(var Cn=Tt;++qr<mt;){ur=lr[qr];var dn=R[ur],Fn=q[ur];if(Ce)var ya=Tt?Ce(Fn,dn,ur,q,R,Xe):Ce(dn,Fn,ur,R,q,Xe);if(!(ya===void 0?dn===Fn||It(dn,Fn,fe,Ce,Xe):ya)){jr=!1;break}Cn||(Cn=ur=="constructor")}if(jr&&!Cn){var ds=R.constructor,vr=q.constructor;ds!=vr&&"constructor"in R&&"constructor"in q&&!(typeof ds=="function"&&ds instanceof ds&&typeof vr=="function"&&vr instanceof vr)&&(jr=!1)}return Xe.delete(R),Xe.delete(q),jr}function ro(R){return ma(R,i0,nl)}function Oi(R,q){var fe=R.__data__;return sl(q)?fe[typeof q=="string"?"string":"hash"]:fe.map}function Qr(R,q){var fe=He(R,q);return Qf(fe)?fe:void 0}function rl(R){var q=D.call(R,Ur),fe=R[Ur];try{R[Ur]=void 0;var Ce=!0}catch{}var It=K.call(R);return Ce&&(q?R[Ur]=fe:delete R[Ur]),It}var nl=Jn?function(R){return R==null?[]:(R=Object(R),nt(Jn(R),function(q){return ht.call(R,q)}))}:Ct,jn=us;(Ht&&jn(new Ht(new ArrayBuffer(1)))!=de||Lt&&jn(new Lt)!=U||zt&&jn(zt.resolve())!=L||Wt&&jn(new Wt)!=I||Ft&&jn(new Ft)!=z)&&(jn=function(R){var q=us(R),fe=q==N?R.constructor:void 0,Ce=fe?Qn(fe):"";if(Ce)switch(Ce){case ir:return de;case sr:return U;case qt:return L;case or:return I;case Vt:return z}return q});function il(R,q){return q=q??c,!!q&&(typeof R=="number"||Fe.test(R))&&R>-1&&R%1==0&&R<q}function sl(R){var q=typeof R;return q=="string"||q=="number"||q=="symbol"||q=="boolean"?R!=="__proto__":R===null}function ol(R){return!!B&&B in R}function al(R){var q=R&&R.constructor,fe=typeof q=="function"&&q.prototype||b;return R===fe}function t0(R){return K.call(R)}function Qn(R){if(R!=null){try{return m.call(R)}catch{}try{return R+""}catch{}}return""}function cl(R,q){return R===q||R!==R&&q!==q}var ll=wa(function(){return arguments}())?wa:function(R){return fs(R)&&D.call(R,"callee")&&!ht.call(R,"callee")},no=Array.isArray;function r0(R){return R!=null&&ul(R.length)&&!io(R)}var va=Ii||xt;function n0(R,q){return hs(R,q)}function io(R){if(!hl(R))return!1;var q=us(R);return q==A||q==P||q==d||q==$}function ul(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=c}function hl(R){var q=typeof R;return R!=null&&(q=="object"||q=="function")}function fs(R){return R!=null&&typeof R=="object"}var fl=Me?$t(Me):Qc;function i0(R){return r0(R)?Jc(R):el(R)}function Ct(){return[]}function xt(){return!1}t.exports=n0})(eh,eh.exports);var D_=eh.exports,$_=Object.defineProperty,Pp=Object.getOwnPropertySymbols,P_=Object.prototype.hasOwnProperty,T_=Object.prototype.propertyIsEnumerable,Tp=(t,e,r)=>e in t?$_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rr=(t,e)=>{for(var r in e||(e={}))P_.call(e,r)&&Tp(t,r,e[r]);if(Pp)for(var r of Pp(e))T_.call(e,r)&&Tp(t,r,e[r]);return t};function R_(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 o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),d=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function E(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var U=0,H=0,G=0,N=P.length;G!==N&&P[G]===0;)G++,U++;for(var L=(N-G)*v+1>>>0,$=new Uint8Array(L);G!==N;){for(var T=P[G],I=0,f=L-1;(T!==0||I<H)&&f!==-1;f--,I++)T+=256*$[f]>>>0,$[f]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,G++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(U);x<L;++x)J+=t.charAt($[x]);return J}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var U=0;if(P[U]!==" "){for(var H=0,G=0;P[U]===h;)H++,U++;for(var N=(P.length-U)*d+1>>>0,L=new Uint8Array(N);P[U];){var $=r[P.charCodeAt(U)];if($===255)return;for(var T=0,I=N-1;($!==0||T<G)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");G=T,U++}if(P[U]!==" "){for(var f=N-G;f!==N&&L[f]===0;)f++;for(var x=new Uint8Array(H+(N-f)),J=H;f!==N;)x[J++]=L[f++];return x}}}function A(P){var U=_(P);if(U)return U;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:A}}var N_=R_,L_=N_;const Rp=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")},M_=t=>new TextEncoder().encode(t),U_=t=>new TextDecoder().decode(t);class j_{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class F_{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Np(this,e)}}class B_{constructor(e){this.decoders=e}or(e){return Np(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 Np=(t,e)=>new B_(Rr(Rr({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class k_{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new j_(e,r,n),this.decoder=new F_(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const nc=({name:t,prefix:e,encode:r,decode:n})=>new k_(t,e,r,n),Fo=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=L_(r,e);return nc({prefix:t,name:e,encode:n,decode:o=>Rp(i(o))})},H_=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,d=0;for(let v=0;v<o;++v){const E=i[t[v]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|E,l+=r,l>=8&&(l-=8,c[d++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},z_=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},Er=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>nc({prefix:e,name:t,encode(i){return z_(i,n,r)},decode(i){return H_(i,n,r,t)}}),W_=nc({prefix:"\0",name:"identity",encode:t=>U_(t),decode:t=>M_(t)});var q_=Object.freeze({__proto__:null,identity:W_});const V_=Er({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var K_=Object.freeze({__proto__:null,base2:V_});const G_=Er({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Z_=Object.freeze({__proto__:null,base8:G_});const Y_=Fo({prefix:"9",name:"base10",alphabet:"0123456789"});var J_=Object.freeze({__proto__:null,base10:Y_});const X_=Er({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Q_=Er({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var e8=Object.freeze({__proto__:null,base16:X_,base16upper:Q_});const t8=Er({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),r8=Er({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),n8=Er({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),i8=Er({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),s8=Er({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),o8=Er({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),a8=Er({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),c8=Er({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),l8=Er({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var u8=Object.freeze({__proto__:null,base32:t8,base32upper:r8,base32pad:n8,base32padupper:i8,base32hex:s8,base32hexupper:o8,base32hexpad:a8,base32hexpadupper:c8,base32z:l8});const h8=Fo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),f8=Fo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var d8=Object.freeze({__proto__:null,base36:h8,base36upper:f8});const p8=Fo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),g8=Fo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var m8=Object.freeze({__proto__:null,base58btc:p8,base58flickr:g8});const w8=Er({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),v8=Er({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),y8=Er({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),b8=Er({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var _8=Object.freeze({__proto__:null,base64:w8,base64pad:v8,base64url:y8,base64urlpad:b8});const Lp=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}"),E8=Lp.reduce((t,e,r)=>(t[r]=e,t),[]),x8=Lp.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function C8(t){return t.reduce((e,r)=>(e+=E8[r],e),"")}function I8(t){const e=[];for(const r of t){const n=x8[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const O8=nc({prefix:"\u{1F680}",name:"base256emoji",encode:C8,decode:I8});var A8=Object.freeze({__proto__:null,base256emoji:O8}),S8=Up,Mp=128,D8=127,$8=~D8,P8=Math.pow(2,31);function Up(t,e,r){e=e||[],r=r||0;for(var n=r;t>=P8;)e[r++]=t&255|Mp,t/=128;for(;t&$8;)e[r++]=t&255|Mp,t>>>=7;return e[r]=t|0,Up.bytes=r-n+1,e}var T8=th,R8=128,jp=127;function th(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw th.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&jp)<<i:(c&jp)*Math.pow(2,i),i+=7}while(c>=R8);return th.bytes=o-n,r}var N8=Math.pow(2,7),L8=Math.pow(2,14),M8=Math.pow(2,21),U8=Math.pow(2,28),j8=Math.pow(2,35),F8=Math.pow(2,42),B8=Math.pow(2,49),k8=Math.pow(2,56),H8=Math.pow(2,63),z8=function(t){return t<N8?1:t<L8?2:t<M8?3:t<U8?4:t<j8?5:t<F8?6:t<B8?7:t<k8?8:t<H8?9:10},W8={encode:S8,decode:T8,encodingLength:z8},Fp=W8;const Bp=(t,e,r=0)=>(Fp.encode(t,e,r),e),kp=t=>Fp.encodingLength(t),rh=(t,e)=>{const r=e.byteLength,n=kp(t),i=n+kp(r),o=new Uint8Array(i+r);return Bp(t,o,0),Bp(r,o,n),o.set(e,i),new q8(t,r,e,o)};class q8{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Hp=({name:t,code:e,encode:r})=>new V8(t,e,r);class V8{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?rh(this.code,r):r.then(n=>rh(this.code,n))}else throw Error("Unknown type, must be binary type")}}const zp=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),K8=Hp({name:"sha2-256",code:18,encode:zp("SHA-256")}),G8=Hp({name:"sha2-512",code:19,encode:zp("SHA-512")});var Z8=Object.freeze({__proto__:null,sha256:K8,sha512:G8});const Wp=0,Y8="identity",qp=Rp;var J8=Object.freeze({__proto__:null,identity:{code:Wp,name:Y8,encode:qp,digest:t=>rh(Wp,qp(t))}});new TextEncoder,new TextDecoder;const Vp=Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr({},q_),K_),Z_),J_),e8),u8),d8),m8),_8),A8);Rr(Rr({},Z8),J8);function Kp(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function X8(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Kp(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Gp(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Zp=Gp("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),nh=Gp("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=X8(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Q8=Rr({utf8:Zp,"utf-8":Zp,hex:Vp.base16,latin1:nh,ascii:nh,binary:nh},Vp);function eE(t,e="utf8"){const r=Q8[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Kp(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const Yp="wc",tE=2,ih="core",fi=`${Yp}@2:${ih}:`,rE={name:ih,logger:"error"},nE={database:":memory:"},iE="crypto",Jp="client_ed25519_seed",sE=ke.ONE_DAY,oE="keychain",aE="0.3",cE="messages",lE="0.3",uE=ke.SIX_HOURS,hE="publisher",Xp="irn",fE="error",Qp="wss://relay.walletconnect.com",dE="relayer",rr={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},pE="_subscription",Bo={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},gE=ke.ONE_SECOND/2,mE="2.7.9-7fa58fba",wE=1e4,vE="0.3",Pn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},yE="subscription",bE="0.3",_E=ke.FIVE_SECONDS*1e3,EE="pairing",xE="0.3",ko={wc_pairingDelete:{req:{ttl:ke.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ke.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ke.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ke.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ke.ONE_DAY,prompt:!1,tag:0},res:{ttl:ke.ONE_DAY,prompt:!1,tag:0}}},Tn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},CE="history",IE="0.3",OE="expirer",on={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},AE="0.3",sh="verify-api",eg="https://verify.walletconnect.com";class SE{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=oE,this.version=aE,this.initialized=!1,this.storagePrefix=fi,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:o}=_e("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(o)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,D1(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?$1(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class DE{constructor(e,r,n){this.core=e,this.logger=r,this.name=iE,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(),o=gp(i);return pp(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=U5();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=gp(o),l=Iu();return await B4(l,i,sE,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),h=j5(l,o);return this.setSymKey(h,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||F5(i);return await this.keychain.set(c,i),c},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,o,c)=>{this.isInitialized();const l=E1(c),h=Mo(o);if(x1(l)){const _=l.senderPublicKey,A=l.receiverPublicKey;i=await this.generateSharedKey(_,A)}const d=this.getSymKey(i),{type:v,senderPublicKey:E}=l;return k5({type:v,symKey:d,message:h,senderPublicKey:E})},this.decode=async(i,o,c)=>{this.isInitialized();const l=W5(o,c);if(x1(l)){const v=l.receiverPublicKey,E=l.senderPublicKey;i=await this.generateSharedKey(v,E)}const h=this.getSymKey(i),d=H5({symKey:h,encoded:o});return Vu(d)},this.getPayloadType=i=>{const o=Va(i);return Io(o.type)},this.getPayloadSenderPublicKey=i=>{const o=Va(i);return o.senderPublicKey?Dr(o.senderPublicKey,$r):void 0},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.keychain=n||new SE(this.core,this.logger)}get context(){return pt.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Jp)}catch{e=Iu(),await this.keychain.set(Jp,e)}return eE(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class $E extends m4{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=cE,this.version=lE,this.initialized=!1,this.storagePrefix=fi,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 o=Os(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[o]<"u"||(c[o]=i,this.messages.set(n,c),await this.persist()),o},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const o=this.get(n),c=Os(i);return typeof o[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=pt.generateChildLogger(e,this.name),this.core=r}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,D1(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?$1(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class PE extends w4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new br.exports.EventEmitter,this.name=hE,this.queue=new Map,this.publishTimeout=1e4,this.publish=async(n,i,o)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});try{const c=o?.ttl||uE,l=Du(o),h=o?.prompt||!1,d=o?.tag||0,v=o?.id||Ip().toString(),E={topic:n,message:i,opts:{ttl:c,relay:l,prompt:h,tag:d,id:v}};this.queue.set(v,E);try{await await Ka(this.rpcPublish(n,i,c,l,h,d,v),this.publishTimeout),this.relayer.events.emit(rr.publish,E)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(rr.connection_stalled);return}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}})}catch(c){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(c),c}},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=pt.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return pt.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,o,c,l){var h,d,v,E;const _={method:Ga(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:o,tag:c},id:l};return Pr((h=_.params)==null?void 0:h.prompt)&&((d=_.params)==null||delete d.prompt),Pr((v=_.params)==null?void 0:v.tag)&&((E=_.params)==null||delete E.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:_}),this.relayer.request(_)}onPublish(e){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(Po.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()}),this.relayer.on(rr.message_ack,e=>{this.onPublish(e.id.toString())})}}class TE{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(o=>o!==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 RE=Object.defineProperty,NE=Object.defineProperties,LE=Object.getOwnPropertyDescriptors,tg=Object.getOwnPropertySymbols,ME=Object.prototype.hasOwnProperty,UE=Object.prototype.propertyIsEnumerable,rg=(t,e,r)=>e in t?RE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ho=(t,e)=>{for(var r in e||(e={}))ME.call(e,r)&&rg(t,r,e[r]);if(tg)for(var r of tg(e))UE.call(e,r)&&rg(t,r,e[r]);return t},oh=(t,e)=>NE(t,LE(e));class jE extends b4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new TE,this.events=new br.exports.EventEmitter,this.name=yE,this.version=bE,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=fi,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 o=Du(i),c={topic:n,relay:o};this.pending.set(n,c);const l=await this.rpcSubscribe(n,o);return this.onSubscribe(l,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),l}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}},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,o)=>{const c=new ke.Watch;c.start(this.pendingSubscriptionWatchLabel);const l=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(l),c.stop(this.pendingSubscriptionWatchLabel),i(!0)),c.elapsed(this.pendingSubscriptionWatchLabel)>=_E&&(clearInterval(l),c.stop(this.pendingSubscriptionWatchLabel),o(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!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.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=pt.generateChildLogger(r,this.name),this.clientId=""}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=Du(n);await this.rpcUnsubscribe(e,r,i);const o=Zt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,o),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:Ga(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Ka(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(rr.connection_stalled)}return Os(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:Ga(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 Ka(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(rr.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:Ga(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,oh(Ho({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Ho({},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,Ho({},r)),this.topicMap.set(r.topic,e),this.events.emit(Pn.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}=_e("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(Pn.deleted,oh(Ho({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Pn.sync)}async reset(){if(this.cached.length){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(Pn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=_e("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);zn(r)&&this.onBatchSubscribe(r.map((n,i)=>oh(Ho({},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(Po.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(rr.connect,async()=>{await this.onConnect()}),this.relayer.on(rr.disconnect,()=>{this.onDisconnect()}),this.events.on(Pn.created,async e=>{const r=Pn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Pn.deleted,async e=>{const r=Pn.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}=_e("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 FE=Object.defineProperty,ng=Object.getOwnPropertySymbols,BE=Object.prototype.hasOwnProperty,kE=Object.prototype.propertyIsEnumerable,ig=(t,e,r)=>e in t?FE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,HE=(t,e)=>{for(var r in e||(e={}))BE.call(e,r)&&ig(t,r,e[r]);if(ng)for(var r of ng(e))kE.call(e,r)&&ig(t,r,e[r]);return t};class zE extends v4{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new br.exports.EventEmitter,this.name=dE,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?pt.generateChildLogger(e.logger,this.name):pt.pino(pt.getDefaultLoggerOptions({level:e.logger||fE})),this.messages=new $E(this.logger,e.core),this.subscriber=new jE(this,this.logger),this.publisher=new PE(this,this.logger),this.relayUrl=e?.relayUrl||Qp,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribted to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},wE)}get context(){return pt.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){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";return i||(await Promise.all([new Promise(o=>{this.subscriber.once(Pn.created,c=>{c.topic===e&&o()})}),new Promise(async o=>{i=await this.subscriber.subscribe(e,r),o()})]),i)}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(rr.transport_closed))}async transportOpen(e){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=e||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(Pn.resubscribed,()=>{r()})}),await Promise.race([new Promise(async(r,n)=>{await Ka(this.provider.connect(),5e3,"socket stalled").catch(i=>n(i)).then(()=>r()).finally(()=>this.removeListener(rr.transport_closed,this.rejectTransportOpen))}),new Promise(r=>this.once(rr.transport_closed,this.rejectTransportOpen))])])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.events.emit(rr.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=e||this.relayUrl,this.connected&&await Promise.all([new Promise(r=>{this.provider.once(Bo.disconnect,()=>{r()})}),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}rejectTransportOpen(){throw new Error("closeTransport called before connection was established")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new hi(new S_(tb({sdkVersion:mE,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;return await this.subscriber.isSubscribed(r)?this.messages.has(r,n):!0}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Qu(e)){if(!e.method.endsWith(pE))return;const r=e.params,{topic:n,message:i,publishedAt:o}=r.data,c={topic:n,message:i,publishedAt:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(HE({type:"event",event:r.id},c)),this.events.emit(r.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else rc(e)&&this.events.emit(rr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(rr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=Xu(e.id,!0);await this.provider.connection.send(r)}registerProviderListeners(){this.provider.on(Bo.payload,e=>this.onProviderPayload(e)),this.provider.on(Bo.connect,()=>{this.events.emit(rr.connect)}),this.provider.on(Bo.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(Bo.error,e=>{this.logger.error(e),this.events.emit(rr.error,e)})}registerEventListeners(){this.events.on(rr.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(rr.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},ke.toMiliseconds(gE))}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var WE=Object.defineProperty,sg=Object.getOwnPropertySymbols,qE=Object.prototype.hasOwnProperty,VE=Object.prototype.propertyIsEnumerable,og=(t,e,r)=>e in t?WE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ag=(t,e)=>{for(var r in e||(e={}))qE.call(e,r)&&og(t,r,e[r]);if(sg)for(var r of sg(e))VE.call(e,r)&&og(t,r,e[r]);return t};class ic extends y4{constructor(e,r,n,i=fi,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=vE,this.cached=[],this.initialized=!1,this.storagePrefix=fi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!Pr(c)?this.map.set(this.getKey(c),c):Cb(c)?this.map.set(c.id,c):Ib(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,l)=>{this.isInitialized(),this.map.has(c)?await this.update(c,l):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:l}),this.map.set(c,l),await this.persist())},this.get=c=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:c}),this.getData(c)),this.getAll=c=>(this.isInitialized(),c?this.values.filter(l=>Object.keys(c).every(h=>D_(l[h],c[h]))):this.values),this.update=async(c,l)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:l});const h=ag(ag({},this.getData(c)),l);this.map.set(c,h),await this.persist()},this.delete=async(c,l)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:l}),this.map.delete(c),await this.persist())},this.logger=pt.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return pt.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}=_e("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}=_e("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}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class KE{constructor(e,r){this.core=e,this.logger=r,this.name=EE,this.version=xE,this.events=new br.exports,this.initialized=!1,this.storagePrefix=fi,this.ignoredPayloadTypes=[Bi],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=Iu(),i=await this.core.crypto.setSymKey(n),o=$n(ke.FIVE_MINUTES),c={protocol:Xp},l={topic:i,expiry:o,relay:c,active:!1},h=pb({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:c});return await this.pairings.set(i,l),await this.core.relayer.subscribe(i),this.core.expirer.set(i,o),{topic:i,uri:h}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:o,relay:c}=hb(n.uri);if(this.pairings.keys.includes(i))throw new Error(`Pairing already exists: ${i}`);if(this.core.crypto.hasKeys(i))throw new Error(`Keychain already exists: ${i}`);const l=$n(ke.FIVE_MINUTES),h={topic:i,relay:c,expiry:l,active:!1};return await this.pairings.set(i,h),await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:c}),this.core.expirer.set(i,l),n.activatePairing&&await this.activate({topic:i}),h},this.activate=async({topic:n})=>{this.isInitialized();const i=$n(ke.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 o=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:l,reject:h}=As();this.events.once(tr("pairing_ping",o),({error:d})=>{d?h(d):l()}),await c()}},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",Zt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,o)=>{const c=ec(i,o),l=await this.core.crypto.encode(n,c),h=ko[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,l,h),c.id},this.sendResult=async(n,i,o)=>{const c=Xu(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),d=ko[h.request.method].res;await this.core.relayer.publish(i,l,d),await this.core.history.resolve(c)},this.sendError=async(n,i,o)=>{const c=tc(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),d=ko[h.request.method]?ko[h.request.method].res:ko.unregistered_method.res;await this.core.relayer.publish(i,l,d),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Zt("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=>ui(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:o}=n,c=o.method;if(this.pairings.keys.includes(i))switch(c){case"wc_pairingPing":return this.onPairingPingRequest(i,o);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,o);default:return this.onUnknownRpcMethodRequest(i,o)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:o}=n,c=(await this.core.history.get(i,o.id)).request.method;if(this.pairings.keys.includes(i))switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,o);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:o}=i;try{this.isValidPing({topic:n}),await this.sendResult(o,n,!0),this.events.emit("pairing_ping",{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:o}=i;setTimeout(()=>{Vn(i)?this.events.emit(tr("pairing_ping",o),{}):En(i)&&this.events.emit(tr("pairing_ping",o),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:o}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:o,method:c}=i;try{if(this.registeredMethods.includes(c))return;const l=Zt("WC_METHOD_UNSUPPORTED",c);await this.sendError(o,n,l),this.logger.error(l)}catch(l){await this.sendError(o,n,l),this.logger.error(l)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Zt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!zr(n)){const{message:i}=_e("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!xb(n.uri)){const{message:i}=_e("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!zr(n)){const{message:o}=_e("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!zr(n)){const{message:o}=_e("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!gr(n,!1)){const{message:i}=_e("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=_e("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(ui(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=_e("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.pairings=new ic(this.core,this.logger,this.name,this.storagePrefix)}get context(){return pt.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(rr.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);Qu(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):rc(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(on.expired,async e=>{const{topic:r}=T1(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class GE extends g4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new br.exports.EventEmitter,this.name=CE,this.version=IE,this.cached=[],this.initialized=!1,this.storagePrefix=fi,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,o)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:o}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:o};this.records.set(c.id,c),this.events.emit(Tn.created,c)},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=En(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(Tn.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(o=>{if(o.topic===n){if(typeof i<"u"&&o.id!==i)return;this.records.delete(o.id),this.events.emit(Tn.deleted,o)}})},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=pt.generateChildLogger(r,this.name)}get context(){return pt.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:ec(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}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Tn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=_e("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(Tn.created,e=>{const r=Tn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Tn.updated,e=>{const r=Tn.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Tn.deleted,e=>{const r=Tn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ZE extends _4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new br.exports.EventEmitter,this.name=OE,this.version=AE,this.cached=[],this.initialized=!1,this.storagePrefix=fi,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 o=this.formatTarget(n),c={target:o,expiry:i};this.expirations.set(o,c),this.checkExpiry(o,c),this.events.emit(on.created,{target:o,expiration:c})},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),o=this.getExpiration(i);this.expirations.delete(i),this.events.emit(on.deleted,{target:i,expiration: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.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.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 rb(e);if(typeof e=="number")return nb(e);const{message:r}=_e("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(on.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=_e("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}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ke.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(on.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Po.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(on.created,e=>{const r=on.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(on.expired,e=>{const r=on.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(on.deleted,e=>{const r=on.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class YE extends E4{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=sh,this.initialized=!1,this.init=async n=>{A1()||!Au()||(this.verifyUrl=n?.verifyUrl||eg,await this.createIframe())},this.register=async n=>{var i;this.initialized||await this.init(),this.iframe&&((i=this.iframe.contentWindow)==null||i.postMessage(n.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${n.attestationId} ${this.verifyUrl}`))},this.resolve=async n=>{var i;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${n.attestationId}`);const o=this.startAbortTimer(ke.FIVE_SECONDS),c=await fetch(`${this.verifyUrl}/attestation/${n.attestationId}`,{signal:this.abortController.signal});return clearTimeout(o),c.status===200?(i=await c.json())==null?void 0:i.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise((n,i)=>{if(document.getElementById(sh))return n();const o=document.createElement("iframe");o.setAttribute("id",sh),o.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),o.style.display="none",o.addEventListener("load",()=>{this.initialized=!0,n()}),o.addEventListener("error",c=>{i(c)}),document.body.append(o),this.iframe=o}),new Promise(n=>{setTimeout(()=>n("iframe load timeout"),ke.toMiliseconds(ke.ONE_SECOND/2))})])}catch(n){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(n)}},this.logger=pt.generateChildLogger(r,this.name),this.verifyUrl=eg,this.abortController=new AbortController,this.isDevEnv=Ou()&&process.env.IS_VITEST}get context(){return pt.getLoggerContext(this.logger)}startAbortTimer(e){return setTimeout(()=>this.abortController.abort(),ke.toMiliseconds(e))}}var JE=Object.defineProperty,cg=Object.getOwnPropertySymbols,XE=Object.prototype.hasOwnProperty,QE=Object.prototype.propertyIsEnumerable,lg=(t,e,r)=>e in t?JE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ug=(t,e)=>{for(var r in e||(e={}))XE.call(e,r)&&lg(t,r,e[r]);if(cg)for(var r of cg(e))QE.call(e,r)&&lg(t,r,e[r]);return t};class ah extends p4{constructor(e){super(e),this.protocol=Yp,this.version=tE,this.name=ih,this.events=new br.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||Qp;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||rE.logger}));this.logger=pt.generateChildLogger(r,this.name),this.heartbeat=new Po.HeartBeat,this.crypto=new DE(this,this.logger,e?.keychain),this.history=new GE(this,this.logger),this.expirer=new ZE(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new v6(ug(ug({},nE),e?.storageOptions)),this.relayer=new zE({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new KE(this,this.logger),this.verify=new YE(this.projectId||"",this.logger)}static async init(e){const r=new ah(e);return await r.initialize(),r}get context(){return pt.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 e7=ah,hg="wc",fg=2,dg="client",ch=`${hg}@${fg}:${dg}:`,lh={name:dg,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},t7="proposal",pg="Proposal expired",r7="session",sc=ke.SEVEN_DAYS,n7="engine",zo={wc_sessionPropose:{req:{ttl:ke.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ke.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ke.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ke.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ke.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ke.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ke.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ke.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ke.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ke.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ke.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ke.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ke.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ke.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ke.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ke.THIRTY_SECONDS,prompt:!1,tag:1115}}},uh={min:ke.FIVE_MINUTES,max:ke.SEVEN_DAYS},i7="request",s7=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var o7=Object.defineProperty,a7=Object.defineProperties,c7=Object.getOwnPropertyDescriptors,gg=Object.getOwnPropertySymbols,l7=Object.prototype.hasOwnProperty,u7=Object.prototype.propertyIsEnumerable,mg=(t,e,r)=>e in t?o7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,an=(t,e)=>{for(var r in e||(e={}))l7.call(e,r)&&mg(t,r,e[r]);if(gg)for(var r of gg(e))u7.call(e,r)&&mg(t,r,e[r]);return t},hh=(t,e)=>a7(t,c7(e));class h7 extends C4{constructor(e){super(e),this.name=n7,this.events=new br.exports,this.initialized=!1,this.ignoredPayloadTypes=[Bi],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(zo)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized();const n=hh(an({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:h}=n;let d=i,v,E=!1;if(d&&(E=this.client.core.pairing.pairings.get(d).active),!d||!E){const{topic:L,uri:$}=await this.client.core.pairing.create();d=L,v=$}const _=await this.client.core.crypto.generateKeyPair(),A=an({requiredNamespaces:o,optionalNamespaces:c,relays:h??[{protocol:Xp}],proposer:{publicKey:_,metadata:this.client.metadata}},l&&{sessionProperties:l}),{reject:P,resolve:U,done:H}=As(ke.FIVE_MINUTES,pg);if(this.events.once(tr("session_connect"),async({error:L,session:$})=>{if(L)P(L);else if($){$.self.publicKey=_;const T=hh(an({},$),{requiredNamespaces:$.requiredNamespaces,optionalNamespaces:$.optionalNamespaces});await this.client.session.set($.topic,T),await this.setExpiry($.topic,$.expiry),d&&await this.client.core.pairing.updateMetadata({topic:d,metadata:$.peer.metadata}),U(T)}}),!d){const{message:L}=_e("NO_MATCHING_KEY",`connect() pairing topic: ${d}`);throw new Error(L)}const G=await this.sendRequest(d,"wc_sessionPropose",A),N=$n(ke.FIVE_MINUTES);return await this.setProposal(G,an({id:G,expiry:N},A)),{uri:v,approval:H}},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:o,sessionProperties:c}=r,l=this.client.proposal.get(n);let{pairingTopic:h,proposer:d,requiredNamespaces:v,optionalNamespaces:E}=l;h=h||"",Ds(v)||(v=vb(o,"approve()"));const _=await this.client.core.crypto.generateKeyPair(),A=d.publicKey,P=await this.client.core.crypto.generateSharedKey(_,A);h&&n&&(await this.client.core.pairing.updateMetadata({topic:h,metadata:d.metadata}),await this.sendResult(n,h,{relay:{protocol:i??"irn"},responderPublicKey:_}),await this.client.proposal.delete(n,Zt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}));const U=an({relay:{protocol:i??"irn"},namespaces:o,requiredNamespaces:v,optionalNamespaces:E,pairingTopic:h,controller:{publicKey:_,metadata:this.client.metadata},expiry:$n(sc)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(P),await this.sendRequest(P,"wc_sessionSettle",U);const H=hh(an({},U),{topic:P,pairingTopic:h,acknowledged:!1,self:U.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:_});return await this.client.session.set(P,H),await this.setExpiry(P,$n(sc)),{topic:P,acknowledged:()=>new Promise(G=>setTimeout(()=>G(this.client.session.get(P)),500))}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:o}=this.client.proposal.get(n);o&&(await this.sendError(n,o,i),await this.client.proposal.delete(n,Zt("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,o=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:c,resolve:l,reject:h}=As();return this.events.once(tr("session_update",o),({error:d})=>{d?h(d):l()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:c}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:o,resolve:c,reject:l}=As();return this.events.once(tr("session_extend",i),({error:h})=>{h?l(h):c()}),await this.setExpiry(n,$n(sc)),{acknowledged:o}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:o,expiry:c}=r,l=await this.sendRequest(o,"wc_sessionRequest",{request:i,chainId:n},c),{done:h,resolve:d,reject:v}=As(c);return this.events.once(tr("session_request",l),({error:E,result:_})=>{E?v(E):d(_)}),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:l}),ib({id:l,topic:o,store:this.client.core.storage}),await h()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;Vn(i)?await this.sendResult(o,n,i.result):En(i)&&await this.sendError(o,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:o,resolve:c,reject:l}=As();this.events.once(tr("session_ping",i),({error:h})=>{h?l(h):c()}),await o()}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:o}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:o})},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",Zt("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=>_b(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(o=>{var c,l;return((c=o.peerMetadata)==null?void 0:c.url)&&((l=o.peerMetadata)==null?void 0:l.url)===r.peer.metadata.url&&o.topic&&o.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(o=>this.client.core.pairing.disconnect({topic:o.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},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,Zt("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,Zt("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=zo.wc_sessionRequest.req.ttl,{id:i,topic:o,params:c}=r;await this.client.pendingRequest.set(i,{id:i,topic:o,params:c}),n&&this.client.core.expirer.set(i,$n(n))},this.sendRequest=async(r,n,i,o)=>{const c=ec(n,i);if(Au()&&s7.includes(n)){const d=Os(JSON.stringify(c));await this.client.core.verify.register({attestationId:d})}const l=await this.client.core.crypto.encode(r,c),h=zo[n].req;return o&&(h.ttl=o),this.client.core.history.set(r,c),this.client.core.relayer.publish(r,l,h),c.id},this.sendResult=async(r,n,i)=>{const o=Xu(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),h=zo[l.request.method].res;this.client.core.relayer.publish(n,c,h),await this.client.core.history.resolve(o)},this.sendError=async(r,n,i)=>{const o=tc(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),h=zo[l.request.method].res;this.client.core.relayer.publish(n,c,h),await this.client.core.history.resolve(o)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{ui(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{ui(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,o=i.method;switch(o){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 ${o}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){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 ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=_e("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidConnect(an({},n.params));const c=$n(ke.FIVE_MINUTES),l=an({id:o,pairingTopic:r,expiry:c},i);await this.setProposal(o,l);const h=Os(JSON.stringify(n)),d=await this.getVerifyContext(h,l.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:l,verifyContext:d})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(Vn(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const l=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const h=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:h});const d=await this.client.core.crypto.generateSharedKey(l,h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:d});const v=await this.client.core.relayer.subscribe(d);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:v}),await this.client.core.pairing.activate({topic:r})}else En(n)&&(await this.client.proposal.delete(i,Zt("USER_DISCONNECTED")),this.events.emit(tr("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidSessionSettleRequest(o);const{relay:c,controller:l,expiry:h,namespaces:d,requiredNamespaces:v,optionalNamespaces:E,sessionProperties:_,pairingTopic:A}=n.params,P=an({topic:r,relay:c,expiry:h,namespaces:d,acknowledged:!0,pairingTopic:A,requiredNamespaces:v,optionalNamespaces:E,controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},_&&{sessionProperties:_});await this.sendResult(n.id,r,!0),this.events.emit(tr("session_connect"),{session:P}),this.cleanupDuplicatePairings(P)}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Vn(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(tr("session_approve",i),{})):En(n)&&(await this.client.session.delete(r,Zt("USER_DISCONNECTED")),this.events.emit(tr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidUpdate(an({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(o,r,!0),this.client.events.emit("session_update",{id:o,topic:r,params:i})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(tr("session_update",i),{}):En(n)&&this.events.emit(tr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,$n(sc)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(tr("session_extend",i),{}):En(n)&&this.events.emit(tr("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(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{Vn(n)?this.events.emit(tr("session_ping",i),{}):En(n)&&this.events.emit(tr("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(o=>{this.client.core.relayer.once(rr.publish,async()=>{o(await this.deleteSession(r))})}),this.sendResult(i,r,!0)]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidRequest(an({topic:r},o)),await this.setPendingSessionRequest({id:i,topic:r,params:o});const c=Os(JSON.stringify(n)),l=this.client.session.get(r),h=await this.getVerifyContext(c,l.peer.metadata);this.client.events.emit("session_request",{id:i,topic:r,params:o,verifyContext:h})}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(tr("session_request",i),{result:n.result}):En(n)&&this.events.emit(tr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidEmit(an({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o})}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.isValidConnect=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(h)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:o,sessionProperties:c,relays:l}=r;if(Pr(n)||await this.isValidPairingTopic(n),!Rb(l,!0)){const{message:h}=_e("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(h)}!Pr(i)&&Ds(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Pr(o)&&Ds(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Pr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=Tb(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!zr(r))throw new Error(_e("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:o,sessionProperties:c}=r;await this.isValidProposalId(n);const l=this.client.proposal.get(n),h=Ya(i,"approve()");if(h)throw new Error(h.message);const d=B1(l.requiredNamespaces,i,"approve()");if(d)throw new Error(d.message);if(!gr(o,!0)){const{message:v}=_e("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(v)}Pr(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async r=>{if(!zr(r)){const{message:o}=_e("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!Lb(i)){const{message:o}=_e("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!zr(r)){const{message:d}=_e("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(d)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!j1(n)){const{message:d}=_e("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(d)}const l=Ob(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const h=Ya(o,"onSessionSettleRequest()");if(h)throw new Error(h.message);if(ui(c)){const{message:d}=_e("EXPIRED","onSessionSettleRequest()");throw new Error(d)}},this.isValidUpdate=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(h)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const o=this.client.session.get(n),c=Ya(i,"update()");if(c)throw new Error(c.message);const l=B1(o.requiredNamespaces,i,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(h)}const{topic:n,request:i,chainId:o,expiry:c}=r;await this.isValidSessionTopic(n);const{namespaces:l}=this.client.session.get(n);if(!F1(l,o)){const{message:h}=_e("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(h)}if(!Mb(i)){const{message:h}=_e("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(h)}if(!Fb(l,o,i.method)){const{message:h}=_e("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(h)}if(c&&!zb(c,uh)){const{message:h}=_e("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${uh.min} and ${uh.max}`);throw new Error(h)}},this.isValidRespond=async r=>{if(!zr(r)){const{message:o}=_e("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!Ub(i)){const{message:o}=_e("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!zr(r)){const{message:l}=_e("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(l)}const{topic:n,event:i,chainId:o}=r;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!F1(c,o)){const{message:l}=_e("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!jb(i)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!Bb(c,o,i.name)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}},this.isValidDisconnect=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||"",validation:"UNKNOWN",origin:n.url||""}};try{const o=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});o&&(i.verified.origin=o,i.verified.validation=o===n.url?"VALID":"INVALID")}catch(o){this.client.logger.error(o)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!gr(i,!1)){const{message:o}=_e("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(o)}})}}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(rr.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);Qu(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):rc(i)?(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i})):this.onRelayEventUnknownPayload({topic:r,payload:i})})}registerExpirerEvents(){this.client.core.expirer.on(on.expired,async e=>{const{topic:r,id:n}=T1(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,_e("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(!gr(e,!1)){const{message:r}=_e("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}=_e("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(ui(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=_e("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!gr(e,!1)){const{message:r}=_e("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(ui(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=_e("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(gr(e,!1)){const{message:r}=_e("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=_e("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!Nb(e)){const{message:r}=_e("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(ui(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=_e("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class f7 extends ic{constructor(e,r){super(e,r,t7,ch),this.core=e,this.logger=r}}class d7 extends ic{constructor(e,r){super(e,r,r7,ch),this.core=e,this.logger=r}}class p7 extends ic{constructor(e,r){super(e,r,i7,ch,n=>n.id),this.core=e,this.logger=r}}class fh extends x4{constructor(e){super(e),this.protocol=hg,this.version=fg,this.name=lh.name,this.events=new br.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||lh.name,this.metadata=e?.metadata||J5();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||lh.logger}));this.core=e?.core||new e7(e),this.logger=pt.generateChildLogger(r,this.name),this.session=new d7(this.core,this.logger),this.proposal=new f7(this.core,this.logger),this.pendingRequest=new p7(this.core,this.logger),this.engine=new h7(this)}static async init(e){const r=new fh(e);return await r.initialize(),r}get context(){return pt.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.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var dh={exports:{}};(function(t,e){var r=typeof self<"u"?self:pr,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(c){var l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function h(O){return O&&DataView.prototype.isPrototypeOf(O)}if(l.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=ArrayBuffer.isView||function(O){return O&&d.indexOf(Object.prototype.toString.call(O))>-1};function E(O){if(typeof O!="string"&&(O=String(O)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(O))throw new TypeError("Invalid character in header field name");return O.toLowerCase()}function _(O){return typeof O!="string"&&(O=String(O)),O}function A(O){var j={next:function(){var ce=O.shift();return{done:ce===void 0,value:ce}}};return l.iterable&&(j[Symbol.iterator]=function(){return j}),j}function P(O){this.map={},O instanceof P?O.forEach(function(j,ce){this.append(ce,j)},this):Array.isArray(O)?O.forEach(function(j){this.append(j[0],j[1])},this):O&&Object.getOwnPropertyNames(O).forEach(function(j){this.append(j,O[j])},this)}P.prototype.append=function(O,j){O=E(O),j=_(j);var ce=this.map[O];this.map[O]=ce?ce+", "+j:j},P.prototype.delete=function(O){delete this.map[E(O)]},P.prototype.get=function(O){return O=E(O),this.has(O)?this.map[O]:null},P.prototype.has=function(O){return this.map.hasOwnProperty(E(O))},P.prototype.set=function(O,j){this.map[E(O)]=_(j)},P.prototype.forEach=function(O,j){for(var ce in this.map)this.map.hasOwnProperty(ce)&&O.call(j,this.map[ce],ce,this)},P.prototype.keys=function(){var O=[];return this.forEach(function(j,ce){O.push(ce)}),A(O)},P.prototype.values=function(){var O=[];return this.forEach(function(j){O.push(j)}),A(O)},P.prototype.entries=function(){var O=[];return this.forEach(function(j,ce){O.push([ce,j])}),A(O)},l.iterable&&(P.prototype[Symbol.iterator]=P.prototype.entries);function U(O){if(O.bodyUsed)return Promise.reject(new TypeError("Already read"));O.bodyUsed=!0}function H(O){return new Promise(function(j,ce){O.onload=function(){j(O.result)},O.onerror=function(){ce(O.error)}})}function G(O){var j=new FileReader,ce=H(j);return j.readAsArrayBuffer(O),ce}function N(O){var j=new FileReader,ce=H(j);return j.readAsText(O),ce}function L(O){for(var j=new Uint8Array(O),ce=new Array(j.length),le=0;le<j.length;le++)ce[le]=String.fromCharCode(j[le]);return ce.join("")}function $(O){if(O.slice)return O.slice(0);var j=new Uint8Array(O.byteLength);return j.set(new Uint8Array(O)),j.buffer}function T(){return this.bodyUsed=!1,this._initBody=function(O){this._bodyInit=O,O?typeof O=="string"?this._bodyText=O:l.blob&&Blob.prototype.isPrototypeOf(O)?this._bodyBlob=O:l.formData&&FormData.prototype.isPrototypeOf(O)?this._bodyFormData=O:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(O)?this._bodyText=O.toString():l.arrayBuffer&&l.blob&&h(O)?(this._bodyArrayBuffer=$(O.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(O)||v(O))?this._bodyArrayBuffer=$(O):this._bodyText=O=Object.prototype.toString.call(O):this._bodyText="",this.headers.get("content-type")||(typeof O=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(O)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var O=U(this);if(O)return O;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?U(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(G)}),this.text=function(){var O=U(this);if(O)return O;if(this._bodyBlob)return N(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(J)}),this.json=function(){return this.text().then(JSON.parse)},this}var I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function f(O){var j=O.toUpperCase();return I.indexOf(j)>-1?j:O}function x(O,j){j=j||{};var ce=j.body;if(O instanceof x){if(O.bodyUsed)throw new TypeError("Already read");this.url=O.url,this.credentials=O.credentials,j.headers||(this.headers=new P(O.headers)),this.method=O.method,this.mode=O.mode,this.signal=O.signal,!ce&&O._bodyInit!=null&&(ce=O._bodyInit,O.bodyUsed=!0)}else this.url=String(O);if(this.credentials=j.credentials||this.credentials||"same-origin",(j.headers||!this.headers)&&(this.headers=new P(j.headers)),this.method=f(j.method||this.method||"GET"),this.mode=j.mode||this.mode||null,this.signal=j.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ce)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ce)}x.prototype.clone=function(){return new x(this,{body:this._bodyInit})};function J(O){var j=new FormData;return O.trim().split("&").forEach(function(ce){if(ce){var le=ce.split("="),re=le.shift().replace(/\+/g," "),ne=le.join("=").replace(/\+/g," ");j.append(decodeURIComponent(re),decodeURIComponent(ne))}}),j}function z(O){var j=new P,ce=O.replace(/\r?\n[\t ]+/g," ");return ce.split(/\r?\n/).forEach(function(le){var re=le.split(":"),ne=re.shift().trim();if(ne){var ae=re.join(":").trim();j.append(ne,ae)}}),j}T.call(x.prototype);function ee(O,j){j||(j={}),this.type="default",this.status=j.status===void 0?200:j.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in j?j.statusText:"OK",this.headers=new P(j.headers),this.url=j.url||"",this._initBody(O)}T.call(ee.prototype),ee.prototype.clone=function(){return new ee(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new P(this.headers),url:this.url})},ee.error=function(){var O=new ee(null,{status:0,statusText:""});return O.type="error",O};var de=[301,302,303,307,308];ee.redirect=function(O,j){if(de.indexOf(j)===-1)throw new RangeError("Invalid status code");return new ee(null,{status:j,headers:{location:O}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(j,ce){this.message=j,this.name=ce;var le=Error(j);this.stack=le.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function me(O,j){return new Promise(function(ce,le){var re=new x(O,j);if(re.signal&&re.signal.aborted)return le(new c.DOMException("Aborted","AbortError"));var ne=new XMLHttpRequest;function ae(){ne.abort()}ne.onload=function(){var ie={status:ne.status,statusText:ne.statusText,headers:z(ne.getAllResponseHeaders()||"")};ie.url="responseURL"in ne?ne.responseURL:ie.headers.get("X-Request-URL");var Se="response"in ne?ne.response:ne.responseText;ce(new ee(Se,ie))},ne.onerror=function(){le(new TypeError("Network request failed"))},ne.ontimeout=function(){le(new TypeError("Network request failed"))},ne.onabort=function(){le(new c.DOMException("Aborted","AbortError"))},ne.open(re.method,re.url,!0),re.credentials==="include"?ne.withCredentials=!0:re.credentials==="omit"&&(ne.withCredentials=!1),"responseType"in ne&&l.blob&&(ne.responseType="blob"),re.headers.forEach(function(ie,Se){ne.setRequestHeader(Se,ie)}),re.signal&&(re.signal.addEventListener("abort",ae),ne.onreadystatechange=function(){ne.readyState===4&&re.signal.removeEventListener("abort",ae)}),ne.send(typeof re._bodyInit>"u"?null:re._bodyInit)})}return me.polyfill=!0,o.fetch||(o.fetch=me,o.Headers=P,o.Request=x,o.Response=ee),c.Headers=P,c.Request=x,c.Response=ee,c.fetch=me,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(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})(dh,dh.exports);var wg=pw(dh.exports);const vg={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},yg=10;class Vi{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new br.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Ap(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}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=Mo(e),o=await(await wg(this.url,Object.assign(Object.assign({},vg),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Ap(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",o=>{this.resetMaxListeners(),i(o)}),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{if(!this.disableProviderPing){const r=Mo({id:1,jsonrpc:"2.0",method:"test",params:[]});await wg(e,Object.assign(Object.assign({},vg),{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"?Vu(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=tc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return yp(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>yg&&this.events.setMaxListeners(yg)}}const bg="error",g7="wss://relay.walletconnect.com",m7="wc",w7="universal_provider",_g=`${m7}@2:${w7}:`,v7="https://rpc.walletconnect.com/v1",di={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Wo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ph={exports:{}};/**
|
|
73
73
|
* @license
|
|
74
74
|
* Lodash <https://lodash.com/>
|
|
75
75
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
76
76
|
* Released under MIT license <https://lodash.com/license>
|
|
77
77
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
78
78
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
79
|
-
*/(function(t,e){(function(){var r,n="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",d=500,v="__lodash_placeholder__",E=1,_=2,A=4,P=1,U=2,H=1,G=2,N=4,L=8,$=16,T=32,I=64,f=128,x=256,J=512,z=30,ee="...",de=800,me=16,O=1,j=2,ce=3,le=1/0,re=9007199254740991,ne=17976931348623157e292,ae=0/0,ie=4294967295,Se=ie-1,ge=ie>>>1,Fe=[["ary",f],["bind",H],["bindKey",G],["curry",L],["curryRight",$],["flip",J],["partial",T],["partialRight",I],["rearg",x]],ye="[object Arguments]",Le="[object Array]",X="[object AsyncFunction]",Y="[object Boolean]",W="[object Date]",w="[object DOMException]",F="[object Error]",we="[object Function]",ve="[object GeneratorFunction]",Me="[object Map]",nt="[object Number]",at="[object Null]",Ge="[object Object]",Dt="[object Promise]",$t="[object Proxy]",Je="[object RegExp]",He="[object Set]",Be="[object String]",Ke="[object Symbol]",rt="[object Undefined]",Ue="[object WeakMap]",Ze="[object WeakSet]",b="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",D="[object Float64Array]",B="[object Int8Array]",K="[object Int16Array]",Q="[object Int32Array]",Ee="[object Uint8Array]",Te="[object Uint8ClampedArray]",st="[object Uint16Array]",ht="[object Uint32Array]",lt=/\b__p \+= '';/g,Ur=/\b(__p \+=) '' \+/g,Jn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ii=/&(?:amp|lt|gt|quot|#39);/g,ls=/[&<>"']/g,Ht=RegExp(Ii.source),Lt=RegExp(ls.source),zt=/<%-([\s\S]+?)%>/g,Wt=/<%([\s\S]+?)%>/g,Ft=/<%=([\s\S]+?)%>/g,Mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ir=/^\w*$/,sr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qt=/[\\^$.*+?()[\]{}|]/g,or=RegExp(qt.source),Vt=/^\s+/,Jt=/\s/,Kt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pt=/\{\n\/\* \[wrapped with (.+)\] \*/,ar=/,? & /,cr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ff=/[()=,{}\[\]\/\s]/,Bf=/\\(\\)?/g,kf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fn=/\w*$/,Hf=/^[-+]0x[0-9a-f]+$/i,zf=/^0b[01]+$/i,Wf=/^\[object .+?Constructor\]$/,qf=/^0o[0-7]+$/i,Vf=/^(?:0|[1-9]\d*)$/,Xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qs=/($^)/,Kf=/['\n\r\u2028\u2029\\]/g,eo="\\ud800-\\udfff",Gf="\\u0300-\\u036f",Zf="\\ufe20-\\ufe2f",to="\\u20d0-\\u20ff",Zc=Gf+Zf+to,Yc="\\u2700-\\u27bf",xn="a-z\\xdf-\\xf6\\xf8-\\xff",Yf="\\xac\\xb1\\xd7\\xf7",Jf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Xf="\\u2000-\\u206f",Qf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Jc="A-Z\\xc0-\\xd6\\xd8-\\xde",Xc="\\ufe0e\\ufe0f",us=Yf+Jf+Xf+Qf,wa="['\u2019]",hs="["+eo+"]",va="["+us+"]",fs="["+Zc+"]",Qc="\\d+",e0="["+Yc+"]",el="["+xn+"]",tl="[^"+eo+us+Qc+Yc+xn+Jc+"]",ro="\\ud83c[\\udffb-\\udfff]",t0="(?:"+fs+"|"+ro+")",rl="[^"+eo+"]",no="(?:\\ud83c[\\udde6-\\uddff]){2}",Oi="[\\ud800-\\udbff][\\udc00-\\udfff]",Qr="["+Jc+"]",nl="\\u200d",il="(?:"+el+"|"+tl+")",jn="(?:"+Qr+"|"+tl+")",sl="(?:"+wa+"(?:d|ll|m|re|s|t|ve))?",ol="(?:"+wa+"(?:D|LL|M|RE|S|T|VE))?",al=t0+"?",cl="["+Xc+"]?",r0="(?:"+nl+"(?:"+[rl,no,Oi].join("|")+")"+cl+al+")*",Qn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ll="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ul=cl+al+r0,io="(?:"+[e0,no,Oi].join("|")+")"+ul,n0="(?:"+[rl+fs+"?",fs,no,Oi,hs].join("|")+")",ya=RegExp(wa,"g"),i0=RegExp(fs,"g"),so=RegExp(ro+"(?="+ro+")|"+n0+ul,"g"),hl=RegExp([Qr+"?"+el+"+"+sl+"(?="+[va,Qr,"$"].join("|")+")",jn+"+"+ol+"(?="+[va,Qr+il,"$"].join("|")+")",Qr+"?"+il+"+"+sl,Qr+"+"+ol,ll,Qn,Qc,io].join("|"),"g"),fl=RegExp("["+nl+eo+Zc+Xc+"]"),ds=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,dl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],s0=-1,Ct={};Ct[m]=Ct[D]=Ct[B]=Ct[K]=Ct[Q]=Ct[Ee]=Ct[Te]=Ct[st]=Ct[ht]=!0,Ct[ye]=Ct[Le]=Ct[b]=Ct[Y]=Ct[p]=Ct[W]=Ct[F]=Ct[we]=Ct[Me]=Ct[nt]=Ct[Ge]=Ct[Je]=Ct[He]=Ct[Be]=Ct[Ue]=!1;var xt={};xt[ye]=xt[Le]=xt[b]=xt[p]=xt[Y]=xt[W]=xt[m]=xt[D]=xt[B]=xt[K]=xt[Q]=xt[Me]=xt[nt]=xt[Ge]=xt[Je]=xt[He]=xt[Be]=xt[Ke]=xt[Ee]=xt[Te]=xt[st]=xt[ht]=!0,xt[F]=xt[we]=xt[Ue]=!1;var R={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},q={"&":"&","<":"<",">":">",'"':""","'":"'"},fe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},It=parseFloat,Xe=parseInt,Tt=typeof qo=="object"&&qo&&qo.Object===Object&&qo,lr=typeof self=="object"&&self&&self.Object===Object&&self,mt=Tt||lr||Function("return this")(),Ot=e&&!e.nodeType&&e,Xt=Ot&&!0&&t&&!t.nodeType&&t,qr=Xt&&Xt.exports===Ot,ur=qr&&Tt.process,Rt=function(){try{var V=Xt&&Xt.require&&Xt.require("util").types;return V||ur&&ur.binding&&ur.binding("util")}catch{}}(),jr=Rt&&Rt.isArrayBuffer,Cn=Rt&&Rt.isDate,dn=Rt&&Rt.isMap,Fn=Rt&&Rt.isRegExp,ba=Rt&&Rt.isSet,ps=Rt&&Rt.isTypedArray;function vr(V,se,te){switch(te.length){case 0:return V.call(se);case 1:return V.call(se,te[0]);case 2:return V.call(se,te[0],te[1]);case 3:return V.call(se,te[0],te[1],te[2])}return V.apply(se,te)}function oS(V,se,te,Oe){for(var Ye=-1,vt=V==null?0:V.length;++Ye<vt;){var fr=V[Ye];se(Oe,fr,te(fr),V)}return Oe}function pn(V,se){for(var te=-1,Oe=V==null?0:V.length;++te<Oe&&se(V[te],te,V)!==!1;);return V}function aS(V,se){for(var te=V==null?0:V.length;te--&&se(V[te],te,V)!==!1;);return V}function mm(V,se){for(var te=-1,Oe=V==null?0:V.length;++te<Oe;)if(!se(V[te],te,V))return!1;return!0}function Ai(V,se){for(var te=-1,Oe=V==null?0:V.length,Ye=0,vt=[];++te<Oe;){var fr=V[te];se(fr,te,V)&&(vt[Ye++]=fr)}return vt}function pl(V,se){var te=V==null?0:V.length;return!!te&&oo(V,se,0)>-1}function o0(V,se,te){for(var Oe=-1,Ye=V==null?0:V.length;++Oe<Ye;)if(te(se,V[Oe]))return!0;return!1}function Ut(V,se){for(var te=-1,Oe=V==null?0:V.length,Ye=Array(Oe);++te<Oe;)Ye[te]=se(V[te],te,V);return Ye}function Si(V,se){for(var te=-1,Oe=se.length,Ye=V.length;++te<Oe;)V[Ye+te]=se[te];return V}function a0(V,se,te,Oe){var Ye=-1,vt=V==null?0:V.length;for(Oe&&vt&&(te=V[++Ye]);++Ye<vt;)te=se(te,V[Ye],Ye,V);return te}function cS(V,se,te,Oe){var Ye=V==null?0:V.length;for(Oe&&Ye&&(te=V[--Ye]);Ye--;)te=se(te,V[Ye],Ye,V);return te}function c0(V,se){for(var te=-1,Oe=V==null?0:V.length;++te<Oe;)if(se(V[te],te,V))return!0;return!1}var lS=l0("length");function uS(V){return V.split("")}function hS(V){return V.match(cr)||[]}function wm(V,se,te){var Oe;return te(V,function(Ye,vt,fr){if(se(Ye,vt,fr))return Oe=vt,!1}),Oe}function gl(V,se,te,Oe){for(var Ye=V.length,vt=te+(Oe?1:-1);Oe?vt--:++vt<Ye;)if(se(V[vt],vt,V))return vt;return-1}function oo(V,se,te){return se===se?xS(V,se,te):gl(V,vm,te)}function fS(V,se,te,Oe){for(var Ye=te-1,vt=V.length;++Ye<vt;)if(Oe(V[Ye],se))return Ye;return-1}function vm(V){return V!==V}function ym(V,se){var te=V==null?0:V.length;return te?h0(V,se)/te:ae}function l0(V){return function(se){return se==null?r:se[V]}}function u0(V){return function(se){return V==null?r:V[se]}}function bm(V,se,te,Oe,Ye){return Ye(V,function(vt,fr,At){te=Oe?(Oe=!1,vt):se(te,vt,fr,At)}),te}function dS(V,se){var te=V.length;for(V.sort(se);te--;)V[te]=V[te].value;return V}function h0(V,se){for(var te,Oe=-1,Ye=V.length;++Oe<Ye;){var vt=se(V[Oe]);vt!==r&&(te=te===r?vt:te+vt)}return te}function f0(V,se){for(var te=-1,Oe=Array(V);++te<V;)Oe[te]=se(te);return Oe}function pS(V,se){return Ut(se,function(te){return[te,V[te]]})}function _m(V){return V&&V.slice(0,Im(V)+1).replace(Vt,"")}function en(V){return function(se){return V(se)}}function d0(V,se){return Ut(se,function(te){return V[te]})}function _a(V,se){return V.has(se)}function Em(V,se){for(var te=-1,Oe=V.length;++te<Oe&&oo(se,V[te],0)>-1;);return te}function xm(V,se){for(var te=V.length;te--&&oo(se,V[te],0)>-1;);return te}function gS(V,se){for(var te=V.length,Oe=0;te--;)V[te]===se&&++Oe;return Oe}var mS=u0(R),wS=u0(q);function vS(V){return"\\"+Ce[V]}function yS(V,se){return V==null?r:V[se]}function ao(V){return fl.test(V)}function bS(V){return ds.test(V)}function _S(V){for(var se,te=[];!(se=V.next()).done;)te.push(se.value);return te}function p0(V){var se=-1,te=Array(V.size);return V.forEach(function(Oe,Ye){te[++se]=[Ye,Oe]}),te}function Cm(V,se){return function(te){return V(se(te))}}function Di(V,se){for(var te=-1,Oe=V.length,Ye=0,vt=[];++te<Oe;){var fr=V[te];(fr===se||fr===v)&&(V[te]=v,vt[Ye++]=te)}return vt}function ml(V){var se=-1,te=Array(V.size);return V.forEach(function(Oe){te[++se]=Oe}),te}function ES(V){var se=-1,te=Array(V.size);return V.forEach(function(Oe){te[++se]=[Oe,Oe]}),te}function xS(V,se,te){for(var Oe=te-1,Ye=V.length;++Oe<Ye;)if(V[Oe]===se)return Oe;return-1}function CS(V,se,te){for(var Oe=te+1;Oe--;)if(V[Oe]===se)return Oe;return Oe}function co(V){return ao(V)?OS(V):lS(V)}function In(V){return ao(V)?AS(V):uS(V)}function Im(V){for(var se=V.length;se--&&Jt.test(V.charAt(se)););return se}var IS=u0(fe);function OS(V){for(var se=so.lastIndex=0;so.test(V);)++se;return se}function AS(V){return V.match(so)||[]}function SS(V){return V.match(hl)||[]}var DS=function V(se){se=se==null?mt:lo.defaults(mt.Object(),se,lo.pick(mt,dl));var te=se.Array,Oe=se.Date,Ye=se.Error,vt=se.Function,fr=se.Math,At=se.Object,g0=se.RegExp,$S=se.String,gn=se.TypeError,wl=te.prototype,PS=vt.prototype,uo=At.prototype,vl=se["__core-js_shared__"],yl=PS.toString,bt=uo.hasOwnProperty,TS=0,Om=function(){var s=/[^.]+$/.exec(vl&&vl.keys&&vl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),bl=uo.toString,RS=yl.call(At),NS=mt._,LS=g0("^"+yl.call(bt).replace(qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_l=qr?se.Buffer:r,$i=se.Symbol,El=se.Uint8Array,Am=_l?_l.allocUnsafe:r,xl=Cm(At.getPrototypeOf,At),Sm=At.create,Dm=uo.propertyIsEnumerable,Cl=wl.splice,$m=$i?$i.isConcatSpreadable:r,Ea=$i?$i.iterator:r,gs=$i?$i.toStringTag:r,Il=function(){try{var s=bs(At,"defineProperty");return s({},"",{}),s}catch{}}(),MS=se.clearTimeout!==mt.clearTimeout&&se.clearTimeout,US=Oe&&Oe.now!==mt.Date.now&&Oe.now,jS=se.setTimeout!==mt.setTimeout&&se.setTimeout,Ol=fr.ceil,Al=fr.floor,m0=At.getOwnPropertySymbols,FS=_l?_l.isBuffer:r,Pm=se.isFinite,BS=wl.join,kS=Cm(At.keys,At),dr=fr.max,Ar=fr.min,HS=Oe.now,zS=se.parseInt,Tm=fr.random,WS=wl.reverse,w0=bs(se,"DataView"),xa=bs(se,"Map"),v0=bs(se,"Promise"),ho=bs(se,"Set"),Ca=bs(se,"WeakMap"),Ia=bs(At,"create"),Sl=Ca&&new Ca,fo={},qS=_s(w0),VS=_s(xa),KS=_s(v0),GS=_s(ho),ZS=_s(Ca),Dl=$i?$i.prototype:r,Oa=Dl?Dl.valueOf:r,Rm=Dl?Dl.toString:r;function C(s){if(Gt(s)&&!Qe(s)&&!(s instanceof dt)){if(s instanceof mn)return s;if(bt.call(s,"__wrapped__"))return N2(s)}return new mn(s)}var po=function(){function s(){}return function(a){if(!Bt(a))return{};if(Sm)return Sm(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function $l(){}function mn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}C.templateSettings={escape:zt,evaluate:Wt,interpolate:Ft,variable:"",imports:{_:C}},C.prototype=$l.prototype,C.prototype.constructor=C,mn.prototype=po($l.prototype),mn.prototype.constructor=mn;function dt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function YS(){var s=new dt(this.__wrapped__);return s.__actions__=Vr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Vr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Vr(this.__views__),s}function JS(){if(this.__filtered__){var s=new dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function XS(){var s=this.__wrapped__.value(),a=this.__dir__,u=Qe(s),g=a<0,y=u?s.length:0,S=u$(0,y,this.__views__),M=S.start,k=S.end,Z=k-M,ue=g?k:M-1,he=this.__iteratees__,pe=he.length,be=0,Pe=Ar(Z,this.__takeCount__);if(!u||!g&&y==Z&&Pe==Z)return n2(s,this.__actions__);var We=[];e:for(;Z--&&be<Pe;){ue+=a;for(var ot=-1,qe=s[ue];++ot<pe;){var ft=he[ot],wt=ft.iteratee,nn=ft.type,kr=wt(qe);if(nn==j)qe=kr;else if(!kr){if(nn==O)continue e;break e}}We[be++]=qe}return We}dt.prototype=po($l.prototype),dt.prototype.constructor=dt;function ms(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function QS(){this.__data__=Ia?Ia(null):{},this.size=0}function eD(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function tD(s){var a=this.__data__;if(Ia){var u=a[s];return u===h?r:u}return bt.call(a,s)?a[s]:r}function rD(s){var a=this.__data__;return Ia?a[s]!==r:bt.call(a,s)}function nD(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Ia&&a===r?h:a,this}ms.prototype.clear=QS,ms.prototype.delete=eD,ms.prototype.get=tD,ms.prototype.has=rD,ms.prototype.set=nD;function ei(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function iD(){this.__data__=[],this.size=0}function sD(s){var a=this.__data__,u=Pl(a,s);if(u<0)return!1;var g=a.length-1;return u==g?a.pop():Cl.call(a,u,1),--this.size,!0}function oD(s){var a=this.__data__,u=Pl(a,s);return u<0?r:a[u][1]}function aD(s){return Pl(this.__data__,s)>-1}function cD(s,a){var u=this.__data__,g=Pl(u,s);return g<0?(++this.size,u.push([s,a])):u[g][1]=a,this}ei.prototype.clear=iD,ei.prototype.delete=sD,ei.prototype.get=oD,ei.prototype.has=aD,ei.prototype.set=cD;function ti(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function lD(){this.size=0,this.__data__={hash:new ms,map:new(xa||ei),string:new ms}}function uD(s){var a=zl(this,s).delete(s);return this.size-=a?1:0,a}function hD(s){return zl(this,s).get(s)}function fD(s){return zl(this,s).has(s)}function dD(s,a){var u=zl(this,s),g=u.size;return u.set(s,a),this.size+=u.size==g?0:1,this}ti.prototype.clear=lD,ti.prototype.delete=uD,ti.prototype.get=hD,ti.prototype.has=fD,ti.prototype.set=dD;function ws(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new ti;++a<u;)this.add(s[a])}function pD(s){return this.__data__.set(s,h),this}function gD(s){return this.__data__.has(s)}ws.prototype.add=ws.prototype.push=pD,ws.prototype.has=gD;function On(s){var a=this.__data__=new ei(s);this.size=a.size}function mD(){this.__data__=new ei,this.size=0}function wD(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function vD(s){return this.__data__.get(s)}function yD(s){return this.__data__.has(s)}function bD(s,a){var u=this.__data__;if(u instanceof ei){var g=u.__data__;if(!xa||g.length<i-1)return g.push([s,a]),this.size=++u.size,this;u=this.__data__=new ti(g)}return u.set(s,a),this.size=u.size,this}On.prototype.clear=mD,On.prototype.delete=wD,On.prototype.get=vD,On.prototype.has=yD,On.prototype.set=bD;function Nm(s,a){var u=Qe(s),g=!u&&Es(s),y=!u&&!g&&Li(s),S=!u&&!g&&!y&&vo(s),M=u||g||y||S,k=M?f0(s.length,$S):[],Z=k.length;for(var ue in s)(a||bt.call(s,ue))&&!(M&&(ue=="length"||y&&(ue=="offset"||ue=="parent")||S&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||si(ue,Z)))&&k.push(ue);return k}function Lm(s){var a=s.length;return a?s[D0(0,a-1)]:r}function _D(s,a){return Wl(Vr(s),vs(a,0,s.length))}function ED(s){return Wl(Vr(s))}function y0(s,a,u){(u!==r&&!An(s[a],u)||u===r&&!(a in s))&&ri(s,a,u)}function Aa(s,a,u){var g=s[a];(!(bt.call(s,a)&&An(g,u))||u===r&&!(a in s))&&ri(s,a,u)}function Pl(s,a){for(var u=s.length;u--;)if(An(s[u][0],a))return u;return-1}function xD(s,a,u,g){return Pi(s,function(y,S,M){a(g,y,u(y),M)}),g}function Mm(s,a){return s&&kn(a,yr(a),s)}function CD(s,a){return s&&kn(a,Gr(a),s)}function ri(s,a,u){a=="__proto__"&&Il?Il(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function b0(s,a){for(var u=-1,g=a.length,y=te(g),S=s==null;++u<g;)y[u]=S?r:ed(s,a[u]);return y}function vs(s,a,u){return s===s&&(u!==r&&(s=s<=u?s:u),a!==r&&(s=s>=a?s:a)),s}function wn(s,a,u,g,y,S){var M,k=a&E,Z=a&_,ue=a&A;if(u&&(M=y?u(s,g,y,S):u(s)),M!==r)return M;if(!Bt(s))return s;var he=Qe(s);if(he){if(M=f$(s),!k)return Vr(s,M)}else{var pe=Sr(s),be=pe==we||pe==ve;if(Li(s))return o2(s,k);if(pe==Ge||pe==ye||be&&!y){if(M=Z||be?{}:I2(s),!k)return Z?t$(s,CD(M,s)):e$(s,Mm(M,s))}else{if(!xt[pe])return y?s:{};M=d$(s,pe,k)}}S||(S=new On);var Pe=S.get(s);if(Pe)return Pe;S.set(s,M),ew(s)?s.forEach(function(qe){M.add(wn(qe,a,u,qe,s,S))}):X2(s)&&s.forEach(function(qe,ft){M.set(ft,wn(qe,a,u,ft,s,S))});var We=ue?Z?B0:F0:Z?Gr:yr,ot=he?r:We(s);return pn(ot||s,function(qe,ft){ot&&(ft=qe,qe=s[ft]),Aa(M,ft,wn(qe,a,u,ft,s,S))}),M}function ID(s){var a=yr(s);return function(u){return Um(u,s,a)}}function Um(s,a,u){var g=u.length;if(s==null)return!g;for(s=At(s);g--;){var y=u[g],S=a[y],M=s[y];if(M===r&&!(y in s)||!S(M))return!1}return!0}function jm(s,a,u){if(typeof s!="function")throw new gn(c);return Na(function(){s.apply(r,u)},a)}function Sa(s,a,u,g){var y=-1,S=pl,M=!0,k=s.length,Z=[],ue=a.length;if(!k)return Z;u&&(a=Ut(a,en(u))),g?(S=o0,M=!1):a.length>=i&&(S=_a,M=!1,a=new ws(a));e:for(;++y<k;){var he=s[y],pe=u==null?he:u(he);if(he=g||he!==0?he:0,M&&pe===pe){for(var be=ue;be--;)if(a[be]===pe)continue e;Z.push(he)}else S(a,pe,g)||Z.push(he)}return Z}var Pi=h2(Bn),Fm=h2(E0,!0);function OD(s,a){var u=!0;return Pi(s,function(g,y,S){return u=!!a(g,y,S),u}),u}function Tl(s,a,u){for(var g=-1,y=s.length;++g<y;){var S=s[g],M=a(S);if(M!=null&&(k===r?M===M&&!rn(M):u(M,k)))var k=M,Z=S}return Z}function AD(s,a,u,g){var y=s.length;for(u=it(u),u<0&&(u=-u>y?0:y+u),g=g===r||g>y?y:it(g),g<0&&(g+=y),g=u>g?0:rw(g);u<g;)s[u++]=a;return s}function Bm(s,a){var u=[];return Pi(s,function(g,y,S){a(g,y,S)&&u.push(g)}),u}function Cr(s,a,u,g,y){var S=-1,M=s.length;for(u||(u=g$),y||(y=[]);++S<M;){var k=s[S];a>0&&u(k)?a>1?Cr(k,a-1,u,g,y):Si(y,k):g||(y[y.length]=k)}return y}var _0=f2(),km=f2(!0);function Bn(s,a){return s&&_0(s,a,yr)}function E0(s,a){return s&&km(s,a,yr)}function Rl(s,a){return Ai(a,function(u){return oi(s[u])})}function ys(s,a){a=Ri(a,s);for(var u=0,g=a.length;s!=null&&u<g;)s=s[Hn(a[u++])];return u&&u==g?s:r}function Hm(s,a,u){var g=a(s);return Qe(s)?g:Si(g,u(s))}function Fr(s){return s==null?s===r?rt:at:gs&&gs in At(s)?l$(s):E$(s)}function x0(s,a){return s>a}function SD(s,a){return s!=null&&bt.call(s,a)}function DD(s,a){return s!=null&&a in At(s)}function $D(s,a,u){return s>=Ar(a,u)&&s<dr(a,u)}function C0(s,a,u){for(var g=u?o0:pl,y=s[0].length,S=s.length,M=S,k=te(S),Z=1/0,ue=[];M--;){var he=s[M];M&&a&&(he=Ut(he,en(a))),Z=Ar(he.length,Z),k[M]=!u&&(a||y>=120&&he.length>=120)?new ws(M&&he):r}he=s[0];var pe=-1,be=k[0];e:for(;++pe<y&&ue.length<Z;){var Pe=he[pe],We=a?a(Pe):Pe;if(Pe=u||Pe!==0?Pe:0,!(be?_a(be,We):g(ue,We,u))){for(M=S;--M;){var ot=k[M];if(!(ot?_a(ot,We):g(s[M],We,u)))continue e}be&&be.push(We),ue.push(Pe)}}return ue}function PD(s,a,u,g){return Bn(s,function(y,S,M){a(g,u(y),S,M)}),g}function Da(s,a,u){a=Ri(a,s),s=D2(s,a);var g=s==null?s:s[Hn(yn(a))];return g==null?r:vr(g,s,u)}function zm(s){return Gt(s)&&Fr(s)==ye}function TD(s){return Gt(s)&&Fr(s)==b}function RD(s){return Gt(s)&&Fr(s)==W}function $a(s,a,u,g,y){return s===a?!0:s==null||a==null||!Gt(s)&&!Gt(a)?s!==s&&a!==a:ND(s,a,u,g,$a,y)}function ND(s,a,u,g,y,S){var M=Qe(s),k=Qe(a),Z=M?Le:Sr(s),ue=k?Le:Sr(a);Z=Z==ye?Ge:Z,ue=ue==ye?Ge:ue;var he=Z==Ge,pe=ue==Ge,be=Z==ue;if(be&&Li(s)){if(!Li(a))return!1;M=!0,he=!1}if(be&&!he)return S||(S=new On),M||vo(s)?E2(s,a,u,g,y,S):a$(s,a,Z,u,g,y,S);if(!(u&P)){var Pe=he&&bt.call(s,"__wrapped__"),We=pe&&bt.call(a,"__wrapped__");if(Pe||We){var ot=Pe?s.value():s,qe=We?a.value():a;return S||(S=new On),y(ot,qe,u,g,S)}}return be?(S||(S=new On),c$(s,a,u,g,y,S)):!1}function LD(s){return Gt(s)&&Sr(s)==Me}function I0(s,a,u,g){var y=u.length,S=y,M=!g;if(s==null)return!S;for(s=At(s);y--;){var k=u[y];if(M&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++y<S;){k=u[y];var Z=k[0],ue=s[Z],he=k[1];if(M&&k[2]){if(ue===r&&!(Z in s))return!1}else{var pe=new On;if(g)var be=g(ue,he,Z,s,a,pe);if(!(be===r?$a(he,ue,P|U,g,pe):be))return!1}}return!0}function Wm(s){if(!Bt(s)||w$(s))return!1;var a=oi(s)?LS:Wf;return a.test(_s(s))}function MD(s){return Gt(s)&&Fr(s)==Je}function UD(s){return Gt(s)&&Sr(s)==He}function jD(s){return Gt(s)&&Yl(s.length)&&!!Ct[Fr(s)]}function qm(s){return typeof s=="function"?s:s==null?Zr:typeof s=="object"?Qe(s)?Gm(s[0],s[1]):Km(s):dw(s)}function O0(s){if(!Ra(s))return kS(s);var a=[];for(var u in At(s))bt.call(s,u)&&u!="constructor"&&a.push(u);return a}function FD(s){if(!Bt(s))return _$(s);var a=Ra(s),u=[];for(var g in s)g=="constructor"&&(a||!bt.call(s,g))||u.push(g);return u}function A0(s,a){return s<a}function Vm(s,a){var u=-1,g=Kr(s)?te(s.length):[];return Pi(s,function(y,S,M){g[++u]=a(y,S,M)}),g}function Km(s){var a=H0(s);return a.length==1&&a[0][2]?A2(a[0][0],a[0][1]):function(u){return u===s||I0(u,s,a)}}function Gm(s,a){return W0(s)&&O2(a)?A2(Hn(s),a):function(u){var g=ed(u,s);return g===r&&g===a?td(u,s):$a(a,g,P|U)}}function Nl(s,a,u,g,y){s!==a&&_0(a,function(S,M){if(y||(y=new On),Bt(S))BD(s,a,M,u,Nl,g,y);else{var k=g?g(V0(s,M),S,M+"",s,a,y):r;k===r&&(k=S),y0(s,M,k)}},Gr)}function BD(s,a,u,g,y,S,M){var k=V0(s,u),Z=V0(a,u),ue=M.get(Z);if(ue){y0(s,u,ue);return}var he=S?S(k,Z,u+"",s,a,M):r,pe=he===r;if(pe){var be=Qe(Z),Pe=!be&&Li(Z),We=!be&&!Pe&&vo(Z);he=Z,be||Pe||We?Qe(k)?he=k:Qt(k)?he=Vr(k):Pe?(pe=!1,he=o2(Z,!0)):We?(pe=!1,he=a2(Z,!0)):he=[]:La(Z)||Es(Z)?(he=k,Es(k)?he=nw(k):(!Bt(k)||oi(k))&&(he=I2(Z))):pe=!1}pe&&(M.set(Z,he),y(he,Z,g,S,M),M.delete(Z)),y0(s,u,he)}function Zm(s,a){var u=s.length;if(u)return a+=a<0?u:0,si(a,u)?s[a]:r}function Ym(s,a,u){a.length?a=Ut(a,function(S){return Qe(S)?function(M){return ys(M,S.length===1?S[0]:S)}:S}):a=[Zr];var g=-1;a=Ut(a,en(ze()));var y=Vm(s,function(S,M,k){var Z=Ut(a,function(ue){return ue(S)});return{criteria:Z,index:++g,value:S}});return dS(y,function(S,M){return QD(S,M,u)})}function kD(s,a){return Jm(s,a,function(u,g){return td(s,g)})}function Jm(s,a,u){for(var g=-1,y=a.length,S={};++g<y;){var M=a[g],k=ys(s,M);u(k,M)&&Pa(S,Ri(M,s),k)}return S}function HD(s){return function(a){return ys(a,s)}}function S0(s,a,u,g){var y=g?fS:oo,S=-1,M=a.length,k=s;for(s===a&&(a=Vr(a)),u&&(k=Ut(s,en(u)));++S<M;)for(var Z=0,ue=a[S],he=u?u(ue):ue;(Z=y(k,he,Z,g))>-1;)k!==s&&Cl.call(k,Z,1),Cl.call(s,Z,1);return s}function Xm(s,a){for(var u=s?a.length:0,g=u-1;u--;){var y=a[u];if(u==g||y!==S){var S=y;si(y)?Cl.call(s,y,1):T0(s,y)}}return s}function D0(s,a){return s+Al(Tm()*(a-s+1))}function zD(s,a,u,g){for(var y=-1,S=dr(Ol((a-s)/(u||1)),0),M=te(S);S--;)M[g?S:++y]=s,s+=u;return M}function $0(s,a){var u="";if(!s||a<1||a>re)return u;do a%2&&(u+=s),a=Al(a/2),a&&(s+=s);while(a);return u}function ct(s,a){return K0(S2(s,a,Zr),s+"")}function WD(s){return Lm(yo(s))}function qD(s,a){var u=yo(s);return Wl(u,vs(a,0,u.length))}function Pa(s,a,u,g){if(!Bt(s))return s;a=Ri(a,s);for(var y=-1,S=a.length,M=S-1,k=s;k!=null&&++y<S;){var Z=Hn(a[y]),ue=u;if(Z==="__proto__"||Z==="constructor"||Z==="prototype")return s;if(y!=M){var he=k[Z];ue=g?g(he,Z,k):r,ue===r&&(ue=Bt(he)?he:si(a[y+1])?[]:{})}Aa(k,Z,ue),k=k[Z]}return s}var Qm=Sl?function(s,a){return Sl.set(s,a),s}:Zr,VD=Il?function(s,a){return Il(s,"toString",{configurable:!0,enumerable:!1,value:nd(a),writable:!0})}:Zr;function KD(s){return Wl(yo(s))}function vn(s,a,u){var g=-1,y=s.length;a<0&&(a=-a>y?0:y+a),u=u>y?y:u,u<0&&(u+=y),y=a>u?0:u-a>>>0,a>>>=0;for(var S=te(y);++g<y;)S[g]=s[g+a];return S}function GD(s,a){var u;return Pi(s,function(g,y,S){return u=a(g,y,S),!u}),!!u}function Ll(s,a,u){var g=0,y=s==null?g:s.length;if(typeof a=="number"&&a===a&&y<=ge){for(;g<y;){var S=g+y>>>1,M=s[S];M!==null&&!rn(M)&&(u?M<=a:M<a)?g=S+1:y=S}return y}return P0(s,a,Zr,u)}function P0(s,a,u,g){var y=0,S=s==null?0:s.length;if(S===0)return 0;a=u(a);for(var M=a!==a,k=a===null,Z=rn(a),ue=a===r;y<S;){var he=Al((y+S)/2),pe=u(s[he]),be=pe!==r,Pe=pe===null,We=pe===pe,ot=rn(pe);if(M)var qe=g||We;else ue?qe=We&&(g||be):k?qe=We&&be&&(g||!Pe):Z?qe=We&&be&&!Pe&&(g||!ot):Pe||ot?qe=!1:qe=g?pe<=a:pe<a;qe?y=he+1:S=he}return Ar(S,Se)}function e2(s,a){for(var u=-1,g=s.length,y=0,S=[];++u<g;){var M=s[u],k=a?a(M):M;if(!u||!An(k,Z)){var Z=k;S[y++]=M===0?0:M}}return S}function t2(s){return typeof s=="number"?s:rn(s)?ae:+s}function tn(s){if(typeof s=="string")return s;if(Qe(s))return Ut(s,tn)+"";if(rn(s))return Rm?Rm.call(s):"";var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Ti(s,a,u){var g=-1,y=pl,S=s.length,M=!0,k=[],Z=k;if(u)M=!1,y=o0;else if(S>=i){var ue=a?null:s$(s);if(ue)return ml(ue);M=!1,y=_a,Z=new ws}else Z=a?[]:k;e:for(;++g<S;){var he=s[g],pe=a?a(he):he;if(he=u||he!==0?he:0,M&&pe===pe){for(var be=Z.length;be--;)if(Z[be]===pe)continue e;a&&Z.push(pe),k.push(he)}else y(Z,pe,u)||(Z!==k&&Z.push(pe),k.push(he))}return k}function T0(s,a){return a=Ri(a,s),s=D2(s,a),s==null||delete s[Hn(yn(a))]}function r2(s,a,u,g){return Pa(s,a,u(ys(s,a)),g)}function Ml(s,a,u,g){for(var y=s.length,S=g?y:-1;(g?S--:++S<y)&&a(s[S],S,s););return u?vn(s,g?0:S,g?S+1:y):vn(s,g?S+1:0,g?y:S)}function n2(s,a){var u=s;return u instanceof dt&&(u=u.value()),a0(a,function(g,y){return y.func.apply(y.thisArg,Si([g],y.args))},u)}function R0(s,a,u){var g=s.length;if(g<2)return g?Ti(s[0]):[];for(var y=-1,S=te(g);++y<g;)for(var M=s[y],k=-1;++k<g;)k!=y&&(S[y]=Sa(S[y]||M,s[k],a,u));return Ti(Cr(S,1),a,u)}function i2(s,a,u){for(var g=-1,y=s.length,S=a.length,M={};++g<y;){var k=g<S?a[g]:r;u(M,s[g],k)}return M}function N0(s){return Qt(s)?s:[]}function L0(s){return typeof s=="function"?s:Zr}function Ri(s,a){return Qe(s)?s:W0(s,a)?[s]:R2(yt(s))}var ZD=ct;function Ni(s,a,u){var g=s.length;return u=u===r?g:u,!a&&u>=g?s:vn(s,a,u)}var s2=MS||function(s){return mt.clearTimeout(s)};function o2(s,a){if(a)return s.slice();var u=s.length,g=Am?Am(u):new s.constructor(u);return s.copy(g),g}function M0(s){var a=new s.constructor(s.byteLength);return new El(a).set(new El(s)),a}function YD(s,a){var u=a?M0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function JD(s){var a=new s.constructor(s.source,fn.exec(s));return a.lastIndex=s.lastIndex,a}function XD(s){return Oa?At(Oa.call(s)):{}}function a2(s,a){var u=a?M0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function c2(s,a){if(s!==a){var u=s!==r,g=s===null,y=s===s,S=rn(s),M=a!==r,k=a===null,Z=a===a,ue=rn(a);if(!k&&!ue&&!S&&s>a||S&&M&&Z&&!k&&!ue||g&&M&&Z||!u&&Z||!y)return 1;if(!g&&!S&&!ue&&s<a||ue&&u&&y&&!g&&!S||k&&u&&y||!M&&y||!Z)return-1}return 0}function QD(s,a,u){for(var g=-1,y=s.criteria,S=a.criteria,M=y.length,k=u.length;++g<M;){var Z=c2(y[g],S[g]);if(Z){if(g>=k)return Z;var ue=u[g];return Z*(ue=="desc"?-1:1)}}return s.index-a.index}function l2(s,a,u,g){for(var y=-1,S=s.length,M=u.length,k=-1,Z=a.length,ue=dr(S-M,0),he=te(Z+ue),pe=!g;++k<Z;)he[k]=a[k];for(;++y<M;)(pe||y<S)&&(he[u[y]]=s[y]);for(;ue--;)he[k++]=s[y++];return he}function u2(s,a,u,g){for(var y=-1,S=s.length,M=-1,k=u.length,Z=-1,ue=a.length,he=dr(S-k,0),pe=te(he+ue),be=!g;++y<he;)pe[y]=s[y];for(var Pe=y;++Z<ue;)pe[Pe+Z]=a[Z];for(;++M<k;)(be||y<S)&&(pe[Pe+u[M]]=s[y++]);return pe}function Vr(s,a){var u=-1,g=s.length;for(a||(a=te(g));++u<g;)a[u]=s[u];return a}function kn(s,a,u,g){var y=!u;u||(u={});for(var S=-1,M=a.length;++S<M;){var k=a[S],Z=g?g(u[k],s[k],k,u,s):r;Z===r&&(Z=s[k]),y?ri(u,k,Z):Aa(u,k,Z)}return u}function e$(s,a){return kn(s,z0(s),a)}function t$(s,a){return kn(s,x2(s),a)}function Ul(s,a){return function(u,g){var y=Qe(u)?oS:xD,S=a?a():{};return y(u,s,ze(g,2),S)}}function go(s){return ct(function(a,u){var g=-1,y=u.length,S=y>1?u[y-1]:r,M=y>2?u[2]:r;for(S=s.length>3&&typeof S=="function"?(y--,S):r,M&&Br(u[0],u[1],M)&&(S=y<3?r:S,y=1),a=At(a);++g<y;){var k=u[g];k&&s(a,k,g,S)}return a})}function h2(s,a){return function(u,g){if(u==null)return u;if(!Kr(u))return s(u,g);for(var y=u.length,S=a?y:-1,M=At(u);(a?S--:++S<y)&&g(M[S],S,M)!==!1;);return u}}function f2(s){return function(a,u,g){for(var y=-1,S=At(a),M=g(a),k=M.length;k--;){var Z=M[s?k:++y];if(u(S[Z],Z,S)===!1)break}return a}}function r$(s,a,u){var g=a&H,y=Ta(s);function S(){var M=this&&this!==mt&&this instanceof S?y:s;return M.apply(g?u:this,arguments)}return S}function d2(s){return function(a){a=yt(a);var u=ao(a)?In(a):r,g=u?u[0]:a.charAt(0),y=u?Ni(u,1).join(""):a.slice(1);return g[s]()+y}}function mo(s){return function(a){return a0(hw(uw(a).replace(ya,"")),s,"")}}function Ta(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=po(s.prototype),g=s.apply(u,a);return Bt(g)?g:u}}function n$(s,a,u){var g=Ta(s);function y(){for(var S=arguments.length,M=te(S),k=S,Z=wo(y);k--;)M[k]=arguments[k];var ue=S<3&&M[0]!==Z&&M[S-1]!==Z?[]:Di(M,Z);if(S-=ue.length,S<u)return v2(s,a,jl,y.placeholder,r,M,ue,r,r,u-S);var he=this&&this!==mt&&this instanceof y?g:s;return vr(he,this,M)}return y}function p2(s){return function(a,u,g){var y=At(a);if(!Kr(a)){var S=ze(u,3);a=yr(a),u=function(k){return S(y[k],k,y)}}var M=s(a,u,g);return M>-1?y[S?a[M]:M]:r}}function g2(s){return ii(function(a){var u=a.length,g=u,y=mn.prototype.thru;for(s&&a.reverse();g--;){var S=a[g];if(typeof S!="function")throw new gn(c);if(y&&!M&&Hl(S)=="wrapper")var M=new mn([],!0)}for(g=M?g:u;++g<u;){S=a[g];var k=Hl(S),Z=k=="wrapper"?k0(S):r;Z&&q0(Z[0])&&Z[1]==(f|L|T|x)&&!Z[4].length&&Z[9]==1?M=M[Hl(Z[0])].apply(M,Z[3]):M=S.length==1&&q0(S)?M[k]():M.thru(S)}return function(){var ue=arguments,he=ue[0];if(M&&ue.length==1&&Qe(he))return M.plant(he).value();for(var pe=0,be=u?a[pe].apply(this,ue):he;++pe<u;)be=a[pe].call(this,be);return be}})}function jl(s,a,u,g,y,S,M,k,Z,ue){var he=a&f,pe=a&H,be=a&G,Pe=a&(L|$),We=a&J,ot=be?r:Ta(s);function qe(){for(var ft=arguments.length,wt=te(ft),nn=ft;nn--;)wt[nn]=arguments[nn];if(Pe)var kr=wo(qe),sn=gS(wt,kr);if(g&&(wt=l2(wt,g,y,Pe)),S&&(wt=u2(wt,S,M,Pe)),ft-=sn,Pe&&ft<ue){var er=Di(wt,kr);return v2(s,a,jl,qe.placeholder,u,wt,er,k,Z,ue-ft)}var Sn=pe?u:this,ci=be?Sn[s]:s;return ft=wt.length,k?wt=x$(wt,k):We&&ft>1&&wt.reverse(),he&&Z<ft&&(wt.length=Z),this&&this!==mt&&this instanceof qe&&(ci=ot||Ta(ci)),ci.apply(Sn,wt)}return qe}function m2(s,a){return function(u,g){return PD(u,s,a(g),{})}}function Fl(s,a){return function(u,g){var y;if(u===r&&g===r)return a;if(u!==r&&(y=u),g!==r){if(y===r)return g;typeof u=="string"||typeof g=="string"?(u=tn(u),g=tn(g)):(u=t2(u),g=t2(g)),y=s(u,g)}return y}}function U0(s){return ii(function(a){return a=Ut(a,en(ze())),ct(function(u){var g=this;return s(a,function(y){return vr(y,g,u)})})})}function Bl(s,a){a=a===r?" ":tn(a);var u=a.length;if(u<2)return u?$0(a,s):a;var g=$0(a,Ol(s/co(a)));return ao(a)?Ni(In(g),0,s).join(""):g.slice(0,s)}function i$(s,a,u,g){var y=a&H,S=Ta(s);function M(){for(var k=-1,Z=arguments.length,ue=-1,he=g.length,pe=te(he+Z),be=this&&this!==mt&&this instanceof M?S:s;++ue<he;)pe[ue]=g[ue];for(;Z--;)pe[ue++]=arguments[++k];return vr(be,y?u:this,pe)}return M}function w2(s){return function(a,u,g){return g&&typeof g!="number"&&Br(a,u,g)&&(u=g=r),a=ai(a),u===r?(u=a,a=0):u=ai(u),g=g===r?a<u?1:-1:ai(g),zD(a,u,g,s)}}function kl(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=bn(a),u=bn(u)),s(a,u)}}function v2(s,a,u,g,y,S,M,k,Z,ue){var he=a&L,pe=he?M:r,be=he?r:M,Pe=he?S:r,We=he?r:S;a|=he?T:I,a&=~(he?I:T),a&N||(a&=~(H|G));var ot=[s,a,y,Pe,pe,We,be,k,Z,ue],qe=u.apply(r,ot);return q0(s)&&$2(qe,ot),qe.placeholder=g,P2(qe,s,a)}function j0(s){var a=fr[s];return function(u,g){if(u=bn(u),g=g==null?0:Ar(it(g),292),g&&Pm(u)){var y=(yt(u)+"e").split("e"),S=a(y[0]+"e"+(+y[1]+g));return y=(yt(S)+"e").split("e"),+(y[0]+"e"+(+y[1]-g))}return a(u)}}var s$=ho&&1/ml(new ho([,-0]))[1]==le?function(s){return new ho(s)}:od;function y2(s){return function(a){var u=Sr(a);return u==Me?p0(a):u==He?ES(a):pS(a,s(a))}}function ni(s,a,u,g,y,S,M,k){var Z=a&G;if(!Z&&typeof s!="function")throw new gn(c);var ue=g?g.length:0;if(ue||(a&=~(T|I),g=y=r),M=M===r?M:dr(it(M),0),k=k===r?k:it(k),ue-=y?y.length:0,a&I){var he=g,pe=y;g=y=r}var be=Z?r:k0(s),Pe=[s,a,u,g,y,he,pe,S,M,k];if(be&&b$(Pe,be),s=Pe[0],a=Pe[1],u=Pe[2],g=Pe[3],y=Pe[4],k=Pe[9]=Pe[9]===r?Z?0:s.length:dr(Pe[9]-ue,0),!k&&a&(L|$)&&(a&=~(L|$)),!a||a==H)var We=r$(s,a,u);else a==L||a==$?We=n$(s,a,k):(a==T||a==(H|T))&&!y.length?We=i$(s,a,u,g):We=jl.apply(r,Pe);var ot=be?Qm:$2;return P2(ot(We,Pe),s,a)}function b2(s,a,u,g){return s===r||An(s,uo[u])&&!bt.call(g,u)?a:s}function _2(s,a,u,g,y,S){return Bt(s)&&Bt(a)&&(S.set(a,s),Nl(s,a,r,_2,S),S.delete(a)),s}function o$(s){return La(s)?r:s}function E2(s,a,u,g,y,S){var M=u&P,k=s.length,Z=a.length;if(k!=Z&&!(M&&Z>k))return!1;var ue=S.get(s),he=S.get(a);if(ue&&he)return ue==a&&he==s;var pe=-1,be=!0,Pe=u&U?new ws:r;for(S.set(s,a),S.set(a,s);++pe<k;){var We=s[pe],ot=a[pe];if(g)var qe=M?g(ot,We,pe,a,s,S):g(We,ot,pe,s,a,S);if(qe!==r){if(qe)continue;be=!1;break}if(Pe){if(!c0(a,function(ft,wt){if(!_a(Pe,wt)&&(We===ft||y(We,ft,u,g,S)))return Pe.push(wt)})){be=!1;break}}else if(!(We===ot||y(We,ot,u,g,S))){be=!1;break}}return S.delete(s),S.delete(a),be}function a$(s,a,u,g,y,S,M){switch(u){case p:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case b:return!(s.byteLength!=a.byteLength||!S(new El(s),new El(a)));case Y:case W:case nt:return An(+s,+a);case F:return s.name==a.name&&s.message==a.message;case Je:case Be:return s==a+"";case Me:var k=p0;case He:var Z=g&P;if(k||(k=ml),s.size!=a.size&&!Z)return!1;var ue=M.get(s);if(ue)return ue==a;g|=U,M.set(s,a);var he=E2(k(s),k(a),g,y,S,M);return M.delete(s),he;case Ke:if(Oa)return Oa.call(s)==Oa.call(a)}return!1}function c$(s,a,u,g,y,S){var M=u&P,k=F0(s),Z=k.length,ue=F0(a),he=ue.length;if(Z!=he&&!M)return!1;for(var pe=Z;pe--;){var be=k[pe];if(!(M?be in a:bt.call(a,be)))return!1}var Pe=S.get(s),We=S.get(a);if(Pe&&We)return Pe==a&&We==s;var ot=!0;S.set(s,a),S.set(a,s);for(var qe=M;++pe<Z;){be=k[pe];var ft=s[be],wt=a[be];if(g)var nn=M?g(wt,ft,be,a,s,S):g(ft,wt,be,s,a,S);if(!(nn===r?ft===wt||y(ft,wt,u,g,S):nn)){ot=!1;break}qe||(qe=be=="constructor")}if(ot&&!qe){var kr=s.constructor,sn=a.constructor;kr!=sn&&"constructor"in s&&"constructor"in a&&!(typeof kr=="function"&&kr instanceof kr&&typeof sn=="function"&&sn instanceof sn)&&(ot=!1)}return S.delete(s),S.delete(a),ot}function ii(s){return K0(S2(s,r,U2),s+"")}function F0(s){return Hm(s,yr,z0)}function B0(s){return Hm(s,Gr,x2)}var k0=Sl?function(s){return Sl.get(s)}:od;function Hl(s){for(var a=s.name+"",u=fo[a],g=bt.call(fo,a)?u.length:0;g--;){var y=u[g],S=y.func;if(S==null||S==s)return y.name}return a}function wo(s){var a=bt.call(C,"placeholder")?C:s;return a.placeholder}function ze(){var s=C.iteratee||id;return s=s===id?qm:s,arguments.length?s(arguments[0],arguments[1]):s}function zl(s,a){var u=s.__data__;return m$(a)?u[typeof a=="string"?"string":"hash"]:u.map}function H0(s){for(var a=yr(s),u=a.length;u--;){var g=a[u],y=s[g];a[u]=[g,y,O2(y)]}return a}function bs(s,a){var u=yS(s,a);return Wm(u)?u:r}function l$(s){var a=bt.call(s,gs),u=s[gs];try{s[gs]=r;var g=!0}catch{}var y=bl.call(s);return g&&(a?s[gs]=u:delete s[gs]),y}var z0=m0?function(s){return s==null?[]:(s=At(s),Ai(m0(s),function(a){return Dm.call(s,a)}))}:ad,x2=m0?function(s){for(var a=[];s;)Si(a,z0(s)),s=xl(s);return a}:ad,Sr=Fr;(w0&&Sr(new w0(new ArrayBuffer(1)))!=p||xa&&Sr(new xa)!=Me||v0&&Sr(v0.resolve())!=Dt||ho&&Sr(new ho)!=He||Ca&&Sr(new Ca)!=Ue)&&(Sr=function(s){var a=Fr(s),u=a==Ge?s.constructor:r,g=u?_s(u):"";if(g)switch(g){case qS:return p;case VS:return Me;case KS:return Dt;case GS:return He;case ZS:return Ue}return a});function u$(s,a,u){for(var g=-1,y=u.length;++g<y;){var S=u[g],M=S.size;switch(S.type){case"drop":s+=M;break;case"dropRight":a-=M;break;case"take":a=Ar(a,s+M);break;case"takeRight":s=dr(s,a-M);break}}return{start:s,end:a}}function h$(s){var a=s.match(Pt);return a?a[1].split(ar):[]}function C2(s,a,u){a=Ri(a,s);for(var g=-1,y=a.length,S=!1;++g<y;){var M=Hn(a[g]);if(!(S=s!=null&&u(s,M)))break;s=s[M]}return S||++g!=y?S:(y=s==null?0:s.length,!!y&&Yl(y)&&si(M,y)&&(Qe(s)||Es(s)))}function f$(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&bt.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function I2(s){return typeof s.constructor=="function"&&!Ra(s)?po(xl(s)):{}}function d$(s,a,u){var g=s.constructor;switch(a){case b:return M0(s);case Y:case W:return new g(+s);case p:return YD(s,u);case m:case D:case B:case K:case Q:case Ee:case Te:case st:case ht:return a2(s,u);case Me:return new g;case nt:case Be:return new g(s);case Je:return JD(s);case He:return new g;case Ke:return XD(s)}}function p$(s,a){var u=a.length;if(!u)return s;var g=u-1;return a[g]=(u>1?"& ":"")+a[g],a=a.join(u>2?", ":" "),s.replace(Kt,`{
|
|
79
|
+
*/(function(t,e){(function(){var r,n="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",d=500,v="__lodash_placeholder__",E=1,_=2,A=4,P=1,U=2,H=1,G=2,N=4,L=8,$=16,T=32,I=64,f=128,x=256,J=512,z=30,ee="...",de=800,me=16,O=1,j=2,ce=3,le=1/0,re=9007199254740991,ne=17976931348623157e292,ae=0/0,ie=4294967295,Se=ie-1,ge=ie>>>1,Fe=[["ary",f],["bind",H],["bindKey",G],["curry",L],["curryRight",$],["flip",J],["partial",T],["partialRight",I],["rearg",x]],ye="[object Arguments]",Le="[object Array]",X="[object AsyncFunction]",Y="[object Boolean]",W="[object Date]",w="[object DOMException]",F="[object Error]",we="[object Function]",ve="[object GeneratorFunction]",Me="[object Map]",nt="[object Number]",at="[object Null]",Ge="[object Object]",Dt="[object Promise]",$t="[object Proxy]",Je="[object RegExp]",He="[object Set]",Be="[object String]",Ke="[object Symbol]",rt="[object Undefined]",Ue="[object WeakMap]",Ze="[object WeakSet]",b="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",D="[object Float64Array]",B="[object Int8Array]",K="[object Int16Array]",Q="[object Int32Array]",Ee="[object Uint8Array]",Te="[object Uint8ClampedArray]",st="[object Uint16Array]",ht="[object Uint32Array]",lt=/\b__p \+= '';/g,Ur=/\b(__p \+=) '' \+/g,Jn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ii=/&(?:amp|lt|gt|quot|#39);/g,cs=/[&<>"']/g,Ht=RegExp(Ii.source),Lt=RegExp(cs.source),zt=/<%-([\s\S]+?)%>/g,Wt=/<%([\s\S]+?)%>/g,Ft=/<%=([\s\S]+?)%>/g,Mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ir=/^\w*$/,sr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qt=/[\\^$.*+?()[\]{}|]/g,or=RegExp(qt.source),Vt=/^\s+/,Jt=/\s/,Kt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pt=/\{\n\/\* \[wrapped with (.+)\] \*/,ar=/,? & /,cr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,jf=/[()=,{}\[\]\/\s]/,Ff=/\\(\\)?/g,Bf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fn=/\w*$/,kf=/^[-+]0x[0-9a-f]+$/i,Hf=/^0b[01]+$/i,zf=/^\[object .+?Constructor\]$/,Wf=/^0o[0-7]+$/i,qf=/^(?:0|[1-9]\d*)$/,Xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xs=/($^)/,Vf=/['\n\r\u2028\u2029\\]/g,Qs="\\ud800-\\udfff",Kf="\\u0300-\\u036f",Gf="\\ufe20-\\ufe2f",eo="\\u20d0-\\u20ff",Gc=Kf+Gf+eo,Zc="\\u2700-\\u27bf",xn="a-z\\xdf-\\xf6\\xf8-\\xff",Zf="\\xac\\xb1\\xd7\\xf7",Yf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Jf="\\u2000-\\u206f",Xf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Yc="A-Z\\xc0-\\xd6\\xd8-\\xde",Jc="\\ufe0e\\ufe0f",ls=Zf+Yf+Jf+Xf,ma="['\u2019]",us="["+Qs+"]",wa="["+ls+"]",hs="["+Gc+"]",Xc="\\d+",Qf="["+Zc+"]",Qc="["+xn+"]",el="[^"+Qs+ls+Xc+Zc+xn+Yc+"]",to="\\ud83c[\\udffb-\\udfff]",e0="(?:"+hs+"|"+to+")",tl="[^"+Qs+"]",ro="(?:\\ud83c[\\udde6-\\uddff]){2}",Oi="[\\ud800-\\udbff][\\udc00-\\udfff]",Qr="["+Yc+"]",rl="\\u200d",nl="(?:"+Qc+"|"+el+")",jn="(?:"+Qr+"|"+el+")",il="(?:"+ma+"(?:d|ll|m|re|s|t|ve))?",sl="(?:"+ma+"(?:D|LL|M|RE|S|T|VE))?",ol=e0+"?",al="["+Jc+"]?",t0="(?:"+rl+"(?:"+[tl,ro,Oi].join("|")+")"+al+ol+")*",Qn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ll=al+ol+t0,no="(?:"+[Qf,ro,Oi].join("|")+")"+ll,r0="(?:"+[tl+hs+"?",hs,ro,Oi,us].join("|")+")",va=RegExp(ma,"g"),n0=RegExp(hs,"g"),io=RegExp(to+"(?="+to+")|"+r0+ll,"g"),ul=RegExp([Qr+"?"+Qc+"+"+il+"(?="+[wa,Qr,"$"].join("|")+")",jn+"+"+sl+"(?="+[wa,Qr+nl,"$"].join("|")+")",Qr+"?"+nl+"+"+il,Qr+"+"+sl,cl,Qn,Xc,no].join("|"),"g"),hl=RegExp("["+rl+Qs+Gc+Jc+"]"),fs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],i0=-1,Ct={};Ct[m]=Ct[D]=Ct[B]=Ct[K]=Ct[Q]=Ct[Ee]=Ct[Te]=Ct[st]=Ct[ht]=!0,Ct[ye]=Ct[Le]=Ct[b]=Ct[Y]=Ct[p]=Ct[W]=Ct[F]=Ct[we]=Ct[Me]=Ct[nt]=Ct[Ge]=Ct[Je]=Ct[He]=Ct[Be]=Ct[Ue]=!1;var xt={};xt[ye]=xt[Le]=xt[b]=xt[p]=xt[Y]=xt[W]=xt[m]=xt[D]=xt[B]=xt[K]=xt[Q]=xt[Me]=xt[nt]=xt[Ge]=xt[Je]=xt[He]=xt[Be]=xt[Ke]=xt[Ee]=xt[Te]=xt[st]=xt[ht]=!0,xt[F]=xt[we]=xt[Ue]=!1;var R={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},q={"&":"&","<":"<",">":">",'"':""","'":"'"},fe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},It=parseFloat,Xe=parseInt,Tt=typeof Wo=="object"&&Wo&&Wo.Object===Object&&Wo,lr=typeof self=="object"&&self&&self.Object===Object&&self,mt=Tt||lr||Function("return this")(),Ot=e&&!e.nodeType&&e,Xt=Ot&&!0&&t&&!t.nodeType&&t,qr=Xt&&Xt.exports===Ot,ur=qr&&Tt.process,Rt=function(){try{var V=Xt&&Xt.require&&Xt.require("util").types;return V||ur&&ur.binding&&ur.binding("util")}catch{}}(),jr=Rt&&Rt.isArrayBuffer,Cn=Rt&&Rt.isDate,dn=Rt&&Rt.isMap,Fn=Rt&&Rt.isRegExp,ya=Rt&&Rt.isSet,ds=Rt&&Rt.isTypedArray;function vr(V,se,te){switch(te.length){case 0:return V.call(se);case 1:return V.call(se,te[0]);case 2:return V.call(se,te[0],te[1]);case 3:return V.call(se,te[0],te[1],te[2])}return V.apply(se,te)}function sS(V,se,te,Oe){for(var Ye=-1,vt=V==null?0:V.length;++Ye<vt;){var fr=V[Ye];se(Oe,fr,te(fr),V)}return Oe}function pn(V,se){for(var te=-1,Oe=V==null?0:V.length;++te<Oe&&se(V[te],te,V)!==!1;);return V}function oS(V,se){for(var te=V==null?0:V.length;te--&&se(V[te],te,V)!==!1;);return V}function gm(V,se){for(var te=-1,Oe=V==null?0:V.length;++te<Oe;)if(!se(V[te],te,V))return!1;return!0}function Ai(V,se){for(var te=-1,Oe=V==null?0:V.length,Ye=0,vt=[];++te<Oe;){var fr=V[te];se(fr,te,V)&&(vt[Ye++]=fr)}return vt}function dl(V,se){var te=V==null?0:V.length;return!!te&&so(V,se,0)>-1}function s0(V,se,te){for(var Oe=-1,Ye=V==null?0:V.length;++Oe<Ye;)if(te(se,V[Oe]))return!0;return!1}function Ut(V,se){for(var te=-1,Oe=V==null?0:V.length,Ye=Array(Oe);++te<Oe;)Ye[te]=se(V[te],te,V);return Ye}function Si(V,se){for(var te=-1,Oe=se.length,Ye=V.length;++te<Oe;)V[Ye+te]=se[te];return V}function o0(V,se,te,Oe){var Ye=-1,vt=V==null?0:V.length;for(Oe&&vt&&(te=V[++Ye]);++Ye<vt;)te=se(te,V[Ye],Ye,V);return te}function aS(V,se,te,Oe){var Ye=V==null?0:V.length;for(Oe&&Ye&&(te=V[--Ye]);Ye--;)te=se(te,V[Ye],Ye,V);return te}function a0(V,se){for(var te=-1,Oe=V==null?0:V.length;++te<Oe;)if(se(V[te],te,V))return!0;return!1}var cS=c0("length");function lS(V){return V.split("")}function uS(V){return V.match(cr)||[]}function mm(V,se,te){var Oe;return te(V,function(Ye,vt,fr){if(se(Ye,vt,fr))return Oe=vt,!1}),Oe}function pl(V,se,te,Oe){for(var Ye=V.length,vt=te+(Oe?1:-1);Oe?vt--:++vt<Ye;)if(se(V[vt],vt,V))return vt;return-1}function so(V,se,te){return se===se?ES(V,se,te):pl(V,wm,te)}function hS(V,se,te,Oe){for(var Ye=te-1,vt=V.length;++Ye<vt;)if(Oe(V[Ye],se))return Ye;return-1}function wm(V){return V!==V}function vm(V,se){var te=V==null?0:V.length;return te?u0(V,se)/te:ae}function c0(V){return function(se){return se==null?r:se[V]}}function l0(V){return function(se){return V==null?r:V[se]}}function ym(V,se,te,Oe,Ye){return Ye(V,function(vt,fr,At){te=Oe?(Oe=!1,vt):se(te,vt,fr,At)}),te}function fS(V,se){var te=V.length;for(V.sort(se);te--;)V[te]=V[te].value;return V}function u0(V,se){for(var te,Oe=-1,Ye=V.length;++Oe<Ye;){var vt=se(V[Oe]);vt!==r&&(te=te===r?vt:te+vt)}return te}function h0(V,se){for(var te=-1,Oe=Array(V);++te<V;)Oe[te]=se(te);return Oe}function dS(V,se){return Ut(se,function(te){return[te,V[te]]})}function bm(V){return V&&V.slice(0,Cm(V)+1).replace(Vt,"")}function en(V){return function(se){return V(se)}}function f0(V,se){return Ut(se,function(te){return V[te]})}function ba(V,se){return V.has(se)}function _m(V,se){for(var te=-1,Oe=V.length;++te<Oe&&so(se,V[te],0)>-1;);return te}function Em(V,se){for(var te=V.length;te--&&so(se,V[te],0)>-1;);return te}function pS(V,se){for(var te=V.length,Oe=0;te--;)V[te]===se&&++Oe;return Oe}var gS=l0(R),mS=l0(q);function wS(V){return"\\"+Ce[V]}function vS(V,se){return V==null?r:V[se]}function oo(V){return hl.test(V)}function yS(V){return fs.test(V)}function bS(V){for(var se,te=[];!(se=V.next()).done;)te.push(se.value);return te}function d0(V){var se=-1,te=Array(V.size);return V.forEach(function(Oe,Ye){te[++se]=[Ye,Oe]}),te}function xm(V,se){return function(te){return V(se(te))}}function Di(V,se){for(var te=-1,Oe=V.length,Ye=0,vt=[];++te<Oe;){var fr=V[te];(fr===se||fr===v)&&(V[te]=v,vt[Ye++]=te)}return vt}function gl(V){var se=-1,te=Array(V.size);return V.forEach(function(Oe){te[++se]=Oe}),te}function _S(V){var se=-1,te=Array(V.size);return V.forEach(function(Oe){te[++se]=[Oe,Oe]}),te}function ES(V,se,te){for(var Oe=te-1,Ye=V.length;++Oe<Ye;)if(V[Oe]===se)return Oe;return-1}function xS(V,se,te){for(var Oe=te+1;Oe--;)if(V[Oe]===se)return Oe;return Oe}function ao(V){return oo(V)?IS(V):cS(V)}function In(V){return oo(V)?OS(V):lS(V)}function Cm(V){for(var se=V.length;se--&&Jt.test(V.charAt(se)););return se}var CS=l0(fe);function IS(V){for(var se=io.lastIndex=0;io.test(V);)++se;return se}function OS(V){return V.match(io)||[]}function AS(V){return V.match(ul)||[]}var SS=function V(se){se=se==null?mt:co.defaults(mt.Object(),se,co.pick(mt,fl));var te=se.Array,Oe=se.Date,Ye=se.Error,vt=se.Function,fr=se.Math,At=se.Object,p0=se.RegExp,DS=se.String,gn=se.TypeError,ml=te.prototype,$S=vt.prototype,lo=At.prototype,wl=se["__core-js_shared__"],vl=$S.toString,bt=lo.hasOwnProperty,PS=0,Im=function(){var s=/[^.]+$/.exec(wl&&wl.keys&&wl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),yl=lo.toString,TS=vl.call(At),RS=mt._,NS=p0("^"+vl.call(bt).replace(qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bl=qr?se.Buffer:r,$i=se.Symbol,_l=se.Uint8Array,Om=bl?bl.allocUnsafe:r,El=xm(At.getPrototypeOf,At),Am=At.create,Sm=lo.propertyIsEnumerable,xl=ml.splice,Dm=$i?$i.isConcatSpreadable:r,_a=$i?$i.iterator:r,ps=$i?$i.toStringTag:r,Cl=function(){try{var s=ys(At,"defineProperty");return s({},"",{}),s}catch{}}(),LS=se.clearTimeout!==mt.clearTimeout&&se.clearTimeout,MS=Oe&&Oe.now!==mt.Date.now&&Oe.now,US=se.setTimeout!==mt.setTimeout&&se.setTimeout,Il=fr.ceil,Ol=fr.floor,g0=At.getOwnPropertySymbols,jS=bl?bl.isBuffer:r,$m=se.isFinite,FS=ml.join,BS=xm(At.keys,At),dr=fr.max,Ar=fr.min,kS=Oe.now,HS=se.parseInt,Pm=fr.random,zS=ml.reverse,m0=ys(se,"DataView"),Ea=ys(se,"Map"),w0=ys(se,"Promise"),uo=ys(se,"Set"),xa=ys(se,"WeakMap"),Ca=ys(At,"create"),Al=xa&&new xa,ho={},WS=bs(m0),qS=bs(Ea),VS=bs(w0),KS=bs(uo),GS=bs(xa),Sl=$i?$i.prototype:r,Ia=Sl?Sl.valueOf:r,Tm=Sl?Sl.toString:r;function C(s){if(Gt(s)&&!Qe(s)&&!(s instanceof dt)){if(s instanceof mn)return s;if(bt.call(s,"__wrapped__"))return R2(s)}return new mn(s)}var fo=function(){function s(){}return function(a){if(!Bt(a))return{};if(Am)return Am(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function Dl(){}function mn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}C.templateSettings={escape:zt,evaluate:Wt,interpolate:Ft,variable:"",imports:{_:C}},C.prototype=Dl.prototype,C.prototype.constructor=C,mn.prototype=fo(Dl.prototype),mn.prototype.constructor=mn;function dt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function ZS(){var s=new dt(this.__wrapped__);return s.__actions__=Vr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Vr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Vr(this.__views__),s}function YS(){if(this.__filtered__){var s=new dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function JS(){var s=this.__wrapped__.value(),a=this.__dir__,u=Qe(s),g=a<0,y=u?s.length:0,S=l$(0,y,this.__views__),M=S.start,k=S.end,Z=k-M,ue=g?k:M-1,he=this.__iteratees__,pe=he.length,be=0,Pe=Ar(Z,this.__takeCount__);if(!u||!g&&y==Z&&Pe==Z)return r2(s,this.__actions__);var We=[];e:for(;Z--&&be<Pe;){ue+=a;for(var ot=-1,qe=s[ue];++ot<pe;){var ft=he[ot],wt=ft.iteratee,nn=ft.type,kr=wt(qe);if(nn==j)qe=kr;else if(!kr){if(nn==O)continue e;break e}}We[be++]=qe}return We}dt.prototype=fo(Dl.prototype),dt.prototype.constructor=dt;function gs(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function XS(){this.__data__=Ca?Ca(null):{},this.size=0}function QS(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function eD(s){var a=this.__data__;if(Ca){var u=a[s];return u===h?r:u}return bt.call(a,s)?a[s]:r}function tD(s){var a=this.__data__;return Ca?a[s]!==r:bt.call(a,s)}function rD(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Ca&&a===r?h:a,this}gs.prototype.clear=XS,gs.prototype.delete=QS,gs.prototype.get=eD,gs.prototype.has=tD,gs.prototype.set=rD;function ei(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function nD(){this.__data__=[],this.size=0}function iD(s){var a=this.__data__,u=$l(a,s);if(u<0)return!1;var g=a.length-1;return u==g?a.pop():xl.call(a,u,1),--this.size,!0}function sD(s){var a=this.__data__,u=$l(a,s);return u<0?r:a[u][1]}function oD(s){return $l(this.__data__,s)>-1}function aD(s,a){var u=this.__data__,g=$l(u,s);return g<0?(++this.size,u.push([s,a])):u[g][1]=a,this}ei.prototype.clear=nD,ei.prototype.delete=iD,ei.prototype.get=sD,ei.prototype.has=oD,ei.prototype.set=aD;function ti(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function cD(){this.size=0,this.__data__={hash:new gs,map:new(Ea||ei),string:new gs}}function lD(s){var a=Hl(this,s).delete(s);return this.size-=a?1:0,a}function uD(s){return Hl(this,s).get(s)}function hD(s){return Hl(this,s).has(s)}function fD(s,a){var u=Hl(this,s),g=u.size;return u.set(s,a),this.size+=u.size==g?0:1,this}ti.prototype.clear=cD,ti.prototype.delete=lD,ti.prototype.get=uD,ti.prototype.has=hD,ti.prototype.set=fD;function ms(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new ti;++a<u;)this.add(s[a])}function dD(s){return this.__data__.set(s,h),this}function pD(s){return this.__data__.has(s)}ms.prototype.add=ms.prototype.push=dD,ms.prototype.has=pD;function On(s){var a=this.__data__=new ei(s);this.size=a.size}function gD(){this.__data__=new ei,this.size=0}function mD(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function wD(s){return this.__data__.get(s)}function vD(s){return this.__data__.has(s)}function yD(s,a){var u=this.__data__;if(u instanceof ei){var g=u.__data__;if(!Ea||g.length<i-1)return g.push([s,a]),this.size=++u.size,this;u=this.__data__=new ti(g)}return u.set(s,a),this.size=u.size,this}On.prototype.clear=gD,On.prototype.delete=mD,On.prototype.get=wD,On.prototype.has=vD,On.prototype.set=yD;function Rm(s,a){var u=Qe(s),g=!u&&_s(s),y=!u&&!g&&Li(s),S=!u&&!g&&!y&&wo(s),M=u||g||y||S,k=M?h0(s.length,DS):[],Z=k.length;for(var ue in s)(a||bt.call(s,ue))&&!(M&&(ue=="length"||y&&(ue=="offset"||ue=="parent")||S&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||si(ue,Z)))&&k.push(ue);return k}function Nm(s){var a=s.length;return a?s[S0(0,a-1)]:r}function bD(s,a){return zl(Vr(s),ws(a,0,s.length))}function _D(s){return zl(Vr(s))}function v0(s,a,u){(u!==r&&!An(s[a],u)||u===r&&!(a in s))&&ri(s,a,u)}function Oa(s,a,u){var g=s[a];(!(bt.call(s,a)&&An(g,u))||u===r&&!(a in s))&&ri(s,a,u)}function $l(s,a){for(var u=s.length;u--;)if(An(s[u][0],a))return u;return-1}function ED(s,a,u,g){return Pi(s,function(y,S,M){a(g,y,u(y),M)}),g}function Lm(s,a){return s&&kn(a,yr(a),s)}function xD(s,a){return s&&kn(a,Gr(a),s)}function ri(s,a,u){a=="__proto__"&&Cl?Cl(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function y0(s,a){for(var u=-1,g=a.length,y=te(g),S=s==null;++u<g;)y[u]=S?r:Q0(s,a[u]);return y}function ws(s,a,u){return s===s&&(u!==r&&(s=s<=u?s:u),a!==r&&(s=s>=a?s:a)),s}function wn(s,a,u,g,y,S){var M,k=a&E,Z=a&_,ue=a&A;if(u&&(M=y?u(s,g,y,S):u(s)),M!==r)return M;if(!Bt(s))return s;var he=Qe(s);if(he){if(M=h$(s),!k)return Vr(s,M)}else{var pe=Sr(s),be=pe==we||pe==ve;if(Li(s))return s2(s,k);if(pe==Ge||pe==ye||be&&!y){if(M=Z||be?{}:C2(s),!k)return Z?e$(s,xD(M,s)):QD(s,Lm(M,s))}else{if(!xt[pe])return y?s:{};M=f$(s,pe,k)}}S||(S=new On);var Pe=S.get(s);if(Pe)return Pe;S.set(s,M),Q2(s)?s.forEach(function(qe){M.add(wn(qe,a,u,qe,s,S))}):J2(s)&&s.forEach(function(qe,ft){M.set(ft,wn(qe,a,u,ft,s,S))});var We=ue?Z?F0:j0:Z?Gr:yr,ot=he?r:We(s);return pn(ot||s,function(qe,ft){ot&&(ft=qe,qe=s[ft]),Oa(M,ft,wn(qe,a,u,ft,s,S))}),M}function CD(s){var a=yr(s);return function(u){return Mm(u,s,a)}}function Mm(s,a,u){var g=u.length;if(s==null)return!g;for(s=At(s);g--;){var y=u[g],S=a[y],M=s[y];if(M===r&&!(y in s)||!S(M))return!1}return!0}function Um(s,a,u){if(typeof s!="function")throw new gn(c);return Ra(function(){s.apply(r,u)},a)}function Aa(s,a,u,g){var y=-1,S=dl,M=!0,k=s.length,Z=[],ue=a.length;if(!k)return Z;u&&(a=Ut(a,en(u))),g?(S=s0,M=!1):a.length>=i&&(S=ba,M=!1,a=new ms(a));e:for(;++y<k;){var he=s[y],pe=u==null?he:u(he);if(he=g||he!==0?he:0,M&&pe===pe){for(var be=ue;be--;)if(a[be]===pe)continue e;Z.push(he)}else S(a,pe,g)||Z.push(he)}return Z}var Pi=u2(Bn),jm=u2(_0,!0);function ID(s,a){var u=!0;return Pi(s,function(g,y,S){return u=!!a(g,y,S),u}),u}function Pl(s,a,u){for(var g=-1,y=s.length;++g<y;){var S=s[g],M=a(S);if(M!=null&&(k===r?M===M&&!rn(M):u(M,k)))var k=M,Z=S}return Z}function OD(s,a,u,g){var y=s.length;for(u=it(u),u<0&&(u=-u>y?0:y+u),g=g===r||g>y?y:it(g),g<0&&(g+=y),g=u>g?0:tw(g);u<g;)s[u++]=a;return s}function Fm(s,a){var u=[];return Pi(s,function(g,y,S){a(g,y,S)&&u.push(g)}),u}function Cr(s,a,u,g,y){var S=-1,M=s.length;for(u||(u=p$),y||(y=[]);++S<M;){var k=s[S];a>0&&u(k)?a>1?Cr(k,a-1,u,g,y):Si(y,k):g||(y[y.length]=k)}return y}var b0=h2(),Bm=h2(!0);function Bn(s,a){return s&&b0(s,a,yr)}function _0(s,a){return s&&Bm(s,a,yr)}function Tl(s,a){return Ai(a,function(u){return oi(s[u])})}function vs(s,a){a=Ri(a,s);for(var u=0,g=a.length;s!=null&&u<g;)s=s[Hn(a[u++])];return u&&u==g?s:r}function km(s,a,u){var g=a(s);return Qe(s)?g:Si(g,u(s))}function Fr(s){return s==null?s===r?rt:at:ps&&ps in At(s)?c$(s):_$(s)}function E0(s,a){return s>a}function AD(s,a){return s!=null&&bt.call(s,a)}function SD(s,a){return s!=null&&a in At(s)}function DD(s,a,u){return s>=Ar(a,u)&&s<dr(a,u)}function x0(s,a,u){for(var g=u?s0:dl,y=s[0].length,S=s.length,M=S,k=te(S),Z=1/0,ue=[];M--;){var he=s[M];M&&a&&(he=Ut(he,en(a))),Z=Ar(he.length,Z),k[M]=!u&&(a||y>=120&&he.length>=120)?new ms(M&&he):r}he=s[0];var pe=-1,be=k[0];e:for(;++pe<y&&ue.length<Z;){var Pe=he[pe],We=a?a(Pe):Pe;if(Pe=u||Pe!==0?Pe:0,!(be?ba(be,We):g(ue,We,u))){for(M=S;--M;){var ot=k[M];if(!(ot?ba(ot,We):g(s[M],We,u)))continue e}be&&be.push(We),ue.push(Pe)}}return ue}function $D(s,a,u,g){return Bn(s,function(y,S,M){a(g,u(y),S,M)}),g}function Sa(s,a,u){a=Ri(a,s),s=S2(s,a);var g=s==null?s:s[Hn(yn(a))];return g==null?r:vr(g,s,u)}function Hm(s){return Gt(s)&&Fr(s)==ye}function PD(s){return Gt(s)&&Fr(s)==b}function TD(s){return Gt(s)&&Fr(s)==W}function Da(s,a,u,g,y){return s===a?!0:s==null||a==null||!Gt(s)&&!Gt(a)?s!==s&&a!==a:RD(s,a,u,g,Da,y)}function RD(s,a,u,g,y,S){var M=Qe(s),k=Qe(a),Z=M?Le:Sr(s),ue=k?Le:Sr(a);Z=Z==ye?Ge:Z,ue=ue==ye?Ge:ue;var he=Z==Ge,pe=ue==Ge,be=Z==ue;if(be&&Li(s)){if(!Li(a))return!1;M=!0,he=!1}if(be&&!he)return S||(S=new On),M||wo(s)?_2(s,a,u,g,y,S):o$(s,a,Z,u,g,y,S);if(!(u&P)){var Pe=he&&bt.call(s,"__wrapped__"),We=pe&&bt.call(a,"__wrapped__");if(Pe||We){var ot=Pe?s.value():s,qe=We?a.value():a;return S||(S=new On),y(ot,qe,u,g,S)}}return be?(S||(S=new On),a$(s,a,u,g,y,S)):!1}function ND(s){return Gt(s)&&Sr(s)==Me}function C0(s,a,u,g){var y=u.length,S=y,M=!g;if(s==null)return!S;for(s=At(s);y--;){var k=u[y];if(M&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++y<S;){k=u[y];var Z=k[0],ue=s[Z],he=k[1];if(M&&k[2]){if(ue===r&&!(Z in s))return!1}else{var pe=new On;if(g)var be=g(ue,he,Z,s,a,pe);if(!(be===r?Da(he,ue,P|U,g,pe):be))return!1}}return!0}function zm(s){if(!Bt(s)||m$(s))return!1;var a=oi(s)?NS:zf;return a.test(bs(s))}function LD(s){return Gt(s)&&Fr(s)==Je}function MD(s){return Gt(s)&&Sr(s)==He}function UD(s){return Gt(s)&&Zl(s.length)&&!!Ct[Fr(s)]}function Wm(s){return typeof s=="function"?s:s==null?Zr:typeof s=="object"?Qe(s)?Km(s[0],s[1]):Vm(s):fw(s)}function I0(s){if(!Ta(s))return BS(s);var a=[];for(var u in At(s))bt.call(s,u)&&u!="constructor"&&a.push(u);return a}function jD(s){if(!Bt(s))return b$(s);var a=Ta(s),u=[];for(var g in s)g=="constructor"&&(a||!bt.call(s,g))||u.push(g);return u}function O0(s,a){return s<a}function qm(s,a){var u=-1,g=Kr(s)?te(s.length):[];return Pi(s,function(y,S,M){g[++u]=a(y,S,M)}),g}function Vm(s){var a=k0(s);return a.length==1&&a[0][2]?O2(a[0][0],a[0][1]):function(u){return u===s||C0(u,s,a)}}function Km(s,a){return z0(s)&&I2(a)?O2(Hn(s),a):function(u){var g=Q0(u,s);return g===r&&g===a?ed(u,s):Da(a,g,P|U)}}function Rl(s,a,u,g,y){s!==a&&b0(a,function(S,M){if(y||(y=new On),Bt(S))FD(s,a,M,u,Rl,g,y);else{var k=g?g(q0(s,M),S,M+"",s,a,y):r;k===r&&(k=S),v0(s,M,k)}},Gr)}function FD(s,a,u,g,y,S,M){var k=q0(s,u),Z=q0(a,u),ue=M.get(Z);if(ue){v0(s,u,ue);return}var he=S?S(k,Z,u+"",s,a,M):r,pe=he===r;if(pe){var be=Qe(Z),Pe=!be&&Li(Z),We=!be&&!Pe&&wo(Z);he=Z,be||Pe||We?Qe(k)?he=k:Qt(k)?he=Vr(k):Pe?(pe=!1,he=s2(Z,!0)):We?(pe=!1,he=o2(Z,!0)):he=[]:Na(Z)||_s(Z)?(he=k,_s(k)?he=rw(k):(!Bt(k)||oi(k))&&(he=C2(Z))):pe=!1}pe&&(M.set(Z,he),y(he,Z,g,S,M),M.delete(Z)),v0(s,u,he)}function Gm(s,a){var u=s.length;if(u)return a+=a<0?u:0,si(a,u)?s[a]:r}function Zm(s,a,u){a.length?a=Ut(a,function(S){return Qe(S)?function(M){return vs(M,S.length===1?S[0]:S)}:S}):a=[Zr];var g=-1;a=Ut(a,en(ze()));var y=qm(s,function(S,M,k){var Z=Ut(a,function(ue){return ue(S)});return{criteria:Z,index:++g,value:S}});return fS(y,function(S,M){return XD(S,M,u)})}function BD(s,a){return Ym(s,a,function(u,g){return ed(s,g)})}function Ym(s,a,u){for(var g=-1,y=a.length,S={};++g<y;){var M=a[g],k=vs(s,M);u(k,M)&&$a(S,Ri(M,s),k)}return S}function kD(s){return function(a){return vs(a,s)}}function A0(s,a,u,g){var y=g?hS:so,S=-1,M=a.length,k=s;for(s===a&&(a=Vr(a)),u&&(k=Ut(s,en(u)));++S<M;)for(var Z=0,ue=a[S],he=u?u(ue):ue;(Z=y(k,he,Z,g))>-1;)k!==s&&xl.call(k,Z,1),xl.call(s,Z,1);return s}function Jm(s,a){for(var u=s?a.length:0,g=u-1;u--;){var y=a[u];if(u==g||y!==S){var S=y;si(y)?xl.call(s,y,1):P0(s,y)}}return s}function S0(s,a){return s+Ol(Pm()*(a-s+1))}function HD(s,a,u,g){for(var y=-1,S=dr(Il((a-s)/(u||1)),0),M=te(S);S--;)M[g?S:++y]=s,s+=u;return M}function D0(s,a){var u="";if(!s||a<1||a>re)return u;do a%2&&(u+=s),a=Ol(a/2),a&&(s+=s);while(a);return u}function ct(s,a){return V0(A2(s,a,Zr),s+"")}function zD(s){return Nm(vo(s))}function WD(s,a){var u=vo(s);return zl(u,ws(a,0,u.length))}function $a(s,a,u,g){if(!Bt(s))return s;a=Ri(a,s);for(var y=-1,S=a.length,M=S-1,k=s;k!=null&&++y<S;){var Z=Hn(a[y]),ue=u;if(Z==="__proto__"||Z==="constructor"||Z==="prototype")return s;if(y!=M){var he=k[Z];ue=g?g(he,Z,k):r,ue===r&&(ue=Bt(he)?he:si(a[y+1])?[]:{})}Oa(k,Z,ue),k=k[Z]}return s}var Xm=Al?function(s,a){return Al.set(s,a),s}:Zr,qD=Cl?function(s,a){return Cl(s,"toString",{configurable:!0,enumerable:!1,value:rd(a),writable:!0})}:Zr;function VD(s){return zl(vo(s))}function vn(s,a,u){var g=-1,y=s.length;a<0&&(a=-a>y?0:y+a),u=u>y?y:u,u<0&&(u+=y),y=a>u?0:u-a>>>0,a>>>=0;for(var S=te(y);++g<y;)S[g]=s[g+a];return S}function KD(s,a){var u;return Pi(s,function(g,y,S){return u=a(g,y,S),!u}),!!u}function Nl(s,a,u){var g=0,y=s==null?g:s.length;if(typeof a=="number"&&a===a&&y<=ge){for(;g<y;){var S=g+y>>>1,M=s[S];M!==null&&!rn(M)&&(u?M<=a:M<a)?g=S+1:y=S}return y}return $0(s,a,Zr,u)}function $0(s,a,u,g){var y=0,S=s==null?0:s.length;if(S===0)return 0;a=u(a);for(var M=a!==a,k=a===null,Z=rn(a),ue=a===r;y<S;){var he=Ol((y+S)/2),pe=u(s[he]),be=pe!==r,Pe=pe===null,We=pe===pe,ot=rn(pe);if(M)var qe=g||We;else ue?qe=We&&(g||be):k?qe=We&&be&&(g||!Pe):Z?qe=We&&be&&!Pe&&(g||!ot):Pe||ot?qe=!1:qe=g?pe<=a:pe<a;qe?y=he+1:S=he}return Ar(S,Se)}function Qm(s,a){for(var u=-1,g=s.length,y=0,S=[];++u<g;){var M=s[u],k=a?a(M):M;if(!u||!An(k,Z)){var Z=k;S[y++]=M===0?0:M}}return S}function e2(s){return typeof s=="number"?s:rn(s)?ae:+s}function tn(s){if(typeof s=="string")return s;if(Qe(s))return Ut(s,tn)+"";if(rn(s))return Tm?Tm.call(s):"";var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Ti(s,a,u){var g=-1,y=dl,S=s.length,M=!0,k=[],Z=k;if(u)M=!1,y=s0;else if(S>=i){var ue=a?null:i$(s);if(ue)return gl(ue);M=!1,y=ba,Z=new ms}else Z=a?[]:k;e:for(;++g<S;){var he=s[g],pe=a?a(he):he;if(he=u||he!==0?he:0,M&&pe===pe){for(var be=Z.length;be--;)if(Z[be]===pe)continue e;a&&Z.push(pe),k.push(he)}else y(Z,pe,u)||(Z!==k&&Z.push(pe),k.push(he))}return k}function P0(s,a){return a=Ri(a,s),s=S2(s,a),s==null||delete s[Hn(yn(a))]}function t2(s,a,u,g){return $a(s,a,u(vs(s,a)),g)}function Ll(s,a,u,g){for(var y=s.length,S=g?y:-1;(g?S--:++S<y)&&a(s[S],S,s););return u?vn(s,g?0:S,g?S+1:y):vn(s,g?S+1:0,g?y:S)}function r2(s,a){var u=s;return u instanceof dt&&(u=u.value()),o0(a,function(g,y){return y.func.apply(y.thisArg,Si([g],y.args))},u)}function T0(s,a,u){var g=s.length;if(g<2)return g?Ti(s[0]):[];for(var y=-1,S=te(g);++y<g;)for(var M=s[y],k=-1;++k<g;)k!=y&&(S[y]=Aa(S[y]||M,s[k],a,u));return Ti(Cr(S,1),a,u)}function n2(s,a,u){for(var g=-1,y=s.length,S=a.length,M={};++g<y;){var k=g<S?a[g]:r;u(M,s[g],k)}return M}function R0(s){return Qt(s)?s:[]}function N0(s){return typeof s=="function"?s:Zr}function Ri(s,a){return Qe(s)?s:z0(s,a)?[s]:T2(yt(s))}var GD=ct;function Ni(s,a,u){var g=s.length;return u=u===r?g:u,!a&&u>=g?s:vn(s,a,u)}var i2=LS||function(s){return mt.clearTimeout(s)};function s2(s,a){if(a)return s.slice();var u=s.length,g=Om?Om(u):new s.constructor(u);return s.copy(g),g}function L0(s){var a=new s.constructor(s.byteLength);return new _l(a).set(new _l(s)),a}function ZD(s,a){var u=a?L0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function YD(s){var a=new s.constructor(s.source,fn.exec(s));return a.lastIndex=s.lastIndex,a}function JD(s){return Ia?At(Ia.call(s)):{}}function o2(s,a){var u=a?L0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function a2(s,a){if(s!==a){var u=s!==r,g=s===null,y=s===s,S=rn(s),M=a!==r,k=a===null,Z=a===a,ue=rn(a);if(!k&&!ue&&!S&&s>a||S&&M&&Z&&!k&&!ue||g&&M&&Z||!u&&Z||!y)return 1;if(!g&&!S&&!ue&&s<a||ue&&u&&y&&!g&&!S||k&&u&&y||!M&&y||!Z)return-1}return 0}function XD(s,a,u){for(var g=-1,y=s.criteria,S=a.criteria,M=y.length,k=u.length;++g<M;){var Z=a2(y[g],S[g]);if(Z){if(g>=k)return Z;var ue=u[g];return Z*(ue=="desc"?-1:1)}}return s.index-a.index}function c2(s,a,u,g){for(var y=-1,S=s.length,M=u.length,k=-1,Z=a.length,ue=dr(S-M,0),he=te(Z+ue),pe=!g;++k<Z;)he[k]=a[k];for(;++y<M;)(pe||y<S)&&(he[u[y]]=s[y]);for(;ue--;)he[k++]=s[y++];return he}function l2(s,a,u,g){for(var y=-1,S=s.length,M=-1,k=u.length,Z=-1,ue=a.length,he=dr(S-k,0),pe=te(he+ue),be=!g;++y<he;)pe[y]=s[y];for(var Pe=y;++Z<ue;)pe[Pe+Z]=a[Z];for(;++M<k;)(be||y<S)&&(pe[Pe+u[M]]=s[y++]);return pe}function Vr(s,a){var u=-1,g=s.length;for(a||(a=te(g));++u<g;)a[u]=s[u];return a}function kn(s,a,u,g){var y=!u;u||(u={});for(var S=-1,M=a.length;++S<M;){var k=a[S],Z=g?g(u[k],s[k],k,u,s):r;Z===r&&(Z=s[k]),y?ri(u,k,Z):Oa(u,k,Z)}return u}function QD(s,a){return kn(s,H0(s),a)}function e$(s,a){return kn(s,E2(s),a)}function Ml(s,a){return function(u,g){var y=Qe(u)?sS:ED,S=a?a():{};return y(u,s,ze(g,2),S)}}function po(s){return ct(function(a,u){var g=-1,y=u.length,S=y>1?u[y-1]:r,M=y>2?u[2]:r;for(S=s.length>3&&typeof S=="function"?(y--,S):r,M&&Br(u[0],u[1],M)&&(S=y<3?r:S,y=1),a=At(a);++g<y;){var k=u[g];k&&s(a,k,g,S)}return a})}function u2(s,a){return function(u,g){if(u==null)return u;if(!Kr(u))return s(u,g);for(var y=u.length,S=a?y:-1,M=At(u);(a?S--:++S<y)&&g(M[S],S,M)!==!1;);return u}}function h2(s){return function(a,u,g){for(var y=-1,S=At(a),M=g(a),k=M.length;k--;){var Z=M[s?k:++y];if(u(S[Z],Z,S)===!1)break}return a}}function t$(s,a,u){var g=a&H,y=Pa(s);function S(){var M=this&&this!==mt&&this instanceof S?y:s;return M.apply(g?u:this,arguments)}return S}function f2(s){return function(a){a=yt(a);var u=oo(a)?In(a):r,g=u?u[0]:a.charAt(0),y=u?Ni(u,1).join(""):a.slice(1);return g[s]()+y}}function go(s){return function(a){return o0(uw(lw(a).replace(va,"")),s,"")}}function Pa(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=fo(s.prototype),g=s.apply(u,a);return Bt(g)?g:u}}function r$(s,a,u){var g=Pa(s);function y(){for(var S=arguments.length,M=te(S),k=S,Z=mo(y);k--;)M[k]=arguments[k];var ue=S<3&&M[0]!==Z&&M[S-1]!==Z?[]:Di(M,Z);if(S-=ue.length,S<u)return w2(s,a,Ul,y.placeholder,r,M,ue,r,r,u-S);var he=this&&this!==mt&&this instanceof y?g:s;return vr(he,this,M)}return y}function d2(s){return function(a,u,g){var y=At(a);if(!Kr(a)){var S=ze(u,3);a=yr(a),u=function(k){return S(y[k],k,y)}}var M=s(a,u,g);return M>-1?y[S?a[M]:M]:r}}function p2(s){return ii(function(a){var u=a.length,g=u,y=mn.prototype.thru;for(s&&a.reverse();g--;){var S=a[g];if(typeof S!="function")throw new gn(c);if(y&&!M&&kl(S)=="wrapper")var M=new mn([],!0)}for(g=M?g:u;++g<u;){S=a[g];var k=kl(S),Z=k=="wrapper"?B0(S):r;Z&&W0(Z[0])&&Z[1]==(f|L|T|x)&&!Z[4].length&&Z[9]==1?M=M[kl(Z[0])].apply(M,Z[3]):M=S.length==1&&W0(S)?M[k]():M.thru(S)}return function(){var ue=arguments,he=ue[0];if(M&&ue.length==1&&Qe(he))return M.plant(he).value();for(var pe=0,be=u?a[pe].apply(this,ue):he;++pe<u;)be=a[pe].call(this,be);return be}})}function Ul(s,a,u,g,y,S,M,k,Z,ue){var he=a&f,pe=a&H,be=a&G,Pe=a&(L|$),We=a&J,ot=be?r:Pa(s);function qe(){for(var ft=arguments.length,wt=te(ft),nn=ft;nn--;)wt[nn]=arguments[nn];if(Pe)var kr=mo(qe),sn=pS(wt,kr);if(g&&(wt=c2(wt,g,y,Pe)),S&&(wt=l2(wt,S,M,Pe)),ft-=sn,Pe&&ft<ue){var er=Di(wt,kr);return w2(s,a,Ul,qe.placeholder,u,wt,er,k,Z,ue-ft)}var Sn=pe?u:this,ci=be?Sn[s]:s;return ft=wt.length,k?wt=E$(wt,k):We&&ft>1&&wt.reverse(),he&&Z<ft&&(wt.length=Z),this&&this!==mt&&this instanceof qe&&(ci=ot||Pa(ci)),ci.apply(Sn,wt)}return qe}function g2(s,a){return function(u,g){return $D(u,s,a(g),{})}}function jl(s,a){return function(u,g){var y;if(u===r&&g===r)return a;if(u!==r&&(y=u),g!==r){if(y===r)return g;typeof u=="string"||typeof g=="string"?(u=tn(u),g=tn(g)):(u=e2(u),g=e2(g)),y=s(u,g)}return y}}function M0(s){return ii(function(a){return a=Ut(a,en(ze())),ct(function(u){var g=this;return s(a,function(y){return vr(y,g,u)})})})}function Fl(s,a){a=a===r?" ":tn(a);var u=a.length;if(u<2)return u?D0(a,s):a;var g=D0(a,Il(s/ao(a)));return oo(a)?Ni(In(g),0,s).join(""):g.slice(0,s)}function n$(s,a,u,g){var y=a&H,S=Pa(s);function M(){for(var k=-1,Z=arguments.length,ue=-1,he=g.length,pe=te(he+Z),be=this&&this!==mt&&this instanceof M?S:s;++ue<he;)pe[ue]=g[ue];for(;Z--;)pe[ue++]=arguments[++k];return vr(be,y?u:this,pe)}return M}function m2(s){return function(a,u,g){return g&&typeof g!="number"&&Br(a,u,g)&&(u=g=r),a=ai(a),u===r?(u=a,a=0):u=ai(u),g=g===r?a<u?1:-1:ai(g),HD(a,u,g,s)}}function Bl(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=bn(a),u=bn(u)),s(a,u)}}function w2(s,a,u,g,y,S,M,k,Z,ue){var he=a&L,pe=he?M:r,be=he?r:M,Pe=he?S:r,We=he?r:S;a|=he?T:I,a&=~(he?I:T),a&N||(a&=~(H|G));var ot=[s,a,y,Pe,pe,We,be,k,Z,ue],qe=u.apply(r,ot);return W0(s)&&D2(qe,ot),qe.placeholder=g,$2(qe,s,a)}function U0(s){var a=fr[s];return function(u,g){if(u=bn(u),g=g==null?0:Ar(it(g),292),g&&$m(u)){var y=(yt(u)+"e").split("e"),S=a(y[0]+"e"+(+y[1]+g));return y=(yt(S)+"e").split("e"),+(y[0]+"e"+(+y[1]-g))}return a(u)}}var i$=uo&&1/gl(new uo([,-0]))[1]==le?function(s){return new uo(s)}:sd;function v2(s){return function(a){var u=Sr(a);return u==Me?d0(a):u==He?_S(a):dS(a,s(a))}}function ni(s,a,u,g,y,S,M,k){var Z=a&G;if(!Z&&typeof s!="function")throw new gn(c);var ue=g?g.length:0;if(ue||(a&=~(T|I),g=y=r),M=M===r?M:dr(it(M),0),k=k===r?k:it(k),ue-=y?y.length:0,a&I){var he=g,pe=y;g=y=r}var be=Z?r:B0(s),Pe=[s,a,u,g,y,he,pe,S,M,k];if(be&&y$(Pe,be),s=Pe[0],a=Pe[1],u=Pe[2],g=Pe[3],y=Pe[4],k=Pe[9]=Pe[9]===r?Z?0:s.length:dr(Pe[9]-ue,0),!k&&a&(L|$)&&(a&=~(L|$)),!a||a==H)var We=t$(s,a,u);else a==L||a==$?We=r$(s,a,k):(a==T||a==(H|T))&&!y.length?We=n$(s,a,u,g):We=Ul.apply(r,Pe);var ot=be?Xm:D2;return $2(ot(We,Pe),s,a)}function y2(s,a,u,g){return s===r||An(s,lo[u])&&!bt.call(g,u)?a:s}function b2(s,a,u,g,y,S){return Bt(s)&&Bt(a)&&(S.set(a,s),Rl(s,a,r,b2,S),S.delete(a)),s}function s$(s){return Na(s)?r:s}function _2(s,a,u,g,y,S){var M=u&P,k=s.length,Z=a.length;if(k!=Z&&!(M&&Z>k))return!1;var ue=S.get(s),he=S.get(a);if(ue&&he)return ue==a&&he==s;var pe=-1,be=!0,Pe=u&U?new ms:r;for(S.set(s,a),S.set(a,s);++pe<k;){var We=s[pe],ot=a[pe];if(g)var qe=M?g(ot,We,pe,a,s,S):g(We,ot,pe,s,a,S);if(qe!==r){if(qe)continue;be=!1;break}if(Pe){if(!a0(a,function(ft,wt){if(!ba(Pe,wt)&&(We===ft||y(We,ft,u,g,S)))return Pe.push(wt)})){be=!1;break}}else if(!(We===ot||y(We,ot,u,g,S))){be=!1;break}}return S.delete(s),S.delete(a),be}function o$(s,a,u,g,y,S,M){switch(u){case p:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case b:return!(s.byteLength!=a.byteLength||!S(new _l(s),new _l(a)));case Y:case W:case nt:return An(+s,+a);case F:return s.name==a.name&&s.message==a.message;case Je:case Be:return s==a+"";case Me:var k=d0;case He:var Z=g&P;if(k||(k=gl),s.size!=a.size&&!Z)return!1;var ue=M.get(s);if(ue)return ue==a;g|=U,M.set(s,a);var he=_2(k(s),k(a),g,y,S,M);return M.delete(s),he;case Ke:if(Ia)return Ia.call(s)==Ia.call(a)}return!1}function a$(s,a,u,g,y,S){var M=u&P,k=j0(s),Z=k.length,ue=j0(a),he=ue.length;if(Z!=he&&!M)return!1;for(var pe=Z;pe--;){var be=k[pe];if(!(M?be in a:bt.call(a,be)))return!1}var Pe=S.get(s),We=S.get(a);if(Pe&&We)return Pe==a&&We==s;var ot=!0;S.set(s,a),S.set(a,s);for(var qe=M;++pe<Z;){be=k[pe];var ft=s[be],wt=a[be];if(g)var nn=M?g(wt,ft,be,a,s,S):g(ft,wt,be,s,a,S);if(!(nn===r?ft===wt||y(ft,wt,u,g,S):nn)){ot=!1;break}qe||(qe=be=="constructor")}if(ot&&!qe){var kr=s.constructor,sn=a.constructor;kr!=sn&&"constructor"in s&&"constructor"in a&&!(typeof kr=="function"&&kr instanceof kr&&typeof sn=="function"&&sn instanceof sn)&&(ot=!1)}return S.delete(s),S.delete(a),ot}function ii(s){return V0(A2(s,r,M2),s+"")}function j0(s){return km(s,yr,H0)}function F0(s){return km(s,Gr,E2)}var B0=Al?function(s){return Al.get(s)}:sd;function kl(s){for(var a=s.name+"",u=ho[a],g=bt.call(ho,a)?u.length:0;g--;){var y=u[g],S=y.func;if(S==null||S==s)return y.name}return a}function mo(s){var a=bt.call(C,"placeholder")?C:s;return a.placeholder}function ze(){var s=C.iteratee||nd;return s=s===nd?Wm:s,arguments.length?s(arguments[0],arguments[1]):s}function Hl(s,a){var u=s.__data__;return g$(a)?u[typeof a=="string"?"string":"hash"]:u.map}function k0(s){for(var a=yr(s),u=a.length;u--;){var g=a[u],y=s[g];a[u]=[g,y,I2(y)]}return a}function ys(s,a){var u=vS(s,a);return zm(u)?u:r}function c$(s){var a=bt.call(s,ps),u=s[ps];try{s[ps]=r;var g=!0}catch{}var y=yl.call(s);return g&&(a?s[ps]=u:delete s[ps]),y}var H0=g0?function(s){return s==null?[]:(s=At(s),Ai(g0(s),function(a){return Sm.call(s,a)}))}:od,E2=g0?function(s){for(var a=[];s;)Si(a,H0(s)),s=El(s);return a}:od,Sr=Fr;(m0&&Sr(new m0(new ArrayBuffer(1)))!=p||Ea&&Sr(new Ea)!=Me||w0&&Sr(w0.resolve())!=Dt||uo&&Sr(new uo)!=He||xa&&Sr(new xa)!=Ue)&&(Sr=function(s){var a=Fr(s),u=a==Ge?s.constructor:r,g=u?bs(u):"";if(g)switch(g){case WS:return p;case qS:return Me;case VS:return Dt;case KS:return He;case GS:return Ue}return a});function l$(s,a,u){for(var g=-1,y=u.length;++g<y;){var S=u[g],M=S.size;switch(S.type){case"drop":s+=M;break;case"dropRight":a-=M;break;case"take":a=Ar(a,s+M);break;case"takeRight":s=dr(s,a-M);break}}return{start:s,end:a}}function u$(s){var a=s.match(Pt);return a?a[1].split(ar):[]}function x2(s,a,u){a=Ri(a,s);for(var g=-1,y=a.length,S=!1;++g<y;){var M=Hn(a[g]);if(!(S=s!=null&&u(s,M)))break;s=s[M]}return S||++g!=y?S:(y=s==null?0:s.length,!!y&&Zl(y)&&si(M,y)&&(Qe(s)||_s(s)))}function h$(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&bt.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function C2(s){return typeof s.constructor=="function"&&!Ta(s)?fo(El(s)):{}}function f$(s,a,u){var g=s.constructor;switch(a){case b:return L0(s);case Y:case W:return new g(+s);case p:return ZD(s,u);case m:case D:case B:case K:case Q:case Ee:case Te:case st:case ht:return o2(s,u);case Me:return new g;case nt:case Be:return new g(s);case Je:return YD(s);case He:return new g;case Ke:return JD(s)}}function d$(s,a){var u=a.length;if(!u)return s;var g=u-1;return a[g]=(u>1?"& ":"")+a[g],a=a.join(u>2?", ":" "),s.replace(Kt,`{
|
|
80
80
|
/* [wrapped with `+a+`] */
|
|
81
|
-
`)}function g$(s){return Qe(s)||Es(s)||!!($m&&s&&s[$m])}function si(s,a){var u=typeof s;return a=a??re,!!a&&(u=="number"||u!="symbol"&&Vf.test(s))&&s>-1&&s%1==0&&s<a}function Br(s,a,u){if(!Bt(u))return!1;var g=typeof a;return(g=="number"?Kr(u)&&si(a,u.length):g=="string"&&a in u)?An(u[a],s):!1}function W0(s,a){if(Qe(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||rn(s)?!0:ir.test(s)||!Mt.test(s)||a!=null&&s in At(a)}function m$(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function q0(s){var a=Hl(s),u=C[a];if(typeof u!="function"||!(a in dt.prototype))return!1;if(s===u)return!0;var g=k0(u);return!!g&&s===g[0]}function w$(s){return!!Om&&Om in s}var v$=vl?oi:cd;function Ra(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||uo;return s===u}function O2(s){return s===s&&!Bt(s)}function A2(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in At(u))}}function y$(s){var a=Gl(s,function(g){return u.size===d&&u.clear(),g}),u=a.cache;return a}function b$(s,a){var u=s[1],g=a[1],y=u|g,S=y<(H|G|f),M=g==f&&u==L||g==f&&u==x&&s[7].length<=a[8]||g==(f|x)&&a[7].length<=a[8]&&u==L;if(!(S||M))return s;g&H&&(s[2]=a[2],y|=u&H?0:N);var k=a[3];if(k){var Z=s[3];s[3]=Z?l2(Z,k,a[4]):k,s[4]=Z?Di(s[3],v):a[4]}return k=a[5],k&&(Z=s[5],s[5]=Z?u2(Z,k,a[6]):k,s[6]=Z?Di(s[5],v):a[6]),k=a[7],k&&(s[7]=k),g&f&&(s[8]=s[8]==null?a[8]:Ar(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=y,s}function _$(s){var a=[];if(s!=null)for(var u in At(s))a.push(u);return a}function E$(s){return bl.call(s)}function S2(s,a,u){return a=dr(a===r?s.length-1:a,0),function(){for(var g=arguments,y=-1,S=dr(g.length-a,0),M=te(S);++y<S;)M[y]=g[a+y];y=-1;for(var k=te(a+1);++y<a;)k[y]=g[y];return k[a]=u(M),vr(s,this,k)}}function D2(s,a){return a.length<2?s:ys(s,vn(a,0,-1))}function x$(s,a){for(var u=s.length,g=Ar(a.length,u),y=Vr(s);g--;){var S=a[g];s[g]=si(S,u)?y[S]:r}return s}function V0(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var $2=T2(Qm),Na=jS||function(s,a){return mt.setTimeout(s,a)},K0=T2(VD);function P2(s,a,u){var g=a+"";return K0(s,p$(g,C$(h$(g),u)))}function T2(s){var a=0,u=0;return function(){var g=HS(),y=me-(g-u);if(u=g,y>0){if(++a>=de)return arguments[0]}else a=0;return s.apply(r,arguments)}}function Wl(s,a){var u=-1,g=s.length,y=g-1;for(a=a===r?g:a;++u<a;){var S=D0(u,y),M=s[S];s[S]=s[u],s[u]=M}return s.length=a,s}var R2=y$(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(sr,function(u,g,y,S){a.push(y?S.replace(Bf,"$1"):g||u)}),a});function Hn(s){if(typeof s=="string"||rn(s))return s;var a=s+"";return a=="0"&&1/s==-le?"-0":a}function _s(s){if(s!=null){try{return yl.call(s)}catch{}try{return s+""}catch{}}return""}function C$(s,a){return pn(Fe,function(u){var g="_."+u[0];a&u[1]&&!pl(s,g)&&s.push(g)}),s.sort()}function N2(s){if(s instanceof dt)return s.clone();var a=new mn(s.__wrapped__,s.__chain__);return a.__actions__=Vr(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function I$(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=dr(it(a),0);var g=s==null?0:s.length;if(!g||a<1)return[];for(var y=0,S=0,M=te(Ol(g/a));y<g;)M[S++]=vn(s,y,y+=a);return M}function O$(s){for(var a=-1,u=s==null?0:s.length,g=0,y=[];++a<u;){var S=s[a];S&&(y[g++]=S)}return y}function A$(){var s=arguments.length;if(!s)return[];for(var a=te(s-1),u=arguments[0],g=s;g--;)a[g-1]=arguments[g];return Si(Qe(u)?Vr(u):[u],Cr(a,1))}var S$=ct(function(s,a){return Qt(s)?Sa(s,Cr(a,1,Qt,!0)):[]}),D$=ct(function(s,a){var u=yn(a);return Qt(u)&&(u=r),Qt(s)?Sa(s,Cr(a,1,Qt,!0),ze(u,2)):[]}),$$=ct(function(s,a){var u=yn(a);return Qt(u)&&(u=r),Qt(s)?Sa(s,Cr(a,1,Qt,!0),r,u):[]});function P$(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),vn(s,a<0?0:a,g)):[]}function T$(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,vn(s,0,a<0?0:a)):[]}function R$(s,a){return s&&s.length?Ml(s,ze(a,3),!0,!0):[]}function N$(s,a){return s&&s.length?Ml(s,ze(a,3),!0):[]}function L$(s,a,u,g){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&Br(s,a,u)&&(u=0,g=y),AD(s,a,u,g)):[]}function L2(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=u==null?0:it(u);return y<0&&(y=dr(g+y,0)),gl(s,ze(a,3),y)}function M2(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=g-1;return u!==r&&(y=it(u),y=u<0?dr(g+y,0):Ar(y,g-1)),gl(s,ze(a,3),y,!0)}function U2(s){var a=s==null?0:s.length;return a?Cr(s,1):[]}function M$(s){var a=s==null?0:s.length;return a?Cr(s,le):[]}function U$(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:it(a),Cr(s,a)):[]}function j$(s){for(var a=-1,u=s==null?0:s.length,g={};++a<u;){var y=s[a];g[y[0]]=y[1]}return g}function j2(s){return s&&s.length?s[0]:r}function F$(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=u==null?0:it(u);return y<0&&(y=dr(g+y,0)),oo(s,a,y)}function B$(s){var a=s==null?0:s.length;return a?vn(s,0,-1):[]}var k$=ct(function(s){var a=Ut(s,N0);return a.length&&a[0]===s[0]?C0(a):[]}),H$=ct(function(s){var a=yn(s),u=Ut(s,N0);return a===yn(u)?a=r:u.pop(),u.length&&u[0]===s[0]?C0(u,ze(a,2)):[]}),z$=ct(function(s){var a=yn(s),u=Ut(s,N0);return a=typeof a=="function"?a:r,a&&u.pop(),u.length&&u[0]===s[0]?C0(u,r,a):[]});function W$(s,a){return s==null?"":BS.call(s,a)}function yn(s){var a=s==null?0:s.length;return a?s[a-1]:r}function q$(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=g;return u!==r&&(y=it(u),y=y<0?dr(g+y,0):Ar(y,g-1)),a===a?CS(s,a,y):gl(s,vm,y,!0)}function V$(s,a){return s&&s.length?Zm(s,it(a)):r}var K$=ct(F2);function F2(s,a){return s&&s.length&&a&&a.length?S0(s,a):s}function G$(s,a,u){return s&&s.length&&a&&a.length?S0(s,a,ze(u,2)):s}function Z$(s,a,u){return s&&s.length&&a&&a.length?S0(s,a,r,u):s}var Y$=ii(function(s,a){var u=s==null?0:s.length,g=b0(s,a);return Xm(s,Ut(a,function(y){return si(y,u)?+y:y}).sort(c2)),g});function J$(s,a){var u=[];if(!(s&&s.length))return u;var g=-1,y=[],S=s.length;for(a=ze(a,3);++g<S;){var M=s[g];a(M,g,s)&&(u.push(M),y.push(g))}return Xm(s,y),u}function G0(s){return s==null?s:WS.call(s)}function X$(s,a,u){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&Br(s,a,u)?(a=0,u=g):(a=a==null?0:it(a),u=u===r?g:it(u)),vn(s,a,u)):[]}function Q$(s,a){return Ll(s,a)}function eP(s,a,u){return P0(s,a,ze(u,2))}function tP(s,a){var u=s==null?0:s.length;if(u){var g=Ll(s,a);if(g<u&&An(s[g],a))return g}return-1}function rP(s,a){return Ll(s,a,!0)}function nP(s,a,u){return P0(s,a,ze(u,2),!0)}function iP(s,a){var u=s==null?0:s.length;if(u){var g=Ll(s,a,!0)-1;if(An(s[g],a))return g}return-1}function sP(s){return s&&s.length?e2(s):[]}function oP(s,a){return s&&s.length?e2(s,ze(a,2)):[]}function aP(s){var a=s==null?0:s.length;return a?vn(s,1,a):[]}function cP(s,a,u){return s&&s.length?(a=u||a===r?1:it(a),vn(s,0,a<0?0:a)):[]}function lP(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,vn(s,a<0?0:a,g)):[]}function uP(s,a){return s&&s.length?Ml(s,ze(a,3),!1,!0):[]}function hP(s,a){return s&&s.length?Ml(s,ze(a,3)):[]}var fP=ct(function(s){return Ti(Cr(s,1,Qt,!0))}),dP=ct(function(s){var a=yn(s);return Qt(a)&&(a=r),Ti(Cr(s,1,Qt,!0),ze(a,2))}),pP=ct(function(s){var a=yn(s);return a=typeof a=="function"?a:r,Ti(Cr(s,1,Qt,!0),r,a)});function gP(s){return s&&s.length?Ti(s):[]}function mP(s,a){return s&&s.length?Ti(s,ze(a,2)):[]}function wP(s,a){return a=typeof a=="function"?a:r,s&&s.length?Ti(s,r,a):[]}function Z0(s){if(!(s&&s.length))return[];var a=0;return s=Ai(s,function(u){if(Qt(u))return a=dr(u.length,a),!0}),f0(a,function(u){return Ut(s,l0(u))})}function B2(s,a){if(!(s&&s.length))return[];var u=Z0(s);return a==null?u:Ut(u,function(g){return vr(a,r,g)})}var vP=ct(function(s,a){return Qt(s)?Sa(s,a):[]}),yP=ct(function(s){return R0(Ai(s,Qt))}),bP=ct(function(s){var a=yn(s);return Qt(a)&&(a=r),R0(Ai(s,Qt),ze(a,2))}),_P=ct(function(s){var a=yn(s);return a=typeof a=="function"?a:r,R0(Ai(s,Qt),r,a)}),EP=ct(Z0);function xP(s,a){return i2(s||[],a||[],Aa)}function CP(s,a){return i2(s||[],a||[],Pa)}var IP=ct(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,B2(s,u)});function k2(s){var a=C(s);return a.__chain__=!0,a}function OP(s,a){return a(s),s}function ql(s,a){return a(s)}var AP=ii(function(s){var a=s.length,u=a?s[0]:0,g=this.__wrapped__,y=function(S){return b0(S,s)};return a>1||this.__actions__.length||!(g instanceof dt)||!si(u)?this.thru(y):(g=g.slice(u,+u+(a?1:0)),g.__actions__.push({func:ql,args:[y],thisArg:r}),new mn(g,this.__chain__).thru(function(S){return a&&!S.length&&S.push(r),S}))});function SP(){return k2(this)}function DP(){return new mn(this.value(),this.__chain__)}function $P(){this.__values__===r&&(this.__values__=tw(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function PP(){return this}function TP(s){for(var a,u=this;u instanceof $l;){var g=N2(u);g.__index__=0,g.__values__=r,a?y.__wrapped__=g:a=g;var y=g;u=u.__wrapped__}return y.__wrapped__=s,a}function RP(){var s=this.__wrapped__;if(s instanceof dt){var a=s;return this.__actions__.length&&(a=new dt(this)),a=a.reverse(),a.__actions__.push({func:ql,args:[G0],thisArg:r}),new mn(a,this.__chain__)}return this.thru(G0)}function NP(){return n2(this.__wrapped__,this.__actions__)}var LP=Ul(function(s,a,u){bt.call(s,u)?++s[u]:ri(s,u,1)});function MP(s,a,u){var g=Qe(s)?mm:OD;return u&&Br(s,a,u)&&(a=r),g(s,ze(a,3))}function UP(s,a){var u=Qe(s)?Ai:Bm;return u(s,ze(a,3))}var jP=p2(L2),FP=p2(M2);function BP(s,a){return Cr(Vl(s,a),1)}function kP(s,a){return Cr(Vl(s,a),le)}function HP(s,a,u){return u=u===r?1:it(u),Cr(Vl(s,a),u)}function H2(s,a){var u=Qe(s)?pn:Pi;return u(s,ze(a,3))}function z2(s,a){var u=Qe(s)?aS:Fm;return u(s,ze(a,3))}var zP=Ul(function(s,a,u){bt.call(s,u)?s[u].push(a):ri(s,u,[a])});function WP(s,a,u,g){s=Kr(s)?s:yo(s),u=u&&!g?it(u):0;var y=s.length;return u<0&&(u=dr(y+u,0)),Jl(s)?u<=y&&s.indexOf(a,u)>-1:!!y&&oo(s,a,u)>-1}var qP=ct(function(s,a,u){var g=-1,y=typeof a=="function",S=Kr(s)?te(s.length):[];return Pi(s,function(M){S[++g]=y?vr(a,M,u):Da(M,a,u)}),S}),VP=Ul(function(s,a,u){ri(s,u,a)});function Vl(s,a){var u=Qe(s)?Ut:Vm;return u(s,ze(a,3))}function KP(s,a,u,g){return s==null?[]:(Qe(a)||(a=a==null?[]:[a]),u=g?r:u,Qe(u)||(u=u==null?[]:[u]),Ym(s,a,u))}var GP=Ul(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function ZP(s,a,u){var g=Qe(s)?a0:bm,y=arguments.length<3;return g(s,ze(a,4),u,y,Pi)}function YP(s,a,u){var g=Qe(s)?cS:bm,y=arguments.length<3;return g(s,ze(a,4),u,y,Fm)}function JP(s,a){var u=Qe(s)?Ai:Bm;return u(s,Zl(ze(a,3)))}function XP(s){var a=Qe(s)?Lm:WD;return a(s)}function QP(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=it(a);var g=Qe(s)?_D:qD;return g(s,a)}function eT(s){var a=Qe(s)?ED:KD;return a(s)}function tT(s){if(s==null)return 0;if(Kr(s))return Jl(s)?co(s):s.length;var a=Sr(s);return a==Me||a==He?s.size:O0(s).length}function rT(s,a,u){var g=Qe(s)?c0:GD;return u&&Br(s,a,u)&&(a=r),g(s,ze(a,3))}var nT=ct(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Br(s,a[0],a[1])?a=[]:u>2&&Br(a[0],a[1],a[2])&&(a=[a[0]]),Ym(s,Cr(a,1),[])}),Kl=US||function(){return mt.Date.now()};function iT(s,a){if(typeof a!="function")throw new gn(c);return s=it(s),function(){if(--s<1)return a.apply(this,arguments)}}function W2(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,ni(s,f,r,r,r,r,a)}function q2(s,a){var u;if(typeof a!="function")throw new gn(c);return s=it(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=r),u}}var Y0=ct(function(s,a,u){var g=H;if(u.length){var y=Di(u,wo(Y0));g|=T}return ni(s,g,a,u,y)}),V2=ct(function(s,a,u){var g=H|G;if(u.length){var y=Di(u,wo(V2));g|=T}return ni(a,g,s,u,y)});function K2(s,a,u){a=u?r:a;var g=ni(s,L,r,r,r,r,r,a);return g.placeholder=K2.placeholder,g}function G2(s,a,u){a=u?r:a;var g=ni(s,$,r,r,r,r,r,a);return g.placeholder=G2.placeholder,g}function Z2(s,a,u){var g,y,S,M,k,Z,ue=0,he=!1,pe=!1,be=!0;if(typeof s!="function")throw new gn(c);a=bn(a)||0,Bt(u)&&(he=!!u.leading,pe="maxWait"in u,S=pe?dr(bn(u.maxWait)||0,a):S,be="trailing"in u?!!u.trailing:be);function Pe(er){var Sn=g,ci=y;return g=y=r,ue=er,M=s.apply(ci,Sn),M}function We(er){return ue=er,k=Na(ft,a),he?Pe(er):M}function ot(er){var Sn=er-Z,ci=er-ue,pw=a-Sn;return pe?Ar(pw,S-ci):pw}function qe(er){var Sn=er-Z,ci=er-ue;return Z===r||Sn>=a||Sn<0||pe&&ci>=S}function ft(){var er=Kl();if(qe(er))return wt(er);k=Na(ft,ot(er))}function wt(er){return k=r,be&&g?Pe(er):(g=y=r,M)}function nn(){k!==r&&s2(k),ue=0,g=Z=y=k=r}function kr(){return k===r?M:wt(Kl())}function sn(){var er=Kl(),Sn=qe(er);if(g=arguments,y=this,Z=er,Sn){if(k===r)return We(Z);if(pe)return s2(k),k=Na(ft,a),Pe(Z)}return k===r&&(k=Na(ft,a)),M}return sn.cancel=nn,sn.flush=kr,sn}var sT=ct(function(s,a){return jm(s,1,a)}),oT=ct(function(s,a,u){return jm(s,bn(a)||0,u)});function aT(s){return ni(s,J)}function Gl(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new gn(c);var u=function(){var g=arguments,y=a?a.apply(this,g):g[0],S=u.cache;if(S.has(y))return S.get(y);var M=s.apply(this,g);return u.cache=S.set(y,M)||S,M};return u.cache=new(Gl.Cache||ti),u}Gl.Cache=ti;function Zl(s){if(typeof s!="function")throw new gn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function cT(s){return q2(2,s)}var lT=ZD(function(s,a){a=a.length==1&&Qe(a[0])?Ut(a[0],en(ze())):Ut(Cr(a,1),en(ze()));var u=a.length;return ct(function(g){for(var y=-1,S=Ar(g.length,u);++y<S;)g[y]=a[y].call(this,g[y]);return vr(s,this,g)})}),J0=ct(function(s,a){var u=Di(a,wo(J0));return ni(s,T,r,a,u)}),Y2=ct(function(s,a){var u=Di(a,wo(Y2));return ni(s,I,r,a,u)}),uT=ii(function(s,a){return ni(s,x,r,r,r,a)});function hT(s,a){if(typeof s!="function")throw new gn(c);return a=a===r?a:it(a),ct(s,a)}function fT(s,a){if(typeof s!="function")throw new gn(c);return a=a==null?0:dr(it(a),0),ct(function(u){var g=u[a],y=Ni(u,0,a);return g&&Si(y,g),vr(s,this,y)})}function dT(s,a,u){var g=!0,y=!0;if(typeof s!="function")throw new gn(c);return Bt(u)&&(g="leading"in u?!!u.leading:g,y="trailing"in u?!!u.trailing:y),Z2(s,a,{leading:g,maxWait:a,trailing:y})}function pT(s){return W2(s,1)}function gT(s,a){return J0(L0(a),s)}function mT(){if(!arguments.length)return[];var s=arguments[0];return Qe(s)?s:[s]}function wT(s){return wn(s,A)}function vT(s,a){return a=typeof a=="function"?a:r,wn(s,A,a)}function yT(s){return wn(s,E|A)}function bT(s,a){return a=typeof a=="function"?a:r,wn(s,E|A,a)}function _T(s,a){return a==null||Um(s,a,yr(a))}function An(s,a){return s===a||s!==s&&a!==a}var ET=kl(x0),xT=kl(function(s,a){return s>=a}),Es=zm(function(){return arguments}())?zm:function(s){return Gt(s)&&bt.call(s,"callee")&&!Dm.call(s,"callee")},Qe=te.isArray,CT=jr?en(jr):TD;function Kr(s){return s!=null&&Yl(s.length)&&!oi(s)}function Qt(s){return Gt(s)&&Kr(s)}function IT(s){return s===!0||s===!1||Gt(s)&&Fr(s)==Y}var Li=FS||cd,OT=Cn?en(Cn):RD;function AT(s){return Gt(s)&&s.nodeType===1&&!La(s)}function ST(s){if(s==null)return!0;if(Kr(s)&&(Qe(s)||typeof s=="string"||typeof s.splice=="function"||Li(s)||vo(s)||Es(s)))return!s.length;var a=Sr(s);if(a==Me||a==He)return!s.size;if(Ra(s))return!O0(s).length;for(var u in s)if(bt.call(s,u))return!1;return!0}function DT(s,a){return $a(s,a)}function $T(s,a,u){u=typeof u=="function"?u:r;var g=u?u(s,a):r;return g===r?$a(s,a,r,u):!!g}function X0(s){if(!Gt(s))return!1;var a=Fr(s);return a==F||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!La(s)}function PT(s){return typeof s=="number"&&Pm(s)}function oi(s){if(!Bt(s))return!1;var a=Fr(s);return a==we||a==ve||a==X||a==$t}function J2(s){return typeof s=="number"&&s==it(s)}function Yl(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=re}function Bt(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function Gt(s){return s!=null&&typeof s=="object"}var X2=dn?en(dn):LD;function TT(s,a){return s===a||I0(s,a,H0(a))}function RT(s,a,u){return u=typeof u=="function"?u:r,I0(s,a,H0(a),u)}function NT(s){return Q2(s)&&s!=+s}function LT(s){if(v$(s))throw new Ye(o);return Wm(s)}function MT(s){return s===null}function UT(s){return s==null}function Q2(s){return typeof s=="number"||Gt(s)&&Fr(s)==nt}function La(s){if(!Gt(s)||Fr(s)!=Ge)return!1;var a=xl(s);if(a===null)return!0;var u=bt.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&yl.call(u)==RS}var Q0=Fn?en(Fn):MD;function jT(s){return J2(s)&&s>=-re&&s<=re}var ew=ba?en(ba):UD;function Jl(s){return typeof s=="string"||!Qe(s)&&Gt(s)&&Fr(s)==Be}function rn(s){return typeof s=="symbol"||Gt(s)&&Fr(s)==Ke}var vo=ps?en(ps):jD;function FT(s){return s===r}function BT(s){return Gt(s)&&Sr(s)==Ue}function kT(s){return Gt(s)&&Fr(s)==Ze}var HT=kl(A0),zT=kl(function(s,a){return s<=a});function tw(s){if(!s)return[];if(Kr(s))return Jl(s)?In(s):Vr(s);if(Ea&&s[Ea])return _S(s[Ea]());var a=Sr(s),u=a==Me?p0:a==He?ml:yo;return u(s)}function ai(s){if(!s)return s===0?s:0;if(s=bn(s),s===le||s===-le){var a=s<0?-1:1;return a*ne}return s===s?s:0}function it(s){var a=ai(s),u=a%1;return a===a?u?a-u:a:0}function rw(s){return s?vs(it(s),0,ie):0}function bn(s){if(typeof s=="number")return s;if(rn(s))return ae;if(Bt(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=Bt(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=_m(s);var u=zf.test(s);return u||qf.test(s)?Xe(s.slice(2),u?2:8):Hf.test(s)?ae:+s}function nw(s){return kn(s,Gr(s))}function WT(s){return s?vs(it(s),-re,re):s===0?s:0}function yt(s){return s==null?"":tn(s)}var qT=go(function(s,a){if(Ra(a)||Kr(a)){kn(a,yr(a),s);return}for(var u in a)bt.call(a,u)&&Aa(s,u,a[u])}),iw=go(function(s,a){kn(a,Gr(a),s)}),Xl=go(function(s,a,u,g){kn(a,Gr(a),s,g)}),VT=go(function(s,a,u,g){kn(a,yr(a),s,g)}),KT=ii(b0);function GT(s,a){var u=po(s);return a==null?u:Mm(u,a)}var ZT=ct(function(s,a){s=At(s);var u=-1,g=a.length,y=g>2?a[2]:r;for(y&&Br(a[0],a[1],y)&&(g=1);++u<g;)for(var S=a[u],M=Gr(S),k=-1,Z=M.length;++k<Z;){var ue=M[k],he=s[ue];(he===r||An(he,uo[ue])&&!bt.call(s,ue))&&(s[ue]=S[ue])}return s}),YT=ct(function(s){return s.push(r,_2),vr(sw,r,s)});function JT(s,a){return wm(s,ze(a,3),Bn)}function XT(s,a){return wm(s,ze(a,3),E0)}function QT(s,a){return s==null?s:_0(s,ze(a,3),Gr)}function eR(s,a){return s==null?s:km(s,ze(a,3),Gr)}function tR(s,a){return s&&Bn(s,ze(a,3))}function rR(s,a){return s&&E0(s,ze(a,3))}function nR(s){return s==null?[]:Rl(s,yr(s))}function iR(s){return s==null?[]:Rl(s,Gr(s))}function ed(s,a,u){var g=s==null?r:ys(s,a);return g===r?u:g}function sR(s,a){return s!=null&&C2(s,a,SD)}function td(s,a){return s!=null&&C2(s,a,DD)}var oR=m2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=bl.call(a)),s[a]=u},nd(Zr)),aR=m2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=bl.call(a)),bt.call(s,a)?s[a].push(u):s[a]=[u]},ze),cR=ct(Da);function yr(s){return Kr(s)?Nm(s):O0(s)}function Gr(s){return Kr(s)?Nm(s,!0):FD(s)}function lR(s,a){var u={};return a=ze(a,3),Bn(s,function(g,y,S){ri(u,a(g,y,S),g)}),u}function uR(s,a){var u={};return a=ze(a,3),Bn(s,function(g,y,S){ri(u,y,a(g,y,S))}),u}var hR=go(function(s,a,u){Nl(s,a,u)}),sw=go(function(s,a,u,g){Nl(s,a,u,g)}),fR=ii(function(s,a){var u={};if(s==null)return u;var g=!1;a=Ut(a,function(S){return S=Ri(S,s),g||(g=S.length>1),S}),kn(s,B0(s),u),g&&(u=wn(u,E|_|A,o$));for(var y=a.length;y--;)T0(u,a[y]);return u});function dR(s,a){return ow(s,Zl(ze(a)))}var pR=ii(function(s,a){return s==null?{}:kD(s,a)});function ow(s,a){if(s==null)return{};var u=Ut(B0(s),function(g){return[g]});return a=ze(a),Jm(s,u,function(g,y){return a(g,y[0])})}function gR(s,a,u){a=Ri(a,s);var g=-1,y=a.length;for(y||(y=1,s=r);++g<y;){var S=s==null?r:s[Hn(a[g])];S===r&&(g=y,S=u),s=oi(S)?S.call(s):S}return s}function mR(s,a,u){return s==null?s:Pa(s,a,u)}function wR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:Pa(s,a,u,g)}var aw=y2(yr),cw=y2(Gr);function vR(s,a,u){var g=Qe(s),y=g||Li(s)||vo(s);if(a=ze(a,4),u==null){var S=s&&s.constructor;y?u=g?new S:[]:Bt(s)?u=oi(S)?po(xl(s)):{}:u={}}return(y?pn:Bn)(s,function(M,k,Z){return a(u,M,k,Z)}),u}function yR(s,a){return s==null?!0:T0(s,a)}function bR(s,a,u){return s==null?s:r2(s,a,L0(u))}function _R(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:r2(s,a,L0(u),g)}function yo(s){return s==null?[]:d0(s,yr(s))}function ER(s){return s==null?[]:d0(s,Gr(s))}function xR(s,a,u){return u===r&&(u=a,a=r),u!==r&&(u=bn(u),u=u===u?u:0),a!==r&&(a=bn(a),a=a===a?a:0),vs(bn(s),a,u)}function CR(s,a,u){return a=ai(a),u===r?(u=a,a=0):u=ai(u),s=bn(s),$D(s,a,u)}function IR(s,a,u){if(u&&typeof u!="boolean"&&Br(s,a,u)&&(a=u=r),u===r&&(typeof a=="boolean"?(u=a,a=r):typeof s=="boolean"&&(u=s,s=r)),s===r&&a===r?(s=0,a=1):(s=ai(s),a===r?(a=s,s=0):a=ai(a)),s>a){var g=s;s=a,a=g}if(u||s%1||a%1){var y=Tm();return Ar(s+y*(a-s+It("1e-"+((y+"").length-1))),a)}return D0(s,a)}var OR=mo(function(s,a,u){return a=a.toLowerCase(),s+(u?lw(a):a)});function lw(s){return rd(yt(s).toLowerCase())}function uw(s){return s=yt(s),s&&s.replace(Xn,mS).replace(i0,"")}function AR(s,a,u){s=yt(s),a=tn(a);var g=s.length;u=u===r?g:vs(it(u),0,g);var y=u;return u-=a.length,u>=0&&s.slice(u,y)==a}function SR(s){return s=yt(s),s&&Lt.test(s)?s.replace(ls,wS):s}function DR(s){return s=yt(s),s&&or.test(s)?s.replace(qt,"\\$&"):s}var $R=mo(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),PR=mo(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),TR=d2("toLowerCase");function RR(s,a,u){s=yt(s),a=it(a);var g=a?co(s):0;if(!a||g>=a)return s;var y=(a-g)/2;return Bl(Al(y),u)+s+Bl(Ol(y),u)}function NR(s,a,u){s=yt(s),a=it(a);var g=a?co(s):0;return a&&g<a?s+Bl(a-g,u):s}function LR(s,a,u){s=yt(s),a=it(a);var g=a?co(s):0;return a&&g<a?Bl(a-g,u)+s:s}function MR(s,a,u){return u||a==null?a=0:a&&(a=+a),zS(yt(s).replace(Vt,""),a||0)}function UR(s,a,u){return(u?Br(s,a,u):a===r)?a=1:a=it(a),$0(yt(s),a)}function jR(){var s=arguments,a=yt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var FR=mo(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function BR(s,a,u){return u&&typeof u!="number"&&Br(s,a,u)&&(a=u=r),u=u===r?ie:u>>>0,u?(s=yt(s),s&&(typeof a=="string"||a!=null&&!Q0(a))&&(a=tn(a),!a&&ao(s))?Ni(In(s),0,u):s.split(a,u)):[]}var kR=mo(function(s,a,u){return s+(u?" ":"")+rd(a)});function HR(s,a,u){return s=yt(s),u=u==null?0:vs(it(u),0,s.length),a=tn(a),s.slice(u,u+a.length)==a}function zR(s,a,u){var g=C.templateSettings;u&&Br(s,a,u)&&(a=r),s=yt(s),a=Xl({},a,g,b2);var y=Xl({},a.imports,g.imports,b2),S=yr(y),M=d0(y,S),k,Z,ue=0,he=a.interpolate||Qs,pe="__p += '",be=g0((a.escape||Qs).source+"|"+he.source+"|"+(he===Ft?kf:Qs).source+"|"+(a.evaluate||Qs).source+"|$","g"),Pe="//# sourceURL="+(bt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++s0+"]")+`
|
|
82
|
-
`;s.replace(be,function(qe,ft,wt,nn,kr,sn){return wt||(wt=nn),pe+=s.slice(ue,sn).replace(
|
|
81
|
+
`)}function p$(s){return Qe(s)||_s(s)||!!(Dm&&s&&s[Dm])}function si(s,a){var u=typeof s;return a=a??re,!!a&&(u=="number"||u!="symbol"&&qf.test(s))&&s>-1&&s%1==0&&s<a}function Br(s,a,u){if(!Bt(u))return!1;var g=typeof a;return(g=="number"?Kr(u)&&si(a,u.length):g=="string"&&a in u)?An(u[a],s):!1}function z0(s,a){if(Qe(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||rn(s)?!0:ir.test(s)||!Mt.test(s)||a!=null&&s in At(a)}function g$(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function W0(s){var a=kl(s),u=C[a];if(typeof u!="function"||!(a in dt.prototype))return!1;if(s===u)return!0;var g=B0(u);return!!g&&s===g[0]}function m$(s){return!!Im&&Im in s}var w$=wl?oi:ad;function Ta(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||lo;return s===u}function I2(s){return s===s&&!Bt(s)}function O2(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in At(u))}}function v$(s){var a=Kl(s,function(g){return u.size===d&&u.clear(),g}),u=a.cache;return a}function y$(s,a){var u=s[1],g=a[1],y=u|g,S=y<(H|G|f),M=g==f&&u==L||g==f&&u==x&&s[7].length<=a[8]||g==(f|x)&&a[7].length<=a[8]&&u==L;if(!(S||M))return s;g&H&&(s[2]=a[2],y|=u&H?0:N);var k=a[3];if(k){var Z=s[3];s[3]=Z?c2(Z,k,a[4]):k,s[4]=Z?Di(s[3],v):a[4]}return k=a[5],k&&(Z=s[5],s[5]=Z?l2(Z,k,a[6]):k,s[6]=Z?Di(s[5],v):a[6]),k=a[7],k&&(s[7]=k),g&f&&(s[8]=s[8]==null?a[8]:Ar(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=y,s}function b$(s){var a=[];if(s!=null)for(var u in At(s))a.push(u);return a}function _$(s){return yl.call(s)}function A2(s,a,u){return a=dr(a===r?s.length-1:a,0),function(){for(var g=arguments,y=-1,S=dr(g.length-a,0),M=te(S);++y<S;)M[y]=g[a+y];y=-1;for(var k=te(a+1);++y<a;)k[y]=g[y];return k[a]=u(M),vr(s,this,k)}}function S2(s,a){return a.length<2?s:vs(s,vn(a,0,-1))}function E$(s,a){for(var u=s.length,g=Ar(a.length,u),y=Vr(s);g--;){var S=a[g];s[g]=si(S,u)?y[S]:r}return s}function q0(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var D2=P2(Xm),Ra=US||function(s,a){return mt.setTimeout(s,a)},V0=P2(qD);function $2(s,a,u){var g=a+"";return V0(s,d$(g,x$(u$(g),u)))}function P2(s){var a=0,u=0;return function(){var g=kS(),y=me-(g-u);if(u=g,y>0){if(++a>=de)return arguments[0]}else a=0;return s.apply(r,arguments)}}function zl(s,a){var u=-1,g=s.length,y=g-1;for(a=a===r?g:a;++u<a;){var S=S0(u,y),M=s[S];s[S]=s[u],s[u]=M}return s.length=a,s}var T2=v$(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(sr,function(u,g,y,S){a.push(y?S.replace(Ff,"$1"):g||u)}),a});function Hn(s){if(typeof s=="string"||rn(s))return s;var a=s+"";return a=="0"&&1/s==-le?"-0":a}function bs(s){if(s!=null){try{return vl.call(s)}catch{}try{return s+""}catch{}}return""}function x$(s,a){return pn(Fe,function(u){var g="_."+u[0];a&u[1]&&!dl(s,g)&&s.push(g)}),s.sort()}function R2(s){if(s instanceof dt)return s.clone();var a=new mn(s.__wrapped__,s.__chain__);return a.__actions__=Vr(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function C$(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=dr(it(a),0);var g=s==null?0:s.length;if(!g||a<1)return[];for(var y=0,S=0,M=te(Il(g/a));y<g;)M[S++]=vn(s,y,y+=a);return M}function I$(s){for(var a=-1,u=s==null?0:s.length,g=0,y=[];++a<u;){var S=s[a];S&&(y[g++]=S)}return y}function O$(){var s=arguments.length;if(!s)return[];for(var a=te(s-1),u=arguments[0],g=s;g--;)a[g-1]=arguments[g];return Si(Qe(u)?Vr(u):[u],Cr(a,1))}var A$=ct(function(s,a){return Qt(s)?Aa(s,Cr(a,1,Qt,!0)):[]}),S$=ct(function(s,a){var u=yn(a);return Qt(u)&&(u=r),Qt(s)?Aa(s,Cr(a,1,Qt,!0),ze(u,2)):[]}),D$=ct(function(s,a){var u=yn(a);return Qt(u)&&(u=r),Qt(s)?Aa(s,Cr(a,1,Qt,!0),r,u):[]});function $$(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),vn(s,a<0?0:a,g)):[]}function P$(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,vn(s,0,a<0?0:a)):[]}function T$(s,a){return s&&s.length?Ll(s,ze(a,3),!0,!0):[]}function R$(s,a){return s&&s.length?Ll(s,ze(a,3),!0):[]}function N$(s,a,u,g){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&Br(s,a,u)&&(u=0,g=y),OD(s,a,u,g)):[]}function N2(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=u==null?0:it(u);return y<0&&(y=dr(g+y,0)),pl(s,ze(a,3),y)}function L2(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=g-1;return u!==r&&(y=it(u),y=u<0?dr(g+y,0):Ar(y,g-1)),pl(s,ze(a,3),y,!0)}function M2(s){var a=s==null?0:s.length;return a?Cr(s,1):[]}function L$(s){var a=s==null?0:s.length;return a?Cr(s,le):[]}function M$(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:it(a),Cr(s,a)):[]}function U$(s){for(var a=-1,u=s==null?0:s.length,g={};++a<u;){var y=s[a];g[y[0]]=y[1]}return g}function U2(s){return s&&s.length?s[0]:r}function j$(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=u==null?0:it(u);return y<0&&(y=dr(g+y,0)),so(s,a,y)}function F$(s){var a=s==null?0:s.length;return a?vn(s,0,-1):[]}var B$=ct(function(s){var a=Ut(s,R0);return a.length&&a[0]===s[0]?x0(a):[]}),k$=ct(function(s){var a=yn(s),u=Ut(s,R0);return a===yn(u)?a=r:u.pop(),u.length&&u[0]===s[0]?x0(u,ze(a,2)):[]}),H$=ct(function(s){var a=yn(s),u=Ut(s,R0);return a=typeof a=="function"?a:r,a&&u.pop(),u.length&&u[0]===s[0]?x0(u,r,a):[]});function z$(s,a){return s==null?"":FS.call(s,a)}function yn(s){var a=s==null?0:s.length;return a?s[a-1]:r}function W$(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=g;return u!==r&&(y=it(u),y=y<0?dr(g+y,0):Ar(y,g-1)),a===a?xS(s,a,y):pl(s,wm,y,!0)}function q$(s,a){return s&&s.length?Gm(s,it(a)):r}var V$=ct(j2);function j2(s,a){return s&&s.length&&a&&a.length?A0(s,a):s}function K$(s,a,u){return s&&s.length&&a&&a.length?A0(s,a,ze(u,2)):s}function G$(s,a,u){return s&&s.length&&a&&a.length?A0(s,a,r,u):s}var Z$=ii(function(s,a){var u=s==null?0:s.length,g=y0(s,a);return Jm(s,Ut(a,function(y){return si(y,u)?+y:y}).sort(a2)),g});function Y$(s,a){var u=[];if(!(s&&s.length))return u;var g=-1,y=[],S=s.length;for(a=ze(a,3);++g<S;){var M=s[g];a(M,g,s)&&(u.push(M),y.push(g))}return Jm(s,y),u}function K0(s){return s==null?s:zS.call(s)}function J$(s,a,u){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&Br(s,a,u)?(a=0,u=g):(a=a==null?0:it(a),u=u===r?g:it(u)),vn(s,a,u)):[]}function X$(s,a){return Nl(s,a)}function Q$(s,a,u){return $0(s,a,ze(u,2))}function eP(s,a){var u=s==null?0:s.length;if(u){var g=Nl(s,a);if(g<u&&An(s[g],a))return g}return-1}function tP(s,a){return Nl(s,a,!0)}function rP(s,a,u){return $0(s,a,ze(u,2),!0)}function nP(s,a){var u=s==null?0:s.length;if(u){var g=Nl(s,a,!0)-1;if(An(s[g],a))return g}return-1}function iP(s){return s&&s.length?Qm(s):[]}function sP(s,a){return s&&s.length?Qm(s,ze(a,2)):[]}function oP(s){var a=s==null?0:s.length;return a?vn(s,1,a):[]}function aP(s,a,u){return s&&s.length?(a=u||a===r?1:it(a),vn(s,0,a<0?0:a)):[]}function cP(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,vn(s,a<0?0:a,g)):[]}function lP(s,a){return s&&s.length?Ll(s,ze(a,3),!1,!0):[]}function uP(s,a){return s&&s.length?Ll(s,ze(a,3)):[]}var hP=ct(function(s){return Ti(Cr(s,1,Qt,!0))}),fP=ct(function(s){var a=yn(s);return Qt(a)&&(a=r),Ti(Cr(s,1,Qt,!0),ze(a,2))}),dP=ct(function(s){var a=yn(s);return a=typeof a=="function"?a:r,Ti(Cr(s,1,Qt,!0),r,a)});function pP(s){return s&&s.length?Ti(s):[]}function gP(s,a){return s&&s.length?Ti(s,ze(a,2)):[]}function mP(s,a){return a=typeof a=="function"?a:r,s&&s.length?Ti(s,r,a):[]}function G0(s){if(!(s&&s.length))return[];var a=0;return s=Ai(s,function(u){if(Qt(u))return a=dr(u.length,a),!0}),h0(a,function(u){return Ut(s,c0(u))})}function F2(s,a){if(!(s&&s.length))return[];var u=G0(s);return a==null?u:Ut(u,function(g){return vr(a,r,g)})}var wP=ct(function(s,a){return Qt(s)?Aa(s,a):[]}),vP=ct(function(s){return T0(Ai(s,Qt))}),yP=ct(function(s){var a=yn(s);return Qt(a)&&(a=r),T0(Ai(s,Qt),ze(a,2))}),bP=ct(function(s){var a=yn(s);return a=typeof a=="function"?a:r,T0(Ai(s,Qt),r,a)}),_P=ct(G0);function EP(s,a){return n2(s||[],a||[],Oa)}function xP(s,a){return n2(s||[],a||[],$a)}var CP=ct(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,F2(s,u)});function B2(s){var a=C(s);return a.__chain__=!0,a}function IP(s,a){return a(s),s}function Wl(s,a){return a(s)}var OP=ii(function(s){var a=s.length,u=a?s[0]:0,g=this.__wrapped__,y=function(S){return y0(S,s)};return a>1||this.__actions__.length||!(g instanceof dt)||!si(u)?this.thru(y):(g=g.slice(u,+u+(a?1:0)),g.__actions__.push({func:Wl,args:[y],thisArg:r}),new mn(g,this.__chain__).thru(function(S){return a&&!S.length&&S.push(r),S}))});function AP(){return B2(this)}function SP(){return new mn(this.value(),this.__chain__)}function DP(){this.__values__===r&&(this.__values__=ew(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function $P(){return this}function PP(s){for(var a,u=this;u instanceof Dl;){var g=R2(u);g.__index__=0,g.__values__=r,a?y.__wrapped__=g:a=g;var y=g;u=u.__wrapped__}return y.__wrapped__=s,a}function TP(){var s=this.__wrapped__;if(s instanceof dt){var a=s;return this.__actions__.length&&(a=new dt(this)),a=a.reverse(),a.__actions__.push({func:Wl,args:[K0],thisArg:r}),new mn(a,this.__chain__)}return this.thru(K0)}function RP(){return r2(this.__wrapped__,this.__actions__)}var NP=Ml(function(s,a,u){bt.call(s,u)?++s[u]:ri(s,u,1)});function LP(s,a,u){var g=Qe(s)?gm:ID;return u&&Br(s,a,u)&&(a=r),g(s,ze(a,3))}function MP(s,a){var u=Qe(s)?Ai:Fm;return u(s,ze(a,3))}var UP=d2(N2),jP=d2(L2);function FP(s,a){return Cr(ql(s,a),1)}function BP(s,a){return Cr(ql(s,a),le)}function kP(s,a,u){return u=u===r?1:it(u),Cr(ql(s,a),u)}function k2(s,a){var u=Qe(s)?pn:Pi;return u(s,ze(a,3))}function H2(s,a){var u=Qe(s)?oS:jm;return u(s,ze(a,3))}var HP=Ml(function(s,a,u){bt.call(s,u)?s[u].push(a):ri(s,u,[a])});function zP(s,a,u,g){s=Kr(s)?s:vo(s),u=u&&!g?it(u):0;var y=s.length;return u<0&&(u=dr(y+u,0)),Yl(s)?u<=y&&s.indexOf(a,u)>-1:!!y&&so(s,a,u)>-1}var WP=ct(function(s,a,u){var g=-1,y=typeof a=="function",S=Kr(s)?te(s.length):[];return Pi(s,function(M){S[++g]=y?vr(a,M,u):Sa(M,a,u)}),S}),qP=Ml(function(s,a,u){ri(s,u,a)});function ql(s,a){var u=Qe(s)?Ut:qm;return u(s,ze(a,3))}function VP(s,a,u,g){return s==null?[]:(Qe(a)||(a=a==null?[]:[a]),u=g?r:u,Qe(u)||(u=u==null?[]:[u]),Zm(s,a,u))}var KP=Ml(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function GP(s,a,u){var g=Qe(s)?o0:ym,y=arguments.length<3;return g(s,ze(a,4),u,y,Pi)}function ZP(s,a,u){var g=Qe(s)?aS:ym,y=arguments.length<3;return g(s,ze(a,4),u,y,jm)}function YP(s,a){var u=Qe(s)?Ai:Fm;return u(s,Gl(ze(a,3)))}function JP(s){var a=Qe(s)?Nm:zD;return a(s)}function XP(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=it(a);var g=Qe(s)?bD:WD;return g(s,a)}function QP(s){var a=Qe(s)?_D:VD;return a(s)}function eT(s){if(s==null)return 0;if(Kr(s))return Yl(s)?ao(s):s.length;var a=Sr(s);return a==Me||a==He?s.size:I0(s).length}function tT(s,a,u){var g=Qe(s)?a0:KD;return u&&Br(s,a,u)&&(a=r),g(s,ze(a,3))}var rT=ct(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Br(s,a[0],a[1])?a=[]:u>2&&Br(a[0],a[1],a[2])&&(a=[a[0]]),Zm(s,Cr(a,1),[])}),Vl=MS||function(){return mt.Date.now()};function nT(s,a){if(typeof a!="function")throw new gn(c);return s=it(s),function(){if(--s<1)return a.apply(this,arguments)}}function z2(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,ni(s,f,r,r,r,r,a)}function W2(s,a){var u;if(typeof a!="function")throw new gn(c);return s=it(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=r),u}}var Z0=ct(function(s,a,u){var g=H;if(u.length){var y=Di(u,mo(Z0));g|=T}return ni(s,g,a,u,y)}),q2=ct(function(s,a,u){var g=H|G;if(u.length){var y=Di(u,mo(q2));g|=T}return ni(a,g,s,u,y)});function V2(s,a,u){a=u?r:a;var g=ni(s,L,r,r,r,r,r,a);return g.placeholder=V2.placeholder,g}function K2(s,a,u){a=u?r:a;var g=ni(s,$,r,r,r,r,r,a);return g.placeholder=K2.placeholder,g}function G2(s,a,u){var g,y,S,M,k,Z,ue=0,he=!1,pe=!1,be=!0;if(typeof s!="function")throw new gn(c);a=bn(a)||0,Bt(u)&&(he=!!u.leading,pe="maxWait"in u,S=pe?dr(bn(u.maxWait)||0,a):S,be="trailing"in u?!!u.trailing:be);function Pe(er){var Sn=g,ci=y;return g=y=r,ue=er,M=s.apply(ci,Sn),M}function We(er){return ue=er,k=Ra(ft,a),he?Pe(er):M}function ot(er){var Sn=er-Z,ci=er-ue,dw=a-Sn;return pe?Ar(dw,S-ci):dw}function qe(er){var Sn=er-Z,ci=er-ue;return Z===r||Sn>=a||Sn<0||pe&&ci>=S}function ft(){var er=Vl();if(qe(er))return wt(er);k=Ra(ft,ot(er))}function wt(er){return k=r,be&&g?Pe(er):(g=y=r,M)}function nn(){k!==r&&i2(k),ue=0,g=Z=y=k=r}function kr(){return k===r?M:wt(Vl())}function sn(){var er=Vl(),Sn=qe(er);if(g=arguments,y=this,Z=er,Sn){if(k===r)return We(Z);if(pe)return i2(k),k=Ra(ft,a),Pe(Z)}return k===r&&(k=Ra(ft,a)),M}return sn.cancel=nn,sn.flush=kr,sn}var iT=ct(function(s,a){return Um(s,1,a)}),sT=ct(function(s,a,u){return Um(s,bn(a)||0,u)});function oT(s){return ni(s,J)}function Kl(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new gn(c);var u=function(){var g=arguments,y=a?a.apply(this,g):g[0],S=u.cache;if(S.has(y))return S.get(y);var M=s.apply(this,g);return u.cache=S.set(y,M)||S,M};return u.cache=new(Kl.Cache||ti),u}Kl.Cache=ti;function Gl(s){if(typeof s!="function")throw new gn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function aT(s){return W2(2,s)}var cT=GD(function(s,a){a=a.length==1&&Qe(a[0])?Ut(a[0],en(ze())):Ut(Cr(a,1),en(ze()));var u=a.length;return ct(function(g){for(var y=-1,S=Ar(g.length,u);++y<S;)g[y]=a[y].call(this,g[y]);return vr(s,this,g)})}),Y0=ct(function(s,a){var u=Di(a,mo(Y0));return ni(s,T,r,a,u)}),Z2=ct(function(s,a){var u=Di(a,mo(Z2));return ni(s,I,r,a,u)}),lT=ii(function(s,a){return ni(s,x,r,r,r,a)});function uT(s,a){if(typeof s!="function")throw new gn(c);return a=a===r?a:it(a),ct(s,a)}function hT(s,a){if(typeof s!="function")throw new gn(c);return a=a==null?0:dr(it(a),0),ct(function(u){var g=u[a],y=Ni(u,0,a);return g&&Si(y,g),vr(s,this,y)})}function fT(s,a,u){var g=!0,y=!0;if(typeof s!="function")throw new gn(c);return Bt(u)&&(g="leading"in u?!!u.leading:g,y="trailing"in u?!!u.trailing:y),G2(s,a,{leading:g,maxWait:a,trailing:y})}function dT(s){return z2(s,1)}function pT(s,a){return Y0(N0(a),s)}function gT(){if(!arguments.length)return[];var s=arguments[0];return Qe(s)?s:[s]}function mT(s){return wn(s,A)}function wT(s,a){return a=typeof a=="function"?a:r,wn(s,A,a)}function vT(s){return wn(s,E|A)}function yT(s,a){return a=typeof a=="function"?a:r,wn(s,E|A,a)}function bT(s,a){return a==null||Mm(s,a,yr(a))}function An(s,a){return s===a||s!==s&&a!==a}var _T=Bl(E0),ET=Bl(function(s,a){return s>=a}),_s=Hm(function(){return arguments}())?Hm:function(s){return Gt(s)&&bt.call(s,"callee")&&!Sm.call(s,"callee")},Qe=te.isArray,xT=jr?en(jr):PD;function Kr(s){return s!=null&&Zl(s.length)&&!oi(s)}function Qt(s){return Gt(s)&&Kr(s)}function CT(s){return s===!0||s===!1||Gt(s)&&Fr(s)==Y}var Li=jS||ad,IT=Cn?en(Cn):TD;function OT(s){return Gt(s)&&s.nodeType===1&&!Na(s)}function AT(s){if(s==null)return!0;if(Kr(s)&&(Qe(s)||typeof s=="string"||typeof s.splice=="function"||Li(s)||wo(s)||_s(s)))return!s.length;var a=Sr(s);if(a==Me||a==He)return!s.size;if(Ta(s))return!I0(s).length;for(var u in s)if(bt.call(s,u))return!1;return!0}function ST(s,a){return Da(s,a)}function DT(s,a,u){u=typeof u=="function"?u:r;var g=u?u(s,a):r;return g===r?Da(s,a,r,u):!!g}function J0(s){if(!Gt(s))return!1;var a=Fr(s);return a==F||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!Na(s)}function $T(s){return typeof s=="number"&&$m(s)}function oi(s){if(!Bt(s))return!1;var a=Fr(s);return a==we||a==ve||a==X||a==$t}function Y2(s){return typeof s=="number"&&s==it(s)}function Zl(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=re}function Bt(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function Gt(s){return s!=null&&typeof s=="object"}var J2=dn?en(dn):ND;function PT(s,a){return s===a||C0(s,a,k0(a))}function TT(s,a,u){return u=typeof u=="function"?u:r,C0(s,a,k0(a),u)}function RT(s){return X2(s)&&s!=+s}function NT(s){if(w$(s))throw new Ye(o);return zm(s)}function LT(s){return s===null}function MT(s){return s==null}function X2(s){return typeof s=="number"||Gt(s)&&Fr(s)==nt}function Na(s){if(!Gt(s)||Fr(s)!=Ge)return!1;var a=El(s);if(a===null)return!0;var u=bt.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&vl.call(u)==TS}var X0=Fn?en(Fn):LD;function UT(s){return Y2(s)&&s>=-re&&s<=re}var Q2=ya?en(ya):MD;function Yl(s){return typeof s=="string"||!Qe(s)&&Gt(s)&&Fr(s)==Be}function rn(s){return typeof s=="symbol"||Gt(s)&&Fr(s)==Ke}var wo=ds?en(ds):UD;function jT(s){return s===r}function FT(s){return Gt(s)&&Sr(s)==Ue}function BT(s){return Gt(s)&&Fr(s)==Ze}var kT=Bl(O0),HT=Bl(function(s,a){return s<=a});function ew(s){if(!s)return[];if(Kr(s))return Yl(s)?In(s):Vr(s);if(_a&&s[_a])return bS(s[_a]());var a=Sr(s),u=a==Me?d0:a==He?gl:vo;return u(s)}function ai(s){if(!s)return s===0?s:0;if(s=bn(s),s===le||s===-le){var a=s<0?-1:1;return a*ne}return s===s?s:0}function it(s){var a=ai(s),u=a%1;return a===a?u?a-u:a:0}function tw(s){return s?ws(it(s),0,ie):0}function bn(s){if(typeof s=="number")return s;if(rn(s))return ae;if(Bt(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=Bt(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=bm(s);var u=Hf.test(s);return u||Wf.test(s)?Xe(s.slice(2),u?2:8):kf.test(s)?ae:+s}function rw(s){return kn(s,Gr(s))}function zT(s){return s?ws(it(s),-re,re):s===0?s:0}function yt(s){return s==null?"":tn(s)}var WT=po(function(s,a){if(Ta(a)||Kr(a)){kn(a,yr(a),s);return}for(var u in a)bt.call(a,u)&&Oa(s,u,a[u])}),nw=po(function(s,a){kn(a,Gr(a),s)}),Jl=po(function(s,a,u,g){kn(a,Gr(a),s,g)}),qT=po(function(s,a,u,g){kn(a,yr(a),s,g)}),VT=ii(y0);function KT(s,a){var u=fo(s);return a==null?u:Lm(u,a)}var GT=ct(function(s,a){s=At(s);var u=-1,g=a.length,y=g>2?a[2]:r;for(y&&Br(a[0],a[1],y)&&(g=1);++u<g;)for(var S=a[u],M=Gr(S),k=-1,Z=M.length;++k<Z;){var ue=M[k],he=s[ue];(he===r||An(he,lo[ue])&&!bt.call(s,ue))&&(s[ue]=S[ue])}return s}),ZT=ct(function(s){return s.push(r,b2),vr(iw,r,s)});function YT(s,a){return mm(s,ze(a,3),Bn)}function JT(s,a){return mm(s,ze(a,3),_0)}function XT(s,a){return s==null?s:b0(s,ze(a,3),Gr)}function QT(s,a){return s==null?s:Bm(s,ze(a,3),Gr)}function eR(s,a){return s&&Bn(s,ze(a,3))}function tR(s,a){return s&&_0(s,ze(a,3))}function rR(s){return s==null?[]:Tl(s,yr(s))}function nR(s){return s==null?[]:Tl(s,Gr(s))}function Q0(s,a,u){var g=s==null?r:vs(s,a);return g===r?u:g}function iR(s,a){return s!=null&&x2(s,a,AD)}function ed(s,a){return s!=null&&x2(s,a,SD)}var sR=g2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=yl.call(a)),s[a]=u},rd(Zr)),oR=g2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=yl.call(a)),bt.call(s,a)?s[a].push(u):s[a]=[u]},ze),aR=ct(Sa);function yr(s){return Kr(s)?Rm(s):I0(s)}function Gr(s){return Kr(s)?Rm(s,!0):jD(s)}function cR(s,a){var u={};return a=ze(a,3),Bn(s,function(g,y,S){ri(u,a(g,y,S),g)}),u}function lR(s,a){var u={};return a=ze(a,3),Bn(s,function(g,y,S){ri(u,y,a(g,y,S))}),u}var uR=po(function(s,a,u){Rl(s,a,u)}),iw=po(function(s,a,u,g){Rl(s,a,u,g)}),hR=ii(function(s,a){var u={};if(s==null)return u;var g=!1;a=Ut(a,function(S){return S=Ri(S,s),g||(g=S.length>1),S}),kn(s,F0(s),u),g&&(u=wn(u,E|_|A,s$));for(var y=a.length;y--;)P0(u,a[y]);return u});function fR(s,a){return sw(s,Gl(ze(a)))}var dR=ii(function(s,a){return s==null?{}:BD(s,a)});function sw(s,a){if(s==null)return{};var u=Ut(F0(s),function(g){return[g]});return a=ze(a),Ym(s,u,function(g,y){return a(g,y[0])})}function pR(s,a,u){a=Ri(a,s);var g=-1,y=a.length;for(y||(y=1,s=r);++g<y;){var S=s==null?r:s[Hn(a[g])];S===r&&(g=y,S=u),s=oi(S)?S.call(s):S}return s}function gR(s,a,u){return s==null?s:$a(s,a,u)}function mR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:$a(s,a,u,g)}var ow=v2(yr),aw=v2(Gr);function wR(s,a,u){var g=Qe(s),y=g||Li(s)||wo(s);if(a=ze(a,4),u==null){var S=s&&s.constructor;y?u=g?new S:[]:Bt(s)?u=oi(S)?fo(El(s)):{}:u={}}return(y?pn:Bn)(s,function(M,k,Z){return a(u,M,k,Z)}),u}function vR(s,a){return s==null?!0:P0(s,a)}function yR(s,a,u){return s==null?s:t2(s,a,N0(u))}function bR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:t2(s,a,N0(u),g)}function vo(s){return s==null?[]:f0(s,yr(s))}function _R(s){return s==null?[]:f0(s,Gr(s))}function ER(s,a,u){return u===r&&(u=a,a=r),u!==r&&(u=bn(u),u=u===u?u:0),a!==r&&(a=bn(a),a=a===a?a:0),ws(bn(s),a,u)}function xR(s,a,u){return a=ai(a),u===r?(u=a,a=0):u=ai(u),s=bn(s),DD(s,a,u)}function CR(s,a,u){if(u&&typeof u!="boolean"&&Br(s,a,u)&&(a=u=r),u===r&&(typeof a=="boolean"?(u=a,a=r):typeof s=="boolean"&&(u=s,s=r)),s===r&&a===r?(s=0,a=1):(s=ai(s),a===r?(a=s,s=0):a=ai(a)),s>a){var g=s;s=a,a=g}if(u||s%1||a%1){var y=Pm();return Ar(s+y*(a-s+It("1e-"+((y+"").length-1))),a)}return S0(s,a)}var IR=go(function(s,a,u){return a=a.toLowerCase(),s+(u?cw(a):a)});function cw(s){return td(yt(s).toLowerCase())}function lw(s){return s=yt(s),s&&s.replace(Xn,gS).replace(n0,"")}function OR(s,a,u){s=yt(s),a=tn(a);var g=s.length;u=u===r?g:ws(it(u),0,g);var y=u;return u-=a.length,u>=0&&s.slice(u,y)==a}function AR(s){return s=yt(s),s&&Lt.test(s)?s.replace(cs,mS):s}function SR(s){return s=yt(s),s&&or.test(s)?s.replace(qt,"\\$&"):s}var DR=go(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),$R=go(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),PR=f2("toLowerCase");function TR(s,a,u){s=yt(s),a=it(a);var g=a?ao(s):0;if(!a||g>=a)return s;var y=(a-g)/2;return Fl(Ol(y),u)+s+Fl(Il(y),u)}function RR(s,a,u){s=yt(s),a=it(a);var g=a?ao(s):0;return a&&g<a?s+Fl(a-g,u):s}function NR(s,a,u){s=yt(s),a=it(a);var g=a?ao(s):0;return a&&g<a?Fl(a-g,u)+s:s}function LR(s,a,u){return u||a==null?a=0:a&&(a=+a),HS(yt(s).replace(Vt,""),a||0)}function MR(s,a,u){return(u?Br(s,a,u):a===r)?a=1:a=it(a),D0(yt(s),a)}function UR(){var s=arguments,a=yt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var jR=go(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function FR(s,a,u){return u&&typeof u!="number"&&Br(s,a,u)&&(a=u=r),u=u===r?ie:u>>>0,u?(s=yt(s),s&&(typeof a=="string"||a!=null&&!X0(a))&&(a=tn(a),!a&&oo(s))?Ni(In(s),0,u):s.split(a,u)):[]}var BR=go(function(s,a,u){return s+(u?" ":"")+td(a)});function kR(s,a,u){return s=yt(s),u=u==null?0:ws(it(u),0,s.length),a=tn(a),s.slice(u,u+a.length)==a}function HR(s,a,u){var g=C.templateSettings;u&&Br(s,a,u)&&(a=r),s=yt(s),a=Jl({},a,g,y2);var y=Jl({},a.imports,g.imports,y2),S=yr(y),M=f0(y,S),k,Z,ue=0,he=a.interpolate||Xs,pe="__p += '",be=p0((a.escape||Xs).source+"|"+he.source+"|"+(he===Ft?Bf:Xs).source+"|"+(a.evaluate||Xs).source+"|$","g"),Pe="//# sourceURL="+(bt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++i0+"]")+`
|
|
82
|
+
`;s.replace(be,function(qe,ft,wt,nn,kr,sn){return wt||(wt=nn),pe+=s.slice(ue,sn).replace(Vf,wS),ft&&(k=!0,pe+=`' +
|
|
83
83
|
__e(`+ft+`) +
|
|
84
84
|
'`),kr&&(Z=!0,pe+=`';
|
|
85
85
|
`+kr+`;
|
|
@@ -89,36 +89,36 @@ __p += '`),wt&&(pe+=`' +
|
|
|
89
89
|
`;var We=bt.call(a,"variable")&&a.variable;if(!We)pe=`with (obj) {
|
|
90
90
|
`+pe+`
|
|
91
91
|
}
|
|
92
|
-
`;else if(
|
|
92
|
+
`;else if(jf.test(We))throw new Ye(l);pe=(Z?pe.replace(lt,""):pe).replace(Ur,"$1").replace(Jn,"$1;"),pe="function("+(We||"obj")+`) {
|
|
93
93
|
`+(We?"":`obj || (obj = {});
|
|
94
94
|
`)+"var __t, __p = ''"+(k?", __e = _.escape":"")+(Z?`, __j = Array.prototype.join;
|
|
95
95
|
function print() { __p += __j.call(arguments, '') }
|
|
96
96
|
`:`;
|
|
97
97
|
`)+pe+`return __p
|
|
98
|
-
}`;var ot=fw(function(){return vt(S,Pe+"return "+pe).apply(r,M)});if(ot.source=pe,X0(ot))throw ot;return ot}function WR(s){return yt(s).toLowerCase()}function qR(s){return yt(s).toUpperCase()}function VR(s,a,u){if(s=yt(s),s&&(u||a===r))return _m(s);if(!s||!(a=tn(a)))return s;var g=In(s),y=In(a),S=Em(g,y),M=xm(g,y)+1;return Ni(g,S,M).join("")}function KR(s,a,u){if(s=yt(s),s&&(u||a===r))return s.slice(0,Im(s)+1);if(!s||!(a=tn(a)))return s;var g=In(s),y=xm(g,In(a))+1;return Ni(g,0,y).join("")}function GR(s,a,u){if(s=yt(s),s&&(u||a===r))return s.replace(Vt,"");if(!s||!(a=tn(a)))return s;var g=In(s),y=Em(g,In(a));return Ni(g,y).join("")}function ZR(s,a){var u=z,g=ee;if(Bt(a)){var y="separator"in a?a.separator:y;u="length"in a?it(a.length):u,g="omission"in a?tn(a.omission):g}s=yt(s);var S=s.length;if(ao(s)){var M=In(s);S=M.length}if(u>=S)return s;var k=u-co(g);if(k<1)return g;var Z=M?Ni(M,0,k).join(""):s.slice(0,k);if(y===r)return Z+g;if(M&&(k+=Z.length-k),Q0(y)){if(s.slice(k).search(y)){var ue,he=Z;for(y.global||(y=g0(y.source,yt(fn.exec(y))+"g")),y.lastIndex=0;ue=y.exec(he);)var pe=ue.index;Z=Z.slice(0,pe===r?k:pe)}}else if(s.indexOf(tn(y),k)!=k){var be=Z.lastIndexOf(y);be>-1&&(Z=Z.slice(0,be))}return Z+g}function YR(s){return s=yt(s),s&&Ht.test(s)?s.replace(Ii,IS):s}var JR=mo(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),rd=d2("toUpperCase");function hw(s,a,u){return s=yt(s),a=u?r:a,a===r?bS(s)?SS(s):hS(s):s.match(a)||[]}var fw=ct(function(s,a){try{return vr(s,r,a)}catch(u){return X0(u)?u:new Ye(u)}}),XR=ii(function(s,a){return pn(a,function(u){u=Hn(u),ri(s,u,Y0(s[u],s))}),s});function QR(s){var a=s==null?0:s.length,u=ze();return s=a?Ut(s,function(g){if(typeof g[1]!="function")throw new gn(c);return[u(g[0]),g[1]]}):[],ct(function(g){for(var y=-1;++y<a;){var S=s[y];if(vr(S[0],this,g))return vr(S[1],this,g)}})}function eN(s){return ID(wn(s,E))}function nd(s){return function(){return s}}function tN(s,a){return s==null||s!==s?a:s}var rN=g2(),nN=g2(!0);function Zr(s){return s}function id(s){return qm(typeof s=="function"?s:wn(s,E))}function iN(s){return Km(wn(s,E))}function sN(s,a){return Gm(s,wn(a,E))}var oN=ct(function(s,a){return function(u){return Da(u,s,a)}}),aN=ct(function(s,a){return function(u){return Da(s,u,a)}});function sd(s,a,u){var g=yr(a),y=Rl(a,g);u==null&&!(Bt(a)&&(y.length||!g.length))&&(u=a,a=s,s=this,y=Rl(a,yr(a)));var S=!(Bt(u)&&"chain"in u)||!!u.chain,M=oi(s);return pn(y,function(k){var Z=a[k];s[k]=Z,M&&(s.prototype[k]=function(){var ue=this.__chain__;if(S||ue){var he=s(this.__wrapped__),pe=he.__actions__=Vr(this.__actions__);return pe.push({func:Z,args:arguments,thisArg:s}),he.__chain__=ue,he}return Z.apply(s,Si([this.value()],arguments))})}),s}function cN(){return mt._===this&&(mt._=NS),this}function od(){}function lN(s){return s=it(s),ct(function(a){return Zm(a,s)})}var uN=U0(Ut),hN=U0(mm),fN=U0(c0);function dw(s){return W0(s)?l0(Hn(s)):HD(s)}function dN(s){return function(a){return s==null?r:ys(s,a)}}var pN=w2(),gN=w2(!0);function ad(){return[]}function cd(){return!1}function mN(){return{}}function wN(){return""}function vN(){return!0}function yN(s,a){if(s=it(s),s<1||s>re)return[];var u=ie,g=Ar(s,ie);a=ze(a),s-=ie;for(var y=f0(g,a);++u<s;)a(u);return y}function bN(s){return Qe(s)?Ut(s,Hn):rn(s)?[s]:Vr(R2(yt(s)))}function _N(s){var a=++TS;return yt(s)+a}var EN=Fl(function(s,a){return s+a},0),xN=j0("ceil"),CN=Fl(function(s,a){return s/a},1),IN=j0("floor");function ON(s){return s&&s.length?Tl(s,Zr,x0):r}function AN(s,a){return s&&s.length?Tl(s,ze(a,2),x0):r}function SN(s){return ym(s,Zr)}function DN(s,a){return ym(s,ze(a,2))}function $N(s){return s&&s.length?Tl(s,Zr,A0):r}function PN(s,a){return s&&s.length?Tl(s,ze(a,2),A0):r}var TN=Fl(function(s,a){return s*a},1),RN=j0("round"),NN=Fl(function(s,a){return s-a},0);function LN(s){return s&&s.length?h0(s,Zr):0}function MN(s,a){return s&&s.length?h0(s,ze(a,2)):0}return C.after=iT,C.ary=W2,C.assign=qT,C.assignIn=iw,C.assignInWith=Xl,C.assignWith=VT,C.at=KT,C.before=q2,C.bind=Y0,C.bindAll=XR,C.bindKey=V2,C.castArray=mT,C.chain=k2,C.chunk=I$,C.compact=O$,C.concat=A$,C.cond=QR,C.conforms=eN,C.constant=nd,C.countBy=LP,C.create=GT,C.curry=K2,C.curryRight=G2,C.debounce=Z2,C.defaults=ZT,C.defaultsDeep=YT,C.defer=sT,C.delay=oT,C.difference=S$,C.differenceBy=D$,C.differenceWith=$$,C.drop=P$,C.dropRight=T$,C.dropRightWhile=R$,C.dropWhile=N$,C.fill=L$,C.filter=UP,C.flatMap=BP,C.flatMapDeep=kP,C.flatMapDepth=HP,C.flatten=U2,C.flattenDeep=M$,C.flattenDepth=U$,C.flip=aT,C.flow=rN,C.flowRight=nN,C.fromPairs=j$,C.functions=nR,C.functionsIn=iR,C.groupBy=zP,C.initial=B$,C.intersection=k$,C.intersectionBy=H$,C.intersectionWith=z$,C.invert=oR,C.invertBy=aR,C.invokeMap=qP,C.iteratee=id,C.keyBy=VP,C.keys=yr,C.keysIn=Gr,C.map=Vl,C.mapKeys=lR,C.mapValues=uR,C.matches=iN,C.matchesProperty=sN,C.memoize=Gl,C.merge=hR,C.mergeWith=sw,C.method=oN,C.methodOf=aN,C.mixin=sd,C.negate=Zl,C.nthArg=lN,C.omit=fR,C.omitBy=dR,C.once=cT,C.orderBy=KP,C.over=uN,C.overArgs=lT,C.overEvery=hN,C.overSome=fN,C.partial=J0,C.partialRight=Y2,C.partition=GP,C.pick=pR,C.pickBy=ow,C.property=dw,C.propertyOf=dN,C.pull=K$,C.pullAll=F2,C.pullAllBy=G$,C.pullAllWith=Z$,C.pullAt=Y$,C.range=pN,C.rangeRight=gN,C.rearg=uT,C.reject=JP,C.remove=J$,C.rest=hT,C.reverse=G0,C.sampleSize=QP,C.set=mR,C.setWith=wR,C.shuffle=eT,C.slice=X$,C.sortBy=nT,C.sortedUniq=sP,C.sortedUniqBy=oP,C.split=BR,C.spread=fT,C.tail=aP,C.take=cP,C.takeRight=lP,C.takeRightWhile=uP,C.takeWhile=hP,C.tap=OP,C.throttle=dT,C.thru=ql,C.toArray=tw,C.toPairs=aw,C.toPairsIn=cw,C.toPath=bN,C.toPlainObject=nw,C.transform=vR,C.unary=pT,C.union=fP,C.unionBy=dP,C.unionWith=pP,C.uniq=gP,C.uniqBy=mP,C.uniqWith=wP,C.unset=yR,C.unzip=Z0,C.unzipWith=B2,C.update=bR,C.updateWith=_R,C.values=yo,C.valuesIn=ER,C.without=vP,C.words=hw,C.wrap=gT,C.xor=yP,C.xorBy=bP,C.xorWith=_P,C.zip=EP,C.zipObject=xP,C.zipObjectDeep=CP,C.zipWith=IP,C.entries=aw,C.entriesIn=cw,C.extend=iw,C.extendWith=Xl,sd(C,C),C.add=EN,C.attempt=fw,C.camelCase=OR,C.capitalize=lw,C.ceil=xN,C.clamp=xR,C.clone=wT,C.cloneDeep=yT,C.cloneDeepWith=bT,C.cloneWith=vT,C.conformsTo=_T,C.deburr=uw,C.defaultTo=tN,C.divide=CN,C.endsWith=AR,C.eq=An,C.escape=SR,C.escapeRegExp=DR,C.every=MP,C.find=jP,C.findIndex=L2,C.findKey=JT,C.findLast=FP,C.findLastIndex=M2,C.findLastKey=XT,C.floor=IN,C.forEach=H2,C.forEachRight=z2,C.forIn=QT,C.forInRight=eR,C.forOwn=tR,C.forOwnRight=rR,C.get=ed,C.gt=ET,C.gte=xT,C.has=sR,C.hasIn=td,C.head=j2,C.identity=Zr,C.includes=WP,C.indexOf=F$,C.inRange=CR,C.invoke=cR,C.isArguments=Es,C.isArray=Qe,C.isArrayBuffer=CT,C.isArrayLike=Kr,C.isArrayLikeObject=Qt,C.isBoolean=IT,C.isBuffer=Li,C.isDate=OT,C.isElement=AT,C.isEmpty=ST,C.isEqual=DT,C.isEqualWith=$T,C.isError=X0,C.isFinite=PT,C.isFunction=oi,C.isInteger=J2,C.isLength=Yl,C.isMap=X2,C.isMatch=TT,C.isMatchWith=RT,C.isNaN=NT,C.isNative=LT,C.isNil=UT,C.isNull=MT,C.isNumber=Q2,C.isObject=Bt,C.isObjectLike=Gt,C.isPlainObject=La,C.isRegExp=Q0,C.isSafeInteger=jT,C.isSet=ew,C.isString=Jl,C.isSymbol=rn,C.isTypedArray=vo,C.isUndefined=FT,C.isWeakMap=BT,C.isWeakSet=kT,C.join=W$,C.kebabCase=$R,C.last=yn,C.lastIndexOf=q$,C.lowerCase=PR,C.lowerFirst=TR,C.lt=HT,C.lte=zT,C.max=ON,C.maxBy=AN,C.mean=SN,C.meanBy=DN,C.min=$N,C.minBy=PN,C.stubArray=ad,C.stubFalse=cd,C.stubObject=mN,C.stubString=wN,C.stubTrue=vN,C.multiply=TN,C.nth=V$,C.noConflict=cN,C.noop=od,C.now=Kl,C.pad=RR,C.padEnd=NR,C.padStart=LR,C.parseInt=MR,C.random=IR,C.reduce=ZP,C.reduceRight=YP,C.repeat=UR,C.replace=jR,C.result=gR,C.round=RN,C.runInContext=V,C.sample=XP,C.size=tT,C.snakeCase=FR,C.some=rT,C.sortedIndex=Q$,C.sortedIndexBy=eP,C.sortedIndexOf=tP,C.sortedLastIndex=rP,C.sortedLastIndexBy=nP,C.sortedLastIndexOf=iP,C.startCase=kR,C.startsWith=HR,C.subtract=NN,C.sum=LN,C.sumBy=MN,C.template=zR,C.times=yN,C.toFinite=ai,C.toInteger=it,C.toLength=rw,C.toLower=WR,C.toNumber=bn,C.toSafeInteger=WT,C.toString=yt,C.toUpper=qR,C.trim=VR,C.trimEnd=KR,C.trimStart=GR,C.truncate=ZR,C.unescape=YR,C.uniqueId=_N,C.upperCase=JR,C.upperFirst=rd,C.each=H2,C.eachRight=z2,C.first=j2,sd(C,function(){var s={};return Bn(C,function(a,u){bt.call(C.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),C.VERSION=n,pn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){C[s].placeholder=C}),pn(["drop","take"],function(s,a){dt.prototype[s]=function(u){u=u===r?1:dr(it(u),0);var g=this.__filtered__&&!a?new dt(this):this.clone();return g.__filtered__?g.__takeCount__=Ar(u,g.__takeCount__):g.__views__.push({size:Ar(u,ie),type:s+(g.__dir__<0?"Right":"")}),g},dt.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),pn(["filter","map","takeWhile"],function(s,a){var u=a+1,g=u==O||u==ce;dt.prototype[s]=function(y){var S=this.clone();return S.__iteratees__.push({iteratee:ze(y,3),type:u}),S.__filtered__=S.__filtered__||g,S}}),pn(["head","last"],function(s,a){var u="take"+(a?"Right":"");dt.prototype[s]=function(){return this[u](1).value()[0]}}),pn(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");dt.prototype[s]=function(){return this.__filtered__?new dt(this):this[u](1)}}),dt.prototype.compact=function(){return this.filter(Zr)},dt.prototype.find=function(s){return this.filter(s).head()},dt.prototype.findLast=function(s){return this.reverse().find(s)},dt.prototype.invokeMap=ct(function(s,a){return typeof s=="function"?new dt(this):this.map(function(u){return Da(u,s,a)})}),dt.prototype.reject=function(s){return this.filter(Zl(ze(s)))},dt.prototype.slice=function(s,a){s=it(s);var u=this;return u.__filtered__&&(s>0||a<0)?new dt(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==r&&(a=it(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},dt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},dt.prototype.toArray=function(){return this.take(ie)},Bn(dt.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),y=C[g?"take"+(a=="last"?"Right":""):a],S=g||/^find/.test(a);y&&(C.prototype[a]=function(){var M=this.__wrapped__,k=g?[1]:arguments,Z=M instanceof dt,ue=k[0],he=Z||Qe(M),pe=function(ft){var wt=y.apply(C,Si([ft],k));return g&&be?wt[0]:wt};he&&u&&typeof ue=="function"&&ue.length!=1&&(Z=he=!1);var be=this.__chain__,Pe=!!this.__actions__.length,We=S&&!be,ot=Z&&!Pe;if(!S&&he){M=ot?M:new dt(this);var qe=s.apply(M,k);return qe.__actions__.push({func:ql,args:[pe],thisArg:r}),new mn(qe,be)}return We&&ot?s.apply(this,k):(qe=this.thru(pe),We?g?qe.value()[0]:qe.value():qe)})}),pn(["pop","push","shift","sort","splice","unshift"],function(s){var a=wl[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",g=/^(?:pop|shift)$/.test(s);C.prototype[s]=function(){var y=arguments;if(g&&!this.__chain__){var S=this.value();return a.apply(Qe(S)?S:[],y)}return this[u](function(M){return a.apply(Qe(M)?M:[],y)})}}),Bn(dt.prototype,function(s,a){var u=C[a];if(u){var g=u.name+"";bt.call(fo,g)||(fo[g]=[]),fo[g].push({name:a,func:u})}}),fo[jl(r,G).name]=[{name:"wrapper",func:r}],dt.prototype.clone=YS,dt.prototype.reverse=JS,dt.prototype.value=XS,C.prototype.at=AP,C.prototype.chain=SP,C.prototype.commit=DP,C.prototype.next=$P,C.prototype.plant=TP,C.prototype.reverse=RP,C.prototype.toJSON=C.prototype.valueOf=C.prototype.value=NP,C.prototype.first=C.prototype.head,Ea&&(C.prototype[Ea]=PP),C},lo=DS();Xt?((Xt.exports=lo)._=lo,Ot._=lo):mt._=lo}).call(qo)})(gh,gh.exports);var y7=Object.defineProperty,b7=Object.defineProperties,_7=Object.getOwnPropertyDescriptors,xg=Object.getOwnPropertySymbols,E7=Object.prototype.hasOwnProperty,x7=Object.prototype.propertyIsEnumerable,Cg=(t,e,r)=>e in t?y7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ac=(t,e)=>{for(var r in e||(e={}))E7.call(e,r)&&Cg(t,r,e[r]);if(xg)for(var r of xg(e))x7.call(e,r)&&Cg(t,r,e[r]);return t},C7=(t,e)=>b7(t,_7(e));function cn(t,e,r){let n;const i=mh(t);return e.rpcMap&&(n=e.rpcMap[i]),n||(n=`${v7}?chainId=eip155:${i}&projectId=${r}`),n}function mh(t){return t.includes("eip155")?Number(t.split(":")[1]):Number(t)}function I7(t,e){if(!e.includes(t))throw new Error(`Chain '${t}' not approved. Please use one of the following: ${e.toString()}`)}function O7(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function A7(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const o=e.namespaces[i].accounts;n.push(...o)}),n}function S7(t,e={}){const r=Ig(t),n=Ig(e);return gh.exports.merge(r,n)}function Ig(t){var e,r,n,i;const o={};if(!$s(t))return o;for(const[c,l]of Object.entries(t)){const h=M1(c)?[c]:l.chains,d=l.methods||[],v=l.events||[],E=l.rpcMap||{},_=Ya(c);o[_]=C7(ac(ac({},o[_]),l),{chains:Du(h,(e=o[_])==null?void 0:e.chains),methods:Du(d,(r=o[_])==null?void 0:r.methods),events:Du(v,(n=o[_])==null?void 0:n.events),rpcMap:ac(ac({},E),(i=o[_])==null?void 0:i.rpcMap)})}return o}const Ki=(t,e)=>{const r=n=>{n.request!==e.request||n.topic!==e.topic||(t.events.removeListener("session_request_sent",r),D7(e,t.core.storage))};t.on("session_request_sent",r)};async function D7(t,e){try{const r=await e.getItem("WALLETCONNECT_DEEPLINK_CHOICE");if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n?.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const o=`${i}/wc?requestId=${t.id}&sessionTopic=${t.topic}`,c=D1();c===ki.browser?window.open(o,"_self","noreferrer noopener"):c===ki.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(r){console.error(r)}}const Og={},Yt=t=>Og[t],wh=(t,e)=>{Og[t]=e};class $7{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?(Ki(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||cn(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(di.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=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}class P7{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("client"),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)?(Ki(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=mh(e);if(!this.httpProviders[n]){const i=r||cn(`${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(di.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||cn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=mh(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}handleSwitchChain(e){const r=parseInt(e,16),n=`${this.name}:${r}`;I7(n,this.namespace.chains),this.setDefaultChain(`${r}`)}}class T7{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?(Ki(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||cn(`${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(di.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}class R7{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?(Ki(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||cn(`${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(di.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}class N7{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?(Ki(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(di.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r);e[r]=this.createHttpProvider(r,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}class L7{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?(Ki(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||cn(`${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(di.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}class M7{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?(Ki(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||cn(`${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(di.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}var U7=Object.defineProperty,j7=Object.defineProperties,F7=Object.getOwnPropertyDescriptors,Ag=Object.getOwnPropertySymbols,B7=Object.prototype.hasOwnProperty,k7=Object.prototype.propertyIsEnumerable,Sg=(t,e,r)=>e in t?U7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cc=(t,e)=>{for(var r in e||(e={}))B7.call(e,r)&&Sg(t,r,e[r]);if(Ag)for(var r of Ag(e))k7.call(e,r)&&Sg(t,r,e[r]);return t},vh=(t,e)=>j7(t,F7(e));class yh{constructor(e){this.events=new br.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||_g})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new yh(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:cc({},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:Zt("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(o=>{this.session=o}).catch(o=>{if(o.message!==gg)throw o;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(zn(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 dh.init({logger:this.providerOpts.logger||_g,relayUrl:this.providerOpts.relayUrl||g7,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>Ya(r)))];wh("client",this.client),wh("events",this.events),wh("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=A7(r,this.session),i=O7(n),o=S7(this.namespaces,this.optionalNamespaces),c=vh(cc({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new P7({namespace:c});break;case"solana":this.rpcProviders[r]=new T7({namespace:c});break;case"cosmos":this.rpcProviders[r]=new R7({namespace:c});break;case"polkadot":this.rpcProviders[r]=new $7({namespace:c});break;case"cip34":this.rpcProviders[r]=new N7({namespace:c});break;case"elrond":this.rpcProviders[r]=new L7({namespace:c});break;case"multiversx":this.rpcProviders[r]=new M7({namespace:c});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,o=(n=this.client)==null?void 0:n.session.get(e);this.session=vh(cc({},o),{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",vh(cc({},Zt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(di.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).map(c=>Ya(c)).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=Ya(Object.keys(this.namespaces)[0]),o=this.rpcProviders[i].getDefaultChain();return[i,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){var n;const[i,o]=this.validateChain(e);r||this.getProvider(i).setDefaultChain(o),((n=this.namespaces[i])!=null?n:this.namespaces[`${i}:${o}`]).defaultChain=o,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",o)}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(`${Eg}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${Eg}/${e}`)}}const H7=yh,z7="wc",W7="ethereum_provider",q7=`${z7}@${2}:${W7}:`,V7="https://rpc.walletconnect.com/v1/",lc=["eth_sendTransaction","personal_sign"],K7=["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"],uc=["chainChanged","accountsChanged"],G7=["message","disconnect","connect"];var Z7=Object.defineProperty,Y7=Object.defineProperties,J7=Object.getOwnPropertyDescriptors,Dg=Object.getOwnPropertySymbols,X7=Object.prototype.hasOwnProperty,Q7=Object.prototype.propertyIsEnumerable,$g=(t,e,r)=>e in t?Z7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bh=(t,e)=>{for(var r in e||(e={}))X7.call(e,r)&&$g(t,r,e[r]);if(Dg)for(var r of Dg(e))Q7.call(e,r)&&$g(t,r,e[r]);return t},Pg=(t,e)=>Y7(t,J7(e));function _h(t){return Number(t[0].split(":")[1])}function Eh(t){return`0x${t.toString(16)}`}function ex(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:c,rpcMap:l}=t;if(!zn(e))throw new Error("Invalid chains");const h=e,d=n||lc,v=o||uc,E={[_h(h)]:l[_h(h)]},_={chains:h,methods:d,events:v,rpcMap:E},A=o?.filter(G=>!uc.includes(G)),P=n?.filter(G=>!lc.includes(G));if(!r&&!c&&!i&&!(A!=null&&A.length)&&!(P!=null&&P.length))return{required:_};const U=A?.length&&P?.length||!r,H={chains:[...new Set(U?h.concat(r||[]):r)],methods:[...new Set(d.concat(i||[]))],events:[...new Set(v.concat(c||[]))],rpcMap:l};return{required:_,optional:H}}class hc{constructor(){this.events=new br.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=q7,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 hc;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}=ex(this.rpc);try{const i=await new Promise(async(c,l)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(d=>{!d.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Pg(bh({namespaces:{[this.namespace]:r}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(d=>{c(d)}).catch(d=>{l(new Error(d.message))})});if(!i)return;this.setChainIds(this.rpc.chains);const o=M5(i.namespaces,[this.namespace]);this.setAccounts(o),this.events.emit("connect",{chainId:Eh(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",Eh(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",Pg(bh({},Zt("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",Eh(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||lc,events:e?.events||uc,optionalMethods:e?.optionalMethods||[],optionalEvents:e?.optionalEvents||[],rpcMap:e?.rpcMap||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),showQrModal:Boolean(e?.showQrModal),qrModalOptions:(n=e?.qrModalOptions)!=null?n:void 0,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=_h(this.rpc.chains),this.signer=await H7.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal)try{const{Web3Modal:r}=await Promise.resolve().then(function(){return Px});this.modal=new r(bh({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch{throw new Error("To use QR modal, please install @web3modal/standalone package")}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&zn(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&zn(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(o=>this.formatChainId(o)),n.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${V7}?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 tx=hc,rx=Symbol(),Tg=Object.getPrototypeOf,xh=new WeakMap,nx=t=>t&&(xh.has(t)?xh.get(t):Tg(t)===Object.prototype||Tg(t)===Array.prototype),ix=t=>nx(t)&&t[rx]||null,Rg=(t,e=!0)=>{xh.set(t,e)},Ch=t=>typeof t=="object"&&t!==null,pi=new WeakMap,fc=new WeakSet,sx=(t=Object.is,e=(d,v)=>new Proxy(d,v),r=d=>Ch(d)&&!fc.has(d)&&(Array.isArray(d)||!(Symbol.iterator in d))&&!(d instanceof WeakMap)&&!(d instanceof WeakSet)&&!(d instanceof Error)&&!(d instanceof Number)&&!(d instanceof Date)&&!(d instanceof String)&&!(d instanceof RegExp)&&!(d instanceof ArrayBuffer),n=d=>{switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:throw d}},i=new WeakMap,o=(d,v,E=n)=>{const _=i.get(d);if(_?.[0]===v)return _[1];const A=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d));return Rg(A,!0),i.set(d,[v,A]),Reflect.ownKeys(d).forEach(P=>{if(Object.getOwnPropertyDescriptor(A,P))return;const U=Reflect.get(d,P),H={value:U,enumerable:!0,configurable:!0};if(fc.has(U))Rg(U,!1);else if(U instanceof Promise)delete H.value,H.get=()=>E(U);else if(pi.has(U)){const[G,N]=pi.get(U);H.value=o(G,N(),E)}Object.defineProperty(A,P,H)}),A},c=new WeakMap,l=[1,1],h=d=>{if(!Ch(d))throw new Error("object required");const v=c.get(d);if(v)return v;let E=l[0];const _=new Set,A=(J,z=++l[0])=>{E!==z&&(E=z,_.forEach(ee=>ee(J,z)))};let P=l[1];const U=(J=++l[1])=>(P!==J&&!_.size&&(P=J,G.forEach(([z])=>{const ee=z[1](J);ee>E&&(E=ee)})),E),H=J=>(z,ee)=>{const de=[...z];de[1]=[J,...de[1]],A(de,ee)},G=new Map,N=(J,z)=>{if(void 0!=="production"&&G.has(J))throw new Error("prop listener already exists");if(_.size){const ee=z[3](H(J));G.set(J,[z,ee])}else G.set(J,[z])},L=J=>{var z;const ee=G.get(J);ee&&(G.delete(J),(z=ee[1])==null||z.call(ee))},$=J=>(_.add(J),_.size===1&&G.forEach(([ee,de],me)=>{if(void 0!=="production"&&de)throw new Error("remove already exists");const O=ee[3](H(me));G.set(me,[ee,O])}),()=>{_.delete(J),_.size===0&&G.forEach(([ee,de],me)=>{de&&(de(),G.set(me,[ee]))})}),T=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d)),f=e(T,{deleteProperty(J,z){const ee=Reflect.get(J,z);L(z);const de=Reflect.deleteProperty(J,z);return de&&A(["delete",[z],ee]),de},set(J,z,ee,de){const me=Reflect.has(J,z),O=Reflect.get(J,z,de);if(me&&(t(O,ee)||c.has(ee)&&t(O,c.get(ee))))return!0;L(z),Ch(ee)&&(ee=ix(ee)||ee);let j=ee;if(ee instanceof Promise)ee.then(ce=>{ee.status="fulfilled",ee.value=ce,A(["resolve",[z],ce])}).catch(ce=>{ee.status="rejected",ee.reason=ce,A(["reject",[z],ce])});else{!pi.has(ee)&&r(ee)&&(j=h(ee));const ce=!fc.has(j)&&pi.get(j);ce&&N(z,ce)}return Reflect.set(J,z,j,de),A(["set",[z],ee,O]),!0}});c.set(d,f);const x=[T,U,o,$];return pi.set(f,x),Reflect.ownKeys(d).forEach(J=>{const z=Object.getOwnPropertyDescriptor(d,J);"value"in z&&(f[J]=d[J],delete z.value,delete z.writable),Object.defineProperty(T,J,z)}),f})=>[h,pi,fc,t,e,r,n,i,o,c,l],[ox]=sx();function Rn(t={}){return ox(t)}function Kn(t,e,r){const n=pi.get(t);void 0!=="production"&&!n&&console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const d=c(v=>{if(o.push(v),r){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,l&&e(o.splice(0))}))});return l=!0,()=>{l=!1,d()}}function ax(t,e){const r=pi.get(t);void 0!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}var Ng={},dc={};dc.byteLength=ux,dc.toByteArray=fx,dc.fromByteArray=gx;for(var Nn=[],ln=[],cx=typeof Uint8Array<"u"?Uint8Array:Array,Ih="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ts=0,lx=Ih.length;Ts<lx;++Ts)Nn[Ts]=Ih[Ts],ln[Ih.charCodeAt(Ts)]=Ts;ln["-".charCodeAt(0)]=62,ln["_".charCodeAt(0)]=63;function Lg(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 ux(t){var e=Lg(t),r=e[0],n=e[1];return(r+n)*3/4-n}function hx(t,e,r){return(e+r)*3/4-r}function fx(t){var e,r=Lg(t),n=r[0],i=r[1],o=new cx(hx(t,n,i)),c=0,l=i>0?n-4:n,h;for(h=0;h<l;h+=4)e=ln[t.charCodeAt(h)]<<18|ln[t.charCodeAt(h+1)]<<12|ln[t.charCodeAt(h+2)]<<6|ln[t.charCodeAt(h+3)],o[c++]=e>>16&255,o[c++]=e>>8&255,o[c++]=e&255;return i===2&&(e=ln[t.charCodeAt(h)]<<2|ln[t.charCodeAt(h+1)]>>4,o[c++]=e&255),i===1&&(e=ln[t.charCodeAt(h)]<<10|ln[t.charCodeAt(h+1)]<<4|ln[t.charCodeAt(h+2)]>>2,o[c++]=e>>8&255,o[c++]=e&255),o}function dx(t){return Nn[t>>18&63]+Nn[t>>12&63]+Nn[t>>6&63]+Nn[t&63]}function px(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(dx(n));return i.join("")}function gx(t){for(var e,r=t.length,n=r%3,i=[],o=16383,c=0,l=r-n;c<l;c+=o)i.push(px(t,c,c+o>l?l:c+o));return n===1?(e=t[r-1],i.push(Nn[e>>2]+Nn[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Nn[e>>10]+Nn[e>>4&63]+Nn[e<<2&63]+"=")),i.join("")}var Oh={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Oh.read=function(t,e,r,n,i){var o,c,l=i*8-n-1,h=(1<<l)-1,d=h>>1,v=-7,E=r?i-1:0,_=r?-1:1,A=t[e+E];for(E+=_,o=A&(1<<-v)-1,A>>=-v,v+=l;v>0;o=o*256+t[e+E],E+=_,v-=8);for(c=o&(1<<-v)-1,o>>=-v,v+=n;v>0;c=c*256+t[e+E],E+=_,v-=8);if(o===0)o=1-d;else{if(o===h)return c?NaN:(A?-1:1)*(1/0);c=c+Math.pow(2,n),o=o-d}return(A?-1:1)*c*Math.pow(2,o-n)},Oh.write=function(t,e,r,n,i,o){var c,l,h,d=o*8-i-1,v=(1<<d)-1,E=v>>1,_=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,P=n?1:-1,U=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,c=v):(c=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+E>=1?e+=_/h:e+=_*Math.pow(2,1-E),e*h>=2&&(c++,h/=2),c+E>=v?(l=0,c=v):c+E>=1?(l=(e*h-1)*Math.pow(2,i),c=c+E):(l=e*Math.pow(2,E-1)*Math.pow(2,i),c=0));i>=8;t[r+A]=l&255,A+=P,l/=256,i-=8);for(c=c<<i|l,d+=i;d>0;t[r+A]=c&255,A+=P,c/=256,d-=8);t[r+A-P]|=U*128};/*!
|
|
98
|
+
}`;var ot=hw(function(){return vt(S,Pe+"return "+pe).apply(r,M)});if(ot.source=pe,J0(ot))throw ot;return ot}function zR(s){return yt(s).toLowerCase()}function WR(s){return yt(s).toUpperCase()}function qR(s,a,u){if(s=yt(s),s&&(u||a===r))return bm(s);if(!s||!(a=tn(a)))return s;var g=In(s),y=In(a),S=_m(g,y),M=Em(g,y)+1;return Ni(g,S,M).join("")}function VR(s,a,u){if(s=yt(s),s&&(u||a===r))return s.slice(0,Cm(s)+1);if(!s||!(a=tn(a)))return s;var g=In(s),y=Em(g,In(a))+1;return Ni(g,0,y).join("")}function KR(s,a,u){if(s=yt(s),s&&(u||a===r))return s.replace(Vt,"");if(!s||!(a=tn(a)))return s;var g=In(s),y=_m(g,In(a));return Ni(g,y).join("")}function GR(s,a){var u=z,g=ee;if(Bt(a)){var y="separator"in a?a.separator:y;u="length"in a?it(a.length):u,g="omission"in a?tn(a.omission):g}s=yt(s);var S=s.length;if(oo(s)){var M=In(s);S=M.length}if(u>=S)return s;var k=u-ao(g);if(k<1)return g;var Z=M?Ni(M,0,k).join(""):s.slice(0,k);if(y===r)return Z+g;if(M&&(k+=Z.length-k),X0(y)){if(s.slice(k).search(y)){var ue,he=Z;for(y.global||(y=p0(y.source,yt(fn.exec(y))+"g")),y.lastIndex=0;ue=y.exec(he);)var pe=ue.index;Z=Z.slice(0,pe===r?k:pe)}}else if(s.indexOf(tn(y),k)!=k){var be=Z.lastIndexOf(y);be>-1&&(Z=Z.slice(0,be))}return Z+g}function ZR(s){return s=yt(s),s&&Ht.test(s)?s.replace(Ii,CS):s}var YR=go(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),td=f2("toUpperCase");function uw(s,a,u){return s=yt(s),a=u?r:a,a===r?yS(s)?AS(s):uS(s):s.match(a)||[]}var hw=ct(function(s,a){try{return vr(s,r,a)}catch(u){return J0(u)?u:new Ye(u)}}),JR=ii(function(s,a){return pn(a,function(u){u=Hn(u),ri(s,u,Z0(s[u],s))}),s});function XR(s){var a=s==null?0:s.length,u=ze();return s=a?Ut(s,function(g){if(typeof g[1]!="function")throw new gn(c);return[u(g[0]),g[1]]}):[],ct(function(g){for(var y=-1;++y<a;){var S=s[y];if(vr(S[0],this,g))return vr(S[1],this,g)}})}function QR(s){return CD(wn(s,E))}function rd(s){return function(){return s}}function eN(s,a){return s==null||s!==s?a:s}var tN=p2(),rN=p2(!0);function Zr(s){return s}function nd(s){return Wm(typeof s=="function"?s:wn(s,E))}function nN(s){return Vm(wn(s,E))}function iN(s,a){return Km(s,wn(a,E))}var sN=ct(function(s,a){return function(u){return Sa(u,s,a)}}),oN=ct(function(s,a){return function(u){return Sa(s,u,a)}});function id(s,a,u){var g=yr(a),y=Tl(a,g);u==null&&!(Bt(a)&&(y.length||!g.length))&&(u=a,a=s,s=this,y=Tl(a,yr(a)));var S=!(Bt(u)&&"chain"in u)||!!u.chain,M=oi(s);return pn(y,function(k){var Z=a[k];s[k]=Z,M&&(s.prototype[k]=function(){var ue=this.__chain__;if(S||ue){var he=s(this.__wrapped__),pe=he.__actions__=Vr(this.__actions__);return pe.push({func:Z,args:arguments,thisArg:s}),he.__chain__=ue,he}return Z.apply(s,Si([this.value()],arguments))})}),s}function aN(){return mt._===this&&(mt._=RS),this}function sd(){}function cN(s){return s=it(s),ct(function(a){return Gm(a,s)})}var lN=M0(Ut),uN=M0(gm),hN=M0(a0);function fw(s){return z0(s)?c0(Hn(s)):kD(s)}function fN(s){return function(a){return s==null?r:vs(s,a)}}var dN=m2(),pN=m2(!0);function od(){return[]}function ad(){return!1}function gN(){return{}}function mN(){return""}function wN(){return!0}function vN(s,a){if(s=it(s),s<1||s>re)return[];var u=ie,g=Ar(s,ie);a=ze(a),s-=ie;for(var y=h0(g,a);++u<s;)a(u);return y}function yN(s){return Qe(s)?Ut(s,Hn):rn(s)?[s]:Vr(T2(yt(s)))}function bN(s){var a=++PS;return yt(s)+a}var _N=jl(function(s,a){return s+a},0),EN=U0("ceil"),xN=jl(function(s,a){return s/a},1),CN=U0("floor");function IN(s){return s&&s.length?Pl(s,Zr,E0):r}function ON(s,a){return s&&s.length?Pl(s,ze(a,2),E0):r}function AN(s){return vm(s,Zr)}function SN(s,a){return vm(s,ze(a,2))}function DN(s){return s&&s.length?Pl(s,Zr,O0):r}function $N(s,a){return s&&s.length?Pl(s,ze(a,2),O0):r}var PN=jl(function(s,a){return s*a},1),TN=U0("round"),RN=jl(function(s,a){return s-a},0);function NN(s){return s&&s.length?u0(s,Zr):0}function LN(s,a){return s&&s.length?u0(s,ze(a,2)):0}return C.after=nT,C.ary=z2,C.assign=WT,C.assignIn=nw,C.assignInWith=Jl,C.assignWith=qT,C.at=VT,C.before=W2,C.bind=Z0,C.bindAll=JR,C.bindKey=q2,C.castArray=gT,C.chain=B2,C.chunk=C$,C.compact=I$,C.concat=O$,C.cond=XR,C.conforms=QR,C.constant=rd,C.countBy=NP,C.create=KT,C.curry=V2,C.curryRight=K2,C.debounce=G2,C.defaults=GT,C.defaultsDeep=ZT,C.defer=iT,C.delay=sT,C.difference=A$,C.differenceBy=S$,C.differenceWith=D$,C.drop=$$,C.dropRight=P$,C.dropRightWhile=T$,C.dropWhile=R$,C.fill=N$,C.filter=MP,C.flatMap=FP,C.flatMapDeep=BP,C.flatMapDepth=kP,C.flatten=M2,C.flattenDeep=L$,C.flattenDepth=M$,C.flip=oT,C.flow=tN,C.flowRight=rN,C.fromPairs=U$,C.functions=rR,C.functionsIn=nR,C.groupBy=HP,C.initial=F$,C.intersection=B$,C.intersectionBy=k$,C.intersectionWith=H$,C.invert=sR,C.invertBy=oR,C.invokeMap=WP,C.iteratee=nd,C.keyBy=qP,C.keys=yr,C.keysIn=Gr,C.map=ql,C.mapKeys=cR,C.mapValues=lR,C.matches=nN,C.matchesProperty=iN,C.memoize=Kl,C.merge=uR,C.mergeWith=iw,C.method=sN,C.methodOf=oN,C.mixin=id,C.negate=Gl,C.nthArg=cN,C.omit=hR,C.omitBy=fR,C.once=aT,C.orderBy=VP,C.over=lN,C.overArgs=cT,C.overEvery=uN,C.overSome=hN,C.partial=Y0,C.partialRight=Z2,C.partition=KP,C.pick=dR,C.pickBy=sw,C.property=fw,C.propertyOf=fN,C.pull=V$,C.pullAll=j2,C.pullAllBy=K$,C.pullAllWith=G$,C.pullAt=Z$,C.range=dN,C.rangeRight=pN,C.rearg=lT,C.reject=YP,C.remove=Y$,C.rest=uT,C.reverse=K0,C.sampleSize=XP,C.set=gR,C.setWith=mR,C.shuffle=QP,C.slice=J$,C.sortBy=rT,C.sortedUniq=iP,C.sortedUniqBy=sP,C.split=FR,C.spread=hT,C.tail=oP,C.take=aP,C.takeRight=cP,C.takeRightWhile=lP,C.takeWhile=uP,C.tap=IP,C.throttle=fT,C.thru=Wl,C.toArray=ew,C.toPairs=ow,C.toPairsIn=aw,C.toPath=yN,C.toPlainObject=rw,C.transform=wR,C.unary=dT,C.union=hP,C.unionBy=fP,C.unionWith=dP,C.uniq=pP,C.uniqBy=gP,C.uniqWith=mP,C.unset=vR,C.unzip=G0,C.unzipWith=F2,C.update=yR,C.updateWith=bR,C.values=vo,C.valuesIn=_R,C.without=wP,C.words=uw,C.wrap=pT,C.xor=vP,C.xorBy=yP,C.xorWith=bP,C.zip=_P,C.zipObject=EP,C.zipObjectDeep=xP,C.zipWith=CP,C.entries=ow,C.entriesIn=aw,C.extend=nw,C.extendWith=Jl,id(C,C),C.add=_N,C.attempt=hw,C.camelCase=IR,C.capitalize=cw,C.ceil=EN,C.clamp=ER,C.clone=mT,C.cloneDeep=vT,C.cloneDeepWith=yT,C.cloneWith=wT,C.conformsTo=bT,C.deburr=lw,C.defaultTo=eN,C.divide=xN,C.endsWith=OR,C.eq=An,C.escape=AR,C.escapeRegExp=SR,C.every=LP,C.find=UP,C.findIndex=N2,C.findKey=YT,C.findLast=jP,C.findLastIndex=L2,C.findLastKey=JT,C.floor=CN,C.forEach=k2,C.forEachRight=H2,C.forIn=XT,C.forInRight=QT,C.forOwn=eR,C.forOwnRight=tR,C.get=Q0,C.gt=_T,C.gte=ET,C.has=iR,C.hasIn=ed,C.head=U2,C.identity=Zr,C.includes=zP,C.indexOf=j$,C.inRange=xR,C.invoke=aR,C.isArguments=_s,C.isArray=Qe,C.isArrayBuffer=xT,C.isArrayLike=Kr,C.isArrayLikeObject=Qt,C.isBoolean=CT,C.isBuffer=Li,C.isDate=IT,C.isElement=OT,C.isEmpty=AT,C.isEqual=ST,C.isEqualWith=DT,C.isError=J0,C.isFinite=$T,C.isFunction=oi,C.isInteger=Y2,C.isLength=Zl,C.isMap=J2,C.isMatch=PT,C.isMatchWith=TT,C.isNaN=RT,C.isNative=NT,C.isNil=MT,C.isNull=LT,C.isNumber=X2,C.isObject=Bt,C.isObjectLike=Gt,C.isPlainObject=Na,C.isRegExp=X0,C.isSafeInteger=UT,C.isSet=Q2,C.isString=Yl,C.isSymbol=rn,C.isTypedArray=wo,C.isUndefined=jT,C.isWeakMap=FT,C.isWeakSet=BT,C.join=z$,C.kebabCase=DR,C.last=yn,C.lastIndexOf=W$,C.lowerCase=$R,C.lowerFirst=PR,C.lt=kT,C.lte=HT,C.max=IN,C.maxBy=ON,C.mean=AN,C.meanBy=SN,C.min=DN,C.minBy=$N,C.stubArray=od,C.stubFalse=ad,C.stubObject=gN,C.stubString=mN,C.stubTrue=wN,C.multiply=PN,C.nth=q$,C.noConflict=aN,C.noop=sd,C.now=Vl,C.pad=TR,C.padEnd=RR,C.padStart=NR,C.parseInt=LR,C.random=CR,C.reduce=GP,C.reduceRight=ZP,C.repeat=MR,C.replace=UR,C.result=pR,C.round=TN,C.runInContext=V,C.sample=JP,C.size=eT,C.snakeCase=jR,C.some=tT,C.sortedIndex=X$,C.sortedIndexBy=Q$,C.sortedIndexOf=eP,C.sortedLastIndex=tP,C.sortedLastIndexBy=rP,C.sortedLastIndexOf=nP,C.startCase=BR,C.startsWith=kR,C.subtract=RN,C.sum=NN,C.sumBy=LN,C.template=HR,C.times=vN,C.toFinite=ai,C.toInteger=it,C.toLength=tw,C.toLower=zR,C.toNumber=bn,C.toSafeInteger=zT,C.toString=yt,C.toUpper=WR,C.trim=qR,C.trimEnd=VR,C.trimStart=KR,C.truncate=GR,C.unescape=ZR,C.uniqueId=bN,C.upperCase=YR,C.upperFirst=td,C.each=k2,C.eachRight=H2,C.first=U2,id(C,function(){var s={};return Bn(C,function(a,u){bt.call(C.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),C.VERSION=n,pn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){C[s].placeholder=C}),pn(["drop","take"],function(s,a){dt.prototype[s]=function(u){u=u===r?1:dr(it(u),0);var g=this.__filtered__&&!a?new dt(this):this.clone();return g.__filtered__?g.__takeCount__=Ar(u,g.__takeCount__):g.__views__.push({size:Ar(u,ie),type:s+(g.__dir__<0?"Right":"")}),g},dt.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),pn(["filter","map","takeWhile"],function(s,a){var u=a+1,g=u==O||u==ce;dt.prototype[s]=function(y){var S=this.clone();return S.__iteratees__.push({iteratee:ze(y,3),type:u}),S.__filtered__=S.__filtered__||g,S}}),pn(["head","last"],function(s,a){var u="take"+(a?"Right":"");dt.prototype[s]=function(){return this[u](1).value()[0]}}),pn(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");dt.prototype[s]=function(){return this.__filtered__?new dt(this):this[u](1)}}),dt.prototype.compact=function(){return this.filter(Zr)},dt.prototype.find=function(s){return this.filter(s).head()},dt.prototype.findLast=function(s){return this.reverse().find(s)},dt.prototype.invokeMap=ct(function(s,a){return typeof s=="function"?new dt(this):this.map(function(u){return Sa(u,s,a)})}),dt.prototype.reject=function(s){return this.filter(Gl(ze(s)))},dt.prototype.slice=function(s,a){s=it(s);var u=this;return u.__filtered__&&(s>0||a<0)?new dt(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==r&&(a=it(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},dt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},dt.prototype.toArray=function(){return this.take(ie)},Bn(dt.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),y=C[g?"take"+(a=="last"?"Right":""):a],S=g||/^find/.test(a);y&&(C.prototype[a]=function(){var M=this.__wrapped__,k=g?[1]:arguments,Z=M instanceof dt,ue=k[0],he=Z||Qe(M),pe=function(ft){var wt=y.apply(C,Si([ft],k));return g&&be?wt[0]:wt};he&&u&&typeof ue=="function"&&ue.length!=1&&(Z=he=!1);var be=this.__chain__,Pe=!!this.__actions__.length,We=S&&!be,ot=Z&&!Pe;if(!S&&he){M=ot?M:new dt(this);var qe=s.apply(M,k);return qe.__actions__.push({func:Wl,args:[pe],thisArg:r}),new mn(qe,be)}return We&&ot?s.apply(this,k):(qe=this.thru(pe),We?g?qe.value()[0]:qe.value():qe)})}),pn(["pop","push","shift","sort","splice","unshift"],function(s){var a=ml[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",g=/^(?:pop|shift)$/.test(s);C.prototype[s]=function(){var y=arguments;if(g&&!this.__chain__){var S=this.value();return a.apply(Qe(S)?S:[],y)}return this[u](function(M){return a.apply(Qe(M)?M:[],y)})}}),Bn(dt.prototype,function(s,a){var u=C[a];if(u){var g=u.name+"";bt.call(ho,g)||(ho[g]=[]),ho[g].push({name:a,func:u})}}),ho[Ul(r,G).name]=[{name:"wrapper",func:r}],dt.prototype.clone=ZS,dt.prototype.reverse=YS,dt.prototype.value=JS,C.prototype.at=OP,C.prototype.chain=AP,C.prototype.commit=SP,C.prototype.next=DP,C.prototype.plant=PP,C.prototype.reverse=TP,C.prototype.toJSON=C.prototype.valueOf=C.prototype.value=RP,C.prototype.first=C.prototype.head,_a&&(C.prototype[_a]=$P),C},co=SS();Xt?((Xt.exports=co)._=co,Ot._=co):mt._=co}).call(Wo)})(ph,ph.exports);var y7=Object.defineProperty,b7=Object.defineProperties,_7=Object.getOwnPropertyDescriptors,Eg=Object.getOwnPropertySymbols,E7=Object.prototype.hasOwnProperty,x7=Object.prototype.propertyIsEnumerable,xg=(t,e,r)=>e in t?y7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,oc=(t,e)=>{for(var r in e||(e={}))E7.call(e,r)&&xg(t,r,e[r]);if(Eg)for(var r of Eg(e))x7.call(e,r)&&xg(t,r,e[r]);return t},C7=(t,e)=>b7(t,_7(e));function cn(t,e,r){let n;const i=gh(t);return e.rpcMap&&(n=e.rpcMap[i]),n||(n=`${v7}?chainId=eip155:${i}&projectId=${r}`),n}function gh(t){return t.includes("eip155")?Number(t.split(":")[1]):Number(t)}function I7(t,e){if(!e.includes(t))throw new Error(`Chain '${t}' not approved. Please use one of the following: ${e.toString()}`)}function O7(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function A7(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const o=e.namespaces[i].accounts;n.push(...o)}),n}function S7(t,e={}){const r=Cg(t),n=Cg(e);return ph.exports.merge(r,n)}function Cg(t){var e,r,n,i;const o={};if(!Ds(t))return o;for(const[c,l]of Object.entries(t)){const h=L1(c)?[c]:l.chains,d=l.methods||[],v=l.events||[],E=l.rpcMap||{},_=Za(c);o[_]=C7(oc(oc({},o[_]),l),{chains:Su(h,(e=o[_])==null?void 0:e.chains),methods:Su(d,(r=o[_])==null?void 0:r.methods),events:Su(v,(n=o[_])==null?void 0:n.events),rpcMap:oc(oc({},E),(i=o[_])==null?void 0:i.rpcMap)})}return o}const Ig={},Yt=t=>Ig[t],mh=(t,e)=>{Ig[t]=e};class D7{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||cn(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(di.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=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}class $7{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("client"),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)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){const n=gh(e);if(!this.httpProviders[n]){const i=r||cn(`${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(di.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||cn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=gh(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}handleSwitchChain(e){const r=parseInt(e,16),n=`${this.name}:${r}`;I7(n,this.namespace.chains),this.setDefaultChain(`${r}`)}}class P7{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||cn(`${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(di.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}class T7{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||cn(`${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(di.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}class R7{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?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(di.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r);e[r]=this.createHttpProvider(r,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}class N7{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||cn(`${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(di.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}class L7{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Yt("events"),this.client=Yt("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)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||cn(`${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(di.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new hi(new Vi(n,Yt("disableProviderPing")))}}var M7=Object.defineProperty,U7=Object.defineProperties,j7=Object.getOwnPropertyDescriptors,Og=Object.getOwnPropertySymbols,F7=Object.prototype.hasOwnProperty,B7=Object.prototype.propertyIsEnumerable,Ag=(t,e,r)=>e in t?M7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ac=(t,e)=>{for(var r in e||(e={}))F7.call(e,r)&&Ag(t,r,e[r]);if(Og)for(var r of Og(e))B7.call(e,r)&&Ag(t,r,e[r]);return t},wh=(t,e)=>U7(t,j7(e));class vh{constructor(e){this.events=new br.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||bg})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new vh(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:ac({},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:Zt("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(o=>{this.session=o}).catch(o=>{if(o.message!==pg)throw o;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(zn(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 fh.init({logger:this.providerOpts.logger||bg,relayUrl:this.providerOpts.relayUrl||g7,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>Za(r)))];mh("client",this.client),mh("events",this.events),mh("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=A7(r,this.session),i=O7(n),o=S7(this.namespaces,this.optionalNamespaces),c=wh(ac({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new $7({namespace:c});break;case"solana":this.rpcProviders[r]=new P7({namespace:c});break;case"cosmos":this.rpcProviders[r]=new T7({namespace:c});break;case"polkadot":this.rpcProviders[r]=new D7({namespace:c});break;case"cip34":this.rpcProviders[r]=new R7({namespace:c});break;case"elrond":this.rpcProviders[r]=new N7({namespace:c});break;case"multiversx":this.rpcProviders[r]=new L7({namespace:c});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,o=(n=this.client)==null?void 0:n.session.get(e);this.session=wh(ac({},o),{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",wh(ac({},Zt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(di.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).map(c=>Za(c)).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=Za(Object.keys(this.namespaces)[0]),o=this.rpcProviders[i].getDefaultChain();return[i,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){var n;const[i,o]=this.validateChain(e);r||this.getProvider(i).setDefaultChain(o),((n=this.namespaces[i])!=null?n:this.namespaces[`${i}:${o}`]).defaultChain=o,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",o)}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(`${_g}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${_g}/${e}`)}}const k7=vh,H7="wc",z7="ethereum_provider",W7=`${H7}@2:${z7}:`,q7="https://rpc.walletconnect.com/v1/",cc=["eth_sendTransaction","personal_sign"],V7=["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"],lc=["chainChanged","accountsChanged"],K7=["message","disconnect","connect"];var G7=Object.defineProperty,Z7=Object.defineProperties,Y7=Object.getOwnPropertyDescriptors,Sg=Object.getOwnPropertySymbols,J7=Object.prototype.hasOwnProperty,X7=Object.prototype.propertyIsEnumerable,Dg=(t,e,r)=>e in t?G7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yh=(t,e)=>{for(var r in e||(e={}))J7.call(e,r)&&Dg(t,r,e[r]);if(Sg)for(var r of Sg(e))X7.call(e,r)&&Dg(t,r,e[r]);return t},$g=(t,e)=>Z7(t,Y7(e));function bh(t){return Number(t[0].split(":")[1])}function _h(t){return`0x${t.toString(16)}`}function Q7(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:c,rpcMap:l}=t;if(!zn(e))throw new Error("Invalid chains");const h=e,d=n||cc,v=o||lc,E={[bh(h)]:l[bh(h)]},_={chains:h,methods:d,events:v,rpcMap:E},A=o?.filter(G=>!lc.includes(G)),P=n?.filter(G=>!cc.includes(G));if(!r&&!c&&!i&&!(A!=null&&A.length)&&!(P!=null&&P.length))return{required:_};const U=A?.length&&P?.length||!r,H={chains:[...new Set(U?h.concat(r||[]):r)],methods:[...new Set(d.concat(i||[]))],events:[...new Set(v.concat(c||[]))],rpcMap:l};return{required:_,optional:H}}class uc{constructor(){this.events=new br.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=W7,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 uc;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}=Q7(this.rpc);try{const i=await new Promise(async(c,l)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(d=>{!d.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect($g(yh({namespaces:{[this.namespace]:r}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(d=>{c(d)}).catch(d=>{l(new Error(d.message))})});if(!i)return;this.setChainIds(this.rpc.chains);const o=L5(i.namespaces,[this.namespace]);this.setAccounts(o),this.events.emit("connect",{chainId:_h(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",_h(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",$g(yh({},Zt("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",_h(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||cc,events:e?.events||lc,optionalMethods:e?.optionalMethods||[],optionalEvents:e?.optionalEvents||[],rpcMap:e?.rpcMap||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:(n=e?.qrModalOptions)!=null?n:void 0,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=bh(this.rpc.chains),this.signer=await k7.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{Web3Modal:n}=await Promise.resolve().then(function(){return $x});r=n}catch{throw new Error("To use QR modal, please install @web3modal/standalone package")}if(r)try{this.modal=new r(yh({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate Web3Modal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&zn(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&zn(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(o=>this.formatChainId(o)),n.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${q7}?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 ex=uc,tx=Symbol(),Pg=Object.getPrototypeOf,Eh=new WeakMap,rx=t=>t&&(Eh.has(t)?Eh.get(t):Pg(t)===Object.prototype||Pg(t)===Array.prototype),nx=t=>rx(t)&&t[tx]||null,Tg=(t,e=!0)=>{Eh.set(t,e)},xh=t=>typeof t=="object"&&t!==null,pi=new WeakMap,hc=new WeakSet,ix=(t=Object.is,e=(d,v)=>new Proxy(d,v),r=d=>xh(d)&&!hc.has(d)&&(Array.isArray(d)||!(Symbol.iterator in d))&&!(d instanceof WeakMap)&&!(d instanceof WeakSet)&&!(d instanceof Error)&&!(d instanceof Number)&&!(d instanceof Date)&&!(d instanceof String)&&!(d instanceof RegExp)&&!(d instanceof ArrayBuffer),n=d=>{switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:throw d}},i=new WeakMap,o=(d,v,E=n)=>{const _=i.get(d);if(_?.[0]===v)return _[1];const A=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d));return Tg(A,!0),i.set(d,[v,A]),Reflect.ownKeys(d).forEach(P=>{if(Object.getOwnPropertyDescriptor(A,P))return;const U=Reflect.get(d,P),H={value:U,enumerable:!0,configurable:!0};if(hc.has(U))Tg(U,!1);else if(U instanceof Promise)delete H.value,H.get=()=>E(U);else if(pi.has(U)){const[G,N]=pi.get(U);H.value=o(G,N(),E)}Object.defineProperty(A,P,H)}),A},c=new WeakMap,l=[1,1],h=d=>{if(!xh(d))throw new Error("object required");const v=c.get(d);if(v)return v;let E=l[0];const _=new Set,A=(J,z=++l[0])=>{E!==z&&(E=z,_.forEach(ee=>ee(J,z)))};let P=l[1];const U=(J=++l[1])=>(P!==J&&!_.size&&(P=J,G.forEach(([z])=>{const ee=z[1](J);ee>E&&(E=ee)})),E),H=J=>(z,ee)=>{const de=[...z];de[1]=[J,...de[1]],A(de,ee)},G=new Map,N=(J,z)=>{if(G.has(J))throw new Error("prop listener already exists");if(_.size){const ee=z[3](H(J));G.set(J,[z,ee])}else G.set(J,[z])},L=J=>{var z;const ee=G.get(J);ee&&(G.delete(J),(z=ee[1])==null||z.call(ee))},$=J=>(_.add(J),_.size===1&&G.forEach(([ee,de],me)=>{if(de)throw new Error("remove already exists");const O=ee[3](H(me));G.set(me,[ee,O])}),()=>{_.delete(J),_.size===0&&G.forEach(([ee,de],me)=>{de&&(de(),G.set(me,[ee]))})}),T=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d)),f=e(T,{deleteProperty(J,z){const ee=Reflect.get(J,z);L(z);const de=Reflect.deleteProperty(J,z);return de&&A(["delete",[z],ee]),de},set(J,z,ee,de){const me=Reflect.has(J,z),O=Reflect.get(J,z,de);if(me&&(t(O,ee)||c.has(ee)&&t(O,c.get(ee))))return!0;L(z),xh(ee)&&(ee=nx(ee)||ee);let j=ee;if(ee instanceof Promise)ee.then(ce=>{ee.status="fulfilled",ee.value=ce,A(["resolve",[z],ce])}).catch(ce=>{ee.status="rejected",ee.reason=ce,A(["reject",[z],ce])});else{!pi.has(ee)&&r(ee)&&(j=h(ee));const ce=!hc.has(j)&&pi.get(j);ce&&N(z,ce)}return Reflect.set(J,z,j,de),A(["set",[z],ee,O]),!0}});c.set(d,f);const x=[T,U,o,$];return pi.set(f,x),Reflect.ownKeys(d).forEach(J=>{const z=Object.getOwnPropertyDescriptor(d,J);"value"in z&&(f[J]=d[J],delete z.value,delete z.writable),Object.defineProperty(T,J,z)}),f})=>[h,pi,hc,t,e,r,n,i,o,c,l],[sx]=ix();function Rn(t={}){return sx(t)}function Kn(t,e,r){const n=pi.get(t);n||console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const d=c(v=>{if(o.push(v),r){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,l&&e(o.splice(0))}))});return l=!0,()=>{l=!1,d()}}function ox(t,e){const r=pi.get(t);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}var Rg={},fc={};fc.byteLength=lx,fc.toByteArray=hx,fc.fromByteArray=px;for(var Nn=[],ln=[],ax=typeof Uint8Array<"u"?Uint8Array:Array,Ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ps=0,cx=Ch.length;Ps<cx;++Ps)Nn[Ps]=Ch[Ps],ln[Ch.charCodeAt(Ps)]=Ps;ln["-".charCodeAt(0)]=62,ln["_".charCodeAt(0)]=63;function Ng(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 lx(t){var e=Ng(t),r=e[0],n=e[1];return(r+n)*3/4-n}function ux(t,e,r){return(e+r)*3/4-r}function hx(t){var e,r=Ng(t),n=r[0],i=r[1],o=new ax(ux(t,n,i)),c=0,l=i>0?n-4:n,h;for(h=0;h<l;h+=4)e=ln[t.charCodeAt(h)]<<18|ln[t.charCodeAt(h+1)]<<12|ln[t.charCodeAt(h+2)]<<6|ln[t.charCodeAt(h+3)],o[c++]=e>>16&255,o[c++]=e>>8&255,o[c++]=e&255;return i===2&&(e=ln[t.charCodeAt(h)]<<2|ln[t.charCodeAt(h+1)]>>4,o[c++]=e&255),i===1&&(e=ln[t.charCodeAt(h)]<<10|ln[t.charCodeAt(h+1)]<<4|ln[t.charCodeAt(h+2)]>>2,o[c++]=e>>8&255,o[c++]=e&255),o}function fx(t){return Nn[t>>18&63]+Nn[t>>12&63]+Nn[t>>6&63]+Nn[t&63]}function dx(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(fx(n));return i.join("")}function px(t){for(var e,r=t.length,n=r%3,i=[],o=16383,c=0,l=r-n;c<l;c+=o)i.push(dx(t,c,c+o>l?l:c+o));return n===1?(e=t[r-1],i.push(Nn[e>>2]+Nn[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Nn[e>>10]+Nn[e>>4&63]+Nn[e<<2&63]+"=")),i.join("")}var Ih={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ih.read=function(t,e,r,n,i){var o,c,l=i*8-n-1,h=(1<<l)-1,d=h>>1,v=-7,E=r?i-1:0,_=r?-1:1,A=t[e+E];for(E+=_,o=A&(1<<-v)-1,A>>=-v,v+=l;v>0;o=o*256+t[e+E],E+=_,v-=8);for(c=o&(1<<-v)-1,o>>=-v,v+=n;v>0;c=c*256+t[e+E],E+=_,v-=8);if(o===0)o=1-d;else{if(o===h)return c?NaN:(A?-1:1)*(1/0);c=c+Math.pow(2,n),o=o-d}return(A?-1:1)*c*Math.pow(2,o-n)},Ih.write=function(t,e,r,n,i,o){var c,l,h,d=o*8-i-1,v=(1<<d)-1,E=v>>1,_=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,P=n?1:-1,U=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,c=v):(c=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+E>=1?e+=_/h:e+=_*Math.pow(2,1-E),e*h>=2&&(c++,h/=2),c+E>=v?(l=0,c=v):c+E>=1?(l=(e*h-1)*Math.pow(2,i),c=c+E):(l=e*Math.pow(2,E-1)*Math.pow(2,i),c=0));i>=8;t[r+A]=l&255,A+=P,l/=256,i-=8);for(c=c<<i|l,d+=i;d>0;t[r+A]=c&255,A+=P,c/=256,d-=8);t[r+A-P]|=U*128};/*!
|
|
99
99
|
* The buffer module from node.js, for the browser.
|
|
100
100
|
*
|
|
101
101
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
102
102
|
* @license MIT
|
|
103
|
-
*/(function(t){const e=dc,r=Oh,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=N,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,l.TYPED_ARRAY_SUPPORT=o(),!l.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 o(){try{const b=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(b,p),b.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function c(b){if(b>i)throw new RangeError('The value "'+b+'" is invalid for option "size"');const p=new Uint8Array(b);return Object.setPrototypeOf(p,l.prototype),p}function l(b,p,m){if(typeof b=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(b)}return h(b,p,m)}l.poolSize=8192;function h(b,p,m){if(typeof b=="string")return _(b,p);if(ArrayBuffer.isView(b))return P(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(Be(b,ArrayBuffer)||b&&Be(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Be(b,SharedArrayBuffer)||b&&Be(b.buffer,SharedArrayBuffer)))return U(b,p,m);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=b.valueOf&&b.valueOf();if(D!=null&&D!==b)return l.from(D,p,m);const B=H(b);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return l.from(b[Symbol.toPrimitive]("string"),p,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}l.from=function(b,p,m){return h(b,p,m)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function d(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function v(b,p,m){return d(b),b<=0?c(b):p!==void 0?typeof m=="string"?c(b).fill(p,m):c(b).fill(p):c(b)}l.alloc=function(b,p,m){return v(b,p,m)};function E(b){return d(b),c(b<0?0:G(b)|0)}l.allocUnsafe=function(b){return E(b)},l.allocUnsafeSlow=function(b){return E(b)};function _(b,p){if((typeof p!="string"||p==="")&&(p="utf8"),!l.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const m=L(b,p)|0;let D=c(m);const B=D.write(b,p);return B!==m&&(D=D.slice(0,B)),D}function A(b){const p=b.length<0?0:G(b.length)|0,m=c(p);for(let D=0;D<p;D+=1)m[D]=b[D]&255;return m}function P(b){if(Be(b,Uint8Array)){const p=new Uint8Array(b);return U(p.buffer,p.byteOffset,p.byteLength)}return A(b)}function U(b,p,m){if(p<0||b.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(b.byteLength<p+(m||0))throw new RangeError('"length" is outside of buffer bounds');let D;return p===void 0&&m===void 0?D=new Uint8Array(b):m===void 0?D=new Uint8Array(b,p):D=new Uint8Array(b,p,m),Object.setPrototypeOf(D,l.prototype),D}function H(b){if(l.isBuffer(b)){const p=G(b.length)|0,m=c(p);return m.length===0||b.copy(m,0,0,p),m}if(b.length!==void 0)return typeof b.length!="number"||Ke(b.length)?c(0):A(b);if(b.type==="Buffer"&&Array.isArray(b.data))return A(b.data)}function G(b){if(b>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return b|0}function N(b){return+b!=b&&(b=0),l.alloc(+b)}l.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==l.prototype},l.compare=function(p,m){if(Be(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),Be(m,Uint8Array)&&(m=l.from(m,m.offset,m.byteLength)),!l.isBuffer(p)||!l.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===m)return 0;let D=p.length,B=m.length;for(let K=0,Q=Math.min(D,B);K<Q;++K)if(p[K]!==m[K]){D=p[K],B=m[K];break}return D<B?-1:B<D?1:0},l.isEncoding=function(p){switch(String(p).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}},l.concat=function(p,m){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return l.alloc(0);let D;if(m===void 0)for(m=0,D=0;D<p.length;++D)m+=p[D].length;const B=l.allocUnsafe(m);let K=0;for(D=0;D<p.length;++D){let Q=p[D];if(Be(Q,Uint8Array))K+Q.length>B.length?(l.isBuffer(Q)||(Q=l.from(Q)),Q.copy(B,K)):Uint8Array.prototype.set.call(B,Q,K);else if(l.isBuffer(Q))Q.copy(B,K);else throw new TypeError('"list" argument must be an Array of Buffers');K+=Q.length}return B};function L(b,p){if(l.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||Be(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);const m=b.length,D=arguments.length>2&&arguments[2]===!0;if(!D&&m===0)return 0;let B=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Ge(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return Je(b).length;default:if(B)return D?-1:Ge(b).length;p=(""+p).toLowerCase(),B=!0}}l.byteLength=L;function $(b,p,m){let D=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,p>>>=0,m<=p))return"";for(b||(b="utf8");;)switch(b){case"hex":return ne(this,p,m);case"utf8":case"utf-8":return O(this,p,m);case"ascii":return le(this,p,m);case"latin1":case"binary":return re(this,p,m);case"base64":return me(this,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,p,m);default:if(D)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),D=!0}}l.prototype._isBuffer=!0;function T(b,p,m){const D=b[p];b[p]=b[m],b[m]=D}l.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;m<p;m+=2)T(this,m,m+1);return this},l.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let m=0;m<p;m+=4)T(this,m,m+3),T(this,m+1,m+2);return this},l.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let m=0;m<p;m+=8)T(this,m,m+7),T(this,m+1,m+6),T(this,m+2,m+5),T(this,m+3,m+4);return this},l.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?O(this,0,p):$.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(p){if(!l.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:l.compare(this,p)===0},l.prototype.inspect=function(){let p="";const m=t.INSPECT_MAX_BYTES;return p=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(p+=" ... "),"<Buffer "+p+">"},n&&(l.prototype[n]=l.prototype.inspect),l.prototype.compare=function(p,m,D,B,K){if(Be(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),!l.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(m===void 0&&(m=0),D===void 0&&(D=p?p.length:0),B===void 0&&(B=0),K===void 0&&(K=this.length),m<0||D>p.length||B<0||K>this.length)throw new RangeError("out of range index");if(B>=K&&m>=D)return 0;if(B>=K)return-1;if(m>=D)return 1;if(m>>>=0,D>>>=0,B>>>=0,K>>>=0,this===p)return 0;let Q=K-B,Ee=D-m;const Te=Math.min(Q,Ee),st=this.slice(B,K),ht=p.slice(m,D);for(let lt=0;lt<Te;++lt)if(st[lt]!==ht[lt]){Q=st[lt],Ee=ht[lt];break}return Q<Ee?-1:Ee<Q?1:0};function I(b,p,m,D,B){if(b.length===0)return-1;if(typeof m=="string"?(D=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,Ke(m)&&(m=B?0:b.length-1),m<0&&(m=b.length+m),m>=b.length){if(B)return-1;m=b.length-1}else if(m<0)if(B)m=0;else return-1;if(typeof p=="string"&&(p=l.from(p,D)),l.isBuffer(p))return p.length===0?-1:f(b,p,m,D,B);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(b,p,m):Uint8Array.prototype.lastIndexOf.call(b,p,m):f(b,[p],m,D,B);throw new TypeError("val must be string, number or Buffer")}function f(b,p,m,D,B){let K=1,Q=b.length,Ee=p.length;if(D!==void 0&&(D=String(D).toLowerCase(),D==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(b.length<2||p.length<2)return-1;K=2,Q/=2,Ee/=2,m/=2}function Te(ht,lt){return K===1?ht[lt]:ht.readUInt16BE(lt*K)}let st;if(B){let ht=-1;for(st=m;st<Q;st++)if(Te(b,st)===Te(p,ht===-1?0:st-ht)){if(ht===-1&&(ht=st),st-ht+1===Ee)return ht*K}else ht!==-1&&(st-=st-ht),ht=-1}else for(m+Ee>Q&&(m=Q-Ee),st=m;st>=0;st--){let ht=!0;for(let lt=0;lt<Ee;lt++)if(Te(b,st+lt)!==Te(p,lt)){ht=!1;break}if(ht)return st}return-1}l.prototype.includes=function(p,m,D){return this.indexOf(p,m,D)!==-1},l.prototype.indexOf=function(p,m,D){return I(this,p,m,D,!0)},l.prototype.lastIndexOf=function(p,m,D){return I(this,p,m,D,!1)};function x(b,p,m,D){m=Number(m)||0;const B=b.length-m;D?(D=Number(D),D>B&&(D=B)):D=B;const K=p.length;D>K/2&&(D=K/2);let Q;for(Q=0;Q<D;++Q){const Ee=parseInt(p.substr(Q*2,2),16);if(Ke(Ee))return Q;b[m+Q]=Ee}return Q}function J(b,p,m,D){return He(Ge(p,b.length-m),b,m,D)}function z(b,p,m,D){return He(Dt(p),b,m,D)}function ee(b,p,m,D){return He(Je(p),b,m,D)}function de(b,p,m,D){return He($t(p,b.length-m),b,m,D)}l.prototype.write=function(p,m,D,B){if(m===void 0)B="utf8",D=this.length,m=0;else if(D===void 0&&typeof m=="string")B=m,D=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(D)?(D=D>>>0,B===void 0&&(B="utf8")):(B=D,D=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const K=this.length-m;if((D===void 0||D>K)&&(D=K),p.length>0&&(D<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let Q=!1;for(;;)switch(B){case"hex":return x(this,p,m,D);case"utf8":case"utf-8":return J(this,p,m,D);case"ascii":case"latin1":case"binary":return z(this,p,m,D);case"base64":return ee(this,p,m,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,p,m,D);default:if(Q)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),Q=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(b,p,m){return p===0&&m===b.length?e.fromByteArray(b):e.fromByteArray(b.slice(p,m))}function O(b,p,m){m=Math.min(b.length,m);const D=[];let B=p;for(;B<m;){const K=b[B];let Q=null,Ee=K>239?4:K>223?3:K>191?2:1;if(B+Ee<=m){let Te,st,ht,lt;switch(Ee){case 1:K<128&&(Q=K);break;case 2:Te=b[B+1],(Te&192)===128&&(lt=(K&31)<<6|Te&63,lt>127&&(Q=lt));break;case 3:Te=b[B+1],st=b[B+2],(Te&192)===128&&(st&192)===128&&(lt=(K&15)<<12|(Te&63)<<6|st&63,lt>2047&&(lt<55296||lt>57343)&&(Q=lt));break;case 4:Te=b[B+1],st=b[B+2],ht=b[B+3],(Te&192)===128&&(st&192)===128&&(ht&192)===128&&(lt=(K&15)<<18|(Te&63)<<12|(st&63)<<6|ht&63,lt>65535&<<1114112&&(Q=lt))}}Q===null?(Q=65533,Ee=1):Q>65535&&(Q-=65536,D.push(Q>>>10&1023|55296),Q=56320|Q&1023),D.push(Q),B+=Ee}return ce(D)}const j=4096;function ce(b){const p=b.length;if(p<=j)return String.fromCharCode.apply(String,b);let m="",D=0;for(;D<p;)m+=String.fromCharCode.apply(String,b.slice(D,D+=j));return m}function le(b,p,m){let D="";m=Math.min(b.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(b[B]&127);return D}function re(b,p,m){let D="";m=Math.min(b.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(b[B]);return D}function ne(b,p,m){const D=b.length;(!p||p<0)&&(p=0),(!m||m<0||m>D)&&(m=D);let B="";for(let K=p;K<m;++K)B+=rt[b[K]];return B}function ae(b,p,m){const D=b.slice(p,m);let B="";for(let K=0;K<D.length-1;K+=2)B+=String.fromCharCode(D[K]+D[K+1]*256);return B}l.prototype.slice=function(p,m){const D=this.length;p=~~p,m=m===void 0?D:~~m,p<0?(p+=D,p<0&&(p=0)):p>D&&(p=D),m<0?(m+=D,m<0&&(m=0)):m>D&&(m=D),m<p&&(m=p);const B=this.subarray(p,m);return Object.setPrototypeOf(B,l.prototype),B};function ie(b,p,m){if(b%1!==0||b<0)throw new RangeError("offset is not uint");if(b+p>m)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],K=1,Q=0;for(;++Q<m&&(K*=256);)B+=this[p+Q]*K;return B},l.prototype.readUintBE=l.prototype.readUIntBE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p+--m],K=1;for(;m>0&&(K*=256);)B+=this[p+--m]*K;return B},l.prototype.readUint8=l.prototype.readUInt8=function(p,m){return p=p>>>0,m||ie(p,1,this.length),this[p]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(p,m){return p=p>>>0,m||ie(p,2,this.length),this[p]|this[p+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(p,m){return p=p>>>0,m||ie(p,2,this.length),this[p]<<8|this[p+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},l.prototype.readBigUInt64LE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,K=this[++p]+this[++p]*2**8+this[++p]*2**16+D*2**24;return BigInt(B)+(BigInt(K)<<BigInt(32))}),l.prototype.readBigUInt64BE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=m*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],K=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D;return(BigInt(B)<<BigInt(32))+BigInt(K)}),l.prototype.readIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],K=1,Q=0;for(;++Q<m&&(K*=256);)B+=this[p+Q]*K;return K*=128,B>=K&&(B-=Math.pow(2,8*m)),B},l.prototype.readIntBE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=m,K=1,Q=this[p+--B];for(;B>0&&(K*=256);)Q+=this[p+--B]*K;return K*=128,Q>=K&&(Q-=Math.pow(2,8*m)),Q},l.prototype.readInt8=function(p,m){return p=p>>>0,m||ie(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},l.prototype.readInt16LE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const D=this[p]|this[p+1]<<8;return D&32768?D|4294901760:D},l.prototype.readInt16BE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const D=this[p+1]|this[p]<<8;return D&32768?D|4294901760:D},l.prototype.readInt32LE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},l.prototype.readInt32BE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},l.prototype.readBigInt64LE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(D<<24);return(BigInt(B)<<BigInt(32))+BigInt(m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),l.prototype.readBigInt64BE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=(m<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(B)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D)}),l.prototype.readFloatLE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),r.read(this,p,!0,23,4)},l.prototype.readFloatBE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),r.read(this,p,!1,23,4)},l.prototype.readDoubleLE=function(p,m){return p=p>>>0,m||ie(p,8,this.length),r.read(this,p,!0,52,8)},l.prototype.readDoubleBE=function(p,m){return p=p>>>0,m||ie(p,8,this.length),r.read(this,p,!1,52,8)};function Se(b,p,m,D,B,K){if(!l.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>B||p<K)throw new RangeError('"value" argument is out of bounds');if(m+D>b.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(p,m,D,B){if(p=+p,m=m>>>0,D=D>>>0,!B){const Ee=Math.pow(2,8*D)-1;Se(this,p,m,D,Ee,0)}let K=1,Q=0;for(this[m]=p&255;++Q<D&&(K*=256);)this[m+Q]=p/K&255;return m+D},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(p,m,D,B){if(p=+p,m=m>>>0,D=D>>>0,!B){const Ee=Math.pow(2,8*D)-1;Se(this,p,m,D,Ee,0)}let K=D-1,Q=1;for(this[m+K]=p&255;--K>=0&&(Q*=256);)this[m+K]=p/Q&255;return m+D},l.prototype.writeUint8=l.prototype.writeUInt8=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,1,255,0),this[m]=p&255,m+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,2,65535,0),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,2,65535,0),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,4,4294967295,0),this[m+3]=p>>>24,this[m+2]=p>>>16,this[m+1]=p>>>8,this[m]=p&255,m+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,4,4294967295,0),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4};function ge(b,p,m,D,B){we(p,D,B,b,m,7);let K=Number(p&BigInt(4294967295));b[m++]=K,K=K>>8,b[m++]=K,K=K>>8,b[m++]=K,K=K>>8,b[m++]=K;let Q=Number(p>>BigInt(32)&BigInt(4294967295));return b[m++]=Q,Q=Q>>8,b[m++]=Q,Q=Q>>8,b[m++]=Q,Q=Q>>8,b[m++]=Q,m}function Fe(b,p,m,D,B){we(p,D,B,b,m,7);let K=Number(p&BigInt(4294967295));b[m+7]=K,K=K>>8,b[m+6]=K,K=K>>8,b[m+5]=K,K=K>>8,b[m+4]=K;let Q=Number(p>>BigInt(32)&BigInt(4294967295));return b[m+3]=Q,Q=Q>>8,b[m+2]=Q,Q=Q>>8,b[m+1]=Q,Q=Q>>8,b[m]=Q,m+8}l.prototype.writeBigUInt64LE=Ue(function(p,m=0){return ge(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Ue(function(p,m=0){return Fe(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(p,m,D,B){if(p=+p,m=m>>>0,!B){const Te=Math.pow(2,8*D-1);Se(this,p,m,D,Te-1,-Te)}let K=0,Q=1,Ee=0;for(this[m]=p&255;++K<D&&(Q*=256);)p<0&&Ee===0&&this[m+K-1]!==0&&(Ee=1),this[m+K]=(p/Q>>0)-Ee&255;return m+D},l.prototype.writeIntBE=function(p,m,D,B){if(p=+p,m=m>>>0,!B){const Te=Math.pow(2,8*D-1);Se(this,p,m,D,Te-1,-Te)}let K=D-1,Q=1,Ee=0;for(this[m+K]=p&255;--K>=0&&(Q*=256);)p<0&&Ee===0&&this[m+K+1]!==0&&(Ee=1),this[m+K]=(p/Q>>0)-Ee&255;return m+D},l.prototype.writeInt8=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,1,127,-128),p<0&&(p=255+p+1),this[m]=p&255,m+1},l.prototype.writeInt16LE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,2,32767,-32768),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeInt16BE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,2,32767,-32768),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeInt32LE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,4,2147483647,-2147483648),this[m]=p&255,this[m+1]=p>>>8,this[m+2]=p>>>16,this[m+3]=p>>>24,m+4},l.prototype.writeInt32BE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4},l.prototype.writeBigInt64LE=Ue(function(p,m=0){return ge(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Ue(function(p,m=0){return Fe(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(b,p,m,D,B,K){if(m+D>b.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Le(b,p,m,D,B){return p=+p,m=m>>>0,B||ye(b,p,m,4),r.write(b,p,m,D,23,4),m+4}l.prototype.writeFloatLE=function(p,m,D){return Le(this,p,m,!0,D)},l.prototype.writeFloatBE=function(p,m,D){return Le(this,p,m,!1,D)};function X(b,p,m,D,B){return p=+p,m=m>>>0,B||ye(b,p,m,8),r.write(b,p,m,D,52,8),m+8}l.prototype.writeDoubleLE=function(p,m,D){return X(this,p,m,!0,D)},l.prototype.writeDoubleBE=function(p,m,D){return X(this,p,m,!1,D)},l.prototype.copy=function(p,m,D,B){if(!l.isBuffer(p))throw new TypeError("argument should be a Buffer");if(D||(D=0),!B&&B!==0&&(B=this.length),m>=p.length&&(m=p.length),m||(m=0),B>0&&B<D&&(B=D),B===D||p.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(D<0||D>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),p.length-m<B-D&&(B=p.length-m+D);const K=B-D;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,D,B):Uint8Array.prototype.set.call(p,this.subarray(D,B),m),K},l.prototype.fill=function(p,m,D,B){if(typeof p=="string"){if(typeof m=="string"?(B=m,m=0,D=this.length):typeof D=="string"&&(B=D,D=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!l.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(p.length===1){const Q=p.charCodeAt(0);(B==="utf8"&&Q<128||B==="latin1")&&(p=Q)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(m<0||this.length<m||this.length<D)throw new RangeError("Out of range index");if(D<=m)return this;m=m>>>0,D=D===void 0?this.length:D>>>0,p||(p=0);let K;if(typeof p=="number")for(K=m;K<D;++K)this[K]=p;else{const Q=l.isBuffer(p)?p:l.from(p,B),Ee=Q.length;if(Ee===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(K=0;K<D-m;++K)this[K+m]=Q[K%Ee]}return this};const Y={};function W(b,p,m){Y[b]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${b}]`,this.stack,delete this.name}get code(){return b}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${b}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(b,p){return`The "${b}" argument must be of type number. Received type ${typeof p}`},TypeError),W("ERR_OUT_OF_RANGE",function(b,p,m){let D=`The value of "${b}" is out of range.`,B=m;return Number.isInteger(m)&&Math.abs(m)>2**32?B=w(String(m)):typeof m=="bigint"&&(B=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(B=w(B)),B+="n"),D+=` It must be ${p}. Received ${B}`,D},RangeError);function w(b){let p="",m=b.length;const D=b[0]==="-"?1:0;for(;m>=D+4;m-=3)p=`_${b.slice(m-3,m)}${p}`;return`${b.slice(0,m)}${p}`}function F(b,p,m){ve(p,"offset"),(b[p]===void 0||b[p+m]===void 0)&&Me(p,b.length-(m+1))}function we(b,p,m,D,B,K){if(b>m||b<p){const Q=typeof p=="bigint"?"n":"";let Ee;throw K>3?p===0||p===BigInt(0)?Ee=`>= 0${Q} and < 2${Q} ** ${(K+1)*8}${Q}`:Ee=`>= -(2${Q} ** ${(K+1)*8-1}${Q}) and < 2 ** ${(K+1)*8-1}${Q}`:Ee=`>= ${p}${Q} and <= ${m}${Q}`,new Y.ERR_OUT_OF_RANGE("value",Ee,b)}F(D,B,K)}function ve(b,p){if(typeof b!="number")throw new Y.ERR_INVALID_ARG_TYPE(p,"number",b)}function Me(b,p,m){throw Math.floor(b)!==b?(ve(b,m),new Y.ERR_OUT_OF_RANGE(m||"offset","an integer",b)):p<0?new Y.ERR_BUFFER_OUT_OF_BOUNDS:new Y.ERR_OUT_OF_RANGE(m||"offset",`>= ${m?1:0} and <= ${p}`,b)}const nt=/[^+/0-9A-Za-z-_]/g;function at(b){if(b=b.split("=")[0],b=b.trim().replace(nt,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function Ge(b,p){p=p||1/0;let m;const D=b.length;let B=null;const K=[];for(let Q=0;Q<D;++Q){if(m=b.charCodeAt(Q),m>55295&&m<57344){if(!B){if(m>56319){(p-=3)>-1&&K.push(239,191,189);continue}else if(Q+1===D){(p-=3)>-1&&K.push(239,191,189);continue}B=m;continue}if(m<56320){(p-=3)>-1&&K.push(239,191,189),B=m;continue}m=(B-55296<<10|m-56320)+65536}else B&&(p-=3)>-1&&K.push(239,191,189);if(B=null,m<128){if((p-=1)<0)break;K.push(m)}else if(m<2048){if((p-=2)<0)break;K.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;K.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;K.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return K}function Dt(b){const p=[];for(let m=0;m<b.length;++m)p.push(b.charCodeAt(m)&255);return p}function $t(b,p){let m,D,B;const K=[];for(let Q=0;Q<b.length&&!((p-=2)<0);++Q)m=b.charCodeAt(Q),D=m>>8,B=m%256,K.push(B),K.push(D);return K}function Je(b){return e.toByteArray(at(b))}function He(b,p,m,D){let B;for(B=0;B<D&&!(B+m>=p.length||B>=b.length);++B)p[B+m]=b[B];return B}function Be(b,p){return b instanceof p||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===p.name}function Ke(b){return b!==b}const rt=function(){const b="0123456789abcdef",p=new Array(256);for(let m=0;m<16;++m){const D=m*16;for(let B=0;B<16;++B)p[D+B]=b[m]+b[B]}return p}();function Ue(b){return typeof BigInt>"u"?Ze:b}function Ze(){throw new Error("BigInt not supported")}})(Ng);let Ah;const Nt={ethereumClient:void 0,setEthereumClient(t){Ah=t},client(){if(Ah)return Ah;throw new Error("ClientCtrl has no client set")}},mr=Rn({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),tt={state:mr,subscribe(t){return Kn(mr,()=>t(mr))},push(t,e){t!==mr.view&&(mr.view=t,e&&(mr.data=e),mr.history.push(t))},reset(t){mr.view=t,mr.history=[t]},replace(t){mr.history.length>1&&(mr.history[mr.history.length-1]=t,mr.view=t)},goBack(){if(mr.history.length>1){mr.history.pop();const[t]=mr.history.slice(-1);mr.view=t}},setData(t){mr.data=t}},Ie={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",W3M_PREFER_INJECTED_URL_FLAG:"w3mPreferInjected",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Ie.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Ie.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Ie.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(!Ie.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;t.endsWith("/")&&(n=t.slice(0,-1)),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}/wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(Ie.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Ie.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Ie.WALLETCONNECT_DEEPLINK_CHOICE)},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(Ie.W3M_VERSION,"2.4.1")},getWalletRouterData(){var t;const e=(t=tt.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e},getSwitchNetworkRouterData(){var t;const e=(t=tt.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error('Missing "SwitchNetwork" view data');return e},isPreferInjectedFlag(){return typeof location<"u"?new URLSearchParams(location.search).has(Ie.W3M_PREFER_INJECTED_URL_FLAG):!1}},mx=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Or=Rn({enabled:mx,userSessionId:"",events:[],connectedWalletId:void 0}),gi={state:Or,subscribe(t){return Kn(Or.events,()=>t(ax(Or.events[Or.events.length-1])))},initialize(){Or.enabled&&typeof crypto<"u"&&(Or.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Or.connectedWalletId=t},click(t){if(Or.enabled){const e={type:"CLICK",name:t.name,userSessionId:Or.userSessionId,timestamp:Date.now(),data:t};Or.events.push(e)}},track(t){if(Or.enabled){const e={type:"TRACK",name:t.name,userSessionId:Or.userSessionId,timestamp:Date.now(),data:t};Or.events.push(e)}},view(t){if(Or.enabled){const e={type:"VIEW",name:t.name,userSessionId:Or.userSessionId,timestamp:Date.now(),data:t};Or.events.push(e)}}},xr=Rn({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,isStandalone:!1,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,isPreferInjected:!1,walletConnectVersion:1}),De={state:xr,subscribe(t){return Kn(xr,()=>t(xr))},setChains(t){xr.chains=t},setStandaloneChains(t){xr.standaloneChains=t},setStandaloneUri(t){xr.standaloneUri=t},getSelectedChain(){const t=Nt.client().getNetwork().chain;return t&&(xr.selectedChain=t),xr.selectedChain},setSelectedChain(t){xr.selectedChain=t},setIsStandalone(t){xr.isStandalone=t},setIsCustomDesktop(t){xr.isCustomDesktop=t},setIsCustomMobile(t){xr.isCustomMobile=t},setIsDataLoaded(t){xr.isDataLoaded=t},setIsUiLoaded(t){xr.isUiLoaded=t},setWalletConnectVersion(t){xr.walletConnectVersion=t},setIsPreferInjected(t){xr.isPreferInjected=t},setIsAuth(t){xr.isAuth=t}},pc=Rn({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,tokenContracts:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableAuthMode:!1,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),jt={state:pc,subscribe(t){return Kn(pc,()=>t(pc))},setConfig(t){var e,r,n,i;gi.initialize(),De.setStandaloneChains(t.standaloneChains),De.setIsStandalone(!!((e=t.standaloneChains)!=null&&e.length)||!!t.enableStandaloneMode),De.setIsAuth(!!t.enableAuthMode),De.setIsCustomMobile(!!((r=t.mobileWallets)!=null&&r.length)),De.setIsCustomDesktop(!!((n=t.desktopWallets)!=null&&n.length)),De.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),De.state.isStandalone||(De.setChains(Nt.client().chains),De.setIsPreferInjected(Nt.client().isInjectedProviderInstalled()&&Ie.isPreferInjectedFlag())),t.defaultChain&&De.setSelectedChain(t.defaultChain),Ie.setWeb3ModalVersionInStorage(),Object.assign(pc,t)}},kt=Rn({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),Et={state:kt,subscribe(t){return Kn(kt,()=>t(kt))},getAccount(){const t=Nt.client().getAccount();kt.address=t.address,kt.isConnected=t.isConnected},async fetchProfile(t,e){var r;try{kt.profileLoading=!0;const n=e??kt.address,i=(r=De.state.chains)==null?void 0:r.find(o=>o.id===1);if(n&&i){const o=await Nt.client().fetchEnsName({address:n,chainId:1});if(o){const c=await Nt.client().fetchEnsAvatar({name:o,chainId:1});c&&await t(c),kt.profileAvatar=c}kt.profileName=o}}finally{kt.profileLoading=!1}},async fetchBalance(t){try{const{chain:e}=Nt.client().getNetwork(),{tokenContracts:r}=jt.state;let n;e&&r&&(n=r[e.id]),kt.balanceLoading=!0;const i=t??kt.address;if(i){const o=await Nt.client().fetchBalance({address:i,token:n});kt.balance={amount:o.formatted,symbol:o.symbol}}}finally{kt.balanceLoading=!1}},setAddress(t){kt.address=t},setIsConnected(t){kt.isConnected=t},resetBalance(){kt.balance=void 0},resetAccount(){kt.address=void 0,kt.isConnected=!1,kt.profileName=void 0,kt.profileAvatar=void 0,kt.balance=void 0}},Sh="https://explorer-api.walletconnect.com";async function gc(t,e){const r=new URL(t,Sh);return r.searchParams.append("projectId",jt.state.projectId),Object.entries(e).forEach(([n,i])=>{i&&r.searchParams.append(n,String(i))}),(await fetch(r)).json()}const mi={async getDesktopListings(t){return gc("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return gc("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return gc("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return gc("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${Sh}/w3m/v1/getWalletImage/${t}?projectId=${jt.state.projectId}`},getAssetImageUrl(t){return`${Sh}/w3m/v1/getAssetImage/${t}?projectId=${jt.state.projectId}`}};var wx=Object.defineProperty,Mg=Object.getOwnPropertySymbols,vx=Object.prototype.hasOwnProperty,yx=Object.prototype.propertyIsEnumerable,Ug=(t,e,r)=>e in t?wx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bx=(t,e)=>{for(var r in e||(e={}))vx.call(e,r)&&Ug(t,r,e[r]);if(Mg)for(var r of Mg(e))yx.call(e,r)&&Ug(t,r,e[r]);return t};const jg=Ie.isMobile(),un=Rn({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),nr={state:un,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=jt.state;if(t==="NONE"||e==="ALL"&&!t)return un.recomendedWallets;if(Ie.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await mi.getAllListings(r),i=Object.values(n);i.sort((o,c)=>{const l=t.indexOf(o.id),h=t.indexOf(c.id);return l-h}),un.recomendedWallets=i}else{const{standaloneChains:r,walletConnectVersion:n,isAuth:i}=De.state,o=r?.join(","),c=Ie.isArray(e),l={page:1,sdks:i?"auth_v1":void 0,entries:Ie.RECOMMENDED_WALLET_AMOUNT,chains:o,version:n,excludedIds:c?e.join(","):void 0},{listings:h}=jg?await mi.getMobileListings(l):await mi.getDesktopListings(l);un.recomendedWallets=Object.values(h)}return un.recomendedWallets},async getWallets(t){const e=bx({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=jt.state,{recomendedWallets:i}=un;if(n==="ALL")return un.wallets;e.search||(i.length?e.excludedIds=i.map(E=>E.id).join(","):Ie.isArray(r)&&(e.excludedIds=r.join(","))),Ie.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),De.state.isAuth&&(e.sdks="auth_v1");const{page:o,search:c}=t,{listings:l,total:h}=jg?await mi.getMobileListings(e):await mi.getDesktopListings(e),d=Object.values(l),v=c?"search":"wallets";return un[v]={listings:[...un[v].listings,...d],total:h,page:o??1},{listings:d,total:h}},async getInjectedWallets(){const{listings:t}=await mi.getInjectedListings({}),e=Object.values(t);return un.injectedWallets=e,un.injectedWallets},getWalletImageUrl(t){return mi.getWalletImageUrl(t)},getAssetImageUrl(t){return mi.getAssetImageUrl(t)},resetSearch(){un.search={listings:[],total:0,page:1}}},Vo=Rn({pairingUri:"",pairingError:!1}),hr={state:Vo,subscribe(t){return Kn(Vo,()=>t(Vo))},setPairingUri(t){Vo.pairingUri=t},setPairingError(t){Vo.pairingError=t}},Rs=Rn({open:!1}),Nr={state:Rs,subscribe(t){return Kn(Rs,()=>t(Rs))},async open(t){return new Promise(e=>{const{isStandalone:r,isUiLoaded:n,isDataLoaded:i,isPreferInjected:o,selectedChain:c}=De.state,{pairingUri:l}=hr.state,{isConnected:h}=Et.state,{enableNetworkView:d}=jt.state;if(r)De.setStandaloneUri(t?.uri),De.setStandaloneChains(t?.standaloneChains),tt.reset("ConnectWallet");else if(t!=null&&t.route)tt.reset(t.route);else if(h)tt.reset("Account");else if(d)tt.reset("SelectNetwork");else if(o){Nt.client().connectConnector("injected",c?.id).catch(v=>console.error(v)),e();return}else tt.reset("ConnectWallet");if(n&&i&&(r||l||h))Rs.open=!0,e();else{const v=setInterval(()=>{const E=De.state,_=hr.state;E.isUiLoaded&&E.isDataLoaded&&(E.isStandalone||_.pairingUri||h)&&(clearInterval(v),Rs.open=!0,e())},200)}})},close(){Rs.open=!1}};var _x=Object.defineProperty,Fg=Object.getOwnPropertySymbols,Ex=Object.prototype.hasOwnProperty,xx=Object.prototype.propertyIsEnumerable,Bg=(t,e,r)=>e in t?_x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cx=(t,e)=>{for(var r in e||(e={}))Ex.call(e,r)&&Bg(t,r,e[r]);if(Fg)for(var r of Fg(e))xx.call(e,r)&&Bg(t,r,e[r]);return t};function Ix(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Ko=Rn({themeMode:Ix()?"dark":"light"}),Ln={state:Ko,subscribe(t){return Kn(Ko,()=>t(Ko))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(Ko.themeMode=e),r&&(Ko.themeVariables=Cx({},r))}},Gi=Rn({open:!1,message:"",variant:"success"}),Wr={state:Gi,subscribe(t){return Kn(Gi,()=>t(Gi))},openToast(t,e){Gi.open=!0,Gi.message=t,Gi.variant=e},closeToast(){Gi.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=Ng.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var Ox=Object.defineProperty,kg=Object.getOwnPropertySymbols,Ax=Object.prototype.hasOwnProperty,Sx=Object.prototype.propertyIsEnumerable,Hg=(t,e,r)=>e in t?Ox(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Dx=(t,e)=>{for(var r in e||(e={}))Ax.call(e,r)&&Hg(t,r,e[r]);if(kg)for(var r of kg(e))Sx.call(e,r)&&Hg(t,r,e[r]);return t};class $x{constructor(e){this.openModal=Nr.open,this.closeModal=Nr.close,this.subscribeModal=Nr.subscribe,this.setTheme=Ln.setThemeConfig,Ln.setThemeConfig(e),jt.setConfig(Dx({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return sS});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),De.setIsUiLoaded(!0)}}}var Px=Object.freeze({__proto__:null,Web3Modal:$x});/**
|
|
103
|
+
*/(function(t){const e=fc,r=Ih,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=N,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,l.TYPED_ARRAY_SUPPORT=o(),!l.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 o(){try{const b=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(b,p),b.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function c(b){if(b>i)throw new RangeError('The value "'+b+'" is invalid for option "size"');const p=new Uint8Array(b);return Object.setPrototypeOf(p,l.prototype),p}function l(b,p,m){if(typeof b=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(b)}return h(b,p,m)}l.poolSize=8192;function h(b,p,m){if(typeof b=="string")return _(b,p);if(ArrayBuffer.isView(b))return P(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(Be(b,ArrayBuffer)||b&&Be(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Be(b,SharedArrayBuffer)||b&&Be(b.buffer,SharedArrayBuffer)))return U(b,p,m);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=b.valueOf&&b.valueOf();if(D!=null&&D!==b)return l.from(D,p,m);const B=H(b);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return l.from(b[Symbol.toPrimitive]("string"),p,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}l.from=function(b,p,m){return h(b,p,m)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function d(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function v(b,p,m){return d(b),b<=0?c(b):p!==void 0?typeof m=="string"?c(b).fill(p,m):c(b).fill(p):c(b)}l.alloc=function(b,p,m){return v(b,p,m)};function E(b){return d(b),c(b<0?0:G(b)|0)}l.allocUnsafe=function(b){return E(b)},l.allocUnsafeSlow=function(b){return E(b)};function _(b,p){if((typeof p!="string"||p==="")&&(p="utf8"),!l.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const m=L(b,p)|0;let D=c(m);const B=D.write(b,p);return B!==m&&(D=D.slice(0,B)),D}function A(b){const p=b.length<0?0:G(b.length)|0,m=c(p);for(let D=0;D<p;D+=1)m[D]=b[D]&255;return m}function P(b){if(Be(b,Uint8Array)){const p=new Uint8Array(b);return U(p.buffer,p.byteOffset,p.byteLength)}return A(b)}function U(b,p,m){if(p<0||b.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(b.byteLength<p+(m||0))throw new RangeError('"length" is outside of buffer bounds');let D;return p===void 0&&m===void 0?D=new Uint8Array(b):m===void 0?D=new Uint8Array(b,p):D=new Uint8Array(b,p,m),Object.setPrototypeOf(D,l.prototype),D}function H(b){if(l.isBuffer(b)){const p=G(b.length)|0,m=c(p);return m.length===0||b.copy(m,0,0,p),m}if(b.length!==void 0)return typeof b.length!="number"||Ke(b.length)?c(0):A(b);if(b.type==="Buffer"&&Array.isArray(b.data))return A(b.data)}function G(b){if(b>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return b|0}function N(b){return+b!=b&&(b=0),l.alloc(+b)}l.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==l.prototype},l.compare=function(p,m){if(Be(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),Be(m,Uint8Array)&&(m=l.from(m,m.offset,m.byteLength)),!l.isBuffer(p)||!l.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===m)return 0;let D=p.length,B=m.length;for(let K=0,Q=Math.min(D,B);K<Q;++K)if(p[K]!==m[K]){D=p[K],B=m[K];break}return D<B?-1:B<D?1:0},l.isEncoding=function(p){switch(String(p).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}},l.concat=function(p,m){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return l.alloc(0);let D;if(m===void 0)for(m=0,D=0;D<p.length;++D)m+=p[D].length;const B=l.allocUnsafe(m);let K=0;for(D=0;D<p.length;++D){let Q=p[D];if(Be(Q,Uint8Array))K+Q.length>B.length?(l.isBuffer(Q)||(Q=l.from(Q)),Q.copy(B,K)):Uint8Array.prototype.set.call(B,Q,K);else if(l.isBuffer(Q))Q.copy(B,K);else throw new TypeError('"list" argument must be an Array of Buffers');K+=Q.length}return B};function L(b,p){if(l.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||Be(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);const m=b.length,D=arguments.length>2&&arguments[2]===!0;if(!D&&m===0)return 0;let B=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Ge(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return Je(b).length;default:if(B)return D?-1:Ge(b).length;p=(""+p).toLowerCase(),B=!0}}l.byteLength=L;function $(b,p,m){let D=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,p>>>=0,m<=p))return"";for(b||(b="utf8");;)switch(b){case"hex":return ne(this,p,m);case"utf8":case"utf-8":return O(this,p,m);case"ascii":return le(this,p,m);case"latin1":case"binary":return re(this,p,m);case"base64":return me(this,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,p,m);default:if(D)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),D=!0}}l.prototype._isBuffer=!0;function T(b,p,m){const D=b[p];b[p]=b[m],b[m]=D}l.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;m<p;m+=2)T(this,m,m+1);return this},l.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let m=0;m<p;m+=4)T(this,m,m+3),T(this,m+1,m+2);return this},l.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let m=0;m<p;m+=8)T(this,m,m+7),T(this,m+1,m+6),T(this,m+2,m+5),T(this,m+3,m+4);return this},l.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?O(this,0,p):$.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(p){if(!l.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:l.compare(this,p)===0},l.prototype.inspect=function(){let p="";const m=t.INSPECT_MAX_BYTES;return p=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(p+=" ... "),"<Buffer "+p+">"},n&&(l.prototype[n]=l.prototype.inspect),l.prototype.compare=function(p,m,D,B,K){if(Be(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),!l.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(m===void 0&&(m=0),D===void 0&&(D=p?p.length:0),B===void 0&&(B=0),K===void 0&&(K=this.length),m<0||D>p.length||B<0||K>this.length)throw new RangeError("out of range index");if(B>=K&&m>=D)return 0;if(B>=K)return-1;if(m>=D)return 1;if(m>>>=0,D>>>=0,B>>>=0,K>>>=0,this===p)return 0;let Q=K-B,Ee=D-m;const Te=Math.min(Q,Ee),st=this.slice(B,K),ht=p.slice(m,D);for(let lt=0;lt<Te;++lt)if(st[lt]!==ht[lt]){Q=st[lt],Ee=ht[lt];break}return Q<Ee?-1:Ee<Q?1:0};function I(b,p,m,D,B){if(b.length===0)return-1;if(typeof m=="string"?(D=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,Ke(m)&&(m=B?0:b.length-1),m<0&&(m=b.length+m),m>=b.length){if(B)return-1;m=b.length-1}else if(m<0)if(B)m=0;else return-1;if(typeof p=="string"&&(p=l.from(p,D)),l.isBuffer(p))return p.length===0?-1:f(b,p,m,D,B);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(b,p,m):Uint8Array.prototype.lastIndexOf.call(b,p,m):f(b,[p],m,D,B);throw new TypeError("val must be string, number or Buffer")}function f(b,p,m,D,B){let K=1,Q=b.length,Ee=p.length;if(D!==void 0&&(D=String(D).toLowerCase(),D==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(b.length<2||p.length<2)return-1;K=2,Q/=2,Ee/=2,m/=2}function Te(ht,lt){return K===1?ht[lt]:ht.readUInt16BE(lt*K)}let st;if(B){let ht=-1;for(st=m;st<Q;st++)if(Te(b,st)===Te(p,ht===-1?0:st-ht)){if(ht===-1&&(ht=st),st-ht+1===Ee)return ht*K}else ht!==-1&&(st-=st-ht),ht=-1}else for(m+Ee>Q&&(m=Q-Ee),st=m;st>=0;st--){let ht=!0;for(let lt=0;lt<Ee;lt++)if(Te(b,st+lt)!==Te(p,lt)){ht=!1;break}if(ht)return st}return-1}l.prototype.includes=function(p,m,D){return this.indexOf(p,m,D)!==-1},l.prototype.indexOf=function(p,m,D){return I(this,p,m,D,!0)},l.prototype.lastIndexOf=function(p,m,D){return I(this,p,m,D,!1)};function x(b,p,m,D){m=Number(m)||0;const B=b.length-m;D?(D=Number(D),D>B&&(D=B)):D=B;const K=p.length;D>K/2&&(D=K/2);let Q;for(Q=0;Q<D;++Q){const Ee=parseInt(p.substr(Q*2,2),16);if(Ke(Ee))return Q;b[m+Q]=Ee}return Q}function J(b,p,m,D){return He(Ge(p,b.length-m),b,m,D)}function z(b,p,m,D){return He(Dt(p),b,m,D)}function ee(b,p,m,D){return He(Je(p),b,m,D)}function de(b,p,m,D){return He($t(p,b.length-m),b,m,D)}l.prototype.write=function(p,m,D,B){if(m===void 0)B="utf8",D=this.length,m=0;else if(D===void 0&&typeof m=="string")B=m,D=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(D)?(D=D>>>0,B===void 0&&(B="utf8")):(B=D,D=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const K=this.length-m;if((D===void 0||D>K)&&(D=K),p.length>0&&(D<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let Q=!1;for(;;)switch(B){case"hex":return x(this,p,m,D);case"utf8":case"utf-8":return J(this,p,m,D);case"ascii":case"latin1":case"binary":return z(this,p,m,D);case"base64":return ee(this,p,m,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,p,m,D);default:if(Q)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),Q=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(b,p,m){return p===0&&m===b.length?e.fromByteArray(b):e.fromByteArray(b.slice(p,m))}function O(b,p,m){m=Math.min(b.length,m);const D=[];let B=p;for(;B<m;){const K=b[B];let Q=null,Ee=K>239?4:K>223?3:K>191?2:1;if(B+Ee<=m){let Te,st,ht,lt;switch(Ee){case 1:K<128&&(Q=K);break;case 2:Te=b[B+1],(Te&192)===128&&(lt=(K&31)<<6|Te&63,lt>127&&(Q=lt));break;case 3:Te=b[B+1],st=b[B+2],(Te&192)===128&&(st&192)===128&&(lt=(K&15)<<12|(Te&63)<<6|st&63,lt>2047&&(lt<55296||lt>57343)&&(Q=lt));break;case 4:Te=b[B+1],st=b[B+2],ht=b[B+3],(Te&192)===128&&(st&192)===128&&(ht&192)===128&&(lt=(K&15)<<18|(Te&63)<<12|(st&63)<<6|ht&63,lt>65535&<<1114112&&(Q=lt))}}Q===null?(Q=65533,Ee=1):Q>65535&&(Q-=65536,D.push(Q>>>10&1023|55296),Q=56320|Q&1023),D.push(Q),B+=Ee}return ce(D)}const j=4096;function ce(b){const p=b.length;if(p<=j)return String.fromCharCode.apply(String,b);let m="",D=0;for(;D<p;)m+=String.fromCharCode.apply(String,b.slice(D,D+=j));return m}function le(b,p,m){let D="";m=Math.min(b.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(b[B]&127);return D}function re(b,p,m){let D="";m=Math.min(b.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(b[B]);return D}function ne(b,p,m){const D=b.length;(!p||p<0)&&(p=0),(!m||m<0||m>D)&&(m=D);let B="";for(let K=p;K<m;++K)B+=rt[b[K]];return B}function ae(b,p,m){const D=b.slice(p,m);let B="";for(let K=0;K<D.length-1;K+=2)B+=String.fromCharCode(D[K]+D[K+1]*256);return B}l.prototype.slice=function(p,m){const D=this.length;p=~~p,m=m===void 0?D:~~m,p<0?(p+=D,p<0&&(p=0)):p>D&&(p=D),m<0?(m+=D,m<0&&(m=0)):m>D&&(m=D),m<p&&(m=p);const B=this.subarray(p,m);return Object.setPrototypeOf(B,l.prototype),B};function ie(b,p,m){if(b%1!==0||b<0)throw new RangeError("offset is not uint");if(b+p>m)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],K=1,Q=0;for(;++Q<m&&(K*=256);)B+=this[p+Q]*K;return B},l.prototype.readUintBE=l.prototype.readUIntBE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p+--m],K=1;for(;m>0&&(K*=256);)B+=this[p+--m]*K;return B},l.prototype.readUint8=l.prototype.readUInt8=function(p,m){return p=p>>>0,m||ie(p,1,this.length),this[p]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(p,m){return p=p>>>0,m||ie(p,2,this.length),this[p]|this[p+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(p,m){return p=p>>>0,m||ie(p,2,this.length),this[p]<<8|this[p+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},l.prototype.readBigUInt64LE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,K=this[++p]+this[++p]*2**8+this[++p]*2**16+D*2**24;return BigInt(B)+(BigInt(K)<<BigInt(32))}),l.prototype.readBigUInt64BE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=m*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],K=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D;return(BigInt(B)<<BigInt(32))+BigInt(K)}),l.prototype.readIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],K=1,Q=0;for(;++Q<m&&(K*=256);)B+=this[p+Q]*K;return K*=128,B>=K&&(B-=Math.pow(2,8*m)),B},l.prototype.readIntBE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=m,K=1,Q=this[p+--B];for(;B>0&&(K*=256);)Q+=this[p+--B]*K;return K*=128,Q>=K&&(Q-=Math.pow(2,8*m)),Q},l.prototype.readInt8=function(p,m){return p=p>>>0,m||ie(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},l.prototype.readInt16LE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const D=this[p]|this[p+1]<<8;return D&32768?D|4294901760:D},l.prototype.readInt16BE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const D=this[p+1]|this[p]<<8;return D&32768?D|4294901760:D},l.prototype.readInt32LE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},l.prototype.readInt32BE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},l.prototype.readBigInt64LE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(D<<24);return(BigInt(B)<<BigInt(32))+BigInt(m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),l.prototype.readBigInt64BE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=(m<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(B)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D)}),l.prototype.readFloatLE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),r.read(this,p,!0,23,4)},l.prototype.readFloatBE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),r.read(this,p,!1,23,4)},l.prototype.readDoubleLE=function(p,m){return p=p>>>0,m||ie(p,8,this.length),r.read(this,p,!0,52,8)},l.prototype.readDoubleBE=function(p,m){return p=p>>>0,m||ie(p,8,this.length),r.read(this,p,!1,52,8)};function Se(b,p,m,D,B,K){if(!l.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>B||p<K)throw new RangeError('"value" argument is out of bounds');if(m+D>b.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(p,m,D,B){if(p=+p,m=m>>>0,D=D>>>0,!B){const Ee=Math.pow(2,8*D)-1;Se(this,p,m,D,Ee,0)}let K=1,Q=0;for(this[m]=p&255;++Q<D&&(K*=256);)this[m+Q]=p/K&255;return m+D},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(p,m,D,B){if(p=+p,m=m>>>0,D=D>>>0,!B){const Ee=Math.pow(2,8*D)-1;Se(this,p,m,D,Ee,0)}let K=D-1,Q=1;for(this[m+K]=p&255;--K>=0&&(Q*=256);)this[m+K]=p/Q&255;return m+D},l.prototype.writeUint8=l.prototype.writeUInt8=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,1,255,0),this[m]=p&255,m+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,2,65535,0),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,2,65535,0),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,4,4294967295,0),this[m+3]=p>>>24,this[m+2]=p>>>16,this[m+1]=p>>>8,this[m]=p&255,m+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,4,4294967295,0),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4};function ge(b,p,m,D,B){we(p,D,B,b,m,7);let K=Number(p&BigInt(4294967295));b[m++]=K,K=K>>8,b[m++]=K,K=K>>8,b[m++]=K,K=K>>8,b[m++]=K;let Q=Number(p>>BigInt(32)&BigInt(4294967295));return b[m++]=Q,Q=Q>>8,b[m++]=Q,Q=Q>>8,b[m++]=Q,Q=Q>>8,b[m++]=Q,m}function Fe(b,p,m,D,B){we(p,D,B,b,m,7);let K=Number(p&BigInt(4294967295));b[m+7]=K,K=K>>8,b[m+6]=K,K=K>>8,b[m+5]=K,K=K>>8,b[m+4]=K;let Q=Number(p>>BigInt(32)&BigInt(4294967295));return b[m+3]=Q,Q=Q>>8,b[m+2]=Q,Q=Q>>8,b[m+1]=Q,Q=Q>>8,b[m]=Q,m+8}l.prototype.writeBigUInt64LE=Ue(function(p,m=0){return ge(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Ue(function(p,m=0){return Fe(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(p,m,D,B){if(p=+p,m=m>>>0,!B){const Te=Math.pow(2,8*D-1);Se(this,p,m,D,Te-1,-Te)}let K=0,Q=1,Ee=0;for(this[m]=p&255;++K<D&&(Q*=256);)p<0&&Ee===0&&this[m+K-1]!==0&&(Ee=1),this[m+K]=(p/Q>>0)-Ee&255;return m+D},l.prototype.writeIntBE=function(p,m,D,B){if(p=+p,m=m>>>0,!B){const Te=Math.pow(2,8*D-1);Se(this,p,m,D,Te-1,-Te)}let K=D-1,Q=1,Ee=0;for(this[m+K]=p&255;--K>=0&&(Q*=256);)p<0&&Ee===0&&this[m+K+1]!==0&&(Ee=1),this[m+K]=(p/Q>>0)-Ee&255;return m+D},l.prototype.writeInt8=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,1,127,-128),p<0&&(p=255+p+1),this[m]=p&255,m+1},l.prototype.writeInt16LE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,2,32767,-32768),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeInt16BE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,2,32767,-32768),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeInt32LE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,4,2147483647,-2147483648),this[m]=p&255,this[m+1]=p>>>8,this[m+2]=p>>>16,this[m+3]=p>>>24,m+4},l.prototype.writeInt32BE=function(p,m,D){return p=+p,m=m>>>0,D||Se(this,p,m,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4},l.prototype.writeBigInt64LE=Ue(function(p,m=0){return ge(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Ue(function(p,m=0){return Fe(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(b,p,m,D,B,K){if(m+D>b.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Le(b,p,m,D,B){return p=+p,m=m>>>0,B||ye(b,p,m,4),r.write(b,p,m,D,23,4),m+4}l.prototype.writeFloatLE=function(p,m,D){return Le(this,p,m,!0,D)},l.prototype.writeFloatBE=function(p,m,D){return Le(this,p,m,!1,D)};function X(b,p,m,D,B){return p=+p,m=m>>>0,B||ye(b,p,m,8),r.write(b,p,m,D,52,8),m+8}l.prototype.writeDoubleLE=function(p,m,D){return X(this,p,m,!0,D)},l.prototype.writeDoubleBE=function(p,m,D){return X(this,p,m,!1,D)},l.prototype.copy=function(p,m,D,B){if(!l.isBuffer(p))throw new TypeError("argument should be a Buffer");if(D||(D=0),!B&&B!==0&&(B=this.length),m>=p.length&&(m=p.length),m||(m=0),B>0&&B<D&&(B=D),B===D||p.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(D<0||D>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),p.length-m<B-D&&(B=p.length-m+D);const K=B-D;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,D,B):Uint8Array.prototype.set.call(p,this.subarray(D,B),m),K},l.prototype.fill=function(p,m,D,B){if(typeof p=="string"){if(typeof m=="string"?(B=m,m=0,D=this.length):typeof D=="string"&&(B=D,D=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!l.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(p.length===1){const Q=p.charCodeAt(0);(B==="utf8"&&Q<128||B==="latin1")&&(p=Q)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(m<0||this.length<m||this.length<D)throw new RangeError("Out of range index");if(D<=m)return this;m=m>>>0,D=D===void 0?this.length:D>>>0,p||(p=0);let K;if(typeof p=="number")for(K=m;K<D;++K)this[K]=p;else{const Q=l.isBuffer(p)?p:l.from(p,B),Ee=Q.length;if(Ee===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(K=0;K<D-m;++K)this[K+m]=Q[K%Ee]}return this};const Y={};function W(b,p,m){Y[b]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${b}]`,this.stack,delete this.name}get code(){return b}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${b}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(b,p){return`The "${b}" argument must be of type number. Received type ${typeof p}`},TypeError),W("ERR_OUT_OF_RANGE",function(b,p,m){let D=`The value of "${b}" is out of range.`,B=m;return Number.isInteger(m)&&Math.abs(m)>2**32?B=w(String(m)):typeof m=="bigint"&&(B=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(B=w(B)),B+="n"),D+=` It must be ${p}. Received ${B}`,D},RangeError);function w(b){let p="",m=b.length;const D=b[0]==="-"?1:0;for(;m>=D+4;m-=3)p=`_${b.slice(m-3,m)}${p}`;return`${b.slice(0,m)}${p}`}function F(b,p,m){ve(p,"offset"),(b[p]===void 0||b[p+m]===void 0)&&Me(p,b.length-(m+1))}function we(b,p,m,D,B,K){if(b>m||b<p){const Q=typeof p=="bigint"?"n":"";let Ee;throw K>3?p===0||p===BigInt(0)?Ee=`>= 0${Q} and < 2${Q} ** ${(K+1)*8}${Q}`:Ee=`>= -(2${Q} ** ${(K+1)*8-1}${Q}) and < 2 ** ${(K+1)*8-1}${Q}`:Ee=`>= ${p}${Q} and <= ${m}${Q}`,new Y.ERR_OUT_OF_RANGE("value",Ee,b)}F(D,B,K)}function ve(b,p){if(typeof b!="number")throw new Y.ERR_INVALID_ARG_TYPE(p,"number",b)}function Me(b,p,m){throw Math.floor(b)!==b?(ve(b,m),new Y.ERR_OUT_OF_RANGE(m||"offset","an integer",b)):p<0?new Y.ERR_BUFFER_OUT_OF_BOUNDS:new Y.ERR_OUT_OF_RANGE(m||"offset",`>= ${m?1:0} and <= ${p}`,b)}const nt=/[^+/0-9A-Za-z-_]/g;function at(b){if(b=b.split("=")[0],b=b.trim().replace(nt,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function Ge(b,p){p=p||1/0;let m;const D=b.length;let B=null;const K=[];for(let Q=0;Q<D;++Q){if(m=b.charCodeAt(Q),m>55295&&m<57344){if(!B){if(m>56319){(p-=3)>-1&&K.push(239,191,189);continue}else if(Q+1===D){(p-=3)>-1&&K.push(239,191,189);continue}B=m;continue}if(m<56320){(p-=3)>-1&&K.push(239,191,189),B=m;continue}m=(B-55296<<10|m-56320)+65536}else B&&(p-=3)>-1&&K.push(239,191,189);if(B=null,m<128){if((p-=1)<0)break;K.push(m)}else if(m<2048){if((p-=2)<0)break;K.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;K.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;K.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return K}function Dt(b){const p=[];for(let m=0;m<b.length;++m)p.push(b.charCodeAt(m)&255);return p}function $t(b,p){let m,D,B;const K=[];for(let Q=0;Q<b.length&&!((p-=2)<0);++Q)m=b.charCodeAt(Q),D=m>>8,B=m%256,K.push(B),K.push(D);return K}function Je(b){return e.toByteArray(at(b))}function He(b,p,m,D){let B;for(B=0;B<D&&!(B+m>=p.length||B>=b.length);++B)p[B+m]=b[B];return B}function Be(b,p){return b instanceof p||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===p.name}function Ke(b){return b!==b}const rt=function(){const b="0123456789abcdef",p=new Array(256);for(let m=0;m<16;++m){const D=m*16;for(let B=0;B<16;++B)p[D+B]=b[m]+b[B]}return p}();function Ue(b){return typeof BigInt>"u"?Ze:b}function Ze(){throw new Error("BigInt not supported")}})(Rg);let Oh;const Nt={ethereumClient:void 0,setEthereumClient(t){Oh=t},client(){if(Oh)return Oh;throw new Error("ClientCtrl has no client set")}},mr=Rn({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),tt={state:mr,subscribe(t){return Kn(mr,()=>t(mr))},push(t,e){t!==mr.view&&(mr.view=t,e&&(mr.data=e),mr.history.push(t))},reset(t){mr.view=t,mr.history=[t]},replace(t){mr.history.length>1&&(mr.history[mr.history.length-1]=t,mr.view=t)},goBack(){if(mr.history.length>1){mr.history.pop();const[t]=mr.history.slice(-1);mr.view=t}},setData(t){mr.data=t}},Ie={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",W3M_PREFER_INJECTED_URL_FLAG:"w3mPreferInjected",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Ie.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Ie.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Ie.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(!Ie.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;t.endsWith("/")&&(n=t.slice(0,-1)),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}/wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(Ie.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Ie.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Ie.WALLETCONNECT_DEEPLINK_CHOICE)},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(Ie.W3M_VERSION,"2.4.1")},getWalletRouterData(){var t;const e=(t=tt.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e},getSwitchNetworkRouterData(){var t;const e=(t=tt.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error('Missing "SwitchNetwork" view data');return e},isPreferInjectedFlag(){return typeof location<"u"?new URLSearchParams(location.search).has(Ie.W3M_PREFER_INJECTED_URL_FLAG):!1}},gx=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Or=Rn({enabled:gx,userSessionId:"",events:[],connectedWalletId:void 0}),gi={state:Or,subscribe(t){return Kn(Or.events,()=>t(ox(Or.events[Or.events.length-1])))},initialize(){Or.enabled&&typeof crypto<"u"&&(Or.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Or.connectedWalletId=t},click(t){if(Or.enabled){const e={type:"CLICK",name:t.name,userSessionId:Or.userSessionId,timestamp:Date.now(),data:t};Or.events.push(e)}},track(t){if(Or.enabled){const e={type:"TRACK",name:t.name,userSessionId:Or.userSessionId,timestamp:Date.now(),data:t};Or.events.push(e)}},view(t){if(Or.enabled){const e={type:"VIEW",name:t.name,userSessionId:Or.userSessionId,timestamp:Date.now(),data:t};Or.events.push(e)}}},xr=Rn({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,isStandalone:!1,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,isPreferInjected:!1,walletConnectVersion:1}),De={state:xr,subscribe(t){return Kn(xr,()=>t(xr))},setChains(t){xr.chains=t},setStandaloneChains(t){xr.standaloneChains=t},setStandaloneUri(t){xr.standaloneUri=t},getSelectedChain(){const t=Nt.client().getNetwork().chain;return t&&(xr.selectedChain=t),xr.selectedChain},setSelectedChain(t){xr.selectedChain=t},setIsStandalone(t){xr.isStandalone=t},setIsCustomDesktop(t){xr.isCustomDesktop=t},setIsCustomMobile(t){xr.isCustomMobile=t},setIsDataLoaded(t){xr.isDataLoaded=t},setIsUiLoaded(t){xr.isUiLoaded=t},setWalletConnectVersion(t){xr.walletConnectVersion=t},setIsPreferInjected(t){xr.isPreferInjected=t},setIsAuth(t){xr.isAuth=t}},dc=Rn({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,tokenContracts:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableAuthMode:!1,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),jt={state:dc,subscribe(t){return Kn(dc,()=>t(dc))},setConfig(t){var e,r,n,i;gi.initialize(),De.setStandaloneChains(t.standaloneChains),De.setIsStandalone(!!((e=t.standaloneChains)!=null&&e.length)||!!t.enableStandaloneMode),De.setIsAuth(!!t.enableAuthMode),De.setIsCustomMobile(!!((r=t.mobileWallets)!=null&&r.length)),De.setIsCustomDesktop(!!((n=t.desktopWallets)!=null&&n.length)),De.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),De.state.isStandalone||(De.setChains(Nt.client().chains),De.setIsPreferInjected(Nt.client().isInjectedProviderInstalled()&&Ie.isPreferInjectedFlag())),t.defaultChain&&De.setSelectedChain(t.defaultChain),Ie.setWeb3ModalVersionInStorage(),Object.assign(dc,t)}},kt=Rn({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),Et={state:kt,subscribe(t){return Kn(kt,()=>t(kt))},getAccount(){const t=Nt.client().getAccount();kt.address=t.address,kt.isConnected=t.isConnected},async fetchProfile(t,e){var r;try{kt.profileLoading=!0;const n=e??kt.address,i=(r=De.state.chains)==null?void 0:r.find(o=>o.id===1);if(n&&i){const o=await Nt.client().fetchEnsName({address:n,chainId:1});if(o){const c=await Nt.client().fetchEnsAvatar({name:o,chainId:1});c&&await t(c),kt.profileAvatar=c}kt.profileName=o}}finally{kt.profileLoading=!1}},async fetchBalance(t){try{const{chain:e}=Nt.client().getNetwork(),{tokenContracts:r}=jt.state;let n;e&&r&&(n=r[e.id]),kt.balanceLoading=!0;const i=t??kt.address;if(i){const o=await Nt.client().fetchBalance({address:i,token:n});kt.balance={amount:o.formatted,symbol:o.symbol}}}finally{kt.balanceLoading=!1}},setAddress(t){kt.address=t},setIsConnected(t){kt.isConnected=t},resetBalance(){kt.balance=void 0},resetAccount(){kt.address=void 0,kt.isConnected=!1,kt.profileName=void 0,kt.profileAvatar=void 0,kt.balance=void 0}},Ah="https://explorer-api.walletconnect.com";async function pc(t,e){const r=new URL(t,Ah);return r.searchParams.append("projectId",jt.state.projectId),Object.entries(e).forEach(([n,i])=>{i&&r.searchParams.append(n,String(i))}),(await fetch(r)).json()}const mi={async getDesktopListings(t){return pc("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return pc("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return pc("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return pc("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${Ah}/w3m/v1/getWalletImage/${t}?projectId=${jt.state.projectId}`},getAssetImageUrl(t){return`${Ah}/w3m/v1/getAssetImage/${t}?projectId=${jt.state.projectId}`}};var mx=Object.defineProperty,Lg=Object.getOwnPropertySymbols,wx=Object.prototype.hasOwnProperty,vx=Object.prototype.propertyIsEnumerable,Mg=(t,e,r)=>e in t?mx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yx=(t,e)=>{for(var r in e||(e={}))wx.call(e,r)&&Mg(t,r,e[r]);if(Lg)for(var r of Lg(e))vx.call(e,r)&&Mg(t,r,e[r]);return t};const Ug=Ie.isMobile(),un=Rn({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),nr={state:un,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=jt.state;if(t==="NONE"||e==="ALL"&&!t)return un.recomendedWallets;if(Ie.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await mi.getAllListings(r),i=Object.values(n);i.sort((o,c)=>{const l=t.indexOf(o.id),h=t.indexOf(c.id);return l-h}),un.recomendedWallets=i}else{const{standaloneChains:r,walletConnectVersion:n,isAuth:i}=De.state,o=r?.join(","),c=Ie.isArray(e),l={page:1,sdks:i?"auth_v1":void 0,entries:Ie.RECOMMENDED_WALLET_AMOUNT,chains:o,version:n,excludedIds:c?e.join(","):void 0},{listings:h}=Ug?await mi.getMobileListings(l):await mi.getDesktopListings(l);un.recomendedWallets=Object.values(h)}return un.recomendedWallets},async getWallets(t){const e=yx({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=jt.state,{recomendedWallets:i}=un;if(n==="ALL")return un.wallets;e.search||(i.length?e.excludedIds=i.map(E=>E.id).join(","):Ie.isArray(r)&&(e.excludedIds=r.join(","))),Ie.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),De.state.isAuth&&(e.sdks="auth_v1");const{page:o,search:c}=t,{listings:l,total:h}=Ug?await mi.getMobileListings(e):await mi.getDesktopListings(e),d=Object.values(l),v=c?"search":"wallets";return un[v]={listings:[...un[v].listings,...d],total:h,page:o??1},{listings:d,total:h}},async getInjectedWallets(){const{listings:t}=await mi.getInjectedListings({}),e=Object.values(t);return un.injectedWallets=e,un.injectedWallets},getWalletImageUrl(t){return mi.getWalletImageUrl(t)},getAssetImageUrl(t){return mi.getAssetImageUrl(t)},resetSearch(){un.search={listings:[],total:0,page:1}}},qo=Rn({pairingUri:"",pairingError:!1}),hr={state:qo,subscribe(t){return Kn(qo,()=>t(qo))},setPairingUri(t){qo.pairingUri=t},setPairingError(t){qo.pairingError=t}},Ts=Rn({open:!1}),Nr={state:Ts,subscribe(t){return Kn(Ts,()=>t(Ts))},async open(t){return new Promise(e=>{const{isStandalone:r,isUiLoaded:n,isDataLoaded:i,isPreferInjected:o,selectedChain:c}=De.state,{pairingUri:l}=hr.state,{isConnected:h}=Et.state,{enableNetworkView:d}=jt.state;if(r)De.setStandaloneUri(t?.uri),De.setStandaloneChains(t?.standaloneChains),tt.reset("ConnectWallet");else if(t!=null&&t.route)tt.reset(t.route);else if(h)tt.reset("Account");else if(d)tt.reset("SelectNetwork");else if(o){Nt.client().connectConnector("injected",c?.id).catch(v=>console.error(v)),e();return}else tt.reset("ConnectWallet");if(n&&i&&(r||l||h))Ts.open=!0,e();else{const v=setInterval(()=>{const E=De.state,_=hr.state;E.isUiLoaded&&E.isDataLoaded&&(E.isStandalone||_.pairingUri||h)&&(clearInterval(v),Ts.open=!0,e())},200)}})},close(){Ts.open=!1}};var bx=Object.defineProperty,jg=Object.getOwnPropertySymbols,_x=Object.prototype.hasOwnProperty,Ex=Object.prototype.propertyIsEnumerable,Fg=(t,e,r)=>e in t?bx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xx=(t,e)=>{for(var r in e||(e={}))_x.call(e,r)&&Fg(t,r,e[r]);if(jg)for(var r of jg(e))Ex.call(e,r)&&Fg(t,r,e[r]);return t};function Cx(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Vo=Rn({themeMode:Cx()?"dark":"light"}),Ln={state:Vo,subscribe(t){return Kn(Vo,()=>t(Vo))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(Vo.themeMode=e),r&&(Vo.themeVariables=xx({},r))}},Ki=Rn({open:!1,message:"",variant:"success"}),Wr={state:Ki,subscribe(t){return Kn(Ki,()=>t(Ki))},openToast(t,e){Ki.open=!0,Ki.message=t,Ki.variant=e},closeToast(){Ki.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=Rg.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var Ix=Object.defineProperty,Bg=Object.getOwnPropertySymbols,Ox=Object.prototype.hasOwnProperty,Ax=Object.prototype.propertyIsEnumerable,kg=(t,e,r)=>e in t?Ix(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sx=(t,e)=>{for(var r in e||(e={}))Ox.call(e,r)&&kg(t,r,e[r]);if(Bg)for(var r of Bg(e))Ax.call(e,r)&&kg(t,r,e[r]);return t};class Dx{constructor(e){this.openModal=Nr.open,this.closeModal=Nr.close,this.subscribeModal=Nr.subscribe,this.setTheme=Ln.setThemeConfig,Ln.setThemeConfig(e),jt.setConfig(Sx({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return iS});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),De.setIsUiLoaded(!0)}}}var $x=Object.freeze({__proto__:null,Web3Modal:Dx});/**
|
|
104
104
|
* @license
|
|
105
105
|
* Copyright 2019 Google LLC
|
|
106
106
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
107
|
-
*/const
|
|
107
|
+
*/const gc=window,Sh=gc.ShadowRoot&&(gc.ShadyCSS===void 0||gc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dh=Symbol(),Hg=new WeakMap;class zg{constructor(e,r,n){if(this._$cssResult$=!0,n!==Dh)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(Sh&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=Hg.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Hg.set(r,e))}return e}toString(){return this.cssText}}const Px=t=>new zg(typeof t=="string"?t:t+"",void 0,Dh),Ve=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,o)=>n+(c=>{if(c._$cssResult$===!0)return c.cssText;if(typeof c=="number")return c;throw Error("Value passed to 'css' function must be a 'css' function result: "+c+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new zg(r,t,Dh)},Tx=(t,e)=>{Sh?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=gc.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},Wg=Sh?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return Px(r)})(t):t;/**
|
|
108
108
|
* @license
|
|
109
109
|
* Copyright 2017 Google LLC
|
|
110
110
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
111
|
-
*/var
|
|
111
|
+
*/var $h;const mc=window,qg=mc.trustedTypes,Rx=qg?qg.emptyScript:"",Vg=mc.reactiveElementPolyfillSupport,Ph={toAttribute(t,e){switch(e){case Boolean:t=t?Rx: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}},Kg=(t,e)=>e!==t&&(e==e||t==t),Th={attribute:!0,type:String,converter:Ph,reflect:!1,hasChanged:Kg};class Rs 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=Th){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 o=this[e];this[r]=i,this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Th}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(Wg(i))}else e!==void 0&&r.push(Wg(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 Tx(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=Th){var i;const o=this.constructor._$Ep(e,n);if(o!==void 0&&n.reflect===!0){const c=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:Ph).toAttribute(r,n.type);this._$El=e,c==null?this.removeAttribute(o):this.setAttribute(o,c),this._$El=null}}_$AK(e,r){var n;const i=this.constructor,o=i._$Ev.get(e);if(o!==void 0&&this._$El!==o){const c=i.getPropertyOptions(o),l=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?c.converter:Ph;this._$El=o,this[o]=l.fromAttribute(r,c.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Kg)(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,o)=>this[o]=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 o;return(o=i.hostUpdate)===null||o===void 0?void 0:o.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){}}Rs.finalized=!0,Rs.elementProperties=new Map,Rs.elementStyles=[],Rs.shadowRootOptions={mode:"open"},Vg?.({ReactiveElement:Rs}),(($h=mc.reactiveElementVersions)!==null&&$h!==void 0?$h:mc.reactiveElementVersions=[]).push("1.6.1");/**
|
|
112
112
|
* @license
|
|
113
113
|
* Copyright 2017 Google LLC
|
|
114
114
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
115
|
-
*/var
|
|
116
|
-
\f\r]`,
|
|
117
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
115
|
+
*/var Rh;const wc=window,Ns=wc.trustedTypes,Gg=Ns?Ns.createPolicy("lit-html",{createHTML:t=>t}):void 0,Nh="$lit$",wi=`lit$${(Math.random()+"").slice(9)}$`,Zg="?"+wi,Nx=`<${Zg}>`,Gi=document,Ko=()=>Gi.createComment(""),Go=t=>t===null||typeof t!="object"&&typeof t!="function",Yg=Array.isArray,Lx=t=>Yg(t)||typeof t?.[Symbol.iterator]=="function",Lh=`[
|
|
116
|
+
\f\r]`,Zo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Jg=/-->/g,Xg=/>/g,Zi=RegExp(`>|${Lh}(?:([^\\s"'>=/]+)(${Lh}*=${Lh}*(?:[^
|
|
117
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Qg=/'/g,e3=/"/g,t3=/^(?:script|style|textarea|title)$/i,r3=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),oe=r3(1),ut=r3(2),Yi=Symbol.for("lit-noChange"),wr=Symbol.for("lit-nothing"),n3=new WeakMap,Ji=Gi.createTreeWalker(Gi,129,null,!1),Mx=(t,e)=>{const r=t.length-1,n=[];let i,o=e===2?"<svg>":"",c=Zo;for(let h=0;h<r;h++){const d=t[h];let v,E,_=-1,A=0;for(;A<d.length&&(c.lastIndex=A,E=c.exec(d),E!==null);)A=c.lastIndex,c===Zo?E[1]==="!--"?c=Jg:E[1]!==void 0?c=Xg:E[2]!==void 0?(t3.test(E[2])&&(i=RegExp("</"+E[2],"g")),c=Zi):E[3]!==void 0&&(c=Zi):c===Zi?E[0]===">"?(c=i??Zo,_=-1):E[1]===void 0?_=-2:(_=c.lastIndex-E[2].length,v=E[1],c=E[3]===void 0?Zi:E[3]==='"'?e3:Qg):c===e3||c===Qg?c=Zi:c===Jg||c===Xg?c=Zo:(c=Zi,i=void 0);const P=c===Zi&&t[h+1].startsWith("/>")?" ":"";o+=c===Zo?d+Nx:_>=0?(n.push(v),d.slice(0,_)+Nh+d.slice(_)+wi+P):d+wi+(_===-2?(n.push(void 0),h):P)}const l=o+(t[r]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[Gg!==void 0?Gg.createHTML(l):l,n]};class Yo{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let o=0,c=0;const l=e.length-1,h=this.parts,[d,v]=Mx(e,r);if(this.el=Yo.createElement(d,n),Ji.currentNode=this.el.content,r===2){const E=this.el.content,_=E.firstChild;_.remove(),E.append(..._.childNodes)}for(;(i=Ji.nextNode())!==null&&h.length<l;){if(i.nodeType===1){if(i.hasAttributes()){const E=[];for(const _ of i.getAttributeNames())if(_.endsWith(Nh)||_.startsWith(wi)){const A=v[c++];if(E.push(_),A!==void 0){const P=i.getAttribute(A.toLowerCase()+Nh).split(wi),U=/([.?@])?(.*)/.exec(A);h.push({type:1,index:o,name:U[2],strings:P,ctor:U[1]==="."?jx:U[1]==="?"?Bx:U[1]==="@"?kx:vc})}else h.push({type:6,index:o})}for(const _ of E)i.removeAttribute(_)}if(t3.test(i.tagName)){const E=i.textContent.split(wi),_=E.length-1;if(_>0){i.textContent=Ns?Ns.emptyScript:"";for(let A=0;A<_;A++)i.append(E[A],Ko()),Ji.nextNode(),h.push({type:2,index:++o});i.append(E[_],Ko())}}}else if(i.nodeType===8)if(i.data===Zg)h.push({type:2,index:o});else{let E=-1;for(;(E=i.data.indexOf(wi,E+1))!==-1;)h.push({type:7,index:o}),E+=wi.length-1}o++}}static createElement(e,r){const n=Gi.createElement("template");return n.innerHTML=e,n}}function Ls(t,e,r=t,n){var i,o,c,l;if(e===Yi)return e;let h=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const d=Go(e)?void 0:e._$litDirective$;return h?.constructor!==d&&((o=h?._$AO)===null||o===void 0||o.call(h,!1),d===void 0?h=void 0:(h=new d(t),h._$AT(t,r,n)),n!==void 0?((c=(l=r)._$Co)!==null&&c!==void 0?c:l._$Co=[])[n]=h:r._$Cl=h),h!==void 0&&(e=Ls(t,h._$AS(t,e.values),h,n)),e}class Ux{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;const{el:{content:n},parts:i}=this._$AD,o=((r=e?.creationScope)!==null&&r!==void 0?r:Gi).importNode(n,!0);Ji.currentNode=o;let c=Ji.nextNode(),l=0,h=0,d=i[0];for(;d!==void 0;){if(l===d.index){let v;d.type===2?v=new Jo(c,c.nextSibling,this,e):d.type===1?v=new d.ctor(c,d.name,d.strings,this,e):d.type===6&&(v=new Hx(c,this,e)),this._$AV.push(v),d=i[++h]}l!==d?.index&&(c=Ji.nextNode(),l++)}return Ji.currentNode=Gi,o}v(e){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class Jo{constructor(e,r,n,i){var o;this.type=2,this._$AH=wr,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(o=i?.isConnected)===null||o===void 0||o}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}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=Ls(this,e,r),Go(e)?e===wr||e==null||e===""?(this._$AH!==wr&&this._$AR(),this._$AH=wr):e!==this._$AH&&e!==Yi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Lx(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==wr&&Go(this._$AH)?this._$AA.nextSibling.data=e:this.$(Gi.createTextNode(e)),this._$AH=e}g(e){var r;const{values:n,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Yo.createElement(i.h,this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===o)this._$AH.v(n);else{const c=new Ux(o,this),l=c.u(this.options);c.v(n),this.$(l),this._$AH=c}}_$AC(e){let r=n3.get(e.strings);return r===void 0&&n3.set(e.strings,r=new Yo(e)),r}T(e){Yg(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const o of e)i===r.length?r.push(n=new Jo(this.k(Ko()),this.k(Ko()),this,this.options)):n=r[i],n._$AI(o),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._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class vc{constructor(e,r,n,i,o){this.type=1,this._$AH=wr,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=wr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){const o=this.strings;let c=!1;if(o===void 0)e=Ls(this,e,r,0),c=!Go(e)||e!==this._$AH&&e!==Yi,c&&(this._$AH=e);else{const l=e;let h,d;for(e=o[0],h=0;h<o.length-1;h++)d=Ls(this,l[n+h],r,h),d===Yi&&(d=this._$AH[h]),c||(c=!Go(d)||d!==this._$AH[h]),d===wr?e=wr:e!==wr&&(e+=(d??"")+o[h+1]),this._$AH[h]=d}c&&!i&&this.j(e)}j(e){e===wr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class jx extends vc{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===wr?void 0:e}}const Fx=Ns?Ns.emptyScript:"";class Bx extends vc{constructor(){super(...arguments),this.type=4}j(e){e&&e!==wr?this.element.setAttribute(this.name,Fx):this.element.removeAttribute(this.name)}}class kx extends vc{constructor(e,r,n,i,o){super(e,r,n,i,o),this.type=5}_$AI(e,r=this){var n;if((e=(n=Ls(this,e,r,0))!==null&&n!==void 0?n:wr)===Yi)return;const i=this._$AH,o=e===wr&&i!==wr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,c=e!==wr&&(i===wr||o);o&&this.element.removeEventListener(this.name,this,i),c&&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 Hx{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){Ls(this,e)}}const i3=wc.litHtmlPolyfillSupport;i3?.(Yo,Jo),((Rh=wc.litHtmlVersions)!==null&&Rh!==void 0?Rh:wc.litHtmlVersions=[]).push("2.7.4");const zx=(t,e,r)=>{var n,i;const o=(n=r?.renderBefore)!==null&&n!==void 0?n:e;let c=o._$litPart$;if(c===void 0){const l=(i=r?.renderBefore)!==null&&i!==void 0?i:null;o._$litPart$=c=new Jo(e.insertBefore(Ko(),l),l,void 0,r??{})}return c._$AI(t),c};/**
|
|
118
118
|
* @license
|
|
119
119
|
* Copyright 2017 Google LLC
|
|
120
120
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
121
|
-
*/var Uh
|
|
121
|
+
*/var Mh,Uh;class $e extends Rs{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=zx(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 Yi}}$e.finalized=!0,$e._$litElement$=!0,(Mh=globalThis.litElementHydrateSupport)===null||Mh===void 0||Mh.call(globalThis,{LitElement:$e});const s3=globalThis.litElementPolyfillSupport;s3?.({LitElement:$e}),((Uh=globalThis.litElementVersions)!==null&&Uh!==void 0?Uh:globalThis.litElementVersions=[]).push("3.3.2");/**
|
|
122
122
|
* @license
|
|
123
123
|
* Copyright 2017 Google LLC
|
|
124
124
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -126,7 +126,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
126
126
|
* @license
|
|
127
127
|
* Copyright 2017 Google LLC
|
|
128
128
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
129
|
-
*/const
|
|
129
|
+
*/const Wx=(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 Ae(t){return(e,r)=>r!==void 0?((n,i,o)=>{i.constructor.createProperty(o,n)})(t,e,r):Wx(t,e)}/**
|
|
130
130
|
* @license
|
|
131
131
|
* Copyright 2017 Google LLC
|
|
132
132
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -134,20 +134,20 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
134
134
|
* @license
|
|
135
135
|
* Copyright 2021 Google LLC
|
|
136
136
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
137
|
-
*/var
|
|
137
|
+
*/var jh;((jh=window.HTMLSlotElement)===null||jh===void 0?void 0:jh.prototype.assignedElements)!=null;/**
|
|
138
138
|
* @license
|
|
139
139
|
* Copyright 2017 Google LLC
|
|
140
140
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
141
|
-
*/const
|
|
141
|
+
*/const qx={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Vx=t=>(...e)=>({_$litDirective$:t,values:e});class Kx{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)}}/**
|
|
142
142
|
* @license
|
|
143
143
|
* Copyright 2018 Google LLC
|
|
144
144
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
145
|
-
*/const Lr=Kx(class extends Gx{constructor(t){var e;if(super(t),t.type!==Vx.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.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.nt)===null||r===void 0)&&r.has(o))&&this.it.add(o);return this.render(e)}const i=t.element.classList;this.it.forEach(o=>{o in e||(i.remove(o),this.it.delete(o))});for(const o in e){const c=!!e[o];c===this.it.has(o)||!((n=this.nt)===null||n===void 0)&&n.has(o)||(c?(i.add(o),this.it.add(o)):(i.remove(o),this.it.delete(o)))}return Ji}});function Zx(t,e){t.indexOf(e)===-1&&t.push(e)}const a3=(t,e,r)=>Math.min(Math.max(r,t),e),hn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},bc=t=>typeof t=="number",Us=t=>Array.isArray(t)&&!bc(t[0]),Yx=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function Jx(t,e){return Us(t)?t[Yx(0,t.length,e)]:t}const c3=(t,e,r)=>-r*t+r*e+t,l3=()=>{},vi=t=>t,Bh=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function u3(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Bh(0,e,n);t.push(c3(r,1,i))}}function Xx(t){const e=[0];return u3(e,t-1),e}function Qx(t,e=Xx(t.length),r=vi){const n=t.length,i=n-e.length;return i>0&&u3(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=a3(0,1,Bh(e[c],e[c+1],o));return l=Jx(r,c)(l),c3(t[c],t[c+1],l)}}const h3=t=>Array.isArray(t)&&bc(t[0]),kh=t=>typeof t=="object"&&Boolean(t.createAnimation),Qi=t=>typeof t=="function",e9=t=>typeof t=="string",Qo={ms:t=>t*1e3,s:t=>t/1e3},f3=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,t9=1e-7,r9=12;function n9(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=f3(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>t9&&++l<r9);return c}function ea(t,e,r,n){if(t===e&&r===n)return vi;const i=o=>n9(o,0,1,t,r);return o=>o===0||o===1?o:f3(i(o),e,n)}const i9=(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 a3(0,1,i/t)},d3={ease:ea(.25,.1,.25,1),"ease-in":ea(.42,0,1,1),"ease-in-out":ea(.42,0,.58,1),"ease-out":ea(0,0,.58,1)},s9=/\((.*?)\)/;function p3(t){if(Qi(t))return t;if(h3(t))return ea(...t);if(d3[t])return d3[t];if(t.startsWith("steps")){const e=s9.exec(t);if(e){const r=e[1].split(",");return i9(parseFloat(r[0]),r[1].trim())}}return vi}class g3{constructor(e,r=[0,1],{easing:n,duration:i=hn.duration,delay:o=hn.delay,endDelay:c=hn.endDelay,repeat:l=hn.repeat,offset:h,direction:d="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=vi,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((E,_)=>{this.resolve=E,this.reject=_}),n=n||hn.easing,kh(n)){const E=n.createAnimation(r);n=E.easing,r=E.keyframes||r,i=E.duration||i}this.repeat=l,this.easing=Us(n)?vi:p3(n),this.updateDuration(i);const v=Qx(r,h,Us(n)?n.map(p3):vi);this.tick=E=>{var _;o=o;let A=0;this.pauseTime!==void 0?A=this.pauseTime:A=(E-this.startTime)*this.rate,this.t=A,A/=1e3,A=Math.max(A-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(A=this.totalDuration);const P=A/this.duration;let U=Math.floor(P),H=P%1;!H&&P>=1&&(H=1),H===1&&U--;const G=U%2;(d==="reverse"||d==="alternate"&&G||d==="alternate-reverse"&&!G)&&(H=1-H);const N=A>=this.totalDuration?1:Math.min(H,1),L=v(this.easing(N));e(L),this.pauseTime===void 0&&(this.playState==="finished"||A>=this.totalDuration+c)?(this.playState="finished",(_=this.resolve)===null||_===void 0||_.call(this,L)):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 Hh=function(){};process.env.NODE_ENV!=="production"&&(Hh=function(t,e){if(!t)throw new Error(e)});class o9{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const zh=new WeakMap;function m3(t){return zh.has(t)||zh.set(t,{transforms:[],values:new Map}),zh.get(t)}function a9(t,e){return t.has(e)||t.set(e,new o9),t.get(e)}const c9=["","X","Y","Z"],l9=["translate","scale","rotate","skew"],_c={x:"translateX",y:"translateY",z:"translateZ"},w3={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},u9={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:w3,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:vi},skew:w3},ta=new Map,Wh=t=>`--motion-${t}`,Ec=["x","y","z"];l9.forEach(t=>{c9.forEach(e=>{Ec.push(t+e),ta.set(Wh(t+e),u9[t])})});const h9=(t,e)=>Ec.indexOf(t)-Ec.indexOf(e),f9=new Set(Ec),v3=t=>f9.has(t),d9=(t,e)=>{_c[e]&&(e=_c[e]);const{transforms:r}=m3(t);Zx(r,e),t.style.transform=p9(r)},p9=t=>t.sort(h9).reduce(g9,"").trim(),g9=(t,e)=>`${t} ${e}(var(${Wh(e)}))`,qh=t=>t.startsWith("--"),y3=new Set;function m9(t){if(!y3.has(t)){y3.add(t);try{const{syntax:e,initialValue:r}=ta.has(t)?ta.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const Vh=(t,e)=>document.createElement("div").animate(t,e),b3={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Vh({opacity:[1]})}catch{return!1}return!0},finished:()=>Boolean(Vh({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{Vh({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Kh={},js={};for(const t in b3)js[t]=()=>(Kh[t]===void 0&&(Kh[t]=b3[t]()),Kh[t]);const w9=.015,v9=(t,e)=>{let r="";const n=Math.round(e/w9);for(let i=0;i<n;i++)r+=t(Bh(0,n-1,i))+", ";return r.substring(0,r.length-2)},_3=(t,e)=>Qi(t)?js.linearEasing()?`linear(${v9(t,e)})`:hn.easing:h3(t)?y9(t):t,y9=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function b9(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const _9=t=>Array.isArray(t)?t:[t];function Gh(t){return _c[t]&&(t=_c[t]),v3(t)?Wh(t):t}const xc={get:(t,e)=>{e=Gh(e);let r=qh(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=ta.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=Gh(e),qh(e)?t.style.setProperty(e,r):t.style[e]=r}};function E3(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function E9(t,e){var r;let n=e?.toDefaultUnit||vi;const i=t[t.length-1];if(e9(i)){const o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=c=>c+o)}return n}function x9(){return window.__MOTION_DEV_TOOLS_RECORD}function C9(t,e,r,n={},i){const o=x9(),c=n.record!==!1&&o;let l,{duration:h=hn.duration,delay:d=hn.delay,endDelay:v=hn.endDelay,repeat:E=hn.repeat,easing:_=hn.easing,persist:A=!1,direction:P,offset:U,allowWebkitAcceleration:H=!1}=n;const G=m3(t),N=v3(e);let L=js.waapi();N&&d9(t,e);const $=Gh(e),T=a9(G.values,$),I=ta.get($);return E3(T.animation,!(kh(_)&&T.generator)&&n.record!==!1),()=>{const f=()=>{var z,ee;return(ee=(z=xc.get(t,$))!==null&&z!==void 0?z:I?.initialValue)!==null&&ee!==void 0?ee:0};let x=b9(_9(r),f);const J=E9(x,I);if(kh(_)){const z=_.createAnimation(x,e!=="opacity",f,$,T);_=z.easing,x=z.keyframes||x,h=z.duration||h}if(qh($)&&(js.cssRegisterProperty()?m9($):L=!1),N&&!js.linearEasing()&&(Qi(_)||Us(_)&&_.some(Qi))&&(L=!1),L){I&&(x=x.map(de=>bc(de)?I.toDefaultUnit(de):de)),x.length===1&&(!js.partialKeyframes()||c)&&x.unshift(f());const z={delay:Qo.ms(d),duration:Qo.ms(h),endDelay:Qo.ms(v),easing:Us(_)?void 0:_3(_,h),direction:P,iterations:E+1,fill:"both"};l=t.animate({[$]:x,offset:U,easing:Us(_)?_.map(de=>_3(de,h)):void 0},z),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=x[x.length-1];l.finished.then(()=>{A||(xc.set(t,$,ee),l.cancel())}).catch(l3),H||(l.playbackRate=1.000001)}else if(i&&N)x=x.map(z=>typeof z=="string"?parseFloat(z):z),x.length===1&&x.unshift(parseFloat(f())),l=new i(z=>{xc.set(t,$,J?J(z):z)},x,Object.assign(Object.assign({},n),{duration:h,easing:_}));else{const z=x[x.length-1];xc.set(t,$,I&&bc(z)?I.toDefaultUnit(z):z)}return c&&o(t,e,x,{duration:h,delay:d,easing:_,repeat:E,offset:U},"motion-one"),T.setAnimation(l),l}}const I9=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function x3(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 O9=t=>t(),C3=(t,e,r=hn.duration)=>new Proxy({animations:t.map(O9).filter(Boolean),duration:r,options:e},S9),A9=t=>t.animations[0],S9={get:(t,e)=>{const r=A9(t);switch(e){case"duration":return t.duration;case"currentTime":return Qo.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(D9)).catch(l3)),t.finished;case"stop":return()=>{t.animations.forEach(n=>E3(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=Qo.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},D9=t=>t.finished;function $9(t,e,r){return Qi(t)?t(e,r):t}function P9(t){return function(r,n,i={}){r=x3(r);const o=r.length;Hh(Boolean(o),"No valid element provided."),Hh(Boolean(n),"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const h=r[l];for(const d in n){const v=I9(i,d);v.delay=$9(v.delay,l,o);const E=C9(h,d,n[d],v,t);c.push(E)}}return C3(c,i,i.duration)}}const T9=P9(g3);function R9(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 N9={any:0,all:1};function L9(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=x3(t),c=new WeakMap,l=d=>{d.forEach(v=>{const E=c.get(v.target);if(v.isIntersecting!==Boolean(E))if(v.isIntersecting){const _=e(v);Qi(_)?c.set(v.target,_):h.unobserve(v.target)}else E&&(E(v),c.delete(v.target))})},h=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:N9[i]});return o.forEach(d=>h.observe(d)),()=>h.disconnect()}function Zh(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function I3(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const M9={isActive:t=>Boolean(t.inView),subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=R9(n,["once"]);return L9(t,c=>{if(e(),I3(t,"viewenter",c),!i)return l=>{r(),I3(t,"viewleave",l)}},o)}},O3=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),Zh(t,e,n))};[...Object.keys({inView:M9,hover:{isActive:t=>Boolean(t.hover),subscribe:(t,{enable:e,disable:r})=>{const n=O3(t,"hoverstart",e),i=O3(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=o=>{r(),Zh(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),Zh(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function U9(t,e={}){return C3([()=>{const r=new g3(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function es(t,e,r){return(Qi(t)?U9:T9)(t,e,r)}var ra={},j9=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},A3={},Jr={};let Yh;const F9=[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];Jr.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},Jr.getSymbolTotalCodewords=function(e){return F9[e]},Jr.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},Jr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Yh=e},Jr.isKanjiModeEnabled=function(){return typeof Yh<"u"},Jr.toSJIS=function(e){return Yh(e)};var Cc={};(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}}})(Cc);function S3(){this.buffer=[],this.length=0}S3.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 B9=S3;function na(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)}na.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},na.prototype.get=function(t,e){return this.data[t*this.size+e]},na.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},na.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var k9=na,D3={};(function(t){const e=Jr.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,o=e(n),c=o===145?26:Math.ceil((o-13)/(2*i-2))*2,l=[o-7];for(let h=1;h<i-1;h++)l[h]=l[h-1]-c;return l.push(6),l.reverse()},t.getPositions=function(n){const i=[],o=t.getRowColCoords(n),c=o.length;for(let l=0;l<c;l++)for(let h=0;h<c;h++)l===0&&h===0||l===0&&h===c-1||l===c-1&&h===0||i.push([o[l],o[h]]);return i}})(D3);var $3={};const H9=Jr.getSymbolSize,P3=7;$3.getPositions=function(e){const r=H9(e);return[[0,0],[r-P3,0],[0,r-P3]]};var T3={};(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 o=i.size;let c=0,l=0,h=0,d=null,v=null;for(let E=0;E<o;E++){l=h=0,d=v=null;for(let _=0;_<o;_++){let A=i.get(E,_);A===d?l++:(l>=5&&(c+=e.N1+(l-5)),d=A,l=1),A=i.get(_,E),A===v?h++:(h>=5&&(c+=e.N1+(h-5)),v=A,h=1)}l>=5&&(c+=e.N1+(l-5)),h>=5&&(c+=e.N1+(h-5))}return c},t.getPenaltyN2=function(i){const o=i.size;let c=0;for(let l=0;l<o-1;l++)for(let h=0;h<o-1;h++){const d=i.get(l,h)+i.get(l,h+1)+i.get(l+1,h)+i.get(l+1,h+1);(d===4||d===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,h=0;for(let d=0;d<o;d++){l=h=0;for(let v=0;v<o;v++)l=l<<1&2047|i.get(d,v),v>=10&&(l===1488||l===93)&&c++,h=h<<1&2047|i.get(v,d),v>=10&&(h===1488||h===93)&&c++}return c*e.N3},t.getPenaltyN4=function(i){let o=0;const c=i.data.length;for(let h=0;h<c;h++)o+=i.data[h];return Math.abs(Math.ceil(o*100/c/5)-10)*e.N4};function r(n,i,o){switch(n){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,o){const c=o.size;for(let l=0;l<c;l++)for(let h=0;h<c;h++)o.isReserved(h,l)||o.xor(h,l,r(i,h,l))},t.getBestMask=function(i,o){const c=Object.keys(t.Patterns).length;let l=0,h=1/0;for(let d=0;d<c;d++){o(d),t.applyMask(d,i);const v=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(d,i),v<h&&(h=v,l=d)}return l}})(T3);var Ic={};const yi=Cc,Oc=[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],Ac=[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];Ic.getBlocksCount=function(e,r){switch(r){case yi.L:return Oc[(e-1)*4+0];case yi.M:return Oc[(e-1)*4+1];case yi.Q:return Oc[(e-1)*4+2];case yi.H:return Oc[(e-1)*4+3];default:return}},Ic.getTotalCodewordsCount=function(e,r){switch(r){case yi.L:return Ac[(e-1)*4+0];case yi.M:return Ac[(e-1)*4+1];case yi.Q:return Ac[(e-1)*4+2];case yi.H:return Ac[(e-1)*4+3];default:return}};var R3={},Sc={};const ia=new Uint8Array(512),Dc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ia[r]=e,Dc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ia[r]=ia[r-255]})(),Sc.log=function(e){if(e<1)throw new Error("log("+e+")");return Dc[e]},Sc.exp=function(e){return ia[e]},Sc.mul=function(e,r){return e===0||r===0?0:ia[Dc[e]+Dc[r]]},function(t){const e=Sc;t.mul=function(n,i){const o=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let l=0;l<i.length;l++)o[c+l]^=e.mul(n[c],i[l]);return o},t.mod=function(n,i){let o=new Uint8Array(n);for(;o.length-i.length>=0;){const c=o[0];for(let h=0;h<i.length;h++)o[h]^=e.mul(i[h],c);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let o=0;o<n;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}(R3);const N3=R3;function Jh(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Jh.prototype.initialize=function(e){this.degree=e,this.genPoly=N3.generateECPolynomial(this.degree)},Jh.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=N3.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(n,i),o}return n};var z9=Jh,L3={},bi={},Xh={};Xh.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Mn={};const M3="[0-9]+",W9="[A-Z $%*+\\-./:]+";let sa="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";sa=sa.replace(/u/g,"\\u");const q9="(?:(?![A-Z0-9 $%*+\\-./:]|"+sa+`)(?:.|[\r
|
|
146
|
-
]))+`;Mn.KANJI=new RegExp(
|
|
147
|
-
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var
|
|
148
|
-
Suggested mode is: `+e.toString($));switch(L===e.KANJI&&!l.isKanjiModeEnabled()&&(L=e.BYTE),L){case e.NUMERIC:return new r(G);case e.ALPHANUMERIC:return new n(G);case e.KANJI:return new o(G);case e.BYTE:return new i(G)}}t.fromArray=function(N){return N.reduce(function(L,$){return typeof $=="string"?L.push(H($,null)):$.data&&L.push(H($.data,$.mode)),L},[])},t.fromString=function(N,L){const $=E(N,l.isKanjiModeEnabled()),T=P($),I=U(T,L),f=h.find_path(I.map,"start","end"),x=[];for(let J=1;J<f.length-1;J++)x.push(I.table[f[J]].node);return t.fromArray(A(x))},t.rawSplit=function(N){return t.fromArray(E(N,l.isKanjiModeEnabled()))}}(
|
|
145
|
+
*/const Lr=Vx(class extends Kx{constructor(t){var e;if(super(t),t.type!==qx.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.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.nt)===null||r===void 0)&&r.has(o))&&this.it.add(o);return this.render(e)}const i=t.element.classList;this.it.forEach(o=>{o in e||(i.remove(o),this.it.delete(o))});for(const o in e){const c=!!e[o];c===this.it.has(o)||!((n=this.nt)===null||n===void 0)&&n.has(o)||(c?(i.add(o),this.it.add(o)):(i.remove(o),this.it.delete(o)))}return Yi}});function Gx(t,e){t.indexOf(e)===-1&&t.push(e)}const o3=(t,e,r)=>Math.min(Math.max(r,t),e),hn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},yc=t=>typeof t=="number",Ms=t=>Array.isArray(t)&&!yc(t[0]),Zx=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function Yx(t,e){return Ms(t)?t[Zx(0,t.length,e)]:t}const a3=(t,e,r)=>-r*t+r*e+t,c3=()=>{},vi=t=>t,Fh=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function l3(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Fh(0,e,n);t.push(a3(r,1,i))}}function Jx(t){const e=[0];return l3(e,t-1),e}function Xx(t,e=Jx(t.length),r=vi){const n=t.length,i=n-e.length;return i>0&&l3(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=o3(0,1,Fh(e[c],e[c+1],o));return l=Yx(r,c)(l),a3(t[c],t[c+1],l)}}const u3=t=>Array.isArray(t)&&yc(t[0]),Bh=t=>typeof t=="object"&&!!t.createAnimation,Xi=t=>typeof t=="function",Qx=t=>typeof t=="string",Xo={ms:t=>t*1e3,s:t=>t/1e3},h3=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,e9=1e-7,t9=12;function r9(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=h3(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>e9&&++l<t9);return c}function Qo(t,e,r,n){if(t===e&&r===n)return vi;const i=o=>r9(o,0,1,t,r);return o=>o===0||o===1?o:h3(i(o),e,n)}const n9=(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 o3(0,1,i/t)},f3={ease:Qo(.25,.1,.25,1),"ease-in":Qo(.42,0,1,1),"ease-in-out":Qo(.42,0,.58,1),"ease-out":Qo(0,0,.58,1)},i9=/\((.*?)\)/;function d3(t){if(Xi(t))return t;if(u3(t))return Qo(...t);if(f3[t])return f3[t];if(t.startsWith("steps")){const e=i9.exec(t);if(e){const r=e[1].split(",");return n9(parseFloat(r[0]),r[1].trim())}}return vi}class p3{constructor(e,r=[0,1],{easing:n,duration:i=hn.duration,delay:o=hn.delay,endDelay:c=hn.endDelay,repeat:l=hn.repeat,offset:h,direction:d="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=vi,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((E,_)=>{this.resolve=E,this.reject=_}),n=n||hn.easing,Bh(n)){const E=n.createAnimation(r);n=E.easing,r=E.keyframes||r,i=E.duration||i}this.repeat=l,this.easing=Ms(n)?vi:d3(n),this.updateDuration(i);const v=Xx(r,h,Ms(n)?n.map(d3):vi);this.tick=E=>{var _;o=o;let A=0;this.pauseTime!==void 0?A=this.pauseTime:A=(E-this.startTime)*this.rate,this.t=A,A/=1e3,A=Math.max(A-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(A=this.totalDuration);const P=A/this.duration;let U=Math.floor(P),H=P%1;!H&&P>=1&&(H=1),H===1&&U--;const G=U%2;(d==="reverse"||d==="alternate"&&G||d==="alternate-reverse"&&!G)&&(H=1-H);const N=A>=this.totalDuration?1:Math.min(H,1),L=v(this.easing(N));e(L),this.pauseTime===void 0&&(this.playState==="finished"||A>=this.totalDuration+c)?(this.playState="finished",(_=this.resolve)===null||_===void 0||_.call(this,L)):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 kh=function(){};process.env.NODE_ENV!=="production"&&(kh=function(t,e){if(!t)throw new Error(e)});class s9{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Hh=new WeakMap;function g3(t){return Hh.has(t)||Hh.set(t,{transforms:[],values:new Map}),Hh.get(t)}function o9(t,e){return t.has(e)||t.set(e,new s9),t.get(e)}const a9=["","X","Y","Z"],c9=["translate","scale","rotate","skew"],bc={x:"translateX",y:"translateY",z:"translateZ"},m3={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},l9={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:m3,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:vi},skew:m3},ea=new Map,zh=t=>`--motion-${t}`,_c=["x","y","z"];c9.forEach(t=>{a9.forEach(e=>{_c.push(t+e),ea.set(zh(t+e),l9[t])})});const u9=(t,e)=>_c.indexOf(t)-_c.indexOf(e),h9=new Set(_c),w3=t=>h9.has(t),f9=(t,e)=>{bc[e]&&(e=bc[e]);const{transforms:r}=g3(t);Gx(r,e),t.style.transform=d9(r)},d9=t=>t.sort(u9).reduce(p9,"").trim(),p9=(t,e)=>`${t} ${e}(var(${zh(e)}))`,Wh=t=>t.startsWith("--"),v3=new Set;function g9(t){if(!v3.has(t)){v3.add(t);try{const{syntax:e,initialValue:r}=ea.has(t)?ea.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const qh=(t,e)=>document.createElement("div").animate(t,e),y3={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{qh({opacity:[1]})}catch{return!1}return!0},finished:()=>!!qh({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{qh({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Vh={},Us={};for(const t in y3)Us[t]=()=>(Vh[t]===void 0&&(Vh[t]=y3[t]()),Vh[t]);const m9=.015,w9=(t,e)=>{let r="";const n=Math.round(e/m9);for(let i=0;i<n;i++)r+=t(Fh(0,n-1,i))+", ";return r.substring(0,r.length-2)},b3=(t,e)=>Xi(t)?Us.linearEasing()?`linear(${w9(t,e)})`:hn.easing:u3(t)?v9(t):t,v9=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function y9(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const b9=t=>Array.isArray(t)?t:[t];function Kh(t){return bc[t]&&(t=bc[t]),w3(t)?zh(t):t}const Ec={get:(t,e)=>{e=Kh(e);let r=Wh(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=ea.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=Kh(e),Wh(e)?t.style.setProperty(e,r):t.style[e]=r}};function _3(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function _9(t,e){var r;let n=e?.toDefaultUnit||vi;const i=t[t.length-1];if(Qx(i)){const o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=c=>c+o)}return n}function E9(){return window.__MOTION_DEV_TOOLS_RECORD}function x9(t,e,r,n={},i){const o=E9(),c=n.record!==!1&&o;let l,{duration:h=hn.duration,delay:d=hn.delay,endDelay:v=hn.endDelay,repeat:E=hn.repeat,easing:_=hn.easing,persist:A=!1,direction:P,offset:U,allowWebkitAcceleration:H=!1}=n;const G=g3(t),N=w3(e);let L=Us.waapi();N&&f9(t,e);const $=Kh(e),T=o9(G.values,$),I=ea.get($);return _3(T.animation,!(Bh(_)&&T.generator)&&n.record!==!1),()=>{const f=()=>{var z,ee;return(ee=(z=Ec.get(t,$))!==null&&z!==void 0?z:I?.initialValue)!==null&&ee!==void 0?ee:0};let x=y9(b9(r),f);const J=_9(x,I);if(Bh(_)){const z=_.createAnimation(x,e!=="opacity",f,$,T);_=z.easing,x=z.keyframes||x,h=z.duration||h}if(Wh($)&&(Us.cssRegisterProperty()?g9($):L=!1),N&&!Us.linearEasing()&&(Xi(_)||Ms(_)&&_.some(Xi))&&(L=!1),L){I&&(x=x.map(de=>yc(de)?I.toDefaultUnit(de):de)),x.length===1&&(!Us.partialKeyframes()||c)&&x.unshift(f());const z={delay:Xo.ms(d),duration:Xo.ms(h),endDelay:Xo.ms(v),easing:Ms(_)?void 0:b3(_,h),direction:P,iterations:E+1,fill:"both"};l=t.animate({[$]:x,offset:U,easing:Ms(_)?_.map(de=>b3(de,h)):void 0},z),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=x[x.length-1];l.finished.then(()=>{A||(Ec.set(t,$,ee),l.cancel())}).catch(c3),H||(l.playbackRate=1.000001)}else if(i&&N)x=x.map(z=>typeof z=="string"?parseFloat(z):z),x.length===1&&x.unshift(parseFloat(f())),l=new i(z=>{Ec.set(t,$,J?J(z):z)},x,Object.assign(Object.assign({},n),{duration:h,easing:_}));else{const z=x[x.length-1];Ec.set(t,$,I&&yc(z)?I.toDefaultUnit(z):z)}return c&&o(t,e,x,{duration:h,delay:d,easing:_,repeat:E,offset:U},"motion-one"),T.setAnimation(l),l}}const C9=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function E3(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 I9=t=>t(),x3=(t,e,r=hn.duration)=>new Proxy({animations:t.map(I9).filter(Boolean),duration:r,options:e},A9),O9=t=>t.animations[0],A9={get:(t,e)=>{const r=O9(t);switch(e){case"duration":return t.duration;case"currentTime":return Xo.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(S9)).catch(c3)),t.finished;case"stop":return()=>{t.animations.forEach(n=>_3(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=Xo.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},S9=t=>t.finished;function D9(t,e,r){return Xi(t)?t(e,r):t}function $9(t){return function(r,n,i={}){r=E3(r);const o=r.length;kh(!!o,"No valid element provided."),kh(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const h=r[l];for(const d in n){const v=C9(i,d);v.delay=D9(v.delay,l,o);const E=x9(h,d,n[d],v,t);c.push(E)}}return x3(c,i,i.duration)}}const P9=$9(p3);function T9(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 R9={any:0,all:1};function N9(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=E3(t),c=new WeakMap,l=d=>{d.forEach(v=>{const E=c.get(v.target);if(v.isIntersecting!==!!E)if(v.isIntersecting){const _=e(v);Xi(_)?c.set(v.target,_):h.unobserve(v.target)}else E&&(E(v),c.delete(v.target))})},h=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:R9[i]});return o.forEach(d=>h.observe(d)),()=>h.disconnect()}function Gh(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function C3(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const L9={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=T9(n,["once"]);return N9(t,c=>{if(e(),C3(t,"viewenter",c),!i)return l=>{r(),C3(t,"viewleave",l)}},o)}},I3=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),Gh(t,e,n))};[...Object.keys({inView:L9,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=I3(t,"hoverstart",e),i=I3(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const n=o=>{r(),Gh(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),Gh(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function M9(t,e={}){return x3([()=>{const r=new p3(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function Qi(t,e,r){return(Xi(t)?M9:P9)(t,e,r)}var ta={},U9=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},O3={},Jr={};let Zh;const j9=[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];Jr.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},Jr.getSymbolTotalCodewords=function(e){return j9[e]},Jr.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},Jr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Zh=e},Jr.isKanjiModeEnabled=function(){return typeof Zh<"u"},Jr.toSJIS=function(e){return Zh(e)};var xc={};(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}}})(xc);function A3(){this.buffer=[],this.length=0}A3.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 F9=A3;function ra(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)}ra.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},ra.prototype.get=function(t,e){return this.data[t*this.size+e]},ra.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},ra.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var B9=ra,S3={};(function(t){const e=Jr.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,o=e(n),c=o===145?26:Math.ceil((o-13)/(2*i-2))*2,l=[o-7];for(let h=1;h<i-1;h++)l[h]=l[h-1]-c;return l.push(6),l.reverse()},t.getPositions=function(n){const i=[],o=t.getRowColCoords(n),c=o.length;for(let l=0;l<c;l++)for(let h=0;h<c;h++)l===0&&h===0||l===0&&h===c-1||l===c-1&&h===0||i.push([o[l],o[h]]);return i}})(S3);var D3={};const k9=Jr.getSymbolSize,$3=7;D3.getPositions=function(e){const r=k9(e);return[[0,0],[r-$3,0],[0,r-$3]]};var P3={};(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 o=i.size;let c=0,l=0,h=0,d=null,v=null;for(let E=0;E<o;E++){l=h=0,d=v=null;for(let _=0;_<o;_++){let A=i.get(E,_);A===d?l++:(l>=5&&(c+=e.N1+(l-5)),d=A,l=1),A=i.get(_,E),A===v?h++:(h>=5&&(c+=e.N1+(h-5)),v=A,h=1)}l>=5&&(c+=e.N1+(l-5)),h>=5&&(c+=e.N1+(h-5))}return c},t.getPenaltyN2=function(i){const o=i.size;let c=0;for(let l=0;l<o-1;l++)for(let h=0;h<o-1;h++){const d=i.get(l,h)+i.get(l,h+1)+i.get(l+1,h)+i.get(l+1,h+1);(d===4||d===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,h=0;for(let d=0;d<o;d++){l=h=0;for(let v=0;v<o;v++)l=l<<1&2047|i.get(d,v),v>=10&&(l===1488||l===93)&&c++,h=h<<1&2047|i.get(v,d),v>=10&&(h===1488||h===93)&&c++}return c*e.N3},t.getPenaltyN4=function(i){let o=0;const c=i.data.length;for(let h=0;h<c;h++)o+=i.data[h];return Math.abs(Math.ceil(o*100/c/5)-10)*e.N4};function r(n,i,o){switch(n){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,o){const c=o.size;for(let l=0;l<c;l++)for(let h=0;h<c;h++)o.isReserved(h,l)||o.xor(h,l,r(i,h,l))},t.getBestMask=function(i,o){const c=Object.keys(t.Patterns).length;let l=0,h=1/0;for(let d=0;d<c;d++){o(d),t.applyMask(d,i);const v=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(d,i),v<h&&(h=v,l=d)}return l}})(P3);var Cc={};const yi=xc,Ic=[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],Oc=[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];Cc.getBlocksCount=function(e,r){switch(r){case yi.L:return Ic[(e-1)*4+0];case yi.M:return Ic[(e-1)*4+1];case yi.Q:return Ic[(e-1)*4+2];case yi.H:return Ic[(e-1)*4+3];default:return}},Cc.getTotalCodewordsCount=function(e,r){switch(r){case yi.L:return Oc[(e-1)*4+0];case yi.M:return Oc[(e-1)*4+1];case yi.Q:return Oc[(e-1)*4+2];case yi.H:return Oc[(e-1)*4+3];default:return}};var T3={},Ac={};const na=new Uint8Array(512),Sc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)na[r]=e,Sc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)na[r]=na[r-255]})(),Ac.log=function(e){if(e<1)throw new Error("log("+e+")");return Sc[e]},Ac.exp=function(e){return na[e]},Ac.mul=function(e,r){return e===0||r===0?0:na[Sc[e]+Sc[r]]},function(t){const e=Ac;t.mul=function(n,i){const o=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let l=0;l<i.length;l++)o[c+l]^=e.mul(n[c],i[l]);return o},t.mod=function(n,i){let o=new Uint8Array(n);for(;o.length-i.length>=0;){const c=o[0];for(let h=0;h<i.length;h++)o[h]^=e.mul(i[h],c);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let o=0;o<n;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}(T3);const R3=T3;function Yh(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Yh.prototype.initialize=function(e){this.degree=e,this.genPoly=R3.generateECPolynomial(this.degree)},Yh.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=R3.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(n,i),o}return n};var H9=Yh,N3={},bi={},Jh={};Jh.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Mn={};const L3="[0-9]+",z9="[A-Z $%*+\\-./:]+";let ia="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ia=ia.replace(/u/g,"\\u");const W9="(?:(?![A-Z0-9 $%*+\\-./:]|"+ia+`)(?:.|[\r
|
|
146
|
+
]))+`;Mn.KANJI=new RegExp(ia,"g"),Mn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Mn.BYTE=new RegExp(W9,"g"),Mn.NUMERIC=new RegExp(L3,"g"),Mn.ALPHANUMERIC=new RegExp(z9,"g");const q9=new RegExp("^"+ia+"$"),V9=new RegExp("^"+L3+"$"),K9=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Mn.testKanji=function(e){return q9.test(e)},Mn.testNumeric=function(e){return V9.test(e)},Mn.testAlphanumeric=function(e){return K9.test(e)},function(t){const e=Jh,r=Mn;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,c){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?o.ccBits[0]:c<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return r.testNumeric(o)?t.NUMERIC:r.testAlphanumeric(o)?t.ALPHANUMERIC:r.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.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(o,c){if(t.isValid(o))return o;try{return n(o)}catch{return c}}}(bi),function(t){const e=Jr,r=Cc,n=xc,i=bi,o=Jh,c=7973,l=e.getBCHDigit(c);function h(_,A,P){for(let U=1;U<=40;U++)if(A<=t.getCapacity(U,P,_))return U}function d(_,A){return i.getCharCountIndicator(_,A)+4}function v(_,A){let P=0;return _.forEach(function(U){const H=d(U.mode,A);P+=H+U.getBitsLength()}),P}function E(_,A){for(let P=1;P<=40;P++)if(v(_,P)<=t.getCapacity(P,A,i.MIXED))return P}t.from=function(A,P){return o.isValid(A)?parseInt(A,10):P},t.getCapacity=function(A,P,U){if(!o.isValid(A))throw new Error("Invalid QR Code version");typeof U>"u"&&(U=i.BYTE);const H=e.getSymbolTotalCodewords(A),G=r.getTotalCodewordsCount(A,P),N=(H-G)*8;if(U===i.MIXED)return N;const L=N-d(U,A);switch(U){case i.NUMERIC:return Math.floor(L/10*3);case i.ALPHANUMERIC:return Math.floor(L/11*2);case i.KANJI:return Math.floor(L/13);case i.BYTE:default:return Math.floor(L/8)}},t.getBestVersionForData=function(A,P){let U;const H=n.from(P,n.M);if(Array.isArray(A)){if(A.length>1)return E(A,H);if(A.length===0)return 1;U=A[0]}else U=A;return h(U.mode,U.getLength(),H)},t.getEncodedBits=function(A){if(!o.isValid(A)||A<7)throw new Error("Invalid QR Code version");let P=A<<12;for(;e.getBCHDigit(P)-l>=0;)P^=c<<e.getBCHDigit(P)-l;return A<<12|P}}(N3);var M3={};const Xh=Jr,U3=1335,G9=21522,j3=Xh.getBCHDigit(U3);M3.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;Xh.getBCHDigit(i)-j3>=0;)i^=U3<<Xh.getBCHDigit(i)-j3;return(n<<10|i)^G9};var F3={};const Z9=bi;function js(t){this.mode=Z9.NUMERIC,this.data=t.toString()}js.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},js.prototype.getLength=function(){return this.data.length},js.prototype.getBitsLength=function(){return js.getBitsLength(this.data.length)},js.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 o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,o*3+1))};var Y9=js;const J9=bi,Qh=["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 Fs(t){this.mode=J9.ALPHANUMERIC,this.data=t}Fs.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Fs.prototype.getLength=function(){return this.data.length},Fs.prototype.getBitsLength=function(){return Fs.getBitsLength(this.data.length)},Fs.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=Qh.indexOf(this.data[r])*45;n+=Qh.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(Qh.indexOf(this.data[r]),6)};var X9=Fs,Q9=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var o=e.charCodeAt(i);if(o>=55296&&o<=56319&&n>i+1){var c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(o=(o-55296)*1024+c-56320+65536,i+=1)}if(o<128){r.push(o);continue}if(o<2048){r.push(o>>6|192),r.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){r.push(o>>12|224),r.push(o>>6&63|128),r.push(o&63|128);continue}if(o>=65536&&o<=1114111){r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const eC=Q9,tC=bi;function Bs(t){this.mode=tC.BYTE,typeof t=="string"&&(t=eC(t)),this.data=new Uint8Array(t)}Bs.getBitsLength=function(e){return e*8},Bs.prototype.getLength=function(){return this.data.length},Bs.prototype.getBitsLength=function(){return Bs.getBitsLength(this.data.length)},Bs.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var rC=Bs;const nC=bi,iC=Jr;function ks(t){this.mode=nC.KANJI,this.data=t}ks.getBitsLength=function(e){return e*13},ks.prototype.getLength=function(){return this.data.length},ks.prototype.getBitsLength=function(){return ks.getBitsLength(this.data.length)},ks.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=iC.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]+`
|
|
147
|
+
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var sC=ks,B3={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var o={},c={};c[n]=0;var l=e.PriorityQueue.make();l.push(n,0);for(var h,d,v,E,_,A,P,U,H;!l.empty();){h=l.pop(),d=h.value,E=h.cost,_=r[d]||{};for(v in _)_.hasOwnProperty(v)&&(A=_[v],P=E+A,U=c[v],H=typeof c[v]>"u",(H||U>P)&&(c[v]=P,l.push(v,P),o[v]=d))}if(typeof i<"u"&&typeof c[i]>"u"){var G=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(G)}return o},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],o=n;o;)i.push(o),r[o],o=r[o];return i.reverse(),i},find_path:function(r,n,i){var o=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},o;r=r||{};for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);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})(B3),function(t){const e=bi,r=Y9,n=X9,i=rC,o=sC,c=Mn,l=Jr,h=B3.exports;function d(G){return unescape(encodeURIComponent(G)).length}function v(G,N,L){const $=[];let T;for(;(T=G.exec(L))!==null;)$.push({data:T[0],index:T.index,mode:N,length:T[0].length});return $}function E(G){const N=v(c.NUMERIC,e.NUMERIC,G),L=v(c.ALPHANUMERIC,e.ALPHANUMERIC,G);let $,T;return l.isKanjiModeEnabled()?($=v(c.BYTE,e.BYTE,G),T=v(c.KANJI,e.KANJI,G)):($=v(c.BYTE_KANJI,e.BYTE,G),T=[]),N.concat(L,$,T).sort(function(f,x){return f.index-x.index}).map(function(f){return{data:f.data,mode:f.mode,length:f.length}})}function _(G,N){switch(N){case e.NUMERIC:return r.getBitsLength(G);case e.ALPHANUMERIC:return n.getBitsLength(G);case e.KANJI:return o.getBitsLength(G);case e.BYTE:return i.getBitsLength(G)}}function A(G){return G.reduce(function(N,L){const $=N.length-1>=0?N[N.length-1]:null;return $&&$.mode===L.mode?(N[N.length-1].data+=L.data,N):(N.push(L),N)},[])}function P(G){const N=[];for(let L=0;L<G.length;L++){const $=G[L];switch($.mode){case e.NUMERIC:N.push([$,{data:$.data,mode:e.ALPHANUMERIC,length:$.length},{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.ALPHANUMERIC:N.push([$,{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.KANJI:N.push([$,{data:$.data,mode:e.BYTE,length:d($.data)}]);break;case e.BYTE:N.push([{data:$.data,mode:e.BYTE,length:d($.data)}])}}return N}function U(G,N){const L={},$={start:{}};let T=["start"];for(let I=0;I<G.length;I++){const f=G[I],x=[];for(let J=0;J<f.length;J++){const z=f[J],ee=""+I+J;x.push(ee),L[ee]={node:z,lastCount:0},$[ee]={};for(let de=0;de<T.length;de++){const me=T[de];L[me]&&L[me].node.mode===z.mode?($[me][ee]=_(L[me].lastCount+z.length,z.mode)-_(L[me].lastCount,z.mode),L[me].lastCount+=z.length):(L[me]&&(L[me].lastCount=z.length),$[me][ee]=_(z.length,z.mode)+4+e.getCharCountIndicator(z.mode,N))}}T=x}for(let I=0;I<T.length;I++)$[T[I]].end=0;return{map:$,table:L}}function H(G,N){let L;const $=e.getBestModeForData(G);if(L=e.from(N,$),L!==e.BYTE&&L.bit<$.bit)throw new Error('"'+G+'" cannot be encoded with mode '+e.toString(L)+`.
|
|
148
|
+
Suggested mode is: `+e.toString($));switch(L===e.KANJI&&!l.isKanjiModeEnabled()&&(L=e.BYTE),L){case e.NUMERIC:return new r(G);case e.ALPHANUMERIC:return new n(G);case e.KANJI:return new o(G);case e.BYTE:return new i(G)}}t.fromArray=function(N){return N.reduce(function(L,$){return typeof $=="string"?L.push(H($,null)):$.data&&L.push(H($.data,$.mode)),L},[])},t.fromString=function(N,L){const $=E(N,l.isKanjiModeEnabled()),T=P($),I=U(T,L),f=h.find_path(I.map,"start","end"),x=[];for(let J=1;J<f.length-1;J++)x.push(I.table[f[J]].node);return t.fromArray(A(x))},t.rawSplit=function(N){return t.fromArray(E(N,l.isKanjiModeEnabled()))}}(F3);const Dc=Jr,ef=xc,oC=F9,aC=B9,cC=S3,lC=D3,tf=P3,rf=Cc,uC=H9,$c=N3,hC=M3,fC=bi,nf=F3;function dC(t,e){const r=t.size,n=lC.getPositions(e);for(let i=0;i<n.length;i++){const o=n[i][0],c=n[i][1];for(let l=-1;l<=7;l++)if(!(o+l<=-1||r<=o+l))for(let h=-1;h<=7;h++)c+h<=-1||r<=c+h||(l>=0&&l<=6&&(h===0||h===6)||h>=0&&h<=6&&(l===0||l===6)||l>=2&&l<=4&&h>=2&&h<=4?t.set(o+l,c+h,!0,!0):t.set(o+l,c+h,!1,!0))}}function pC(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 gC(t,e){const r=cC.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],o=r[n][1];for(let c=-2;c<=2;c++)for(let l=-2;l<=2;l++)c===-2||c===2||l===-2||l===2||c===0&&l===0?t.set(i+c,o+l,!0,!0):t.set(i+c,o+l,!1,!0)}}function mC(t,e){const r=t.size,n=$c.getEncodedBits(e);let i,o,c;for(let l=0;l<18;l++)i=Math.floor(l/3),o=l%3+r-8-3,c=(n>>l&1)===1,t.set(i,o,c,!0),t.set(o,i,c,!0)}function sf(t,e,r){const n=t.size,i=hC.getEncodedBits(e,r);let o,c;for(o=0;o<15;o++)c=(i>>o&1)===1,o<6?t.set(o,8,c,!0):o<8?t.set(o+1,8,c,!0):t.set(n-15+o,8,c,!0),o<8?t.set(8,n-o-1,c,!0):o<9?t.set(8,15-o-1+1,c,!0):t.set(8,15-o-1,c,!0);t.set(n-8,8,1,!0)}function wC(t,e){const r=t.size;let n=-1,i=r-1,o=7,c=0;for(let l=r-1;l>0;l-=2)for(l===6&&l--;;){for(let h=0;h<2;h++)if(!t.isReserved(i,l-h)){let d=!1;c<e.length&&(d=(e[c]>>>o&1)===1),t.set(i,l-h,d),o--,o===-1&&(c++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function vC(t,e,r){const n=new oC;r.forEach(function(h){n.put(h.mode.bit,4),n.put(h.getLength(),fC.getCharCountIndicator(h.mode,t)),h.write(n)});const i=Dc.getSymbolTotalCodewords(t),o=rf.getTotalCodewordsCount(t,e),c=(i-o)*8;for(n.getLengthInBits()+4<=c&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const l=(c-n.getLengthInBits())/8;for(let h=0;h<l;h++)n.put(h%2?17:236,8);return yC(n,t,e)}function yC(t,e,r){const n=Dc.getSymbolTotalCodewords(e),i=rf.getTotalCodewordsCount(e,r),o=n-i,c=rf.getBlocksCount(e,r),l=n%c,h=c-l,d=Math.floor(n/c),v=Math.floor(o/c),E=v+1,_=d-v,A=new uC(_);let P=0;const U=new Array(c),H=new Array(c);let G=0;const N=new Uint8Array(t.buffer);for(let f=0;f<c;f++){const x=f<h?v:E;U[f]=N.slice(P,P+x),H[f]=A.encode(U[f]),P+=x,G=Math.max(G,x)}const L=new Uint8Array(n);let $=0,T,I;for(T=0;T<G;T++)for(I=0;I<c;I++)T<U[I].length&&(L[$++]=U[I][T]);for(T=0;T<_;T++)for(I=0;I<c;I++)L[$++]=H[I][T];return L}function bC(t,e,r,n){let i;if(Array.isArray(t))i=nf.fromArray(t);else if(typeof t=="string"){let d=e;if(!d){const v=nf.rawSplit(t);d=$c.getBestVersionForData(v,r)}i=nf.fromString(t,d||40)}else throw new Error("Invalid data");const o=$c.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`
|
|
149
149
|
The chosen QR Code version cannot contain this amount of data.
|
|
150
150
|
Minimum version required to store current data is: `+o+`.
|
|
151
|
-
`);const c=
|
|
152
|
-
`;return typeof n=="function"&&n(null,_),_};const CC=j9,lf=A3,q3=H3,IC=z3;function uf(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!CC())throw new Error("Callback required as last argument");if(l){if(c<2)throw new Error("Too few arguments provided");c===2?(i=r,r=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(r=e,e=n=void 0):c===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(h,d){try{const v=lf.create(r,n);h(t(v,e,n))}catch(v){d(v)}})}try{const h=lf.create(r,n);i(null,t(h,e,n))}catch(h){i(h)}}ra.create=lf.create,ra.toCanvas=uf.bind(null,q3.render),ra.toDataURL=uf.bind(null,q3.renderToDataURL),ra.toString=uf.bind(null,function(t,e,r){return IC.render(t,r)});var OC=Object.defineProperty,V3=Object.getOwnPropertySymbols,AC=Object.prototype.hasOwnProperty,SC=Object.prototype.propertyIsEnumerable,K3=(t,e,r)=>e in t?OC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Tc=(t,e)=>{for(var r in e||(e={}))AC.call(e,r)&&K3(t,r,e[r]);if(V3)for(var r of V3(e))SC.call(e,r)&&K3(t,r,e[r]);return t};function DC(){var t;const e=(t=Ln.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--w3m-color-fg-1":r.foreground[1],"--w3m-color-fg-2":r.foreground[2],"--w3m-color-fg-3":r.foreground[3],"--w3m-color-bg-1":r.background[1],"--w3m-color-bg-2":r.background[2],"--w3m-color-bg-3":r.background[3],"--w3m-color-overlay":r.overlay}}function G3(){return{"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-wallet-icon-large-border-radius":"30px","--w3m-wallet-icon-small-border-radius":"7px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)"}}function $C(){const{themeVariables:t}=Ln.state;return{"--w3m-background-image-url":t!=null&&t["--w3m-background-image-url"]?`url(${t["--w3m-background-image-url"]})`:"none"}}const je={getPreset(t){return G3()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=Ln.state;if(t){const r=Tc(Tc(Tc(Tc({},DC()),G3()),e),$C());Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:Ve`*,::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;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-accent-fill-color);background:var(--w3m-accent-color)}`},PC=Ve`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-accent-color);border-radius:var(--w3m-icon-button-border-radius);margin-bottom:4px}button path{fill:var(--w3m-accent-fill-color)}`;var TC=Object.defineProperty,RC=Object.getOwnPropertyDescriptor,Rc=(t,e,r,n)=>{for(var i=n>1?void 0:n?RC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&TC(e,r,i),i};let zs=class extends $e{constructor(){super(...arguments),this.icon=void 0,this.label="",this.onClick=()=>null}render(){return oe`<button @click="${this.onClick}"><div>${this.icon}</div><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};zs.styles=[je.globalCss,PC],Rc([Ae()],zs.prototype,"icon",2),Rc([Ae()],zs.prototype,"label",2),Rc([Ae()],zs.prototype,"onClick",2),zs=Rc([Re("w3m-box-button")],zs);const NC=Ve`button{border-radius:var(--w3m-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--w3m-accent-color)}button path{fill:var(--w3m-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:active::after{background-color:var(--w3m-color-overlay)}.w3m-ghost,.w3m-ghost:active::after,.w3m-outline{background-color:transparent}.w3m-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}.w3m-ghost:hover::after{background-color:transparent}.w3m-ghost:hover{opacity:.5}}button:disabled{background-color:var(--w3m-color-bg-3);pointer-events:none}.w3m-ghost::after{border-color:transparent}.w3m-ghost path{fill:var(--w3m-color-fg-2)}.w3m-outline path{fill:var(--w3m-accent-color)}.w3m-outline:disabled{background-color:transparent;opacity:.5}`;var LC=Object.defineProperty,MC=Object.getOwnPropertyDescriptor,Ws=(t,e,r,n)=>{for(var i=n>1?void 0:n?MC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&LC(e,r,i),i};let _i=class extends $e{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0,"w3m-ghost":this.variant==="ghost","w3m-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),oe`<button class="${Lr(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-regular" color="${e}"><slot></slot></w3m-text>${this.iconRight}</button>`}};_i.styles=[je.globalCss,NC],Ws([Ae()],_i.prototype,"disabled",2),Ws([Ae()],_i.prototype,"iconLeft",2),Ws([Ae()],_i.prototype,"iconRight",2),Ws([Ae()],_i.prototype,"onClick",2),Ws([Ae()],_i.prototype,"variant",2),_i=Ws([Re("w3m-button")],_i);const UC=Ve`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--w3m-button-border-radius);color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:active::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-accent-color);background-color:transparent}.w3m-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}}`;var jC=Object.defineProperty,FC=Object.getOwnPropertyDescriptor,hf=(t,e,r,n)=>{for(var i=n>1?void 0:n?FC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&jC(e,r,i),i};let oa=class extends $e{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return oe`<button ?disabled="${this.disabled}" class="${Lr(t)}"><slot></slot></button>`}};oa.styles=[je.globalCss,UC],hf([Ae()],oa.prototype,"disabled",2),hf([Ae()],oa.prototype,"variant",2),oa=hf([Re("w3m-button-big")],oa);const BC=Ve`:host{background-color:var(--w3m-color-bg-2);border-top:1px solid var(--w3m-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var kC=Object.defineProperty,HC=Object.getOwnPropertyDescriptor,zC=(t,e,r,n)=>{for(var i=n>1?void 0:n?HC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&kC(e,r,i),i};let ff=class extends $e{render(){return oe`<div><slot></slot></div>`}};ff.styles=[je.globalCss,BC],ff=zC([Re("w3m-info-footer")],ff);const Ne={CROSS_ICON:ut`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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>`,GLOBE_ICON:ut`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},WC=Ve`.w3m-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--w3m-background-border-radius) * .9);background-color:var(--w3m-background-color);background-image:var(--w3m-background-image-url);background-position:center;background-size:cover}.w3m-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--w3m-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--w3m-color-fg-1)}.w3m-toolbar div{display:flex}.w3m-toolbar div 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)}@media(hover:hover){button:hover{background-color:var(--w3m-color-bg-2)}}`;var qC=Object.defineProperty,VC=Object.getOwnPropertyDescriptor,Z3=(t,e,r,n)=>{for(var i=n>1?void 0:n?VC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&qC(e,r,i),i};let Nc=class extends $e{constructor(){super(),this.isHelp=!1,this.unsubscribeRouter=void 0,this.unsubscribeRouter=tt.subscribe(t=>{this.isHelp=t.view==="Help"})}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this)}onHelp(){tt.push("Help")}logoTemplate(){var t;const e=(t=Ln.state.themeVariables)==null?void 0:t["--w3m-logo-image-url"];return e?oe`<img src="${e}">`:Ne.WALLET_CONNECT_LOGO}render(){const t={"w3m-help-active":this.isHelp};return oe`<div class="w3m-toolbar-placeholder"></div><div class="w3m-toolbar">${this.logoTemplate()}<div class="${Lr(t)}"><button @click="${this.onHelp}">${Ne.HELP_ICON}</button> <button @click="${Nr.close}">${Ne.CROSS_ICON}</button></div></div>`}};Nc.styles=[je.globalCss,WC],Z3([gt()],Nc.prototype,"isHelp",2),Nc=Z3([Re("w3m-modal-backcard")],Nc);const KC=Ve`main{padding:20px;padding-top:0;width:100%}`;var GC=Object.defineProperty,ZC=Object.getOwnPropertyDescriptor,YC=(t,e,r,n)=>{for(var i=n>1?void 0:n?ZC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&GC(e,r,i),i};let df=class extends $e{render(){return oe`<main><slot></slot></main>`}};df.styles=[je.globalCss,KC],df=YC([Re("w3m-modal-content")],df);const JC=Ve`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var XC=Object.defineProperty,QC=Object.getOwnPropertyDescriptor,eI=(t,e,r,n)=>{for(var i=n>1?void 0:n?QC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&XC(e,r,i),i};let pf=class extends $e{render(){return oe`<footer><slot></slot></footer>`}};pf.styles=[je.globalCss,JC],pf=eI([Re("w3m-modal-footer")],pf);const tI=Ve`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}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-accent-color)}`;var rI=Object.defineProperty,nI=Object.getOwnPropertyDescriptor,aa=(t,e,r,n)=>{for(var i=n>1?void 0:n?nI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&rI(e,r,i),i};let ts=class extends $e{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return oe`<button class="w3m-back-btn" @click="${tt.goBack}">${Ne.BACK_ICON}</button>`}actionBtnTemplate(){return oe`<button class="w3m-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"w3m-border":this.border},e=tt.state.history.length>1,r=this.title?oe`<w3m-text variant="big-bold">${this.title}</w3m-text>`:oe`<slot></slot>`;return oe`<header class="${Lr(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};ts.styles=[je.globalCss,tI],aa([Ae()],ts.prototype,"title",2),aa([Ae()],ts.prototype,"onAction",2),aa([Ae()],ts.prototype,"actionIcon",2),aa([Ae()],ts.prototype,"border",2),ts=aa([Re("w3m-modal-header")],ts);const iI={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"},sI={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"}},Xr={externalWallets(){const{isStandalone:t}=De.state;if(t)return[];let e=Nt.client().getConnectors();return e=e.filter(r=>r.id!=="injected"),e},manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:n}=jt.state,i=(t=Xr.recentWallet())==null?void 0:t.id,o=Ie.isMobile()?r:n,c=o?.filter(l=>i!==l.id);return(e=Ie.isMobile()?c?.map(({id:l,name:h,links:d})=>({id:l,name:h,mobile:d,links:d})):c?.map(({id:l,name:h,links:d})=>({id:l,name:h,desktop:d,links:d})))!=null?e:[]},installedInjectedWallets(){const{isStandalone:t}=De.state;if(t)return[];if(!Nt.client().isInjectedProviderInstalled())return[];const{namespace:e}=Nt.client(),{injectedWallets:r}=nr.state;let n=r.filter(({injected:i})=>!!i.some(o=>Nt.client().safeCheckInjectedProvider(o.injected_id)&&o.namespace===e));return n.length>1&&(n=n.filter(({injected:i})=>!!i.map(({injected_id:o})=>o).every(o=>o!=="isMetaMask"))),n.length?n:[{name:"Browser",id:"browser",image_id:void 0}]},injectedWallets(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,explorerRecommendedWalletIds:r}=jt.state,n=Ie.isMobile();if(t||e==="ALL"||n)return[];const{namespace:i}=Nt.client(),{injectedWallets:o}=nr.state;return o.filter(({id:c,injected:l})=>{const h=Ie.isArray(e)?e:[],d=Ie.isArray(r)?r:[];return!!l.some(v=>v.namespace===i&&!h.includes(c)&&!d.includes(c))})},recentWallet(){return xe.getRecentWallet()},recomendedWallets(t=!1){var e;const r=Xr.installedInjectedWallets().map(({id:c})=>c),n=t||(e=Xr.recentWallet())==null?void 0:e.id,i=[...r,n],{recomendedWallets:o}=nr.state;return o.filter(c=>!i.includes(c.id))}},xe={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET_DATA:"W3M_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",rejectStandaloneButtonComponent(){const{isStandalone:t}=De.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},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=jt.state;return r!=null&&r[t]?r[t]:e?nr.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e?t.split(" ")[0]:t},getChainIcon(t){var e;const r=iI[t],{projectId:n,chainImages:i}=jt.state;return(e=i?.[t])!=null?e:n&&r?nr.getAssetImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=sI[t])==null?void 0:e.icon,{projectId:i,tokenImages:o}=jt.state;return(r=o?.[t])!=null?r:i&&n?nr.getAssetImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=xe.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.src=t});return Promise.race([e,Ie.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},handleMobileLinking(t){const{standaloneUri:e}=De.state,{pairingUri:r}=hr.state,{mobile:n,name:i}=t,o=n?.native,c=n?.universal;xe.setRecentWallet(t);function l(h){let d="";o?d=Ie.formatUniversalUrl(o,h,i):c&&(d=Ie.formatNativeUrl(c,h,i)),Ie.openHref(d,"_self")}l(e||r)},handleAndroidLinking(){const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state;t?(Ie.setWalletConnectAndroidDeepLink(t),Ie.openHref(t,"_self")):(Ie.setWalletConnectAndroidDeepLink(e),Ie.openHref(e,"_self"))},async handleUriCopy(){const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state;t?await navigator.clipboard.writeText(t):await navigator.clipboard.writeText(e),Wr.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=De.state;await Nt.client().connectConnector(t,r?.id),Nr.close()}catch(r){console.error(r),e?e():Wr.openToast(xe.getErrorMessage(r),"error")}},getCustomImageUrls(){const{chainImages:t,walletImages:e}=jt.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},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(o=>{let c=0;for(let h=0;h<o.length;h+=1)c=o.charCodeAt(h)+((c<<5)-c),c=c&c;const l=[0,0,0];for(let h=0;h<3;h+=1){const d=c>>h*8&255;l[h]=d}n.push(`rgb(${l[0]}, ${l[1]}, ${l[2]})`)});const i=document.querySelector(":root");if(i){const o={"--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(o).forEach(([c,l])=>i.style.setProperty(c,l))}},setRecentWallet(t){const{walletConnectVersion:e}=De.state;localStorage.setItem(xe.W3M_RECENT_WALLET_DATA,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(xe.W3M_RECENT_WALLET_DATA);if(t){const{walletConnectVersion:e}=De.state,r=JSON.parse(t);if(r[e])return r[e]}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Ie.openHref(xe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{id:t,desktop:e,mobile:r,injected:n}=Ie.getWalletRouterData(),i=Xr.installedInjectedWallets(),o=!!(n!=null&&n.length),c=i.some(v=>v.id===t),l=!!(e!=null&&e.native),h=!!(e!=null&&e.universal),d=!!(r!=null&&r.native)||!!(r!=null&&r.universal);return{isInjectedInstalled:c,isInjected:o,isDesktop:l,isMobile:d,isWeb:h}},goToConnectingView(t){tt.setData({Wallet:t});const e=Ie.isMobile(),{isDesktop:r,isWeb:n,isMobile:i,isInjectedInstalled:o}=xe.getCachedRouterWalletPlatforms();e?o?tt.push("InjectedConnecting"):i?tt.push("MobileConnecting"):n?tt.push("WebConnecting"):tt.push("InstallWallet"):o?tt.push("InjectedConnecting"):r?tt.push("DesktopConnecting"):n?tt.push("WebConnecting"):i?tt.push("MobileQrcodeConnecting"):tt.push("InstallWallet")}},oI=Ve`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var aI=Object.defineProperty,cI=Object.getOwnPropertyDescriptor,gf=(t,e,r,n)=>{for(var i=n>1?void 0:n?cI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&aI(e,r,i),i};let ca=class extends $e{constructor(){super(),this.view=tt.state.view,this.prevView=tt.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=tt.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&es(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),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 xe.getShadowRootElement(this,".w3m-router")}get contentEl(){return xe.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return oe`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return oe`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnecting":return oe`<w3m-injected-connecting-view></w3m-injected-connecting-view>`;case"DesktopConnecting":return oe`<w3m-desktop-connecting-view></w3m-desktop-connecting-view>`;case"MobileConnecting":return oe`<w3m-mobile-connecting-view></w3m-mobile-connecting-view>`;case"WebConnecting":return oe`<w3m-web-connecting-view></w3m-web-connecting-view>`;case"MobileQrcodeConnecting":return oe`<w3m-mobile-qr-connecting-view></w3m-mobile-qr-connecting-view>`;case"GetWallet":return oe`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"WalletExplorer":return oe`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return oe`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return oe`<w3m-help-view></w3m-help-view>`;case"Account":return oe`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return oe`<w3m-switch-network-view></w3m-switch-network-view>`;case"InstallWallet":return oe`<w3m-install-wallet-view></w3m-install-wallet-view>`;default:return oe`<div>Not Found</div>`}}async onChangeRoute(){await es(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=tt.state.view,es(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return oe`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};ca.styles=[je.globalCss,oI],gf([gt()],ca.prototype,"view",2),gf([gt()],ca.prototype,"prevView",2),ca=gf([Re("w3m-modal-router")],ca);const lI=Ve`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--w3m-notification-border-radius);border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-accent-color)}.w3m-error path{fill:var(--w3m-error-color)}`;var uI=Object.defineProperty,hI=Object.getOwnPropertyDescriptor,Y3=(t,e,r,n)=>{for(var i=n>1?void 0:n?hI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&uI(e,r,i),i};let Lc=class extends $e{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Wr.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Wr.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Wr.closeToast()}render(){const{message:t,variant:e}=Wr.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?oe`<div class="${Lr(r)}">${e==="success"?Ne.CHECKMARK_ICON:null} ${e==="error"?Ne.CROSS_ICON:null}<w3m-text variant="small-regular">${t}</w3m-text></div>`:null}};Lc.styles=[je.globalCss,lI],Y3([gt()],Lc.prototype,"open",2),Lc=Y3([Re("w3m-modal-toast")],Lc);const fI=Ve`button{padding:5px;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px;position:relative}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:active{background-color:var(--w3m-color-overlay)}.w3m-unsupported{opacity:.3}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}`;var dI=Object.defineProperty,pI=Object.getOwnPropertyDescriptor,la=(t,e,r,n)=>{for(var i=n>1?void 0:n?pI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&dI(e,r,i),i};let rs=class extends $e{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId="",this.unsupported=!1}render(){const t={"w3m-unsupported":this.unsupported};return oe`<button @click="${this.onClick}" class="${Lr(t)}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular">${this.name}</w3m-text></button>`}};rs.styles=[je.globalCss,fI],la([Ae()],rs.prototype,"onClick",2),la([Ae()],rs.prototype,"name",2),la([Ae()],rs.prototype,"chainId",2),la([Ae()],rs.prototype,"unsupported",2),rs=la([Re("w3m-network-button")],rs);const gI=Ve`@keyframes loading{to{stroke-dashoffset:0}}:host{width:inherit;height:inherit;position:relative}path{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)}image{clip-path:path('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')}`;var mI=Object.defineProperty,wI=Object.getOwnPropertyDescriptor,J3=(t,e,r,n)=>{for(var i=n>1?void 0:n?wI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&mI(e,r,i),i};let Mc=class extends $e{constructor(){super(...arguments),this.chainId=""}render(){const t=xe.getChainIcon(this.chainId);return t?oe`<svg width="54" height="59" viewBox="0 0 54 59" fill="none"><image href="${t}"/><image href="${t}" width="54" height="59"/><path 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"/></svg>`:oe`${Ne.NETWORK_PLACEHOLDER}`}};Mc.styles=[je.globalCss,gI],J3([Ae()],Mc.prototype,"chainId",2),Mc=J3([Re("w3m-network-image")],Mc);const vI=.1,X3=2.5,Gn=7;function mf(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+vI}function yI(t,e){const r=Array.prototype.slice.call(ra.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,o,c)=>(c%n===0?i.push([o]):i[i.length-1].push(o))&&i,[])}const bI={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",o=n==="light"?"#fff":"#141414",c=[],l=yI(t,"Q"),h=e/l.length,d=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];d.forEach(({x:U,y:H})=>{const G=(l.length-Gn)*h*U,N=(l.length-Gn)*h*H,L=.32;for(let $=0;$<d.length;$+=1){const T=h*(Gn-$*2);c.push(ut`<rect fill="${$%2===0?i:o}" height="${T}" rx="${T*L}" ry="${T*L}" width="${T}" x="${G+h*$}" y="${N+h*$}">`)}});const v=Math.floor((r+25)/h),E=l.length/2-v/2,_=l.length/2+v/2-1,A=[];l.forEach((U,H)=>{U.forEach((G,N)=>{if(l[H][N]&&!(H<Gn&&N<Gn||H>l.length-(Gn+1)&&N<Gn||H<Gn&&N>l.length-(Gn+1))&&!(H>E&&H<_&&N>E&&N<_)){const L=H*h+h/2,$=N*h+h/2;A.push([L,$])}})});const P={};return A.forEach(([U,H])=>{P[U]?P[U].push(H):P[U]=[H]}),Object.entries(P).map(([U,H])=>{const G=H.filter(N=>H.every(L=>!mf(N,L,h)));return[Number(U),G]}).forEach(([U,H])=>{H.forEach(G=>{c.push(ut`<circle cx="${U}" cy="${G}" fill="${i}" r="${h/X3}">`)})}),Object.entries(P).filter(([U,H])=>H.length>1).map(([U,H])=>{const G=H.filter(N=>H.some(L=>mf(N,L,h)));return[Number(U),G]}).map(([U,H])=>{H.sort((N,L)=>N<L?-1:1);const G=[];for(const N of H){const L=G.find($=>$.some(T=>mf(N,T,h)));L?L.push(N):G.push([N])}return[U,G.map(N=>[N[0],N[N.length-1]])]}).forEach(([U,H])=>{H.forEach(([G,N])=>{c.push(ut`<line x1="${U}" x2="${U}" y1="${G}" y2="${N}" stroke="${i}" stroke-width="${h/(X3/2)}" stroke-linecap="round">`)})}),c}},_I=Ve`@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:var(--w3m-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-accent-color)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var EI=Object.defineProperty,xI=Object.getOwnPropertyDescriptor,qs=(t,e,r,n)=>{for(var i=n>1?void 0:n?xI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&EI(e,r,i),i};let Zn=class extends $e{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){var t;const e=(t=Ln.state.themeMode)!=null?t:"light";return ut`<svg height="${this.size}" width="${this.size}">${bI.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return oe`<div>${this.walletId||this.imageUrl?oe`<w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}" imageUrl="${this.imageUrl}"></w3m-wallet-image>`:Ne.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}<w3m-theme-context></w3m-theme-context></div>`}};Zn.styles=[je.globalCss,_I],qs([Ae()],Zn.prototype,"uri",2),qs([Ae({type:Number})],Zn.prototype,"size",2),qs([Ae()],Zn.prototype,"imageId",2),qs([Ae()],Zn.prototype,"walletId",2),qs([Ae()],Zn.prototype,"imageUrl",2),Zn=qs([Re("w3m-qrcode")],Zn);const CI=Ve`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--w3m-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:transparent;position:absolute;background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}input::placeholder{color:transparent}svg{margin:2px 4px 0 0}div{top:0;left:calc(50% - 12px);transform:translateX(-50%);transition:.2s all ease;pointer-events:none;display:flex;align-items:center;justify-content:center;height:calc(100% - 2px);width:fit-content;position:relative}input:focus-within+div,input:not(:placeholder-shown)+div{transform:translateX(10px);left:0}w3m-text{opacity:1;transition:.2s opacity ease}input:focus-within+div w3m-text,input:not(:placeholder-shown)+div w3m-text{opacity:0}input:focus-within,input:not(:placeholder-shown){color:var(--w3m-color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var II=Object.defineProperty,OI=Object.getOwnPropertyDescriptor,Q3=(t,e,r,n)=>{for(var i=n>1?void 0:n?OI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&II(e,r,i),i};let Uc=class extends $e{constructor(){super(...arguments),this.onChange=()=>null}render(){const t="Search wallets";return oe`<input type="text" @input="${this.onChange}" placeholder="${t}"><div>${Ne.SEARCH_ICON}<w3m-text color="secondary" variant="small-thin">${t}</w3m-text></div>`}};Uc.styles=[je.globalCss,CI],Q3([Ae()],Uc.prototype,"onChange",2),Uc=Q3([Re("w3m-search-input")],Uc);const AI=Ve`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-accent-color)}`;var SI=Object.defineProperty,DI=Object.getOwnPropertyDescriptor,$I=(t,e,r,n)=>{for(var i=n>1?void 0:n?DI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&SI(e,r,i),i};let wf=class extends $e{render(){return oe`<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>`}};wf.styles=[je.globalCss,AI],wf=$I([Re("w3m-spinner")],wf);const PI=Ve`span{font-style:normal;font-family:var(--w3m-font-family);font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xsmall-bold{font-family:var(--w3m-text-xsmall-bold-font-family);font-weight:var(--w3m-text-xsmall-bold-weight);font-size:var(--w3m-text-xsmall-bold-size);line-height:var(--w3m-text-xsmall-bold-line-height);letter-spacing:var(--w3m-text-xsmall-bold-letter-spacing);text-transform:var(--w3m-text-xsmall-bold-text-transform)}.w3m-xsmall-regular{font-family:var(--w3m-text-xsmall-regular-font-family);font-weight:var(--w3m-text-xsmall-regular-weight);font-size:var(--w3m-text-xsmall-regular-size);line-height:var(--w3m-text-xsmall-regular-line-height);letter-spacing:var(--w3m-text-xsmall-regular-letter-spacing);text-transform:var(--w3m-text-xsmall-regular-text-transform)}.w3m-small-thin{font-family:var(--w3m-text-small-thin-font-family);font-weight:var(--w3m-text-small-thin-weight);font-size:var(--w3m-text-small-thin-size);line-height:var(--w3m-text-small-thin-line-height);letter-spacing:var(--w3m-text-small-thin-letter-spacing);text-transform:var(--w3m-text-small-thin-text-transform)}.w3m-small-regular{font-family:var(--w3m-text-small-regular-font-family);font-weight:var(--w3m-text-small-regular-weight);font-size:var(--w3m-text-small-regular-size);line-height:var(--w3m-text-small-regular-line-height);letter-spacing:var(--w3m-text-small-regular-letter-spacing);text-transform:var(--w3m-text-small-regular-text-transform)}.w3m-medium-regular{font-family:var(--w3m-text-medium-regular-font-family);font-weight:var(--w3m-text-medium-regular-weight);font-size:var(--w3m-text-medium-regular-size);line-height:var(--w3m-text-medium-regular-line-height);letter-spacing:var(--w3m-text-medium-regular-letter-spacing);text-transform:var(--w3m-text-medium-regular-text-transform)}.w3m-big-bold{font-family:var(--w3m-text-big-bold-font-family);font-weight:var(--w3m-text-big-bold-weight);font-size:var(--w3m-text-big-bold-size);line-height:var(--w3m-text-big-bold-line-height);letter-spacing:var(--w3m-text-big-bold-letter-spacing);text-transform:var(--w3m-text-big-bold-text-transform)}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-accent-fill-color)}.w3m-color-accnt{color:var(--w3m-accent-color)}.w3m-color-error{color:var(--w3m-error-color)}`;var TI=Object.defineProperty,RI=Object.getOwnPropertyDescriptor,vf=(t,e,r,n)=>{for(var i=n>1?void 0:n?RI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&TI(e,r,i),i};let ua=class extends $e{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"w3m-big-bold":this.variant==="big-bold","w3m-medium-regular":this.variant==="medium-regular","w3m-small-regular":this.variant==="small-regular","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-regular":this.variant==="xsmall-regular","w3m-xsmall-bold":this.variant==="xsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return oe`<span><slot class="${Lr(t)}"></slot></span>`}};ua.styles=[je.globalCss,PI],vf([Ae()],ua.prototype,"variant",2),vf([Ae()],ua.prototype,"color",2),ua=vf([Re("w3m-text")],ua);const NI=Ve`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right: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 LI=Object.defineProperty,MI=Object.getOwnPropertyDescriptor,em=(t,e,r,n)=>{for(var i=n>1?void 0:n?MI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&LI(e,r,i),i};let jc=class extends $e{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=xe.getTokenIcon((t=this.symbol)!=null?t:"");return e?oe`<div><img src="${e}" alt="${this.id}"></div>`:Ne.TOKEN_PLACEHOLDER}};jc.styles=[je.globalCss,NI],em([Ae()],jc.prototype,"symbol",2),jc=em([Re("w3m-token-image")],jc);const UI=Ve`button{width:100%;height:100%;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--w3m-wallet-icon-border-radius);margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var jI=Object.defineProperty,FI=Object.getOwnPropertyDescriptor,Ei=(t,e,r,n)=>{for(var i=n>1?void 0:n?FI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&jI(e,r,i),i};let Un=class extends $e{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?oe`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?oe`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</w3m-text>`:null}handleClick(){gi.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return oe`<button @click="${this.handleClick.bind(this)}"><div><w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}"></w3m-wallet-image><w3m-text variant="xsmall-regular">${(t=this.label)!=null?t:xe.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};Un.styles=[je.globalCss,UI],Ei([Ae()],Un.prototype,"onClick",2),Ei([Ae()],Un.prototype,"name",2),Ei([Ae()],Un.prototype,"walletId",2),Ei([Ae()],Un.prototype,"label",2),Ei([Ae()],Un.prototype,"imageId",2),Ei([Ae()],Un.prototype,"installed",2),Ei([Ae()],Un.prototype,"recent",2),Un=Ei([Re("w3m-wallet-button")],Un);const BI=Ve`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--w3m-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right: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 kI=Object.defineProperty,HI=Object.getOwnPropertyDescriptor,Fc=(t,e,r,n)=>{for(var i=n>1?void 0:n?HI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&kI(e,r,i),i};let Vs=class extends $e{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:xe.getWalletIcon({id:this.walletId,image_id:this.imageId});return oe`${e.length?oe`<div><img src="${e}" alt="${this.id}"></div>`:Ne.WALLET_PLACEHOLDER}`}};Vs.styles=[je.globalCss,BI],Fc([Ae()],Vs.prototype,"walletId",2),Fc([Ae()],Vs.prototype,"imageId",2),Fc([Ae()],Vs.prototype,"imageUrl",2),Vs=Fc([Re("w3m-wallet-image")],Vs);var zI=Object.defineProperty,WI=Object.getOwnPropertyDescriptor,qI=(t,e,r,n)=>{for(var i=n>1?void 0:n?WI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&zI(e,r,i),i};let tm=class extends $e{constructor(){super(),this.unwatchAccount=void 0,Et.getAccount(),this.fetchProfile(),this.fetchBalance(),this.unwatchAccount=Nt.client().watchAccount(t=>{const{address:e,isConnected:r}=Et.state;t.isConnected&&t.address!==e&&(this.fetchProfile(t.address),this.fetchBalance(t.address),Et.setAddress(t.address)),t.isConnected||Et.resetAccount(),r!==t.isConnected&&Nr.close(),!r&&t.isConnected?gi.track({name:"ACCOUNT_CONNECTED"}):r&&!t.isConnected&&gi.track({name:"ACCOUNT_DISCONNECTED"}),Et.setIsConnected(t.isConnected)})}disconnectedCallback(){var t;(t=this.unwatchAccount)==null||t.call(this)}async fetchProfile(t){var e;const r=(e=De.state.chains)==null?void 0:e.find(n=>n.id===1);if(jt.state.enableAccountView&&r)try{await Et.fetchProfile(xe.preloadImage,t)}catch(n){console.error(n),Wr.openToast(xe.getErrorMessage(n),"error")}}async fetchBalance(t){if(jt.state.enableAccountView)try{await Et.fetchBalance(t)}catch(e){console.error(e),Wr.openToast(xe.getErrorMessage(e),"error")}}};tm=qI([Re("w3m-account-context")],tm);var VI=Object.defineProperty,KI=Object.getOwnPropertyDescriptor,rm=(t,e,r,n)=>{for(var i=n>1?void 0:n?KI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&VI(e,r,i),i};let yf=class extends $e{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>xe.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){var t;if(jt.state.enableExplorer){const{chains:e}=De.state;await Promise.all([nr.getRecomendedWallets(),nr.getInjectedWallets()]),De.setIsDataLoaded(!0);const{recomendedWallets:r}=nr.state,n=Xr.installedInjectedWallets(),i=(t=e?.map(l=>xe.getChainIcon(l.id)))!=null?t:[],o=r.map(l=>xe.getWalletIcon(l)),c=n.map(l=>xe.getWalletIcon(l));await this.loadImages([...i,...o,...c])}else De.setIsDataLoaded(!0)}async preloadCustomImages(){const t=xe.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),Wr.openToast("Failed preloading","error")}}};rm([gt()],yf.prototype,"preload",2),yf=rm([Re("w3m-explorer-context")],yf);var GI=Object.defineProperty,ZI=Object.getOwnPropertyDescriptor,nm=(t,e,r,n)=>{for(var i=n>1?void 0:n?ZI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&GI(e,r,i),i};let bf=class extends $e{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const t=De.getSelectedChain();this.activeChainId=t?.id,this.unwatchNetwork=Nt.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(De.setSelectedChain(r),this.activeChainId=r.id,Et.resetBalance(),this.fetchBalance())})}disconnectedCallback(){var t;(t=this.unwatchNetwork)==null||t.call(this)}async fetchBalance(){if(jt.state.enableAccountView)try{await Et.fetchBalance()}catch(t){console.error(t),Wr.openToast(xe.getErrorMessage(t),"error")}}};nm([gt()],bf.prototype,"activeChainId",2),bf=nm([Re("w3m-network-context")],bf);var YI=Object.defineProperty,JI=Object.getOwnPropertyDescriptor,XI=(t,e,r,n)=>{for(var i=n>1?void 0:n?JI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&YI(e,r,i),i};let im=class extends $e{constructor(){super(),this.unsubscribeTheme=void 0,je.setTheme(),this.unsubscribeTheme=Ln.subscribe(je.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=Ln.state,e=[t?.["--w3m-background-image-url"],t?.["--w3m-logo-image-url"]].filter(Boolean);e.length&&await Promise.all(e.map(async r=>xe.preloadImage(r)))}catch{console.info("Unsuccessful attempt at preloading some images")}}};im=XI([Re("w3m-theme-context")],im);var QI=Object.defineProperty,eO=Object.getOwnPropertyDescriptor,tO=(t,e,r,n)=>{for(var i=n>1?void 0:n?eO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&QI(e,r,i),i};const rO=18e4,sm=1e3;var om;let am=class extends $e{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=(om=De.state.selectedChain)==null?void 0:om.id,this.isAccountConnected=Et.state.isConnected,this.lastRetry=Date.now(),this.unwatchOptions=De.subscribe(t=>{var e,r;((e=t.selectedChain)==null?void 0:e.id)!==this.selectedChainId&&(this.selectedChainId=(r=t.selectedChain)==null?void 0:r.id,this.connectAndWait())}),this.unwatchAccount=Et.subscribe(t=>{(this.isAccountConnected!==t.isConnected||!this.isGenerated)&&(this.isAccountConnected=t.isConnected,setTimeout(this.connectAndWait.bind(this),0))}),document.addEventListener("visibilitychange",this.onVisibilityChange.bind(this))}disconnectedCallback(){var t,e;(t=this.unwatchOptions)==null||t.call(this),(e=this.unwatchAccount)==null||e.call(this),document.removeEventListener("visibilitychange",this.onVisibilityChange)}async connectAndWait(){if(clearTimeout(this.timeout),!this.isAccountConnected){this.isGenerated=!0,this.timeout=setTimeout(this.connectAndWait.bind(this),rO);try{const{standaloneUri:t,selectedChain:e}=De.state;t?hr.setPairingUri(t):await Nt.client().connectWalletConnect(r=>hr.setPairingUri(r),e?.id)}catch(t){console.error(t),hr.setPairingError(!0),Wr.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=sm&&(this.lastRetry=Date.now(),this.connectAndWait())}}}onVisibilityChange(){!document.hidden&&Ie.isMobile()&&setTimeout(this.connectAndWait.bind(this),sm)}};am=tO([Re("w3m-wc-connection-context")],am);const nO=Ve`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:var(--w3m-button-border-radius);padding:4px 4px 4px 8px}div button{border-radius:var(--w3m-secondary-button-border-radius);padding:4px 8px;padding-left:4px;height:auto;margin-left:10px;color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}.w3m-no-avatar{padding-left:8px}button::after{content:'';top:0;bottom:0;left:0;right: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 iO=Object.defineProperty,sO=Object.getOwnPropertyDescriptor,_f=(t,e,r,n)=>{for(var i=n>1?void 0:n?sO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&iO(e,r,i),i};let Ks=class extends $e{constructor(){super(),this.balance="hide",this.avatar="show",xe.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=De.state;t||(gi.click({name:"ACCOUNT_BUTTON"}),Nr.open({route:"Account"}))}accountTemplate(){const t=this.avatar==="show";return oe`${t?oe`<w3m-avatar></w3m-avatar>`:null}<w3m-address-text></w3m-address-text>`}render(){const t=this.balance==="show",e={"w3m-no-avatar":this.avatar==="hide"};return t?oe`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}" class="${Lr(e)}">${this.accountTemplate()}</button></div>`:oe`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};Ks.styles=[je.globalCss,nO],_f([Ae()],Ks.prototype,"balance",2),_f([Ae()],Ks.prototype,"avatar",2),Ks=_f([Re("w3m-account-button")],Ks);const oO=Ve`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){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 aO=Object.defineProperty,cO=Object.getOwnPropertyDescriptor,Ef=(t,e,r,n)=>{for(var i=n>1?void 0:n?cO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&aO(e,r,i),i};let ha=class extends $e{constructor(){super(),this.chainId=0,this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=De.state;this.chainId=t?.id,this.label=t?.name,this.unsubscribeNetwork=De.subscribe(({selectedChain:e})=>{this.chainId=e?.id,this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){tt.push("SelectNetwork")}render(){const{chains:t,selectedChain:e}=De.state,r=t?.map(o=>o.id),n=e&&r?.includes(e.id),i=t&&t.length<=1&&n;return oe`<button @click="${this.onClick}" ?disabled="${i}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};ha.styles=[je.globalCss,oO],Ef([gt()],ha.prototype,"chainId",2),Ef([gt()],ha.prototype,"label",2),ha=Ef([Re("w3m-account-network-button")],ha);const lO=Ve`@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 uO=Object.defineProperty,hO=Object.getOwnPropertyDescriptor,fa=(t,e,r,n)=>{for(var i=n>1?void 0:n?hO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&uO(e,r,i),i};let ns=class extends $e{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=Et.state.address,this.name=Et.state.profileName,this.loading=!!Et.state.profileLoading,this.unsubscribeAccount=Et.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;const e=this.variant==="button",r={"w3m-loading":this.loading};return oe`<w3m-text class="${Lr(r)}" variant="${e?"medium-regular":"big-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:xe.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};ns.styles=[je.globalCss,lO],fa([gt()],ns.prototype,"address",2),fa([gt()],ns.prototype,"name",2),fa([gt()],ns.prototype,"loading",2),fa([Ae()],ns.prototype,"variant",2),ns=fa([Re("w3m-address-text")],ns);const Mr={onConnecting(t){xe.goToConnectingView(t)},onExternal(t){xe.handleConnectorConnection(t)},manualWalletsTemplate(){return Xr.manualWallets().map(t=>oe`<w3m-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},recomendedWalletsTemplate(t=!1){return Xr.recomendedWallets(t).map(e=>oe`<w3m-wallet-button walletId="${e.id}" imageId="${e.image_id}" name="${e.name}" .onClick="${()=>this.onConnecting(e)}"></w3m-wallet-button>`)},externalWalletsTemplate(){return Xr.externalWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${()=>this.onExternal(t.id)}"></w3m-wallet-button>`)},recentWalletTemplate(){const t=Xr.recentWallet();if(t)return oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`},installedInjectedWalletsTemplate(){return Xr.installedInjectedWallets().map(t=>oe`<w3m-wallet-button .installed="${!0}" name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},injectedWalletsTemplate(){return Xr.injectedWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)}},fO=Ve`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.w3m-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.w3m-track svg{margin:0 5px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--w3m-wallet-icon-border-radius)}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-title{display:flex;align-items:center;margin-bottom:10px}.w3m-title svg{margin-right:6px}.w3m-title path{fill:var(--w3m-accent-color)}w3m-modal-footer .w3m-title{padding:0 10px}w3m-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--w3m-color-bg-1))}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var dO=Object.defineProperty,pO=Object.getOwnPropertyDescriptor,gO=(t,e,r,n)=>{for(var i=n>1?void 0:n?pO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&dO(e,r,i),i};let xf=class extends $e{onGoToQrcode(){tt.push("Qrcode")}onGetWallet(){tt.push("GetWallet")}render(){const{recomendedWallets:t}=nr.state,e=[...t,...t],r=Mr.externalWalletsTemplate(),n=Mr.installedInjectedWalletsTemplate(),i=[...n,...r].length>0,o=Ie.RECOMMENDED_WALLET_AMOUNT*2;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Ne.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-title">${Ne.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">WalletConnect</w3m-text></div><div class="w3m-slider"><div class="w3m-track">${[...Array(o)].map((c,l)=>{const h=e[l%e.length];return h?oe`<w3m-wallet-image walletId="${h.id}" imageId="${h.image_id}"></w3m-wallet-image>`:Ne.WALLET_PLACEHOLDER})}</div><w3m-button-big @click="${xe.handleAndroidLinking}"><w3m-text variant="medium-regular" color="inverse">Select Wallet</w3m-text></w3m-button-big></div></w3m-modal-content>${i?oe`<w3m-modal-footer><div class="w3m-title">${Ne.WALLET_ICON}<w3m-text variant="small-regular" color="accent">Other</w3m-text></div><div class="w3m-grid">${n} ${r}</div></w3m-modal-footer>`:null}<w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Choose WalletConnect to see supported apps on your device${i?", or select from other options":""}`}</w3m-text><w3m-button variant="outline" .iconRight="${Ne.ARROW_UP_RIGHT_ICON}" .onClick="${()=>this.onGetWallet()}">I don't have a wallet</w3m-button></w3m-info-footer>`}};xf.styles=[je.globalCss,fO],xf=gO([Re("w3m-android-wallet-selection")],xf);const mO=Ve`@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 wO=Object.defineProperty,vO=Object.getOwnPropertyDescriptor,da=(t,e,r,n)=>{for(var i=n>1?void 0:n?vO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&wO(e,r,i),i};let is=class extends $e{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=Et.state.address,this.avatar=Et.state.profileAvatar,this.loading=!!Et.state.profileLoading,this.unsubscribeAccount=Et.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?oe`<img class="${Lr(t)}" src="${this.avatar}">`:this.address?(xe.generateAvatarColors(this.address),oe`<div class="${Lr(t)}">${this.loading?oe`<div class="w3m-loader"></div>`:null}</div>`):null}};is.styles=[je.globalCss,mO],da([gt()],is.prototype,"address",2),da([gt()],is.prototype,"avatar",2),da([gt()],is.prototype,"loading",2),da([Ae()],is.prototype,"size",2),is=da([Re("w3m-avatar")],is);const yO=Ve`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var bO=Object.defineProperty,_O=Object.getOwnPropertyDescriptor,Cf=(t,e,r,n)=>{for(var i=n>1?void 0:n?_O(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&bO(e,r,i),i};let pa=class extends $e{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=Et.state.balance)==null?void 0:t.symbol,this.amount=(e=Et.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=Et.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"?t=0:typeof this.amount=="string"&&this.amount.length>6?t=parseFloat(this.amount).toFixed(3):typeof this.amount=="string"&&(t=parseFloat(this.amount)),oe`<div><w3m-token-image symbol="${this.symbol}"></w3m-token-image><w3m-text variant="medium-regular" color="primary">${t} ${this.symbol}</w3m-text></div>`}};pa.styles=[je.globalCss,yO],Cf([gt()],pa.prototype,"symbol",2),Cf([gt()],pa.prototype,"amount",2),pa=Cf([Re("w3m-balance")],pa);const EO=Ve`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-accent-fill-color)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var xO=Object.defineProperty,CO=Object.getOwnPropertyDescriptor,Bc=(t,e,r,n)=>{for(var i=n>1?void 0:n?CO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&xO(e,r,i),i};let ss=class extends $e{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,xe.rejectStandaloneButtonComponent(),this.modalUnsub=Nr.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"?Ne.WALLET_CONNECT_ICON:null}onClick(){Et.state.isConnected?this.onDisconnect():this.onConnect()}async onConnect(){this.loading=!0,gi.click({name:"CONNECT_BUTTON"}),await Nr.open(),Nr.state.open||(this.loading=!1)}async onDisconnect(){gi.click({name:"DISCONNECT_BUTTON"}),await Nt.client().disconnect()}render(){return oe`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${this.loading?oe`<w3m-spinner></w3m-spinner><w3m-text variant="medium-regular" color="accent">Connecting...</w3m-text>`:oe`${this.iconTemplate()}<w3m-text variant="medium-regular" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};ss.styles=[je.globalCss,EO],Bc([gt()],ss.prototype,"loading",2),Bc([Ae()],ss.prototype,"label",2),Bc([Ae()],ss.prototype,"icon",2),ss=Bc([Re("w3m-connect-button")],ss);const IO=Ve`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:90px;height:90px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.w3m-stale svg,.w3m-stale use{display:none}`;var OO=Object.defineProperty,AO=Object.getOwnPropertyDescriptor,Gs=(t,e,r,n)=>{for(var i=n>1?void 0:n?AO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&OO(e,r,i),i};let xi=class extends $e{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=Ln.state.themeVariables)==null?void 0:t["--w3m-wallet-icon-large-border-radius"])!=null?e:je.getPreset("--w3m-wallet-icon-large-border-radius");let n=0;r.includes("%")?n=88/100*parseInt(r,10):n=parseInt(r,10),n*=1.17;const i=317-n*1.57,o=425-n*1.8;return oe`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="w3m-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#w3m-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${o}"></use></svg>`}render(){const t={"w3m-error":this.isError,"w3m-stale":this.isStale};return oe`<div class="${Lr(t)}">${this.svgLoaderTemplate()}<w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}"></w3m-wallet-image></div><w3m-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</w3m-text>`}};xi.styles=[je.globalCss,IO],Gs([Ae()],xi.prototype,"walletId",2),Gs([Ae()],xi.prototype,"imageId",2),Gs([Ae()],xi.prototype,"isError",2),Gs([Ae()],xi.prototype,"isStale",2),Gs([Ae()],xi.prototype,"label",2),xi=Gs([Re("w3m-connector-waiting")],xi);var SO=Object.defineProperty,DO=Object.getOwnPropertyDescriptor,Zs=(t,e,r,n)=>{for(var i=n>1?void 0:n?DO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&SO(e,r,i),i};let Ci=class extends $e{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.avatar="show",this.balance="hide",this.unsubscribeAccount=void 0,xe.rejectStandaloneButtonComponent(),this.isConnected=Et.state.isConnected,this.unsubscribeAccount=Et.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=jt.state,e=this.balance,r=this.label,n=this.icon,i=this.avatar;return this.isConnected&&t?oe`<w3m-account-button balance="${e}" avatar="${i}"></w3m-account-button>`:oe`<w3m-connect-button label="${this.isConnected?"Disconnect":r}" icon="${n}"></w3m-connect-button>`}};Zs([gt()],Ci.prototype,"isConnected",2),Zs([Ae()],Ci.prototype,"label",2),Zs([Ae()],Ci.prototype,"icon",2),Zs([Ae()],Ci.prototype,"avatar",2),Zs([Ae()],Ci.prototype,"balance",2),Ci=Zs([Re("w3m-core-button")],Ci);const $O=Ve`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-accent-color)}`;var PO=Object.defineProperty,TO=Object.getOwnPropertyDescriptor,RO=(t,e,r,n)=>{for(var i=n>1?void 0:n?TO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&PO(e,r,i),i};let If=class extends $e{render(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,enableExplorer:r}=jt.state,n=e!=="ALL"&&r,i=Mr.manualWalletsTemplate(),o=Mr.recomendedWalletsTemplate(),c=Mr.externalWalletsTemplate(),l=Mr.recentWalletTemplate(),h=Mr.installedInjectedWalletsTemplate();let d=[l,...i,...o];t||(d=[...h,l,...c,...i,...o]),d=d.filter(Boolean);const v=d.length>4||n;let E=[];v?E=d.slice(0,3):E=d;const _=!!E.length;return oe`<w3m-modal-header .border="${!0}" title="Connect your wallet" .onAction="${xe.handleUriCopy}" .actionIcon="${Ne.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${Ne.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${Ne.SCAN_ICON}<w3m-text variant="small-regular" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${_?oe`<w3m-modal-footer><div class="w3m-desktop-title">${Ne.DESKTOP_ICON}<w3m-text variant="small-regular" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${E} ${v?oe`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};If.styles=[je.globalCss,$O],If=RO([Re("w3m-desktop-wallet-selection")],If);const NO=Ve`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var LO=Object.defineProperty,MO=Object.getOwnPropertyDescriptor,UO=(t,e,r,n)=>{for(var i=n>1?void 0:n?MO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&LO(e,r,i),i};let Of=class extends $e{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=jt.state;return t??e?oe`<div><w3m-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?oe`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?oe`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</w3m-text></div>`:null}};Of.styles=[je.globalCss,NO],Of=UO([Re("w3m-legal-notice")],Of);const jO=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var FO=Object.defineProperty,BO=Object.getOwnPropertyDescriptor,kO=(t,e,r,n)=>{for(var i=n>1?void 0:n?BO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&FO(e,r,i),i};let Af=class extends $e{onQrcode(){tt.push("Qrcode")}render(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,enableExplorer:r}=jt.state,n=e!=="ALL"&&r,i=Mr.manualWalletsTemplate(),o=Mr.recomendedWalletsTemplate(),c=Mr.externalWalletsTemplate(),l=Mr.recentWalletTemplate(),h=Mr.installedInjectedWalletsTemplate();let d=[l,...i,...o];t||(d=[...h,l,...c,...i,...o]),d=d.filter(Boolean);const v=d.length>8||n;let E=[];v?E=d.slice(0,7):E=d;const _=!!E.length;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Ne.QRCODE_ICON}"></w3m-modal-header>${_?oe`<w3m-modal-content><div>${E} ${v?oe`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-content>`:null}`}};Af.styles=[je.globalCss,jO],Af=kO([Re("w3m-mobile-wallet-selection")],Af);const HO=Ve`:host{all:initial}.w3m-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--w3m-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}@media(max-height:720px) and (orientation:landscape){.w3m-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.w3m-active{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) var(--w3m-container-border-radius) var(--w3m-container-border-radius);border:1px solid var(--w3m-color-overlay);overflow:hidden}.w3m-card{width:100%;position:relative;border-radius:var(--w3m-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) 0 0}.w3m-card{border-radius:var(--w3m-container-border-radius) var(--w3m-container-border-radius) 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:440px){.w3m-container{border:0}}`;var zO=Object.defineProperty,WO=Object.getOwnPropertyDescriptor,Sf=(t,e,r,n)=>{for(var i=n>1?void 0:n?WO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&zO(e,r,i),i};let Ys=class extends $e{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Nr.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return xe.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return xe.getShadowRootElement(this,".w3m-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("w3m-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="w3m-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&&Nr.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=xe.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([es(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,es(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=xe.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([es(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,es(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?Nr.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}managedModalContextTemplate(){const{isStandalone:t}=De.state;return t?null:oe`<w3m-wc-connection-context></w3m-wc-connection-context><w3m-account-context></w3m-account-context><w3m-network-context></w3m-network-context>`}render(){const t={"w3m-overlay":!0,"w3m-active":this.active};return oe`<w3m-explorer-context></w3m-explorer-context><w3m-theme-context></w3m-theme-context>${this.managedModalContextTemplate()}<div id="w3m-modal" class="${Lr(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="w3m-container" tabindex="0">${this.open?oe`<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>`}};Ys.styles=[je.globalCss,HO],Sf([gt()],Ys.prototype,"open",2),Sf([gt()],Ys.prototype,"active",2),Ys=Sf([Re("w3m-modal")],Ys);const qO=Ve`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var VO=Object.defineProperty,KO=Object.getOwnPropertyDescriptor,kc=(t,e,r,n)=>{for(var i=n>1?void 0:n?KO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&VO(e,r,i),i};let os=class extends $e{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,xe.rejectStandaloneButtonComponent();const{selectedChain:t}=De.state;this.onSetChainData(t),this.unsubscribeNetwork=De.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=De.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(){gi.click({name:"NETWORK_BUTTON"}),Nr.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=De.state,r=e&&e.length>1;return oe`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="medium-regular" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};os.styles=[je.globalCss,qO],kc([gt()],os.prototype,"chainId",2),kc([gt()],os.prototype,"label",2),kc([gt()],os.prototype,"wrongNetwork",2),os=kc([Re("w3m-network-switch")],os);const GO=Ve`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:1px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-network-image{width:92px;height:92px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}`;var ZO=Object.defineProperty,YO=Object.getOwnPropertyDescriptor,Hc=(t,e,r,n)=>{for(var i=n>1?void 0:n?YO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&ZO(e,r,i),i};let Js=class extends $e{constructor(){super(...arguments),this.chainId=void 0,this.isError=!1,this.label=""}svgLoaderTemplate(){return oe`<svg width="54" height="59" viewBox="0 0 54 59" fill="none" class="w3m-loader"><path id="w3m-loader-path" 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"/><use xlink:href="#w3m-loader-path" stroke-dasharray="54 118" stroke-dashoffset="172"></use></svg>`}render(){const t={"w3m-error":this.isError};return oe`<div class="${Lr(t)}">${this.svgLoaderTemplate()}<w3m-network-image chainId="${this.chainId}"></w3m-network-image></div><w3m-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Switch declined":this.label}</w3m-text>`}};Js.styles=[je.globalCss,GO],Hc([Ae()],Js.prototype,"chainId",2),Hc([Ae()],Js.prototype,"isError",2),Hc([Ae()],Js.prototype,"label",2),Js=Hc([Re("w3m-network-waiting")],Js);const JO=Ve`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var XO=Object.defineProperty,QO=Object.getOwnPropertyDescriptor,as=(t,e,r,n)=>{for(var i=n>1?void 0:n?QO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&XO(e,r,i),i};let Yn=class extends $e{constructor(){super(...arguments),this.isMobile=!1,this.isInjected=!1,this.isInjectedInstalled=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Ie.isMobile()?tt.replace("MobileConnecting"):tt.replace("MobileQrcodeConnecting")}onInjected(){this.isInjectedInstalled?tt.replace("InjectedConnecting"):tt.replace("InstallWallet")}onDesktop(){tt.replace("DesktopConnecting")}onWeb(){tt.replace("WebConnecting")}render(){const{isStandalone:t}=De.state;return oe`<div>${this.isRetry?oe`<slot></slot>`:null} ${this.isMobile?oe`<w3m-button .onClick="${this.onMobile}" .iconLeft="${Ne.MOBILE_ICON}" variant="outline">Mobile</w3m-button>`:null} ${this.isInjected&&!t?oe`<w3m-button .onClick="${this.onInjected}" .iconLeft="${Ne.WALLET_ICON}" variant="outline">Browser</w3m-button>`:null} ${this.isDesktop?oe`<w3m-button .onClick="${this.onDesktop}" .iconLeft="${Ne.DESKTOP_ICON}" variant="outline">Desktop</w3m-button>`:null} ${this.isWeb?oe`<w3m-button .onClick="${this.onWeb}" .iconLeft="${Ne.GLOBE_ICON}" variant="outline">Web</w3m-button>`:null}</div>`}};Yn.styles=[je.globalCss,JO],as([Ae()],Yn.prototype,"isMobile",2),as([Ae()],Yn.prototype,"isInjected",2),as([Ae()],Yn.prototype,"isInjectedInstalled",2),as([Ae()],Yn.prototype,"isDesktop",2),as([Ae()],Yn.prototype,"isWeb",2),as([Ae()],Yn.prototype,"isRetry",2),Yn=as([Re("w3m-platform-selection")],Yn);const eA=Ve`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--w3m-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--w3m-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--w3m-wallet-icon-border-radius)/ 2);border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var tA=Object.defineProperty,rA=Object.getOwnPropertyDescriptor,nA=(t,e,r,n)=>{for(var i=n>1?void 0:n?rA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&tA(e,r,i),i};let Df=class extends $e{onClick(){tt.push("WalletExplorer")}render(){const{recomendedWallets:t}=nr.state,e=Xr.manualWallets(),r=[...t,...e].reverse().slice(0,4);return oe`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{const i=xe.getWalletIcon(n);if(i)return oe`<img src="${i}">`;const o=xe.getWalletIcon({id:n.id});return o?oe`<img src="${o}">`:Ne.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Ne.WALLET_PLACEHOLDER)}</div><w3m-text variant="xsmall-regular">View All</w3m-text></button>`}};Df.styles=[je.globalCss,eA],Df=nA([Re("w3m-view-all-wallets-button")],Df);const iA=Ve`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var sA=Object.defineProperty,oA=Object.getOwnPropertyDescriptor,zc=(t,e,r,n)=>{for(var i=n>1?void 0:n?oA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&sA(e,r,i),i};let Xs=class extends $e{constructor(){super(),this.walletId="",this.imageId="",this.uri="",this.unwatchWcConnection=void 0,setTimeout(()=>{const{pairingUri:t}=hr.state,{standaloneUri:e}=De.state;this.uri=e??t},0),this.unwatchWcConnection=hr.subscribe(t=>{t.pairingUri&&(this.uri=t.pairingUri)})}disconnectedCallback(){var t;(t=this.unwatchWcConnection)==null||t.call(this)}get overlayEl(){return xe.getShadowRootElement(this,".w3m-qr-container")}render(){return oe`<div class="w3m-qr-container">${this.uri?oe`<w3m-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${this.walletId}" imageId="${this.imageId}"></w3m-qrcode>`:oe`<w3m-spinner></w3m-spinner>`}</div>`}};Xs.styles=[je.globalCss,iA],zc([Ae()],Xs.prototype,"walletId",2),zc([Ae()],Xs.prototype,"imageId",2),zc([gt()],Xs.prototype,"uri",2),Xs=zc([Re("w3m-walletconnect-qr")],Xs);const aA=Ve`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-success-color);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-success-color),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var cA=Object.defineProperty,lA=Object.getOwnPropertyDescriptor,uA=(t,e,r,n)=>{for(var i=n>1?void 0:n?lA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&cA(e,r,i),i};let $f=class extends $e{async onDisconnect(){await Nt.client().disconnect()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=Et.state.address)!=null?t:""),Wr.openToast("Address copied","success")}render(){return oe`<w3m-modal-content><div class="w3m-profile"><div class="w3m-info"><w3m-avatar size="medium"></w3m-avatar><w3m-address-text variant="modal"></w3m-address-text></div><div class="w3m-connection-badge"><w3m-text variant="small-regular" color="secondary">Connected</w3m-text></div></div></w3m-modal-content><div class="w3m-balance"><w3m-balance></w3m-balance></div><w3m-modal-footer><div class="w3m-footer"><w3m-account-network-button></w3m-account-network-button><w3m-box-button label="Copy Address" .onClick="${this.onCopyAddress}" .icon="${Ne.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${Ne.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};$f.styles=[je.globalCss,aA],$f=uA([Re("w3m-account-view")],$f);var hA=Object.defineProperty,fA=Object.getOwnPropertyDescriptor,dA=(t,e,r,n)=>{for(var i=n>1?void 0:n?fA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&hA(e,r,i),i};let Pf=class extends $e{viewTemplate(){return Ie.isAndroid()?oe`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Ie.isMobile()?oe`<w3m-mobile-wallet-selection></w3m-mobile-wallet-selection>`:oe`<w3m-desktop-wallet-selection></w3m-desktop-wallet-selection>`}render(){return oe`${this.viewTemplate()}<w3m-legal-notice></w3m-legal-notice>`}};Pf.styles=[je.globalCss],Pf=dA([Re("w3m-connect-wallet-view")],Pf);const pA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var gA=Object.defineProperty,mA=Object.getOwnPropertyDescriptor,cm=(t,e,r,n)=>{for(var i=n>1?void 0:n?mA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&gA(e,r,i),i};let Wc=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openDesktopApp(),this.unwatchConnection=hr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Ie.getWalletRouterData(),n=e?.native;if(n){const i=Ie.formatNativeUrl(n,t,r);Ie.openHref(i,"_self")}}openDesktopApp(){hr.setPairingError(!1);const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state,r=Ie.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Ie.getWalletRouterData(),{isMobile:n,isInjected:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Ne.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</w3m-text><w3m-platform-selection .isMobile="${n}" .isInjected="${i}" .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Ne.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};Wc.styles=[je.globalCss,pA],cm([gt()],Wc.prototype,"isError",2),Wc=cm([Re("w3m-desktop-connecting-view")],Wc);const wA=Ve`.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 vA=Object.defineProperty,yA=Object.getOwnPropertyDescriptor,bA=(t,e,r,n)=>{for(var i=n>1?void 0:n?yA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&vA(e,r,i),i};let Tf=class extends $e{onGet(t){Ie.openHref(t,"_blank")}render(){const t=nr.state.recomendedWallets.slice(0,5),e=Xr.manualWallets().slice(0,5),r=t.length,n=e.length;return oe`<w3m-modal-header title="Get a wallet"></w3m-modal-header><w3m-modal-content>${r?t.map(i=>oe`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${i.id}" imageId="${i.image_id}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i.name}</w3m-text><w3m-button .iconRight="${Ne.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(i.homepage)}">Get</w3m-button></div></div>`):null} ${n?e.map(i=>oe`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${i.id}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i.name}</w3m-text><w3m-button .iconRight="${Ne.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(i.links.universal)}">Get</w3m-button></div></div>`):null}</w3m-modal-content><div class="w3m-footer-actions"><w3m-text variant="medium-regular">Not what you're looking for?</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With hundreds of wallets out there, there's something for everyone</w3m-text><w3m-button .onClick="${xe.openWalletExplorerUrl}" .iconRight="${Ne.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Tf.styles=[je.globalCss,wA],Tf=bA([Re("w3m-get-wallet-view")],Tf);const _A=Ve`.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 EA=Object.defineProperty,xA=Object.getOwnPropertyDescriptor,CA=(t,e,r,n)=>{for(var i=n>1?void 0:n?xA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&EA(e,r,i),i};let Rf=class extends $e{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){jt.state.enableExplorer?tt.push("GetWallet"):xe.openWalletExplorerUrl()}onLearnMore(){Ie.openHref(this.learnUrl,"_blank")}render(){return oe`<w3m-modal-header title="What is a wallet?"></w3m-modal-header><w3m-modal-content><div class="w3m-info-container"><div class="w3m-images">${Ne.HELP_CHART_IMG} ${Ne.HELP_PAINTING_IMG} ${Ne.HELP_ETH_IMG}</div><w3m-text variant="medium-regular">A home for your digital assets</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Ne.HELP_KEY_IMG} ${Ne.HELP_USER_IMG} ${Ne.HELP_LOCK_IMG}</div><w3m-text variant="medium-regular">One login for all of web3</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">Log in to any app by connecting your wallet. Say goodbye to countless passwords!</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Ne.HELP_COMPAS_IMG} ${Ne.HELP_NOUN_IMG} ${Ne.HELP_DAO_IMG}</div><w3m-text variant="medium-regular">Your gateway to a new web</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.</w3m-text></div><div class="w3m-footer-actions"><w3m-button .onClick="${this.onGet.bind(this)}" .iconLeft="${Ne.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${Ne.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};Rf.styles=[je.globalCss,_A],Rf=CA([Re("w3m-help-view")],Rf);const IA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var OA=Object.defineProperty,AA=Object.getOwnPropertyDescriptor,lm=(t,e,r,n)=>{for(var i=n>1?void 0:n?AA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&OA(e,r,i),i};let qc=class extends $e{constructor(){super(),this.isError=!1,this.connector=Nt.client().getConnectorById("injected"),this.openInjectedApp()}async openInjectedApp(){const{ready:t}=this.connector;t&&(this.isError=!1,await xe.handleConnectorConnection("injected",()=>{this.isError=!0}))}render(){const{name:t,id:e,image_id:r}=Ie.getWalletRouterData(),{isMobile:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">Connection can be declined if multiple wallets are installed or previous request is still active</w3m-text><w3m-platform-selection .isMobile="${n}" .isDesktop="${i}" .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${this.openInjectedApp.bind(this)}" .disabled="${!this.isError}" .iconRight="${Ne.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};qc.styles=[je.globalCss,IA],lm([gt()],qc.prototype,"isError",2),qc=lm([Re("w3m-injected-connecting-view")],qc);const SA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var DA=Object.defineProperty,$A=Object.getOwnPropertyDescriptor,PA=(t,e,r,n)=>{for(var i=n>1?void 0:n?$A(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&DA(e,r,i),i};let Nf=class extends $e{onInstall(t){t&&Ie.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:n}=Ie.getWalletRouterData();return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="Not Detected" .isStale="${!0}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</w3m-text><w3m-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${Ne.ARROW_DOWN_ICON}">Download</w3m-button></w3m-info-footer>`}};Nf.styles=[je.globalCss,SA],Nf=PA([Re("w3m-install-wallet-view")],Nf);const TA=Ve`w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}w3m-info-footer{display:flex;width:100%}.w3m-app-store{justify-content:space-between}.w3m-app-store w3m-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--w3m-wallet-icon-small-border-radius)}.w3m-app-store div{display:flex;align-items:center}.w3m-app-store w3m-button{margin-right:-10px}.w3m-note{flex-direction:column;align-items:center;padding:5px 0}.w3m-note w3m-text{text-align:center}w3m-platform-selection div{display:flex}w3m-platform-selection w3m-button:nth-child(2){margin-left:10px}`;var RA=Object.defineProperty,NA=Object.getOwnPropertyDescriptor,um=(t,e,r,n)=>{for(var i=n>1?void 0:n?NA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&RA(e,r,i),i};let Vc=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openMobileApp(),this.unwatchConnection=hr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t,e=!1){const{mobile:r,name:n}=Ie.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!e){const c=Ie.formatNativeUrl(i,t,n);Ie.openHref(c,"_self")}else if(o){const c=Ie.formatUniversalUrl(o,t,n);Ie.openHref(c,"_self")}}openMobileApp(t=!1){hr.setPairingError(!1);const{standaloneUri:e}=De.state,{pairingUri:r}=hr.state,n=Ie.getWalletRouterData();xe.setRecentWallet(n),e?this.onFormatAndRedirect(e,t):this.onFormatAndRedirect(r,t)}onGoToAppStore(t){t&&Ie.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:n,mobile:i}=Ie.getWalletRouterData(),{isWeb:o}=xe.getCachedRouterWalletPlatforms(),c=n?.ios,l=i?.universal;return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="Tap 'Open' to continue…" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer class="w3m-note"><w3m-text color="secondary" variant="small-thin">You can reload the website to try again ${l?` or open ${t} using a "Backup" instead`:""}</w3m-text><w3m-platform-selection .isWeb="${o}" .isRetry="${!0}"><div><w3m-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Ne.RETRY_ICON}">Retry</w3m-button>${l?oe`<w3m-button variant="outline" .onClick="${()=>this.openMobileApp(!0)}" .iconRight="${Ne.ARROW_UP_RIGHT_ICON}">Backup</w3m-button>`:null}</div></w3m-platform-selection></w3m-info-footer><w3m-info-footer class="w3m-app-store"><div><w3m-wallet-image walletId="${e}" imageId="${r}"></w3m-wallet-image><w3m-text>${`Get ${t}`}</w3m-text></div><w3m-button .iconRight="${Ne.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</w3m-button></w3m-info-footer>`}};Vc.styles=[je.globalCss,TA],um([gt()],Vc.prototype,"isError",2),Vc=um([Re("w3m-mobile-connecting-view")],Vc);const LA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var MA=Object.defineProperty,UA=Object.getOwnPropertyDescriptor,jA=(t,e,r,n)=>{for(var i=n>1?void 0:n?UA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&MA(e,r,i),i};let Lf=class extends $e{render(){const{name:t,id:e,image_id:r}=Ie.getWalletRouterData(),{isInjected:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Ne.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr walletId="${e}" imageId="${r}"></w3m-walletconnect-qr></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Scan this qrcode with your phone's camera or inside ${t} app`}</w3m-text><w3m-platform-selection .isDesktop="${i}" .isInjected="${n}" .isWeb="${o}"></w3m-platform-selection></w3m-info-footer>`}};Lf.styles=[je.globalCss,LA],Lf=jA([Re("w3m-mobile-qr-connecting-view")],Lf);var FA=Object.defineProperty,BA=Object.getOwnPropertyDescriptor,kA=(t,e,r,n)=>{for(var i=n>1?void 0:n?BA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&FA(e,r,i),i};let Mf=class extends $e{render(){return oe`<w3m-modal-header title="Scan the code" .onAction="${xe.handleUriCopy}" .actionIcon="${Ne.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Mf.styles=[je.globalCss],Mf=kA([Re("w3m-qrcode-view")],Mf);const HA=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center}`;var hm=Object.defineProperty,zA=Object.defineProperties,WA=Object.getOwnPropertyDescriptor,qA=Object.getOwnPropertyDescriptors,fm=Object.getOwnPropertySymbols,VA=Object.prototype.hasOwnProperty,KA=Object.prototype.propertyIsEnumerable,dm=(t,e,r)=>e in t?hm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,GA=(t,e)=>{for(var r in e||(e={}))VA.call(e,r)&&dm(t,r,e[r]);if(fm)for(var r of fm(e))KA.call(e,r)&&dm(t,r,e[r]);return t},ZA=(t,e)=>zA(t,qA(e)),Uf=(t,e,r,n)=>{for(var i=n>1?void 0:n?WA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&hm(e,r,i),i};let ga=class extends $e{constructor(){super(),this.connectedChains="ALL",this.isUnsupportedChains=!1,this.getConnectedChainIds()}async getConnectedChainIds(){this.connectedChains=await Nt.client().getConnectedChainIds()}async onSelectChain(t){try{const{selectedChain:e,walletConnectVersion:r,isPreferInjected:n}=De.state,{isConnected:i}=Et.state;i?e?.id===t.id?tt.reset("Account"):r===2?(await Nt.client().switchNetwork({chainId:t.id}),tt.reset("Account")):tt.push("SwitchNetwork",{SwitchNetwork:t}):n?(De.setSelectedChain(t),Nr.close()):(De.setSelectedChain(t),tt.push("ConnectWallet"))}catch(e){console.error(e),Wr.openToast(xe.getErrorMessage(e),"error")}}isUnsuportedChainId(t){return typeof this.connectedChains=="string"&&this.connectedChains!=="ALL"?(this.isUnsupportedChains=!0,!0):Array.isArray(this.connectedChains)&&!this.connectedChains.includes(String(t))?(this.isUnsupportedChains=!0,!0):!1}render(){const{chains:t}=De.state,e=t?.map(n=>ZA(GA({},n),{unsupported:this.isUnsuportedChainId(n.id)})),r=e?.sort((n,i)=>Number(n.unsupported)-Number(i.unsupported));return oe`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div>${r?.map(n=>oe`<w3m-network-button name="${n.name}" chainId="${n.id}" .unsupported="${n.unsupported}" .onClick="${async()=>this.onSelectChain(n)}">${n.name}</w3m-network-button>`)}</div></w3m-modal-content>${this.isUnsupportedChains?oe`<w3m-info-footer><w3m-text color="secondary" variant="small-thin">Your connected wallet may not support some of the networks available for this dapp</w3m-text></w3m-info-footer>`:null}`}};ga.styles=[je.globalCss,HA],Uf([gt()],ga.prototype,"connectedChains",2),Uf([gt()],ga.prototype,"isUnsupportedChains",2),ga=Uf([Re("w3m-select-network-view")],ga);const YA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var JA=Object.defineProperty,XA=Object.getOwnPropertyDescriptor,pm=(t,e,r,n)=>{for(var i=n>1?void 0:n?XA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&JA(e,r,i),i};let Kc=class extends $e{constructor(){super(),this.isError=!1,this.onSwitchNetwork()}async onSwitchNetwork(){try{this.isError=!1;const t=Ie.getSwitchNetworkRouterData();await Nt.client().switchNetwork({chainId:t.id}),De.setSelectedChain(t),tt.reset("Account")}catch{this.isError=!0}}render(){const{id:t,name:e}=Ie.getSwitchNetworkRouterData();return oe`<w3m-modal-header title="${`Connect to ${e}`}"></w3m-modal-header><w3m-modal-content><w3m-network-waiting chainId="${t}" label="Approve in your wallet" .isError="${this.isError}"></w3m-network-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">Switch can be declined if chain is not supported by a wallet or previous request is still active</w3m-text><w3m-button .onClick="${this.onSwitchNetwork.bind(this)}" .disabled="${!this.isError}" .iconRight="${Ne.RETRY_ICON}">Try Again</w3m-button></w3m-info-footer>`}};Kc.styles=[je.globalCss,YA],pm([gt()],Kc.prototype,"isError",2),Kc=pm([Re("w3m-switch-network-view")],Kc);const QA=Ve`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 eS=Object.defineProperty,tS=Object.getOwnPropertyDescriptor,ma=(t,e,r,n)=>{for(var i=n>1?void 0:n?tS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&eS(e,r,i),i};const jf=40;let cs=class extends $e{constructor(){super(...arguments),this.loading=!nr.state.wallets.listings.length,this.firstFetch=!nr.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=xe.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,nr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),nr.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return xe.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}=nr.state,{listings:r,total:n}=this.search?e:t;return n<=jf||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r,injectedWallets:n}=nr.state,{listings:i,total:o,page:c}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>jf&&i.length<o))try{this.loading=!0;const l=(t=De.state.standaloneChains)==null?void 0:t.join(","),{listings:h}=await nr.getWallets({page:this.firstFetch?1:c+1,entries:jf,search:this.search,version:De.state.walletConnectVersion,chains:l}),d=h.map(E=>xe.getWalletIcon(E)),v=n.map(E=>xe.getWalletIcon(E));await Promise.all([...d.map(async E=>xe.preloadImage(E)),...v.map(async E=>xe.preloadImage(E)),Ie.wait(300)]),this.endReached=this.isLastPage()}catch(l){console.error(l),Wr.openToast(xe.getErrorMessage(l),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Ie.isAndroid()?xe.handleMobileLinking(t):xe.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=nr.state,{listings:r}=this.search?e:t,n=this.loading&&!r.length,i=this.search.length>=3;let o=Mr.injectedWalletsTemplate(),c=Mr.manualWalletsTemplate(),l=Mr.recomendedWalletsTemplate(!0);i&&(o=o.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)),c=c.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)),l=l.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)));const h=!this.loading&&!r.length&&!o.length&&!l.length,d=Math.max(o.length,r.length),v={"w3m-loading":n,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":h};return oe`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Lr(v)}"><div class="w3m-grid">${n?null:l} ${n?null:[...Array(d)].map((E,_)=>oe`${c[_]} ${o[_]} ${r[_]?oe`<w3m-wallet-button imageId="${r[_].image_id}" name="${r[_].name}" walletId="${r[_].id}" .onClick="${()=>this.onConnect(r[_])}"></w3m-wallet-button>`:null}`)}</div><div class="w3m-placeholder-block">${h?oe`<w3m-text variant="big-bold" color="secondary">No results found</w3m-text>`:null} ${!h&&this.loading?oe`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};cs.styles=[je.globalCss,QA],ma([gt()],cs.prototype,"loading",2),ma([gt()],cs.prototype,"firstFetch",2),ma([gt()],cs.prototype,"search",2),ma([gt()],cs.prototype,"endReached",2),cs=ma([Re("w3m-wallet-explorer-view")],cs);const rS=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var nS=Object.defineProperty,iS=Object.getOwnPropertyDescriptor,gm=(t,e,r,n)=>{for(var i=n>1?void 0:n?iS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&nS(e,r,i),i};let Gc=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openWebWallet(),this.unwatchConnection=hr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Ie.getWalletRouterData(),n=e?.universal;if(n){const i=Ie.formatUniversalUrl(n,t,r);Ie.openHref(i,"_blank")}}openWebWallet(){hr.setPairingError(!1);const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state,r=Ie.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Ie.getWalletRouterData(),{isMobile:n,isInjected:i,isDesktop:o}=xe.getCachedRouterWalletPlatforms(),c=Ie.isMobile();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Ne.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</w3m-text><w3m-platform-selection .isMobile="${n}" .isInjected="${c?!1:i}" .isDesktop="${c?!1:o}" .isRetry="${!0}"><w3m-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Ne.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};Gc.styles=[je.globalCss,rS],gm([gt()],Gc.prototype,"isError",2),Gc=gm([Re("w3m-web-connecting-view")],Gc);var sS=Object.freeze({__proto__:null,get W3mAccountButton(){return Ks},get W3mConnectButton(){return ss},get W3mCoreButton(){return Ci},get W3mModal(){return Ys},get W3mNetworkSwitch(){return os},get W3mQrCode(){return Zn}});_n.EthereumProvider=tx,_n.OPTIONAL_EVENTS=G7,_n.OPTIONAL_METHODS=K7,_n.REQUIRED_EVENTS=uc,_n.REQUIRED_METHODS=lc,_n.default=hc,Object.defineProperty(_n,"__esModule",{value:!0})});
|
|
151
|
+
`);const c=vC(e,r,i),l=Dc.getSymbolSize(e),h=new aC(l);return dC(h,e),pC(h),gC(h,e),sf(h,r,0),e>=7&&mC(h,e),wC(h,c),isNaN(n)&&(n=tf.getBestMask(h,sf.bind(null,h,r))),tf.applyMask(n,h),sf(h,r,n),{modules:h,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}O3.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=ef.M,i,o;return typeof r<"u"&&(n=ef.from(r.errorCorrectionLevel,ef.M),i=$c.from(r.version),o=tf.from(r.maskPattern),r.toSJISFunc&&Dc.setToSJISFunction(r.toSJISFunc)),bC(e,i,n,o)};var k3={},of={};(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(o){return[o,o]}))),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,o=n.width&&n.width>=21?n.width:void 0,c=n.scale||4;return{width:o,scale:o?4:c,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 o=t.getScale(n,i);return Math.floor((n+i.margin*2)*o)},t.qrToImageData=function(n,i,o){const c=i.modules.size,l=i.modules.data,h=t.getScale(c,o),d=Math.floor((c+o.margin*2)*h),v=o.margin*h,E=[o.color.light,o.color.dark];for(let _=0;_<d;_++)for(let A=0;A<d;A++){let P=(_*d+A)*4,U=o.color.light;if(_>=v&&A>=v&&_<d-v&&A<d-v){const H=Math.floor((_-v)/h),G=Math.floor((A-v)/h);U=E[l[H*c+G]?1:0]}n[P++]=U.r,n[P++]=U.g,n[P++]=U.b,n[P]=U.a}}})(of),function(t){const e=of;function r(i,o,c){i.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=c,o.width=c,o.style.height=c+"px",o.style.width=c+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(o,c,l){let h=l,d=c;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),c||(d=n()),h=e.getOptions(h);const v=e.getImageWidth(o.modules.size,h),E=d.getContext("2d"),_=E.createImageData(v,v);return e.qrToImageData(_.data,o,h),r(E,d,v),E.putImageData(_,0,0),d},t.renderToDataURL=function(o,c,l){let h=l;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),h||(h={});const d=t.render(o,c,h),v=h.type||"image/png",E=h.rendererOpts||{};return d.toDataURL(v,E.quality)}}(k3);var H3={};const _C=of;function z3(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function af(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function EC(t,e,r){let n="",i=0,o=!1,c=0;for(let l=0;l<t.length;l++){const h=Math.floor(l%e),d=Math.floor(l/e);!h&&!o&&(o=!0),t[l]?(c++,l>0&&h>0&&t[l-1]||(n+=o?af("M",h+r,.5+d+r):af("m",i,0),i=0,o=!1),h+1<e&&t[l+1]||(n+=af("h",c),c=0)):i++}return n}H3.render=function(e,r,n){const i=_C.getOptions(r),o=e.modules.size,c=e.modules.data,l=o+i.margin*2,h=i.color.light.a?"<path "+z3(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",d="<path "+z3(i.color.dark,"stroke")+' d="'+EC(c,o,i.margin)+'"/>',v='viewBox="0 0 '+l+" "+l+'"',_='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+v+' shape-rendering="crispEdges">'+h+d+`</svg>
|
|
152
|
+
`;return typeof n=="function"&&n(null,_),_};const xC=U9,cf=O3,W3=k3,CC=H3;function lf(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!xC())throw new Error("Callback required as last argument");if(l){if(c<2)throw new Error("Too few arguments provided");c===2?(i=r,r=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(r=e,e=n=void 0):c===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(h,d){try{const v=cf.create(r,n);h(t(v,e,n))}catch(v){d(v)}})}try{const h=cf.create(r,n);i(null,t(h,e,n))}catch(h){i(h)}}ta.create=cf.create,ta.toCanvas=lf.bind(null,W3.render),ta.toDataURL=lf.bind(null,W3.renderToDataURL),ta.toString=lf.bind(null,function(t,e,r){return CC.render(t,r)});var IC=Object.defineProperty,q3=Object.getOwnPropertySymbols,OC=Object.prototype.hasOwnProperty,AC=Object.prototype.propertyIsEnumerable,V3=(t,e,r)=>e in t?IC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pc=(t,e)=>{for(var r in e||(e={}))OC.call(e,r)&&V3(t,r,e[r]);if(q3)for(var r of q3(e))AC.call(e,r)&&V3(t,r,e[r]);return t};function SC(){var t;const e=(t=Ln.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--w3m-color-fg-1":r.foreground[1],"--w3m-color-fg-2":r.foreground[2],"--w3m-color-fg-3":r.foreground[3],"--w3m-color-bg-1":r.background[1],"--w3m-color-bg-2":r.background[2],"--w3m-color-bg-3":r.background[3],"--w3m-color-overlay":r.overlay}}function K3(){return{"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-wallet-icon-large-border-radius":"30px","--w3m-wallet-icon-small-border-radius":"7px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)"}}function DC(){const{themeVariables:t}=Ln.state;return{"--w3m-background-image-url":t!=null&&t["--w3m-background-image-url"]?`url(${t["--w3m-background-image-url"]})`:"none"}}const je={getPreset(t){return K3()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=Ln.state;if(t){const r=Pc(Pc(Pc(Pc({},SC()),K3()),e),DC());Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:Ve`*,::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;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-accent-fill-color);background:var(--w3m-accent-color)}`},$C=Ve`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-accent-color);border-radius:var(--w3m-icon-button-border-radius);margin-bottom:4px}button path{fill:var(--w3m-accent-fill-color)}`;var PC=Object.defineProperty,TC=Object.getOwnPropertyDescriptor,Tc=(t,e,r,n)=>{for(var i=n>1?void 0:n?TC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&PC(e,r,i),i};let Hs=class extends $e{constructor(){super(...arguments),this.icon=void 0,this.label="",this.onClick=()=>null}render(){return oe`<button @click="${this.onClick}"><div>${this.icon}</div><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};Hs.styles=[je.globalCss,$C],Tc([Ae()],Hs.prototype,"icon",2),Tc([Ae()],Hs.prototype,"label",2),Tc([Ae()],Hs.prototype,"onClick",2),Hs=Tc([Re("w3m-box-button")],Hs);const RC=Ve`button{border-radius:var(--w3m-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--w3m-accent-color)}button path{fill:var(--w3m-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:active::after{background-color:var(--w3m-color-overlay)}.w3m-ghost,.w3m-ghost:active::after,.w3m-outline{background-color:transparent}.w3m-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}.w3m-ghost:hover::after{background-color:transparent}.w3m-ghost:hover{opacity:.5}}button:disabled{background-color:var(--w3m-color-bg-3);pointer-events:none}.w3m-ghost::after{border-color:transparent}.w3m-ghost path{fill:var(--w3m-color-fg-2)}.w3m-outline path{fill:var(--w3m-accent-color)}.w3m-outline:disabled{background-color:transparent;opacity:.5}`;var NC=Object.defineProperty,LC=Object.getOwnPropertyDescriptor,zs=(t,e,r,n)=>{for(var i=n>1?void 0:n?LC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&NC(e,r,i),i};let _i=class extends $e{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0,"w3m-ghost":this.variant==="ghost","w3m-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),oe`<button class="${Lr(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-regular" color="${e}"><slot></slot></w3m-text>${this.iconRight}</button>`}};_i.styles=[je.globalCss,RC],zs([Ae()],_i.prototype,"disabled",2),zs([Ae()],_i.prototype,"iconLeft",2),zs([Ae()],_i.prototype,"iconRight",2),zs([Ae()],_i.prototype,"onClick",2),zs([Ae()],_i.prototype,"variant",2),_i=zs([Re("w3m-button")],_i);const MC=Ve`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--w3m-button-border-radius);color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:active::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-accent-color);background-color:transparent}.w3m-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}}`;var UC=Object.defineProperty,jC=Object.getOwnPropertyDescriptor,uf=(t,e,r,n)=>{for(var i=n>1?void 0:n?jC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&UC(e,r,i),i};let sa=class extends $e{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return oe`<button ?disabled="${this.disabled}" class="${Lr(t)}"><slot></slot></button>`}};sa.styles=[je.globalCss,MC],uf([Ae()],sa.prototype,"disabled",2),uf([Ae()],sa.prototype,"variant",2),sa=uf([Re("w3m-button-big")],sa);const FC=Ve`:host{background-color:var(--w3m-color-bg-2);border-top:1px solid var(--w3m-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var BC=Object.defineProperty,kC=Object.getOwnPropertyDescriptor,HC=(t,e,r,n)=>{for(var i=n>1?void 0:n?kC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&BC(e,r,i),i};let hf=class extends $e{render(){return oe`<div><slot></slot></div>`}};hf.styles=[je.globalCss,FC],hf=HC([Re("w3m-info-footer")],hf);const Ne={CROSS_ICON:ut`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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>`,GLOBE_ICON:ut`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},zC=Ve`.w3m-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--w3m-background-border-radius) * .9);background-color:var(--w3m-background-color);background-image:var(--w3m-background-image-url);background-position:center;background-size:cover}.w3m-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--w3m-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--w3m-color-fg-1)}.w3m-toolbar div{display:flex}.w3m-toolbar div 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)}@media(hover:hover){button:hover{background-color:var(--w3m-color-bg-2)}}`;var WC=Object.defineProperty,qC=Object.getOwnPropertyDescriptor,G3=(t,e,r,n)=>{for(var i=n>1?void 0:n?qC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&WC(e,r,i),i};let Rc=class extends $e{constructor(){super(),this.isHelp=!1,this.unsubscribeRouter=void 0,this.unsubscribeRouter=tt.subscribe(t=>{this.isHelp=t.view==="Help"})}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this)}onHelp(){tt.push("Help")}logoTemplate(){var t;const e=(t=Ln.state.themeVariables)==null?void 0:t["--w3m-logo-image-url"];return e?oe`<img src="${e}">`:Ne.WALLET_CONNECT_LOGO}render(){const t={"w3m-help-active":this.isHelp};return oe`<div class="w3m-toolbar-placeholder"></div><div class="w3m-toolbar">${this.logoTemplate()}<div class="${Lr(t)}"><button @click="${this.onHelp}">${Ne.HELP_ICON}</button> <button @click="${Nr.close}">${Ne.CROSS_ICON}</button></div></div>`}};Rc.styles=[je.globalCss,zC],G3([gt()],Rc.prototype,"isHelp",2),Rc=G3([Re("w3m-modal-backcard")],Rc);const VC=Ve`main{padding:20px;padding-top:0;width:100%}`;var KC=Object.defineProperty,GC=Object.getOwnPropertyDescriptor,ZC=(t,e,r,n)=>{for(var i=n>1?void 0:n?GC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&KC(e,r,i),i};let ff=class extends $e{render(){return oe`<main><slot></slot></main>`}};ff.styles=[je.globalCss,VC],ff=ZC([Re("w3m-modal-content")],ff);const YC=Ve`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var JC=Object.defineProperty,XC=Object.getOwnPropertyDescriptor,QC=(t,e,r,n)=>{for(var i=n>1?void 0:n?XC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&JC(e,r,i),i};let df=class extends $e{render(){return oe`<footer><slot></slot></footer>`}};df.styles=[je.globalCss,YC],df=QC([Re("w3m-modal-footer")],df);const eI=Ve`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}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-accent-color)}`;var tI=Object.defineProperty,rI=Object.getOwnPropertyDescriptor,oa=(t,e,r,n)=>{for(var i=n>1?void 0:n?rI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&tI(e,r,i),i};let es=class extends $e{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return oe`<button class="w3m-back-btn" @click="${tt.goBack}">${Ne.BACK_ICON}</button>`}actionBtnTemplate(){return oe`<button class="w3m-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"w3m-border":this.border},e=tt.state.history.length>1,r=this.title?oe`<w3m-text variant="big-bold">${this.title}</w3m-text>`:oe`<slot></slot>`;return oe`<header class="${Lr(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};es.styles=[je.globalCss,eI],oa([Ae()],es.prototype,"title",2),oa([Ae()],es.prototype,"onAction",2),oa([Ae()],es.prototype,"actionIcon",2),oa([Ae()],es.prototype,"border",2),es=oa([Re("w3m-modal-header")],es);const nI={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"},iI={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"}},Xr={externalWallets(){const{isStandalone:t}=De.state;if(t)return[];let e=Nt.client().getConnectors();return e=e.filter(r=>r.id!=="injected"),e},manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:n}=jt.state,i=(t=Xr.recentWallet())==null?void 0:t.id,o=Ie.isMobile()?r:n,c=o?.filter(l=>i!==l.id);return(e=Ie.isMobile()?c?.map(({id:l,name:h,links:d})=>({id:l,name:h,mobile:d,links:d})):c?.map(({id:l,name:h,links:d})=>({id:l,name:h,desktop:d,links:d})))!=null?e:[]},installedInjectedWallets(){const{isStandalone:t}=De.state;if(t)return[];if(!Nt.client().isInjectedProviderInstalled())return[];const{namespace:e}=Nt.client(),{injectedWallets:r}=nr.state;let n=r.filter(({injected:i})=>!!i.some(o=>Nt.client().safeCheckInjectedProvider(o.injected_id)&&o.namespace===e));return n.length>1&&(n=n.filter(({injected:i})=>!!i.map(({injected_id:o})=>o).every(o=>o!=="isMetaMask"))),n.length?n:[{name:"Browser",id:"browser",image_id:void 0}]},injectedWallets(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,explorerRecommendedWalletIds:r}=jt.state,n=Ie.isMobile();if(t||e==="ALL"||n)return[];const{namespace:i}=Nt.client(),{injectedWallets:o}=nr.state;return o.filter(({id:c,injected:l})=>{const h=Ie.isArray(e)?e:[],d=Ie.isArray(r)?r:[];return!!l.some(v=>v.namespace===i&&!h.includes(c)&&!d.includes(c))})},recentWallet(){return xe.getRecentWallet()},recomendedWallets(t=!1){var e;const r=Xr.installedInjectedWallets().map(({id:c})=>c),n=t||(e=Xr.recentWallet())==null?void 0:e.id,i=[...r,n],{recomendedWallets:o}=nr.state;return o.filter(c=>!i.includes(c.id))}},xe={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET_DATA:"W3M_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",rejectStandaloneButtonComponent(){const{isStandalone:t}=De.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},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=jt.state;return r!=null&&r[t]?r[t]:e?nr.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e?t.split(" ")[0]:t},getChainIcon(t){var e;const r=nI[t],{projectId:n,chainImages:i}=jt.state;return(e=i?.[t])!=null?e:n&&r?nr.getAssetImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=iI[t])==null?void 0:e.icon,{projectId:i,tokenImages:o}=jt.state;return(r=o?.[t])!=null?r:i&&n?nr.getAssetImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=xe.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.src=t});return Promise.race([e,Ie.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},handleMobileLinking(t){const{standaloneUri:e}=De.state,{pairingUri:r}=hr.state,{mobile:n,name:i}=t,o=n?.native,c=n?.universal;xe.setRecentWallet(t);function l(h){let d="";o?d=Ie.formatUniversalUrl(o,h,i):c&&(d=Ie.formatNativeUrl(c,h,i)),Ie.openHref(d,"_self")}l(e||r)},handleAndroidLinking(){const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state;t?(Ie.setWalletConnectAndroidDeepLink(t),Ie.openHref(t,"_self")):(Ie.setWalletConnectAndroidDeepLink(e),Ie.openHref(e,"_self"))},async handleUriCopy(){const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state;t?await navigator.clipboard.writeText(t):await navigator.clipboard.writeText(e),Wr.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=De.state;await Nt.client().connectConnector(t,r?.id),Nr.close()}catch(r){console.error(r),e?e():Wr.openToast(xe.getErrorMessage(r),"error")}},getCustomImageUrls(){const{chainImages:t,walletImages:e}=jt.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},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(o=>{let c=0;for(let h=0;h<o.length;h+=1)c=o.charCodeAt(h)+((c<<5)-c),c=c&c;const l=[0,0,0];for(let h=0;h<3;h+=1){const d=c>>h*8&255;l[h]=d}n.push(`rgb(${l[0]}, ${l[1]}, ${l[2]})`)});const i=document.querySelector(":root");if(i){const o={"--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(o).forEach(([c,l])=>i.style.setProperty(c,l))}},setRecentWallet(t){const{walletConnectVersion:e}=De.state;localStorage.setItem(xe.W3M_RECENT_WALLET_DATA,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(xe.W3M_RECENT_WALLET_DATA);if(t){const{walletConnectVersion:e}=De.state,r=JSON.parse(t);if(r[e])return r[e]}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Ie.openHref(xe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{id:t,desktop:e,mobile:r,injected:n}=Ie.getWalletRouterData(),i=Xr.installedInjectedWallets(),o=!!(n!=null&&n.length),c=i.some(v=>v.id===t),l=!!(e!=null&&e.native),h=!!(e!=null&&e.universal),d=!!(r!=null&&r.native)||!!(r!=null&&r.universal);return{isInjectedInstalled:c,isInjected:o,isDesktop:l,isMobile:d,isWeb:h}},goToConnectingView(t){tt.setData({Wallet:t});const e=Ie.isMobile(),{isDesktop:r,isWeb:n,isMobile:i,isInjectedInstalled:o}=xe.getCachedRouterWalletPlatforms();e?o?tt.push("InjectedConnecting"):i?tt.push("MobileConnecting"):n?tt.push("WebConnecting"):tt.push("InstallWallet"):o?tt.push("InjectedConnecting"):r?tt.push("DesktopConnecting"):n?tt.push("WebConnecting"):i?tt.push("MobileQrcodeConnecting"):tt.push("InstallWallet")}},sI=Ve`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var oI=Object.defineProperty,aI=Object.getOwnPropertyDescriptor,pf=(t,e,r,n)=>{for(var i=n>1?void 0:n?aI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&oI(e,r,i),i};let aa=class extends $e{constructor(){super(),this.view=tt.state.view,this.prevView=tt.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=tt.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&Qi(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),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 xe.getShadowRootElement(this,".w3m-router")}get contentEl(){return xe.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return oe`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return oe`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnecting":return oe`<w3m-injected-connecting-view></w3m-injected-connecting-view>`;case"DesktopConnecting":return oe`<w3m-desktop-connecting-view></w3m-desktop-connecting-view>`;case"MobileConnecting":return oe`<w3m-mobile-connecting-view></w3m-mobile-connecting-view>`;case"WebConnecting":return oe`<w3m-web-connecting-view></w3m-web-connecting-view>`;case"MobileQrcodeConnecting":return oe`<w3m-mobile-qr-connecting-view></w3m-mobile-qr-connecting-view>`;case"GetWallet":return oe`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"WalletExplorer":return oe`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return oe`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return oe`<w3m-help-view></w3m-help-view>`;case"Account":return oe`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return oe`<w3m-switch-network-view></w3m-switch-network-view>`;case"InstallWallet":return oe`<w3m-install-wallet-view></w3m-install-wallet-view>`;default:return oe`<div>Not Found</div>`}}async onChangeRoute(){await Qi(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=tt.state.view,Qi(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return oe`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};aa.styles=[je.globalCss,sI],pf([gt()],aa.prototype,"view",2),pf([gt()],aa.prototype,"prevView",2),aa=pf([Re("w3m-modal-router")],aa);const cI=Ve`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--w3m-notification-border-radius);border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-accent-color)}.w3m-error path{fill:var(--w3m-error-color)}`;var lI=Object.defineProperty,uI=Object.getOwnPropertyDescriptor,Z3=(t,e,r,n)=>{for(var i=n>1?void 0:n?uI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&lI(e,r,i),i};let Nc=class extends $e{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Wr.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Wr.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Wr.closeToast()}render(){const{message:t,variant:e}=Wr.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?oe`<div class="${Lr(r)}">${e==="success"?Ne.CHECKMARK_ICON:null} ${e==="error"?Ne.CROSS_ICON:null}<w3m-text variant="small-regular">${t}</w3m-text></div>`:null}};Nc.styles=[je.globalCss,cI],Z3([gt()],Nc.prototype,"open",2),Nc=Z3([Re("w3m-modal-toast")],Nc);const hI=Ve`button{padding:5px;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px;position:relative}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:active{background-color:var(--w3m-color-overlay)}.w3m-unsupported{opacity:.3}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}`;var fI=Object.defineProperty,dI=Object.getOwnPropertyDescriptor,ca=(t,e,r,n)=>{for(var i=n>1?void 0:n?dI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&fI(e,r,i),i};let ts=class extends $e{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId="",this.unsupported=!1}render(){const t={"w3m-unsupported":this.unsupported};return oe`<button @click="${this.onClick}" class="${Lr(t)}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular">${this.name}</w3m-text></button>`}};ts.styles=[je.globalCss,hI],ca([Ae()],ts.prototype,"onClick",2),ca([Ae()],ts.prototype,"name",2),ca([Ae()],ts.prototype,"chainId",2),ca([Ae()],ts.prototype,"unsupported",2),ts=ca([Re("w3m-network-button")],ts);const pI=Ve`@keyframes loading{to{stroke-dashoffset:0}}:host{width:inherit;height:inherit;position:relative}path{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)}image{clip-path:path('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')}`;var gI=Object.defineProperty,mI=Object.getOwnPropertyDescriptor,Y3=(t,e,r,n)=>{for(var i=n>1?void 0:n?mI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&gI(e,r,i),i};let Lc=class extends $e{constructor(){super(...arguments),this.chainId=""}render(){const t=xe.getChainIcon(this.chainId);return t?oe`<svg width="54" height="59" viewBox="0 0 54 59" fill="none"><image href="${t}"/><image href="${t}" width="54" height="59"/><path 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"/></svg>`:oe`${Ne.NETWORK_PLACEHOLDER}`}};Lc.styles=[je.globalCss,pI],Y3([Ae()],Lc.prototype,"chainId",2),Lc=Y3([Re("w3m-network-image")],Lc);const wI=.1,J3=2.5,Gn=7;function gf(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+wI}function vI(t,e){const r=Array.prototype.slice.call(ta.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,o,c)=>(c%n===0?i.push([o]):i[i.length-1].push(o))&&i,[])}const yI={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",o=n==="light"?"#fff":"#141414",c=[],l=vI(t,"Q"),h=e/l.length,d=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];d.forEach(({x:U,y:H})=>{const G=(l.length-Gn)*h*U,N=(l.length-Gn)*h*H,L=.32;for(let $=0;$<d.length;$+=1){const T=h*(Gn-$*2);c.push(ut`<rect fill="${$%2===0?i:o}" height="${T}" rx="${T*L}" ry="${T*L}" width="${T}" x="${G+h*$}" y="${N+h*$}">`)}});const v=Math.floor((r+25)/h),E=l.length/2-v/2,_=l.length/2+v/2-1,A=[];l.forEach((U,H)=>{U.forEach((G,N)=>{if(l[H][N]&&!(H<Gn&&N<Gn||H>l.length-(Gn+1)&&N<Gn||H<Gn&&N>l.length-(Gn+1))&&!(H>E&&H<_&&N>E&&N<_)){const L=H*h+h/2,$=N*h+h/2;A.push([L,$])}})});const P={};return A.forEach(([U,H])=>{P[U]?P[U].push(H):P[U]=[H]}),Object.entries(P).map(([U,H])=>{const G=H.filter(N=>H.every(L=>!gf(N,L,h)));return[Number(U),G]}).forEach(([U,H])=>{H.forEach(G=>{c.push(ut`<circle cx="${U}" cy="${G}" fill="${i}" r="${h/J3}">`)})}),Object.entries(P).filter(([U,H])=>H.length>1).map(([U,H])=>{const G=H.filter(N=>H.some(L=>gf(N,L,h)));return[Number(U),G]}).map(([U,H])=>{H.sort((N,L)=>N<L?-1:1);const G=[];for(const N of H){const L=G.find($=>$.some(T=>gf(N,T,h)));L?L.push(N):G.push([N])}return[U,G.map(N=>[N[0],N[N.length-1]])]}).forEach(([U,H])=>{H.forEach(([G,N])=>{c.push(ut`<line x1="${U}" x2="${U}" y1="${G}" y2="${N}" stroke="${i}" stroke-width="${h/(J3/2)}" stroke-linecap="round">`)})}),c}},bI=Ve`@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:var(--w3m-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-accent-color)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var _I=Object.defineProperty,EI=Object.getOwnPropertyDescriptor,Ws=(t,e,r,n)=>{for(var i=n>1?void 0:n?EI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&_I(e,r,i),i};let Zn=class extends $e{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){var t;const e=(t=Ln.state.themeMode)!=null?t:"light";return ut`<svg height="${this.size}" width="${this.size}">${yI.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return oe`<div>${this.walletId||this.imageUrl?oe`<w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}" imageUrl="${this.imageUrl}"></w3m-wallet-image>`:Ne.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}<w3m-theme-context></w3m-theme-context></div>`}};Zn.styles=[je.globalCss,bI],Ws([Ae()],Zn.prototype,"uri",2),Ws([Ae({type:Number})],Zn.prototype,"size",2),Ws([Ae()],Zn.prototype,"imageId",2),Ws([Ae()],Zn.prototype,"walletId",2),Ws([Ae()],Zn.prototype,"imageUrl",2),Zn=Ws([Re("w3m-qrcode")],Zn);const xI=Ve`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--w3m-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:transparent;position:absolute;background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}input::placeholder{color:transparent}svg{margin:2px 4px 0 0}div{top:0;left:calc(50% - 12px);transform:translateX(-50%);transition:.2s all ease;pointer-events:none;display:flex;align-items:center;justify-content:center;height:calc(100% - 2px);width:fit-content;position:relative}input:focus-within+div,input:not(:placeholder-shown)+div{transform:translateX(10px);left:0}w3m-text{opacity:1;transition:.2s opacity ease}input:focus-within+div w3m-text,input:not(:placeholder-shown)+div w3m-text{opacity:0}input:focus-within,input:not(:placeholder-shown){color:var(--w3m-color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var CI=Object.defineProperty,II=Object.getOwnPropertyDescriptor,X3=(t,e,r,n)=>{for(var i=n>1?void 0:n?II(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&CI(e,r,i),i};let Mc=class extends $e{constructor(){super(...arguments),this.onChange=()=>null}render(){const t="Search wallets";return oe`<input type="text" @input="${this.onChange}" placeholder="${t}"><div>${Ne.SEARCH_ICON}<w3m-text color="secondary" variant="small-thin">${t}</w3m-text></div>`}};Mc.styles=[je.globalCss,xI],X3([Ae()],Mc.prototype,"onChange",2),Mc=X3([Re("w3m-search-input")],Mc);const OI=Ve`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-accent-color)}`;var AI=Object.defineProperty,SI=Object.getOwnPropertyDescriptor,DI=(t,e,r,n)=>{for(var i=n>1?void 0:n?SI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&AI(e,r,i),i};let mf=class extends $e{render(){return oe`<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>`}};mf.styles=[je.globalCss,OI],mf=DI([Re("w3m-spinner")],mf);const $I=Ve`span{font-style:normal;font-family:var(--w3m-font-family);font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xsmall-bold{font-family:var(--w3m-text-xsmall-bold-font-family);font-weight:var(--w3m-text-xsmall-bold-weight);font-size:var(--w3m-text-xsmall-bold-size);line-height:var(--w3m-text-xsmall-bold-line-height);letter-spacing:var(--w3m-text-xsmall-bold-letter-spacing);text-transform:var(--w3m-text-xsmall-bold-text-transform)}.w3m-xsmall-regular{font-family:var(--w3m-text-xsmall-regular-font-family);font-weight:var(--w3m-text-xsmall-regular-weight);font-size:var(--w3m-text-xsmall-regular-size);line-height:var(--w3m-text-xsmall-regular-line-height);letter-spacing:var(--w3m-text-xsmall-regular-letter-spacing);text-transform:var(--w3m-text-xsmall-regular-text-transform)}.w3m-small-thin{font-family:var(--w3m-text-small-thin-font-family);font-weight:var(--w3m-text-small-thin-weight);font-size:var(--w3m-text-small-thin-size);line-height:var(--w3m-text-small-thin-line-height);letter-spacing:var(--w3m-text-small-thin-letter-spacing);text-transform:var(--w3m-text-small-thin-text-transform)}.w3m-small-regular{font-family:var(--w3m-text-small-regular-font-family);font-weight:var(--w3m-text-small-regular-weight);font-size:var(--w3m-text-small-regular-size);line-height:var(--w3m-text-small-regular-line-height);letter-spacing:var(--w3m-text-small-regular-letter-spacing);text-transform:var(--w3m-text-small-regular-text-transform)}.w3m-medium-regular{font-family:var(--w3m-text-medium-regular-font-family);font-weight:var(--w3m-text-medium-regular-weight);font-size:var(--w3m-text-medium-regular-size);line-height:var(--w3m-text-medium-regular-line-height);letter-spacing:var(--w3m-text-medium-regular-letter-spacing);text-transform:var(--w3m-text-medium-regular-text-transform)}.w3m-big-bold{font-family:var(--w3m-text-big-bold-font-family);font-weight:var(--w3m-text-big-bold-weight);font-size:var(--w3m-text-big-bold-size);line-height:var(--w3m-text-big-bold-line-height);letter-spacing:var(--w3m-text-big-bold-letter-spacing);text-transform:var(--w3m-text-big-bold-text-transform)}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-accent-fill-color)}.w3m-color-accnt{color:var(--w3m-accent-color)}.w3m-color-error{color:var(--w3m-error-color)}`;var PI=Object.defineProperty,TI=Object.getOwnPropertyDescriptor,wf=(t,e,r,n)=>{for(var i=n>1?void 0:n?TI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&PI(e,r,i),i};let la=class extends $e{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"w3m-big-bold":this.variant==="big-bold","w3m-medium-regular":this.variant==="medium-regular","w3m-small-regular":this.variant==="small-regular","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-regular":this.variant==="xsmall-regular","w3m-xsmall-bold":this.variant==="xsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return oe`<span><slot class="${Lr(t)}"></slot></span>`}};la.styles=[je.globalCss,$I],wf([Ae()],la.prototype,"variant",2),wf([Ae()],la.prototype,"color",2),la=wf([Re("w3m-text")],la);const RI=Ve`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right: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 NI=Object.defineProperty,LI=Object.getOwnPropertyDescriptor,Q3=(t,e,r,n)=>{for(var i=n>1?void 0:n?LI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&NI(e,r,i),i};let Uc=class extends $e{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=xe.getTokenIcon((t=this.symbol)!=null?t:"");return e?oe`<div><img src="${e}" alt="${this.id}"></div>`:Ne.TOKEN_PLACEHOLDER}};Uc.styles=[je.globalCss,RI],Q3([Ae()],Uc.prototype,"symbol",2),Uc=Q3([Re("w3m-token-image")],Uc);const MI=Ve`button{width:100%;height:100%;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--w3m-wallet-icon-border-radius);margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var UI=Object.defineProperty,jI=Object.getOwnPropertyDescriptor,Ei=(t,e,r,n)=>{for(var i=n>1?void 0:n?jI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&UI(e,r,i),i};let Un=class extends $e{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?oe`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?oe`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</w3m-text>`:null}handleClick(){gi.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return oe`<button @click="${this.handleClick.bind(this)}"><div><w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}"></w3m-wallet-image><w3m-text variant="xsmall-regular">${(t=this.label)!=null?t:xe.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};Un.styles=[je.globalCss,MI],Ei([Ae()],Un.prototype,"onClick",2),Ei([Ae()],Un.prototype,"name",2),Ei([Ae()],Un.prototype,"walletId",2),Ei([Ae()],Un.prototype,"label",2),Ei([Ae()],Un.prototype,"imageId",2),Ei([Ae()],Un.prototype,"installed",2),Ei([Ae()],Un.prototype,"recent",2),Un=Ei([Re("w3m-wallet-button")],Un);const FI=Ve`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--w3m-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right: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 BI=Object.defineProperty,kI=Object.getOwnPropertyDescriptor,jc=(t,e,r,n)=>{for(var i=n>1?void 0:n?kI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&BI(e,r,i),i};let qs=class extends $e{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:xe.getWalletIcon({id:this.walletId,image_id:this.imageId});return oe`${e.length?oe`<div><img src="${e}" alt="${this.id}"></div>`:Ne.WALLET_PLACEHOLDER}`}};qs.styles=[je.globalCss,FI],jc([Ae()],qs.prototype,"walletId",2),jc([Ae()],qs.prototype,"imageId",2),jc([Ae()],qs.prototype,"imageUrl",2),qs=jc([Re("w3m-wallet-image")],qs);var HI=Object.defineProperty,zI=Object.getOwnPropertyDescriptor,WI=(t,e,r,n)=>{for(var i=n>1?void 0:n?zI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&HI(e,r,i),i};let em=class extends $e{constructor(){super(),this.unwatchAccount=void 0,Et.getAccount(),this.fetchProfile(),this.fetchBalance(),this.unwatchAccount=Nt.client().watchAccount(t=>{const{address:e,isConnected:r}=Et.state;t.isConnected&&t.address!==e&&(this.fetchProfile(t.address),this.fetchBalance(t.address),Et.setAddress(t.address)),t.isConnected||Et.resetAccount(),r!==t.isConnected&&Nr.close(),!r&&t.isConnected?gi.track({name:"ACCOUNT_CONNECTED"}):r&&!t.isConnected&&gi.track({name:"ACCOUNT_DISCONNECTED"}),Et.setIsConnected(t.isConnected)})}disconnectedCallback(){var t;(t=this.unwatchAccount)==null||t.call(this)}async fetchProfile(t){var e;const r=(e=De.state.chains)==null?void 0:e.find(n=>n.id===1);if(jt.state.enableAccountView&&r)try{await Et.fetchProfile(xe.preloadImage,t)}catch(n){console.error(n),Wr.openToast(xe.getErrorMessage(n),"error")}}async fetchBalance(t){if(jt.state.enableAccountView)try{await Et.fetchBalance(t)}catch(e){console.error(e),Wr.openToast(xe.getErrorMessage(e),"error")}}};em=WI([Re("w3m-account-context")],em);var qI=Object.defineProperty,VI=Object.getOwnPropertyDescriptor,tm=(t,e,r,n)=>{for(var i=n>1?void 0:n?VI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&qI(e,r,i),i};let vf=class extends $e{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>xe.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){var t;if(jt.state.enableExplorer){const{chains:e}=De.state;await Promise.all([nr.getRecomendedWallets(),nr.getInjectedWallets()]),De.setIsDataLoaded(!0);const{recomendedWallets:r}=nr.state,n=Xr.installedInjectedWallets(),i=(t=e?.map(l=>xe.getChainIcon(l.id)))!=null?t:[],o=r.map(l=>xe.getWalletIcon(l)),c=n.map(l=>xe.getWalletIcon(l));await this.loadImages([...i,...o,...c])}else De.setIsDataLoaded(!0)}async preloadCustomImages(){const t=xe.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),Wr.openToast("Failed preloading","error")}}};tm([gt()],vf.prototype,"preload",2),vf=tm([Re("w3m-explorer-context")],vf);var KI=Object.defineProperty,GI=Object.getOwnPropertyDescriptor,rm=(t,e,r,n)=>{for(var i=n>1?void 0:n?GI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&KI(e,r,i),i};let yf=class extends $e{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const t=De.getSelectedChain();this.activeChainId=t?.id,this.unwatchNetwork=Nt.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(De.setSelectedChain(r),this.activeChainId=r.id,Et.resetBalance(),this.fetchBalance())})}disconnectedCallback(){var t;(t=this.unwatchNetwork)==null||t.call(this)}async fetchBalance(){if(jt.state.enableAccountView)try{await Et.fetchBalance()}catch(t){console.error(t),Wr.openToast(xe.getErrorMessage(t),"error")}}};rm([gt()],yf.prototype,"activeChainId",2),yf=rm([Re("w3m-network-context")],yf);var ZI=Object.defineProperty,YI=Object.getOwnPropertyDescriptor,JI=(t,e,r,n)=>{for(var i=n>1?void 0:n?YI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&ZI(e,r,i),i};let nm=class extends $e{constructor(){super(),this.unsubscribeTheme=void 0,je.setTheme(),this.unsubscribeTheme=Ln.subscribe(je.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=Ln.state,e=[t?.["--w3m-background-image-url"],t?.["--w3m-logo-image-url"]].filter(Boolean);e.length&&await Promise.all(e.map(async r=>xe.preloadImage(r)))}catch{console.info("Unsuccessful attempt at preloading some images")}}};nm=JI([Re("w3m-theme-context")],nm);var XI=Object.defineProperty,QI=Object.getOwnPropertyDescriptor,eO=(t,e,r,n)=>{for(var i=n>1?void 0:n?QI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&XI(e,r,i),i};const tO=18e4,im=1e3;var sm;let om=class extends $e{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=(sm=De.state.selectedChain)==null?void 0:sm.id,this.isAccountConnected=Et.state.isConnected,this.lastRetry=Date.now(),this.unwatchOptions=De.subscribe(t=>{var e,r;((e=t.selectedChain)==null?void 0:e.id)!==this.selectedChainId&&(this.selectedChainId=(r=t.selectedChain)==null?void 0:r.id,this.connectAndWait())}),this.unwatchAccount=Et.subscribe(t=>{(this.isAccountConnected!==t.isConnected||!this.isGenerated)&&(this.isAccountConnected=t.isConnected,setTimeout(this.connectAndWait.bind(this),0))}),document.addEventListener("visibilitychange",this.onVisibilityChange.bind(this))}disconnectedCallback(){var t,e;(t=this.unwatchOptions)==null||t.call(this),(e=this.unwatchAccount)==null||e.call(this),document.removeEventListener("visibilitychange",this.onVisibilityChange)}async connectAndWait(){if(clearTimeout(this.timeout),!this.isAccountConnected){this.isGenerated=!0,this.timeout=setTimeout(this.connectAndWait.bind(this),tO);try{const{standaloneUri:t,selectedChain:e}=De.state;t?hr.setPairingUri(t):await Nt.client().connectWalletConnect(r=>hr.setPairingUri(r),e?.id)}catch(t){console.error(t),hr.setPairingError(!0),Wr.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=im&&(this.lastRetry=Date.now(),this.connectAndWait())}}}onVisibilityChange(){!document.hidden&&Ie.isMobile()&&setTimeout(this.connectAndWait.bind(this),im)}};om=eO([Re("w3m-wc-connection-context")],om);const rO=Ve`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:var(--w3m-button-border-radius);padding:4px 4px 4px 8px}div button{border-radius:var(--w3m-secondary-button-border-radius);padding:4px 8px;padding-left:4px;height:auto;margin-left:10px;color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}.w3m-no-avatar{padding-left:8px}button::after{content:'';top:0;bottom:0;left:0;right: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 nO=Object.defineProperty,iO=Object.getOwnPropertyDescriptor,bf=(t,e,r,n)=>{for(var i=n>1?void 0:n?iO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&nO(e,r,i),i};let Vs=class extends $e{constructor(){super(),this.balance="hide",this.avatar="show",xe.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=De.state;t||(gi.click({name:"ACCOUNT_BUTTON"}),Nr.open({route:"Account"}))}accountTemplate(){const t=this.avatar==="show";return oe`${t?oe`<w3m-avatar></w3m-avatar>`:null}<w3m-address-text></w3m-address-text>`}render(){const t=this.balance==="show",e={"w3m-no-avatar":this.avatar==="hide"};return t?oe`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}" class="${Lr(e)}">${this.accountTemplate()}</button></div>`:oe`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};Vs.styles=[je.globalCss,rO],bf([Ae()],Vs.prototype,"balance",2),bf([Ae()],Vs.prototype,"avatar",2),Vs=bf([Re("w3m-account-button")],Vs);const sO=Ve`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){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 oO=Object.defineProperty,aO=Object.getOwnPropertyDescriptor,_f=(t,e,r,n)=>{for(var i=n>1?void 0:n?aO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&oO(e,r,i),i};let ua=class extends $e{constructor(){super(),this.chainId=0,this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=De.state;this.chainId=t?.id,this.label=t?.name,this.unsubscribeNetwork=De.subscribe(({selectedChain:e})=>{this.chainId=e?.id,this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){tt.push("SelectNetwork")}render(){const{chains:t,selectedChain:e}=De.state,r=t?.map(o=>o.id),n=e&&r?.includes(e.id),i=t&&t.length<=1&&n;return oe`<button @click="${this.onClick}" ?disabled="${i}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};ua.styles=[je.globalCss,sO],_f([gt()],ua.prototype,"chainId",2),_f([gt()],ua.prototype,"label",2),ua=_f([Re("w3m-account-network-button")],ua);const cO=Ve`@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 lO=Object.defineProperty,uO=Object.getOwnPropertyDescriptor,ha=(t,e,r,n)=>{for(var i=n>1?void 0:n?uO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&lO(e,r,i),i};let rs=class extends $e{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=Et.state.address,this.name=Et.state.profileName,this.loading=!!Et.state.profileLoading,this.unsubscribeAccount=Et.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;const e=this.variant==="button",r={"w3m-loading":this.loading};return oe`<w3m-text class="${Lr(r)}" variant="${e?"medium-regular":"big-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:xe.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};rs.styles=[je.globalCss,cO],ha([gt()],rs.prototype,"address",2),ha([gt()],rs.prototype,"name",2),ha([gt()],rs.prototype,"loading",2),ha([Ae()],rs.prototype,"variant",2),rs=ha([Re("w3m-address-text")],rs);const Mr={onConnecting(t){xe.goToConnectingView(t)},onExternal(t){xe.handleConnectorConnection(t)},manualWalletsTemplate(){return Xr.manualWallets().map(t=>oe`<w3m-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},recomendedWalletsTemplate(t=!1){return Xr.recomendedWallets(t).map(e=>oe`<w3m-wallet-button walletId="${e.id}" imageId="${e.image_id}" name="${e.name}" .onClick="${()=>this.onConnecting(e)}"></w3m-wallet-button>`)},externalWalletsTemplate(){return Xr.externalWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${()=>this.onExternal(t.id)}"></w3m-wallet-button>`)},recentWalletTemplate(){const t=Xr.recentWallet();if(t)return oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`},installedInjectedWalletsTemplate(){return Xr.installedInjectedWallets().map(t=>oe`<w3m-wallet-button .installed="${!0}" name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},injectedWalletsTemplate(){return Xr.injectedWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)}},hO=Ve`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.w3m-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.w3m-track svg{margin:0 5px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--w3m-wallet-icon-border-radius)}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-title{display:flex;align-items:center;margin-bottom:10px}.w3m-title svg{margin-right:6px}.w3m-title path{fill:var(--w3m-accent-color)}w3m-modal-footer .w3m-title{padding:0 10px}w3m-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--w3m-color-bg-1))}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var fO=Object.defineProperty,dO=Object.getOwnPropertyDescriptor,pO=(t,e,r,n)=>{for(var i=n>1?void 0:n?dO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&fO(e,r,i),i};let Ef=class extends $e{onGoToQrcode(){tt.push("Qrcode")}onGetWallet(){tt.push("GetWallet")}render(){const{recomendedWallets:t}=nr.state,e=[...t,...t],r=Mr.externalWalletsTemplate(),n=Mr.installedInjectedWalletsTemplate(),i=[...n,...r].length>0,o=Ie.RECOMMENDED_WALLET_AMOUNT*2;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Ne.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-title">${Ne.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">WalletConnect</w3m-text></div><div class="w3m-slider"><div class="w3m-track">${[...Array(o)].map((c,l)=>{const h=e[l%e.length];return h?oe`<w3m-wallet-image walletId="${h.id}" imageId="${h.image_id}"></w3m-wallet-image>`:Ne.WALLET_PLACEHOLDER})}</div><w3m-button-big @click="${xe.handleAndroidLinking}"><w3m-text variant="medium-regular" color="inverse">Select Wallet</w3m-text></w3m-button-big></div></w3m-modal-content>${i?oe`<w3m-modal-footer><div class="w3m-title">${Ne.WALLET_ICON}<w3m-text variant="small-regular" color="accent">Other</w3m-text></div><div class="w3m-grid">${n} ${r}</div></w3m-modal-footer>`:null}<w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Choose WalletConnect to see supported apps on your device${i?", or select from other options":""}`}</w3m-text><w3m-button variant="outline" .iconRight="${Ne.ARROW_UP_RIGHT_ICON}" .onClick="${()=>this.onGetWallet()}">I don't have a wallet</w3m-button></w3m-info-footer>`}};Ef.styles=[je.globalCss,hO],Ef=pO([Re("w3m-android-wallet-selection")],Ef);const gO=Ve`@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 mO=Object.defineProperty,wO=Object.getOwnPropertyDescriptor,fa=(t,e,r,n)=>{for(var i=n>1?void 0:n?wO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&mO(e,r,i),i};let ns=class extends $e{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=Et.state.address,this.avatar=Et.state.profileAvatar,this.loading=!!Et.state.profileLoading,this.unsubscribeAccount=Et.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?oe`<img class="${Lr(t)}" src="${this.avatar}">`:this.address?(xe.generateAvatarColors(this.address),oe`<div class="${Lr(t)}">${this.loading?oe`<div class="w3m-loader"></div>`:null}</div>`):null}};ns.styles=[je.globalCss,gO],fa([gt()],ns.prototype,"address",2),fa([gt()],ns.prototype,"avatar",2),fa([gt()],ns.prototype,"loading",2),fa([Ae()],ns.prototype,"size",2),ns=fa([Re("w3m-avatar")],ns);const vO=Ve`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var yO=Object.defineProperty,bO=Object.getOwnPropertyDescriptor,xf=(t,e,r,n)=>{for(var i=n>1?void 0:n?bO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&yO(e,r,i),i};let da=class extends $e{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=Et.state.balance)==null?void 0:t.symbol,this.amount=(e=Et.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=Et.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"?t=0:typeof this.amount=="string"&&this.amount.length>6?t=parseFloat(this.amount).toFixed(3):typeof this.amount=="string"&&(t=parseFloat(this.amount)),oe`<div><w3m-token-image symbol="${this.symbol}"></w3m-token-image><w3m-text variant="medium-regular" color="primary">${t} ${this.symbol}</w3m-text></div>`}};da.styles=[je.globalCss,vO],xf([gt()],da.prototype,"symbol",2),xf([gt()],da.prototype,"amount",2),da=xf([Re("w3m-balance")],da);const _O=Ve`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-accent-fill-color)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var EO=Object.defineProperty,xO=Object.getOwnPropertyDescriptor,Fc=(t,e,r,n)=>{for(var i=n>1?void 0:n?xO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&EO(e,r,i),i};let is=class extends $e{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,xe.rejectStandaloneButtonComponent(),this.modalUnsub=Nr.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"?Ne.WALLET_CONNECT_ICON:null}onClick(){Et.state.isConnected?this.onDisconnect():this.onConnect()}async onConnect(){this.loading=!0,gi.click({name:"CONNECT_BUTTON"}),await Nr.open(),Nr.state.open||(this.loading=!1)}async onDisconnect(){gi.click({name:"DISCONNECT_BUTTON"}),await Nt.client().disconnect()}render(){return oe`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${this.loading?oe`<w3m-spinner></w3m-spinner><w3m-text variant="medium-regular" color="accent">Connecting...</w3m-text>`:oe`${this.iconTemplate()}<w3m-text variant="medium-regular" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};is.styles=[je.globalCss,_O],Fc([gt()],is.prototype,"loading",2),Fc([Ae()],is.prototype,"label",2),Fc([Ae()],is.prototype,"icon",2),is=Fc([Re("w3m-connect-button")],is);const CO=Ve`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:90px;height:90px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.w3m-stale svg,.w3m-stale use{display:none}`;var IO=Object.defineProperty,OO=Object.getOwnPropertyDescriptor,Ks=(t,e,r,n)=>{for(var i=n>1?void 0:n?OO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&IO(e,r,i),i};let xi=class extends $e{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=Ln.state.themeVariables)==null?void 0:t["--w3m-wallet-icon-large-border-radius"])!=null?e:je.getPreset("--w3m-wallet-icon-large-border-radius");let n=0;r.includes("%")?n=88/100*parseInt(r,10):n=parseInt(r,10),n*=1.17;const i=317-n*1.57,o=425-n*1.8;return oe`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="w3m-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#w3m-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${o}"></use></svg>`}render(){const t={"w3m-error":this.isError,"w3m-stale":this.isStale};return oe`<div class="${Lr(t)}">${this.svgLoaderTemplate()}<w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}"></w3m-wallet-image></div><w3m-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</w3m-text>`}};xi.styles=[je.globalCss,CO],Ks([Ae()],xi.prototype,"walletId",2),Ks([Ae()],xi.prototype,"imageId",2),Ks([Ae()],xi.prototype,"isError",2),Ks([Ae()],xi.prototype,"isStale",2),Ks([Ae()],xi.prototype,"label",2),xi=Ks([Re("w3m-connector-waiting")],xi);var AO=Object.defineProperty,SO=Object.getOwnPropertyDescriptor,Gs=(t,e,r,n)=>{for(var i=n>1?void 0:n?SO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&AO(e,r,i),i};let Ci=class extends $e{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.avatar="show",this.balance="hide",this.unsubscribeAccount=void 0,xe.rejectStandaloneButtonComponent(),this.isConnected=Et.state.isConnected,this.unsubscribeAccount=Et.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=jt.state,e=this.balance,r=this.label,n=this.icon,i=this.avatar;return this.isConnected&&t?oe`<w3m-account-button balance="${e}" avatar="${i}"></w3m-account-button>`:oe`<w3m-connect-button label="${this.isConnected?"Disconnect":r}" icon="${n}"></w3m-connect-button>`}};Gs([gt()],Ci.prototype,"isConnected",2),Gs([Ae()],Ci.prototype,"label",2),Gs([Ae()],Ci.prototype,"icon",2),Gs([Ae()],Ci.prototype,"avatar",2),Gs([Ae()],Ci.prototype,"balance",2),Ci=Gs([Re("w3m-core-button")],Ci);const DO=Ve`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-accent-color)}`;var $O=Object.defineProperty,PO=Object.getOwnPropertyDescriptor,TO=(t,e,r,n)=>{for(var i=n>1?void 0:n?PO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&$O(e,r,i),i};let Cf=class extends $e{render(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,enableExplorer:r}=jt.state,n=e!=="ALL"&&r,i=Mr.manualWalletsTemplate(),o=Mr.recomendedWalletsTemplate(),c=Mr.externalWalletsTemplate(),l=Mr.recentWalletTemplate(),h=Mr.installedInjectedWalletsTemplate();let d=[l,...i,...o];t||(d=[...h,l,...c,...i,...o]),d=d.filter(Boolean);const v=d.length>4||n;let E=[];v?E=d.slice(0,3):E=d;const _=!!E.length;return oe`<w3m-modal-header .border="${!0}" title="Connect your wallet" .onAction="${xe.handleUriCopy}" .actionIcon="${Ne.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${Ne.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${Ne.SCAN_ICON}<w3m-text variant="small-regular" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${_?oe`<w3m-modal-footer><div class="w3m-desktop-title">${Ne.DESKTOP_ICON}<w3m-text variant="small-regular" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${E} ${v?oe`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};Cf.styles=[je.globalCss,DO],Cf=TO([Re("w3m-desktop-wallet-selection")],Cf);const RO=Ve`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var NO=Object.defineProperty,LO=Object.getOwnPropertyDescriptor,MO=(t,e,r,n)=>{for(var i=n>1?void 0:n?LO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&NO(e,r,i),i};let If=class extends $e{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=jt.state;return t??e?oe`<div><w3m-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?oe`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?oe`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</w3m-text></div>`:null}};If.styles=[je.globalCss,RO],If=MO([Re("w3m-legal-notice")],If);const UO=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var jO=Object.defineProperty,FO=Object.getOwnPropertyDescriptor,BO=(t,e,r,n)=>{for(var i=n>1?void 0:n?FO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&jO(e,r,i),i};let Of=class extends $e{onQrcode(){tt.push("Qrcode")}render(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,enableExplorer:r}=jt.state,n=e!=="ALL"&&r,i=Mr.manualWalletsTemplate(),o=Mr.recomendedWalletsTemplate(),c=Mr.externalWalletsTemplate(),l=Mr.recentWalletTemplate(),h=Mr.installedInjectedWalletsTemplate();let d=[l,...i,...o];t||(d=[...h,l,...c,...i,...o]),d=d.filter(Boolean);const v=d.length>8||n;let E=[];v?E=d.slice(0,7):E=d;const _=!!E.length;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Ne.QRCODE_ICON}"></w3m-modal-header>${_?oe`<w3m-modal-content><div>${E} ${v?oe`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-content>`:null}`}};Of.styles=[je.globalCss,UO],Of=BO([Re("w3m-mobile-wallet-selection")],Of);const kO=Ve`:host{all:initial}.w3m-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--w3m-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}@media(max-height:720px) and (orientation:landscape){.w3m-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.w3m-active{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) var(--w3m-container-border-radius) var(--w3m-container-border-radius);border:1px solid var(--w3m-color-overlay);overflow:hidden}.w3m-card{width:100%;position:relative;border-radius:var(--w3m-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) 0 0}.w3m-card{border-radius:var(--w3m-container-border-radius) var(--w3m-container-border-radius) 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:440px){.w3m-container{border:0}}`;var HO=Object.defineProperty,zO=Object.getOwnPropertyDescriptor,Af=(t,e,r,n)=>{for(var i=n>1?void 0:n?zO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&HO(e,r,i),i};let Zs=class extends $e{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Nr.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return xe.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return xe.getShadowRootElement(this,".w3m-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("w3m-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="w3m-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&&Nr.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=xe.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([Qi(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,Qi(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=xe.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([Qi(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,Qi(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?Nr.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}managedModalContextTemplate(){const{isStandalone:t}=De.state;return t?null:oe`<w3m-wc-connection-context></w3m-wc-connection-context><w3m-account-context></w3m-account-context><w3m-network-context></w3m-network-context>`}render(){const t={"w3m-overlay":!0,"w3m-active":this.active};return oe`<w3m-explorer-context></w3m-explorer-context><w3m-theme-context></w3m-theme-context>${this.managedModalContextTemplate()}<div id="w3m-modal" class="${Lr(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="w3m-container" tabindex="0">${this.open?oe`<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>`}};Zs.styles=[je.globalCss,kO],Af([gt()],Zs.prototype,"open",2),Af([gt()],Zs.prototype,"active",2),Zs=Af([Re("w3m-modal")],Zs);const WO=Ve`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var qO=Object.defineProperty,VO=Object.getOwnPropertyDescriptor,Bc=(t,e,r,n)=>{for(var i=n>1?void 0:n?VO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&qO(e,r,i),i};let ss=class extends $e{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,xe.rejectStandaloneButtonComponent();const{selectedChain:t}=De.state;this.onSetChainData(t),this.unsubscribeNetwork=De.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=De.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(){gi.click({name:"NETWORK_BUTTON"}),Nr.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=De.state,r=e&&e.length>1;return oe`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="medium-regular" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};ss.styles=[je.globalCss,WO],Bc([gt()],ss.prototype,"chainId",2),Bc([gt()],ss.prototype,"label",2),Bc([gt()],ss.prototype,"wrongNetwork",2),ss=Bc([Re("w3m-network-switch")],ss);const KO=Ve`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:1px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-network-image{width:92px;height:92px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}`;var GO=Object.defineProperty,ZO=Object.getOwnPropertyDescriptor,kc=(t,e,r,n)=>{for(var i=n>1?void 0:n?ZO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&GO(e,r,i),i};let Ys=class extends $e{constructor(){super(...arguments),this.chainId=void 0,this.isError=!1,this.label=""}svgLoaderTemplate(){return oe`<svg width="54" height="59" viewBox="0 0 54 59" fill="none" class="w3m-loader"><path id="w3m-loader-path" 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"/><use xlink:href="#w3m-loader-path" stroke-dasharray="54 118" stroke-dashoffset="172"></use></svg>`}render(){const t={"w3m-error":this.isError};return oe`<div class="${Lr(t)}">${this.svgLoaderTemplate()}<w3m-network-image chainId="${this.chainId}"></w3m-network-image></div><w3m-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Switch declined":this.label}</w3m-text>`}};Ys.styles=[je.globalCss,KO],kc([Ae()],Ys.prototype,"chainId",2),kc([Ae()],Ys.prototype,"isError",2),kc([Ae()],Ys.prototype,"label",2),Ys=kc([Re("w3m-network-waiting")],Ys);const YO=Ve`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var JO=Object.defineProperty,XO=Object.getOwnPropertyDescriptor,os=(t,e,r,n)=>{for(var i=n>1?void 0:n?XO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&JO(e,r,i),i};let Yn=class extends $e{constructor(){super(...arguments),this.isMobile=!1,this.isInjected=!1,this.isInjectedInstalled=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Ie.isMobile()?tt.replace("MobileConnecting"):tt.replace("MobileQrcodeConnecting")}onInjected(){this.isInjectedInstalled?tt.replace("InjectedConnecting"):tt.replace("InstallWallet")}onDesktop(){tt.replace("DesktopConnecting")}onWeb(){tt.replace("WebConnecting")}render(){const{isStandalone:t}=De.state;return oe`<div>${this.isRetry?oe`<slot></slot>`:null} ${this.isMobile?oe`<w3m-button .onClick="${this.onMobile}" .iconLeft="${Ne.MOBILE_ICON}" variant="outline">Mobile</w3m-button>`:null} ${this.isInjected&&!t?oe`<w3m-button .onClick="${this.onInjected}" .iconLeft="${Ne.WALLET_ICON}" variant="outline">Browser</w3m-button>`:null} ${this.isDesktop?oe`<w3m-button .onClick="${this.onDesktop}" .iconLeft="${Ne.DESKTOP_ICON}" variant="outline">Desktop</w3m-button>`:null} ${this.isWeb?oe`<w3m-button .onClick="${this.onWeb}" .iconLeft="${Ne.GLOBE_ICON}" variant="outline">Web</w3m-button>`:null}</div>`}};Yn.styles=[je.globalCss,YO],os([Ae()],Yn.prototype,"isMobile",2),os([Ae()],Yn.prototype,"isInjected",2),os([Ae()],Yn.prototype,"isInjectedInstalled",2),os([Ae()],Yn.prototype,"isDesktop",2),os([Ae()],Yn.prototype,"isWeb",2),os([Ae()],Yn.prototype,"isRetry",2),Yn=os([Re("w3m-platform-selection")],Yn);const QO=Ve`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--w3m-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--w3m-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--w3m-wallet-icon-border-radius)/ 2);border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var eA=Object.defineProperty,tA=Object.getOwnPropertyDescriptor,rA=(t,e,r,n)=>{for(var i=n>1?void 0:n?tA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&eA(e,r,i),i};let Sf=class extends $e{onClick(){tt.push("WalletExplorer")}render(){const{recomendedWallets:t}=nr.state,e=Xr.manualWallets(),r=[...t,...e].reverse().slice(0,4);return oe`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{const i=xe.getWalletIcon(n);if(i)return oe`<img src="${i}">`;const o=xe.getWalletIcon({id:n.id});return o?oe`<img src="${o}">`:Ne.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Ne.WALLET_PLACEHOLDER)}</div><w3m-text variant="xsmall-regular">View All</w3m-text></button>`}};Sf.styles=[je.globalCss,QO],Sf=rA([Re("w3m-view-all-wallets-button")],Sf);const nA=Ve`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var iA=Object.defineProperty,sA=Object.getOwnPropertyDescriptor,Hc=(t,e,r,n)=>{for(var i=n>1?void 0:n?sA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&iA(e,r,i),i};let Js=class extends $e{constructor(){super(),this.walletId="",this.imageId="",this.uri="",this.unwatchWcConnection=void 0,setTimeout(()=>{const{pairingUri:t}=hr.state,{standaloneUri:e}=De.state;this.uri=e??t},0),this.unwatchWcConnection=hr.subscribe(t=>{t.pairingUri&&(this.uri=t.pairingUri)})}disconnectedCallback(){var t;(t=this.unwatchWcConnection)==null||t.call(this)}get overlayEl(){return xe.getShadowRootElement(this,".w3m-qr-container")}render(){return oe`<div class="w3m-qr-container">${this.uri?oe`<w3m-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${this.walletId}" imageId="${this.imageId}"></w3m-qrcode>`:oe`<w3m-spinner></w3m-spinner>`}</div>`}};Js.styles=[je.globalCss,nA],Hc([Ae()],Js.prototype,"walletId",2),Hc([Ae()],Js.prototype,"imageId",2),Hc([gt()],Js.prototype,"uri",2),Js=Hc([Re("w3m-walletconnect-qr")],Js);const oA=Ve`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-success-color);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-success-color),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var aA=Object.defineProperty,cA=Object.getOwnPropertyDescriptor,lA=(t,e,r,n)=>{for(var i=n>1?void 0:n?cA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&aA(e,r,i),i};let Df=class extends $e{async onDisconnect(){await Nt.client().disconnect()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=Et.state.address)!=null?t:""),Wr.openToast("Address copied","success")}render(){return oe`<w3m-modal-content><div class="w3m-profile"><div class="w3m-info"><w3m-avatar size="medium"></w3m-avatar><w3m-address-text variant="modal"></w3m-address-text></div><div class="w3m-connection-badge"><w3m-text variant="small-regular" color="secondary">Connected</w3m-text></div></div></w3m-modal-content><div class="w3m-balance"><w3m-balance></w3m-balance></div><w3m-modal-footer><div class="w3m-footer"><w3m-account-network-button></w3m-account-network-button><w3m-box-button label="Copy Address" .onClick="${this.onCopyAddress}" .icon="${Ne.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${Ne.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};Df.styles=[je.globalCss,oA],Df=lA([Re("w3m-account-view")],Df);var uA=Object.defineProperty,hA=Object.getOwnPropertyDescriptor,fA=(t,e,r,n)=>{for(var i=n>1?void 0:n?hA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&uA(e,r,i),i};let $f=class extends $e{viewTemplate(){return Ie.isAndroid()?oe`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Ie.isMobile()?oe`<w3m-mobile-wallet-selection></w3m-mobile-wallet-selection>`:oe`<w3m-desktop-wallet-selection></w3m-desktop-wallet-selection>`}render(){return oe`${this.viewTemplate()}<w3m-legal-notice></w3m-legal-notice>`}};$f.styles=[je.globalCss],$f=fA([Re("w3m-connect-wallet-view")],$f);const dA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var pA=Object.defineProperty,gA=Object.getOwnPropertyDescriptor,am=(t,e,r,n)=>{for(var i=n>1?void 0:n?gA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&pA(e,r,i),i};let zc=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openDesktopApp(),this.unwatchConnection=hr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Ie.getWalletRouterData(),n=e?.native;if(n){const i=Ie.formatNativeUrl(n,t,r);Ie.openHref(i,"_self")}}openDesktopApp(){hr.setPairingError(!1);const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state,r=Ie.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Ie.getWalletRouterData(),{isMobile:n,isInjected:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Ne.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</w3m-text><w3m-platform-selection .isMobile="${n}" .isInjected="${i}" .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Ne.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};zc.styles=[je.globalCss,dA],am([gt()],zc.prototype,"isError",2),zc=am([Re("w3m-desktop-connecting-view")],zc);const mA=Ve`.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 wA=Object.defineProperty,vA=Object.getOwnPropertyDescriptor,yA=(t,e,r,n)=>{for(var i=n>1?void 0:n?vA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&wA(e,r,i),i};let Pf=class extends $e{onGet(t){Ie.openHref(t,"_blank")}render(){const t=nr.state.recomendedWallets.slice(0,5),e=Xr.manualWallets().slice(0,5),r=t.length,n=e.length;return oe`<w3m-modal-header title="Get a wallet"></w3m-modal-header><w3m-modal-content>${r?t.map(i=>oe`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${i.id}" imageId="${i.image_id}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i.name}</w3m-text><w3m-button .iconRight="${Ne.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(i.homepage)}">Get</w3m-button></div></div>`):null} ${n?e.map(i=>oe`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${i.id}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i.name}</w3m-text><w3m-button .iconRight="${Ne.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(i.links.universal)}">Get</w3m-button></div></div>`):null}</w3m-modal-content><div class="w3m-footer-actions"><w3m-text variant="medium-regular">Not what you're looking for?</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With hundreds of wallets out there, there's something for everyone</w3m-text><w3m-button .onClick="${xe.openWalletExplorerUrl}" .iconRight="${Ne.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Pf.styles=[je.globalCss,mA],Pf=yA([Re("w3m-get-wallet-view")],Pf);const bA=Ve`.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 _A=Object.defineProperty,EA=Object.getOwnPropertyDescriptor,xA=(t,e,r,n)=>{for(var i=n>1?void 0:n?EA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&_A(e,r,i),i};let Tf=class extends $e{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){jt.state.enableExplorer?tt.push("GetWallet"):xe.openWalletExplorerUrl()}onLearnMore(){Ie.openHref(this.learnUrl,"_blank")}render(){return oe`<w3m-modal-header title="What is a wallet?"></w3m-modal-header><w3m-modal-content><div class="w3m-info-container"><div class="w3m-images">${Ne.HELP_CHART_IMG} ${Ne.HELP_PAINTING_IMG} ${Ne.HELP_ETH_IMG}</div><w3m-text variant="medium-regular">A home for your digital assets</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Ne.HELP_KEY_IMG} ${Ne.HELP_USER_IMG} ${Ne.HELP_LOCK_IMG}</div><w3m-text variant="medium-regular">One login for all of web3</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">Log in to any app by connecting your wallet. Say goodbye to countless passwords!</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Ne.HELP_COMPAS_IMG} ${Ne.HELP_NOUN_IMG} ${Ne.HELP_DAO_IMG}</div><w3m-text variant="medium-regular">Your gateway to a new web</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.</w3m-text></div><div class="w3m-footer-actions"><w3m-button .onClick="${this.onGet.bind(this)}" .iconLeft="${Ne.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${Ne.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};Tf.styles=[je.globalCss,bA],Tf=xA([Re("w3m-help-view")],Tf);const CA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var IA=Object.defineProperty,OA=Object.getOwnPropertyDescriptor,cm=(t,e,r,n)=>{for(var i=n>1?void 0:n?OA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&IA(e,r,i),i};let Wc=class extends $e{constructor(){super(),this.isError=!1,this.connector=Nt.client().getConnectorById("injected"),this.openInjectedApp()}async openInjectedApp(){const{ready:t}=this.connector;t&&(this.isError=!1,await xe.handleConnectorConnection("injected",()=>{this.isError=!0}))}render(){const{name:t,id:e,image_id:r}=Ie.getWalletRouterData(),{isMobile:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">Connection can be declined if multiple wallets are installed or previous request is still active</w3m-text><w3m-platform-selection .isMobile="${n}" .isDesktop="${i}" .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${this.openInjectedApp.bind(this)}" .disabled="${!this.isError}" .iconRight="${Ne.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};Wc.styles=[je.globalCss,CA],cm([gt()],Wc.prototype,"isError",2),Wc=cm([Re("w3m-injected-connecting-view")],Wc);const AA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var SA=Object.defineProperty,DA=Object.getOwnPropertyDescriptor,$A=(t,e,r,n)=>{for(var i=n>1?void 0:n?DA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&SA(e,r,i),i};let Rf=class extends $e{onInstall(t){t&&Ie.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:n}=Ie.getWalletRouterData();return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="Not Detected" .isStale="${!0}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</w3m-text><w3m-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${Ne.ARROW_DOWN_ICON}">Download</w3m-button></w3m-info-footer>`}};Rf.styles=[je.globalCss,AA],Rf=$A([Re("w3m-install-wallet-view")],Rf);const PA=Ve`w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}w3m-info-footer{display:flex;width:100%}.w3m-app-store{justify-content:space-between}.w3m-app-store w3m-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--w3m-wallet-icon-small-border-radius)}.w3m-app-store div{display:flex;align-items:center}.w3m-app-store w3m-button{margin-right:-10px}.w3m-note{flex-direction:column;align-items:center;padding:5px 0}.w3m-note w3m-text{text-align:center}w3m-platform-selection div{display:flex}w3m-platform-selection w3m-button:nth-child(2){margin-left:10px}`;var TA=Object.defineProperty,RA=Object.getOwnPropertyDescriptor,lm=(t,e,r,n)=>{for(var i=n>1?void 0:n?RA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&TA(e,r,i),i};let qc=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openMobileApp(),this.unwatchConnection=hr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t,e=!1){const{mobile:r,name:n}=Ie.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!e){const c=Ie.formatNativeUrl(i,t,n);Ie.openHref(c,"_self")}else if(o){const c=Ie.formatUniversalUrl(o,t,n);Ie.openHref(c,"_self")}}openMobileApp(t=!1){hr.setPairingError(!1);const{standaloneUri:e}=De.state,{pairingUri:r}=hr.state,n=Ie.getWalletRouterData();xe.setRecentWallet(n),e?this.onFormatAndRedirect(e,t):this.onFormatAndRedirect(r,t)}onGoToAppStore(t){t&&Ie.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:n,mobile:i}=Ie.getWalletRouterData(),{isWeb:o}=xe.getCachedRouterWalletPlatforms(),c=n?.ios,l=i?.universal;return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="Tap 'Open' to continue…" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer class="w3m-note"><w3m-text color="secondary" variant="small-thin">You can reload the website to try again ${l?` or open ${t} using a "Backup" instead`:""}</w3m-text><w3m-platform-selection .isWeb="${o}" .isRetry="${!0}"><div><w3m-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Ne.RETRY_ICON}">Retry</w3m-button>${l?oe`<w3m-button variant="outline" .onClick="${()=>this.openMobileApp(!0)}" .iconRight="${Ne.ARROW_UP_RIGHT_ICON}">Backup</w3m-button>`:null}</div></w3m-platform-selection></w3m-info-footer><w3m-info-footer class="w3m-app-store"><div><w3m-wallet-image walletId="${e}" imageId="${r}"></w3m-wallet-image><w3m-text>${`Get ${t}`}</w3m-text></div><w3m-button .iconRight="${Ne.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</w3m-button></w3m-info-footer>`}};qc.styles=[je.globalCss,PA],lm([gt()],qc.prototype,"isError",2),qc=lm([Re("w3m-mobile-connecting-view")],qc);const NA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var LA=Object.defineProperty,MA=Object.getOwnPropertyDescriptor,UA=(t,e,r,n)=>{for(var i=n>1?void 0:n?MA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&LA(e,r,i),i};let Nf=class extends $e{render(){const{name:t,id:e,image_id:r}=Ie.getWalletRouterData(),{isInjected:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Ne.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr walletId="${e}" imageId="${r}"></w3m-walletconnect-qr></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Scan this qrcode with your phone's camera or inside ${t} app`}</w3m-text><w3m-platform-selection .isDesktop="${i}" .isInjected="${n}" .isWeb="${o}"></w3m-platform-selection></w3m-info-footer>`}};Nf.styles=[je.globalCss,NA],Nf=UA([Re("w3m-mobile-qr-connecting-view")],Nf);var jA=Object.defineProperty,FA=Object.getOwnPropertyDescriptor,BA=(t,e,r,n)=>{for(var i=n>1?void 0:n?FA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&jA(e,r,i),i};let Lf=class extends $e{render(){return oe`<w3m-modal-header title="Scan the code" .onAction="${xe.handleUriCopy}" .actionIcon="${Ne.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Lf.styles=[je.globalCss],Lf=BA([Re("w3m-qrcode-view")],Lf);const kA=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center}`;var um=Object.defineProperty,HA=Object.defineProperties,zA=Object.getOwnPropertyDescriptor,WA=Object.getOwnPropertyDescriptors,hm=Object.getOwnPropertySymbols,qA=Object.prototype.hasOwnProperty,VA=Object.prototype.propertyIsEnumerable,fm=(t,e,r)=>e in t?um(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,KA=(t,e)=>{for(var r in e||(e={}))qA.call(e,r)&&fm(t,r,e[r]);if(hm)for(var r of hm(e))VA.call(e,r)&&fm(t,r,e[r]);return t},GA=(t,e)=>HA(t,WA(e)),Mf=(t,e,r,n)=>{for(var i=n>1?void 0:n?zA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&um(e,r,i),i};let pa=class extends $e{constructor(){super(),this.connectedChains="ALL",this.isUnsupportedChains=!1,this.getConnectedChainIds()}async getConnectedChainIds(){this.connectedChains=await Nt.client().getConnectedChainIds()}async onSelectChain(t){try{const{selectedChain:e,walletConnectVersion:r,isPreferInjected:n}=De.state,{isConnected:i}=Et.state;i?e?.id===t.id?tt.reset("Account"):r===2?(await Nt.client().switchNetwork({chainId:t.id}),tt.reset("Account")):tt.push("SwitchNetwork",{SwitchNetwork:t}):n?(De.setSelectedChain(t),Nr.close()):(De.setSelectedChain(t),tt.push("ConnectWallet"))}catch(e){console.error(e),Wr.openToast(xe.getErrorMessage(e),"error")}}isUnsuportedChainId(t){return typeof this.connectedChains=="string"&&this.connectedChains!=="ALL"?(this.isUnsupportedChains=!0,!0):Array.isArray(this.connectedChains)&&!this.connectedChains.includes(String(t))?(this.isUnsupportedChains=!0,!0):!1}render(){const{chains:t}=De.state,e=t?.map(n=>GA(KA({},n),{unsupported:this.isUnsuportedChainId(n.id)})),r=e?.sort((n,i)=>Number(n.unsupported)-Number(i.unsupported));return oe`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div>${r?.map(n=>oe`<w3m-network-button name="${n.name}" chainId="${n.id}" .unsupported="${n.unsupported}" .onClick="${async()=>this.onSelectChain(n)}">${n.name}</w3m-network-button>`)}</div></w3m-modal-content>${this.isUnsupportedChains?oe`<w3m-info-footer><w3m-text color="secondary" variant="small-thin">Your connected wallet may not support some of the networks available for this dapp</w3m-text></w3m-info-footer>`:null}`}};pa.styles=[je.globalCss,kA],Mf([gt()],pa.prototype,"connectedChains",2),Mf([gt()],pa.prototype,"isUnsupportedChains",2),pa=Mf([Re("w3m-select-network-view")],pa);const ZA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var YA=Object.defineProperty,JA=Object.getOwnPropertyDescriptor,dm=(t,e,r,n)=>{for(var i=n>1?void 0:n?JA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&YA(e,r,i),i};let Vc=class extends $e{constructor(){super(),this.isError=!1,this.onSwitchNetwork()}async onSwitchNetwork(){try{this.isError=!1;const t=Ie.getSwitchNetworkRouterData();await Nt.client().switchNetwork({chainId:t.id}),De.setSelectedChain(t),tt.reset("Account")}catch{this.isError=!0}}render(){const{id:t,name:e}=Ie.getSwitchNetworkRouterData();return oe`<w3m-modal-header title="${`Connect to ${e}`}"></w3m-modal-header><w3m-modal-content><w3m-network-waiting chainId="${t}" label="Approve in your wallet" .isError="${this.isError}"></w3m-network-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">Switch can be declined if chain is not supported by a wallet or previous request is still active</w3m-text><w3m-button .onClick="${this.onSwitchNetwork.bind(this)}" .disabled="${!this.isError}" .iconRight="${Ne.RETRY_ICON}">Try Again</w3m-button></w3m-info-footer>`}};Vc.styles=[je.globalCss,ZA],dm([gt()],Vc.prototype,"isError",2),Vc=dm([Re("w3m-switch-network-view")],Vc);const XA=Ve`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 QA=Object.defineProperty,eS=Object.getOwnPropertyDescriptor,ga=(t,e,r,n)=>{for(var i=n>1?void 0:n?eS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&QA(e,r,i),i};const Uf=40;let as=class extends $e{constructor(){super(...arguments),this.loading=!nr.state.wallets.listings.length,this.firstFetch=!nr.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=xe.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,nr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),nr.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return xe.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}=nr.state,{listings:r,total:n}=this.search?e:t;return n<=Uf||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r,injectedWallets:n}=nr.state,{listings:i,total:o,page:c}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>Uf&&i.length<o))try{this.loading=!0;const l=(t=De.state.standaloneChains)==null?void 0:t.join(","),{listings:h}=await nr.getWallets({page:this.firstFetch?1:c+1,entries:Uf,search:this.search,version:De.state.walletConnectVersion,chains:l}),d=h.map(E=>xe.getWalletIcon(E)),v=n.map(E=>xe.getWalletIcon(E));await Promise.all([...d.map(async E=>xe.preloadImage(E)),...v.map(async E=>xe.preloadImage(E)),Ie.wait(300)]),this.endReached=this.isLastPage()}catch(l){console.error(l),Wr.openToast(xe.getErrorMessage(l),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Ie.isAndroid()?xe.handleMobileLinking(t):xe.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=nr.state,{listings:r}=this.search?e:t,n=this.loading&&!r.length,i=this.search.length>=3;let o=Mr.injectedWalletsTemplate(),c=Mr.manualWalletsTemplate(),l=Mr.recomendedWalletsTemplate(!0);i&&(o=o.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)),c=c.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)),l=l.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)));const h=!this.loading&&!r.length&&!o.length&&!l.length,d=Math.max(o.length,r.length),v={"w3m-loading":n,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":h};return oe`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Lr(v)}"><div class="w3m-grid">${n?null:l} ${n?null:[...Array(d)].map((E,_)=>oe`${c[_]} ${o[_]} ${r[_]?oe`<w3m-wallet-button imageId="${r[_].image_id}" name="${r[_].name}" walletId="${r[_].id}" .onClick="${()=>this.onConnect(r[_])}"></w3m-wallet-button>`:null}`)}</div><div class="w3m-placeholder-block">${h?oe`<w3m-text variant="big-bold" color="secondary">No results found</w3m-text>`:null} ${!h&&this.loading?oe`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};as.styles=[je.globalCss,XA],ga([gt()],as.prototype,"loading",2),ga([gt()],as.prototype,"firstFetch",2),ga([gt()],as.prototype,"search",2),ga([gt()],as.prototype,"endReached",2),as=ga([Re("w3m-wallet-explorer-view")],as);const tS=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var rS=Object.defineProperty,nS=Object.getOwnPropertyDescriptor,pm=(t,e,r,n)=>{for(var i=n>1?void 0:n?nS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&rS(e,r,i),i};let Kc=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openWebWallet(),this.unwatchConnection=hr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Ie.getWalletRouterData(),n=e?.universal;if(n){const i=Ie.formatUniversalUrl(n,t,r);Ie.openHref(i,"_blank")}}openWebWallet(){hr.setPairingError(!1);const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state,r=Ie.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Ie.getWalletRouterData(),{isMobile:n,isInjected:i,isDesktop:o}=xe.getCachedRouterWalletPlatforms(),c=Ie.isMobile();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Ne.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</w3m-text><w3m-platform-selection .isMobile="${n}" .isInjected="${c?!1:i}" .isDesktop="${c?!1:o}" .isRetry="${!0}"><w3m-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Ne.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};Kc.styles=[je.globalCss,tS],pm([gt()],Kc.prototype,"isError",2),Kc=pm([Re("w3m-web-connecting-view")],Kc);var iS=Object.freeze({__proto__:null,get W3mAccountButton(){return Vs},get W3mConnectButton(){return is},get W3mCoreButton(){return Ci},get W3mModal(){return Zs},get W3mNetworkSwitch(){return ss},get W3mQrCode(){return Zn}});_n.EthereumProvider=ex,_n.OPTIONAL_EVENTS=K7,_n.OPTIONAL_METHODS=V7,_n.REQUIRED_EVENTS=lc,_n.REQUIRED_METHODS=cc,_n.default=uc,Object.defineProperty(_n,"__esModule",{value:!0})});
|
|
153
153
|
//# sourceMappingURL=index.umd.js.map
|