@walletconnect/ethereum-provider 2.10.0 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.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/dist/types/constants/rpc.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(En,dr){typeof exports=="object"&&typeof module<"u"?dr(exports):typeof define=="function"&&define.amd?define(["exports"],dr):(En=typeof globalThis<"u"?globalThis:En||self,dr(En["@walletconnect/ethereum-provider"]={}))})(this,function(En){"use strict";var dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Iw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Fi(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 yr={exports:{}},Cs=typeof Reflect=="object"?Reflect:null,wd=Cs&&typeof Cs.apply=="function"?Cs.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Wa;Cs&&typeof Cs.ownKeys=="function"?Wa=Cs.ownKeys:Object.getOwnPropertySymbols?Wa=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Wa=function(e){return Object.getOwnPropertyNames(e)};function Sw(t){console&&console.warn&&console.warn(t)}var vd=Number.isNaN||function(e){return e!==e};function _t(){_t.init.call(this)}yr.exports=_t,yr.exports.once=$w,_t.EventEmitter=_t,_t.prototype._events=void 0,_t.prototype._eventsCount=0,_t.prototype._maxListeners=void 0;var yd=10;function za(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 yd},set:function(t){if(typeof t!="number"||t<0||vd(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");yd=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||vd(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 bd(t){return t._maxListeners===void 0?_t.defaultMaxListeners:t._maxListeners}_t.prototype.getMaxListeners=function(){return bd(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")wd(h,this,r);else for(var f=h.length,v=Id(h,f),n=0;n<f;++n)wd(v[n],this,r);return!0};function _d(t,e,r,n){var i,o,c;if(za(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=bd(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,Sw(l)}return t}_t.prototype.addListener=function(e,r){return _d(this,e,r,!1)},_t.prototype.on=_t.prototype.addListener,_t.prototype.prependListener=function(e,r){return _d(this,e,r,!0)};function Ow(){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 Ed(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Ow.bind(n);return i.listener=r,n.wrapFn=i,i}_t.prototype.once=function(e,r){return za(r),this.on(e,Ed(this,e,r)),this},_t.prototype.prependOnceListener=function(e,r){return za(r),this.prependListener(e,Ed(this,e,r)),this},_t.prototype.removeListener=function(e,r){var n,i,o,c,l;if(za(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():Dw(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 xd(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?Aw(i):Id(i,i.length)}_t.prototype.listeners=function(e){return xd(this,e,!0)},_t.prototype.rawListeners=function(e){return xd(this,e,!1)},_t.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Cd.call(t,e)},_t.prototype.listenerCount=Cd;function Cd(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?Wa(this._events):[]};function Id(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Dw(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Aw(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function $w(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))}Sd(t,e,o,{once:!0}),e!=="error"&&Pw(t,i,{once:!0})})}function Pw(t,e,r){typeof t.on=="function"&&Sd(t,"error",e,r)}function Sd(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 cu={},qa={},et={},Od={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,h){var f=l>>>16&65535,v=l&65535,E=h>>>16&65535,_=h&65535;return v*_+(f*_+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}})(Od),Object.defineProperty(et,"__esModule",{value:!0});var Dd=Od;function Tw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}et.readInt16BE=Tw;function Rw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}et.readUint16BE=Rw;function Nw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}et.readInt16LE=Nw;function Lw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}et.readUint16LE=Lw;function Ad(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=Ad,et.writeInt16BE=Ad;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 lu(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}et.readInt32BE=lu;function uu(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=uu;function hu(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}et.readInt32LE=hu;function fu(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=fu;function Va(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=Va,et.writeInt32BE=Va;function Ka(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=Ka,et.writeInt32LE=Ka;function Mw(t,e){e===void 0&&(e=0);var r=lu(t,e),n=lu(t,e+4);return r*4294967296+n-(n>>31)*4294967296}et.readInt64BE=Mw;function Uw(t,e){e===void 0&&(e=0);var r=uu(t,e),n=uu(t,e+4);return r*4294967296+n}et.readUint64BE=Uw;function jw(t,e){e===void 0&&(e=0);var r=hu(t,e),n=hu(t,e+4);return n*4294967296+r-(r>>31)*4294967296}et.readInt64LE=jw;function Fw(t,e){e===void 0&&(e=0);var r=fu(t,e),n=fu(t,e+4);return n*4294967296+r}et.readUint64LE=Fw;function Pd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Va(t/4294967296>>>0,e,r),Va(t>>>0,e,r+4),e}et.writeUint64BE=Pd,et.writeInt64BE=Pd;function Td(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ka(t>>>0,e,r),Ka(t/4294967296>>>0,e,r+4),e}et.writeUint64LE=Td,et.writeInt64LE=Td;function Bw(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=Bw;function kw(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=kw;function Hw(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(!Dd.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=Hw;function Ww(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(!Dd.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=Ww;function zw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}et.readFloat32BE=zw;function qw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}et.readFloat32LE=qw;function Vw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}et.readFloat64BE=Vw;function Kw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}et.readFloat64LE=Kw;function Gw(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=Gw;function Zw(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=Zw;function Yw(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=Yw;function Jw(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=Jw;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});function Qw(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Jr.wipe=Qw,Object.defineProperty(qa,"__esModule",{value:!0});var Cr=et,du=Jr,Xw=20;function ev(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],f=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],S=r[27]<<24|r[26]<<16|r[25]<<8|r[24],P=r[31]<<24|r[30]<<16|r[29]<<8|r[28],j=e[3]<<24|e[2]<<16|e[1]<<8|e[0],H=e[7]<<24|e[6]<<16|e[5]<<8|e[4],Z=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,d=l,x=h,J=f,W=v,ee=E,de=_,me=S,O=P,U=j,ce=H,le=Z,re=N,ne=0;ne<Xw;ne+=2)L=L+d|0,U^=L,U=U>>>32-16|U<<16,ee=ee+U|0,d^=ee,d=d>>>32-12|d<<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+W|0,re^=I,re=re>>>32-16|re<<16,O=O+re|0,W^=O,W=W>>>32-12|W<<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+W|0,re^=I,re=re>>>32-8|re<<8,O=O+re|0,W^=O,W=W>>>32-7|W<<7,$=$+x|0,ce^=$,ce=ce>>>32-8|ce<<8,de=de+ce|0,x^=de,x=x>>>32-7|x<<7,L=L+d|0,U^=L,U=U>>>32-8|U<<8,ee=ee+U|0,d^=ee,d=d>>>32-7|d<<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,U^=$,U=U>>>32-16|U<<16,O=O+U|0,J^=O,J=J>>>32-12|J<<12,T=T+W|0,ce^=T,ce=ce>>>32-16|ce<<16,ee=ee+ce|0,W^=ee,W=W>>>32-12|W<<12,I=I+d|0,le^=I,le=le>>>32-16|le<<16,de=de+le|0,d^=de,d=d>>>32-12|d<<12,T=T+W|0,ce^=T,ce=ce>>>32-8|ce<<8,ee=ee+ce|0,W^=ee,W=W>>>32-7|W<<7,I=I+d|0,le^=I,le=le>>>32-8|le<<8,de=de+le|0,d^=de,d=d>>>32-7|d<<7,$=$+J|0,U^=$,U=U>>>32-8|U<<8,O=O+U|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;Cr.writeUint32LE(L+n|0,t,0),Cr.writeUint32LE($+i|0,t,4),Cr.writeUint32LE(T+o|0,t,8),Cr.writeUint32LE(I+c|0,t,12),Cr.writeUint32LE(d+l|0,t,16),Cr.writeUint32LE(x+h|0,t,20),Cr.writeUint32LE(J+f|0,t,24),Cr.writeUint32LE(W+v|0,t,28),Cr.writeUint32LE(ee+E|0,t,32),Cr.writeUint32LE(de+_|0,t,36),Cr.writeUint32LE(me+S|0,t,40),Cr.writeUint32LE(O+P|0,t,44),Cr.writeUint32LE(U+j|0,t,48),Cr.writeUint32LE(ce+H|0,t,52),Cr.writeUint32LE(le+Z|0,t,56),Cr.writeUint32LE(re+N|0,t,60)}function Rd(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){ev(l,o,t);for(var f=h;f<h+64&&f<r.length;f++)n[f]=r[f]^l[f-h];rv(o,0,c)}return du.wipe(l),i===0&&du.wipe(o),n}qa.streamXOR=Rd;function tv(t,e,r,n){return n===void 0&&(n=0),du.wipe(r),Rd(t,e,r,r,n)}qa.stream=tv;function rv(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 Nd={},fi={};Object.defineProperty(fi,"__esModule",{value:!0});function nv(t,e,r){return~(t-1)&e|t-1&r}fi.select=nv;function iv(t,e){return(t|0)-(e|0)-1>>>31&1}fi.lessOrEqual=iv;function Ld(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}fi.compare=Ld;function sv(t,e){return t.length===0||e.length===0?!1:Ld(t,e)!==0}fi.equal=sv,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=fi,r=Jr;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 f=l[2]|l[3]<<8;this._r[1]=(h>>>13|f<<3)&8191;var v=l[4]|l[5]<<8;this._r[2]=(f>>>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 S=l[10]|l[11]<<8;this._r[6]=(_>>>14|S<<2)&8191;var P=l[12]|l[13]<<8;this._r[7]=(S>>>11|P<<5)&8065;var j=l[14]|l[15]<<8;this._r[8]=(P>>>8|j<<8)&8191,this._r[9]=j>>>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,f){for(var v=this._fin?0:2048,E=this._h[0],_=this._h[1],S=this._h[2],P=this._h[3],j=this._h[4],H=this._h[5],Z=this._h[6],N=this._h[7],L=this._h[8],$=this._h[9],T=this._r[0],I=this._r[1],d=this._r[2],x=this._r[3],J=this._r[4],W=this._r[5],ee=this._r[6],de=this._r[7],me=this._r[8],O=this._r[9];f>=16;){var U=l[h+0]|l[h+1]<<8;E+=U&8191;var ce=l[h+2]|l[h+3]<<8;_+=(U>>>13|ce<<3)&8191;var le=l[h+4]|l[h+5]<<8;S+=(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;j+=(re>>>4|ne<<12)&8191,H+=ne>>>1&8191;var ae=l[h+10]|l[h+11]<<8;Z+=(ne>>>14|ae<<2)&8191;var ie=l[h+12]|l[h+13]<<8;N+=(ae>>>11|ie<<5)&8191;var De=l[h+14]|l[h+15]<<8;L+=(ie>>>8|De<<8)&8191,$+=De>>>5|v;var ge=0,Be=ge;Be+=E*T,Be+=_*(5*O),Be+=S*(5*me),Be+=P*(5*de),Be+=j*(5*ee),ge=Be>>>13,Be&=8191,Be+=H*(5*W),Be+=Z*(5*J),Be+=N*(5*x),Be+=L*(5*d),Be+=$*(5*I),ge+=Be>>>13,Be&=8191;var ye=ge;ye+=E*I,ye+=_*T,ye+=S*(5*O),ye+=P*(5*me),ye+=j*(5*de),ge=ye>>>13,ye&=8191,ye+=H*(5*ee),ye+=Z*(5*W),ye+=N*(5*J),ye+=L*(5*x),ye+=$*(5*d),ge+=ye>>>13,ye&=8191;var Me=ge;Me+=E*d,Me+=_*I,Me+=S*T,Me+=P*(5*O),Me+=j*(5*me),ge=Me>>>13,Me&=8191,Me+=H*(5*de),Me+=Z*(5*ee),Me+=N*(5*W),Me+=L*(5*J),Me+=$*(5*x),ge+=Me>>>13,Me&=8191;var Q=ge;Q+=E*x,Q+=_*d,Q+=S*I,Q+=P*T,Q+=j*(5*O),ge=Q>>>13,Q&=8191,Q+=H*(5*me),Q+=Z*(5*de),Q+=N*(5*ee),Q+=L*(5*W),Q+=$*(5*J),ge+=Q>>>13,Q&=8191;var Y=ge;Y+=E*J,Y+=_*x,Y+=S*d,Y+=P*I,Y+=j*T,ge=Y>>>13,Y&=8191,Y+=H*(5*O),Y+=Z*(5*me),Y+=N*(5*de),Y+=L*(5*ee),Y+=$*(5*W),ge+=Y>>>13,Y&=8191;var z=ge;z+=E*W,z+=_*J,z+=S*x,z+=P*d,z+=j*I,ge=z>>>13,z&=8191,z+=H*T,z+=Z*(5*O),z+=N*(5*me),z+=L*(5*de),z+=$*(5*ee),ge+=z>>>13,z&=8191;var w=ge;w+=E*ee,w+=_*W,w+=S*J,w+=P*x,w+=j*d,ge=w>>>13,w&=8191,w+=H*I,w+=Z*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+=S*W,F+=P*J,F+=j*x,ge=F>>>13,F&=8191,F+=H*d,F+=Z*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+=S*ee,we+=P*W,we+=j*J,ge=we>>>13,we&=8191,we+=H*x,we+=Z*d,we+=N*I,we+=L*T,we+=$*(5*O),ge+=we>>>13,we&=8191;var ve=ge;ve+=E*O,ve+=_*me,ve+=S*de,ve+=P*ee,ve+=j*W,ge=ve>>>13,ve&=8191,ve+=H*J,ve+=Z*x,ve+=N*d,ve+=L*I,ve+=$*T,ge+=ve>>>13,ve&=8191,ge=(ge<<2)+ge|0,ge=ge+Be|0,Be=ge&8191,ge=ge>>>13,ye+=ge,E=Be,_=ye,S=Me,P=Q,j=Y,H=z,Z=w,N=F,L=we,$=ve,h+=16,f-=16}this._h[0]=E,this._h[1]=_,this._h[2]=S,this._h[3]=P,this._h[4]=j,this._h[5]=H,this._h[6]=Z,this._h[7]=N,this._h[8]=L,this._h[9]=$},c.prototype.finish=function(l,h){h===void 0&&(h=0);var f=new Uint16Array(10),v,E,_,S;if(this._leftover){for(S=this._leftover,this._buffer[S++]=1;S<16;S++)this._buffer[S]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(v=this._h[1]>>>13,this._h[1]&=8191,S=2;S<10;S++)this._h[S]+=v,v=this._h[S]>>>13,this._h[S]&=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,f[0]=this._h[0]+5,v=f[0]>>>13,f[0]&=8191,S=1;S<10;S++)f[S]=this._h[S]+v,v=f[S]>>>13,f[S]&=8191;for(f[9]-=8192,E=(v^1)-1,S=0;S<10;S++)f[S]&=E;for(E=~E,S=0;S<10;S++)this._h[S]=this._h[S]&E|f[S];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,S=1;S<8;S++)_=(this._h[S]+this._pad[S]|0)+(_>>>16)|0,this._h[S]=_&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,f=l.length,v;if(this._leftover){v=16-this._leftover,v>f&&(v=f);for(var E=0;E<v;E++)this._buffer[this._leftover+E]=l[h+E];if(f-=v,h+=v,this._leftover+=v,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(f>=16&&(v=f-f%16,this._blocks(l,h,v),h+=v,f-=v),f){for(var E=0;E<f;E++)this._buffer[this._leftover+E]=l[h+E];this._leftover+=f}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 f=h.digest();return h.clean(),f}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}(Nd),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=qa,r=Nd,n=Jr,i=et,o=fi;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function h(f){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,f.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(f)}return h.prototype.seal=function(f,v,E,_){if(f.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var S=new Uint8Array(16);S.set(f,S.length-f.length);var P=new Uint8Array(32);e.stream(this._key,S,P,4);var j=v.length+this.tagLength,H;if(_){if(_.length!==j)throw new Error("ChaCha20Poly1305: incorrect destination length");H=_}else H=new Uint8Array(j);return e.streamXOR(this._key,S,v,H,4),this._authenticate(H.subarray(H.length-this.tagLength,H.length),P,H.subarray(0,H.length-this.tagLength),E),n.wipe(S),H},h.prototype.open=function(f,v,E,_){if(f.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(v.length<this.tagLength)return null;var S=new Uint8Array(16);S.set(f,S.length-f.length);var P=new Uint8Array(32);e.stream(this._key,S,P,4);var j=new Uint8Array(this.tagLength);if(this._authenticate(j,P,v.subarray(0,v.length-this.tagLength),E),!o.equal(j,v.subarray(v.length-this.tagLength,v.length)))return null;var H=v.length-this.tagLength,Z;if(_){if(_.length!==H)throw new Error("ChaCha20Poly1305: incorrect destination length");Z=_}else Z=new Uint8Array(H);return e.streamXOR(this._key,S,v.subarray(0,v.length-this.tagLength),Z,4),n.wipe(S),Z},h.prototype.clean=function(){return n.wipe(this._key),this},h.prototype._authenticate=function(f,v,E,_){var S=new r.Poly1305(v);_&&(S.update(_),_.length%16>0&&S.update(c.subarray(_.length%16))),S.update(E),E.length%16>0&&S.update(c.subarray(E.length%16));var P=new Uint8Array(8);_&&i.writeUint64LE(_.length,P),S.update(P),i.writeUint64LE(E.length,P),S.update(P);for(var j=S.digest(),H=0;H<j.length;H++)f[H]=j[H];S.clean(),n.wipe(j),n.wipe(P)},h}();t.ChaCha20Poly1305=l}(cu);var Md={},Eo={},pu={};Object.defineProperty(pu,"__esModule",{value:!0});function ov(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}pu.isSerializableHash=ov,Object.defineProperty(Eo,"__esModule",{value:!0});var Pn=pu,av=fi,cv=Jr,Ud=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),Pn.isSerializableHash(this._inner)&&Pn.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),cv.wipe(n)}return t.prototype.reset=function(){if(!Pn.isSerializableHash(this._inner)||!Pn.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(){Pn.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Pn.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(!Pn.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(!Pn.isSerializableHash(this._inner)||!Pn.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(!Pn.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Eo.HMAC=Ud;function lv(t,e,r){var n=new Ud(t,e);n.update(r);var i=n.digest();return n.clean(),i}Eo.hmac=lv,Eo.equal=av.equal,Object.defineProperty(Md,"__esModule",{value:!0});var jd=Eo,Fd=Jr,uv=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=jd.hmac(this._hash,n,r);this._hmac=new jd.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(),Fd.wipe(this._buffer),Fd.wipe(this._counter),this._bufpos=0},t}(),hv=Md.HKDF=uv,Is={},Ga={},Za={};Object.defineProperty(Za,"__esModule",{value:!0}),Za.BrowserRandomSource=void 0;const Bd=65536;class fv{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+=Bd)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Bd)));return r}}Za.BrowserRandomSource=fv;function dv(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 Ya={},pv={},gv=Object.freeze({__proto__:null,default:pv}),mv=Fi(gv);Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.NodeRandomSource=void 0;const wv=Jr;class vv{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof dv<"u"){const e=mv;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,wv.wipe)(r),n}}Ya.NodeRandomSource=vv,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.SystemRandomSource=void 0;const yv=Za,bv=Ya;class _v{constructor(){if(this.isAvailable=!1,this.name="",this._source=new yv.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new bv.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)}}Ga.SystemRandomSource=_v,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Ga,r=et,n=Jr;t.defaultRandomSource=new e.SystemRandomSource;function i(f,v=t.defaultRandomSource){return v.randomBytes(f)}t.randomBytes=i;function o(f=t.defaultRandomSource){const v=i(4,f),E=(0,r.readUint32LE)(v);return(0,n.wipe)(v),E}t.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(f,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 S=v.length,P=256-256%S;for(;f>0;){const j=i(Math.ceil(f*256/P),E);for(let H=0;H<j.length&&f>0;H++){const Z=j[H];Z<P&&(_+=v.charAt(Z%S),f--)}(0,n.wipe)(j)}return _}t.randomString=l;function h(f,v=c,E=t.defaultRandomSource){const _=Math.ceil(f/(Math.log(v.length)/Math.LN2));return l(_,v,E)}t.randomStringForEntropy=h}(Is);var Ja={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Jr;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,f){if(f===void 0&&(f=h.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var v=0;if(this._bytesHashed+=f,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&f>0;)this._buffer[this._bufferLength++]=h[v++],f--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(f>=this.blockSize&&(v=o(this._temp,this._state,h,v,f),f%=this.blockSize);f>0;)this._buffer[this._bufferLength++]=h[v++],f--;return this},l.prototype.finish=function(h){if(!this._finished){var f=this._bytesHashed,v=this._bufferLength,E=f/536870912|0,_=f<<3,S=f%64<56?64:128;this._buffer[v]=128;for(var P=v+1;P<S-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,S-8),e.writeUint32BE(_,this._buffer,S-4),o(this._temp,this._state,this._buffer,0,S),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,f,v,E){for(;E>=64;){for(var _=h[0],S=h[1],P=h[2],j=h[3],H=h[4],Z=h[5],N=h[6],L=h[7],$=0;$<16;$++){var T=v+$*4;l[$]=e.readUint32BE(f,T)}for(var $=16;$<64;$++){var I=l[$-2],d=(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[$]=(d+l[$-7]|0)+(x+l[$-16]|0)}for(var $=0;$<64;$++){var d=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&Z^~H&N)|0)+(L+(i[$]+l[$]|0)|0)|0,x=((_>>>2|_<<32-2)^(_>>>13|_<<32-13)^(_>>>22|_<<32-22))+(_&S^_&P^S&P)|0;L=N,N=Z,Z=H,H=j+d|0,j=P,P=S,S=_,_=d+x|0}h[0]+=_,h[1]+=S,h[2]+=P,h[3]+=j,h[4]+=H,h[5]+=Z,h[6]+=N,h[7]+=L,v+=64,E-=64}return v}function c(l){var h=new n;h.update(l);var f=h.digest();return h.clean(),f}t.hash=c})(Ja);var gu={};(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=Is,r=Jr;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 d=$[I]+T+65535;T=Math.floor(d/65536),$[I]=d-T*65536}$[0]+=T-1+37*(T-1)}function l($,T,I){const d=~(I-1);for(let x=0;x<16;x++){const J=d&($[x]^T[x]);$[x]^=J,T[x]^=J}}function h($,T){const I=n(),d=n();for(let x=0;x<16;x++)d[x]=T[x];c(d),c(d),c(d);for(let x=0;x<2;x++){I[0]=d[0]-65517;for(let W=1;W<15;W++)I[W]=d[W]-65535-(I[W-1]>>16&1),I[W-1]&=65535;I[15]=d[15]-32767-(I[14]>>16&1);const J=I[15]>>16&1;I[14]&=65535,l(d,I,1-J)}for(let x=0;x<16;x++)$[2*x]=d[x]&255,$[2*x+1]=d[x]>>8}function f($,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 d=0;d<16;d++)$[d]=T[d]+I[d]}function E($,T,I){for(let d=0;d<16;d++)$[d]=T[d]-I[d]}function _($,T,I){let d,x,J=0,W=0,ee=0,de=0,me=0,O=0,U=0,ce=0,le=0,re=0,ne=0,ae=0,ie=0,De=0,ge=0,Be=0,ye=0,Me=0,Q=0,Y=0,z=0,w=0,F=0,we=0,ve=0,Ue=0,nt=0,at=0,Ge=0,At=0,$t=0,Je=I[0],He=I[1],ke=I[2],Ke=I[3],rt=I[4],je=I[5],Ze=I[6],b=I[7],p=I[8],m=I[9],A=I[10],B=I[11],K=I[12],X=I[13],Ee=I[14],Re=I[15];d=T[0],J+=d*Je,W+=d*He,ee+=d*ke,de+=d*Ke,me+=d*rt,O+=d*je,U+=d*Ze,ce+=d*b,le+=d*p,re+=d*m,ne+=d*A,ae+=d*B,ie+=d*K,De+=d*X,ge+=d*Ee,Be+=d*Re,d=T[1],W+=d*Je,ee+=d*He,de+=d*ke,me+=d*Ke,O+=d*rt,U+=d*je,ce+=d*Ze,le+=d*b,re+=d*p,ne+=d*m,ae+=d*A,ie+=d*B,De+=d*K,ge+=d*X,Be+=d*Ee,ye+=d*Re,d=T[2],ee+=d*Je,de+=d*He,me+=d*ke,O+=d*Ke,U+=d*rt,ce+=d*je,le+=d*Ze,re+=d*b,ne+=d*p,ae+=d*m,ie+=d*A,De+=d*B,ge+=d*K,Be+=d*X,ye+=d*Ee,Me+=d*Re,d=T[3],de+=d*Je,me+=d*He,O+=d*ke,U+=d*Ke,ce+=d*rt,le+=d*je,re+=d*Ze,ne+=d*b,ae+=d*p,ie+=d*m,De+=d*A,ge+=d*B,Be+=d*K,ye+=d*X,Me+=d*Ee,Q+=d*Re,d=T[4],me+=d*Je,O+=d*He,U+=d*ke,ce+=d*Ke,le+=d*rt,re+=d*je,ne+=d*Ze,ae+=d*b,ie+=d*p,De+=d*m,ge+=d*A,Be+=d*B,ye+=d*K,Me+=d*X,Q+=d*Ee,Y+=d*Re,d=T[5],O+=d*Je,U+=d*He,ce+=d*ke,le+=d*Ke,re+=d*rt,ne+=d*je,ae+=d*Ze,ie+=d*b,De+=d*p,ge+=d*m,Be+=d*A,ye+=d*B,Me+=d*K,Q+=d*X,Y+=d*Ee,z+=d*Re,d=T[6],U+=d*Je,ce+=d*He,le+=d*ke,re+=d*Ke,ne+=d*rt,ae+=d*je,ie+=d*Ze,De+=d*b,ge+=d*p,Be+=d*m,ye+=d*A,Me+=d*B,Q+=d*K,Y+=d*X,z+=d*Ee,w+=d*Re,d=T[7],ce+=d*Je,le+=d*He,re+=d*ke,ne+=d*Ke,ae+=d*rt,ie+=d*je,De+=d*Ze,ge+=d*b,Be+=d*p,ye+=d*m,Me+=d*A,Q+=d*B,Y+=d*K,z+=d*X,w+=d*Ee,F+=d*Re,d=T[8],le+=d*Je,re+=d*He,ne+=d*ke,ae+=d*Ke,ie+=d*rt,De+=d*je,ge+=d*Ze,Be+=d*b,ye+=d*p,Me+=d*m,Q+=d*A,Y+=d*B,z+=d*K,w+=d*X,F+=d*Ee,we+=d*Re,d=T[9],re+=d*Je,ne+=d*He,ae+=d*ke,ie+=d*Ke,De+=d*rt,ge+=d*je,Be+=d*Ze,ye+=d*b,Me+=d*p,Q+=d*m,Y+=d*A,z+=d*B,w+=d*K,F+=d*X,we+=d*Ee,ve+=d*Re,d=T[10],ne+=d*Je,ae+=d*He,ie+=d*ke,De+=d*Ke,ge+=d*rt,Be+=d*je,ye+=d*Ze,Me+=d*b,Q+=d*p,Y+=d*m,z+=d*A,w+=d*B,F+=d*K,we+=d*X,ve+=d*Ee,Ue+=d*Re,d=T[11],ae+=d*Je,ie+=d*He,De+=d*ke,ge+=d*Ke,Be+=d*rt,ye+=d*je,Me+=d*Ze,Q+=d*b,Y+=d*p,z+=d*m,w+=d*A,F+=d*B,we+=d*K,ve+=d*X,Ue+=d*Ee,nt+=d*Re,d=T[12],ie+=d*Je,De+=d*He,ge+=d*ke,Be+=d*Ke,ye+=d*rt,Me+=d*je,Q+=d*Ze,Y+=d*b,z+=d*p,w+=d*m,F+=d*A,we+=d*B,ve+=d*K,Ue+=d*X,nt+=d*Ee,at+=d*Re,d=T[13],De+=d*Je,ge+=d*He,Be+=d*ke,ye+=d*Ke,Me+=d*rt,Q+=d*je,Y+=d*Ze,z+=d*b,w+=d*p,F+=d*m,we+=d*A,ve+=d*B,Ue+=d*K,nt+=d*X,at+=d*Ee,Ge+=d*Re,d=T[14],ge+=d*Je,Be+=d*He,ye+=d*ke,Me+=d*Ke,Q+=d*rt,Y+=d*je,z+=d*Ze,w+=d*b,F+=d*p,we+=d*m,ve+=d*A,Ue+=d*B,nt+=d*K,at+=d*X,Ge+=d*Ee,At+=d*Re,d=T[15],Be+=d*Je,ye+=d*He,Me+=d*ke,Q+=d*Ke,Y+=d*rt,z+=d*je,w+=d*Ze,F+=d*b,we+=d*p,ve+=d*m,Ue+=d*A,nt+=d*B,at+=d*K,Ge+=d*X,At+=d*Ee,$t+=d*Re,J+=38*ye,W+=38*Me,ee+=38*Q,de+=38*Y,me+=38*z,O+=38*w,U+=38*F,ce+=38*we,le+=38*ve,re+=38*Ue,ne+=38*nt,ae+=38*at,ie+=38*Ge,De+=38*At,ge+=38*$t,x=1,d=J+x+65535,x=Math.floor(d/65536),J=d-x*65536,d=W+x+65535,x=Math.floor(d/65536),W=d-x*65536,d=ee+x+65535,x=Math.floor(d/65536),ee=d-x*65536,d=de+x+65535,x=Math.floor(d/65536),de=d-x*65536,d=me+x+65535,x=Math.floor(d/65536),me=d-x*65536,d=O+x+65535,x=Math.floor(d/65536),O=d-x*65536,d=U+x+65535,x=Math.floor(d/65536),U=d-x*65536,d=ce+x+65535,x=Math.floor(d/65536),ce=d-x*65536,d=le+x+65535,x=Math.floor(d/65536),le=d-x*65536,d=re+x+65535,x=Math.floor(d/65536),re=d-x*65536,d=ne+x+65535,x=Math.floor(d/65536),ne=d-x*65536,d=ae+x+65535,x=Math.floor(d/65536),ae=d-x*65536,d=ie+x+65535,x=Math.floor(d/65536),ie=d-x*65536,d=De+x+65535,x=Math.floor(d/65536),De=d-x*65536,d=ge+x+65535,x=Math.floor(d/65536),ge=d-x*65536,d=Be+x+65535,x=Math.floor(d/65536),Be=d-x*65536,J+=x-1+37*(x-1),x=1,d=J+x+65535,x=Math.floor(d/65536),J=d-x*65536,d=W+x+65535,x=Math.floor(d/65536),W=d-x*65536,d=ee+x+65535,x=Math.floor(d/65536),ee=d-x*65536,d=de+x+65535,x=Math.floor(d/65536),de=d-x*65536,d=me+x+65535,x=Math.floor(d/65536),me=d-x*65536,d=O+x+65535,x=Math.floor(d/65536),O=d-x*65536,d=U+x+65535,x=Math.floor(d/65536),U=d-x*65536,d=ce+x+65535,x=Math.floor(d/65536),ce=d-x*65536,d=le+x+65535,x=Math.floor(d/65536),le=d-x*65536,d=re+x+65535,x=Math.floor(d/65536),re=d-x*65536,d=ne+x+65535,x=Math.floor(d/65536),ne=d-x*65536,d=ae+x+65535,x=Math.floor(d/65536),ae=d-x*65536,d=ie+x+65535,x=Math.floor(d/65536),ie=d-x*65536,d=De+x+65535,x=Math.floor(d/65536),De=d-x*65536,d=ge+x+65535,x=Math.floor(d/65536),ge=d-x*65536,d=Be+x+65535,x=Math.floor(d/65536),Be=d-x*65536,J+=x-1+37*(x-1),$[0]=J,$[1]=W,$[2]=ee,$[3]=de,$[4]=me,$[5]=O,$[6]=U,$[7]=ce,$[8]=le,$[9]=re,$[10]=ne,$[11]=ae,$[12]=ie,$[13]=De,$[14]=ge,$[15]=Be}function S($,T){_($,T,T)}function P($,T){const I=n();for(let d=0;d<16;d++)I[d]=T[d];for(let d=253;d>=0;d--)S(I,I),d!==2&&d!==4&&_(I,I,T);for(let d=0;d<16;d++)$[d]=I[d]}function j($,T){const I=new Uint8Array(32),d=new Float64Array(80),x=n(),J=n(),W=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,f(d,T);for(let le=0;le<16;le++)J[le]=d[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(W,ee,re),v(de,x,W),E(x,x,W),v(W,J,ee),E(J,J,ee),S(ee,de),S(me,x),_(x,W,x),_(W,J,de),v(de,x,W),E(x,x,W),S(J,x),E(W,ee,me),_(x,W,o),v(x,x,ee),_(W,W,x),_(x,ee,me),_(ee,J,d),S(J,de),l(x,J,re),l(W,ee,re)}for(let le=0;le<16;le++)d[le+16]=x[le],d[le+32]=W[le],d[le+48]=J[le],d[le+64]=ee[le];const O=d.subarray(32),U=d.subarray(16);P(O,O),_(U,U,O);const ce=new Uint8Array(32);return h(ce,U),ce}t.scalarMult=j;function H($){return j($,i)}t.scalarMultBase=H;function Z($){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=Z;function N($){const T=(0,e.randomBytes)(32,$),I=Z(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 d=j($,T);if(I){let x=0;for(let J=0;J<d.length;J++)x|=d[J];if(x===0)throw new Error("X25519: invalid shared key")}return d}t.sharedKey=L})(gu);function mu(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function kd(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?mu(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function wu(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=kd(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return mu(r)}function Ev(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),f=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 j=0,H=0,Z=0,N=P.length;Z!==N&&P[Z]===0;)Z++,j++;for(var L=(N-Z)*v+1>>>0,$=new Uint8Array(L);Z!==N;){for(var T=P[Z],I=0,d=L-1;(T!==0||I<H)&&d!==-1;d--,I++)T+=256*$[d]>>>0,$[d]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,Z++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(j);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 j=0;if(P[j]!==" "){for(var H=0,Z=0;P[j]===h;)H++,j++;for(var N=(P.length-j)*f+1>>>0,L=new Uint8Array(N);P[j];){var $=r[P.charCodeAt(j)];if($===255)return;for(var T=0,I=N-1;($!==0||T<Z)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");Z=T,j++}if(P[j]!==" "){for(var d=N-Z;d!==N&&L[d]===0;)d++;for(var x=new Uint8Array(H+(N-d)),J=H;d!==N;)x[J++]=L[d++];return x}}}function S(P){var j=_(P);if(j)return j;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:S}}var xv=Ev,Cv=xv;const Hd=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")},Iv=t=>new TextEncoder().encode(t),Sv=t=>new TextDecoder().decode(t);class Ov{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 Dv{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 Wd(this,e)}}class Av{constructor(e){this.decoders=e}or(e){return Wd(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 Wd=(t,e)=>new Av({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class $v{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Ov(e,r,n),this.decoder=new Dv(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 $v(t,e,r,n),xo=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Cv(r,e);return Qa({prefix:t,name:e,encode:n,decode:o=>Hd(i(o))})},Pv=(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,f=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[f++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},Tv=(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},br=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Qa({prefix:e,name:t,encode(i){return Tv(i,n,r)},decode(i){return Pv(i,n,r,t)}}),Rv=Qa({prefix:"\0",name:"identity",encode:t=>Sv(t),decode:t=>Iv(t)});var Nv=Object.freeze({__proto__:null,identity:Rv});const Lv=br({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Mv=Object.freeze({__proto__:null,base2:Lv});const Uv=br({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var jv=Object.freeze({__proto__:null,base8:Uv});const Fv=xo({prefix:"9",name:"base10",alphabet:"0123456789"});var Bv=Object.freeze({__proto__:null,base10:Fv});const kv=br({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Hv=br({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Wv=Object.freeze({__proto__:null,base16:kv,base16upper:Hv});const zv=br({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),qv=br({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vv=br({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Kv=br({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gv=br({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Zv=br({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Yv=br({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Jv=br({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Qv=br({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Xv=Object.freeze({__proto__:null,base32:zv,base32upper:qv,base32pad:Vv,base32padupper:Kv,base32hex:Gv,base32hexupper:Zv,base32hexpad:Yv,base32hexpadupper:Jv,base32z:Qv});const ey=xo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ty=xo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ry=Object.freeze({__proto__:null,base36:ey,base36upper:ty});const ny=xo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),iy=xo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var sy=Object.freeze({__proto__:null,base58btc:ny,base58flickr:iy});const oy=br({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ay=br({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),cy=br({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ly=br({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var uy=Object.freeze({__proto__:null,base64:oy,base64pad:ay,base64url:cy,base64urlpad:ly});const zd=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}"),hy=zd.reduce((t,e,r)=>(t[r]=e,t),[]),fy=zd.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function dy(t){return t.reduce((e,r)=>(e+=hy[r],e),"")}function py(t){const e=[];for(const r of t){const n=fy[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const gy=Qa({prefix:"\u{1F680}",name:"base256emoji",encode:dy,decode:py});var my=Object.freeze({__proto__:null,base256emoji:gy}),wy=Vd,qd=128,vy=127,yy=~vy,by=Math.pow(2,31);function Vd(t,e,r){e=e||[],r=r||0;for(var n=r;t>=by;)e[r++]=t&255|qd,t/=128;for(;t&yy;)e[r++]=t&255|qd,t>>>=7;return e[r]=t|0,Vd.bytes=r-n+1,e}var _y=vu,Ey=128,Kd=127;function vu(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw vu.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Kd)<<i:(c&Kd)*Math.pow(2,i),i+=7}while(c>=Ey);return vu.bytes=o-n,r}var xy=Math.pow(2,7),Cy=Math.pow(2,14),Iy=Math.pow(2,21),Sy=Math.pow(2,28),Oy=Math.pow(2,35),Dy=Math.pow(2,42),Ay=Math.pow(2,49),$y=Math.pow(2,56),Py=Math.pow(2,63),Ty=function(t){return t<xy?1:t<Cy?2:t<Iy?3:t<Sy?4:t<Oy?5:t<Dy?6:t<Ay?7:t<$y?8:t<Py?9:10},Ry={encode:wy,decode:_y,encodingLength:Ty},Gd=Ry;const Zd=(t,e,r=0)=>(Gd.encode(t,e,r),e),Yd=t=>Gd.encodingLength(t),yu=(t,e)=>{const r=e.byteLength,n=Yd(t),i=n+Yd(r),o=new Uint8Array(i+r);return Zd(t,o,0),Zd(r,o,n),o.set(e,i),new Ny(t,r,e,o)};class Ny{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Jd=({name:t,code:e,encode:r})=>new Ly(t,e,r);class Ly{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?yu(this.code,r):r.then(n=>yu(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Qd=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),My=Jd({name:"sha2-256",code:18,encode:Qd("SHA-256")}),Uy=Jd({name:"sha2-512",code:19,encode:Qd("SHA-512")});var jy=Object.freeze({__proto__:null,sha256:My,sha512:Uy});const Xd=0,Fy="identity",e1=Hd;var By=Object.freeze({__proto__:null,identity:{code:Xd,name:Fy,encode:e1,digest:t=>yu(Xd,e1(t))}});new TextEncoder,new TextDecoder;const t1={...Nv,...Mv,...jv,...Bv,...Wv,...Xv,...ry,...sy,...uy,...my};({...jy,...By});function r1(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const n1=r1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),bu=r1("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=kd(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),i1={utf8:n1,"utf-8":n1,hex:t1.base16,latin1:bu,ascii:bu,binary:bu,...t1};function Hr(t,e="utf8"){const r=i1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?mu(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Ar(t,e="utf8"){const r=i1[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 s1=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))},ky=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),Hy=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),Wy=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}(),zy=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),qy=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Vy=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Ky=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,o1=3,Gy=[["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",Vy]],a1=[["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 Zy(t){return t?c1(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new qy:typeof navigator<"u"?c1(navigator.userAgent):Qy()}function Yy(t){return t!==""&&Gy.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 c1(t){var e=Yy(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new zy;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<o1&&(i=s1(s1([],i,!0),Xy(o1-i.length),!0)):i=[];var o=i.join("."),c=Jy(t),l=Ky.exec(t);return l&&l[1]?new Wy(r,o,c,l[1]):new ky(r,o,c)}function Jy(t){for(var e=0,r=a1.length;e<r;e++){var n=a1[e],i=n[0],o=n[1],c=o.exec(t);if(c)return i}return null}function Qy(){var t=typeof process<"u"&&process.version;return t?new Hy(process.version.slice(1)):null}function Xy(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Te={};/*! *****************************************************************************
|
|
1
|
+
(function(_n,dr){typeof exports=="object"&&typeof module<"u"?dr(exports):typeof define=="function"&&define.amd?define(["exports"],dr):(_n=typeof globalThis<"u"?globalThis:_n||self,dr(_n["@walletconnect/ethereum-provider"]={}))})(this,function(_n){"use strict";var dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ji(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 yr={exports:{}},Cs=typeof Reflect=="object"?Reflect:null,vd=Cs&&typeof Cs.apply=="function"?Cs.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},qa;Cs&&typeof Cs.ownKeys=="function"?qa=Cs.ownKeys:Object.getOwnPropertySymbols?qa=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:qa=function(e){return Object.getOwnPropertyNames(e)};function Ow(t){console&&console.warn&&console.warn(t)}var yd=Number.isNaN||function(e){return e!==e};function _t(){_t.init.call(this)}yr.exports=_t,yr.exports.once=Pw,_t.EventEmitter=_t,_t.prototype._events=void 0,_t.prototype._eventsCount=0,_t.prototype._maxListeners=void 0;var bd=10;function Va(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 bd},set:function(t){if(typeof t!="number"||t<0||yd(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");bd=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||yd(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 _d(t){return t._maxListeners===void 0?_t.defaultMaxListeners:t._maxListeners}_t.prototype.getMaxListeners=function(){return _d(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")vd(h,this,r);else for(var f=h.length,v=Sd(h,f),n=0;n<f;++n)vd(v[n],this,r);return!0};function Ed(t,e,r,n){var i,o,c;if(Va(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=_d(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,Ow(l)}return t}_t.prototype.addListener=function(e,r){return Ed(this,e,r,!1)},_t.prototype.on=_t.prototype.addListener,_t.prototype.prependListener=function(e,r){return Ed(this,e,r,!0)};function Dw(){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 xd(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Dw.bind(n);return i.listener=r,n.wrapFn=i,i}_t.prototype.once=function(e,r){return Va(r),this.on(e,xd(this,e,r)),this},_t.prototype.prependOnceListener=function(e,r){return Va(r),this.prependListener(e,xd(this,e,r)),this},_t.prototype.removeListener=function(e,r){var n,i,o,c,l;if(Va(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():Aw(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 Cd(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?$w(i):Sd(i,i.length)}_t.prototype.listeners=function(e){return Cd(this,e,!0)},_t.prototype.rawListeners=function(e){return Cd(this,e,!1)},_t.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Id.call(t,e)},_t.prototype.listenerCount=Id;function Id(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?qa(this._events):[]};function Sd(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Aw(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function $w(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Pw(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))}Od(t,e,o,{once:!0}),e!=="error"&&Tw(t,i,{once:!0})})}function Tw(t,e,r){typeof t.on=="function"&&Od(t,"error",e,r)}function Od(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 uu={},Ka={},et={},Dd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,h){var f=l>>>16&65535,v=l&65535,E=h>>>16&65535,_=h&65535;return v*_+(f*_+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}})(Dd),Object.defineProperty(et,"__esModule",{value:!0});var Ad=Dd;function Rw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}et.readInt16BE=Rw;function Nw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}et.readUint16BE=Nw;function Lw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}et.readInt16LE=Lw;function Mw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}et.readUint16LE=Mw;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 Pd(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=Pd,et.writeInt16LE=Pd;function hu(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}et.readInt32BE=hu;function fu(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=fu;function du(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}et.readInt32LE=du;function pu(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=pu;function Ga(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=Ga,et.writeInt32BE=Ga;function Za(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=Za,et.writeInt32LE=Za;function Uw(t,e){e===void 0&&(e=0);var r=hu(t,e),n=hu(t,e+4);return r*4294967296+n-(n>>31)*4294967296}et.readInt64BE=Uw;function jw(t,e){e===void 0&&(e=0);var r=fu(t,e),n=fu(t,e+4);return r*4294967296+n}et.readUint64BE=jw;function Fw(t,e){e===void 0&&(e=0);var r=du(t,e),n=du(t,e+4);return n*4294967296+r-(r>>31)*4294967296}et.readInt64LE=Fw;function Bw(t,e){e===void 0&&(e=0);var r=pu(t,e),n=pu(t,e+4);return n*4294967296+r}et.readUint64LE=Bw;function Td(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ga(t/4294967296>>>0,e,r),Ga(t>>>0,e,r+4),e}et.writeUint64BE=Td,et.writeInt64BE=Td;function Rd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Za(t>>>0,e,r),Za(t/4294967296>>>0,e,r+4),e}et.writeUint64LE=Rd,et.writeInt64LE=Rd;function kw(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=kw;function Hw(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=Hw;function Ww(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(!Ad.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=Ww;function zw(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(!Ad.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=zw;function qw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}et.readFloat32BE=qw;function Vw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}et.readFloat32LE=Vw;function Kw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}et.readFloat64BE=Kw;function Gw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}et.readFloat64LE=Gw;function Zw(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=Zw;function Yw(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=Yw;function Jw(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=Jw;function Qw(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=Qw;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});function Xw(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Jr.wipe=Xw,Object.defineProperty(Ka,"__esModule",{value:!0});var Cr=et,gu=Jr,ev=20;function tv(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],f=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],S=r[27]<<24|r[26]<<16|r[25]<<8|r[24],P=r[31]<<24|r[30]<<16|r[29]<<8|r[28],j=e[3]<<24|e[2]<<16|e[1]<<8|e[0],H=e[7]<<24|e[6]<<16|e[5]<<8|e[4],Z=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,d=l,x=h,J=f,W=v,ee=E,de=_,me=S,O=P,U=j,ce=H,le=Z,re=N,ne=0;ne<ev;ne+=2)L=L+d|0,U^=L,U=U>>>32-16|U<<16,ee=ee+U|0,d^=ee,d=d>>>32-12|d<<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+W|0,re^=I,re=re>>>32-16|re<<16,O=O+re|0,W^=O,W=W>>>32-12|W<<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+W|0,re^=I,re=re>>>32-8|re<<8,O=O+re|0,W^=O,W=W>>>32-7|W<<7,$=$+x|0,ce^=$,ce=ce>>>32-8|ce<<8,de=de+ce|0,x^=de,x=x>>>32-7|x<<7,L=L+d|0,U^=L,U=U>>>32-8|U<<8,ee=ee+U|0,d^=ee,d=d>>>32-7|d<<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,U^=$,U=U>>>32-16|U<<16,O=O+U|0,J^=O,J=J>>>32-12|J<<12,T=T+W|0,ce^=T,ce=ce>>>32-16|ce<<16,ee=ee+ce|0,W^=ee,W=W>>>32-12|W<<12,I=I+d|0,le^=I,le=le>>>32-16|le<<16,de=de+le|0,d^=de,d=d>>>32-12|d<<12,T=T+W|0,ce^=T,ce=ce>>>32-8|ce<<8,ee=ee+ce|0,W^=ee,W=W>>>32-7|W<<7,I=I+d|0,le^=I,le=le>>>32-8|le<<8,de=de+le|0,d^=de,d=d>>>32-7|d<<7,$=$+J|0,U^=$,U=U>>>32-8|U<<8,O=O+U|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;Cr.writeUint32LE(L+n|0,t,0),Cr.writeUint32LE($+i|0,t,4),Cr.writeUint32LE(T+o|0,t,8),Cr.writeUint32LE(I+c|0,t,12),Cr.writeUint32LE(d+l|0,t,16),Cr.writeUint32LE(x+h|0,t,20),Cr.writeUint32LE(J+f|0,t,24),Cr.writeUint32LE(W+v|0,t,28),Cr.writeUint32LE(ee+E|0,t,32),Cr.writeUint32LE(de+_|0,t,36),Cr.writeUint32LE(me+S|0,t,40),Cr.writeUint32LE(O+P|0,t,44),Cr.writeUint32LE(U+j|0,t,48),Cr.writeUint32LE(ce+H|0,t,52),Cr.writeUint32LE(le+Z|0,t,56),Cr.writeUint32LE(re+N|0,t,60)}function Nd(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){tv(l,o,t);for(var f=h;f<h+64&&f<r.length;f++)n[f]=r[f]^l[f-h];nv(o,0,c)}return gu.wipe(l),i===0&&gu.wipe(o),n}Ka.streamXOR=Nd;function rv(t,e,r,n){return n===void 0&&(n=0),gu.wipe(r),Nd(t,e,r,r,n)}Ka.stream=rv;function nv(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 Ld={},hi={};Object.defineProperty(hi,"__esModule",{value:!0});function iv(t,e,r){return~(t-1)&e|t-1&r}hi.select=iv;function sv(t,e){return(t|0)-(e|0)-1>>>31&1}hi.lessOrEqual=sv;function Md(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}hi.compare=Md;function ov(t,e){return t.length===0||e.length===0?!1:Md(t,e)!==0}hi.equal=ov,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=hi,r=Jr;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 f=l[2]|l[3]<<8;this._r[1]=(h>>>13|f<<3)&8191;var v=l[4]|l[5]<<8;this._r[2]=(f>>>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 S=l[10]|l[11]<<8;this._r[6]=(_>>>14|S<<2)&8191;var P=l[12]|l[13]<<8;this._r[7]=(S>>>11|P<<5)&8065;var j=l[14]|l[15]<<8;this._r[8]=(P>>>8|j<<8)&8191,this._r[9]=j>>>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,f){for(var v=this._fin?0:2048,E=this._h[0],_=this._h[1],S=this._h[2],P=this._h[3],j=this._h[4],H=this._h[5],Z=this._h[6],N=this._h[7],L=this._h[8],$=this._h[9],T=this._r[0],I=this._r[1],d=this._r[2],x=this._r[3],J=this._r[4],W=this._r[5],ee=this._r[6],de=this._r[7],me=this._r[8],O=this._r[9];f>=16;){var U=l[h+0]|l[h+1]<<8;E+=U&8191;var ce=l[h+2]|l[h+3]<<8;_+=(U>>>13|ce<<3)&8191;var le=l[h+4]|l[h+5]<<8;S+=(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;j+=(re>>>4|ne<<12)&8191,H+=ne>>>1&8191;var ae=l[h+10]|l[h+11]<<8;Z+=(ne>>>14|ae<<2)&8191;var ie=l[h+12]|l[h+13]<<8;N+=(ae>>>11|ie<<5)&8191;var De=l[h+14]|l[h+15]<<8;L+=(ie>>>8|De<<8)&8191,$+=De>>>5|v;var ge=0,Be=ge;Be+=E*T,Be+=_*(5*O),Be+=S*(5*me),Be+=P*(5*de),Be+=j*(5*ee),ge=Be>>>13,Be&=8191,Be+=H*(5*W),Be+=Z*(5*J),Be+=N*(5*x),Be+=L*(5*d),Be+=$*(5*I),ge+=Be>>>13,Be&=8191;var ye=ge;ye+=E*I,ye+=_*T,ye+=S*(5*O),ye+=P*(5*me),ye+=j*(5*de),ge=ye>>>13,ye&=8191,ye+=H*(5*ee),ye+=Z*(5*W),ye+=N*(5*J),ye+=L*(5*x),ye+=$*(5*d),ge+=ye>>>13,ye&=8191;var Me=ge;Me+=E*d,Me+=_*I,Me+=S*T,Me+=P*(5*O),Me+=j*(5*me),ge=Me>>>13,Me&=8191,Me+=H*(5*de),Me+=Z*(5*ee),Me+=N*(5*W),Me+=L*(5*J),Me+=$*(5*x),ge+=Me>>>13,Me&=8191;var Q=ge;Q+=E*x,Q+=_*d,Q+=S*I,Q+=P*T,Q+=j*(5*O),ge=Q>>>13,Q&=8191,Q+=H*(5*me),Q+=Z*(5*de),Q+=N*(5*ee),Q+=L*(5*W),Q+=$*(5*J),ge+=Q>>>13,Q&=8191;var Y=ge;Y+=E*J,Y+=_*x,Y+=S*d,Y+=P*I,Y+=j*T,ge=Y>>>13,Y&=8191,Y+=H*(5*O),Y+=Z*(5*me),Y+=N*(5*de),Y+=L*(5*ee),Y+=$*(5*W),ge+=Y>>>13,Y&=8191;var z=ge;z+=E*W,z+=_*J,z+=S*x,z+=P*d,z+=j*I,ge=z>>>13,z&=8191,z+=H*T,z+=Z*(5*O),z+=N*(5*me),z+=L*(5*de),z+=$*(5*ee),ge+=z>>>13,z&=8191;var w=ge;w+=E*ee,w+=_*W,w+=S*J,w+=P*x,w+=j*d,ge=w>>>13,w&=8191,w+=H*I,w+=Z*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+=S*W,F+=P*J,F+=j*x,ge=F>>>13,F&=8191,F+=H*d,F+=Z*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+=S*ee,we+=P*W,we+=j*J,ge=we>>>13,we&=8191,we+=H*x,we+=Z*d,we+=N*I,we+=L*T,we+=$*(5*O),ge+=we>>>13,we&=8191;var ve=ge;ve+=E*O,ve+=_*me,ve+=S*de,ve+=P*ee,ve+=j*W,ge=ve>>>13,ve&=8191,ve+=H*J,ve+=Z*x,ve+=N*d,ve+=L*I,ve+=$*T,ge+=ve>>>13,ve&=8191,ge=(ge<<2)+ge|0,ge=ge+Be|0,Be=ge&8191,ge=ge>>>13,ye+=ge,E=Be,_=ye,S=Me,P=Q,j=Y,H=z,Z=w,N=F,L=we,$=ve,h+=16,f-=16}this._h[0]=E,this._h[1]=_,this._h[2]=S,this._h[3]=P,this._h[4]=j,this._h[5]=H,this._h[6]=Z,this._h[7]=N,this._h[8]=L,this._h[9]=$},c.prototype.finish=function(l,h){h===void 0&&(h=0);var f=new Uint16Array(10),v,E,_,S;if(this._leftover){for(S=this._leftover,this._buffer[S++]=1;S<16;S++)this._buffer[S]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(v=this._h[1]>>>13,this._h[1]&=8191,S=2;S<10;S++)this._h[S]+=v,v=this._h[S]>>>13,this._h[S]&=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,f[0]=this._h[0]+5,v=f[0]>>>13,f[0]&=8191,S=1;S<10;S++)f[S]=this._h[S]+v,v=f[S]>>>13,f[S]&=8191;for(f[9]-=8192,E=(v^1)-1,S=0;S<10;S++)f[S]&=E;for(E=~E,S=0;S<10;S++)this._h[S]=this._h[S]&E|f[S];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,S=1;S<8;S++)_=(this._h[S]+this._pad[S]|0)+(_>>>16)|0,this._h[S]=_&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,f=l.length,v;if(this._leftover){v=16-this._leftover,v>f&&(v=f);for(var E=0;E<v;E++)this._buffer[this._leftover+E]=l[h+E];if(f-=v,h+=v,this._leftover+=v,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(f>=16&&(v=f-f%16,this._blocks(l,h,v),h+=v,f-=v),f){for(var E=0;E<f;E++)this._buffer[this._leftover+E]=l[h+E];this._leftover+=f}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 f=h.digest();return h.clean(),f}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}(Ld),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ka,r=Ld,n=Jr,i=et,o=hi;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function h(f){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,f.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(f)}return h.prototype.seal=function(f,v,E,_){if(f.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var S=new Uint8Array(16);S.set(f,S.length-f.length);var P=new Uint8Array(32);e.stream(this._key,S,P,4);var j=v.length+this.tagLength,H;if(_){if(_.length!==j)throw new Error("ChaCha20Poly1305: incorrect destination length");H=_}else H=new Uint8Array(j);return e.streamXOR(this._key,S,v,H,4),this._authenticate(H.subarray(H.length-this.tagLength,H.length),P,H.subarray(0,H.length-this.tagLength),E),n.wipe(S),H},h.prototype.open=function(f,v,E,_){if(f.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(v.length<this.tagLength)return null;var S=new Uint8Array(16);S.set(f,S.length-f.length);var P=new Uint8Array(32);e.stream(this._key,S,P,4);var j=new Uint8Array(this.tagLength);if(this._authenticate(j,P,v.subarray(0,v.length-this.tagLength),E),!o.equal(j,v.subarray(v.length-this.tagLength,v.length)))return null;var H=v.length-this.tagLength,Z;if(_){if(_.length!==H)throw new Error("ChaCha20Poly1305: incorrect destination length");Z=_}else Z=new Uint8Array(H);return e.streamXOR(this._key,S,v.subarray(0,v.length-this.tagLength),Z,4),n.wipe(S),Z},h.prototype.clean=function(){return n.wipe(this._key),this},h.prototype._authenticate=function(f,v,E,_){var S=new r.Poly1305(v);_&&(S.update(_),_.length%16>0&&S.update(c.subarray(_.length%16))),S.update(E),E.length%16>0&&S.update(c.subarray(E.length%16));var P=new Uint8Array(8);_&&i.writeUint64LE(_.length,P),S.update(P),i.writeUint64LE(E.length,P),S.update(P);for(var j=S.digest(),H=0;H<j.length;H++)f[H]=j[H];S.clean(),n.wipe(j),n.wipe(P)},h}();t.ChaCha20Poly1305=l}(uu);var Ud={},Co={},mu={};Object.defineProperty(mu,"__esModule",{value:!0});function av(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}mu.isSerializableHash=av,Object.defineProperty(Co,"__esModule",{value:!0});var $n=mu,cv=hi,lv=Jr,jd=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),$n.isSerializableHash(this._inner)&&$n.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),lv.wipe(n)}return t.prototype.reset=function(){if(!$n.isSerializableHash(this._inner)||!$n.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(){$n.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),$n.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(!$n.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(!$n.isSerializableHash(this._inner)||!$n.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(!$n.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Co.HMAC=jd;function uv(t,e,r){var n=new jd(t,e);n.update(r);var i=n.digest();return n.clean(),i}Co.hmac=uv,Co.equal=cv.equal,Object.defineProperty(Ud,"__esModule",{value:!0});var Fd=Co,Bd=Jr,hv=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=Fd.hmac(this._hash,n,r);this._hmac=new Fd.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(),Bd.wipe(this._buffer),Bd.wipe(this._counter),this._bufpos=0},t}(),fv=Ud.HKDF=hv,Is={},Ya={},Ja={};Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.BrowserRandomSource=void 0;const kd=65536;class dv{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+=kd)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,kd)));return r}}Ja.BrowserRandomSource=dv;function pv(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 Qa={},gv={},mv=Object.freeze({__proto__:null,default:gv}),wv=ji(mv);Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.NodeRandomSource=void 0;const vv=Jr;class yv{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof pv<"u"){const e=wv;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,vv.wipe)(r),n}}Qa.NodeRandomSource=yv,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.SystemRandomSource=void 0;const bv=Ja,_v=Qa;class Ev{constructor(){if(this.isAvailable=!1,this.name="",this._source=new bv.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new _v.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)}}Ya.SystemRandomSource=Ev,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Ya,r=et,n=Jr;t.defaultRandomSource=new e.SystemRandomSource;function i(f,v=t.defaultRandomSource){return v.randomBytes(f)}t.randomBytes=i;function o(f=t.defaultRandomSource){const v=i(4,f),E=(0,r.readUint32LE)(v);return(0,n.wipe)(v),E}t.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(f,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 S=v.length,P=256-256%S;for(;f>0;){const j=i(Math.ceil(f*256/P),E);for(let H=0;H<j.length&&f>0;H++){const Z=j[H];Z<P&&(_+=v.charAt(Z%S),f--)}(0,n.wipe)(j)}return _}t.randomString=l;function h(f,v=c,E=t.defaultRandomSource){const _=Math.ceil(f/(Math.log(v.length)/Math.LN2));return l(_,v,E)}t.randomStringForEntropy=h}(Is);var Xa={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Jr;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,f){if(f===void 0&&(f=h.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var v=0;if(this._bytesHashed+=f,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&f>0;)this._buffer[this._bufferLength++]=h[v++],f--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(f>=this.blockSize&&(v=o(this._temp,this._state,h,v,f),f%=this.blockSize);f>0;)this._buffer[this._bufferLength++]=h[v++],f--;return this},l.prototype.finish=function(h){if(!this._finished){var f=this._bytesHashed,v=this._bufferLength,E=f/536870912|0,_=f<<3,S=f%64<56?64:128;this._buffer[v]=128;for(var P=v+1;P<S-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,S-8),e.writeUint32BE(_,this._buffer,S-4),o(this._temp,this._state,this._buffer,0,S),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,f,v,E){for(;E>=64;){for(var _=h[0],S=h[1],P=h[2],j=h[3],H=h[4],Z=h[5],N=h[6],L=h[7],$=0;$<16;$++){var T=v+$*4;l[$]=e.readUint32BE(f,T)}for(var $=16;$<64;$++){var I=l[$-2],d=(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[$]=(d+l[$-7]|0)+(x+l[$-16]|0)}for(var $=0;$<64;$++){var d=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&Z^~H&N)|0)+(L+(i[$]+l[$]|0)|0)|0,x=((_>>>2|_<<32-2)^(_>>>13|_<<32-13)^(_>>>22|_<<32-22))+(_&S^_&P^S&P)|0;L=N,N=Z,Z=H,H=j+d|0,j=P,P=S,S=_,_=d+x|0}h[0]+=_,h[1]+=S,h[2]+=P,h[3]+=j,h[4]+=H,h[5]+=Z,h[6]+=N,h[7]+=L,v+=64,E-=64}return v}function c(l){var h=new n;h.update(l);var f=h.digest();return h.clean(),f}t.hash=c})(Xa);var wu={};(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=Is,r=Jr;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 d=$[I]+T+65535;T=Math.floor(d/65536),$[I]=d-T*65536}$[0]+=T-1+37*(T-1)}function l($,T,I){const d=~(I-1);for(let x=0;x<16;x++){const J=d&($[x]^T[x]);$[x]^=J,T[x]^=J}}function h($,T){const I=n(),d=n();for(let x=0;x<16;x++)d[x]=T[x];c(d),c(d),c(d);for(let x=0;x<2;x++){I[0]=d[0]-65517;for(let W=1;W<15;W++)I[W]=d[W]-65535-(I[W-1]>>16&1),I[W-1]&=65535;I[15]=d[15]-32767-(I[14]>>16&1);const J=I[15]>>16&1;I[14]&=65535,l(d,I,1-J)}for(let x=0;x<16;x++)$[2*x]=d[x]&255,$[2*x+1]=d[x]>>8}function f($,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 d=0;d<16;d++)$[d]=T[d]+I[d]}function E($,T,I){for(let d=0;d<16;d++)$[d]=T[d]-I[d]}function _($,T,I){let d,x,J=0,W=0,ee=0,de=0,me=0,O=0,U=0,ce=0,le=0,re=0,ne=0,ae=0,ie=0,De=0,ge=0,Be=0,ye=0,Me=0,Q=0,Y=0,z=0,w=0,F=0,we=0,ve=0,Ue=0,nt=0,at=0,Ge=0,At=0,$t=0,Je=I[0],He=I[1],ke=I[2],Ke=I[3],rt=I[4],je=I[5],Ze=I[6],b=I[7],p=I[8],m=I[9],A=I[10],B=I[11],K=I[12],X=I[13],Ee=I[14],Re=I[15];d=T[0],J+=d*Je,W+=d*He,ee+=d*ke,de+=d*Ke,me+=d*rt,O+=d*je,U+=d*Ze,ce+=d*b,le+=d*p,re+=d*m,ne+=d*A,ae+=d*B,ie+=d*K,De+=d*X,ge+=d*Ee,Be+=d*Re,d=T[1],W+=d*Je,ee+=d*He,de+=d*ke,me+=d*Ke,O+=d*rt,U+=d*je,ce+=d*Ze,le+=d*b,re+=d*p,ne+=d*m,ae+=d*A,ie+=d*B,De+=d*K,ge+=d*X,Be+=d*Ee,ye+=d*Re,d=T[2],ee+=d*Je,de+=d*He,me+=d*ke,O+=d*Ke,U+=d*rt,ce+=d*je,le+=d*Ze,re+=d*b,ne+=d*p,ae+=d*m,ie+=d*A,De+=d*B,ge+=d*K,Be+=d*X,ye+=d*Ee,Me+=d*Re,d=T[3],de+=d*Je,me+=d*He,O+=d*ke,U+=d*Ke,ce+=d*rt,le+=d*je,re+=d*Ze,ne+=d*b,ae+=d*p,ie+=d*m,De+=d*A,ge+=d*B,Be+=d*K,ye+=d*X,Me+=d*Ee,Q+=d*Re,d=T[4],me+=d*Je,O+=d*He,U+=d*ke,ce+=d*Ke,le+=d*rt,re+=d*je,ne+=d*Ze,ae+=d*b,ie+=d*p,De+=d*m,ge+=d*A,Be+=d*B,ye+=d*K,Me+=d*X,Q+=d*Ee,Y+=d*Re,d=T[5],O+=d*Je,U+=d*He,ce+=d*ke,le+=d*Ke,re+=d*rt,ne+=d*je,ae+=d*Ze,ie+=d*b,De+=d*p,ge+=d*m,Be+=d*A,ye+=d*B,Me+=d*K,Q+=d*X,Y+=d*Ee,z+=d*Re,d=T[6],U+=d*Je,ce+=d*He,le+=d*ke,re+=d*Ke,ne+=d*rt,ae+=d*je,ie+=d*Ze,De+=d*b,ge+=d*p,Be+=d*m,ye+=d*A,Me+=d*B,Q+=d*K,Y+=d*X,z+=d*Ee,w+=d*Re,d=T[7],ce+=d*Je,le+=d*He,re+=d*ke,ne+=d*Ke,ae+=d*rt,ie+=d*je,De+=d*Ze,ge+=d*b,Be+=d*p,ye+=d*m,Me+=d*A,Q+=d*B,Y+=d*K,z+=d*X,w+=d*Ee,F+=d*Re,d=T[8],le+=d*Je,re+=d*He,ne+=d*ke,ae+=d*Ke,ie+=d*rt,De+=d*je,ge+=d*Ze,Be+=d*b,ye+=d*p,Me+=d*m,Q+=d*A,Y+=d*B,z+=d*K,w+=d*X,F+=d*Ee,we+=d*Re,d=T[9],re+=d*Je,ne+=d*He,ae+=d*ke,ie+=d*Ke,De+=d*rt,ge+=d*je,Be+=d*Ze,ye+=d*b,Me+=d*p,Q+=d*m,Y+=d*A,z+=d*B,w+=d*K,F+=d*X,we+=d*Ee,ve+=d*Re,d=T[10],ne+=d*Je,ae+=d*He,ie+=d*ke,De+=d*Ke,ge+=d*rt,Be+=d*je,ye+=d*Ze,Me+=d*b,Q+=d*p,Y+=d*m,z+=d*A,w+=d*B,F+=d*K,we+=d*X,ve+=d*Ee,Ue+=d*Re,d=T[11],ae+=d*Je,ie+=d*He,De+=d*ke,ge+=d*Ke,Be+=d*rt,ye+=d*je,Me+=d*Ze,Q+=d*b,Y+=d*p,z+=d*m,w+=d*A,F+=d*B,we+=d*K,ve+=d*X,Ue+=d*Ee,nt+=d*Re,d=T[12],ie+=d*Je,De+=d*He,ge+=d*ke,Be+=d*Ke,ye+=d*rt,Me+=d*je,Q+=d*Ze,Y+=d*b,z+=d*p,w+=d*m,F+=d*A,we+=d*B,ve+=d*K,Ue+=d*X,nt+=d*Ee,at+=d*Re,d=T[13],De+=d*Je,ge+=d*He,Be+=d*ke,ye+=d*Ke,Me+=d*rt,Q+=d*je,Y+=d*Ze,z+=d*b,w+=d*p,F+=d*m,we+=d*A,ve+=d*B,Ue+=d*K,nt+=d*X,at+=d*Ee,Ge+=d*Re,d=T[14],ge+=d*Je,Be+=d*He,ye+=d*ke,Me+=d*Ke,Q+=d*rt,Y+=d*je,z+=d*Ze,w+=d*b,F+=d*p,we+=d*m,ve+=d*A,Ue+=d*B,nt+=d*K,at+=d*X,Ge+=d*Ee,At+=d*Re,d=T[15],Be+=d*Je,ye+=d*He,Me+=d*ke,Q+=d*Ke,Y+=d*rt,z+=d*je,w+=d*Ze,F+=d*b,we+=d*p,ve+=d*m,Ue+=d*A,nt+=d*B,at+=d*K,Ge+=d*X,At+=d*Ee,$t+=d*Re,J+=38*ye,W+=38*Me,ee+=38*Q,de+=38*Y,me+=38*z,O+=38*w,U+=38*F,ce+=38*we,le+=38*ve,re+=38*Ue,ne+=38*nt,ae+=38*at,ie+=38*Ge,De+=38*At,ge+=38*$t,x=1,d=J+x+65535,x=Math.floor(d/65536),J=d-x*65536,d=W+x+65535,x=Math.floor(d/65536),W=d-x*65536,d=ee+x+65535,x=Math.floor(d/65536),ee=d-x*65536,d=de+x+65535,x=Math.floor(d/65536),de=d-x*65536,d=me+x+65535,x=Math.floor(d/65536),me=d-x*65536,d=O+x+65535,x=Math.floor(d/65536),O=d-x*65536,d=U+x+65535,x=Math.floor(d/65536),U=d-x*65536,d=ce+x+65535,x=Math.floor(d/65536),ce=d-x*65536,d=le+x+65535,x=Math.floor(d/65536),le=d-x*65536,d=re+x+65535,x=Math.floor(d/65536),re=d-x*65536,d=ne+x+65535,x=Math.floor(d/65536),ne=d-x*65536,d=ae+x+65535,x=Math.floor(d/65536),ae=d-x*65536,d=ie+x+65535,x=Math.floor(d/65536),ie=d-x*65536,d=De+x+65535,x=Math.floor(d/65536),De=d-x*65536,d=ge+x+65535,x=Math.floor(d/65536),ge=d-x*65536,d=Be+x+65535,x=Math.floor(d/65536),Be=d-x*65536,J+=x-1+37*(x-1),x=1,d=J+x+65535,x=Math.floor(d/65536),J=d-x*65536,d=W+x+65535,x=Math.floor(d/65536),W=d-x*65536,d=ee+x+65535,x=Math.floor(d/65536),ee=d-x*65536,d=de+x+65535,x=Math.floor(d/65536),de=d-x*65536,d=me+x+65535,x=Math.floor(d/65536),me=d-x*65536,d=O+x+65535,x=Math.floor(d/65536),O=d-x*65536,d=U+x+65535,x=Math.floor(d/65536),U=d-x*65536,d=ce+x+65535,x=Math.floor(d/65536),ce=d-x*65536,d=le+x+65535,x=Math.floor(d/65536),le=d-x*65536,d=re+x+65535,x=Math.floor(d/65536),re=d-x*65536,d=ne+x+65535,x=Math.floor(d/65536),ne=d-x*65536,d=ae+x+65535,x=Math.floor(d/65536),ae=d-x*65536,d=ie+x+65535,x=Math.floor(d/65536),ie=d-x*65536,d=De+x+65535,x=Math.floor(d/65536),De=d-x*65536,d=ge+x+65535,x=Math.floor(d/65536),ge=d-x*65536,d=Be+x+65535,x=Math.floor(d/65536),Be=d-x*65536,J+=x-1+37*(x-1),$[0]=J,$[1]=W,$[2]=ee,$[3]=de,$[4]=me,$[5]=O,$[6]=U,$[7]=ce,$[8]=le,$[9]=re,$[10]=ne,$[11]=ae,$[12]=ie,$[13]=De,$[14]=ge,$[15]=Be}function S($,T){_($,T,T)}function P($,T){const I=n();for(let d=0;d<16;d++)I[d]=T[d];for(let d=253;d>=0;d--)S(I,I),d!==2&&d!==4&&_(I,I,T);for(let d=0;d<16;d++)$[d]=I[d]}function j($,T){const I=new Uint8Array(32),d=new Float64Array(80),x=n(),J=n(),W=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,f(d,T);for(let le=0;le<16;le++)J[le]=d[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(W,ee,re),v(de,x,W),E(x,x,W),v(W,J,ee),E(J,J,ee),S(ee,de),S(me,x),_(x,W,x),_(W,J,de),v(de,x,W),E(x,x,W),S(J,x),E(W,ee,me),_(x,W,o),v(x,x,ee),_(W,W,x),_(x,ee,me),_(ee,J,d),S(J,de),l(x,J,re),l(W,ee,re)}for(let le=0;le<16;le++)d[le+16]=x[le],d[le+32]=W[le],d[le+48]=J[le],d[le+64]=ee[le];const O=d.subarray(32),U=d.subarray(16);P(O,O),_(U,U,O);const ce=new Uint8Array(32);return h(ce,U),ce}t.scalarMult=j;function H($){return j($,i)}t.scalarMultBase=H;function Z($){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=Z;function N($){const T=(0,e.randomBytes)(32,$),I=Z(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 d=j($,T);if(I){let x=0;for(let J=0;J<d.length;J++)x|=d[J];if(x===0)throw new Error("X25519: invalid shared key")}return d}t.sharedKey=L})(wu);function vu(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Hd(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?vu(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function yu(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=Hd(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return vu(r)}function xv(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),f=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 j=0,H=0,Z=0,N=P.length;Z!==N&&P[Z]===0;)Z++,j++;for(var L=(N-Z)*v+1>>>0,$=new Uint8Array(L);Z!==N;){for(var T=P[Z],I=0,d=L-1;(T!==0||I<H)&&d!==-1;d--,I++)T+=256*$[d]>>>0,$[d]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,Z++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(j);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 j=0;if(P[j]!==" "){for(var H=0,Z=0;P[j]===h;)H++,j++;for(var N=(P.length-j)*f+1>>>0,L=new Uint8Array(N);P[j];){var $=r[P.charCodeAt(j)];if($===255)return;for(var T=0,I=N-1;($!==0||T<Z)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");Z=T,j++}if(P[j]!==" "){for(var d=N-Z;d!==N&&L[d]===0;)d++;for(var x=new Uint8Array(H+(N-d)),J=H;d!==N;)x[J++]=L[d++];return x}}}function S(P){var j=_(P);if(j)return j;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:S}}var Cv=xv,Iv=Cv;const Wd=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")},Sv=t=>new TextEncoder().encode(t),Ov=t=>new TextDecoder().decode(t);class Dv{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 Av{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 zd(this,e)}}class $v{constructor(e){this.decoders=e}or(e){return zd(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 zd=(t,e)=>new $v({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Pv{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Dv(e,r,n),this.decoder=new Av(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ec=({name:t,prefix:e,encode:r,decode:n})=>new Pv(t,e,r,n),Io=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Iv(r,e);return ec({prefix:t,name:e,encode:n,decode:o=>Wd(i(o))})},Tv=(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,f=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[f++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},Rv=(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},br=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>ec({prefix:e,name:t,encode(i){return Rv(i,n,r)},decode(i){return Tv(i,n,r,t)}}),Nv=ec({prefix:"\0",name:"identity",encode:t=>Ov(t),decode:t=>Sv(t)});var Lv=Object.freeze({__proto__:null,identity:Nv});const Mv=br({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Uv=Object.freeze({__proto__:null,base2:Mv});const jv=br({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Fv=Object.freeze({__proto__:null,base8:jv});const Bv=Io({prefix:"9",name:"base10",alphabet:"0123456789"});var kv=Object.freeze({__proto__:null,base10:Bv});const Hv=br({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Wv=br({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var zv=Object.freeze({__proto__:null,base16:Hv,base16upper:Wv});const qv=br({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vv=br({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Kv=br({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Gv=br({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Zv=br({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yv=br({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Jv=br({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Qv=br({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Xv=br({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ey=Object.freeze({__proto__:null,base32:qv,base32upper:Vv,base32pad:Kv,base32padupper:Gv,base32hex:Zv,base32hexupper:Yv,base32hexpad:Jv,base32hexpadupper:Qv,base32z:Xv});const ty=Io({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ry=Io({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ny=Object.freeze({__proto__:null,base36:ty,base36upper:ry});const iy=Io({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),sy=Io({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var oy=Object.freeze({__proto__:null,base58btc:iy,base58flickr:sy});const ay=br({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),cy=br({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ly=br({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),uy=br({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var hy=Object.freeze({__proto__:null,base64:ay,base64pad:cy,base64url:ly,base64urlpad:uy});const qd=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}"),fy=qd.reduce((t,e,r)=>(t[r]=e,t),[]),dy=qd.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function py(t){return t.reduce((e,r)=>(e+=fy[r],e),"")}function gy(t){const e=[];for(const r of t){const n=dy[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const my=ec({prefix:"\u{1F680}",name:"base256emoji",encode:py,decode:gy});var wy=Object.freeze({__proto__:null,base256emoji:my}),vy=Kd,Vd=128,yy=127,by=~yy,_y=Math.pow(2,31);function Kd(t,e,r){e=e||[],r=r||0;for(var n=r;t>=_y;)e[r++]=t&255|Vd,t/=128;for(;t&by;)e[r++]=t&255|Vd,t>>>=7;return e[r]=t|0,Kd.bytes=r-n+1,e}var Ey=bu,xy=128,Gd=127;function bu(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw bu.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Gd)<<i:(c&Gd)*Math.pow(2,i),i+=7}while(c>=xy);return bu.bytes=o-n,r}var Cy=Math.pow(2,7),Iy=Math.pow(2,14),Sy=Math.pow(2,21),Oy=Math.pow(2,28),Dy=Math.pow(2,35),Ay=Math.pow(2,42),$y=Math.pow(2,49),Py=Math.pow(2,56),Ty=Math.pow(2,63),Ry=function(t){return t<Cy?1:t<Iy?2:t<Sy?3:t<Oy?4:t<Dy?5:t<Ay?6:t<$y?7:t<Py?8:t<Ty?9:10},Ny={encode:vy,decode:Ey,encodingLength:Ry},Zd=Ny;const Yd=(t,e,r=0)=>(Zd.encode(t,e,r),e),Jd=t=>Zd.encodingLength(t),_u=(t,e)=>{const r=e.byteLength,n=Jd(t),i=n+Jd(r),o=new Uint8Array(i+r);return Yd(t,o,0),Yd(r,o,n),o.set(e,i),new Ly(t,r,e,o)};class Ly{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Qd=({name:t,code:e,encode:r})=>new My(t,e,r);class My{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?_u(this.code,r):r.then(n=>_u(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Xd=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Uy=Qd({name:"sha2-256",code:18,encode:Xd("SHA-256")}),jy=Qd({name:"sha2-512",code:19,encode:Xd("SHA-512")});var Fy=Object.freeze({__proto__:null,sha256:Uy,sha512:jy});const e1=0,By="identity",t1=Wd;var ky=Object.freeze({__proto__:null,identity:{code:e1,name:By,encode:t1,digest:t=>_u(e1,t1(t))}});new TextEncoder,new TextDecoder;const r1={...Lv,...Uv,...Fv,...kv,...zv,...ey,...ny,...oy,...hy,...wy};({...Fy,...ky});function n1(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const i1=n1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Eu=n1("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=Hd(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),s1={utf8:i1,"utf-8":i1,hex:r1.base16,latin1:Eu,ascii:Eu,binary:Eu,...r1};function Hr(t,e="utf8"){const r=s1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?vu(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Ar(t,e="utf8"){const r=s1[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 o1=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))},Hy=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),Wy=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),zy=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}(),qy=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Vy=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Ky=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Gy=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,a1=3,Zy=[["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",Ky]],c1=[["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 Yy(t){return t?l1(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Vy:typeof navigator<"u"?l1(navigator.userAgent):Xy()}function Jy(t){return t!==""&&Zy.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 l1(t){var e=Jy(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new qy;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<a1&&(i=o1(o1([],i,!0),e5(a1-i.length),!0)):i=[];var o=i.join("."),c=Qy(t),l=Gy.exec(t);return l&&l[1]?new zy(r,o,c,l[1]):new Hy(r,o,c)}function Qy(t){for(var e=0,r=c1.length;e<r;e++){var n=c1[e],i=n[0],o=n[1],c=o.exec(t);if(c)return i}return null}function Xy(){var t=typeof process<"u"&&process.version;return t?new Wy(process.version.slice(1)):null}function e5(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Te={};/*! *****************************************************************************
|
|
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 _u=function(t,e){return _u=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])},_u(t,e)};function e5(t,e){_u(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Eu=function(){return Eu=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},Eu.apply(this,arguments)};function t5(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 r5(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 n5(t,e){return function(r,n){e(r,n,t)}}function i5(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function s5(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{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function o5(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(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function a5(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function c5(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 l1(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 l5(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l1(arguments[e]));return t}function u5(){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 Co(t){return this instanceof Co?(this.v=t,this):new Co(t)}function h5(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(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Co?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function f5(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:Co(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function d5(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(f){o({value:f,done:l})},c)}}function p5(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function g5(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 m5(t){return t&&t.__esModule?t:{default:t}}function w5(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function v5(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 y5=Object.freeze({__proto__:null,__extends:e5,get __assign(){return Eu},__rest:t5,__decorate:r5,__param:n5,__metadata:i5,__awaiter:s5,__generator:o5,__createBinding:a5,__exportStar:c5,__values:xu,__read:l1,__spread:l5,__spreadArrays:u5,__await:Co,__asyncGenerator:h5,__asyncDelegator:f5,__asyncValues:d5,__makeTemplateObject:p5,__importStar:g5,__importDefault:m5,__classPrivateFieldGet:w5,__classPrivateFieldSet:v5}),Xa=Fi(y5),Cu={},Io={},u1;function b5(){if(u1)return Io;u1=1,Object.defineProperty(Io,"__esModule",{value:!0}),Io.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Io.delay=t,Io}var Bi={},Iu={},ki={},h1;function _5(){return h1||(h1=1,Object.defineProperty(ki,"__esModule",{value:!0}),ki.ONE_THOUSAND=ki.ONE_HUNDRED=void 0,ki.ONE_HUNDRED=100,ki.ONE_THOUSAND=1e3),ki}var Su={},f1;function E5(){return f1||(f1=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}(Su)),Su}var d1;function p1(){return d1||(d1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xa;e.__exportStar(_5(),t),e.__exportStar(E5(),t)}(Iu)),Iu}var g1;function x5(){if(g1)return Bi;g1=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.fromMiliseconds=Bi.toMiliseconds=void 0;const t=p1();function e(n){return n*t.ONE_THOUSAND}Bi.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Bi.fromMiliseconds=r,Bi}var m1;function C5(){return m1||(m1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xa;e.__exportStar(b5(),t),e.__exportStar(x5(),t)}(Cu)),Cu}var Ss={},w1;function I5(){if(w1)return Ss;w1=1,Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.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 Ss.Watch=t,Ss.default=t,Ss}var Ou={},So={},v1;function S5(){if(v1)return So;v1=1,Object.defineProperty(So,"__esModule",{value:!0}),So.IWatch=void 0;class t{}return So.IWatch=t,So}var y1;function O5(){return y1||(y1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Xa.__exportStar(S5(),t)}(Ou)),Ou}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xa;e.__exportStar(C5(),t),e.__exportStar(I5(),t),e.__exportStar(O5(),t),e.__exportStar(p1(),t)})(Te);var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.getLocalStorage=Dt.getLocalStorageOrThrow=Dt.getCrypto=Dt.getCryptoOrThrow=_1=Dt.getLocation=Dt.getLocationOrThrow=Du=Dt.getNavigator=Dt.getNavigatorOrThrow=b1=Dt.getDocument=Dt.getDocumentOrThrow=Dt.getFromWindowOrThrow=Dt.getFromWindow=void 0;function Hi(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Dt.getFromWindow=Hi;function Os(t){const e=Hi(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Dt.getFromWindowOrThrow=Os;function D5(){return Os("document")}Dt.getDocumentOrThrow=D5;function A5(){return Hi("document")}var b1=Dt.getDocument=A5;function $5(){return Os("navigator")}Dt.getNavigatorOrThrow=$5;function P5(){return Hi("navigator")}var Du=Dt.getNavigator=P5;function T5(){return Os("location")}Dt.getLocationOrThrow=T5;function R5(){return Hi("location")}var _1=Dt.getLocation=R5;function N5(){return Os("crypto")}Dt.getCryptoOrThrow=N5;function L5(){return Hi("crypto")}Dt.getCrypto=L5;function M5(){return Os("localStorage")}Dt.getLocalStorageOrThrow=M5;function U5(){return Hi("localStorage")}Dt.getLocalStorage=U5;var Au={};Object.defineProperty(Au,"__esModule",{value:!0});var E1=Au.getWindowMetadata=void 0;const x1=Dt;function j5(){let t,e;try{t=x1.getDocumentOrThrow(),e=x1.getLocationOrThrow()}catch{return null}function r(){const E=t.getElementsByTagName("link"),_=[];for(let S=0;S<E.length;S++){const P=E[S],j=P.getAttribute("rel");if(j&&j.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 Z=e.protocol+"//"+e.host;if(H.indexOf("/")===0)Z+=H;else{const N=e.pathname.split("/");N.pop();const L=N.join("/");Z+=L+"/"+H}_.push(Z)}else if(H.indexOf("//")===0){const Z=e.protocol+H;_.push(Z)}else _.push(H)}}return _}function n(...E){const _=t.getElementsByTagName("meta");for(let S=0;S<_.length;S++){const P=_[S],j=["itemprop","property","name"].map(H=>P.getAttribute(H)).filter(H=>H?E.includes(H):!1);if(j.length&&j){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,f=r();return{description:l,url:h,icons:f,name:c}}E1=Au.getWindowMetadata=j5;var Oo={},F5=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),C1="%[a-f0-9]{2}",I1=new RegExp("("+C1+")|([^%]+?)","gi"),S1=new RegExp("("+C1+")+","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 B5(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(I1)||[],r=1;r<e.length;r++)t=$u(e,r).join(""),e=t.match(I1)||[];return t}}function k5(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=S1.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=B5(r[0]);n!==r[0]&&(e[r[0]]=n)}r=S1.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 H5=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 k5(t)}},W5=(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)]},z5=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=F5,r=H5,n=W5,i=z5,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 d=typeof T=="string"&&T.includes(N.arrayFormatSeparator),x=typeof T=="string"&&!d&&E(T,N).includes(N.arrayFormatSeparator);T=x?E(T,N):T;const J=d||x?T.split(N.arrayFormatSeparator).map(W=>E(W,N)):T===null?T:E(T,N);I[$]=J};case"bracket-separator":return($,T,I)=>{const d=/(\[\])$/.test($);if($=$.replace(/\[\]$/,""),!d){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 f(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 S(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 j(N){N=S(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 Z(N,L){L=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},L),f(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[d,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(d,L),x,T)}for(const I of Object.keys(T)){const d=T[I];if(typeof d=="object"&&d!==null)for(const x of Object.keys(d))d[x]=H(d[x],L);else T[I]=H(d,L)}return L.sort===!1?T:(L.sort===!0?Object.keys(T).sort():Object.keys(T).sort(L.sort)).reduce((I,d)=>{const x=T[d];return x&&typeof x=="object"&&!Array.isArray(x)?I[d]=_(x):I[d]=x,I},Object.create(null))}t.extract=j,t.parse=Z,t.stringify=(N,L)=>{if(!N)return"";L=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},L),f(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 d=Object.keys(I);return L.sort!==!1&&d.sort(L.sort),d.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:Z(j(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 $=S(N.url).split("?")[0]||"",T=t.extract(N.url),I=t.parse(T,{sort:!1}),d=Object.assign(I,N.query);let x=t.stringify(d,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:d}=t.parseUrl(N,$);return t.stringifyUrl({url:T,query:i(I,L),fragmentIdentifier:d},$)},t.exclude=(N,L,$)=>{const T=Array.isArray(L)?I=>!L.includes(I):(I,d)=>!L(I,d);return t.pick(N,T,$)}})(Oo);const q5={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 V5(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 O1(t,e){return t.includes(":")?[t]:e.chains||[]}const D1="base10",$r="base16",Pu="base64pad",Tu="utf8",A1=0,Wi=1,K5=0,$1=1,Ru=12,Nu=32;function G5(){const t=gu.generateKeyPair();return{privateKey:Ar(t.secretKey,$r),publicKey:Ar(t.publicKey,$r)}}function Lu(){const t=Is.randomBytes(Nu);return Ar(t,$r)}function Z5(t,e){const r=gu.sharedKey(Hr(t,$r),Hr(e,$r)),n=new hv(Ja.SHA256,r).expand(Nu);return Ar(n,$r)}function Y5(t){const e=Ja.hash(Hr(t,$r));return Ar(e,$r)}function Ds(t){const e=Ja.hash(Hr(t,Tu));return Ar(e,$r)}function J5(t){return Hr(`${t}`,D1)}function Do(t){return Number(Ar(t,D1))}function Q5(t){const e=J5(typeof t.type<"u"?t.type:A1);if(Do(e)===Wi&&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):Is.randomBytes(Ru),i=new cu.ChaCha20Poly1305(Hr(t.symKey,$r)).seal(n,Hr(t.message,Tu));return eb({type:e,sealed:i,iv:n,senderPublicKey:r})}function X5(t){const e=new cu.ChaCha20Poly1305(Hr(t.symKey,$r)),{sealed:r,iv:n}=ec(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Ar(i,Tu)}function eb(t){if(Do(t.type)===Wi){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Ar(wu([t.type,t.senderPublicKey,t.iv,t.sealed]),Pu)}return Ar(wu([t.type,t.iv,t.sealed]),Pu)}function ec(t){const e=Hr(t,Pu),r=e.slice(K5,$1),n=$1;if(Do(r)===Wi){const l=n+Nu,h=l+Ru,f=e.slice(n,l),v=e.slice(l,h),E=e.slice(h);return{type:r,sealed:E,iv:v,senderPublicKey:f}}const i=n+Ru,o=e.slice(n,i),c=e.slice(i);return{type:r,sealed:c,iv:o}}function tb(t,e){const r=ec(t);return P1({type:Do(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Ar(r.senderPublicKey,$r):void 0,receiverPublicKey:e?.receiverPublicKey})}function P1(t){const e=t?.type||A1;if(e===Wi){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 T1(t){return t.type===Wi&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var rb=Object.defineProperty,R1=Object.getOwnPropertySymbols,nb=Object.prototype.hasOwnProperty,ib=Object.prototype.propertyIsEnumerable,N1=(t,e,r)=>e in t?rb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L1=(t,e)=>{for(var r in e||(e={}))nb.call(e,r)&&N1(t,r,e[r]);if(R1)for(var r of R1(e))ib.call(e,r)&&N1(t,r,e[r]);return t};const sb="ReactNative",Qr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},ob="js";function Mu(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function tc(){return!b1()&&!!Du()&&navigator.product===sb}function Ao(){return!Mu()&&!!Du()}function $o(){return tc()?Qr.reactNative:Mu()?Qr.node:Ao()?Qr.browser:Qr.unknown}function ab(t,e){let r=Oo.parse(t);return r=L1(L1({},r),e),t=Oo.stringify(r),t}function cb(){return E1()||{name:"",description:"",url:"",icons:[""]}}function lb(){if($o()===Qr.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=Zy();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 ub(){var t;const e=$o();return e===Qr.browser?[e,((t=_1())==null?void 0:t.host)||"unknown"].join(":"):e}function hb(t,e,r){const n=lb(),i=ub();return[[t,e].join("-"),[ob,r].join("-"),n,i].join("/")}function fb({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c}){const l=r.split("?"),h=hb(t,e,n),f={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0},v=ab(l[1]||"",f);return l[0]+"?"+v}function zi(t,e){return t.filter(r=>e.includes(r)).length===t.length}function M1(t){return Object.fromEntries(t.entries())}function U1(t){return new Map(Object.entries(t))}function As(t=Te.FIVE_MINUTES,e){const r=Te.toMiliseconds(t||Te.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 Po(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 j1(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 db(t){return j1("topic",t)}function pb(t){return j1("id",t)}function F1(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 xn(t,e){return Te.fromMiliseconds((e||Date.now())+Te.toMiliseconds(t))}function di(t){return Date.now()>=Te.toMiliseconds(t)}function tr(t,e){return`${t}${e?`:${e}`:""}`}function Uu(t=[],e=[]){return[...new Set([...t,...e])]}async function gb({id:t,topic:e,wcDeepLink:r}){try{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}&sessionTopic=${e}`,c=$o();c===Qr.browser?o.startsWith("https://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):c===Qr.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(n){console.error(n)}}const mb="irn";function ju(t){return t?.relay||{protocol:mb}}function rc(t){const e=q5[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var wb=Object.defineProperty,B1=Object.getOwnPropertySymbols,vb=Object.prototype.hasOwnProperty,yb=Object.prototype.propertyIsEnumerable,k1=(t,e,r)=>e in t?wb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bb=(t,e)=>{for(var r in e||(e={}))vb.call(e,r)&&k1(t,r,e[r]);if(B1)for(var r of B1(e))yb.call(e,r)&&k1(t,r,e[r]);return t};function _b(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 Eb(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=Oo.parse(o);return{protocol:n,topic:xb(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:_b(c)}}function xb(t){return t.startsWith("//")?t.substring(2):t}function Cb(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 Ib(t){return`${t.protocol}:${t.topic}@${t.version}?`+Oo.stringify(bb({symKey:t.symKey},Cb(t.relay)))}function $s(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Sb(t){const e=[];return Object.values(t).forEach(r=>{e.push(...$s(r.accounts))}),e}function Ob(t,e){const r=[];return Object.values(t).forEach(n=>{$s(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Db(t,e){const r=[];return Object.values(t).forEach(n=>{$s(n.accounts).includes(e)&&r.push(...n.events)}),r}function Ab(t,e){const r=ic(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 Fu(t){return t.includes(":")}function To(t){return Fu(t)?t.split(":")[0]:t}const $b={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}},Pb={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}=Pb[t];return{message:e?`${r} ${e}`:r,code:n}}function Zt(t,e){const{message:r,code:n}=$b[t];return{message:e?`${r} ${e}`:r,code:n}}function Tn(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Ps(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Pr(t){return typeof t>"u"}function pr(t,e){return e&&Pr(t)?!0:typeof t=="string"&&!!t.trim().length}function Bu(t,e){return e&&Pr(t)?!0:typeof t=="number"&&!isNaN(t)}function Tb(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return zi(i,n)?(n.forEach(c=>{const{accounts:l,methods:h,events:f}=t.namespaces[c],v=$s(l),E=r[c];(!zi(O1(c,E),v)||!zi(E.methods,h)||!zi(E.events,f))&&(o=!1)}),o):!1}function nc(t){return pr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Rb(t){if(pr(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&nc(r)}}return!1}function Nb(t){if(pr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Lb(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Mb(t){return t?.topic}function Ub(t,e){let r=null;return pr(t?.publicKey,!1)||(r=_e("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function H1(t){let e=!0;return Tn(t)?t.length&&(e=t.every(r=>pr(r,!1))):e=!1,e}function jb(t,e,r){let n=null;return Tn(e)&&e.length?e.forEach(i=>{n||nc(i)||(n=Zt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):nc(t)||(n=Zt("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function Fb(t,e,r){let n=null;return Object.entries(t).forEach(([i,o])=>{if(n)return;const c=jb(i,O1(i,o),`${e} ${r}`);c&&(n=c)}),n}function Bb(t,e){let r=null;return Tn(t)?t.forEach(n=>{r||Rb(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 kb(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Bb(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function Hb(t,e){let r=null;return H1(t?.methods)?H1(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 W1(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Hb(n,`${e}, namespace`);i&&(r=i)}),r}function Wb(t,e,r){let n=null;if(t&&Ps(t)){const i=W1(t,e);i&&(n=i);const o=Fb(t,e,r);o&&(n=o)}else n=_e("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function ic(t,e){let r=null;if(t&&Ps(t)){const n=W1(t,e);n&&(r=n);const i=kb(t,e);i&&(r=i)}else r=_e("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function z1(t){return pr(t.protocol,!0)}function zb(t,e){let r=!1;return e&&!t?r=!0:t&&Tn(t)&&t.length&&t.forEach(n=>{r=z1(n)}),r}function qb(t){return typeof t=="number"}function Wr(t){return typeof t<"u"&&typeof t!==null}function Vb(t){return!(!t||typeof t!="object"||!t.code||!Bu(t.code,!1)||!t.message||!pr(t.message,!1))}function Kb(t){return!(Pr(t)||!pr(t.method,!1))}function Gb(t){return!(Pr(t)||Pr(t.result)&&Pr(t.error)||!Bu(t.id,!1)||!pr(t.jsonrpc,!1))}function Zb(t){return!(Pr(t)||!pr(t.name,!1))}function q1(t,e){return!(!nc(e)||!Sb(t).includes(e))}function Yb(t,e,r){return pr(r,!1)?Ob(t,e).includes(r):!1}function Jb(t,e,r){return pr(r,!1)?Db(t,e).includes(r):!1}function V1(t,e,r){let n=null;const i=Qb(t),o=Xb(e),c=Object.keys(i),l=Object.keys(o),h=K1(Object.keys(t)),f=K1(Object.keys(e)),v=h.filter(E=>!f.includes(E));return v.length&&(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
14
|
+
***************************************************************************** */var xu=function(t,e){return xu=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])},xu(t,e)};function t5(t,e){xu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Cu=function(){return Cu=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},Cu.apply(this,arguments)};function r5(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 n5(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 i5(t,e){return function(r,n){e(r,n,t)}}function s5(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function o5(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{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function a5(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(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function c5(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function l5(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Iu(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 u1(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 u5(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u1(arguments[e]));return t}function h5(){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 So(t){return this instanceof So?(this.v=t,this):new So(t)}function f5(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(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof So?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function d5(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:So(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function p5(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 Iu=="function"?Iu(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(f){o({value:f,done:l})},c)}}function g5(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function m5(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 w5(t){return t&&t.__esModule?t:{default:t}}function v5(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function y5(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 b5=Object.freeze({__proto__:null,__extends:t5,get __assign(){return Cu},__rest:r5,__decorate:n5,__param:i5,__metadata:s5,__awaiter:o5,__generator:a5,__createBinding:c5,__exportStar:l5,__values:Iu,__read:u1,__spread:u5,__spreadArrays:h5,__await:So,__asyncGenerator:f5,__asyncDelegator:d5,__asyncValues:p5,__makeTemplateObject:g5,__importStar:m5,__importDefault:w5,__classPrivateFieldGet:v5,__classPrivateFieldSet:y5}),tc=ji(b5),Su={},Oo={},h1;function _5(){if(h1)return Oo;h1=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Oo.delay=t,Oo}var Fi={},Ou={},Bi={},f1;function E5(){return f1||(f1=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.ONE_THOUSAND=Bi.ONE_HUNDRED=void 0,Bi.ONE_HUNDRED=100,Bi.ONE_THOUSAND=1e3),Bi}var Du={},d1;function x5(){return d1||(d1=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}(Du)),Du}var p1;function g1(){return p1||(p1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=tc;e.__exportStar(E5(),t),e.__exportStar(x5(),t)}(Ou)),Ou}var m1;function C5(){if(m1)return Fi;m1=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.fromMiliseconds=Fi.toMiliseconds=void 0;const t=g1();function e(n){return n*t.ONE_THOUSAND}Fi.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Fi.fromMiliseconds=r,Fi}var w1;function I5(){return w1||(w1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=tc;e.__exportStar(_5(),t),e.__exportStar(C5(),t)}(Su)),Su}var Ss={},v1;function S5(){if(v1)return Ss;v1=1,Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.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 Ss.Watch=t,Ss.default=t,Ss}var Au={},Do={},y1;function O5(){if(y1)return Do;y1=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.IWatch=void 0;class t{}return Do.IWatch=t,Do}var b1;function D5(){return b1||(b1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),tc.__exportStar(O5(),t)}(Au)),Au}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=tc;e.__exportStar(I5(),t),e.__exportStar(S5(),t),e.__exportStar(D5(),t),e.__exportStar(g1(),t)})(Te);var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.getLocalStorage=Dt.getLocalStorageOrThrow=Dt.getCrypto=Dt.getCryptoOrThrow=E1=Dt.getLocation=Dt.getLocationOrThrow=$u=Dt.getNavigator=Dt.getNavigatorOrThrow=_1=Dt.getDocument=Dt.getDocumentOrThrow=Dt.getFromWindowOrThrow=Dt.getFromWindow=void 0;function ki(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Dt.getFromWindow=ki;function Os(t){const e=ki(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Dt.getFromWindowOrThrow=Os;function A5(){return Os("document")}Dt.getDocumentOrThrow=A5;function $5(){return ki("document")}var _1=Dt.getDocument=$5;function P5(){return Os("navigator")}Dt.getNavigatorOrThrow=P5;function T5(){return ki("navigator")}var $u=Dt.getNavigator=T5;function R5(){return Os("location")}Dt.getLocationOrThrow=R5;function N5(){return ki("location")}var E1=Dt.getLocation=N5;function L5(){return Os("crypto")}Dt.getCryptoOrThrow=L5;function M5(){return ki("crypto")}Dt.getCrypto=M5;function U5(){return Os("localStorage")}Dt.getLocalStorageOrThrow=U5;function j5(){return ki("localStorage")}Dt.getLocalStorage=j5;var Pu={};Object.defineProperty(Pu,"__esModule",{value:!0});var x1=Pu.getWindowMetadata=void 0;const C1=Dt;function F5(){let t,e;try{t=C1.getDocumentOrThrow(),e=C1.getLocationOrThrow()}catch{return null}function r(){const E=t.getElementsByTagName("link"),_=[];for(let S=0;S<E.length;S++){const P=E[S],j=P.getAttribute("rel");if(j&&j.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 Z=e.protocol+"//"+e.host;if(H.indexOf("/")===0)Z+=H;else{const N=e.pathname.split("/");N.pop();const L=N.join("/");Z+=L+"/"+H}_.push(Z)}else if(H.indexOf("//")===0){const Z=e.protocol+H;_.push(Z)}else _.push(H)}}return _}function n(...E){const _=t.getElementsByTagName("meta");for(let S=0;S<_.length;S++){const P=_[S],j=["itemprop","property","name"].map(H=>P.getAttribute(H)).filter(H=>H?E.includes(H):!1);if(j.length&&j){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,f=r();return{description:l,url:h,icons:f,name:c}}x1=Pu.getWindowMetadata=F5;var Ao={},B5=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),I1="%[a-f0-9]{2}",S1=new RegExp("("+I1+")|([^%]+?)","gi"),O1=new RegExp("("+I1+")+","gi");function Tu(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([],Tu(r),Tu(n))}function k5(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(S1)||[],r=1;r<e.length;r++)t=Tu(e,r).join(""),e=t.match(S1)||[];return t}}function H5(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=O1.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=k5(r[0]);n!==r[0]&&(e[r[0]]=n)}r=O1.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 W5=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 H5(t)}},z5=(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)]},q5=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=B5,r=W5,n=z5,i=q5,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 d=typeof T=="string"&&T.includes(N.arrayFormatSeparator),x=typeof T=="string"&&!d&&E(T,N).includes(N.arrayFormatSeparator);T=x?E(T,N):T;const J=d||x?T.split(N.arrayFormatSeparator).map(W=>E(W,N)):T===null?T:E(T,N);I[$]=J};case"bracket-separator":return($,T,I)=>{const d=/(\[\])$/.test($);if($=$.replace(/\[\]$/,""),!d){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 f(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 S(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 j(N){N=S(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 Z(N,L){L=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},L),f(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[d,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(d,L),x,T)}for(const I of Object.keys(T)){const d=T[I];if(typeof d=="object"&&d!==null)for(const x of Object.keys(d))d[x]=H(d[x],L);else T[I]=H(d,L)}return L.sort===!1?T:(L.sort===!0?Object.keys(T).sort():Object.keys(T).sort(L.sort)).reduce((I,d)=>{const x=T[d];return x&&typeof x=="object"&&!Array.isArray(x)?I[d]=_(x):I[d]=x,I},Object.create(null))}t.extract=j,t.parse=Z,t.stringify=(N,L)=>{if(!N)return"";L=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},L),f(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 d=Object.keys(I);return L.sort!==!1&&d.sort(L.sort),d.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:Z(j(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 $=S(N.url).split("?")[0]||"",T=t.extract(N.url),I=t.parse(T,{sort:!1}),d=Object.assign(I,N.query);let x=t.stringify(d,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:d}=t.parseUrl(N,$);return t.stringifyUrl({url:T,query:i(I,L),fragmentIdentifier:d},$)},t.exclude=(N,L,$)=>{const T=Array.isArray(L)?I=>!L.includes(I):(I,d)=>!L(I,d);return t.pick(N,T,$)}})(Ao);const V5={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"}},K5=":";function G5(t){const[e,r]=t.split(K5);return{namespace:e,reference:r}}function Z5(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 D1(t,e){return t.includes(":")?[t]:e.chains||[]}const A1="base10",$r="base16",Ru="base64pad",Nu="utf8",$1=0,Hi=1,Y5=0,P1=1,Lu=12,Mu=32;function J5(){const t=wu.generateKeyPair();return{privateKey:Ar(t.secretKey,$r),publicKey:Ar(t.publicKey,$r)}}function Uu(){const t=Is.randomBytes(Mu);return Ar(t,$r)}function Q5(t,e){const r=wu.sharedKey(Hr(t,$r),Hr(e,$r),!0),n=new fv(Xa.SHA256,r).expand(Mu);return Ar(n,$r)}function X5(t){const e=Xa.hash(Hr(t,$r));return Ar(e,$r)}function Ds(t){const e=Xa.hash(Hr(t,Nu));return Ar(e,$r)}function eb(t){return Hr(`${t}`,A1)}function $o(t){return Number(Ar(t,A1))}function tb(t){const e=eb(typeof t.type<"u"?t.type:$1);if($o(e)===Hi&&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):Is.randomBytes(Lu),i=new uu.ChaCha20Poly1305(Hr(t.symKey,$r)).seal(n,Hr(t.message,Nu));return nb({type:e,sealed:i,iv:n,senderPublicKey:r})}function rb(t){const e=new uu.ChaCha20Poly1305(Hr(t.symKey,$r)),{sealed:r,iv:n}=rc(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Ar(i,Nu)}function nb(t){if($o(t.type)===Hi){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Ar(yu([t.type,t.senderPublicKey,t.iv,t.sealed]),Ru)}return Ar(yu([t.type,t.iv,t.sealed]),Ru)}function rc(t){const e=Hr(t,Ru),r=e.slice(Y5,P1),n=P1;if($o(r)===Hi){const l=n+Mu,h=l+Lu,f=e.slice(n,l),v=e.slice(l,h),E=e.slice(h);return{type:r,sealed:E,iv:v,senderPublicKey:f}}const i=n+Lu,o=e.slice(n,i),c=e.slice(i);return{type:r,sealed:c,iv:o}}function ib(t,e){const r=rc(t);return T1({type:$o(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Ar(r.senderPublicKey,$r):void 0,receiverPublicKey:e?.receiverPublicKey})}function T1(t){const e=t?.type||$1;if(e===Hi){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 R1(t){return t.type===Hi&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var sb=Object.defineProperty,N1=Object.getOwnPropertySymbols,ob=Object.prototype.hasOwnProperty,ab=Object.prototype.propertyIsEnumerable,L1=(t,e,r)=>e in t?sb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M1=(t,e)=>{for(var r in e||(e={}))ob.call(e,r)&&L1(t,r,e[r]);if(N1)for(var r of N1(e))ab.call(e,r)&&L1(t,r,e[r]);return t};const cb="ReactNative",Qr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},lb="js";function ju(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function nc(){return!_1()&&!!$u()&&navigator.product===cb}function Po(){return!ju()&&!!$u()}function To(){return nc()?Qr.reactNative:ju()?Qr.node:Po()?Qr.browser:Qr.unknown}function ub(t,e){let r=Ao.parse(t);return r=M1(M1({},r),e),t=Ao.stringify(r),t}function hb(){return x1()||{name:"",description:"",url:"",icons:[""]}}function fb(){if(To()===Qr.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=Yy();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 db(){var t;const e=To();return e===Qr.browser?[e,((t=E1())==null?void 0:t.host)||"unknown"].join(":"):e}function pb(t,e,r){const n=fb(),i=db();return[[t,e].join("-"),[lb,r].join("-"),n,i].join("/")}function gb({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c}){const l=r.split("?"),h=pb(t,e,n),f={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0},v=ub(l[1]||"",f);return l[0]+"?"+v}function Wi(t,e){return t.filter(r=>e.includes(r)).length===t.length}function U1(t){return Object.fromEntries(t.entries())}function j1(t){return new Map(Object.entries(t))}function As(t=Te.FIVE_MINUTES,e){const r=Te.toMiliseconds(t||Te.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 Ro(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 F1(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 mb(t){return F1("topic",t)}function wb(t){return F1("id",t)}function B1(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 En(t,e){return Te.fromMiliseconds((e||Date.now())+Te.toMiliseconds(t))}function fi(t){return Date.now()>=Te.toMiliseconds(t)}function tr(t,e){return`${t}${e?`:${e}`:""}`}function Fu(t=[],e=[]){return[...new Set([...t,...e])]}async function vb({id:t,topic:e,wcDeepLink:r}){try{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}&sessionTopic=${e}`,c=To();c===Qr.browser?o.startsWith("https://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):c===Qr.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(n){console.error(n)}}const yb="irn";function Bu(t){return t?.relay||{protocol:yb}}function ic(t){const e=V5[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var bb=Object.defineProperty,k1=Object.getOwnPropertySymbols,_b=Object.prototype.hasOwnProperty,Eb=Object.prototype.propertyIsEnumerable,H1=(t,e,r)=>e in t?bb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xb=(t,e)=>{for(var r in e||(e={}))_b.call(e,r)&&H1(t,r,e[r]);if(k1)for(var r of k1(e))Eb.call(e,r)&&H1(t,r,e[r]);return t};function Cb(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 Ib(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=Ao.parse(o);return{protocol:n,topic:Sb(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:Cb(c)}}function Sb(t){return t.startsWith("//")?t.substring(2):t}function Ob(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 Db(t){return`${t.protocol}:${t.topic}@${t.version}?`+Ao.stringify(xb({symKey:t.symKey},Ob(t.relay)))}function $s(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Ab(t){const e=[];return Object.values(t).forEach(r=>{e.push(...$s(r.accounts))}),e}function $b(t,e){const r=[];return Object.values(t).forEach(n=>{$s(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Pb(t,e){const r=[];return Object.values(t).forEach(n=>{$s(n.accounts).includes(e)&&r.push(...n.events)}),r}function Tb(t,e){const r=oc(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 ku(t){return t.includes(":")}function No(t){return ku(t)?t.split(":")[0]:t}const Rb={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}},Nb={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}=Nb[t];return{message:e?`${r} ${e}`:r,code:n}}function Zt(t,e){const{message:r,code:n}=Rb[t];return{message:e?`${r} ${e}`:r,code:n}}function Pn(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Ps(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Pr(t){return typeof t>"u"}function pr(t,e){return e&&Pr(t)?!0:typeof t=="string"&&!!t.trim().length}function Hu(t,e){return e&&Pr(t)?!0:typeof t=="number"&&!isNaN(t)}function Lb(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return Wi(i,n)?(n.forEach(c=>{const{accounts:l,methods:h,events:f}=t.namespaces[c],v=$s(l),E=r[c];(!Wi(D1(c,E),v)||!Wi(E.methods,h)||!Wi(E.events,f))&&(o=!1)}),o):!1}function sc(t){return pr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Mb(t){if(pr(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&sc(r)}}return!1}function Ub(t){if(pr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function jb(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Fb(t){return t?.topic}function Bb(t,e){let r=null;return pr(t?.publicKey,!1)||(r=_e("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function W1(t){let e=!0;return Pn(t)?t.length&&(e=t.every(r=>pr(r,!1))):e=!1,e}function kb(t,e,r){let n=null;return Pn(e)&&e.length?e.forEach(i=>{n||sc(i)||(n=Zt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):sc(t)||(n=Zt("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function Hb(t,e,r){let n=null;return Object.entries(t).forEach(([i,o])=>{if(n)return;const c=kb(i,D1(i,o),`${e} ${r}`);c&&(n=c)}),n}function Wb(t,e){let r=null;return Pn(t)?t.forEach(n=>{r||Mb(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 zb(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Wb(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function qb(t,e){let r=null;return W1(t?.methods)?W1(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 z1(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=qb(n,`${e}, namespace`);i&&(r=i)}),r}function Vb(t,e,r){let n=null;if(t&&Ps(t)){const i=z1(t,e);i&&(n=i);const o=Hb(t,e,r);o&&(n=o)}else n=_e("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function oc(t,e){let r=null;if(t&&Ps(t)){const n=z1(t,e);n&&(r=n);const i=zb(t,e);i&&(r=i)}else r=_e("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function q1(t){return pr(t.protocol,!0)}function Kb(t,e){let r=!1;return e&&!t?r=!0:t&&Pn(t)&&t.length&&t.forEach(n=>{r=q1(n)}),r}function Gb(t){return typeof t=="number"}function Wr(t){return typeof t<"u"&&typeof t!==null}function Zb(t){return!(!t||typeof t!="object"||!t.code||!Hu(t.code,!1)||!t.message||!pr(t.message,!1))}function Yb(t){return!(Pr(t)||!pr(t.method,!1))}function Jb(t){return!(Pr(t)||Pr(t.result)&&Pr(t.error)||!Hu(t.id,!1)||!pr(t.jsonrpc,!1))}function Qb(t){return!(Pr(t)||!pr(t.name,!1))}function V1(t,e){return!(!sc(e)||!Ab(t).includes(e))}function Xb(t,e,r){return pr(r,!1)?$b(t,e).includes(r):!1}function e6(t,e,r){return pr(r,!1)?Pb(t,e).includes(r):!1}function K1(t,e,r){let n=null;const i=t6(t),o=r6(e),c=Object.keys(i),l=Object.keys(o),h=G1(Object.keys(t)),f=G1(Object.keys(e)),v=h.filter(E=>!f.includes(E));return v.length&&(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
15
15
|
Required: ${v.toString()}
|
|
16
|
-
Received: ${Object.keys(e).toString()}`)),
|
|
16
|
+
Received: ${Object.keys(e).toString()}`)),Wi(c,l)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
|
|
17
17
|
Required: ${c.toString()}
|
|
18
18
|
Approved: ${l.toString()}`)),Object.keys(e).forEach(E=>{if(!E.includes(":")||n)return;const _=$s(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||(
|
|
20
|
+
Approved: ${_.toString()}`))}),c.forEach(E=>{n||(Wi(i[E].methods,o[E].methods)?Wi(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 t6(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 G1(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function r6(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=$s(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 n6(t,e){return Hu(t,!1)&&t<=e.max&&t>=e.min}function Z1(){const t=To();return new Promise(e=>{switch(t){case Qr.browser:e(i6());break;case Qr.reactNative:e(s6());break;case Qr.node:e(o6());break;default:e(!0)}})}function i6(){return Po()&&navigator?.onLine}async function s6(){if(nc()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t?.isConnected}return!0}function o6(){return!0}function a6(t){switch(To()){case Qr.browser:c6(t);break;case Qr.reactNative:l6(t);break}}function c6(t){Po()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function l6(t){nc()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>t(e?.isConnected))}const Wu={};class ac{static get(e){return Wu[e]}static set(e,r){Wu[e]=r}static delete(e){delete Wu[e]}}var cc={};/*! *****************************************************************************
|
|
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 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 u6(t,e){zu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var qu=function(){return qu=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},qu.apply(this,arguments)};function h6(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 f6(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 d6(t,e){return function(r,n){e(r,n,t)}}function p6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function g6(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{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function m6(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(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function w6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function v6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Vu(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 y6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Y1(arguments[e]));return t}function b6(){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 _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(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Lo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function E6(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 x6(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 Vu=="function"?Vu(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(f){o({value:f,done:l})},c)}}function C6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function I6(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 S6(t){return t&&t.__esModule?t:{default:t}}function O6(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function D6(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 A6=Object.freeze({__proto__:null,__extends:u6,get __assign(){return qu},__rest:h6,__decorate:f6,__param:d6,__metadata:p6,__awaiter:g6,__generator:m6,__createBinding:w6,__exportStar:v6,__values:Vu,__read:Y1,__spread:y6,__spreadArrays:b6,__await:Lo,__asyncGenerator:_6,__asyncDelegator:E6,__asyncValues:x6,__makeTemplateObject:C6,__importStar:I6,__importDefault:S6,__classPrivateFieldGet:O6,__classPrivateFieldSet:D6}),J1=ji(A6),Mo={};Object.defineProperty(Mo,"__esModule",{value:!0});function $6(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}}Mo.safeJsonParse=$6;function P6(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}Mo.safeJsonStringify=P6;var Uo={exports:{}},Q1;function T6(){return Q1||(Q1=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 dr<"u"&&dr.localStorage?Uo.exports=dr.localStorage:typeof window<"u"&&window.localStorage?Uo.exports=window.localStorage:Uo.exports=new e}()),Uo.exports}var Ku={},jo={},X1;function R6(){if(X1)return jo;X1=1,Object.defineProperty(jo,"__esModule",{value:!0}),jo.IKeyValueStorage=void 0;class t{}return jo.IKeyValueStorage=t,jo}var Fo={},ep;function N6(){if(ep)return Fo;ep=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.parseEntry=void 0;const t=Mo;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return Fo.parseEntry=e,Fo}var tp;function L6(){return tp||(tp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=J1;e.__exportStar(R6(),t),e.__exportStar(N6(),t)}(Ku)),Ku}Object.defineProperty(cc,"__esModule",{value:!0}),cc.KeyValueStorage=void 0;const Ts=J1,rp=Mo,M6=Ts.__importDefault(T6()),U6=L6();class np{constructor(){this.localStorage=M6.default}getKeys(){return Ts.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return Ts.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(U6.parseEntry)})}getItem(e){return Ts.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return rp.safeJsonParse(r)})}setItem(e,r){return Ts.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,rp.safeJsonStringify(r))})}removeItem(e){return Ts.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}cc.KeyValueStorage=np;var j6=cc.default=np,Rs={};/*! *****************************************************************************
|
|
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 Gu=function(t,e){return Gu=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])},Gu(t,e)};function F6(t,e){Gu(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 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 k6(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 H6(t,e){return function(r,n){e(r,n,t)}}function W6(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{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function q6(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(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function V6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function K6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Yu(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 G6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(ip(arguments[e]));return t}function Z6(){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 Bo(t){return this instanceof Bo?(this.v=t,this):new Bo(t)}function Y6(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(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Bo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function J6(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:Bo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function Q6(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 Yu=="function"?Yu(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(f){o({value:f,done:l})},c)}}function X6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function e4(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 t4(t){return t&&t.__esModule?t:{default:t}}function r4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function n4(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 i4=Object.freeze({__proto__:null,__extends:F6,get __assign(){return Zu},__rest:B6,__decorate:k6,__param:H6,__metadata:W6,__awaiter:z6,__generator:q6,__createBinding:V6,__exportStar:K6,__values:Yu,__read:ip,__spread:G6,__spreadArrays:Z6,__await:Bo,__asyncGenerator:Y6,__asyncDelegator:J6,__asyncValues:Q6,__makeTemplateObject:X6,__importStar:e4,__importDefault:t4,__classPrivateFieldGet:r4,__classPrivateFieldSet:n4}),lc=ji(i4),ko={},Ju={},Ho={};class zi{}var s4=Object.freeze({__proto__:null,IEvents:zi}),o4=ji(s4),sp;function a4(){if(sp)return Ho;sp=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.IHeartBeat=void 0;const t=o4;class e extends t.IEvents{constructor(n){super()}}return Ho.IHeartBeat=e,Ho}var op;function ap(){return op||(op=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),lc.__exportStar(a4(),t)}(Ju)),Ju}var Qu={},qi={},cp;function c4(){if(cp)return qi;cp=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.HEARTBEAT_EVENTS=qi.HEARTBEAT_INTERVAL=void 0;const t=Te;return qi.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,qi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},qi}var lp;function up(){return lp||(lp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),lc.__exportStar(c4(),t)}(Qu)),Qu}var hp;function l4(){if(hp)return ko;hp=1,Object.defineProperty(ko,"__esModule",{value:!0}),ko.HeartBeat=void 0;const t=lc,e=yr.exports,r=Te,n=ap(),i=up();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 ko.HeartBeat=o,ko}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=lc;e.__exportStar(l4(),t),e.__exportStar(ap(),t),e.__exportStar(up(),t)})(Rs);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 Ju=function(t,e){return Ju=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])},Ju(t,e)};function a4(t,e){Ju(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Qu=function(){return Qu=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},Qu.apply(this,arguments)};function c4(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 l4(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 u4(t,e){return function(r,n){e(r,n,t)}}function h4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function f4(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{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function d4(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(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function p4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function g4(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 hp(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 m4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(hp(arguments[e]));return t}function w4(){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 ko(t){return this instanceof ko?(this.v=t,this):new ko(t)}function v4(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(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof ko?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function y4(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:ko(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function b4(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(f){o({value:f,done:l})},c)}}function _4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function E4(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 x4(t){return t&&t.__esModule?t:{default:t}}function C4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function I4(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 S4=Object.freeze({__proto__:null,__extends:a4,get __assign(){return Qu},__rest:c4,__decorate:l4,__param:u4,__metadata:h4,__awaiter:f4,__generator:d4,__createBinding:p4,__exportStar:g4,__values:Xu,__read:hp,__spread:m4,__spreadArrays:w4,__await:ko,__asyncGenerator:v4,__asyncDelegator:y4,__asyncValues:b4,__makeTemplateObject:_4,__importStar:E4,__importDefault:x4,__classPrivateFieldGet:C4,__classPrivateFieldSet:I4}),O4=Fi(S4),eh,fp;function D4(){if(fp)return eh;fp=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}eh=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 f=1;f<l;f++)h[f]=o(n[f]);return h.join(" ")}if(typeof r!="string")return r;var v=n.length;if(v===0)return r;for(var E="",_=1-c,S=-1,P=r&&r.length||0,j=0;j<P;){if(r.charCodeAt(j)===37&&j+1<P){switch(S=S>-1?S:0,r.charCodeAt(j+1)){case 100:case 102:if(_>=v||n[_]==null)break;S<j&&(E+=r.slice(S,j)),E+=Number(n[_]),S=j+2,j++;break;case 105:if(_>=v||n[_]==null)break;S<j&&(E+=r.slice(S,j)),E+=Math.floor(Number(n[_])),S=j+2,j++;break;case 79:case 111:case 106:if(_>=v||n[_]===void 0)break;S<j&&(E+=r.slice(S,j));var H=typeof n[_];if(H==="string"){E+="'"+n[_]+"'",S=j+2,j++;break}if(H==="function"){E+=n[_].name||"<anonymous>",S=j+2,j++;break}E+=o(n[_]),S=j+2,j++;break;case 115:if(_>=v)break;S<j&&(E+=r.slice(S,j)),E+=String(n[_]),S=j+2,j++;break;case 37:S<j&&(E+=r.slice(S,j)),E+="%",S=j+2,j++,_--;break}++_}++j}return S===-1?r:(S<P&&(E+=r.slice(S)),E)}return eh}var th,dp;function A4(){if(dp)return th;dp=1;const t=D4();th=i;const e=T().console||{},r={mapHttpRequest:P,mapHttpResponse:P,wrapRequestSerializer:j,wrapResponseSerializer:j,wrapErrorSerializer:j,req:P,res:P,err:_};function n(I,d){return Array.isArray(I)?I.filter(function(J){return J!=="!stdSerializers.err"}):I===!0?Object.keys(d):!1}function i(I){I=I||{},I.browser=I.browser||{};const d=I.browser.transmit;if(d&&typeof d.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||{},W=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 U={transmit:d,serialize:W,asObject:I.browser.asObject,levels:de,timestamp:S(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=W,O._stdErrSerialize=ee,O.child=ne,d&&(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(U,O,"error","log"),o(U,O,"fatal","error"),o(U,O,"warn","error"),o(U,O,"info","log"),o(U,O,"debug","log"),o(U,O,"trace","log")}function ne(ae,ie){if(!ae)throw new Error("missing bindings for child Pino");ie=ie||{},W&&ae.serializers&&(ie.serializers=ae.serializers);const De=ie.serializers;if(W&&De){var ge=Object.assign({},J,De),Be=I.browser.serialize===!0?Object.keys(ge):W;delete ae.serializers,h([ae],Be,ge,this._stdErrSerialize)}function ye(Me){this._childLevel=(Me._childLevel|0)+1,this.error=f(Me,ae,"error"),this.fatal=f(Me,ae,"fatal"),this.warn=f(Me,ae,"warn"),this.info=f(Me,ae,"info"),this.debug=f(Me,ae,"debug"),this.trace=f(Me,ae,"trace"),ge&&(this.serializers=ge,this._serialize=Be),d&&(this._logEvent=E([].concat(Me._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:Z,epochTime:N,unixTime:L,isoTime:$});function o(I,d,x,J){const W=Object.getPrototypeOf(d);d[x]=d.levelVal>d.levels.values[x]?H:W[x]?W[x]:e[x]||e[J]||H,c(I,d,x)}function c(I,d,x){!I.transmit&&d[x]===H||(d[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 U=I.transmit.level||d.level,ce=i.levels.values[U],le=i.levels.values[x];if(le<ce)return;v(this,{ts:ee,methodLevel:x,methodValue:le,transmitLevel:U,transmitValue:i.levels.values[I.transmit.level||d.level],send:I.transmit.send,val:d.levelVal},de)}}}(d[x]))}function l(I,d,x,J){I._serialize&&h(x,I._serialize,I.serializers,I._stdErrSerialize);const W=x.slice();let ee=W[0];const de={};J&&(de.time=J),de.level=i.levels.values[d];let me=(I._childLevel|0)+1;if(me<1&&(me=1),ee!==null&&typeof ee=="object"){for(;me--&&typeof W[0]=="object";)Object.assign(de,W.shift());ee=W.length?t(W.shift(),W):void 0}else typeof ee=="string"&&(ee=t(W.shift(),W));return ee!==void 0&&(de.msg=ee),de}function h(I,d,x,J){for(const W in I)if(J&&I[W]instanceof Error)I[W]=i.stdSerializers.err(I[W]);else if(typeof I[W]=="object"&&!Array.isArray(I[W]))for(const ee in I[W])d&&d.indexOf(ee)>-1&&ee in x&&(I[W][ee]=x[ee](I[W][ee]))}function f(I,d,x){return function(){const J=new Array(1+arguments.length);J[0]=d;for(var W=1;W<J.length;W++)J[W]=arguments[W-1];return I[x].apply(this,J)}}function v(I,d,x){const J=d.send,W=d.ts,ee=d.methodLevel,de=d.methodValue,me=d.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=W,I._logEvent.messages=x.filter(function(U){return O.indexOf(U)===-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 d={type:I.constructor.name,msg:I.message,stack:I.stack};for(const x in I)d[x]===void 0&&(d[x]=I[x]);return d}function S(I){return typeof I.timestamp=="function"?I.timestamp:I.timestamp===!1?Z:N}function P(){return{}}function j(I){return I}function H(){}function Z(){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(d){return typeof d<"u"&&d}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 th}var Ki={},pp;function gp(){return pp||(pp=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.PINO_CUSTOM_CONTEXT_KEY=Ki.PINO_LOGGER_DEFAULTS=void 0,Ki.PINO_LOGGER_DEFAULTS={level:"info"},Ki.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Ki}var Tr={},mp;function $4(){if(mp)return Tr;mp=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.generateChildLogger=Tr.formatChildLoggerContext=Tr.getLoggerContext=Tr.setBrowserLoggerContext=Tr.getBrowserLoggerContext=Tr.getDefaultLoggerOptions=void 0;const t=gp();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,f=t.PINO_CUSTOM_CONTEXT_KEY){return l[f]=h,l}Tr.setBrowserLoggerContext=n;function i(l,h=t.PINO_CUSTOM_CONTEXT_KEY){let f="";return typeof l.bindings>"u"?f=r(l,h):f=l.bindings().context||"",f}Tr.getLoggerContext=i;function o(l,h,f=t.PINO_CUSTOM_CONTEXT_KEY){const v=i(l,f);return v.trim()?`${v}/${h}`:h}Tr.formatChildLoggerContext=o;function c(l,h,f=t.PINO_CUSTOM_CONTEXT_KEY){const v=o(l,h,f),E=l.child({context:v});return n(E,v,f)}return Tr.generateChildLogger=c,Tr}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=O4,r=e.__importDefault(A4());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(gp(),t),e.__exportStar($4(),t)})(pt);class P4 extends qi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class T4 extends qi{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class R4{constructor(e,r){this.logger=e,this.core=r}}class N4 extends qi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class L4 extends qi{constructor(e){super()}}class M4{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class U4 extends qi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class j4 extends qi{constructor(e,r){super(),this.core=e,this.logger=r}}class F4{constructor(e,r){this.projectId=e,this.logger=r}}class B4{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class k4{constructor(e){this.client=e}}const H4=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),W4=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 rh(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return W4(t)}catch{return t}}function Ho(t){return typeof t=="string"?t:H4(t)||""}var nh={},wp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Jr;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,f){if(f===void 0&&(f=h.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var v=0;if(this._bytesHashed+=f,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&f>0;)this._buffer[this._bufferLength++]=h[v++],f--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(f>=this.blockSize&&(v=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,h,v,f),f%=this.blockSize);f>0;)this._buffer[this._bufferLength++]=h[v++],f--;return this},l.prototype.finish=function(h){if(!this._finished){var f=this._bytesHashed,v=this._bufferLength,E=f/536870912|0,_=f<<3,S=f%128<112?128:256;this._buffer[v]=128;for(var P=v+1;P<S-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,S-8),e.writeUint32BE(_,this._buffer,S-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,S),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,f,v,E,_,S){for(var P=f[0],j=f[1],H=f[2],Z=f[3],N=f[4],L=f[5],$=f[6],T=f[7],I=v[0],d=v[1],x=v[2],J=v[3],W=v[4],ee=v[5],de=v[6],me=v[7],O,U,ce,le,re,ne,ae,ie;S>=128;){for(var De=0;De<16;De++){var ge=8*De+_;l[De]=e.readUint32BE(E,ge),h[De]=e.readUint32BE(E,ge+4)}for(var De=0;De<80;De++){var Be=P,ye=j,Me=H,Q=Z,Y=N,z=L,w=$,F=T,we=I,ve=d,Ue=x,nt=J,at=W,Ge=ee,At=de,$t=me;if(O=T,U=me,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=(N>>>14|W<<32-14)^(N>>>18|W<<32-18)^(W>>>41-32|N<<32-(41-32)),U=(W>>>14|N<<32-14)^(W>>>18|N<<32-18)^(N>>>41-32|W<<32-(41-32)),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=N&L^~N&$,U=W&ee^~W&de,re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=i[De*2],U=i[De*2+1],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=l[De%16],U=h[De%16],re+=U&65535,ne+=U>>>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,U=le,re=U&65535,ne=U>>>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)),U=(I>>>28|P<<32-28)^(P>>>34-32|I<<32-(34-32))^(P>>>39-32|I<<32-(39-32)),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=P&j^P&H^j&H,U=I&d^I&x^d&x,re+=U&65535,ne+=U>>>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=Q,U=nt,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=ce,U=le,re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,Q=ae&65535|ie<<16,nt=re&65535|ne<<16,j=Be,H=ye,Z=Me,N=Q,L=Y,$=z,T=w,P=F,d=we,x=ve,J=Ue,W=nt,ee=at,de=Ge,me=At,I=$t,De%16===15)for(var ge=0;ge<16;ge++)O=l[ge],U=h[ge],re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=l[(ge+9)%16],U=h[(ge+9)%16],re+=U&65535,ne+=U>>>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,U=(le>>>1|ce<<32-1)^(le>>>8|ce<<32-8)^(le>>>7|ce<<32-7),re+=U&65535,ne+=U>>>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,U=(le>>>19|ce<<32-19)^(ce>>>61-32|le<<32-(61-32))^(le>>>6|ce<<32-6),re+=U&65535,ne+=U>>>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,U=I,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[0],U=v[0],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[0]=P=ae&65535|ie<<16,v[0]=I=re&65535|ne<<16,O=j,U=d,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[1],U=v[1],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[1]=j=ae&65535|ie<<16,v[1]=d=re&65535|ne<<16,O=H,U=x,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[2],U=v[2],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[2]=H=ae&65535|ie<<16,v[2]=x=re&65535|ne<<16,O=Z,U=J,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[3],U=v[3],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[3]=Z=ae&65535|ie<<16,v[3]=J=re&65535|ne<<16,O=N,U=W,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[4],U=v[4],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[4]=N=ae&65535|ie<<16,v[4]=W=re&65535|ne<<16,O=L,U=ee,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[5],U=v[5],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[5]=L=ae&65535|ie<<16,v[5]=ee=re&65535|ne<<16,O=$,U=de,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[6],U=v[6],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[6]=$=ae&65535|ie<<16,v[6]=de=re&65535|ne<<16,O=T,U=me,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[7],U=v[7],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[7]=T=ae&65535|ie<<16,v[7]=me=re&65535|ne<<16,_+=128,S-=128}return _}function c(l){var h=new n;h.update(l);var f=h.digest();return h.clean(),f}t.hash=c})(wp),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=Is,r=wp,n=Jr;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(Q){const Y=new Float64Array(16);if(Q)for(let z=0;z<Q.length;z++)Y[z]=Q[z];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]),f=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 S(Q,Y){for(let z=0;z<16;z++)Q[z]=Y[z]|0}function P(Q){let Y=1;for(let z=0;z<16;z++){let w=Q[z]+Y+65535;Y=Math.floor(w/65536),Q[z]=w-Y*65536}Q[0]+=Y-1+37*(Y-1)}function j(Q,Y,z){const w=~(z-1);for(let F=0;F<16;F++){const we=w&(Q[F]^Y[F]);Q[F]^=we,Y[F]^=we}}function H(Q,Y){const z=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++){z[0]=w[0]-65517;for(let ve=1;ve<15;ve++)z[ve]=w[ve]-65535-(z[ve-1]>>16&1),z[ve-1]&=65535;z[15]=w[15]-32767-(z[14]>>16&1);const we=z[15]>>16&1;z[14]&=65535,j(w,z,1-we)}for(let F=0;F<16;F++)Q[2*F]=w[F]&255,Q[2*F+1]=w[F]>>8}function Z(Q,Y){let z=0;for(let w=0;w<32;w++)z|=Q[w]^Y[w];return(1&z-1>>>8)-1}function N(Q,Y){const z=new Uint8Array(32),w=new Uint8Array(32);return H(z,Q),H(w,Y),Z(z,w)}function L(Q){const Y=new Uint8Array(32);return H(Y,Q),Y[0]&1}function $(Q,Y){for(let z=0;z<16;z++)Q[z]=Y[2*z]+(Y[2*z+1]<<8);Q[15]&=32767}function T(Q,Y,z){for(let w=0;w<16;w++)Q[w]=Y[w]+z[w]}function I(Q,Y,z){for(let w=0;w<16;w++)Q[w]=Y[w]-z[w]}function d(Q,Y,z){let w,F,we=0,ve=0,Ue=0,nt=0,at=0,Ge=0,At=0,$t=0,Je=0,He=0,ke=0,Ke=0,rt=0,je=0,Ze=0,b=0,p=0,m=0,A=0,B=0,K=0,X=0,Ee=0,Re=0,st=0,ht=0,lt=0,Ur=0,ei=0,Di=0,us=0,Ht=z[0],Lt=z[1],Wt=z[2],zt=z[3],Ft=z[4],Mt=z[5],nr=z[6],ir=z[7],qt=z[8],sr=z[9],Vt=z[10],Jt=z[11],Kt=z[12],Pt=z[13],or=z[14],ar=z[15];w=Y[0],we+=w*Ht,ve+=w*Lt,Ue+=w*Wt,nt+=w*zt,at+=w*Ft,Ge+=w*Mt,At+=w*nr,$t+=w*ir,Je+=w*qt,He+=w*sr,ke+=w*Vt,Ke+=w*Jt,rt+=w*Kt,je+=w*Pt,Ze+=w*or,b+=w*ar,w=Y[1],ve+=w*Ht,Ue+=w*Lt,nt+=w*Wt,at+=w*zt,Ge+=w*Ft,At+=w*Mt,$t+=w*nr,Je+=w*ir,He+=w*qt,ke+=w*sr,Ke+=w*Vt,rt+=w*Jt,je+=w*Kt,Ze+=w*Pt,b+=w*or,p+=w*ar,w=Y[2],Ue+=w*Ht,nt+=w*Lt,at+=w*Wt,Ge+=w*zt,At+=w*Ft,$t+=w*Mt,Je+=w*nr,He+=w*ir,ke+=w*qt,Ke+=w*sr,rt+=w*Vt,je+=w*Jt,Ze+=w*Kt,b+=w*Pt,p+=w*or,m+=w*ar,w=Y[3],nt+=w*Ht,at+=w*Lt,Ge+=w*Wt,At+=w*zt,$t+=w*Ft,Je+=w*Mt,He+=w*nr,ke+=w*ir,Ke+=w*qt,rt+=w*sr,je+=w*Vt,Ze+=w*Jt,b+=w*Kt,p+=w*Pt,m+=w*or,A+=w*ar,w=Y[4],at+=w*Ht,Ge+=w*Lt,At+=w*Wt,$t+=w*zt,Je+=w*Ft,He+=w*Mt,ke+=w*nr,Ke+=w*ir,rt+=w*qt,je+=w*sr,Ze+=w*Vt,b+=w*Jt,p+=w*Kt,m+=w*Pt,A+=w*or,B+=w*ar,w=Y[5],Ge+=w*Ht,At+=w*Lt,$t+=w*Wt,Je+=w*zt,He+=w*Ft,ke+=w*Mt,Ke+=w*nr,rt+=w*ir,je+=w*qt,Ze+=w*sr,b+=w*Vt,p+=w*Jt,m+=w*Kt,A+=w*Pt,B+=w*or,K+=w*ar,w=Y[6],At+=w*Ht,$t+=w*Lt,Je+=w*Wt,He+=w*zt,ke+=w*Ft,Ke+=w*Mt,rt+=w*nr,je+=w*ir,Ze+=w*qt,b+=w*sr,p+=w*Vt,m+=w*Jt,A+=w*Kt,B+=w*Pt,K+=w*or,X+=w*ar,w=Y[7],$t+=w*Ht,Je+=w*Lt,He+=w*Wt,ke+=w*zt,Ke+=w*Ft,rt+=w*Mt,je+=w*nr,Ze+=w*ir,b+=w*qt,p+=w*sr,m+=w*Vt,A+=w*Jt,B+=w*Kt,K+=w*Pt,X+=w*or,Ee+=w*ar,w=Y[8],Je+=w*Ht,He+=w*Lt,ke+=w*Wt,Ke+=w*zt,rt+=w*Ft,je+=w*Mt,Ze+=w*nr,b+=w*ir,p+=w*qt,m+=w*sr,A+=w*Vt,B+=w*Jt,K+=w*Kt,X+=w*Pt,Ee+=w*or,Re+=w*ar,w=Y[9],He+=w*Ht,ke+=w*Lt,Ke+=w*Wt,rt+=w*zt,je+=w*Ft,Ze+=w*Mt,b+=w*nr,p+=w*ir,m+=w*qt,A+=w*sr,B+=w*Vt,K+=w*Jt,X+=w*Kt,Ee+=w*Pt,Re+=w*or,st+=w*ar,w=Y[10],ke+=w*Ht,Ke+=w*Lt,rt+=w*Wt,je+=w*zt,Ze+=w*Ft,b+=w*Mt,p+=w*nr,m+=w*ir,A+=w*qt,B+=w*sr,K+=w*Vt,X+=w*Jt,Ee+=w*Kt,Re+=w*Pt,st+=w*or,ht+=w*ar,w=Y[11],Ke+=w*Ht,rt+=w*Lt,je+=w*Wt,Ze+=w*zt,b+=w*Ft,p+=w*Mt,m+=w*nr,A+=w*ir,B+=w*qt,K+=w*sr,X+=w*Vt,Ee+=w*Jt,Re+=w*Kt,st+=w*Pt,ht+=w*or,lt+=w*ar,w=Y[12],rt+=w*Ht,je+=w*Lt,Ze+=w*Wt,b+=w*zt,p+=w*Ft,m+=w*Mt,A+=w*nr,B+=w*ir,K+=w*qt,X+=w*sr,Ee+=w*Vt,Re+=w*Jt,st+=w*Kt,ht+=w*Pt,lt+=w*or,Ur+=w*ar,w=Y[13],je+=w*Ht,Ze+=w*Lt,b+=w*Wt,p+=w*zt,m+=w*Ft,A+=w*Mt,B+=w*nr,K+=w*ir,X+=w*qt,Ee+=w*sr,Re+=w*Vt,st+=w*Jt,ht+=w*Kt,lt+=w*Pt,Ur+=w*or,ei+=w*ar,w=Y[14],Ze+=w*Ht,b+=w*Lt,p+=w*Wt,m+=w*zt,A+=w*Ft,B+=w*Mt,K+=w*nr,X+=w*ir,Ee+=w*qt,Re+=w*sr,st+=w*Vt,ht+=w*Jt,lt+=w*Kt,Ur+=w*Pt,ei+=w*or,Di+=w*ar,w=Y[15],b+=w*Ht,p+=w*Lt,m+=w*Wt,A+=w*zt,B+=w*Ft,K+=w*Mt,X+=w*nr,Ee+=w*ir,Re+=w*qt,st+=w*sr,ht+=w*Vt,lt+=w*Jt,Ur+=w*Kt,ei+=w*Pt,Di+=w*or,us+=w*ar,we+=38*p,ve+=38*m,Ue+=38*A,nt+=38*B,at+=38*K,Ge+=38*X,At+=38*Ee,$t+=38*Re,Je+=38*st,He+=38*ht,ke+=38*lt,Ke+=38*Ur,rt+=38*ei,je+=38*Di,Ze+=38*us,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=Ue+F+65535,F=Math.floor(w/65536),Ue=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=At+F+65535,F=Math.floor(w/65536),At=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=ke+F+65535,F=Math.floor(w/65536),ke=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=je+F+65535,F=Math.floor(w/65536),je=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=Ue+F+65535,F=Math.floor(w/65536),Ue=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=At+F+65535,F=Math.floor(w/65536),At=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=ke+F+65535,F=Math.floor(w/65536),ke=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=je+F+65535,F=Math.floor(w/65536),je=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),Q[0]=we,Q[1]=ve,Q[2]=Ue,Q[3]=nt,Q[4]=at,Q[5]=Ge,Q[6]=At,Q[7]=$t,Q[8]=Je,Q[9]=He,Q[10]=ke,Q[11]=Ke,Q[12]=rt,Q[13]=je,Q[14]=Ze,Q[15]=b}function x(Q,Y){d(Q,Y,Y)}function J(Q,Y){const z=i();let w;for(w=0;w<16;w++)z[w]=Y[w];for(w=253;w>=0;w--)x(z,z),w!==2&&w!==4&&d(z,z,Y);for(w=0;w<16;w++)Q[w]=z[w]}function W(Q,Y){const z=i();let w;for(w=0;w<16;w++)z[w]=Y[w];for(w=250;w>=0;w--)x(z,z),w!==1&&d(z,z,Y);for(w=0;w<16;w++)Q[w]=z[w]}function ee(Q,Y){const z=i(),w=i(),F=i(),we=i(),ve=i(),Ue=i(),nt=i(),at=i(),Ge=i();I(z,Q[1],Q[0]),I(Ge,Y[1],Y[0]),d(z,z,Ge),T(w,Q[0],Q[1]),T(Ge,Y[0],Y[1]),d(w,w,Ge),d(F,Q[3],Y[3]),d(F,F,f),d(we,Q[2],Y[2]),T(we,we,we),I(ve,w,z),I(Ue,we,F),T(nt,we,F),T(at,w,z),d(Q[0],ve,Ue),d(Q[1],at,nt),d(Q[2],nt,Ue),d(Q[3],ve,at)}function de(Q,Y,z){for(let w=0;w<4;w++)j(Q[w],Y[w],z)}function me(Q,Y){const z=i(),w=i(),F=i();J(F,Y[2]),d(z,Y[0],F),d(w,Y[1],F),H(Q,w),Q[31]^=L(z)<<7}function O(Q,Y,z){S(Q[0],c),S(Q[1],l),S(Q[2],l),S(Q[3],c);for(let w=255;w>=0;--w){const F=z[w/8|0]>>(w&7)&1;de(Q,Y,F),ee(Y,Q),ee(Q,Q),de(Q,Y,F)}}function U(Q,Y){const z=[i(),i(),i(),i()];S(z[0],v),S(z[1],E),S(z[2],l),d(z[3],v,E),O(Q,z,Y)}function ce(Q){if(Q.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const Y=(0,r.hash)(Q);Y[0]&=248,Y[31]&=127,Y[31]|=64;const z=new Uint8Array(32),w=[i(),i(),i(),i()];U(w,Y),me(z,w);const F=new Uint8Array(64);return F.set(Q),F.set(z,32),{publicKey:z,secretKey:F}}t.generateKeyPairFromSeed=ce;function le(Q){const Y=(0,e.randomBytes)(32,Q),z=ce(Y);return(0,n.wipe)(Y),z}t.generateKeyPair=le;function re(Q){if(Q.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(Q.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(Q,Y){let z,w,F,we;for(w=63;w>=32;--w){for(z=0,F=w-32,we=w-12;F<we;++F)Y[F]+=z-16*Y[w]*ne[F-(w-32)],z=Math.floor((Y[F]+128)/256),Y[F]-=z*256;Y[F]+=z,Y[w]=0}for(z=0,F=0;F<32;F++)Y[F]+=z-(Y[31]>>4)*ne[F],z=Y[F]>>8,Y[F]&=255;for(F=0;F<32;F++)Y[F]-=z*ne[F];for(w=0;w<32;w++)Y[w+1]+=Y[w]>>8,Q[w]=Y[w]&255}function ie(Q){const Y=new Float64Array(64);for(let z=0;z<64;z++)Y[z]=Q[z];for(let z=0;z<64;z++)Q[z]=0;ae(Q,Y)}function De(Q,Y){const z=new Float64Array(64),w=[i(),i(),i(),i()],F=(0,r.hash)(Q.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 Ue=ve.digest();ve.clean(),ie(Ue),U(w,Ue),me(we,w),ve.reset(),ve.update(we.subarray(0,32)),ve.update(Q.subarray(32)),ve.update(Y);const nt=ve.digest();ie(nt);for(let at=0;at<32;at++)z[at]=Ue[at];for(let at=0;at<32;at++)for(let Ge=0;Ge<32;Ge++)z[at+Ge]+=nt[at]*F[Ge];return ae(we.subarray(32),z),we}t.sign=De;function ge(Q,Y){const z=i(),w=i(),F=i(),we=i(),ve=i(),Ue=i(),nt=i();return S(Q[2],l),$(Q[1],Y),x(F,Q[1]),d(we,F,h),I(F,F,Q[2]),T(we,Q[2],we),x(ve,we),x(Ue,ve),d(nt,Ue,ve),d(z,nt,F),d(z,z,we),W(z,z),d(z,z,F),d(z,z,we),d(z,z,we),d(Q[0],z,we),x(w,Q[0]),d(w,w,we),N(w,F)&&d(Q[0],Q[0],_),x(w,Q[0]),d(w,w,we),N(w,F)?-1:(L(Q[0])===Y[31]>>7&&I(Q[0],c,Q[0]),d(Q[3],Q[0],Q[1]),0)}function Be(Q,Y,z){const w=new Uint8Array(32),F=[i(),i(),i(),i()],we=[i(),i(),i(),i()];if(z.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ge(we,Q))return!1;const ve=new r.SHA512;ve.update(z.subarray(0,32)),ve.update(Q),ve.update(Y);const Ue=ve.digest();return ie(Ue),O(F,we,Ue),U(we,z.subarray(32)),ee(F,we),me(w,F),!Z(z,w)}t.verify=Be;function ye(Q){let Y=[i(),i(),i(),i()];if(ge(Y,Q))throw new Error("Ed25519: invalid public key");let z=i(),w=i(),F=Y[1];T(z,l,F),I(w,l,F),J(w,w),d(z,z,w);let we=new Uint8Array(32);return H(we,z),we}t.convertPublicKeyToX25519=ye;function Me(Q){const Y=(0,r.hash)(Q.subarray(0,32));Y[0]&=248,Y[31]&=127,Y[31]|=64;const z=new Uint8Array(Y.subarray(0,32));return(0,n.wipe)(Y),z}t.convertSecretKeyToX25519=Me}(nh);const z4="EdDSA",q4="JWT",vp=".",yp="base64url",V4="utf8",K4="utf8",G4=":",Z4="did",Y4="key",bp="base58btc",J4="z",Q4="K36",X4=32;function cc(t){return Ar(Hr(Ho(t),V4),yp)}function _p(t){const e=Hr(Q4,bp),r=J4+Ar(wu([e,t]),bp);return[Z4,Y4,r].join(G4)}function e_(t){return Ar(t,yp)}function t_(t){return Hr([cc(t.header),cc(t.payload)].join(vp),K4)}function r_(t){return[cc(t.header),cc(t.payload),e_(t.signature)].join(vp)}function Ep(t=Is.randomBytes(X4)){return nh.generateKeyPairFromSeed(t)}async function n_(t,e,r,n,i=Te.fromMiliseconds(Date.now())){const o={alg:z4,typ:q4},c=_p(n.publicKey),l=i+r,h={iss:c,sub:t,aud:e,iat:i,exp:l},f=t_({header:o,payload:h}),v=nh.sign(n.secretKey,f);return r_({header:o,payload:h,signature:v})}const i_="PARSE_ERROR",s_="INVALID_REQUEST",o_="METHOD_NOT_FOUND",a_="INVALID_PARAMS",xp="INTERNAL_ERROR",ih="SERVER_ERROR",c_=[-32700,-32600,-32601,-32602,-32603],Wo={[i_]:{code:-32700,message:"Parse error"},[s_]:{code:-32600,message:"Invalid Request"},[o_]:{code:-32601,message:"Method not found"},[a_]:{code:-32602,message:"Invalid params"},[xp]:{code:-32603,message:"Internal error"},[ih]:{code:-32e3,message:"Server error"}},Cp=ih;function l_(t){return c_.includes(t)}function Ip(t){return Object.keys(Wo).includes(t)?Wo[t]:Wo[Cp]}function u_(t){const e=Object.values(Wo).find(r=>r.code===t);return e||Wo[Cp]}function Sp(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Op={};/*! *****************************************************************************
|
|
59
|
+
***************************************************************************** */var Xu=function(t,e){return Xu=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])},Xu(t,e)};function u4(t,e){Xu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var eh=function(){return eh=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},eh.apply(this,arguments)};function h4(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 f4(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 d4(t,e){return function(r,n){e(r,n,t)}}function p4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function g4(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{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function m4(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(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function w4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function v4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function th(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 fp(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 y4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(fp(arguments[e]));return t}function b4(){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 Wo(t){return this instanceof Wo?(this.v=t,this):new Wo(t)}function _4(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(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Wo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function E4(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:Wo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function x4(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 th=="function"?th(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(f){o({value:f,done:l})},c)}}function C4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function I4(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 S4(t){return t&&t.__esModule?t:{default:t}}function O4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function D4(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 A4=Object.freeze({__proto__:null,__extends:u4,get __assign(){return eh},__rest:h4,__decorate:f4,__param:d4,__metadata:p4,__awaiter:g4,__generator:m4,__createBinding:w4,__exportStar:v4,__values:th,__read:fp,__spread:y4,__spreadArrays:b4,__await:Wo,__asyncGenerator:_4,__asyncDelegator:E4,__asyncValues:x4,__makeTemplateObject:C4,__importStar:I4,__importDefault:S4,__classPrivateFieldGet:O4,__classPrivateFieldSet:D4}),$4=ji(A4),rh,dp;function P4(){if(dp)return rh;dp=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}rh=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 f=1;f<l;f++)h[f]=o(n[f]);return h.join(" ")}if(typeof r!="string")return r;var v=n.length;if(v===0)return r;for(var E="",_=1-c,S=-1,P=r&&r.length||0,j=0;j<P;){if(r.charCodeAt(j)===37&&j+1<P){switch(S=S>-1?S:0,r.charCodeAt(j+1)){case 100:case 102:if(_>=v||n[_]==null)break;S<j&&(E+=r.slice(S,j)),E+=Number(n[_]),S=j+2,j++;break;case 105:if(_>=v||n[_]==null)break;S<j&&(E+=r.slice(S,j)),E+=Math.floor(Number(n[_])),S=j+2,j++;break;case 79:case 111:case 106:if(_>=v||n[_]===void 0)break;S<j&&(E+=r.slice(S,j));var H=typeof n[_];if(H==="string"){E+="'"+n[_]+"'",S=j+2,j++;break}if(H==="function"){E+=n[_].name||"<anonymous>",S=j+2,j++;break}E+=o(n[_]),S=j+2,j++;break;case 115:if(_>=v)break;S<j&&(E+=r.slice(S,j)),E+=String(n[_]),S=j+2,j++;break;case 37:S<j&&(E+=r.slice(S,j)),E+="%",S=j+2,j++,_--;break}++_}++j}return S===-1?r:(S<P&&(E+=r.slice(S)),E)}return rh}var nh,pp;function T4(){if(pp)return nh;pp=1;const t=P4();nh=i;const e=T().console||{},r={mapHttpRequest:P,mapHttpResponse:P,wrapRequestSerializer:j,wrapResponseSerializer:j,wrapErrorSerializer:j,req:P,res:P,err:_};function n(I,d){return Array.isArray(I)?I.filter(function(J){return J!=="!stdSerializers.err"}):I===!0?Object.keys(d):!1}function i(I){I=I||{},I.browser=I.browser||{};const d=I.browser.transmit;if(d&&typeof d.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||{},W=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 U={transmit:d,serialize:W,asObject:I.browser.asObject,levels:de,timestamp:S(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=W,O._stdErrSerialize=ee,O.child=ne,d&&(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(U,O,"error","log"),o(U,O,"fatal","error"),o(U,O,"warn","error"),o(U,O,"info","log"),o(U,O,"debug","log"),o(U,O,"trace","log")}function ne(ae,ie){if(!ae)throw new Error("missing bindings for child Pino");ie=ie||{},W&&ae.serializers&&(ie.serializers=ae.serializers);const De=ie.serializers;if(W&&De){var ge=Object.assign({},J,De),Be=I.browser.serialize===!0?Object.keys(ge):W;delete ae.serializers,h([ae],Be,ge,this._stdErrSerialize)}function ye(Me){this._childLevel=(Me._childLevel|0)+1,this.error=f(Me,ae,"error"),this.fatal=f(Me,ae,"fatal"),this.warn=f(Me,ae,"warn"),this.info=f(Me,ae,"info"),this.debug=f(Me,ae,"debug"),this.trace=f(Me,ae,"trace"),ge&&(this.serializers=ge,this._serialize=Be),d&&(this._logEvent=E([].concat(Me._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:Z,epochTime:N,unixTime:L,isoTime:$});function o(I,d,x,J){const W=Object.getPrototypeOf(d);d[x]=d.levelVal>d.levels.values[x]?H:W[x]?W[x]:e[x]||e[J]||H,c(I,d,x)}function c(I,d,x){!I.transmit&&d[x]===H||(d[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 U=I.transmit.level||d.level,ce=i.levels.values[U],le=i.levels.values[x];if(le<ce)return;v(this,{ts:ee,methodLevel:x,methodValue:le,transmitLevel:U,transmitValue:i.levels.values[I.transmit.level||d.level],send:I.transmit.send,val:d.levelVal},de)}}}(d[x]))}function l(I,d,x,J){I._serialize&&h(x,I._serialize,I.serializers,I._stdErrSerialize);const W=x.slice();let ee=W[0];const de={};J&&(de.time=J),de.level=i.levels.values[d];let me=(I._childLevel|0)+1;if(me<1&&(me=1),ee!==null&&typeof ee=="object"){for(;me--&&typeof W[0]=="object";)Object.assign(de,W.shift());ee=W.length?t(W.shift(),W):void 0}else typeof ee=="string"&&(ee=t(W.shift(),W));return ee!==void 0&&(de.msg=ee),de}function h(I,d,x,J){for(const W in I)if(J&&I[W]instanceof Error)I[W]=i.stdSerializers.err(I[W]);else if(typeof I[W]=="object"&&!Array.isArray(I[W]))for(const ee in I[W])d&&d.indexOf(ee)>-1&&ee in x&&(I[W][ee]=x[ee](I[W][ee]))}function f(I,d,x){return function(){const J=new Array(1+arguments.length);J[0]=d;for(var W=1;W<J.length;W++)J[W]=arguments[W-1];return I[x].apply(this,J)}}function v(I,d,x){const J=d.send,W=d.ts,ee=d.methodLevel,de=d.methodValue,me=d.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=W,I._logEvent.messages=x.filter(function(U){return O.indexOf(U)===-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 d={type:I.constructor.name,msg:I.message,stack:I.stack};for(const x in I)d[x]===void 0&&(d[x]=I[x]);return d}function S(I){return typeof I.timestamp=="function"?I.timestamp:I.timestamp===!1?Z:N}function P(){return{}}function j(I){return I}function H(){}function Z(){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(d){return typeof d<"u"&&d}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 nh}var Vi={},gp;function mp(){return gp||(gp=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.PINO_CUSTOM_CONTEXT_KEY=Vi.PINO_LOGGER_DEFAULTS=void 0,Vi.PINO_LOGGER_DEFAULTS={level:"info"},Vi.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Vi}var Tr={},wp;function R4(){if(wp)return Tr;wp=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.generateChildLogger=Tr.formatChildLoggerContext=Tr.getLoggerContext=Tr.setBrowserLoggerContext=Tr.getBrowserLoggerContext=Tr.getDefaultLoggerOptions=void 0;const t=mp();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,f=t.PINO_CUSTOM_CONTEXT_KEY){return l[f]=h,l}Tr.setBrowserLoggerContext=n;function i(l,h=t.PINO_CUSTOM_CONTEXT_KEY){let f="";return typeof l.bindings>"u"?f=r(l,h):f=l.bindings().context||"",f}Tr.getLoggerContext=i;function o(l,h,f=t.PINO_CUSTOM_CONTEXT_KEY){const v=i(l,f);return v.trim()?`${v}/${h}`:h}Tr.formatChildLoggerContext=o;function c(l,h,f=t.PINO_CUSTOM_CONTEXT_KEY){const v=o(l,h,f),E=l.child({context:v});return n(E,v,f)}return Tr.generateChildLogger=c,Tr}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=$4,r=e.__importDefault(T4());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(mp(),t),e.__exportStar(R4(),t)})(pt);class N4 extends zi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class L4 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 U4 extends zi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class j4 extends zi{constructor(e){super()}}class F4{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 k4 extends zi{constructor(e,r){super(),this.core=e,this.logger=r}}class H4{constructor(e,r){this.projectId=e,this.logger=r}}class W4{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class z4{constructor(e){this.client=e}}const q4=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),V4=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 ih(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return V4(t)}catch{return t}}function zo(t){return typeof t=="string"?t:q4(t)||""}var sh={},vp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Jr;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,f){if(f===void 0&&(f=h.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var v=0;if(this._bytesHashed+=f,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&f>0;)this._buffer[this._bufferLength++]=h[v++],f--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(f>=this.blockSize&&(v=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,h,v,f),f%=this.blockSize);f>0;)this._buffer[this._bufferLength++]=h[v++],f--;return this},l.prototype.finish=function(h){if(!this._finished){var f=this._bytesHashed,v=this._bufferLength,E=f/536870912|0,_=f<<3,S=f%128<112?128:256;this._buffer[v]=128;for(var P=v+1;P<S-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,S-8),e.writeUint32BE(_,this._buffer,S-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,S),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,f,v,E,_,S){for(var P=f[0],j=f[1],H=f[2],Z=f[3],N=f[4],L=f[5],$=f[6],T=f[7],I=v[0],d=v[1],x=v[2],J=v[3],W=v[4],ee=v[5],de=v[6],me=v[7],O,U,ce,le,re,ne,ae,ie;S>=128;){for(var De=0;De<16;De++){var ge=8*De+_;l[De]=e.readUint32BE(E,ge),h[De]=e.readUint32BE(E,ge+4)}for(var De=0;De<80;De++){var Be=P,ye=j,Me=H,Q=Z,Y=N,z=L,w=$,F=T,we=I,ve=d,Ue=x,nt=J,at=W,Ge=ee,At=de,$t=me;if(O=T,U=me,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=(N>>>14|W<<32-14)^(N>>>18|W<<32-18)^(W>>>41-32|N<<32-(41-32)),U=(W>>>14|N<<32-14)^(W>>>18|N<<32-18)^(N>>>41-32|W<<32-(41-32)),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=N&L^~N&$,U=W&ee^~W&de,re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=i[De*2],U=i[De*2+1],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=l[De%16],U=h[De%16],re+=U&65535,ne+=U>>>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,U=le,re=U&65535,ne=U>>>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)),U=(I>>>28|P<<32-28)^(P>>>34-32|I<<32-(34-32))^(P>>>39-32|I<<32-(39-32)),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=P&j^P&H^j&H,U=I&d^I&x^d&x,re+=U&65535,ne+=U>>>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=Q,U=nt,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=ce,U=le,re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,Q=ae&65535|ie<<16,nt=re&65535|ne<<16,j=Be,H=ye,Z=Me,N=Q,L=Y,$=z,T=w,P=F,d=we,x=ve,J=Ue,W=nt,ee=at,de=Ge,me=At,I=$t,De%16===15)for(var ge=0;ge<16;ge++)O=l[ge],U=h[ge],re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=l[(ge+9)%16],U=h[(ge+9)%16],re+=U&65535,ne+=U>>>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,U=(le>>>1|ce<<32-1)^(le>>>8|ce<<32-8)^(le>>>7|ce<<32-7),re+=U&65535,ne+=U>>>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,U=(le>>>19|ce<<32-19)^(ce>>>61-32|le<<32-(61-32))^(le>>>6|ce<<32-6),re+=U&65535,ne+=U>>>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,U=I,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[0],U=v[0],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[0]=P=ae&65535|ie<<16,v[0]=I=re&65535|ne<<16,O=j,U=d,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[1],U=v[1],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[1]=j=ae&65535|ie<<16,v[1]=d=re&65535|ne<<16,O=H,U=x,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[2],U=v[2],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[2]=H=ae&65535|ie<<16,v[2]=x=re&65535|ne<<16,O=Z,U=J,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[3],U=v[3],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[3]=Z=ae&65535|ie<<16,v[3]=J=re&65535|ne<<16,O=N,U=W,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[4],U=v[4],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[4]=N=ae&65535|ie<<16,v[4]=W=re&65535|ne<<16,O=L,U=ee,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[5],U=v[5],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[5]=L=ae&65535|ie<<16,v[5]=ee=re&65535|ne<<16,O=$,U=de,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[6],U=v[6],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[6]=$=ae&65535|ie<<16,v[6]=de=re&65535|ne<<16,O=T,U=me,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[7],U=v[7],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[7]=T=ae&65535|ie<<16,v[7]=me=re&65535|ne<<16,_+=128,S-=128}return _}function c(l){var h=new n;h.update(l);var f=h.digest();return h.clean(),f}t.hash=c})(vp),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=Is,r=vp,n=Jr;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(Q){const Y=new Float64Array(16);if(Q)for(let z=0;z<Q.length;z++)Y[z]=Q[z];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]),f=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 S(Q,Y){for(let z=0;z<16;z++)Q[z]=Y[z]|0}function P(Q){let Y=1;for(let z=0;z<16;z++){let w=Q[z]+Y+65535;Y=Math.floor(w/65536),Q[z]=w-Y*65536}Q[0]+=Y-1+37*(Y-1)}function j(Q,Y,z){const w=~(z-1);for(let F=0;F<16;F++){const we=w&(Q[F]^Y[F]);Q[F]^=we,Y[F]^=we}}function H(Q,Y){const z=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++){z[0]=w[0]-65517;for(let ve=1;ve<15;ve++)z[ve]=w[ve]-65535-(z[ve-1]>>16&1),z[ve-1]&=65535;z[15]=w[15]-32767-(z[14]>>16&1);const we=z[15]>>16&1;z[14]&=65535,j(w,z,1-we)}for(let F=0;F<16;F++)Q[2*F]=w[F]&255,Q[2*F+1]=w[F]>>8}function Z(Q,Y){let z=0;for(let w=0;w<32;w++)z|=Q[w]^Y[w];return(1&z-1>>>8)-1}function N(Q,Y){const z=new Uint8Array(32),w=new Uint8Array(32);return H(z,Q),H(w,Y),Z(z,w)}function L(Q){const Y=new Uint8Array(32);return H(Y,Q),Y[0]&1}function $(Q,Y){for(let z=0;z<16;z++)Q[z]=Y[2*z]+(Y[2*z+1]<<8);Q[15]&=32767}function T(Q,Y,z){for(let w=0;w<16;w++)Q[w]=Y[w]+z[w]}function I(Q,Y,z){for(let w=0;w<16;w++)Q[w]=Y[w]-z[w]}function d(Q,Y,z){let w,F,we=0,ve=0,Ue=0,nt=0,at=0,Ge=0,At=0,$t=0,Je=0,He=0,ke=0,Ke=0,rt=0,je=0,Ze=0,b=0,p=0,m=0,A=0,B=0,K=0,X=0,Ee=0,Re=0,st=0,ht=0,lt=0,Ur=0,Xn=0,Oi=0,us=0,Ht=z[0],Lt=z[1],Wt=z[2],zt=z[3],Ft=z[4],Mt=z[5],nr=z[6],ir=z[7],qt=z[8],sr=z[9],Vt=z[10],Jt=z[11],Kt=z[12],Pt=z[13],or=z[14],ar=z[15];w=Y[0],we+=w*Ht,ve+=w*Lt,Ue+=w*Wt,nt+=w*zt,at+=w*Ft,Ge+=w*Mt,At+=w*nr,$t+=w*ir,Je+=w*qt,He+=w*sr,ke+=w*Vt,Ke+=w*Jt,rt+=w*Kt,je+=w*Pt,Ze+=w*or,b+=w*ar,w=Y[1],ve+=w*Ht,Ue+=w*Lt,nt+=w*Wt,at+=w*zt,Ge+=w*Ft,At+=w*Mt,$t+=w*nr,Je+=w*ir,He+=w*qt,ke+=w*sr,Ke+=w*Vt,rt+=w*Jt,je+=w*Kt,Ze+=w*Pt,b+=w*or,p+=w*ar,w=Y[2],Ue+=w*Ht,nt+=w*Lt,at+=w*Wt,Ge+=w*zt,At+=w*Ft,$t+=w*Mt,Je+=w*nr,He+=w*ir,ke+=w*qt,Ke+=w*sr,rt+=w*Vt,je+=w*Jt,Ze+=w*Kt,b+=w*Pt,p+=w*or,m+=w*ar,w=Y[3],nt+=w*Ht,at+=w*Lt,Ge+=w*Wt,At+=w*zt,$t+=w*Ft,Je+=w*Mt,He+=w*nr,ke+=w*ir,Ke+=w*qt,rt+=w*sr,je+=w*Vt,Ze+=w*Jt,b+=w*Kt,p+=w*Pt,m+=w*or,A+=w*ar,w=Y[4],at+=w*Ht,Ge+=w*Lt,At+=w*Wt,$t+=w*zt,Je+=w*Ft,He+=w*Mt,ke+=w*nr,Ke+=w*ir,rt+=w*qt,je+=w*sr,Ze+=w*Vt,b+=w*Jt,p+=w*Kt,m+=w*Pt,A+=w*or,B+=w*ar,w=Y[5],Ge+=w*Ht,At+=w*Lt,$t+=w*Wt,Je+=w*zt,He+=w*Ft,ke+=w*Mt,Ke+=w*nr,rt+=w*ir,je+=w*qt,Ze+=w*sr,b+=w*Vt,p+=w*Jt,m+=w*Kt,A+=w*Pt,B+=w*or,K+=w*ar,w=Y[6],At+=w*Ht,$t+=w*Lt,Je+=w*Wt,He+=w*zt,ke+=w*Ft,Ke+=w*Mt,rt+=w*nr,je+=w*ir,Ze+=w*qt,b+=w*sr,p+=w*Vt,m+=w*Jt,A+=w*Kt,B+=w*Pt,K+=w*or,X+=w*ar,w=Y[7],$t+=w*Ht,Je+=w*Lt,He+=w*Wt,ke+=w*zt,Ke+=w*Ft,rt+=w*Mt,je+=w*nr,Ze+=w*ir,b+=w*qt,p+=w*sr,m+=w*Vt,A+=w*Jt,B+=w*Kt,K+=w*Pt,X+=w*or,Ee+=w*ar,w=Y[8],Je+=w*Ht,He+=w*Lt,ke+=w*Wt,Ke+=w*zt,rt+=w*Ft,je+=w*Mt,Ze+=w*nr,b+=w*ir,p+=w*qt,m+=w*sr,A+=w*Vt,B+=w*Jt,K+=w*Kt,X+=w*Pt,Ee+=w*or,Re+=w*ar,w=Y[9],He+=w*Ht,ke+=w*Lt,Ke+=w*Wt,rt+=w*zt,je+=w*Ft,Ze+=w*Mt,b+=w*nr,p+=w*ir,m+=w*qt,A+=w*sr,B+=w*Vt,K+=w*Jt,X+=w*Kt,Ee+=w*Pt,Re+=w*or,st+=w*ar,w=Y[10],ke+=w*Ht,Ke+=w*Lt,rt+=w*Wt,je+=w*zt,Ze+=w*Ft,b+=w*Mt,p+=w*nr,m+=w*ir,A+=w*qt,B+=w*sr,K+=w*Vt,X+=w*Jt,Ee+=w*Kt,Re+=w*Pt,st+=w*or,ht+=w*ar,w=Y[11],Ke+=w*Ht,rt+=w*Lt,je+=w*Wt,Ze+=w*zt,b+=w*Ft,p+=w*Mt,m+=w*nr,A+=w*ir,B+=w*qt,K+=w*sr,X+=w*Vt,Ee+=w*Jt,Re+=w*Kt,st+=w*Pt,ht+=w*or,lt+=w*ar,w=Y[12],rt+=w*Ht,je+=w*Lt,Ze+=w*Wt,b+=w*zt,p+=w*Ft,m+=w*Mt,A+=w*nr,B+=w*ir,K+=w*qt,X+=w*sr,Ee+=w*Vt,Re+=w*Jt,st+=w*Kt,ht+=w*Pt,lt+=w*or,Ur+=w*ar,w=Y[13],je+=w*Ht,Ze+=w*Lt,b+=w*Wt,p+=w*zt,m+=w*Ft,A+=w*Mt,B+=w*nr,K+=w*ir,X+=w*qt,Ee+=w*sr,Re+=w*Vt,st+=w*Jt,ht+=w*Kt,lt+=w*Pt,Ur+=w*or,Xn+=w*ar,w=Y[14],Ze+=w*Ht,b+=w*Lt,p+=w*Wt,m+=w*zt,A+=w*Ft,B+=w*Mt,K+=w*nr,X+=w*ir,Ee+=w*qt,Re+=w*sr,st+=w*Vt,ht+=w*Jt,lt+=w*Kt,Ur+=w*Pt,Xn+=w*or,Oi+=w*ar,w=Y[15],b+=w*Ht,p+=w*Lt,m+=w*Wt,A+=w*zt,B+=w*Ft,K+=w*Mt,X+=w*nr,Ee+=w*ir,Re+=w*qt,st+=w*sr,ht+=w*Vt,lt+=w*Jt,Ur+=w*Kt,Xn+=w*Pt,Oi+=w*or,us+=w*ar,we+=38*p,ve+=38*m,Ue+=38*A,nt+=38*B,at+=38*K,Ge+=38*X,At+=38*Ee,$t+=38*Re,Je+=38*st,He+=38*ht,ke+=38*lt,Ke+=38*Ur,rt+=38*Xn,je+=38*Oi,Ze+=38*us,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=Ue+F+65535,F=Math.floor(w/65536),Ue=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=At+F+65535,F=Math.floor(w/65536),At=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=ke+F+65535,F=Math.floor(w/65536),ke=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=je+F+65535,F=Math.floor(w/65536),je=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=Ue+F+65535,F=Math.floor(w/65536),Ue=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=At+F+65535,F=Math.floor(w/65536),At=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=ke+F+65535,F=Math.floor(w/65536),ke=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=je+F+65535,F=Math.floor(w/65536),je=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),Q[0]=we,Q[1]=ve,Q[2]=Ue,Q[3]=nt,Q[4]=at,Q[5]=Ge,Q[6]=At,Q[7]=$t,Q[8]=Je,Q[9]=He,Q[10]=ke,Q[11]=Ke,Q[12]=rt,Q[13]=je,Q[14]=Ze,Q[15]=b}function x(Q,Y){d(Q,Y,Y)}function J(Q,Y){const z=i();let w;for(w=0;w<16;w++)z[w]=Y[w];for(w=253;w>=0;w--)x(z,z),w!==2&&w!==4&&d(z,z,Y);for(w=0;w<16;w++)Q[w]=z[w]}function W(Q,Y){const z=i();let w;for(w=0;w<16;w++)z[w]=Y[w];for(w=250;w>=0;w--)x(z,z),w!==1&&d(z,z,Y);for(w=0;w<16;w++)Q[w]=z[w]}function ee(Q,Y){const z=i(),w=i(),F=i(),we=i(),ve=i(),Ue=i(),nt=i(),at=i(),Ge=i();I(z,Q[1],Q[0]),I(Ge,Y[1],Y[0]),d(z,z,Ge),T(w,Q[0],Q[1]),T(Ge,Y[0],Y[1]),d(w,w,Ge),d(F,Q[3],Y[3]),d(F,F,f),d(we,Q[2],Y[2]),T(we,we,we),I(ve,w,z),I(Ue,we,F),T(nt,we,F),T(at,w,z),d(Q[0],ve,Ue),d(Q[1],at,nt),d(Q[2],nt,Ue),d(Q[3],ve,at)}function de(Q,Y,z){for(let w=0;w<4;w++)j(Q[w],Y[w],z)}function me(Q,Y){const z=i(),w=i(),F=i();J(F,Y[2]),d(z,Y[0],F),d(w,Y[1],F),H(Q,w),Q[31]^=L(z)<<7}function O(Q,Y,z){S(Q[0],c),S(Q[1],l),S(Q[2],l),S(Q[3],c);for(let w=255;w>=0;--w){const F=z[w/8|0]>>(w&7)&1;de(Q,Y,F),ee(Y,Q),ee(Q,Q),de(Q,Y,F)}}function U(Q,Y){const z=[i(),i(),i(),i()];S(z[0],v),S(z[1],E),S(z[2],l),d(z[3],v,E),O(Q,z,Y)}function ce(Q){if(Q.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const Y=(0,r.hash)(Q);Y[0]&=248,Y[31]&=127,Y[31]|=64;const z=new Uint8Array(32),w=[i(),i(),i(),i()];U(w,Y),me(z,w);const F=new Uint8Array(64);return F.set(Q),F.set(z,32),{publicKey:z,secretKey:F}}t.generateKeyPairFromSeed=ce;function le(Q){const Y=(0,e.randomBytes)(32,Q),z=ce(Y);return(0,n.wipe)(Y),z}t.generateKeyPair=le;function re(Q){if(Q.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(Q.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(Q,Y){let z,w,F,we;for(w=63;w>=32;--w){for(z=0,F=w-32,we=w-12;F<we;++F)Y[F]+=z-16*Y[w]*ne[F-(w-32)],z=Math.floor((Y[F]+128)/256),Y[F]-=z*256;Y[F]+=z,Y[w]=0}for(z=0,F=0;F<32;F++)Y[F]+=z-(Y[31]>>4)*ne[F],z=Y[F]>>8,Y[F]&=255;for(F=0;F<32;F++)Y[F]-=z*ne[F];for(w=0;w<32;w++)Y[w+1]+=Y[w]>>8,Q[w]=Y[w]&255}function ie(Q){const Y=new Float64Array(64);for(let z=0;z<64;z++)Y[z]=Q[z];for(let z=0;z<64;z++)Q[z]=0;ae(Q,Y)}function De(Q,Y){const z=new Float64Array(64),w=[i(),i(),i(),i()],F=(0,r.hash)(Q.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 Ue=ve.digest();ve.clean(),ie(Ue),U(w,Ue),me(we,w),ve.reset(),ve.update(we.subarray(0,32)),ve.update(Q.subarray(32)),ve.update(Y);const nt=ve.digest();ie(nt);for(let at=0;at<32;at++)z[at]=Ue[at];for(let at=0;at<32;at++)for(let Ge=0;Ge<32;Ge++)z[at+Ge]+=nt[at]*F[Ge];return ae(we.subarray(32),z),we}t.sign=De;function ge(Q,Y){const z=i(),w=i(),F=i(),we=i(),ve=i(),Ue=i(),nt=i();return S(Q[2],l),$(Q[1],Y),x(F,Q[1]),d(we,F,h),I(F,F,Q[2]),T(we,Q[2],we),x(ve,we),x(Ue,ve),d(nt,Ue,ve),d(z,nt,F),d(z,z,we),W(z,z),d(z,z,F),d(z,z,we),d(z,z,we),d(Q[0],z,we),x(w,Q[0]),d(w,w,we),N(w,F)&&d(Q[0],Q[0],_),x(w,Q[0]),d(w,w,we),N(w,F)?-1:(L(Q[0])===Y[31]>>7&&I(Q[0],c,Q[0]),d(Q[3],Q[0],Q[1]),0)}function Be(Q,Y,z){const w=new Uint8Array(32),F=[i(),i(),i(),i()],we=[i(),i(),i(),i()];if(z.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ge(we,Q))return!1;const ve=new r.SHA512;ve.update(z.subarray(0,32)),ve.update(Q),ve.update(Y);const Ue=ve.digest();return ie(Ue),O(F,we,Ue),U(we,z.subarray(32)),ee(F,we),me(w,F),!Z(z,w)}t.verify=Be;function ye(Q){let Y=[i(),i(),i(),i()];if(ge(Y,Q))throw new Error("Ed25519: invalid public key");let z=i(),w=i(),F=Y[1];T(z,l,F),I(w,l,F),J(w,w),d(z,z,w);let we=new Uint8Array(32);return H(we,z),we}t.convertPublicKeyToX25519=ye;function Me(Q){const Y=(0,r.hash)(Q.subarray(0,32));Y[0]&=248,Y[31]&=127,Y[31]|=64;const z=new Uint8Array(Y.subarray(0,32));return(0,n.wipe)(Y),z}t.convertSecretKeyToX25519=Me}(sh);const K4="EdDSA",G4="JWT",yp=".",bp="base64url",Z4="utf8",Y4="utf8",J4=":",Q4="did",X4="key",_p="base58btc",e_="z",t_="K36",r_=32;function uc(t){return Ar(Hr(zo(t),Z4),bp)}function Ep(t){const e=Hr(t_,_p),r=e_+Ar(yu([e,t]),_p);return[Q4,X4,r].join(J4)}function n_(t){return Ar(t,bp)}function i_(t){return Hr([uc(t.header),uc(t.payload)].join(yp),Y4)}function s_(t){return[uc(t.header),uc(t.payload),n_(t.signature)].join(yp)}function xp(t=Is.randomBytes(r_)){return sh.generateKeyPairFromSeed(t)}async function o_(t,e,r,n,i=Te.fromMiliseconds(Date.now())){const o={alg:K4,typ:G4},c=Ep(n.publicKey),l=i+r,h={iss:c,sub:t,aud:e,iat:i,exp:l},f=i_({header:o,payload:h}),v=sh.sign(n.secretKey,f);return s_({header:o,payload:h,signature:v})}const a_="PARSE_ERROR",c_="INVALID_REQUEST",l_="METHOD_NOT_FOUND",u_="INVALID_PARAMS",Cp="INTERNAL_ERROR",oh="SERVER_ERROR",h_=[-32700,-32600,-32601,-32602,-32603],qo={[a_]:{code:-32700,message:"Parse error"},[c_]:{code:-32600,message:"Invalid Request"},[l_]:{code:-32601,message:"Method not found"},[u_]:{code:-32602,message:"Invalid params"},[Cp]:{code:-32603,message:"Internal error"},[oh]:{code:-32e3,message:"Server error"}},Ip=oh;function f_(t){return h_.includes(t)}function Sp(t){return Object.keys(qo).includes(t)?qo[t]:qo[Ip]}function d_(t){const e=Object.values(qo).find(r=>r.code===t);return e||qo[Ip]}function Op(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Dp={};/*! *****************************************************************************
|
|
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 sh=function(t,e){return sh=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])},sh(t,e)};function h_(t,e){sh(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var oh=function(){return oh=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},oh.apply(this,arguments)};function f_(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 d_(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 p_(t,e){return function(r,n){e(r,n,t)}}function g_(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function m_(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{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function w_(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(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function v_(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function y_(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ah(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 Dp(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 b_(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Dp(arguments[e]));return t}function __(){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 zo(t){return this instanceof zo?(this.v=t,this):new zo(t)}function E_(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(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof zo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function x_(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:zo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function C_(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 ah=="function"?ah(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(f){o({value:f,done:l})},c)}}function I_(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function S_(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 O_(t){return t&&t.__esModule?t:{default:t}}function D_(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function A_(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 $_=Object.freeze({__proto__:null,__extends:h_,get __assign(){return oh},__rest:f_,__decorate:d_,__param:p_,__metadata:g_,__awaiter:m_,__generator:w_,__createBinding:v_,__exportStar:y_,__values:ah,__read:Dp,__spread:b_,__spreadArrays:__,__await:zo,__asyncGenerator:E_,__asyncDelegator:x_,__asyncValues:C_,__makeTemplateObject:I_,__importStar:S_,__importDefault:O_,__classPrivateFieldGet:D_,__classPrivateFieldSet:A_}),P_=Fi($_),qn={},Ap;function T_(){if(Ap)return qn;Ap=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.isBrowserCryptoAvailable=qn.getSubtleCrypto=qn.getBrowerCrypto=void 0;function t(){return dr?.crypto||dr?.msCrypto||{}}qn.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}qn.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return qn.isBrowserCryptoAvailable=r,qn}var Vn={},$p;function R_(){if($p)return Vn;$p=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.isBrowser=Vn.isNode=Vn.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Vn.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Vn.isNode=e;function r(){return!t()&&!e()}return Vn.isBrowser=r,Vn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=P_;e.__exportStar(T_(),t),e.__exportStar(R_(),t)})(Op);function ch(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Pp(t=6){return BigInt(ch(t))}function qo(t,e,r){return{id:r||ch(),jsonrpc:"2.0",method:t,params:e}}function lh(t,e){return{id:t,jsonrpc:"2.0",result:e}}function lc(t,e,r){return{id:t,jsonrpc:"2.0",error:N_(e,r)}}function N_(t,e){return typeof t>"u"?Ip(xp):(typeof t=="string"&&(t=Object.assign(Object.assign({},Ip(ih)),{message:t})),typeof e<"u"&&(t.data=e),l_(t.code)&&(t=u_(t.code)),t)}class L_{}class M_ extends L_{constructor(){super()}}class U_ extends M_{constructor(e){super()}}const j_="^https?:",F_="^wss?:";function B_(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Tp(t,e){const r=B_(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Rp(t){return Tp(t,j_)}function Np(t){return Tp(t,F_)}function k_(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Lp(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function uh(t){return Lp(t)&&"method"in t}function uc(t){return Lp(t)&&(Kn(t)||Cn(t))}function Kn(t){return"result"in t}function Cn(t){return"error"in t}class pi extends U_{constructor(e){super(e),this.events=new yr.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(qo(e.method,e.params||[],e.id||Pp().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=>{Cn(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),uc(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 H_=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),W_=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Mp=t=>t.split("?")[0],Up=10,z_=H_();class q_{constructor(e){if(this.url=e,this.events=new yr.exports.EventEmitter,this.registering=!1,!Np(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(Ho(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!Np(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=Op.isReactNative()?void 0:{rejectUnauthorized:!k_(e)},o=new z_(e,[],i);W_()?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"?rh(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=lc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return Sp(e,Mp(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Up&&this.events.setMaxListeners(Up)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Mp(this.url)}`));return this.events.emit("register_error",r),r}}var hh={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,c=9007199254740991,l="[object Arguments]",h="[object Array]",f="[object AsyncFunction]",v="[object Boolean]",E="[object Date]",_="[object Error]",S="[object Function]",P="[object GeneratorFunction]",j="[object Map]",H="[object Number]",Z="[object Null]",N="[object Object]",L="[object Promise]",$="[object Proxy]",T="[object RegExp]",I="[object Set]",d="[object String]",x="[object Symbol]",J="[object Undefined]",W="[object WeakMap]",ee="[object ArrayBuffer]",de="[object DataView]",me="[object Float32Array]",O="[object Float64Array]",U="[object Int8Array]",ce="[object Int16Array]",le="[object Int32Array]",re="[object Uint8Array]",ne="[object Uint8ClampedArray]",ae="[object Uint16Array]",ie="[object Uint32Array]",De=/[\\^$.*+?()[\]{}|]/g,ge=/^\[object .+?Constructor\]$/,Be=/^(?:0|[1-9]\d*)$/,ye={};ye[me]=ye[O]=ye[U]=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[S]=ye[j]=ye[H]=ye[N]=ye[T]=ye[I]=ye[d]=ye[W]=!1;var Me=typeof dr=="object"&&dr&&dr.Object===Object&&dr,Q=typeof self=="object"&&self&&self.Object===Object&&self,Y=Me||Q||Function("return this")(),z=e&&!e.nodeType&&e,w=z&&!0&&t&&!t.nodeType&&t,F=w&&w.exports===z,we=F&&Me.process,ve=function(){try{return we&&we.binding&&we.binding("util")}catch{}}(),Ue=ve&&ve.isTypedArray;function nt(R,q){for(var fe=-1,Ce=R==null?0:R.length,It=0,Qe=[];++fe<Ce;){var Tt=R[fe];q(Tt,fe,R)&&(Qe[It++]=Tt)}return Qe}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 At(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 ke(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 je=Array.prototype,Ze=Function.prototype,b=Object.prototype,p=Y["__core-js_shared__"],m=Ze.toString,A=b.hasOwnProperty,B=function(){var R=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return R?"Symbol(src)_1."+R:""}(),K=b.toString,X=RegExp("^"+m.call(A).replace(De,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=F?Y.Buffer:void 0,Re=Y.Symbol,st=Y.Uint8Array,ht=b.propertyIsEnumerable,lt=je.splice,Ur=Re?Re.toStringTag:void 0,ei=Object.getOwnPropertySymbols,Di=Ee?Ee.isBuffer:void 0,us=Ke(Object.keys,Object),Ht=tn(Y,"DataView"),Lt=tn(Y,"Map"),Wt=tn(Y,"Promise"),zt=tn(Y,"Set"),Ft=tn(Y,"WeakMap"),Mt=tn(Object,"create"),nr=ri(Ht),ir=ri(Lt),qt=ri(Wt),sr=ri(zt),Vt=ri(Ft),Jt=Re?Re.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 or(){this.__data__=Mt?Mt(null):{},this.size=0}function ar(R){var q=this.has(R)&&delete this.__data__[R];return this.size-=q?1:0,q}function Kf(R){var q=this.__data__;if(Mt){var fe=q[R];return fe===n?void 0:fe}return A.call(q,R)?q[R]:void 0}function Gf(R){var q=this.__data__;return Mt?q[R]!==void 0:A.call(q,R)}function Zf(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=or,Pt.prototype.delete=ar,Pt.prototype.get=Kf,Pt.prototype.has=Gf,Pt.prototype.set=Zf;function dn(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 Yf(){this.__data__=[],this.size=0}function Jf(R){var q=this.__data__,fe=hs(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 Qf(R){var q=this.__data__,fe=hs(q,R);return fe<0?void 0:q[fe][1]}function Xf(R){return hs(this.__data__,R)>-1}function e0(R,q){var fe=this.__data__,Ce=hs(fe,R);return Ce<0?(++this.size,fe.push([R,q])):fe[Ce][1]=q,this}dn.prototype.clear=Yf,dn.prototype.delete=Jf,dn.prototype.get=Qf,dn.prototype.has=Xf,dn.prototype.set=e0;function ti(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 to(){this.size=0,this.__data__={hash:new Pt,map:new(Lt||dn),string:new Pt}}function t0(R){var q=Ai(this,R).delete(R);return this.size-=q?1:0,q}function ro(R){return Ai(this,R).get(R)}function r0(R){return Ai(this,R).has(R)}function n0(R,q){var fe=Ai(this,R),Ce=fe.size;return fe.set(R,q),this.size+=fe.size==Ce?0:1,this}ti.prototype.clear=to,ti.prototype.delete=t0,ti.prototype.get=ro,ti.prototype.has=r0,ti.prototype.set=n0;function no(R){var q=-1,fe=R==null?0:R.length;for(this.__data__=new ti;++q<fe;)this.add(R[q])}function il(R){return this.__data__.set(R,n),this}function sl(R){return this.__data__.has(R)}no.prototype.add=no.prototype.push=il,no.prototype.has=sl;function In(R){var q=this.__data__=new dn(R);this.size=q.size}function i0(){this.__data__=new dn,this.size=0}function s0(R){var q=this.__data__,fe=q.delete(R);return this.size=q.size,fe}function o0(R){return this.__data__.get(R)}function a0(R){return this.__data__.has(R)}function ol(R,q){var fe=this.__data__;if(fe instanceof dn){var Ce=fe.__data__;if(!Lt||Ce.length<r-1)return Ce.push([R,q]),this.size=++fe.size,this;fe=this.__data__=new ti(Ce)}return fe.set(R,q),this.size=fe.size,this}In.prototype.clear=i0,In.prototype.delete=s0,In.prototype.get=o0,In.prototype.has=a0,In.prototype.set=ol;function al(R,q){var fe=oo(R),Ce=!fe&&yl(R),It=!fe&&!Ce&&Sa(R),Qe=!fe&&!Ce&&!It&&El(R),Tt=fe||Ce||It||Qe,cr=Tt?At(R.length,String):[],mt=cr.length;for(var St in R)(q||A.call(R,St))&&!(Tt&&(St=="length"||It&&(St=="offset"||St=="parent")||Qe&&(St=="buffer"||St=="byteLength"||St=="byteOffset")||pl(St,mt)))&&cr.push(St);return cr}function hs(R,q){for(var fe=R.length;fe--;)if(vl(R[fe][0],q))return fe;return-1}function Ca(R,q,fe){var Ce=q(R);return oo(R)?Ce:at(Ce,fe(R))}function fs(R){return R==null?R===void 0?J:Z:Ur&&Ur in Object(R)?fl(R):u0(R)}function Ia(R){return ps(R)&&fs(R)==l}function ds(R,q,fe,Ce,It){return R===q?!0:R==null||q==null||!ps(R)&&!ps(q)?R!==R&&q!==q:cl(R,q,fe,Ce,ds,It)}function cl(R,q,fe,Ce,It,Qe){var Tt=oo(R),cr=oo(q),mt=Tt?h:Bn(R),St=cr?h:Bn(q);mt=mt==l?N:mt,St=St==l?N:St;var Qt=mt==N,Vr=St==N,lr=mt==St;if(lr&&Sa(R)){if(!Sa(q))return!1;Tt=!0,Qt=!1}if(lr&&!Qt)return Qe||(Qe=new In),Tt||El(R)?io(R,q,fe,Ce,It,Qe):l0(R,q,mt,fe,Ce,It,Qe);if(!(fe&i)){var Rt=Qt&&A.call(R,"__wrapped__"),jr=Vr&&A.call(q,"__wrapped__");if(Rt||jr){var Sn=Rt?R.value():R,pn=jr?q.value():q;return Qe||(Qe=new In),It(Sn,pn,fe,Ce,Qe)}}return lr?(Qe||(Qe=new In),hl(R,q,fe,Ce,It,Qe)):!1}function c0(R){if(!_l(R)||ml(R))return!1;var q=ao(R)?X:ge;return q.test(ri(R))}function ll(R){return ps(R)&&bl(R.length)&&!!ye[fs(R)]}function ul(R){if(!wl(R))return us(R);var q=[];for(var fe in Object(R))A.call(R,fe)&&fe!="constructor"&&q.push(fe);return q}function io(R,q,fe,Ce,It,Qe){var Tt=fe&i,cr=R.length,mt=q.length;if(cr!=mt&&!(Tt&&mt>cr))return!1;var St=Qe.get(R);if(St&&Qe.get(q))return St==q;var Qt=-1,Vr=!0,lr=fe&o?new no:void 0;for(Qe.set(R,q),Qe.set(q,R);++Qt<cr;){var Rt=R[Qt],jr=q[Qt];if(Ce)var Sn=Tt?Ce(jr,Rt,Qt,q,R,Qe):Ce(Rt,jr,Qt,R,q,Qe);if(Sn!==void 0){if(Sn)continue;Vr=!1;break}if(lr){if(!Ge(q,function(pn,kn){if(!Je(lr,kn)&&(Rt===pn||It(Rt,pn,fe,Ce,Qe)))return lr.push(kn)})){Vr=!1;break}}else if(!(Rt===jr||It(Rt,jr,fe,Ce,Qe))){Vr=!1;break}}return Qe.delete(R),Qe.delete(q),Vr}function l0(R,q,fe,Ce,It,Qe,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||!Qe(new st(R),new st(q)));case v:case E:case H:return vl(+R,+q);case _:return R.name==q.name&&R.message==q.message;case T:case d:return R==q+"";case j:var cr=ke;case I:var mt=Ce&i;if(cr||(cr=rt),R.size!=q.size&&!mt)return!1;var St=Tt.get(R);if(St)return St==q;Ce|=o,Tt.set(R,q);var Qt=io(cr(R),cr(q),Ce,It,Qe,Tt);return Tt.delete(R),Qt;case x:if(Kt)return Kt.call(R)==Kt.call(q)}return!1}function hl(R,q,fe,Ce,It,Qe){var Tt=fe&i,cr=so(R),mt=cr.length,St=so(q),Qt=St.length;if(mt!=Qt&&!Tt)return!1;for(var Vr=mt;Vr--;){var lr=cr[Vr];if(!(Tt?lr in q:A.call(q,lr)))return!1}var Rt=Qe.get(R);if(Rt&&Qe.get(q))return Rt==q;var jr=!0;Qe.set(R,q),Qe.set(q,R);for(var Sn=Tt;++Vr<mt;){lr=cr[Vr];var pn=R[lr],kn=q[lr];if(Ce)var Oa=Tt?Ce(kn,pn,lr,q,R,Qe):Ce(pn,kn,lr,R,q,Qe);if(!(Oa===void 0?pn===kn||It(pn,kn,fe,Ce,Qe):Oa)){jr=!1;break}Sn||(Sn=lr=="constructor")}if(jr&&!Sn){var gs=R.constructor,wr=q.constructor;gs!=wr&&"constructor"in R&&"constructor"in q&&!(typeof gs=="function"&&gs instanceof gs&&typeof wr=="function"&&wr instanceof wr)&&(jr=!1)}return Qe.delete(R),Qe.delete(q),jr}function so(R){return Ca(R,d0,dl)}function Ai(R,q){var fe=R.__data__;return gl(q)?fe[typeof q=="string"?"string":"hash"]:fe.map}function tn(R,q){var fe=He(R,q);return c0(fe)?fe:void 0}function fl(R){var q=A.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 dl=ei?function(R){return R==null?[]:(R=Object(R),nt(ei(R),function(q){return ht.call(R,q)}))}:Ct,Bn=fs;(Ht&&Bn(new Ht(new ArrayBuffer(1)))!=de||Lt&&Bn(new Lt)!=j||Wt&&Bn(Wt.resolve())!=L||zt&&Bn(new zt)!=I||Ft&&Bn(new Ft)!=W)&&(Bn=function(R){var q=fs(R),fe=q==N?R.constructor:void 0,Ce=fe?ri(fe):"";if(Ce)switch(Ce){case nr:return de;case ir:return j;case qt:return L;case sr:return I;case Vt:return W}return q});function pl(R,q){return q=q??c,!!q&&(typeof R=="number"||Be.test(R))&&R>-1&&R%1==0&&R<q}function gl(R){var q=typeof R;return q=="string"||q=="number"||q=="symbol"||q=="boolean"?R!=="__proto__":R===null}function ml(R){return!!B&&B in R}function wl(R){var q=R&&R.constructor,fe=typeof q=="function"&&q.prototype||b;return R===fe}function u0(R){return K.call(R)}function ri(R){if(R!=null){try{return m.call(R)}catch{}try{return R+""}catch{}}return""}function vl(R,q){return R===q||R!==R&&q!==q}var yl=Ia(function(){return arguments}())?Ia:function(R){return ps(R)&&A.call(R,"callee")&&!ht.call(R,"callee")},oo=Array.isArray;function h0(R){return R!=null&&bl(R.length)&&!ao(R)}var Sa=Di||xt;function f0(R,q){return ds(R,q)}function ao(R){if(!_l(R))return!1;var q=fs(R);return q==S||q==P||q==f||q==$}function bl(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=c}function _l(R){var q=typeof R;return R!=null&&(q=="object"||q=="function")}function ps(R){return R!=null&&typeof R=="object"}var El=Ue?$t(Ue):ll;function d0(R){return h0(R)?al(R):ul(R)}function Ct(){return[]}function xt(){return!1}t.exports=f0})(hh,hh.exports);var V_=hh.exports,K_=Object.defineProperty,jp=Object.getOwnPropertySymbols,G_=Object.prototype.hasOwnProperty,Z_=Object.prototype.propertyIsEnumerable,Fp=(t,e,r)=>e in t?K_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rr=(t,e)=>{for(var r in e||(e={}))G_.call(e,r)&&Fp(t,r,e[r]);if(jp)for(var r of jp(e))Z_.call(e,r)&&Fp(t,r,e[r]);return t};function Y_(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),f=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 j=0,H=0,Z=0,N=P.length;Z!==N&&P[Z]===0;)Z++,j++;for(var L=(N-Z)*v+1>>>0,$=new Uint8Array(L);Z!==N;){for(var T=P[Z],I=0,d=L-1;(T!==0||I<H)&&d!==-1;d--,I++)T+=256*$[d]>>>0,$[d]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,Z++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(j);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 j=0;if(P[j]!==" "){for(var H=0,Z=0;P[j]===h;)H++,j++;for(var N=(P.length-j)*f+1>>>0,L=new Uint8Array(N);P[j];){var $=r[P.charCodeAt(j)];if($===255)return;for(var T=0,I=N-1;($!==0||T<Z)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");Z=T,j++}if(P[j]!==" "){for(var d=N-Z;d!==N&&L[d]===0;)d++;for(var x=new Uint8Array(H+(N-d)),J=H;d!==N;)x[J++]=L[d++];return x}}}function S(P){var j=_(P);if(j)return j;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:S}}var J_=Y_,Q_=J_;const Bp=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")},X_=t=>new TextEncoder().encode(t),e8=t=>new TextDecoder().decode(t);class t8{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 r8{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 kp(this,e)}}class n8{constructor(e){this.decoders=e}or(e){return kp(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 kp=(t,e)=>new n8(Rr(Rr({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class i8{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new t8(e,r,n),this.decoder=new r8(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const hc=({name:t,prefix:e,encode:r,decode:n})=>new i8(t,e,r,n),Vo=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Q_(r,e);return hc({prefix:t,name:e,encode:n,decode:o=>Bp(i(o))})},s8=(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,f=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[f++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},o8=(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})=>hc({prefix:e,name:t,encode(i){return o8(i,n,r)},decode(i){return s8(i,n,r,t)}}),a8=hc({prefix:"\0",name:"identity",encode:t=>e8(t),decode:t=>X_(t)});var c8=Object.freeze({__proto__:null,identity:a8});const l8=_r({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var u8=Object.freeze({__proto__:null,base2:l8});const h8=_r({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var f8=Object.freeze({__proto__:null,base8:h8});const d8=Vo({prefix:"9",name:"base10",alphabet:"0123456789"});var p8=Object.freeze({__proto__:null,base10:d8});const g8=_r({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),m8=_r({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var w8=Object.freeze({__proto__:null,base16:g8,base16upper:m8});const v8=_r({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),y8=_r({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),b8=_r({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),_8=_r({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),E8=_r({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),x8=_r({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),C8=_r({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),I8=_r({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),S8=_r({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var O8=Object.freeze({__proto__:null,base32:v8,base32upper:y8,base32pad:b8,base32padupper:_8,base32hex:E8,base32hexupper:x8,base32hexpad:C8,base32hexpadupper:I8,base32z:S8});const D8=Vo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),A8=Vo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var $8=Object.freeze({__proto__:null,base36:D8,base36upper:A8});const P8=Vo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),T8=Vo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var R8=Object.freeze({__proto__:null,base58btc:P8,base58flickr:T8});const N8=_r({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),L8=_r({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),M8=_r({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),U8=_r({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var j8=Object.freeze({__proto__:null,base64:N8,base64pad:L8,base64url:M8,base64urlpad:U8});const Hp=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}"),F8=Hp.reduce((t,e,r)=>(t[r]=e,t),[]),B8=Hp.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function k8(t){return t.reduce((e,r)=>(e+=F8[r],e),"")}function H8(t){const e=[];for(const r of t){const n=B8[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const W8=hc({prefix:"\u{1F680}",name:"base256emoji",encode:k8,decode:H8});var z8=Object.freeze({__proto__:null,base256emoji:W8}),q8=zp,Wp=128,V8=127,K8=~V8,G8=Math.pow(2,31);function zp(t,e,r){e=e||[],r=r||0;for(var n=r;t>=G8;)e[r++]=t&255|Wp,t/=128;for(;t&K8;)e[r++]=t&255|Wp,t>>>=7;return e[r]=t|0,zp.bytes=r-n+1,e}var Z8=fh,Y8=128,qp=127;function fh(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw fh.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&qp)<<i:(c&qp)*Math.pow(2,i),i+=7}while(c>=Y8);return fh.bytes=o-n,r}var J8=Math.pow(2,7),Q8=Math.pow(2,14),X8=Math.pow(2,21),eE=Math.pow(2,28),tE=Math.pow(2,35),rE=Math.pow(2,42),nE=Math.pow(2,49),iE=Math.pow(2,56),sE=Math.pow(2,63),oE=function(t){return t<J8?1:t<Q8?2:t<X8?3:t<eE?4:t<tE?5:t<rE?6:t<nE?7:t<iE?8:t<sE?9:10},aE={encode:q8,decode:Z8,encodingLength:oE},Vp=aE;const Kp=(t,e,r=0)=>(Vp.encode(t,e,r),e),Gp=t=>Vp.encodingLength(t),dh=(t,e)=>{const r=e.byteLength,n=Gp(t),i=n+Gp(r),o=new Uint8Array(i+r);return Kp(t,o,0),Kp(r,o,n),o.set(e,i),new cE(t,r,e,o)};class cE{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 lE(t,e,r);class lE{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?dh(this.code,r):r.then(n=>dh(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Yp=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),uE=Zp({name:"sha2-256",code:18,encode:Yp("SHA-256")}),hE=Zp({name:"sha2-512",code:19,encode:Yp("SHA-512")});var fE=Object.freeze({__proto__:null,sha256:uE,sha512:hE});const Jp=0,dE="identity",Qp=Bp;var pE=Object.freeze({__proto__:null,identity:{code:Jp,name:dE,encode:Qp,digest:t=>dh(Jp,Qp(t))}});new TextEncoder,new TextDecoder;const Xp=Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr({},c8),u8),f8),p8),w8),O8),$8),R8),j8),z8);Rr(Rr({},fE),pE);function eg(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function gE(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?eg(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function tg(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const rg=tg("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),ph=tg("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=gE(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),mE=Rr({utf8:rg,"utf-8":rg,hex:Xp.base16,latin1:ph,ascii:ph,binary:ph},Xp);function wE(t,e="utf8"){const r=mE[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?eg(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const ng="wc",vE=2,gh="core",gi=`${ng}@2:${gh}:`,yE={name:gh,logger:"error"},bE={database:":memory:"},_E="crypto",ig="client_ed25519_seed",EE=Te.ONE_DAY,xE="keychain",CE="0.3",IE="messages",SE="0.3",OE=Te.SIX_HOURS,DE="publisher",sg="irn",AE="error",og="wss://relay.walletconnect.com",ag="wss://relay.walletconnect.org",$E="relayer",Ir={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",Gn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},TE=Te.ONE_SECOND,RE="2.10.0",NE=1e4,LE="0.3",ME="WALLETCONNECT_CLIENT_ID",Rn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},UE="subscription",jE="0.3",FE=Te.FIVE_SECONDS*1e3,BE="pairing",kE="0.3",Ko={wc_pairingDelete:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:0},res:{ttl:Te.ONE_DAY,prompt:!1,tag:0}}},Nn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},HE="history",WE="0.3",zE="expirer",cn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},qE="0.3",mh="verify-api",fc="https://verify.walletconnect.com",cg="https://verify.walletconnect.org";class VE{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=xE,this.version=CE,this.initialized=!1,this.storagePrefix=gi,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,M1(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?U1(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 KE{constructor(e,r,n){this.core=e,this.logger=r,this.name=_E,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=Ep(i);return _p(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=G5();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=Ep(o),l=Lu();return await n_(l,i,EE,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),h=Z5(l,o);return this.setSymKey(h,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||Y5(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=P1(c),h=Ho(o);if(T1(l)){const _=l.senderPublicKey,S=l.receiverPublicKey;i=await this.generateSharedKey(_,S)}const f=this.getSymKey(i),{type:v,senderPublicKey:E}=l;return Q5({type:v,symKey:f,message:h,senderPublicKey:E})},this.decode=async(i,o,c)=>{this.isInitialized();const l=tb(o,c);if(T1(l)){const h=l.receiverPublicKey,f=l.senderPublicKey;i=await this.generateSharedKey(h,f)}try{const h=this.getSymKey(i),f=X5({symKey:h,encoded:o});return rh(f)}catch(h){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(h)}},this.getPayloadType=i=>{const o=ec(i);return Do(o.type)},this.getPayloadSenderPublicKey=i=>{const o=ec(i);return o.senderPublicKey?Ar(o.senderPublicKey,$r):void 0},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.keychain=n||new VE(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(ig)}catch{e=Lu(),await this.keychain.set(ig,e)}return wE(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 GE extends R4{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=IE,this.version=SE,this.initialized=!1,this.storagePrefix=gi,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=Ds(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=Ds(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,M1(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?U1(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 ZE extends N4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new yr.exports.EventEmitter,this.name=DE,this.queue=new Map,this.publishTimeout=Te.toMiliseconds(Te.TEN_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,i,o)=>{var c;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});try{const l=o?.ttl||OE,h=ju(o),f=o?.prompt||!1,v=o?.tag||0,E=o?.id||Pp().toString(),_={topic:n,message:i,opts:{ttl:l,relay:h,prompt:f,tag:v,id:E}},S=setTimeout(()=>this.queue.set(E,_),this.publishTimeout);try{await await Po(this.rpcPublish(n,i,l,h,f,v,E),this.publishTimeout,"Failed to publish payload, please try again."),this.removeRequestFromQueue(E),this.relayer.events.emit(Ir.publish,_)}catch(P){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(c=o?.internal)!=null&&c.throwOnFailedPublish)throw this.removeRequestFromQueue(E),P;return}finally{clearTimeout(S)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}})}catch(l){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(l),l}},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,f,v,E;const _={method:rc(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)&&((f=_.params)==null||delete f.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(_)}removeRequestFromQueue(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(Rs.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ir.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ir.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class YE{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 JE=Object.defineProperty,QE=Object.defineProperties,XE=Object.getOwnPropertyDescriptors,lg=Object.getOwnPropertySymbols,e7=Object.prototype.hasOwnProperty,t7=Object.prototype.propertyIsEnumerable,ug=(t,e,r)=>e in t?JE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Go=(t,e)=>{for(var r in e||(e={}))e7.call(e,r)&&ug(t,r,e[r]);if(lg)for(var r of lg(e))t7.call(e,r)&&ug(t,r,e[r]);return t},wh=(t,e)=>QE(t,XE(e));class r7 extends U4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new YE,this.events=new yr.exports.EventEmitter,this.name=UE,this.version=jE,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=gi,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),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=ju(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 Te.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)>=FE&&(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=ju(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:rc(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Po(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ir.connection_stalled)}return Ds(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:rc(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 Po(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Ir.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:rc(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,wh(Go({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Go({},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,Go({},r)),this.topicMap.set(r.topic,e),this.events.emit(Rn.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(Rn.deleted,wh(Go({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Rn.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(Rn.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);Tn(r)&&this.onBatchSubscribe(r.map((n,i)=>wh(Go({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Rs.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Ir.connect,async()=>{await this.onConnect()}),this.relayer.on(Ir.disconnect,()=>{this.onDisconnect()}),this.events.on(Rn.created,async e=>{const r=Rn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Rn.deleted,async e=>{const r=Rn.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 n7=Object.defineProperty,hg=Object.getOwnPropertySymbols,i7=Object.prototype.hasOwnProperty,s7=Object.prototype.propertyIsEnumerable,fg=(t,e,r)=>e in t?n7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,o7=(t,e)=>{for(var r in e||(e={}))i7.call(e,r)&&fg(t,r,e[r]);if(hg)for(var r of hg(e))s7.call(e,r)&&fg(t,r,e[r]);return t};class a7 extends L4{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new yr.exports.EventEmitter,this.name=$E,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,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.onPayloadHandler=r=>{this.onProviderPayload(r)},this.onConnectHandler=()=>{this.events.emit(Ir.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Ir.error,r)},this.registerProviderListeners=()=>{this.provider.on(Gn.payload,this.onPayloadHandler),this.provider.on(Gn.connect,this.onConnectHandler),this.provider.on(Gn.disconnect,this.onDisconnectHandler),this.provider.on(Gn.error,this.onProviderErrorHandler)},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||AE})),this.messages=new GE(this.logger,e.core),this.subscriber=new r7(this,this.logger),this.publisher=new ZE(this,this.logger),this.relayUrl=e?.relayUrl||og,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${ag}...`),await this.restartTransport(ag)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},NE)}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(Rn.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.hasExperiencedNetworkDisruption&&this.connected?await Po(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(e){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(r=>{if(!this.initialized)return r();this.subscriber.once(Rn.resubscribed,()=>{r()})}),new Promise(async(r,n)=>{try{await Po(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(i){n(i);return}r()})])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.provider.events.emit(Gn.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(e){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await G1())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new pi(new q_(fb({sdkVersion:RE,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;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),uh(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(o7({type:"event",event:r.id},c)),this.events.emit(r.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else uc(e)&&this.events.emit(Ir.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Ir.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=lh(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Gn.payload,this.onPayloadHandler),this.provider.off(Gn.connect,this.onConnectHandler),this.provider.off(Gn.disconnect,this.onDisconnectHandler),this.provider.off(Gn.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(Ir.connection_stalled,()=>{this.restartTransport().catch(r=>this.logger.error(r))});let e=await G1();i6(async r=>{this.initialized&&e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(n=>this.logger.error(n))))})}onProviderDisconnect(){this.events.emit(Ir.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},Te.toMiliseconds(TE)))}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var c7=Object.defineProperty,dg=Object.getOwnPropertySymbols,l7=Object.prototype.hasOwnProperty,u7=Object.prototype.propertyIsEnumerable,pg=(t,e,r)=>e in t?c7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gg=(t,e)=>{for(var r in e||(e={}))l7.call(e,r)&&pg(t,r,e[r]);if(dg)for(var r of dg(e))u7.call(e,r)&&pg(t,r,e[r]);return t};class dc extends M4{constructor(e,r,n,i=gi,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=LE,this.cached=[],this.initialized=!1,this.storagePrefix=gi,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):Lb(c)?this.map.set(c.id,c):Mb(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=>V_(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=gg(gg({},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 h7{constructor(e,r){this.core=e,this.logger=r,this.name=BE,this.version=kE,this.events=new yr.exports,this.initialized=!1,this.storagePrefix=gi,this.ignoredPayloadTypes=[Wi],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=Lu(),i=await this.core.crypto.setSymKey(n),o=xn(Te.FIVE_MINUTES),c={protocol:sg},l={topic:i,expiry:o,relay:c,active:!1},h=Ib({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}=Eb(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=xn(Te.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=xn(Te.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:f})=>{f?h(f):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=qo(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=lh(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),f=Ko[h.request.method].res;await this.core.relayer.publish(i,l,f),await this.core.history.resolve(c)},this.sendError=async(n,i,o)=>{const c=lc(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),f=Ko[h.request.method]?Ko[h.request.method].res:Ko.unregistered_method.res;await this.core.relayer.publish(i,l,f),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=>di(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:o}=n;switch(o.method){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;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(()=>{Kn(i)?this.events.emit(tr("pairing_ping",o),{}):Cn(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(!Wr(n)){const{message:i}=_e("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Nb(n.uri)){const{message:i}=_e("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!Wr(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(!Wr(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(!pr(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(di(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 dc(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(Ir.message,async e=>{const{topic:r,message:n}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);try{uh(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):uc(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(cn.expired,async e=>{const{topic:r}=F1(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class f7 extends T4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new yr.exports.EventEmitter,this.name=HE,this.version=WE,this.cached=[],this.initialized=!1,this.storagePrefix=gi,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,expiry:xn(Te.THIRTY_DAYS)};this.records.set(c.id,c),this.events.emit(Nn.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=Cn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(Nn.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(Nn.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:qo(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(Nn.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(Nn.created,e=>{const r=Nn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Nn.updated,e=>{const r=Nn.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Nn.deleted,e=>{const r=Nn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.core.heartbeat.on(Rs.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{Te.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class d7 extends j4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new yr.exports.EventEmitter,this.name=zE,this.version=qE,this.cached=[],this.initialized=!1,this.storagePrefix=gi,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(cn.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(cn.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 db(e);if(typeof e=="number")return pb(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(cn.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;Te.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(cn.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Rs.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(cn.created,e=>{const r=cn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(cn.expired,e=>{const r=cn.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(cn.deleted,e=>{const r=cn.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 p7 extends F4{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=mh,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||tc()||!Ao())return;const i=n?.verifyUrl||fc;this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(o){this.logger.warn(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.warn(o)}if(!this.initialized){this.removeIframe(),this.verifyUrl=cg;try{await this.createIframe()}catch(o){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(o),this.verifyDisabled=!0}}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const i=n?.verifyUrl||fc;let o="";try{o=await this.fetchAttestation(n.attestationId,i)}catch(c){this.logger.warn(`failed to resolve attestation: ${n.attestationId} from url: ${i}`),this.logger.warn(c),o=await this.fetchAttestation(n.attestationId,cg)}return o},this.fetchAttestation=async(n,i)=>{var o;this.logger.info(`resolving attestation: ${n} from url: ${i}`);const c=this.startAbortTimer(Te.ONE_SECOND*2),l=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(c),l.status===200?(o=await l.json())==null?void 0:o.origin:""},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var i;try{if(!this.iframe)return;(i=this.iframe.contentWindow)==null||i.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const i=o=>{o.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(o=>{if(document.getElementById(mh))return o();window.addEventListener("message",i);const c=document.createElement("iframe");c.id=mh,c.src=`${this.verifyUrl}/${this.projectId}`,c.style.display="none",document.body.append(c),this.iframe=c,n=o}),new Promise((o,c)=>setTimeout(()=>{window.removeEventListener("message",i),c("verify iframe load timeout")},Te.toMiliseconds(Te.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.logger=pt.generateChildLogger(r,this.name),this.verifyUrl=fc,this.abortController=new AbortController,this.isDevEnv=Mu()&&process.env.IS_VITEST}get context(){return pt.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Te.toMiliseconds(e))}}var g7=Object.defineProperty,mg=Object.getOwnPropertySymbols,m7=Object.prototype.hasOwnProperty,w7=Object.prototype.propertyIsEnumerable,wg=(t,e,r)=>e in t?g7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vg=(t,e)=>{for(var r in e||(e={}))m7.call(e,r)&&wg(t,r,e[r]);if(mg)for(var r of mg(e))w7.call(e,r)&&wg(t,r,e[r]);return t};class vh extends P4{constructor(e){super(e),this.protocol=ng,this.version=vE,this.name=gh,this.events=new yr.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||og;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||yE.logger}));this.logger=pt.generateChildLogger(r,this.name),this.heartbeat=new Rs.HeartBeat,this.crypto=new KE(this,this.logger,e?.keychain),this.history=new f7(this,this.logger),this.expirer=new d7(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new L6(vg(vg({},bE),e?.storageOptions)),this.relayer=new a7({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new h7(this,this.logger),this.verify=new p7(this.projectId||"",this.logger)}static async init(e){const r=new vh(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(ME,n),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 v7=vh,yg="wc",bg=2,_g="client",yh=`${yg}@${bg}:${_g}:`,bh={name:_g,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Eg="WALLETCONNECT_DEEPLINK_CHOICE",y7="proposal",xg="Proposal expired",b7="session",pc=Te.SEVEN_DAYS,_7="engine",Zo={wc_sessionPropose:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1115}}},_h={min:Te.FIVE_MINUTES,max:Te.SEVEN_DAYS},Zn={idle:"IDLE",active:"ACTIVE"},E7="request",x7=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var C7=Object.defineProperty,I7=Object.defineProperties,S7=Object.getOwnPropertyDescriptors,Cg=Object.getOwnPropertySymbols,O7=Object.prototype.hasOwnProperty,D7=Object.prototype.propertyIsEnumerable,Ig=(t,e,r)=>e in t?C7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zr=(t,e)=>{for(var r in e||(e={}))O7.call(e,r)&&Ig(t,r,e[r]);if(Cg)for(var r of Cg(e))D7.call(e,r)&&Ig(t,r,e[r]);return t},Yo=(t,e)=>I7(t,S7(e));class A7 extends k4{constructor(e){super(e),this.name=_7,this.events=new yr.exports,this.initialized=!1,this.ignoredPayloadTypes=[Wi],this.requestQueue={state:Zn.idle,queue:[]},this.sessionRequestQueue={state:Zn.idle,queue:[]},this.requestQueueDelay=Te.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Zo)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Te.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=Yo(zr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:h}=n;let f=i,v,E=!1;if(f&&(E=this.client.core.pairing.pairings.get(f).active),!f||!E){const{topic:L,uri:$}=await this.client.core.pairing.create();f=L,v=$}const _=await this.client.core.crypto.generateKeyPair(),S=zr({requiredNamespaces:o,optionalNamespaces:c,relays:h??[{protocol:sg}],proposer:{publicKey:_,metadata:this.client.metadata}},l&&{sessionProperties:l}),{reject:P,resolve:j,done:H}=As(Te.FIVE_MINUTES,xg);if(this.events.once(tr("session_connect"),async({error:L,session:$})=>{if(L)P(L);else if($){$.self.publicKey=_;const T=Yo(zr({},$),{requiredNamespaces:$.requiredNamespaces,optionalNamespaces:$.optionalNamespaces});await this.client.session.set($.topic,T),await this.setExpiry($.topic,$.expiry),f&&await this.client.core.pairing.updateMetadata({topic:f,metadata:$.peer.metadata}),j(T)}}),!f){const{message:L}=_e("NO_MATCHING_KEY",`connect() pairing topic: ${f}`);throw new Error(L)}const Z=await this.sendRequest({topic:f,method:"wc_sessionPropose",params:S}),N=xn(Te.FIVE_MINUTES);return await this.setProposal(Z,zr({id:Z,expiry:N},S)),{uri:v,approval:H}},this.pair=async r=>(await this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{await 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:f,requiredNamespaces:v,optionalNamespaces:E}=l;h=h||"",Ps(v)||(v=Ab(o,"approve()"));const _=await this.client.core.crypto.generateKeyPair(),S=f.publicKey,P=await this.client.core.crypto.generateSharedKey(_,S);h&&n&&(await this.client.core.pairing.updateMetadata({topic:h,metadata:f.metadata}),await this.sendResult({id:n,topic:h,result:{relay:{protocol:i??"irn"},responderPublicKey:_}}),await this.client.proposal.delete(n,Zt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}));const j=zr({relay:{protocol:i??"irn"},namespaces:o,requiredNamespaces:v,optionalNamespaces:E,pairingTopic:h,controller:{publicKey:_,metadata:this.client.metadata},expiry:xn(pc)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(P),await this.sendRequest({topic:P,method:"wc_sessionSettle",params:j,throwOnFailedPublish:!0});const H=Yo(zr({},j),{topic:P,pairingTopic:h,acknowledged:!1,self:j.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:_});return await this.client.session.set(P,H),await this.setExpiry(P,xn(pc)),{topic:P,acknowledged:()=>new Promise(Z=>setTimeout(()=>Z(this.client.session.get(P)),500))}},this.reject=async r=>{await 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=>{await this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,o=await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i}}),{done:c,resolve:l,reject:h}=As();return this.events.once(tr("session_update",o),({error:f})=>{f?h(f):l()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:c}},this.extend=async r=>{await this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest({topic:n,method:"wc_sessionExtend",params:{}}),{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,xn(pc)),{acknowledged:o}},this.request=async r=>{await this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:o,expiry:c}=r,l=ch(),{done:h,resolve:f,reject:v}=As(c);return this.events.once(tr("session_request",l),({error:E,result:_})=>{E?v(E):f(_)}),await Promise.all([new Promise(async E=>{await this.sendRequest({clientRpcId:l,topic:o,method:"wc_sessionRequest",params:{request:i,chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(_=>v(_)),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:l}),E()}),new Promise(async E=>{const _=await this.client.core.storage.getItem(Eg);gb({id:l,topic:o,wcDeepLink:_}),E()}),h()]).then(E=>E[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;Kn(i)?await this.sendResult({id:o,topic:n,result:i.result,throwOnFailedPublish:!0}):Cn(i)&&await this.sendError(o,n,i.error),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest({topic:n,method:"wc_sessionPing",params:{}}),{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=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:o}=r;await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:o}})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest({topic:n,method:"wc_sessionDelete",params:Zt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Tb(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)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),this.client.session.delete(r,Zt("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(Eg).catch(o=>this.client.logger.warn(o))},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.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(o=>o.id!==r),i&&(this.sessionRequestQueue.state=Zn.idle)},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,xn(n))},this.sendRequest=async r=>{const{topic:n,method:i,params:o,expiry:c,relayRpcId:l,clientRpcId:h,throwOnFailedPublish:f}=r,v=qo(i,o,h);if(Ao()&&x7.includes(i)){const S=Ds(JSON.stringify(v));this.client.core.verify.register({attestationId:S})}const E=await this.client.core.crypto.encode(n,v),_=Zo[i].req;return c&&(_.ttl=c),l&&(_.id=l),this.client.core.history.set(n,v),f?(_.internal=Yo(zr({},_.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,E,_)):this.client.core.relayer.publish(n,E,_).catch(S=>this.client.logger.error(S)),v.id},this.sendResult=async r=>{const{id:n,topic:i,result:o,throwOnFailedPublish:c}=r,l=lh(n,o),h=await this.client.core.crypto.encode(i,l),f=await this.client.core.history.get(i,n),v=Zo[f.request.method].res;c?(v.internal=Yo(zr({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,h,v)):this.client.core.relayer.publish(i,h,v).catch(E=>this.client.logger.error(E)),await this.client.core.history.resolve(l)},this.sendError=async(r,n,i)=>{const o=lc(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=>{di(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{di(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Zn.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Zn.active;const r=this.requestQueue.queue.shift();if(r)try{this.processRequest(r),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Zn.idle},this.processRequest=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(zr({},n.params));const c=xn(Te.FIVE_MINUTES),l=zr({id:o,pairingTopic:r,expiry:c},i);await this.setProposal(o,l);const h=Ds(JSON.stringify(n)),f=await this.getVerifyContext(h,l.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:l,verifyContext:f})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(Kn(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 f=await this.client.core.crypto.generateSharedKey(l,h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:f});const v=await this.client.core.relayer.subscribe(f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:v}),await this.client.core.pairing.activate({topic:r})}else Cn(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:f,requiredNamespaces:v,optionalNamespaces:E,sessionProperties:_,pairingTopic:S}=n.params,P=zr({topic:r,relay:c,expiry:h,namespaces:f,acknowledged:!0,pairingTopic:S,requiredNamespaces:v,optionalNamespaces:E,controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},_&&{sessionProperties:_});await this.sendResult({id:n.id,topic:r,result:!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;Kn(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(tr("session_approve",i),{})):Cn(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{const c=`${r}_session_update`,l=sc.get(c);if(l&&this.isRequestOutOfSync(l,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidUpdate(zr({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:o,topic:r,result:!0}),this.client.events.emit("session_update",{id:o,topic:r,params:i}),sc.set(c,o)}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;Kn(n)?this.events.emit(tr("session_update",i),{}):Cn(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,xn(pc)),await this.sendResult({id:i,topic:r,result:!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;Kn(n)?this.events.emit(tr("session_extend",i),{}):Cn(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({id:i,topic:r,result:!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(()=>{Kn(n)?this.events.emit(tr("session_ping",i),{}):Cn(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(Ir.publish,async()=>{o(await this.deleteSession(r))})}),this.sendResult({id:i,topic:r,result:!0})]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(o){this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidRequest(zr({topic:r},o)),await this.setPendingSessionRequest({id:i,topic:r,params:o}),this.addSessionRequestToSessionRequestQueue({id:i,topic:r,params:o}),await this.processSessionRequestQueue()}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;Kn(n)?this.events.emit(tr("session_request",i),{result:n.result}):Cn(n)&&this.events.emit(tr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{const c=`${r}_session_event_${o.event.name}`,l=sc.get(c);if(l&&this.isRequestOutOfSync(l,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(zr({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o}),sc.set(c,i)}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Zn.idle,this.processSessionRequestQueue()},Te.toMiliseconds(this.requestQueueDelay))},this.processSessionRequestQueue=async()=>{if(this.sessionRequestQueue.state===Zn.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{const{id:n,topic:i,params:o}=r,c=Ds(JSON.stringify(qo("wc_sessionRequest",o,n))),l=this.client.session.get(i),h=await this.getVerifyContext(c,l.peer.metadata);this.sessionRequestQueue.state=Zn.active,this.client.events.emit("session_request",{id:n,topic:i,params:o,verifyContext:h})}catch(n){this.client.logger.error(n)}},this.isValidConnect=async r=>{if(!Wr(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),!zb(l,!0)){const{message:h}=_e("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(h)}!Pr(i)&&Ps(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Pr(o)&&Ps(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Pr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=Wb(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Wr(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=ic(i,"approve()");if(h)throw new Error(h.message);const f=V1(l.requiredNamespaces,i,"approve()");if(f)throw new Error(f.message);if(!pr(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(!Wr(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),!Vb(i)){const{message:o}=_e("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!Wr(r)){const{message:f}=_e("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(f)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!z1(n)){const{message:f}=_e("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(f)}const l=Ub(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const h=ic(o,"onSessionSettleRequest()");if(h)throw new Error(h.message);if(di(c)){const{message:f}=_e("EXPIRED","onSessionSettleRequest()");throw new Error(f)}},this.isValidUpdate=async r=>{if(!Wr(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=ic(i,"update()");if(c)throw new Error(c.message);const l=V1(o.requiredNamespaces,i,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async r=>{if(!Wr(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(!Wr(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(!q1(l,o)){const{message:h}=_e("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(h)}if(!Kb(i)){const{message:h}=_e("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(h)}if(!Yb(l,o,i.method)){const{message:h}=_e("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(h)}if(c&&!e6(c,_h)){const{message:h}=_e("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${_h.min} and ${_h.max}`);throw new Error(h)}},this.isValidRespond=async r=>{if(!Wr(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),!Gb(i)){const{message:o}=_e("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Wr(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(!Wr(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(!q1(c,o)){const{message:l}=_e("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!Zb(i)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!Jb(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(!Wr(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||fc,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===new URL(n.url).origin?"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(!pr(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)}})}}async isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Ir.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);try{uh(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):uc(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.client.core.history.delete(r,i.id)):this.onRelayEventUnknownPayload({topic:r,payload:i})}catch(o){this.client.logger.error(o)}})}registerExpirerEvents(){this.client.core.expirer.on(cn.expired,async e=>{const{topic:r,id:n}=F1(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(!pr(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(di(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=_e("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!pr(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(di(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(pr(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(!qb(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(di(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=_e("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class $7 extends dc{constructor(e,r){super(e,r,y7,yh),this.core=e,this.logger=r}}class P7 extends dc{constructor(e,r){super(e,r,b7,yh),this.core=e,this.logger=r}}class T7 extends dc{constructor(e,r){super(e,r,E7,yh,n=>n.id),this.core=e,this.logger=r}}class Eh extends B4{constructor(e){super(e),this.protocol=yg,this.version=bg,this.name=bh.name,this.events=new yr.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||bh.name,this.metadata=e?.metadata||cb();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||bh.logger}));this.core=e?.core||new v7(e),this.logger=pt.generateChildLogger(r,this.name),this.session=new P7(this.core,this.logger),this.proposal=new $7(this.core,this.logger),this.pendingRequest=new T7(this.core,this.logger),this.engine=new A7(this)}static async init(e){const r=new Eh(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 xh={exports:{}};(function(t,e){var r=typeof self<"u"?self:dr,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 f=["[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&&f.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 S(O){var U={next:function(){var ce=O.shift();return{done:ce===void 0,value:ce}}};return l.iterable&&(U[Symbol.iterator]=function(){return U}),U}function P(O){this.map={},O instanceof P?O.forEach(function(U,ce){this.append(ce,U)},this):Array.isArray(O)?O.forEach(function(U){this.append(U[0],U[1])},this):O&&Object.getOwnPropertyNames(O).forEach(function(U){this.append(U,O[U])},this)}P.prototype.append=function(O,U){O=E(O),U=_(U);var ce=this.map[O];this.map[O]=ce?ce+", "+U:U},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,U){this.map[E(O)]=_(U)},P.prototype.forEach=function(O,U){for(var ce in this.map)this.map.hasOwnProperty(ce)&&O.call(U,this.map[ce],ce,this)},P.prototype.keys=function(){var O=[];return this.forEach(function(U,ce){O.push(ce)}),S(O)},P.prototype.values=function(){var O=[];return this.forEach(function(U){O.push(U)}),S(O)},P.prototype.entries=function(){var O=[];return this.forEach(function(U,ce){O.push([ce,U])}),S(O)},l.iterable&&(P.prototype[Symbol.iterator]=P.prototype.entries);function j(O){if(O.bodyUsed)return Promise.reject(new TypeError("Already read"));O.bodyUsed=!0}function H(O){return new Promise(function(U,ce){O.onload=function(){U(O.result)},O.onerror=function(){ce(O.error)}})}function Z(O){var U=new FileReader,ce=H(U);return U.readAsArrayBuffer(O),ce}function N(O){var U=new FileReader,ce=H(U);return U.readAsText(O),ce}function L(O){for(var U=new Uint8Array(O),ce=new Array(U.length),le=0;le<U.length;le++)ce[le]=String.fromCharCode(U[le]);return ce.join("")}function $(O){if(O.slice)return O.slice(0);var U=new Uint8Array(O.byteLength);return U.set(new Uint8Array(O)),U.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=j(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?j(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Z)}),this.text=function(){var O=j(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 d(O){var U=O.toUpperCase();return I.indexOf(U)>-1?U:O}function x(O,U){U=U||{};var ce=U.body;if(O instanceof x){if(O.bodyUsed)throw new TypeError("Already read");this.url=O.url,this.credentials=O.credentials,U.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=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new P(U.headers)),this.method=d(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.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 U=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," ");U.append(decodeURIComponent(re),decodeURIComponent(ne))}}),U}function W(O){var U=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();U.append(ne,ae)}}),U}T.call(x.prototype);function ee(O,U){U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in U?U.statusText:"OK",this.headers=new P(U.headers),this.url=U.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,U){if(de.indexOf(U)===-1)throw new RangeError("Invalid status code");return new ee(null,{status:U,headers:{location:O}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(U,ce){this.message=U,this.name=ce;var le=Error(U);this.stack=le.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function me(O,U){return new Promise(function(ce,le){var re=new x(O,U);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:W(ne.getAllResponseHeaders()||"")};ie.url="responseURL"in ne?ne.responseURL:ie.headers.get("X-Request-URL");var De="response"in ne?ne.response:ne.responseText;ce(new ee(De,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,De){ne.setRequestHeader(De,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})(xh,xh.exports);var Sg=Iw(xh.exports);const Og={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Dg=10;class Gi{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new yr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Rp(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=Ho(e),o=await(await Sg(this.url,Object.assign(Object.assign({},Og),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Rp(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=Ho({id:1,jsonrpc:"2.0",method:"test",params:[]});await Sg(e,Object.assign(Object.assign({},Og),{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"?rh(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=lc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return Sp(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Dg&&this.events.setMaxListeners(Dg)}}const Ag="error",R7="wss://relay.walletconnect.com",N7="wc",L7="universal_provider",$g=`${N7}@2:${L7}:`,M7="https://rpc.walletconnect.com/v1",mi={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Jo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ch={exports:{}};/**
|
|
72
|
+
***************************************************************************** */var ah=function(t,e){return ah=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])},ah(t,e)};function p_(t,e){ah(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ch=function(){return ch=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},ch.apply(this,arguments)};function g_(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function m_(t,e,r,n){var i=arguments.length,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 w_(t,e){return function(r,n){e(r,n,t)}}function v_(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function y_(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{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function b_(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(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function __(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function E_(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function lh(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 Ap(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 x_(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ap(arguments[e]));return t}function C_(){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 Vo(t){return this instanceof Vo?(this.v=t,this):new Vo(t)}function I_(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(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Vo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function S_(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:Vo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function O_(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 lh=="function"?lh(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(f){o({value:f,done:l})},c)}}function D_(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function A_(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 $_(t){return t&&t.__esModule?t:{default:t}}function P_(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function T_(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 R_=Object.freeze({__proto__:null,__extends:p_,get __assign(){return ch},__rest:g_,__decorate:m_,__param:w_,__metadata:v_,__awaiter:y_,__generator:b_,__createBinding:__,__exportStar:E_,__values:lh,__read:Ap,__spread:x_,__spreadArrays:C_,__await:Vo,__asyncGenerator:I_,__asyncDelegator:S_,__asyncValues:O_,__makeTemplateObject:D_,__importStar:A_,__importDefault:$_,__classPrivateFieldGet:P_,__classPrivateFieldSet:T_}),N_=ji(R_),zn={},$p;function L_(){if($p)return zn;$p=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.isBrowserCryptoAvailable=zn.getSubtleCrypto=zn.getBrowerCrypto=void 0;function t(){return dr?.crypto||dr?.msCrypto||{}}zn.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}zn.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return zn.isBrowserCryptoAvailable=r,zn}var qn={},Pp;function M_(){if(Pp)return qn;Pp=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=N_;e.__exportStar(L_(),t),e.__exportStar(M_(),t)})(Dp);function uh(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Tp(t=6){return BigInt(uh(t))}function Ns(t,e,r){return{id:r||uh(),jsonrpc:"2.0",method:t,params:e}}function hh(t,e){return{id:t,jsonrpc:"2.0",result:e}}function hc(t,e,r){return{id:t,jsonrpc:"2.0",error:U_(e,r)}}function U_(t,e){return typeof t>"u"?Sp(Cp):(typeof t=="string"&&(t=Object.assign(Object.assign({},Sp(oh)),{message:t})),typeof e<"u"&&(t.data=e),f_(t.code)&&(t=d_(t.code)),t)}class j_{}class F_ extends j_{constructor(){super()}}class B_ extends F_{constructor(e){super()}}const k_="^https?:",H_="^wss?:";function W_(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Rp(t,e){const r=W_(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Np(t){return Rp(t,k_)}function Lp(t){return Rp(t,H_)}function z_(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Mp(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function fh(t){return Mp(t)&&"method"in t}function fc(t){return Mp(t)&&(Vn(t)||xn(t))}function Vn(t){return"result"in t}function xn(t){return"error"in t}class di extends B_{constructor(e){super(e),this.events=new yr.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(Ns(e.method,e.params||[],e.id||Tp().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=>{xn(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),fc(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 q_=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),V_=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Up=t=>t.split("?")[0],jp=10,K_=q_();class G_{constructor(e){if(this.url=e,this.events=new yr.exports.EventEmitter,this.registering=!1,!Lp(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(zo(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!Lp(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=Dp.isReactNative()?void 0:{rejectUnauthorized:!z_(e)},o=new K_(e,[],i);V_()?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"?ih(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=hc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return Op(e,Up(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>jp&&this.events.setMaxListeners(jp)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Up(this.url)}`));return this.events.emit("register_error",r),r}}var dh={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,c=9007199254740991,l="[object Arguments]",h="[object Array]",f="[object AsyncFunction]",v="[object Boolean]",E="[object Date]",_="[object Error]",S="[object Function]",P="[object GeneratorFunction]",j="[object Map]",H="[object Number]",Z="[object Null]",N="[object Object]",L="[object Promise]",$="[object Proxy]",T="[object RegExp]",I="[object Set]",d="[object String]",x="[object Symbol]",J="[object Undefined]",W="[object WeakMap]",ee="[object ArrayBuffer]",de="[object DataView]",me="[object Float32Array]",O="[object Float64Array]",U="[object Int8Array]",ce="[object Int16Array]",le="[object Int32Array]",re="[object Uint8Array]",ne="[object Uint8ClampedArray]",ae="[object Uint16Array]",ie="[object Uint32Array]",De=/[\\^$.*+?()[\]{}|]/g,ge=/^\[object .+?Constructor\]$/,Be=/^(?:0|[1-9]\d*)$/,ye={};ye[me]=ye[O]=ye[U]=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[S]=ye[j]=ye[H]=ye[N]=ye[T]=ye[I]=ye[d]=ye[W]=!1;var Me=typeof dr=="object"&&dr&&dr.Object===Object&&dr,Q=typeof self=="object"&&self&&self.Object===Object&&self,Y=Me||Q||Function("return this")(),z=e&&!e.nodeType&&e,w=z&&!0&&t&&!t.nodeType&&t,F=w&&w.exports===z,we=F&&Me.process,ve=function(){try{return we&&we.binding&&we.binding("util")}catch{}}(),Ue=ve&&ve.isTypedArray;function nt(R,q){for(var fe=-1,Ce=R==null?0:R.length,It=0,Qe=[];++fe<Ce;){var Tt=R[fe];q(Tt,fe,R)&&(Qe[It++]=Tt)}return Qe}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 At(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 ke(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 je=Array.prototype,Ze=Function.prototype,b=Object.prototype,p=Y["__core-js_shared__"],m=Ze.toString,A=b.hasOwnProperty,B=function(){var R=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return R?"Symbol(src)_1."+R:""}(),K=b.toString,X=RegExp("^"+m.call(A).replace(De,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=F?Y.Buffer:void 0,Re=Y.Symbol,st=Y.Uint8Array,ht=b.propertyIsEnumerable,lt=je.splice,Ur=Re?Re.toStringTag:void 0,Xn=Object.getOwnPropertySymbols,Oi=Ee?Ee.isBuffer:void 0,us=Ke(Object.keys,Object),Ht=tn(Y,"DataView"),Lt=tn(Y,"Map"),Wt=tn(Y,"Promise"),zt=tn(Y,"Set"),Ft=tn(Y,"WeakMap"),Mt=tn(Object,"create"),nr=ti(Ht),ir=ti(Lt),qt=ti(Wt),sr=ti(zt),Vt=ti(Ft),Jt=Re?Re.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 or(){this.__data__=Mt?Mt(null):{},this.size=0}function ar(R){var q=this.has(R)&&delete this.__data__[R];return this.size-=q?1:0,q}function Gf(R){var q=this.__data__;if(Mt){var fe=q[R];return fe===n?void 0:fe}return A.call(q,R)?q[R]:void 0}function Zf(R){var q=this.__data__;return Mt?q[R]!==void 0:A.call(q,R)}function Yf(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=or,Pt.prototype.delete=ar,Pt.prototype.get=Gf,Pt.prototype.has=Zf,Pt.prototype.set=Yf;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 Jf(){this.__data__=[],this.size=0}function Qf(R){var q=this.__data__,fe=hs(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 Xf(R){var q=this.__data__,fe=hs(q,R);return fe<0?void 0:q[fe][1]}function e0(R){return hs(this.__data__,R)>-1}function t0(R,q){var fe=this.__data__,Ce=hs(fe,R);return Ce<0?(++this.size,fe.push([R,q])):fe[Ce][1]=q,this}fn.prototype.clear=Jf,fn.prototype.delete=Qf,fn.prototype.get=Xf,fn.prototype.has=e0,fn.prototype.set=t0;function ei(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 no(){this.size=0,this.__data__={hash:new Pt,map:new(Lt||fn),string:new Pt}}function r0(R){var q=Di(this,R).delete(R);return this.size-=q?1:0,q}function io(R){return Di(this,R).get(R)}function n0(R){return Di(this,R).has(R)}function i0(R,q){var fe=Di(this,R),Ce=fe.size;return fe.set(R,q),this.size+=fe.size==Ce?0:1,this}ei.prototype.clear=no,ei.prototype.delete=r0,ei.prototype.get=io,ei.prototype.has=n0,ei.prototype.set=i0;function so(R){var q=-1,fe=R==null?0:R.length;for(this.__data__=new ei;++q<fe;)this.add(R[q])}function ol(R){return this.__data__.set(R,n),this}function al(R){return this.__data__.has(R)}so.prototype.add=so.prototype.push=ol,so.prototype.has=al;function Cn(R){var q=this.__data__=new fn(R);this.size=q.size}function s0(){this.__data__=new fn,this.size=0}function o0(R){var q=this.__data__,fe=q.delete(R);return this.size=q.size,fe}function a0(R){return this.__data__.get(R)}function c0(R){return this.__data__.has(R)}function cl(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 ei(Ce)}return fe.set(R,q),this.size=fe.size,this}Cn.prototype.clear=s0,Cn.prototype.delete=o0,Cn.prototype.get=a0,Cn.prototype.has=c0,Cn.prototype.set=cl;function ll(R,q){var fe=co(R),Ce=!fe&&_l(R),It=!fe&&!Ce&&Da(R),Qe=!fe&&!Ce&&!It&&Cl(R),Tt=fe||Ce||It||Qe,cr=Tt?At(R.length,String):[],mt=cr.length;for(var St in R)(q||A.call(R,St))&&!(Tt&&(St=="length"||It&&(St=="offset"||St=="parent")||Qe&&(St=="buffer"||St=="byteLength"||St=="byteOffset")||ml(St,mt)))&&cr.push(St);return cr}function hs(R,q){for(var fe=R.length;fe--;)if(bl(R[fe][0],q))return fe;return-1}function Sa(R,q,fe){var Ce=q(R);return co(R)?Ce:at(Ce,fe(R))}function fs(R){return R==null?R===void 0?J:Z:Ur&&Ur in Object(R)?pl(R):h0(R)}function Oa(R){return ps(R)&&fs(R)==l}function ds(R,q,fe,Ce,It){return R===q?!0:R==null||q==null||!ps(R)&&!ps(q)?R!==R&&q!==q:ul(R,q,fe,Ce,ds,It)}function ul(R,q,fe,Ce,It,Qe){var Tt=co(R),cr=co(q),mt=Tt?h:Fn(R),St=cr?h:Fn(q);mt=mt==l?N:mt,St=St==l?N:St;var Qt=mt==N,Vr=St==N,lr=mt==St;if(lr&&Da(R)){if(!Da(q))return!1;Tt=!0,Qt=!1}if(lr&&!Qt)return Qe||(Qe=new Cn),Tt||Cl(R)?oo(R,q,fe,Ce,It,Qe):u0(R,q,mt,fe,Ce,It,Qe);if(!(fe&i)){var Rt=Qt&&A.call(R,"__wrapped__"),jr=Vr&&A.call(q,"__wrapped__");if(Rt||jr){var In=Rt?R.value():R,dn=jr?q.value():q;return Qe||(Qe=new Cn),It(In,dn,fe,Ce,Qe)}}return lr?(Qe||(Qe=new Cn),dl(R,q,fe,Ce,It,Qe)):!1}function l0(R){if(!xl(R)||vl(R))return!1;var q=lo(R)?X:ge;return q.test(ti(R))}function hl(R){return ps(R)&&El(R.length)&&!!ye[fs(R)]}function fl(R){if(!yl(R))return us(R);var q=[];for(var fe in Object(R))A.call(R,fe)&&fe!="constructor"&&q.push(fe);return q}function oo(R,q,fe,Ce,It,Qe){var Tt=fe&i,cr=R.length,mt=q.length;if(cr!=mt&&!(Tt&&mt>cr))return!1;var St=Qe.get(R);if(St&&Qe.get(q))return St==q;var Qt=-1,Vr=!0,lr=fe&o?new so:void 0;for(Qe.set(R,q),Qe.set(q,R);++Qt<cr;){var Rt=R[Qt],jr=q[Qt];if(Ce)var In=Tt?Ce(jr,Rt,Qt,q,R,Qe):Ce(Rt,jr,Qt,R,q,Qe);if(In!==void 0){if(In)continue;Vr=!1;break}if(lr){if(!Ge(q,function(dn,Bn){if(!Je(lr,Bn)&&(Rt===dn||It(Rt,dn,fe,Ce,Qe)))return lr.push(Bn)})){Vr=!1;break}}else if(!(Rt===jr||It(Rt,jr,fe,Ce,Qe))){Vr=!1;break}}return Qe.delete(R),Qe.delete(q),Vr}function u0(R,q,fe,Ce,It,Qe,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||!Qe(new st(R),new st(q)));case v:case E:case H:return bl(+R,+q);case _:return R.name==q.name&&R.message==q.message;case T:case d:return R==q+"";case j:var cr=ke;case I:var mt=Ce&i;if(cr||(cr=rt),R.size!=q.size&&!mt)return!1;var St=Tt.get(R);if(St)return St==q;Ce|=o,Tt.set(R,q);var Qt=oo(cr(R),cr(q),Ce,It,Qe,Tt);return Tt.delete(R),Qt;case x:if(Kt)return Kt.call(R)==Kt.call(q)}return!1}function dl(R,q,fe,Ce,It,Qe){var Tt=fe&i,cr=ao(R),mt=cr.length,St=ao(q),Qt=St.length;if(mt!=Qt&&!Tt)return!1;for(var Vr=mt;Vr--;){var lr=cr[Vr];if(!(Tt?lr in q:A.call(q,lr)))return!1}var Rt=Qe.get(R);if(Rt&&Qe.get(q))return Rt==q;var jr=!0;Qe.set(R,q),Qe.set(q,R);for(var In=Tt;++Vr<mt;){lr=cr[Vr];var dn=R[lr],Bn=q[lr];if(Ce)var Aa=Tt?Ce(Bn,dn,lr,q,R,Qe):Ce(dn,Bn,lr,R,q,Qe);if(!(Aa===void 0?dn===Bn||It(dn,Bn,fe,Ce,Qe):Aa)){jr=!1;break}In||(In=lr=="constructor")}if(jr&&!In){var gs=R.constructor,wr=q.constructor;gs!=wr&&"constructor"in R&&"constructor"in q&&!(typeof gs=="function"&&gs instanceof gs&&typeof wr=="function"&&wr instanceof wr)&&(jr=!1)}return Qe.delete(R),Qe.delete(q),jr}function ao(R){return Sa(R,p0,gl)}function Di(R,q){var fe=R.__data__;return wl(q)?fe[typeof q=="string"?"string":"hash"]:fe.map}function tn(R,q){var fe=He(R,q);return l0(fe)?fe:void 0}function pl(R){var q=A.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 gl=Xn?function(R){return R==null?[]:(R=Object(R),nt(Xn(R),function(q){return ht.call(R,q)}))}:Ct,Fn=fs;(Ht&&Fn(new Ht(new ArrayBuffer(1)))!=de||Lt&&Fn(new Lt)!=j||Wt&&Fn(Wt.resolve())!=L||zt&&Fn(new zt)!=I||Ft&&Fn(new Ft)!=W)&&(Fn=function(R){var q=fs(R),fe=q==N?R.constructor:void 0,Ce=fe?ti(fe):"";if(Ce)switch(Ce){case nr:return de;case ir:return j;case qt:return L;case sr:return I;case Vt:return W}return q});function ml(R,q){return q=q??c,!!q&&(typeof R=="number"||Be.test(R))&&R>-1&&R%1==0&&R<q}function wl(R){var q=typeof R;return q=="string"||q=="number"||q=="symbol"||q=="boolean"?R!=="__proto__":R===null}function vl(R){return!!B&&B in R}function yl(R){var q=R&&R.constructor,fe=typeof q=="function"&&q.prototype||b;return R===fe}function h0(R){return K.call(R)}function ti(R){if(R!=null){try{return m.call(R)}catch{}try{return R+""}catch{}}return""}function bl(R,q){return R===q||R!==R&&q!==q}var _l=Oa(function(){return arguments}())?Oa:function(R){return ps(R)&&A.call(R,"callee")&&!ht.call(R,"callee")},co=Array.isArray;function f0(R){return R!=null&&El(R.length)&&!lo(R)}var Da=Oi||xt;function d0(R,q){return ds(R,q)}function lo(R){if(!xl(R))return!1;var q=fs(R);return q==S||q==P||q==f||q==$}function El(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=c}function xl(R){var q=typeof R;return R!=null&&(q=="object"||q=="function")}function ps(R){return R!=null&&typeof R=="object"}var Cl=Ue?$t(Ue):hl;function p0(R){return f0(R)?ll(R):fl(R)}function Ct(){return[]}function xt(){return!1}t.exports=d0})(dh,dh.exports);var Z_=dh.exports,Y_=Object.defineProperty,Fp=Object.getOwnPropertySymbols,J_=Object.prototype.hasOwnProperty,Q_=Object.prototype.propertyIsEnumerable,Bp=(t,e,r)=>e in t?Y_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rr=(t,e)=>{for(var r in e||(e={}))J_.call(e,r)&&Bp(t,r,e[r]);if(Fp)for(var r of Fp(e))Q_.call(e,r)&&Bp(t,r,e[r]);return t};function X_(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),f=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 j=0,H=0,Z=0,N=P.length;Z!==N&&P[Z]===0;)Z++,j++;for(var L=(N-Z)*v+1>>>0,$=new Uint8Array(L);Z!==N;){for(var T=P[Z],I=0,d=L-1;(T!==0||I<H)&&d!==-1;d--,I++)T+=256*$[d]>>>0,$[d]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,Z++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(j);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 j=0;if(P[j]!==" "){for(var H=0,Z=0;P[j]===h;)H++,j++;for(var N=(P.length-j)*f+1>>>0,L=new Uint8Array(N);P[j];){var $=r[P.charCodeAt(j)];if($===255)return;for(var T=0,I=N-1;($!==0||T<Z)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");Z=T,j++}if(P[j]!==" "){for(var d=N-Z;d!==N&&L[d]===0;)d++;for(var x=new Uint8Array(H+(N-d)),J=H;d!==N;)x[J++]=L[d++];return x}}}function S(P){var j=_(P);if(j)return j;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:S}}var e8=X_,t8=e8;const kp=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")},r8=t=>new TextEncoder().encode(t),n8=t=>new TextDecoder().decode(t);class i8{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 s8{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 Hp(this,e)}}class o8{constructor(e){this.decoders=e}or(e){return Hp(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 Hp=(t,e)=>new o8(Rr(Rr({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class a8{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new i8(e,r,n),this.decoder=new s8(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const dc=({name:t,prefix:e,encode:r,decode:n})=>new a8(t,e,r,n),Ko=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=t8(r,e);return dc({prefix:t,name:e,encode:n,decode:o=>kp(i(o))})},c8=(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,f=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[f++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},l8=(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})=>dc({prefix:e,name:t,encode(i){return l8(i,n,r)},decode(i){return c8(i,n,r,t)}}),u8=dc({prefix:"\0",name:"identity",encode:t=>n8(t),decode:t=>r8(t)});var h8=Object.freeze({__proto__:null,identity:u8});const f8=_r({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var d8=Object.freeze({__proto__:null,base2:f8});const p8=_r({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var g8=Object.freeze({__proto__:null,base8:p8});const m8=Ko({prefix:"9",name:"base10",alphabet:"0123456789"});var w8=Object.freeze({__proto__:null,base10:m8});const v8=_r({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),y8=_r({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var b8=Object.freeze({__proto__:null,base16:v8,base16upper:y8});const _8=_r({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),E8=_r({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),x8=_r({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),C8=_r({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),I8=_r({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),S8=_r({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O8=_r({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),D8=_r({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),A8=_r({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var $8=Object.freeze({__proto__:null,base32:_8,base32upper:E8,base32pad:x8,base32padupper:C8,base32hex:I8,base32hexupper:S8,base32hexpad:O8,base32hexpadupper:D8,base32z:A8});const P8=Ko({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),T8=Ko({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var R8=Object.freeze({__proto__:null,base36:P8,base36upper:T8});const N8=Ko({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),L8=Ko({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var M8=Object.freeze({__proto__:null,base58btc:N8,base58flickr:L8});const U8=_r({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),j8=_r({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),F8=_r({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),B8=_r({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var k8=Object.freeze({__proto__:null,base64:U8,base64pad:j8,base64url:F8,base64urlpad:B8});const Wp=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}"),H8=Wp.reduce((t,e,r)=>(t[r]=e,t),[]),W8=Wp.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function z8(t){return t.reduce((e,r)=>(e+=H8[r],e),"")}function q8(t){const e=[];for(const r of t){const n=W8[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const V8=dc({prefix:"\u{1F680}",name:"base256emoji",encode:z8,decode:q8});var K8=Object.freeze({__proto__:null,base256emoji:V8}),G8=qp,zp=128,Z8=127,Y8=~Z8,J8=Math.pow(2,31);function qp(t,e,r){e=e||[],r=r||0;for(var n=r;t>=J8;)e[r++]=t&255|zp,t/=128;for(;t&Y8;)e[r++]=t&255|zp,t>>>=7;return e[r]=t|0,qp.bytes=r-n+1,e}var Q8=ph,X8=128,Vp=127;function ph(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw ph.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Vp)<<i:(c&Vp)*Math.pow(2,i),i+=7}while(c>=X8);return ph.bytes=o-n,r}var eE=Math.pow(2,7),tE=Math.pow(2,14),rE=Math.pow(2,21),nE=Math.pow(2,28),iE=Math.pow(2,35),sE=Math.pow(2,42),oE=Math.pow(2,49),aE=Math.pow(2,56),cE=Math.pow(2,63),lE=function(t){return t<eE?1:t<tE?2:t<rE?3:t<nE?4:t<iE?5:t<sE?6:t<oE?7:t<aE?8:t<cE?9:10},uE={encode:G8,decode:Q8,encodingLength:lE},Kp=uE;const Gp=(t,e,r=0)=>(Kp.encode(t,e,r),e),Zp=t=>Kp.encodingLength(t),gh=(t,e)=>{const r=e.byteLength,n=Zp(t),i=n+Zp(r),o=new Uint8Array(i+r);return Gp(t,o,0),Gp(r,o,n),o.set(e,i),new hE(t,r,e,o)};class hE{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Yp=({name:t,code:e,encode:r})=>new fE(t,e,r);class fE{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?gh(this.code,r):r.then(n=>gh(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Jp=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),dE=Yp({name:"sha2-256",code:18,encode:Jp("SHA-256")}),pE=Yp({name:"sha2-512",code:19,encode:Jp("SHA-512")});var gE=Object.freeze({__proto__:null,sha256:dE,sha512:pE});const Qp=0,mE="identity",Xp=kp;var wE=Object.freeze({__proto__:null,identity:{code:Qp,name:mE,encode:Xp,digest:t=>gh(Qp,Xp(t))}});new TextEncoder,new TextDecoder;const eg=Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr({},h8),d8),g8),w8),b8),$8),R8),M8),k8),K8);Rr(Rr({},gE),wE);function tg(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function vE(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?tg(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function rg(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const ng=rg("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),mh=rg("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=vE(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),yE=Rr({utf8:ng,"utf-8":ng,hex:eg.base16,latin1:mh,ascii:mh,binary:mh},eg);function bE(t,e="utf8"){const r=yE[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?tg(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const ig="wc",_E=2,wh="core",pi=`${ig}@2:${wh}:`,EE={name:wh,logger:"error"},xE={database:":memory:"},CE="crypto",sg="client_ed25519_seed",IE=Te.ONE_DAY,SE="keychain",OE="0.3",DE="messages",AE="0.3",$E=Te.SIX_HOURS,PE="publisher",og="irn",TE="error",ag="wss://relay.walletconnect.com",cg="wss://relay.walletconnect.org",RE="relayer",Ir={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"},NE="_subscription",Kn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},LE=Te.ONE_SECOND,ME="2.10.1",UE=1e4,jE="0.3",FE="WALLETCONNECT_CLIENT_ID",Tn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},BE="subscription",kE="0.3",HE=Te.FIVE_SECONDS*1e3,WE="pairing",zE="0.3",Go={wc_pairingDelete:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:0},res:{ttl:Te.ONE_DAY,prompt:!1,tag:0}}},Zo={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Rn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},qE="history",VE="0.3",KE="expirer",cn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},GE="0.3",vh="verify-api",pc="https://verify.walletconnect.com",lg="https://verify.walletconnect.org";class ZE{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=SE,this.version=OE,this.initialized=!1,this.storagePrefix=pi,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,U1(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?j1(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 YE{constructor(e,r,n){this.core=e,this.logger=r,this.name=CE,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=xp(i);return Ep(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=xp(o),l=Uu();return await o_(l,i,IE,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),h=Q5(l,o);return this.setSymKey(h,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||X5(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=T1(c),h=zo(o);if(R1(l)){const _=l.senderPublicKey,S=l.receiverPublicKey;i=await this.generateSharedKey(_,S)}const f=this.getSymKey(i),{type:v,senderPublicKey:E}=l;return tb({type:v,symKey:f,message:h,senderPublicKey:E})},this.decode=async(i,o,c)=>{this.isInitialized();const l=ib(o,c);if(R1(l)){const h=l.receiverPublicKey,f=l.senderPublicKey;i=await this.generateSharedKey(h,f)}try{const h=this.getSymKey(i),f=rb({symKey:h,encoded:o});return ih(f)}catch(h){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(h)}},this.getPayloadType=i=>{const o=rc(i);return $o(o.type)},this.getPayloadSenderPublicKey=i=>{const o=rc(i);return o.senderPublicKey?Ar(o.senderPublicKey,$r):void 0},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.keychain=n||new ZE(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(sg)}catch{e=Uu(),await this.keychain.set(sg,e)}return bE(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 JE extends M4{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=DE,this.version=AE,this.initialized=!1,this.storagePrefix=pi,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=Ds(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=Ds(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,U1(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?j1(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 QE extends U4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new yr.exports.EventEmitter,this.name=PE,this.queue=new Map,this.publishTimeout=Te.toMiliseconds(Te.TEN_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,i,o)=>{var c;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});try{const l=o?.ttl||$E,h=Bu(o),f=o?.prompt||!1,v=o?.tag||0,E=o?.id||Tp().toString(),_={topic:n,message:i,opts:{ttl:l,relay:h,prompt:f,tag:v,id:E}},S=setTimeout(()=>this.queue.set(E,_),this.publishTimeout);try{await await Ro(this.rpcPublish(n,i,l,h,f,v,E),this.publishTimeout,"Failed to publish payload, please try again."),this.removeRequestFromQueue(E),this.relayer.events.emit(Ir.publish,_)}catch(P){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(c=o?.internal)!=null&&c.throwOnFailedPublish)throw this.removeRequestFromQueue(E),P;return}finally{clearTimeout(S)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}})}catch(l){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(l),l}},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,f,v,E;const _={method:ic(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)&&((f=_.params)==null||delete f.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(_)}removeRequestFromQueue(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(Rs.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ir.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ir.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class XE{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 e7=Object.defineProperty,t7=Object.defineProperties,r7=Object.getOwnPropertyDescriptors,ug=Object.getOwnPropertySymbols,n7=Object.prototype.hasOwnProperty,i7=Object.prototype.propertyIsEnumerable,hg=(t,e,r)=>e in t?e7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Yo=(t,e)=>{for(var r in e||(e={}))n7.call(e,r)&&hg(t,r,e[r]);if(ug)for(var r of ug(e))i7.call(e,r)&&hg(t,r,e[r]);return t},yh=(t,e)=>t7(t,r7(e));class s7 extends B4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new XE,this.events=new yr.exports.EventEmitter,this.name=BE,this.version=kE,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=pi,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),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=Bu(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 Te.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)>=HE&&(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=Bu(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:ic(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Ro(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ir.connection_stalled)}return Ds(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:ic(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 Ro(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Ir.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:ic(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,yh(Yo({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Yo({},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,Yo({},r)),this.topicMap.set(r.topic,e),this.events.emit(Tn.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(Tn.deleted,yh(Yo({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Tn.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(Tn.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);Pn(r)&&this.onBatchSubscribe(r.map((n,i)=>yh(Yo({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Rs.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Ir.connect,async()=>{await this.onConnect()}),this.relayer.on(Ir.disconnect,()=>{this.onDisconnect()}),this.events.on(Tn.created,async e=>{const r=Tn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Tn.deleted,async e=>{const r=Tn.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 o7=Object.defineProperty,fg=Object.getOwnPropertySymbols,a7=Object.prototype.hasOwnProperty,c7=Object.prototype.propertyIsEnumerable,dg=(t,e,r)=>e in t?o7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,l7=(t,e)=>{for(var r in e||(e={}))a7.call(e,r)&&dg(t,r,e[r]);if(fg)for(var r of fg(e))c7.call(e,r)&&dg(t,r,e[r]);return t};class u7 extends j4{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new yr.exports.EventEmitter,this.name=RE,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,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.onPayloadHandler=r=>{this.onProviderPayload(r)},this.onConnectHandler=()=>{this.events.emit(Ir.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Ir.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Kn.payload,this.onPayloadHandler),this.provider.on(Kn.connect,this.onConnectHandler),this.provider.on(Kn.disconnect,this.onDisconnectHandler),this.provider.on(Kn.error,this.onProviderErrorHandler)},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||TE})),this.messages=new JE(this.logger,e.core),this.subscriber=new s7(this,this.logger),this.publisher=new QE(this,this.logger),this.relayUrl=e?.relayUrl||ag,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${cg}...`),await this.restartTransport(cg)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},UE)}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(Tn.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.hasExperiencedNetworkDisruption&&this.connected?await Ro(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(e){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(r=>{if(!this.initialized)return r();this.subscriber.once(Tn.resubscribed,()=>{r()})}),new Promise(async(r,n)=>{try{await Ro(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(i){n(i);return}r()})])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.provider.events.emit(Kn.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(e){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Z1())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new di(new G_(gb({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;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),fh(e)){if(!e.method.endsWith(NE))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(l7({type:"event",event:r.id},c)),this.events.emit(r.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else fc(e)&&this.events.emit(Ir.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Ir.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=hh(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Kn.payload,this.onPayloadHandler),this.provider.off(Kn.connect,this.onConnectHandler),this.provider.off(Kn.disconnect,this.onDisconnectHandler),this.provider.off(Kn.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(Ir.connection_stalled,()=>{this.restartTransport().catch(r=>this.logger.error(r))});let e=await Z1();a6(async r=>{this.initialized&&e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(n=>this.logger.error(n))))})}onProviderDisconnect(){this.events.emit(Ir.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},Te.toMiliseconds(LE)))}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var h7=Object.defineProperty,pg=Object.getOwnPropertySymbols,f7=Object.prototype.hasOwnProperty,d7=Object.prototype.propertyIsEnumerable,gg=(t,e,r)=>e in t?h7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mg=(t,e)=>{for(var r in e||(e={}))f7.call(e,r)&&gg(t,r,e[r]);if(pg)for(var r of pg(e))d7.call(e,r)&&gg(t,r,e[r]);return t};class gc extends F4{constructor(e,r,n,i=pi,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=jE,this.cached=[],this.initialized=!1,this.storagePrefix=pi,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):jb(c)?this.map.set(c.id,c):Fb(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=>Z_(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=mg(mg({},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 p7{constructor(e,r){this.core=e,this.logger=r,this.name=WE,this.version=zE,this.events=new yr.exports,this.initialized=!1,this.storagePrefix=pi,this.ignoredPayloadTypes=[Hi],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=Uu(),i=await this.core.crypto.setSymKey(n),o=En(Te.FIVE_MINUTES),c={protocol:og},l={topic:i,expiry:o,relay:c,active:!1},h=Db({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}=Ib(n.uri);let l;if(this.pairings.keys.includes(i)&&(l=this.pairings.get(i),l.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);this.core.crypto.keychain.has(i)||(await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:c}));const h=En(Te.FIVE_MINUTES),f={topic:i,relay:c,expiry:h,active:!1};return await this.pairings.set(i,f),this.core.expirer.set(i,h),n.activatePairing&&await this.activate({topic:i}),this.events.emit(Zo.create,f),f},this.activate=async({topic:n})=>{this.isInitialized();const i=En(Te.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:f})=>{f?h(f):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=Ns(i,o),l=await this.core.crypto.encode(n,c),h=Go[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=hh(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),f=Go[h.request.method].res;await this.core.relayer.publish(i,l,f),await this.core.history.resolve(c)},this.sendError=async(n,i,o)=>{const c=hc(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),f=Go[h.request.method]?Go[h.request.method].res:Go.unregistered_method.res;await this.core.relayer.publish(i,l,f),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=>fi(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:o}=n;switch(o.method){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;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(Zo.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),{}):xn(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(Zo.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(!Wr(n)){const{message:i}=_e("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Ub(n.uri)){const{message:i}=_e("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!Wr(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(!Wr(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(!pr(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(fi(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 gc(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(Ir.message,async e=>{const{topic:r,message:n}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);try{fh(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):fc(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(cn.expired,async e=>{const{topic:r}=B1(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Zo.expire,{topic:r}))})}}class g7 extends L4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new yr.exports.EventEmitter,this.name=qE,this.version=VE,this.cached=[],this.initialized=!1,this.storagePrefix=pi,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,expiry:En(Te.THIRTY_DAYS)};this.records.set(c.id,c),this.events.emit(Rn.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=xn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(Rn.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(Rn.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:Ns(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(Rn.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(Rn.created,e=>{const r=Rn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Rn.updated,e=>{const r=Rn.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Rn.deleted,e=>{const r=Rn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.core.heartbeat.on(Rs.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{Te.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class m7 extends k4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new yr.exports.EventEmitter,this.name=KE,this.version=GE,this.cached=[],this.initialized=!1,this.storagePrefix=pi,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(cn.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(cn.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 mb(e);if(typeof e=="number")return wb(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(cn.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;Te.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(cn.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Rs.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(cn.created,e=>{const r=cn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(cn.expired,e=>{const r=cn.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(cn.deleted,e=>{const r=cn.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 w7 extends H4{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=vh,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||nc()||!Po())return;const i=n?.verifyUrl||pc;this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(o){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(o)}if(!this.initialized){this.removeIframe(),this.verifyUrl=lg;try{await this.createIframe()}catch(o){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(o),this.verifyDisabled=!0}}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const i=n?.verifyUrl||pc;let o;try{o=await this.fetchAttestation(n.attestationId,i)}catch(c){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${i}`),this.logger.info(c),o=await this.fetchAttestation(n.attestationId,lg)}return o},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const o=this.startAbortTimer(Te.ONE_SECOND*2),c=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(o),c.status===200?await c.json():void 0},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var i;try{if(!this.iframe)return;(i=this.iframe.contentWindow)==null||i.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const i=o=>{o.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(o=>{if(document.getElementById(vh))return o();window.addEventListener("message",i);const c=document.createElement("iframe");c.id=vh,c.src=`${this.verifyUrl}/${this.projectId}`,c.style.display="none",document.body.append(c),this.iframe=c,n=o}),new Promise((o,c)=>setTimeout(()=>{window.removeEventListener("message",i),c("verify iframe load timeout")},Te.toMiliseconds(Te.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.logger=pt.generateChildLogger(r,this.name),this.verifyUrl=pc,this.abortController=new AbortController,this.isDevEnv=ju()&&process.env.IS_VITEST}get context(){return pt.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Te.toMiliseconds(e))}}var v7=Object.defineProperty,wg=Object.getOwnPropertySymbols,y7=Object.prototype.hasOwnProperty,b7=Object.prototype.propertyIsEnumerable,vg=(t,e,r)=>e in t?v7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yg=(t,e)=>{for(var r in e||(e={}))y7.call(e,r)&&vg(t,r,e[r]);if(wg)for(var r of wg(e))b7.call(e,r)&&vg(t,r,e[r]);return t};class bh extends N4{constructor(e){super(e),this.protocol=ig,this.version=_E,this.name=wh,this.events=new yr.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||ag;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||EE.logger}));this.logger=pt.generateChildLogger(r,this.name),this.heartbeat=new Rs.HeartBeat,this.crypto=new YE(this,this.logger,e?.keychain),this.history=new g7(this,this.logger),this.expirer=new m7(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new j6(yg(yg({},xE),e?.storageOptions)),this.relayer=new u7({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new p7(this,this.logger),this.verify=new w7(this.projectId||"",this.logger)}static async init(e){const r=new bh(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(FE,n),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 _7=bh,bg="wc",_g=2,Eg="client",_h=`${bg}@${_g}:${Eg}:`,Eh={name:Eg,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},xg="WALLETCONNECT_DEEPLINK_CHOICE",E7="proposal",Cg="Proposal expired",x7="session",mc=Te.SEVEN_DAYS,C7="engine",Jo={wc_sessionPropose:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1115}}},xh={min:Te.FIVE_MINUTES,max:Te.SEVEN_DAYS},Gn={idle:"IDLE",active:"ACTIVE"},I7="request",S7=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var O7=Object.defineProperty,D7=Object.defineProperties,A7=Object.getOwnPropertyDescriptors,Ig=Object.getOwnPropertySymbols,$7=Object.prototype.hasOwnProperty,P7=Object.prototype.propertyIsEnumerable,Sg=(t,e,r)=>e in t?O7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zr=(t,e)=>{for(var r in e||(e={}))$7.call(e,r)&&Sg(t,r,e[r]);if(Ig)for(var r of Ig(e))P7.call(e,r)&&Sg(t,r,e[r]);return t},Qo=(t,e)=>D7(t,A7(e));class T7 extends z4{constructor(e){super(e),this.name=C7,this.events=new yr.exports,this.initialized=!1,this.ignoredPayloadTypes=[Hi],this.requestQueue={state:Gn.idle,queue:[]},this.sessionRequestQueue={state:Gn.idle,queue:[]},this.requestQueueDelay=Te.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Jo)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Te.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=Qo(zr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:h}=n;let f=i,v,E=!1;if(f&&(E=this.client.core.pairing.pairings.get(f).active),!f||!E){const{topic:L,uri:$}=await this.client.core.pairing.create();f=L,v=$}const _=await this.client.core.crypto.generateKeyPair(),S=zr({requiredNamespaces:o,optionalNamespaces:c,relays:h??[{protocol:og}],proposer:{publicKey:_,metadata:this.client.metadata}},l&&{sessionProperties:l}),{reject:P,resolve:j,done:H}=As(Te.FIVE_MINUTES,Cg);if(this.events.once(tr("session_connect"),async({error:L,session:$})=>{if(L)P(L);else if($){$.self.publicKey=_;const T=Qo(zr({},$),{requiredNamespaces:$.requiredNamespaces,optionalNamespaces:$.optionalNamespaces});await this.client.session.set($.topic,T),await this.setExpiry($.topic,$.expiry),f&&await this.client.core.pairing.updateMetadata({topic:f,metadata:$.peer.metadata}),j(T)}}),!f){const{message:L}=_e("NO_MATCHING_KEY",`connect() pairing topic: ${f}`);throw new Error(L)}const Z=await this.sendRequest({topic:f,method:"wc_sessionPropose",params:S}),N=En(Te.FIVE_MINUTES);return await this.setProposal(Z,zr({id:Z,expiry:N},S)),{uri:v,approval:H}},this.pair=async r=>(await this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{await 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:f,requiredNamespaces:v,optionalNamespaces:E}=l;h=h||"",Ps(v)||(v=Tb(o,"approve()"));const _=await this.client.core.crypto.generateKeyPair(),S=f.publicKey,P=await this.client.core.crypto.generateSharedKey(_,S);h&&n&&(await this.client.core.pairing.updateMetadata({topic:h,metadata:f.metadata}),await this.sendResult({id:n,topic:h,result:{relay:{protocol:i??"irn"},responderPublicKey:_}}),await this.client.proposal.delete(n,Zt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}));const j=zr({relay:{protocol:i??"irn"},namespaces:o,requiredNamespaces:v,optionalNamespaces:E,pairingTopic:h,controller:{publicKey:_,metadata:this.client.metadata},expiry:En(mc)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(P),await this.sendRequest({topic:P,method:"wc_sessionSettle",params:j,throwOnFailedPublish:!0});const H=Qo(zr({},j),{topic:P,pairingTopic:h,acknowledged:!1,self:j.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:_});return await this.client.session.set(P,H),await this.setExpiry(P,En(mc)),{topic:P,acknowledged:()=>new Promise(Z=>setTimeout(()=>Z(this.client.session.get(P)),500))}},this.reject=async r=>{await 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=>{await this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,o=await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i}}),{done:c,resolve:l,reject:h}=As();return this.events.once(tr("session_update",o),({error:f})=>{f?h(f):l()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:c}},this.extend=async r=>{await this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest({topic:n,method:"wc_sessionExtend",params:{}}),{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,En(mc)),{acknowledged:o}},this.request=async r=>{await this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:o,expiry:c}=r,l=uh(),{done:h,resolve:f,reject:v}=As(c);return this.events.once(tr("session_request",l),({error:E,result:_})=>{E?v(E):f(_)}),await Promise.all([new Promise(async E=>{await this.sendRequest({clientRpcId:l,topic:o,method:"wc_sessionRequest",params:{request:i,chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(_=>v(_)),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:l}),E()}),new Promise(async E=>{const _=await this.client.core.storage.getItem(xg);vb({id:l,topic:o,wcDeepLink:_}),E()}),h()]).then(E=>E[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;Vn(i)?await this.sendResult({id:o,topic:n,result:i.result,throwOnFailedPublish:!0}):xn(i)&&await this.sendError(o,n,i.error),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest({topic:n,method:"wc_sessionPing",params:{}}),{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=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:o}=r;await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:o}})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest({topic:n,method:"wc_sessionDelete",params:Zt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Lb(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)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),this.client.session.delete(r,Zt("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(xg).catch(o=>this.client.logger.warn(o))},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.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(o=>o.id!==r),i&&(this.sessionRequestQueue.state=Gn.idle)},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=Jo.wc_sessionRequest.req.ttl,{id:i,topic:o,params:c,verifyContext:l}=r;await this.client.pendingRequest.set(i,{id:i,topic:o,params:c,verifyContext:l}),n&&this.client.core.expirer.set(i,En(n))},this.sendRequest=async r=>{const{topic:n,method:i,params:o,expiry:c,relayRpcId:l,clientRpcId:h,throwOnFailedPublish:f}=r,v=Ns(i,o,h);if(Po()&&S7.includes(i)){const S=Ds(JSON.stringify(v));this.client.core.verify.register({attestationId:S})}const E=await this.client.core.crypto.encode(n,v),_=Jo[i].req;return c&&(_.ttl=c),l&&(_.id=l),this.client.core.history.set(n,v),f?(_.internal=Qo(zr({},_.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,E,_)):this.client.core.relayer.publish(n,E,_).catch(S=>this.client.logger.error(S)),v.id},this.sendResult=async r=>{const{id:n,topic:i,result:o,throwOnFailedPublish:c}=r,l=hh(n,o),h=await this.client.core.crypto.encode(i,l),f=await this.client.core.history.get(i,n),v=Jo[f.request.method].res;c?(v.internal=Qo(zr({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,h,v)):this.client.core.relayer.publish(i,h,v).catch(E=>this.client.logger.error(E)),await this.client.core.history.resolve(l)},this.sendError=async(r,n,i)=>{const o=hc(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),h=Jo[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=>{fi(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{fi(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Gn.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Gn.active;const r=this.requestQueue.queue.shift();if(r)try{this.processRequest(r),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Gn.idle},this.processRequest=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(zr({},n.params));const c=En(Te.FIVE_MINUTES),l=zr({id:o,pairingTopic:r,expiry:c},i);await this.setProposal(o,l);const h=Ds(JSON.stringify(n)),f=await this.getVerifyContext(h,l.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:l,verifyContext:f})}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 f=await this.client.core.crypto.generateSharedKey(l,h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:f});const v=await this.client.core.relayer.subscribe(f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:v}),await this.client.core.pairing.activate({topic:r})}else xn(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:f,requiredNamespaces:v,optionalNamespaces:E,sessionProperties:_,pairingTopic:S}=n.params,P=zr({topic:r,relay:c,expiry:h,namespaces:f,acknowledged:!0,pairingTopic:S,requiredNamespaces:v,optionalNamespaces:E,controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},_&&{sessionProperties:_});await this.sendResult({id:n.id,topic:r,result:!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),{})):xn(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{const c=`${r}_session_update`,l=ac.get(c);if(l&&this.isRequestOutOfSync(l,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidUpdate(zr({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:o,topic:r,result:!0}),this.client.events.emit("session_update",{id:o,topic:r,params:i}),ac.set(c,o)}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(tr("session_update",i),{}):xn(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,En(mc)),await this.sendResult({id:i,topic:r,result:!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),{}):xn(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({id:i,topic:r,result:!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),{}):xn(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(Ir.publish,async()=>{o(await this.deleteSession(r))})}),this.sendResult({id:i,topic:r,result:!0})]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(o){this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidRequest(zr({topic:r},o));const c=Ds(JSON.stringify(Ns("wc_sessionRequest",o,i))),l=this.client.session.get(r),h=await this.getVerifyContext(c,l.peer.metadata),f={id:i,topic:r,params:o,verifyContext:h};await this.setPendingSessionRequest(f),this.addSessionRequestToSessionRequestQueue(f),this.processSessionRequestQueue()}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}):xn(n)&&this.events.emit(tr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{const c=`${r}_session_event_${o.event.name}`,l=ac.get(c);if(l&&this.isRequestOutOfSync(l,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(zr({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o}),ac.set(c,i)}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Gn.idle,this.processSessionRequestQueue()},Te.toMiliseconds(this.requestQueueDelay))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Gn.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Gn.active,this.client.events.emit("session_request",r)}catch(n){this.client.logger.error(n)}},this.onPairingCreated=r=>{if(r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest(r.topic,Ns("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer},n.id))},this.isValidConnect=async r=>{if(!Wr(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),!Kb(l,!0)){const{message:h}=_e("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(h)}!Pr(i)&&Ps(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Pr(o)&&Ps(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Pr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=Vb(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Wr(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=oc(i,"approve()");if(h)throw new Error(h.message);const f=K1(l.requiredNamespaces,i,"approve()");if(f)throw new Error(f.message);if(!pr(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(!Wr(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),!Zb(i)){const{message:o}=_e("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!Wr(r)){const{message:f}=_e("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(f)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!q1(n)){const{message:f}=_e("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(f)}const l=Bb(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const h=oc(o,"onSessionSettleRequest()");if(h)throw new Error(h.message);if(fi(c)){const{message:f}=_e("EXPIRED","onSessionSettleRequest()");throw new Error(f)}},this.isValidUpdate=async r=>{if(!Wr(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=oc(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(!Wr(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(!Wr(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(!V1(l,o)){const{message:h}=_e("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(h)}if(!Yb(i)){const{message:h}=_e("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(h)}if(!Xb(l,o,i.method)){const{message:h}=_e("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(h)}if(c&&!n6(c,xh)){const{message:h}=_e("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${xh.min} and ${xh.max}`);throw new Error(h)}},this.isValidRespond=async r=>{if(!Wr(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),!Jb(i)){const{message:o}=_e("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Wr(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(!Wr(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(!V1(c,o)){const{message:l}=_e("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!Qb(i)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!e6(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(!Wr(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||pc,validation:"UNKNOWN",origin:n.url||""}};try{const o=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});o&&(i.verified.origin=o.origin,i.verified.isScam=o.isScam,i.verified.validation=o.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(o){this.client.logger.info(o)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!pr(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)}})}}async isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Ir.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);try{fh(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):fc(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.client.core.history.delete(r,i.id)):this.onRelayEventUnknownPayload({topic:r,payload:i})}catch(o){this.client.logger.error(o)}})}registerExpirerEvents(){this.client.core.expirer.on(cn.expired,async e=>{const{topic:r,id:n}=B1(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}))})}registerPairingEvents(){this.client.core.pairing.events.on(Zo.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!pr(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(fi(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=_e("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!pr(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(fi(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(pr(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(!Gb(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(fi(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=_e("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class R7 extends gc{constructor(e,r){super(e,r,E7,_h),this.core=e,this.logger=r}}class N7 extends gc{constructor(e,r){super(e,r,x7,_h),this.core=e,this.logger=r}}class L7 extends gc{constructor(e,r){super(e,r,I7,_h,n=>n.id),this.core=e,this.logger=r}}class Ch extends W4{constructor(e){super(e),this.protocol=bg,this.version=_g,this.name=Eh.name,this.events=new yr.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||Eh.name,this.metadata=e?.metadata||hb();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||Eh.logger}));this.core=e?.core||new _7(e),this.logger=pt.generateChildLogger(r,this.name),this.session=new N7(this.core,this.logger),this.proposal=new R7(this.core,this.logger),this.pendingRequest=new L7(this.core,this.logger),this.engine=new T7(this)}static async init(e){const r=new Ch(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 Ih={exports:{}};(function(t,e){var r=typeof self<"u"?self:dr,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 f=["[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&&f.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 S(O){var U={next:function(){var ce=O.shift();return{done:ce===void 0,value:ce}}};return l.iterable&&(U[Symbol.iterator]=function(){return U}),U}function P(O){this.map={},O instanceof P?O.forEach(function(U,ce){this.append(ce,U)},this):Array.isArray(O)?O.forEach(function(U){this.append(U[0],U[1])},this):O&&Object.getOwnPropertyNames(O).forEach(function(U){this.append(U,O[U])},this)}P.prototype.append=function(O,U){O=E(O),U=_(U);var ce=this.map[O];this.map[O]=ce?ce+", "+U:U},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,U){this.map[E(O)]=_(U)},P.prototype.forEach=function(O,U){for(var ce in this.map)this.map.hasOwnProperty(ce)&&O.call(U,this.map[ce],ce,this)},P.prototype.keys=function(){var O=[];return this.forEach(function(U,ce){O.push(ce)}),S(O)},P.prototype.values=function(){var O=[];return this.forEach(function(U){O.push(U)}),S(O)},P.prototype.entries=function(){var O=[];return this.forEach(function(U,ce){O.push([ce,U])}),S(O)},l.iterable&&(P.prototype[Symbol.iterator]=P.prototype.entries);function j(O){if(O.bodyUsed)return Promise.reject(new TypeError("Already read"));O.bodyUsed=!0}function H(O){return new Promise(function(U,ce){O.onload=function(){U(O.result)},O.onerror=function(){ce(O.error)}})}function Z(O){var U=new FileReader,ce=H(U);return U.readAsArrayBuffer(O),ce}function N(O){var U=new FileReader,ce=H(U);return U.readAsText(O),ce}function L(O){for(var U=new Uint8Array(O),ce=new Array(U.length),le=0;le<U.length;le++)ce[le]=String.fromCharCode(U[le]);return ce.join("")}function $(O){if(O.slice)return O.slice(0);var U=new Uint8Array(O.byteLength);return U.set(new Uint8Array(O)),U.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=j(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?j(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Z)}),this.text=function(){var O=j(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 d(O){var U=O.toUpperCase();return I.indexOf(U)>-1?U:O}function x(O,U){U=U||{};var ce=U.body;if(O instanceof x){if(O.bodyUsed)throw new TypeError("Already read");this.url=O.url,this.credentials=O.credentials,U.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=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new P(U.headers)),this.method=d(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.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 U=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," ");U.append(decodeURIComponent(re),decodeURIComponent(ne))}}),U}function W(O){var U=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();U.append(ne,ae)}}),U}T.call(x.prototype);function ee(O,U){U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in U?U.statusText:"OK",this.headers=new P(U.headers),this.url=U.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,U){if(de.indexOf(U)===-1)throw new RangeError("Invalid status code");return new ee(null,{status:U,headers:{location:O}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(U,ce){this.message=U,this.name=ce;var le=Error(U);this.stack=le.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function me(O,U){return new Promise(function(ce,le){var re=new x(O,U);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:W(ne.getAllResponseHeaders()||"")};ie.url="responseURL"in ne?ne.responseURL:ie.headers.get("X-Request-URL");var De="response"in ne?ne.response:ne.responseText;ce(new ee(De,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,De){ne.setRequestHeader(De,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})(Ih,Ih.exports);var Og=Sw(Ih.exports);const Dg={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Ag=10;class Ki{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new yr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Np(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=zo(e),o=await(await Og(this.url,Object.assign(Object.assign({},Dg),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Np(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=zo({id:1,jsonrpc:"2.0",method:"test",params:[]});await Og(e,Object.assign(Object.assign({},Dg),{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"?ih(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=hc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return Op(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Ag&&this.events.setMaxListeners(Ag)}}const $g="error",M7="wss://relay.walletconnect.com",U7="wc",j7="universal_provider",Pg=`${U7}@2:${j7}:`,F7="https://rpc.walletconnect.com/v1/",gi={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Sh={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__",f=500,v="__lodash_placeholder__",E=1,_=2,S=4,P=1,j=2,H=1,Z=2,N=4,L=8,$=16,T=32,I=64,d=128,x=256,J=512,W=30,ee="...",de=800,me=16,O=1,U=2,ce=3,le=1/0,re=9007199254740991,ne=17976931348623157e292,ae=0/0,ie=4294967295,De=ie-1,ge=ie>>>1,Be=[["ary",d],["bind",H],["bindKey",Z],["curry",L],["curryRight",$],["flip",J],["partial",T],["partialRight",I],["rearg",x]],ye="[object Arguments]",Me="[object Array]",Q="[object AsyncFunction]",Y="[object Boolean]",z="[object Date]",w="[object DOMException]",F="[object Error]",we="[object Function]",ve="[object GeneratorFunction]",Ue="[object Map]",nt="[object Number]",at="[object Null]",Ge="[object Object]",At="[object Promise]",$t="[object Proxy]",Je="[object RegExp]",He="[object Set]",ke="[object String]",Ke="[object Symbol]",rt="[object Undefined]",je="[object WeakMap]",Ze="[object WeakSet]",b="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",A="[object Float64Array]",B="[object Int8Array]",K="[object Int16Array]",X="[object Int32Array]",Ee="[object Uint8Array]",Re="[object Uint8ClampedArray]",st="[object Uint16Array]",ht="[object Uint32Array]",lt=/\b__p \+= '';/g,Ur=/\b(__p \+=) '' \+/g,ei=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Di=/&(?:amp|lt|gt|quot|#39);/g,us=/[&<>"']/g,Ht=RegExp(Di.source),Lt=RegExp(us.source),Wt=/<%-([\s\S]+?)%>/g,zt=/<%([\s\S]+?)%>/g,Ft=/<%=([\s\S]+?)%>/g,Mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nr=/^\w*$/,ir=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qt=/[\\^$.*+?()[\]{}|]/g,sr=RegExp(qt.source),Vt=/^\s+/,Jt=/\s/,Kt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pt=/\{\n\/\* \[wrapped with (.+)\] \*/,or=/,? & /,ar=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Kf=/[()=,{}\[\]\/\s]/,Gf=/\\(\\)?/g,Zf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dn=/\w*$/,Yf=/^[-+]0x[0-9a-f]+$/i,Jf=/^0b[01]+$/i,Qf=/^\[object .+?Constructor\]$/,Xf=/^0o[0-7]+$/i,e0=/^(?:0|[1-9]\d*)$/,ti=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,to=/($^)/,t0=/['\n\r\u2028\u2029\\]/g,ro="\\ud800-\\udfff",r0="\\u0300-\\u036f",n0="\\ufe20-\\ufe2f",no="\\u20d0-\\u20ff",il=r0+n0+no,sl="\\u2700-\\u27bf",In="a-z\\xdf-\\xf6\\xf8-\\xff",i0="\\xac\\xb1\\xd7\\xf7",s0="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",o0="\\u2000-\\u206f",a0=" \\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",ol="A-Z\\xc0-\\xd6\\xd8-\\xde",al="\\ufe0e\\ufe0f",hs=i0+s0+o0+a0,Ca="['\u2019]",fs="["+ro+"]",Ia="["+hs+"]",ds="["+il+"]",cl="\\d+",c0="["+sl+"]",ll="["+In+"]",ul="[^"+ro+hs+cl+sl+In+ol+"]",io="\\ud83c[\\udffb-\\udfff]",l0="(?:"+ds+"|"+io+")",hl="[^"+ro+"]",so="(?:\\ud83c[\\udde6-\\uddff]){2}",Ai="[\\ud800-\\udbff][\\udc00-\\udfff]",tn="["+ol+"]",fl="\\u200d",dl="(?:"+ll+"|"+ul+")",Bn="(?:"+tn+"|"+ul+")",pl="(?:"+Ca+"(?:d|ll|m|re|s|t|ve))?",gl="(?:"+Ca+"(?:D|LL|M|RE|S|T|VE))?",ml=l0+"?",wl="["+al+"]?",u0="(?:"+fl+"(?:"+[hl,so,Ai].join("|")+")"+wl+ml+")*",ri="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",yl=wl+ml+u0,oo="(?:"+[c0,so,Ai].join("|")+")"+yl,h0="(?:"+[hl+ds+"?",ds,so,Ai,fs].join("|")+")",Sa=RegExp(Ca,"g"),f0=RegExp(ds,"g"),ao=RegExp(io+"(?="+io+")|"+h0+yl,"g"),bl=RegExp([tn+"?"+ll+"+"+pl+"(?="+[Ia,tn,"$"].join("|")+")",Bn+"+"+gl+"(?="+[Ia,tn+dl,"$"].join("|")+")",tn+"?"+dl+"+"+pl,tn+"+"+gl,vl,ri,cl,oo].join("|"),"g"),_l=RegExp("["+fl+ro+il+al+"]"),ps=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,El=["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"],d0=-1,Ct={};Ct[m]=Ct[A]=Ct[B]=Ct[K]=Ct[X]=Ct[Ee]=Ct[Re]=Ct[st]=Ct[ht]=!0,Ct[ye]=Ct[Me]=Ct[b]=Ct[Y]=Ct[p]=Ct[z]=Ct[F]=Ct[we]=Ct[Ue]=Ct[nt]=Ct[Ge]=Ct[Je]=Ct[He]=Ct[ke]=Ct[je]=!1;var xt={};xt[ye]=xt[Me]=xt[b]=xt[p]=xt[Y]=xt[z]=xt[m]=xt[A]=xt[B]=xt[K]=xt[X]=xt[Ue]=xt[nt]=xt[Ge]=xt[Je]=xt[He]=xt[ke]=xt[Ke]=xt[Ee]=xt[Re]=xt[st]=xt[ht]=!0,xt[F]=xt[we]=xt[je]=!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,Qe=parseInt,Tt=typeof Jo=="object"&&Jo&&Jo.Object===Object&&Jo,cr=typeof self=="object"&&self&&self.Object===Object&&self,mt=Tt||cr||Function("return this")(),St=e&&!e.nodeType&&e,Qt=St&&!0&&t&&!t.nodeType&&t,Vr=Qt&&Qt.exports===St,lr=Vr&&Tt.process,Rt=function(){try{var V=Qt&&Qt.require&&Qt.require("util").types;return V||lr&&lr.binding&&lr.binding("util")}catch{}}(),jr=Rt&&Rt.isArrayBuffer,Sn=Rt&&Rt.isDate,pn=Rt&&Rt.isMap,kn=Rt&&Rt.isRegExp,Oa=Rt&&Rt.isSet,gs=Rt&&Rt.isTypedArray;function wr(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 ED(V,se,te,Ie){for(var Ye=-1,vt=V==null?0:V.length;++Ye<vt;){var hr=V[Ye];se(Ie,hr,te(hr),V)}return Ie}function gn(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie&&se(V[te],te,V)!==!1;);return V}function xD(V,se){for(var te=V==null?0:V.length;te--&&se(V[te],te,V)!==!1;);return V}function Sm(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie;)if(!se(V[te],te,V))return!1;return!0}function $i(V,se){for(var te=-1,Ie=V==null?0:V.length,Ye=0,vt=[];++te<Ie;){var hr=V[te];se(hr,te,V)&&(vt[Ye++]=hr)}return vt}function xl(V,se){var te=V==null?0:V.length;return!!te&&co(V,se,0)>-1}function p0(V,se,te){for(var Ie=-1,Ye=V==null?0:V.length;++Ie<Ye;)if(te(se,V[Ie]))return!0;return!1}function Ut(V,se){for(var te=-1,Ie=V==null?0:V.length,Ye=Array(Ie);++te<Ie;)Ye[te]=se(V[te],te,V);return Ye}function Pi(V,se){for(var te=-1,Ie=se.length,Ye=V.length;++te<Ie;)V[Ye+te]=se[te];return V}function g0(V,se,te,Ie){var Ye=-1,vt=V==null?0:V.length;for(Ie&&vt&&(te=V[++Ye]);++Ye<vt;)te=se(te,V[Ye],Ye,V);return te}function CD(V,se,te,Ie){var Ye=V==null?0:V.length;for(Ie&&Ye&&(te=V[--Ye]);Ye--;)te=se(te,V[Ye],Ye,V);return te}function m0(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie;)if(se(V[te],te,V))return!0;return!1}var ID=w0("length");function SD(V){return V.split("")}function OD(V){return V.match(ar)||[]}function Om(V,se,te){var Ie;return te(V,function(Ye,vt,hr){if(se(Ye,vt,hr))return Ie=vt,!1}),Ie}function Cl(V,se,te,Ie){for(var Ye=V.length,vt=te+(Ie?1:-1);Ie?vt--:++vt<Ye;)if(se(V[vt],vt,V))return vt;return-1}function co(V,se,te){return se===se?FD(V,se,te):Cl(V,Dm,te)}function DD(V,se,te,Ie){for(var Ye=te-1,vt=V.length;++Ye<vt;)if(Ie(V[Ye],se))return Ye;return-1}function Dm(V){return V!==V}function Am(V,se){var te=V==null?0:V.length;return te?y0(V,se)/te:ae}function w0(V){return function(se){return se==null?r:se[V]}}function v0(V){return function(se){return V==null?r:V[se]}}function $m(V,se,te,Ie,Ye){return Ye(V,function(vt,hr,Ot){te=Ie?(Ie=!1,vt):se(te,vt,hr,Ot)}),te}function AD(V,se){var te=V.length;for(V.sort(se);te--;)V[te]=V[te].value;return V}function y0(V,se){for(var te,Ie=-1,Ye=V.length;++Ie<Ye;){var vt=se(V[Ie]);vt!==r&&(te=te===r?vt:te+vt)}return te}function b0(V,se){for(var te=-1,Ie=Array(V);++te<V;)Ie[te]=se(te);return Ie}function $D(V,se){return Ut(se,function(te){return[te,V[te]]})}function Pm(V){return V&&V.slice(0,Lm(V)+1).replace(Vt,"")}function rn(V){return function(se){return V(se)}}function _0(V,se){return Ut(se,function(te){return V[te]})}function Da(V,se){return V.has(se)}function Tm(V,se){for(var te=-1,Ie=V.length;++te<Ie&&co(se,V[te],0)>-1;);return te}function Rm(V,se){for(var te=V.length;te--&&co(se,V[te],0)>-1;);return te}function PD(V,se){for(var te=V.length,Ie=0;te--;)V[te]===se&&++Ie;return Ie}var TD=v0(R),RD=v0(q);function ND(V){return"\\"+Ce[V]}function LD(V,se){return V==null?r:V[se]}function lo(V){return _l.test(V)}function MD(V){return ps.test(V)}function UD(V){for(var se,te=[];!(se=V.next()).done;)te.push(se.value);return te}function E0(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie,Ye){te[++se]=[Ye,Ie]}),te}function Nm(V,se){return function(te){return V(se(te))}}function Ti(V,se){for(var te=-1,Ie=V.length,Ye=0,vt=[];++te<Ie;){var hr=V[te];(hr===se||hr===v)&&(V[te]=v,vt[Ye++]=te)}return vt}function Il(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie){te[++se]=Ie}),te}function jD(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie){te[++se]=[Ie,Ie]}),te}function FD(V,se,te){for(var Ie=te-1,Ye=V.length;++Ie<Ye;)if(V[Ie]===se)return Ie;return-1}function BD(V,se,te){for(var Ie=te+1;Ie--;)if(V[Ie]===se)return Ie;return Ie}function uo(V){return lo(V)?HD(V):ID(V)}function On(V){return lo(V)?WD(V):SD(V)}function Lm(V){for(var se=V.length;se--&&Jt.test(V.charAt(se)););return se}var kD=v0(fe);function HD(V){for(var se=ao.lastIndex=0;ao.test(V);)++se;return se}function WD(V){return V.match(ao)||[]}function zD(V){return V.match(bl)||[]}var qD=function V(se){se=se==null?mt:ho.defaults(mt.Object(),se,ho.pick(mt,El));var te=se.Array,Ie=se.Date,Ye=se.Error,vt=se.Function,hr=se.Math,Ot=se.Object,x0=se.RegExp,VD=se.String,mn=se.TypeError,Sl=te.prototype,KD=vt.prototype,fo=Ot.prototype,Ol=se["__core-js_shared__"],Dl=KD.toString,bt=fo.hasOwnProperty,GD=0,Mm=function(){var s=/[^.]+$/.exec(Ol&&Ol.keys&&Ol.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Al=fo.toString,ZD=Dl.call(Ot),YD=mt._,JD=x0("^"+Dl.call(bt).replace(qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$l=Vr?se.Buffer:r,Ri=se.Symbol,Pl=se.Uint8Array,Um=$l?$l.allocUnsafe:r,Tl=Nm(Ot.getPrototypeOf,Ot),jm=Ot.create,Fm=fo.propertyIsEnumerable,Rl=Sl.splice,Bm=Ri?Ri.isConcatSpreadable:r,Aa=Ri?Ri.iterator:r,ms=Ri?Ri.toStringTag:r,Nl=function(){try{var s=_s(Ot,"defineProperty");return s({},"",{}),s}catch{}}(),QD=se.clearTimeout!==mt.clearTimeout&&se.clearTimeout,XD=Ie&&Ie.now!==mt.Date.now&&Ie.now,eA=se.setTimeout!==mt.setTimeout&&se.setTimeout,Ll=hr.ceil,Ml=hr.floor,C0=Ot.getOwnPropertySymbols,tA=$l?$l.isBuffer:r,km=se.isFinite,rA=Sl.join,nA=Nm(Ot.keys,Ot),fr=hr.max,Or=hr.min,iA=Ie.now,sA=se.parseInt,Hm=hr.random,oA=Sl.reverse,I0=_s(se,"DataView"),$a=_s(se,"Map"),S0=_s(se,"Promise"),po=_s(se,"Set"),Pa=_s(se,"WeakMap"),Ta=_s(Ot,"create"),Ul=Pa&&new Pa,go={},aA=Es(I0),cA=Es($a),lA=Es(S0),uA=Es(po),hA=Es(Pa),jl=Ri?Ri.prototype:r,Ra=jl?jl.valueOf:r,Wm=jl?jl.toString:r;function C(s){if(Gt(s)&&!Xe(s)&&!(s instanceof dt)){if(s instanceof wn)return s;if(bt.call(s,"__wrapped__"))return z2(s)}return new wn(s)}var mo=function(){function s(){}return function(a){if(!Bt(a))return{};if(jm)return jm(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function Fl(){}function wn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}C.templateSettings={escape:Wt,evaluate:zt,interpolate:Ft,variable:"",imports:{_:C}},C.prototype=Fl.prototype,C.prototype.constructor=C,wn.prototype=mo(Fl.prototype),wn.prototype.constructor=wn;function dt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function fA(){var s=new dt(this.__wrapped__);return s.__actions__=Kr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Kr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Kr(this.__views__),s}function dA(){if(this.__filtered__){var s=new dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function pA(){var s=this.__wrapped__.value(),a=this.__dir__,u=Xe(s),g=a<0,y=u?s.length:0,D=S$(0,y,this.__views__),M=D.start,k=D.end,G=k-M,ue=g?k:M-1,he=this.__iteratees__,pe=he.length,be=0,Pe=Or(G,this.__takeCount__);if(!u||!g&&y==G&&Pe==G)return d2(s,this.__actions__);var ze=[];e:for(;G--&&be<Pe;){ue+=a;for(var ot=-1,qe=s[ue];++ot<pe;){var ft=he[ot],wt=ft.iteratee,on=ft.type,kr=wt(qe);if(on==U)qe=kr;else if(!kr){if(on==O)continue e;break e}}ze[be++]=qe}return ze}dt.prototype=mo(Fl.prototype),dt.prototype.constructor=dt;function ws(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 gA(){this.__data__=Ta?Ta(null):{},this.size=0}function mA(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function wA(s){var a=this.__data__;if(Ta){var u=a[s];return u===h?r:u}return bt.call(a,s)?a[s]:r}function vA(s){var a=this.__data__;return Ta?a[s]!==r:bt.call(a,s)}function yA(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Ta&&a===r?h:a,this}ws.prototype.clear=gA,ws.prototype.delete=mA,ws.prototype.get=wA,ws.prototype.has=vA,ws.prototype.set=yA;function ni(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 bA(){this.__data__=[],this.size=0}function _A(s){var a=this.__data__,u=Bl(a,s);if(u<0)return!1;var g=a.length-1;return u==g?a.pop():Rl.call(a,u,1),--this.size,!0}function EA(s){var a=this.__data__,u=Bl(a,s);return u<0?r:a[u][1]}function xA(s){return Bl(this.__data__,s)>-1}function CA(s,a){var u=this.__data__,g=Bl(u,s);return g<0?(++this.size,u.push([s,a])):u[g][1]=a,this}ni.prototype.clear=bA,ni.prototype.delete=_A,ni.prototype.get=EA,ni.prototype.has=xA,ni.prototype.set=CA;function ii(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 IA(){this.size=0,this.__data__={hash:new ws,map:new($a||ni),string:new ws}}function SA(s){var a=Ql(this,s).delete(s);return this.size-=a?1:0,a}function OA(s){return Ql(this,s).get(s)}function DA(s){return Ql(this,s).has(s)}function AA(s,a){var u=Ql(this,s),g=u.size;return u.set(s,a),this.size+=u.size==g?0:1,this}ii.prototype.clear=IA,ii.prototype.delete=SA,ii.prototype.get=OA,ii.prototype.has=DA,ii.prototype.set=AA;function vs(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new ii;++a<u;)this.add(s[a])}function $A(s){return this.__data__.set(s,h),this}function PA(s){return this.__data__.has(s)}vs.prototype.add=vs.prototype.push=$A,vs.prototype.has=PA;function Dn(s){var a=this.__data__=new ni(s);this.size=a.size}function TA(){this.__data__=new ni,this.size=0}function RA(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function NA(s){return this.__data__.get(s)}function LA(s){return this.__data__.has(s)}function MA(s,a){var u=this.__data__;if(u instanceof ni){var g=u.__data__;if(!$a||g.length<i-1)return g.push([s,a]),this.size=++u.size,this;u=this.__data__=new ii(g)}return u.set(s,a),this.size=u.size,this}Dn.prototype.clear=TA,Dn.prototype.delete=RA,Dn.prototype.get=NA,Dn.prototype.has=LA,Dn.prototype.set=MA;function zm(s,a){var u=Xe(s),g=!u&&xs(s),y=!u&&!g&&ji(s),D=!u&&!g&&!y&&bo(s),M=u||g||y||D,k=M?b0(s.length,VD):[],G=k.length;for(var ue in s)(a||bt.call(s,ue))&&!(M&&(ue=="length"||y&&(ue=="offset"||ue=="parent")||D&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||ci(ue,G)))&&k.push(ue);return k}function qm(s){var a=s.length;return a?s[U0(0,a-1)]:r}function UA(s,a){return Xl(Kr(s),ys(a,0,s.length))}function jA(s){return Xl(Kr(s))}function O0(s,a,u){(u!==r&&!An(s[a],u)||u===r&&!(a in s))&&si(s,a,u)}function Na(s,a,u){var g=s[a];(!(bt.call(s,a)&&An(g,u))||u===r&&!(a in s))&&si(s,a,u)}function Bl(s,a){for(var u=s.length;u--;)if(An(s[u][0],a))return u;return-1}function FA(s,a,u,g){return Ni(s,function(y,D,M){a(g,y,u(y),M)}),g}function Vm(s,a){return s&&Wn(a,vr(a),s)}function BA(s,a){return s&&Wn(a,Zr(a),s)}function si(s,a,u){a=="__proto__"&&Nl?Nl(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function D0(s,a){for(var u=-1,g=a.length,y=te(g),D=s==null;++u<g;)y[u]=D?r:cd(s,a[u]);return y}function ys(s,a,u){return s===s&&(u!==r&&(s=s<=u?s:u),a!==r&&(s=s>=a?s:a)),s}function vn(s,a,u,g,y,D){var M,k=a&E,G=a&_,ue=a&S;if(u&&(M=y?u(s,g,y,D):u(s)),M!==r)return M;if(!Bt(s))return s;var he=Xe(s);if(he){if(M=D$(s),!k)return Kr(s,M)}else{var pe=Dr(s),be=pe==we||pe==ve;if(ji(s))return m2(s,k);if(pe==Ge||pe==ye||be&&!y){if(M=G||be?{}:L2(s),!k)return G?w$(s,BA(M,s)):m$(s,Vm(M,s))}else{if(!xt[pe])return y?s:{};M=A$(s,pe,k)}}D||(D=new Dn);var Pe=D.get(s);if(Pe)return Pe;D.set(s,M),uw(s)?s.forEach(function(qe){M.add(vn(qe,a,u,qe,s,D))}):cw(s)&&s.forEach(function(qe,ft){M.set(ft,vn(qe,a,u,ft,s,D))});var ze=ue?G?G0:K0:G?Zr:vr,ot=he?r:ze(s);return gn(ot||s,function(qe,ft){ot&&(ft=qe,qe=s[ft]),Na(M,ft,vn(qe,a,u,ft,s,D))}),M}function kA(s){var a=vr(s);return function(u){return Km(u,s,a)}}function Km(s,a,u){var g=u.length;if(s==null)return!g;for(s=Ot(s);g--;){var y=u[g],D=a[y],M=s[y];if(M===r&&!(y in s)||!D(M))return!1}return!0}function Gm(s,a,u){if(typeof s!="function")throw new mn(c);return ka(function(){s.apply(r,u)},a)}function La(s,a,u,g){var y=-1,D=xl,M=!0,k=s.length,G=[],ue=a.length;if(!k)return G;u&&(a=Ut(a,rn(u))),g?(D=p0,M=!1):a.length>=i&&(D=Da,M=!1,a=new vs(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;G.push(he)}else D(a,pe,g)||G.push(he)}return G}var Ni=_2(Hn),Zm=_2($0,!0);function HA(s,a){var u=!0;return Ni(s,function(g,y,D){return u=!!a(g,y,D),u}),u}function kl(s,a,u){for(var g=-1,y=s.length;++g<y;){var D=s[g],M=a(D);if(M!=null&&(k===r?M===M&&!sn(M):u(M,k)))var k=M,G=D}return G}function WA(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:fw(g);u<g;)s[u++]=a;return s}function Ym(s,a){var u=[];return Ni(s,function(g,y,D){a(g,y,D)&&u.push(g)}),u}function xr(s,a,u,g,y){var D=-1,M=s.length;for(u||(u=P$),y||(y=[]);++D<M;){var k=s[D];a>0&&u(k)?a>1?xr(k,a-1,u,g,y):Pi(y,k):g||(y[y.length]=k)}return y}var A0=E2(),Jm=E2(!0);function Hn(s,a){return s&&A0(s,a,vr)}function $0(s,a){return s&&Jm(s,a,vr)}function Hl(s,a){return $i(a,function(u){return li(s[u])})}function bs(s,a){a=Mi(a,s);for(var u=0,g=a.length;s!=null&&u<g;)s=s[zn(a[u++])];return u&&u==g?s:r}function Qm(s,a,u){var g=a(s);return Xe(s)?g:Pi(g,u(s))}function Fr(s){return s==null?s===r?rt:at:ms&&ms in Ot(s)?I$(s):j$(s)}function P0(s,a){return s>a}function zA(s,a){return s!=null&&bt.call(s,a)}function qA(s,a){return s!=null&&a in Ot(s)}function VA(s,a,u){return s>=Or(a,u)&&s<fr(a,u)}function T0(s,a,u){for(var g=u?p0:xl,y=s[0].length,D=s.length,M=D,k=te(D),G=1/0,ue=[];M--;){var he=s[M];M&&a&&(he=Ut(he,rn(a))),G=Or(he.length,G),k[M]=!u&&(a||y>=120&&he.length>=120)?new vs(M&&he):r}he=s[0];var pe=-1,be=k[0];e:for(;++pe<y&&ue.length<G;){var Pe=he[pe],ze=a?a(Pe):Pe;if(Pe=u||Pe!==0?Pe:0,!(be?Da(be,ze):g(ue,ze,u))){for(M=D;--M;){var ot=k[M];if(!(ot?Da(ot,ze):g(s[M],ze,u)))continue e}be&&be.push(ze),ue.push(Pe)}}return ue}function KA(s,a,u,g){return Hn(s,function(y,D,M){a(g,u(y),D,M)}),g}function Ma(s,a,u){a=Mi(a,s),s=F2(s,a);var g=s==null?s:s[zn(bn(a))];return g==null?r:wr(g,s,u)}function Xm(s){return Gt(s)&&Fr(s)==ye}function GA(s){return Gt(s)&&Fr(s)==b}function ZA(s){return Gt(s)&&Fr(s)==z}function Ua(s,a,u,g,y){return s===a?!0:s==null||a==null||!Gt(s)&&!Gt(a)?s!==s&&a!==a:YA(s,a,u,g,Ua,y)}function YA(s,a,u,g,y,D){var M=Xe(s),k=Xe(a),G=M?Me:Dr(s),ue=k?Me:Dr(a);G=G==ye?Ge:G,ue=ue==ye?Ge:ue;var he=G==Ge,pe=ue==Ge,be=G==ue;if(be&&ji(s)){if(!ji(a))return!1;M=!0,he=!1}if(be&&!he)return D||(D=new Dn),M||bo(s)?T2(s,a,u,g,y,D):x$(s,a,G,u,g,y,D);if(!(u&P)){var Pe=he&&bt.call(s,"__wrapped__"),ze=pe&&bt.call(a,"__wrapped__");if(Pe||ze){var ot=Pe?s.value():s,qe=ze?a.value():a;return D||(D=new Dn),y(ot,qe,u,g,D)}}return be?(D||(D=new Dn),C$(s,a,u,g,y,D)):!1}function JA(s){return Gt(s)&&Dr(s)==Ue}function R0(s,a,u,g){var y=u.length,D=y,M=!g;if(s==null)return!D;for(s=Ot(s);y--;){var k=u[y];if(M&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++y<D;){k=u[y];var G=k[0],ue=s[G],he=k[1];if(M&&k[2]){if(ue===r&&!(G in s))return!1}else{var pe=new Dn;if(g)var be=g(ue,he,G,s,a,pe);if(!(be===r?Ua(he,ue,P|j,g,pe):be))return!1}}return!0}function e2(s){if(!Bt(s)||R$(s))return!1;var a=li(s)?JD:Qf;return a.test(Es(s))}function QA(s){return Gt(s)&&Fr(s)==Je}function XA(s){return Gt(s)&&Dr(s)==He}function e$(s){return Gt(s)&&su(s.length)&&!!Ct[Fr(s)]}function t2(s){return typeof s=="function"?s:s==null?Yr:typeof s=="object"?Xe(s)?i2(s[0],s[1]):n2(s):xw(s)}function N0(s){if(!Ba(s))return nA(s);var a=[];for(var u in Ot(s))bt.call(s,u)&&u!="constructor"&&a.push(u);return a}function t$(s){if(!Bt(s))return U$(s);var a=Ba(s),u=[];for(var g in s)g=="constructor"&&(a||!bt.call(s,g))||u.push(g);return u}function L0(s,a){return s<a}function r2(s,a){var u=-1,g=Gr(s)?te(s.length):[];return Ni(s,function(y,D,M){g[++u]=a(y,D,M)}),g}function n2(s){var a=Y0(s);return a.length==1&&a[0][2]?U2(a[0][0],a[0][1]):function(u){return u===s||R0(u,s,a)}}function i2(s,a){return Q0(s)&&M2(a)?U2(zn(s),a):function(u){var g=cd(u,s);return g===r&&g===a?ld(u,s):Ua(a,g,P|j)}}function Wl(s,a,u,g,y){s!==a&&A0(a,function(D,M){if(y||(y=new Dn),Bt(D))r$(s,a,M,u,Wl,g,y);else{var k=g?g(ed(s,M),D,M+"",s,a,y):r;k===r&&(k=D),O0(s,M,k)}},Zr)}function r$(s,a,u,g,y,D,M){var k=ed(s,u),G=ed(a,u),ue=M.get(G);if(ue){O0(s,u,ue);return}var he=D?D(k,G,u+"",s,a,M):r,pe=he===r;if(pe){var be=Xe(G),Pe=!be&&ji(G),ze=!be&&!Pe&&bo(G);he=G,be||Pe||ze?Xe(k)?he=k:Xt(k)?he=Kr(k):Pe?(pe=!1,he=m2(G,!0)):ze?(pe=!1,he=w2(G,!0)):he=[]:Ha(G)||xs(G)?(he=k,xs(k)?he=dw(k):(!Bt(k)||li(k))&&(he=L2(G))):pe=!1}pe&&(M.set(G,he),y(he,G,g,D,M),M.delete(G)),O0(s,u,he)}function s2(s,a){var u=s.length;if(u)return a+=a<0?u:0,ci(a,u)?s[a]:r}function o2(s,a,u){a.length?a=Ut(a,function(D){return Xe(D)?function(M){return bs(M,D.length===1?D[0]:D)}:D}):a=[Yr];var g=-1;a=Ut(a,rn(We()));var y=r2(s,function(D,M,k){var G=Ut(a,function(ue){return ue(D)});return{criteria:G,index:++g,value:D}});return AD(y,function(D,M){return g$(D,M,u)})}function n$(s,a){return a2(s,a,function(u,g){return ld(s,g)})}function a2(s,a,u){for(var g=-1,y=a.length,D={};++g<y;){var M=a[g],k=bs(s,M);u(k,M)&&ja(D,Mi(M,s),k)}return D}function i$(s){return function(a){return bs(a,s)}}function M0(s,a,u,g){var y=g?DD:co,D=-1,M=a.length,k=s;for(s===a&&(a=Kr(a)),u&&(k=Ut(s,rn(u)));++D<M;)for(var G=0,ue=a[D],he=u?u(ue):ue;(G=y(k,he,G,g))>-1;)k!==s&&Rl.call(k,G,1),Rl.call(s,G,1);return s}function c2(s,a){for(var u=s?a.length:0,g=u-1;u--;){var y=a[u];if(u==g||y!==D){var D=y;ci(y)?Rl.call(s,y,1):B0(s,y)}}return s}function U0(s,a){return s+Ml(Hm()*(a-s+1))}function s$(s,a,u,g){for(var y=-1,D=fr(Ll((a-s)/(u||1)),0),M=te(D);D--;)M[g?D:++y]=s,s+=u;return M}function j0(s,a){var u="";if(!s||a<1||a>re)return u;do a%2&&(u+=s),a=Ml(a/2),a&&(s+=s);while(a);return u}function ct(s,a){return td(j2(s,a,Yr),s+"")}function o$(s){return qm(_o(s))}function a$(s,a){var u=_o(s);return Xl(u,ys(a,0,u.length))}function ja(s,a,u,g){if(!Bt(s))return s;a=Mi(a,s);for(var y=-1,D=a.length,M=D-1,k=s;k!=null&&++y<D;){var G=zn(a[y]),ue=u;if(G==="__proto__"||G==="constructor"||G==="prototype")return s;if(y!=M){var he=k[G];ue=g?g(he,G,k):r,ue===r&&(ue=Bt(he)?he:ci(a[y+1])?[]:{})}Na(k,G,ue),k=k[G]}return s}var l2=Ul?function(s,a){return Ul.set(s,a),s}:Yr,c$=Nl?function(s,a){return Nl(s,"toString",{configurable:!0,enumerable:!1,value:hd(a),writable:!0})}:Yr;function l$(s){return Xl(_o(s))}function yn(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 D=te(y);++g<y;)D[g]=s[g+a];return D}function u$(s,a){var u;return Ni(s,function(g,y,D){return u=a(g,y,D),!u}),!!u}function zl(s,a,u){var g=0,y=s==null?g:s.length;if(typeof a=="number"&&a===a&&y<=ge){for(;g<y;){var D=g+y>>>1,M=s[D];M!==null&&!sn(M)&&(u?M<=a:M<a)?g=D+1:y=D}return y}return F0(s,a,Yr,u)}function F0(s,a,u,g){var y=0,D=s==null?0:s.length;if(D===0)return 0;a=u(a);for(var M=a!==a,k=a===null,G=sn(a),ue=a===r;y<D;){var he=Ml((y+D)/2),pe=u(s[he]),be=pe!==r,Pe=pe===null,ze=pe===pe,ot=sn(pe);if(M)var qe=g||ze;else ue?qe=ze&&(g||be):k?qe=ze&&be&&(g||!Pe):G?qe=ze&&be&&!Pe&&(g||!ot):Pe||ot?qe=!1:qe=g?pe<=a:pe<a;qe?y=he+1:D=he}return Or(D,De)}function u2(s,a){for(var u=-1,g=s.length,y=0,D=[];++u<g;){var M=s[u],k=a?a(M):M;if(!u||!An(k,G)){var G=k;D[y++]=M===0?0:M}}return D}function h2(s){return typeof s=="number"?s:sn(s)?ae:+s}function nn(s){if(typeof s=="string")return s;if(Xe(s))return Ut(s,nn)+"";if(sn(s))return Wm?Wm.call(s):"";var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Li(s,a,u){var g=-1,y=xl,D=s.length,M=!0,k=[],G=k;if(u)M=!1,y=p0;else if(D>=i){var ue=a?null:_$(s);if(ue)return Il(ue);M=!1,y=Da,G=new vs}else G=a?[]:k;e:for(;++g<D;){var he=s[g],pe=a?a(he):he;if(he=u||he!==0?he:0,M&&pe===pe){for(var be=G.length;be--;)if(G[be]===pe)continue e;a&&G.push(pe),k.push(he)}else y(G,pe,u)||(G!==k&&G.push(pe),k.push(he))}return k}function B0(s,a){return a=Mi(a,s),s=F2(s,a),s==null||delete s[zn(bn(a))]}function f2(s,a,u,g){return ja(s,a,u(bs(s,a)),g)}function ql(s,a,u,g){for(var y=s.length,D=g?y:-1;(g?D--:++D<y)&&a(s[D],D,s););return u?yn(s,g?0:D,g?D+1:y):yn(s,g?D+1:0,g?y:D)}function d2(s,a){var u=s;return u instanceof dt&&(u=u.value()),g0(a,function(g,y){return y.func.apply(y.thisArg,Pi([g],y.args))},u)}function k0(s,a,u){var g=s.length;if(g<2)return g?Li(s[0]):[];for(var y=-1,D=te(g);++y<g;)for(var M=s[y],k=-1;++k<g;)k!=y&&(D[y]=La(D[y]||M,s[k],a,u));return Li(xr(D,1),a,u)}function p2(s,a,u){for(var g=-1,y=s.length,D=a.length,M={};++g<y;){var k=g<D?a[g]:r;u(M,s[g],k)}return M}function H0(s){return Xt(s)?s:[]}function W0(s){return typeof s=="function"?s:Yr}function Mi(s,a){return Xe(s)?s:Q0(s,a)?[s]:W2(yt(s))}var h$=ct;function Ui(s,a,u){var g=s.length;return u=u===r?g:u,!a&&u>=g?s:yn(s,a,u)}var g2=QD||function(s){return mt.clearTimeout(s)};function m2(s,a){if(a)return s.slice();var u=s.length,g=Um?Um(u):new s.constructor(u);return s.copy(g),g}function z0(s){var a=new s.constructor(s.byteLength);return new Pl(a).set(new Pl(s)),a}function f$(s,a){var u=a?z0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function d$(s){var a=new s.constructor(s.source,dn.exec(s));return a.lastIndex=s.lastIndex,a}function p$(s){return Ra?Ot(Ra.call(s)):{}}function w2(s,a){var u=a?z0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function v2(s,a){if(s!==a){var u=s!==r,g=s===null,y=s===s,D=sn(s),M=a!==r,k=a===null,G=a===a,ue=sn(a);if(!k&&!ue&&!D&&s>a||D&&M&&G&&!k&&!ue||g&&M&&G||!u&&G||!y)return 1;if(!g&&!D&&!ue&&s<a||ue&&u&&y&&!g&&!D||k&&u&&y||!M&&y||!G)return-1}return 0}function g$(s,a,u){for(var g=-1,y=s.criteria,D=a.criteria,M=y.length,k=u.length;++g<M;){var G=v2(y[g],D[g]);if(G){if(g>=k)return G;var ue=u[g];return G*(ue=="desc"?-1:1)}}return s.index-a.index}function y2(s,a,u,g){for(var y=-1,D=s.length,M=u.length,k=-1,G=a.length,ue=fr(D-M,0),he=te(G+ue),pe=!g;++k<G;)he[k]=a[k];for(;++y<M;)(pe||y<D)&&(he[u[y]]=s[y]);for(;ue--;)he[k++]=s[y++];return he}function b2(s,a,u,g){for(var y=-1,D=s.length,M=-1,k=u.length,G=-1,ue=a.length,he=fr(D-k,0),pe=te(he+ue),be=!g;++y<he;)pe[y]=s[y];for(var Pe=y;++G<ue;)pe[Pe+G]=a[G];for(;++M<k;)(be||y<D)&&(pe[Pe+u[M]]=s[y++]);return pe}function Kr(s,a){var u=-1,g=s.length;for(a||(a=te(g));++u<g;)a[u]=s[u];return a}function Wn(s,a,u,g){var y=!u;u||(u={});for(var D=-1,M=a.length;++D<M;){var k=a[D],G=g?g(u[k],s[k],k,u,s):r;G===r&&(G=s[k]),y?si(u,k,G):Na(u,k,G)}return u}function m$(s,a){return Wn(s,J0(s),a)}function w$(s,a){return Wn(s,R2(s),a)}function Vl(s,a){return function(u,g){var y=Xe(u)?ED:FA,D=a?a():{};return y(u,s,We(g,2),D)}}function wo(s){return ct(function(a,u){var g=-1,y=u.length,D=y>1?u[y-1]:r,M=y>2?u[2]:r;for(D=s.length>3&&typeof D=="function"?(y--,D):r,M&&Br(u[0],u[1],M)&&(D=y<3?r:D,y=1),a=Ot(a);++g<y;){var k=u[g];k&&s(a,k,g,D)}return a})}function _2(s,a){return function(u,g){if(u==null)return u;if(!Gr(u))return s(u,g);for(var y=u.length,D=a?y:-1,M=Ot(u);(a?D--:++D<y)&&g(M[D],D,M)!==!1;);return u}}function E2(s){return function(a,u,g){for(var y=-1,D=Ot(a),M=g(a),k=M.length;k--;){var G=M[s?k:++y];if(u(D[G],G,D)===!1)break}return a}}function v$(s,a,u){var g=a&H,y=Fa(s);function D(){var M=this&&this!==mt&&this instanceof D?y:s;return M.apply(g?u:this,arguments)}return D}function x2(s){return function(a){a=yt(a);var u=lo(a)?On(a):r,g=u?u[0]:a.charAt(0),y=u?Ui(u,1).join(""):a.slice(1);return g[s]()+y}}function vo(s){return function(a){return g0(_w(bw(a).replace(Sa,"")),s,"")}}function Fa(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=mo(s.prototype),g=s.apply(u,a);return Bt(g)?g:u}}function y$(s,a,u){var g=Fa(s);function y(){for(var D=arguments.length,M=te(D),k=D,G=yo(y);k--;)M[k]=arguments[k];var ue=D<3&&M[0]!==G&&M[D-1]!==G?[]:Ti(M,G);if(D-=ue.length,D<u)return D2(s,a,Kl,y.placeholder,r,M,ue,r,r,u-D);var he=this&&this!==mt&&this instanceof y?g:s;return wr(he,this,M)}return y}function C2(s){return function(a,u,g){var y=Ot(a);if(!Gr(a)){var D=We(u,3);a=vr(a),u=function(k){return D(y[k],k,y)}}var M=s(a,u,g);return M>-1?y[D?a[M]:M]:r}}function I2(s){return ai(function(a){var u=a.length,g=u,y=wn.prototype.thru;for(s&&a.reverse();g--;){var D=a[g];if(typeof D!="function")throw new mn(c);if(y&&!M&&Jl(D)=="wrapper")var M=new wn([],!0)}for(g=M?g:u;++g<u;){D=a[g];var k=Jl(D),G=k=="wrapper"?Z0(D):r;G&&X0(G[0])&&G[1]==(d|L|T|x)&&!G[4].length&&G[9]==1?M=M[Jl(G[0])].apply(M,G[3]):M=D.length==1&&X0(D)?M[k]():M.thru(D)}return function(){var ue=arguments,he=ue[0];if(M&&ue.length==1&&Xe(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 Kl(s,a,u,g,y,D,M,k,G,ue){var he=a&d,pe=a&H,be=a&Z,Pe=a&(L|$),ze=a&J,ot=be?r:Fa(s);function qe(){for(var ft=arguments.length,wt=te(ft),on=ft;on--;)wt[on]=arguments[on];if(Pe)var kr=yo(qe),an=PD(wt,kr);if(g&&(wt=y2(wt,g,y,Pe)),D&&(wt=b2(wt,D,M,Pe)),ft-=an,Pe&&ft<ue){var er=Ti(wt,kr);return D2(s,a,Kl,qe.placeholder,u,wt,er,k,G,ue-ft)}var $n=pe?u:this,hi=be?$n[s]:s;return ft=wt.length,k?wt=F$(wt,k):ze&&ft>1&&wt.reverse(),he&&G<ft&&(wt.length=G),this&&this!==mt&&this instanceof qe&&(hi=ot||Fa(hi)),hi.apply($n,wt)}return qe}function S2(s,a){return function(u,g){return KA(u,s,a(g),{})}}function Gl(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=nn(u),g=nn(g)):(u=h2(u),g=h2(g)),y=s(u,g)}return y}}function q0(s){return ai(function(a){return a=Ut(a,rn(We())),ct(function(u){var g=this;return s(a,function(y){return wr(y,g,u)})})})}function Zl(s,a){a=a===r?" ":nn(a);var u=a.length;if(u<2)return u?j0(a,s):a;var g=j0(a,Ll(s/uo(a)));return lo(a)?Ui(On(g),0,s).join(""):g.slice(0,s)}function b$(s,a,u,g){var y=a&H,D=Fa(s);function M(){for(var k=-1,G=arguments.length,ue=-1,he=g.length,pe=te(he+G),be=this&&this!==mt&&this instanceof M?D:s;++ue<he;)pe[ue]=g[ue];for(;G--;)pe[ue++]=arguments[++k];return wr(be,y?u:this,pe)}return M}function O2(s){return function(a,u,g){return g&&typeof g!="number"&&Br(a,u,g)&&(u=g=r),a=ui(a),u===r?(u=a,a=0):u=ui(u),g=g===r?a<u?1:-1:ui(g),s$(a,u,g,s)}}function Yl(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=_n(a),u=_n(u)),s(a,u)}}function D2(s,a,u,g,y,D,M,k,G,ue){var he=a&L,pe=he?M:r,be=he?r:M,Pe=he?D:r,ze=he?r:D;a|=he?T:I,a&=~(he?I:T),a&N||(a&=~(H|Z));var ot=[s,a,y,Pe,pe,ze,be,k,G,ue],qe=u.apply(r,ot);return X0(s)&&B2(qe,ot),qe.placeholder=g,k2(qe,s,a)}function V0(s){var a=hr[s];return function(u,g){if(u=_n(u),g=g==null?0:Or(it(g),292),g&&km(u)){var y=(yt(u)+"e").split("e"),D=a(y[0]+"e"+(+y[1]+g));return y=(yt(D)+"e").split("e"),+(y[0]+"e"+(+y[1]-g))}return a(u)}}var _$=po&&1/Il(new po([,-0]))[1]==le?function(s){return new po(s)}:pd;function A2(s){return function(a){var u=Dr(a);return u==Ue?E0(a):u==He?jD(a):$D(a,s(a))}}function oi(s,a,u,g,y,D,M,k){var G=a&Z;if(!G&&typeof s!="function")throw new mn(c);var ue=g?g.length:0;if(ue||(a&=~(T|I),g=y=r),M=M===r?M:fr(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=G?r:Z0(s),Pe=[s,a,u,g,y,he,pe,D,M,k];if(be&&M$(Pe,be),s=Pe[0],a=Pe[1],u=Pe[2],g=Pe[3],y=Pe[4],k=Pe[9]=Pe[9]===r?G?0:s.length:fr(Pe[9]-ue,0),!k&&a&(L|$)&&(a&=~(L|$)),!a||a==H)var ze=v$(s,a,u);else a==L||a==$?ze=y$(s,a,k):(a==T||a==(H|T))&&!y.length?ze=b$(s,a,u,g):ze=Kl.apply(r,Pe);var ot=be?l2:B2;return k2(ot(ze,Pe),s,a)}function $2(s,a,u,g){return s===r||An(s,fo[u])&&!bt.call(g,u)?a:s}function P2(s,a,u,g,y,D){return Bt(s)&&Bt(a)&&(D.set(a,s),Wl(s,a,r,P2,D),D.delete(a)),s}function E$(s){return Ha(s)?r:s}function T2(s,a,u,g,y,D){var M=u&P,k=s.length,G=a.length;if(k!=G&&!(M&&G>k))return!1;var ue=D.get(s),he=D.get(a);if(ue&&he)return ue==a&&he==s;var pe=-1,be=!0,Pe=u&j?new vs:r;for(D.set(s,a),D.set(a,s);++pe<k;){var ze=s[pe],ot=a[pe];if(g)var qe=M?g(ot,ze,pe,a,s,D):g(ze,ot,pe,s,a,D);if(qe!==r){if(qe)continue;be=!1;break}if(Pe){if(!m0(a,function(ft,wt){if(!Da(Pe,wt)&&(ze===ft||y(ze,ft,u,g,D)))return Pe.push(wt)})){be=!1;break}}else if(!(ze===ot||y(ze,ot,u,g,D))){be=!1;break}}return D.delete(s),D.delete(a),be}function x$(s,a,u,g,y,D,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||!D(new Pl(s),new Pl(a)));case Y:case z:case nt:return An(+s,+a);case F:return s.name==a.name&&s.message==a.message;case Je:case ke:return s==a+"";case Ue:var k=E0;case He:var G=g&P;if(k||(k=Il),s.size!=a.size&&!G)return!1;var ue=M.get(s);if(ue)return ue==a;g|=j,M.set(s,a);var he=T2(k(s),k(a),g,y,D,M);return M.delete(s),he;case Ke:if(Ra)return Ra.call(s)==Ra.call(a)}return!1}function C$(s,a,u,g,y,D){var M=u&P,k=K0(s),G=k.length,ue=K0(a),he=ue.length;if(G!=he&&!M)return!1;for(var pe=G;pe--;){var be=k[pe];if(!(M?be in a:bt.call(a,be)))return!1}var Pe=D.get(s),ze=D.get(a);if(Pe&&ze)return Pe==a&&ze==s;var ot=!0;D.set(s,a),D.set(a,s);for(var qe=M;++pe<G;){be=k[pe];var ft=s[be],wt=a[be];if(g)var on=M?g(wt,ft,be,a,s,D):g(ft,wt,be,s,a,D);if(!(on===r?ft===wt||y(ft,wt,u,g,D):on)){ot=!1;break}qe||(qe=be=="constructor")}if(ot&&!qe){var kr=s.constructor,an=a.constructor;kr!=an&&"constructor"in s&&"constructor"in a&&!(typeof kr=="function"&&kr instanceof kr&&typeof an=="function"&&an instanceof an)&&(ot=!1)}return D.delete(s),D.delete(a),ot}function ai(s){return td(j2(s,r,K2),s+"")}function K0(s){return Qm(s,vr,J0)}function G0(s){return Qm(s,Zr,R2)}var Z0=Ul?function(s){return Ul.get(s)}:pd;function Jl(s){for(var a=s.name+"",u=go[a],g=bt.call(go,a)?u.length:0;g--;){var y=u[g],D=y.func;if(D==null||D==s)return y.name}return a}function yo(s){var a=bt.call(C,"placeholder")?C:s;return a.placeholder}function We(){var s=C.iteratee||fd;return s=s===fd?t2:s,arguments.length?s(arguments[0],arguments[1]):s}function Ql(s,a){var u=s.__data__;return T$(a)?u[typeof a=="string"?"string":"hash"]:u.map}function Y0(s){for(var a=vr(s),u=a.length;u--;){var g=a[u],y=s[g];a[u]=[g,y,M2(y)]}return a}function _s(s,a){var u=LD(s,a);return e2(u)?u:r}function I$(s){var a=bt.call(s,ms),u=s[ms];try{s[ms]=r;var g=!0}catch{}var y=Al.call(s);return g&&(a?s[ms]=u:delete s[ms]),y}var J0=C0?function(s){return s==null?[]:(s=Ot(s),$i(C0(s),function(a){return Fm.call(s,a)}))}:gd,R2=C0?function(s){for(var a=[];s;)Pi(a,J0(s)),s=Tl(s);return a}:gd,Dr=Fr;(I0&&Dr(new I0(new ArrayBuffer(1)))!=p||$a&&Dr(new $a)!=Ue||S0&&Dr(S0.resolve())!=At||po&&Dr(new po)!=He||Pa&&Dr(new Pa)!=je)&&(Dr=function(s){var a=Fr(s),u=a==Ge?s.constructor:r,g=u?Es(u):"";if(g)switch(g){case aA:return p;case cA:return Ue;case lA:return At;case uA:return He;case hA:return je}return a});function S$(s,a,u){for(var g=-1,y=u.length;++g<y;){var D=u[g],M=D.size;switch(D.type){case"drop":s+=M;break;case"dropRight":a-=M;break;case"take":a=Or(a,s+M);break;case"takeRight":s=fr(s,a-M);break}}return{start:s,end:a}}function O$(s){var a=s.match(Pt);return a?a[1].split(or):[]}function N2(s,a,u){a=Mi(a,s);for(var g=-1,y=a.length,D=!1;++g<y;){var M=zn(a[g]);if(!(D=s!=null&&u(s,M)))break;s=s[M]}return D||++g!=y?D:(y=s==null?0:s.length,!!y&&su(y)&&ci(M,y)&&(Xe(s)||xs(s)))}function D$(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 L2(s){return typeof s.constructor=="function"&&!Ba(s)?mo(Tl(s)):{}}function A$(s,a,u){var g=s.constructor;switch(a){case b:return z0(s);case Y:case z:return new g(+s);case p:return f$(s,u);case m:case A:case B:case K:case X:case Ee:case Re:case st:case ht:return w2(s,u);case Ue:return new g;case nt:case ke:return new g(s);case Je:return d$(s);case He:return new g;case Ke:return p$(s)}}function $$(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__",f=500,v="__lodash_placeholder__",E=1,_=2,S=4,P=1,j=2,H=1,Z=2,N=4,L=8,$=16,T=32,I=64,d=128,x=256,J=512,W=30,ee="...",de=800,me=16,O=1,U=2,ce=3,le=1/0,re=9007199254740991,ne=17976931348623157e292,ae=0/0,ie=4294967295,De=ie-1,ge=ie>>>1,Be=[["ary",d],["bind",H],["bindKey",Z],["curry",L],["curryRight",$],["flip",J],["partial",T],["partialRight",I],["rearg",x]],ye="[object Arguments]",Me="[object Array]",Q="[object AsyncFunction]",Y="[object Boolean]",z="[object Date]",w="[object DOMException]",F="[object Error]",we="[object Function]",ve="[object GeneratorFunction]",Ue="[object Map]",nt="[object Number]",at="[object Null]",Ge="[object Object]",At="[object Promise]",$t="[object Proxy]",Je="[object RegExp]",He="[object Set]",ke="[object String]",Ke="[object Symbol]",rt="[object Undefined]",je="[object WeakMap]",Ze="[object WeakSet]",b="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",A="[object Float64Array]",B="[object Int8Array]",K="[object Int16Array]",X="[object Int32Array]",Ee="[object Uint8Array]",Re="[object Uint8ClampedArray]",st="[object Uint16Array]",ht="[object Uint32Array]",lt=/\b__p \+= '';/g,Ur=/\b(__p \+=) '' \+/g,Xn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oi=/&(?:amp|lt|gt|quot|#39);/g,us=/[&<>"']/g,Ht=RegExp(Oi.source),Lt=RegExp(us.source),Wt=/<%-([\s\S]+?)%>/g,zt=/<%([\s\S]+?)%>/g,Ft=/<%=([\s\S]+?)%>/g,Mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nr=/^\w*$/,ir=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qt=/[\\^$.*+?()[\]{}|]/g,sr=RegExp(qt.source),Vt=/^\s+/,Jt=/\s/,Kt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pt=/\{\n\/\* \[wrapped with (.+)\] \*/,or=/,? & /,ar=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Gf=/[()=,{}\[\]\/\s]/,Zf=/\\(\\)?/g,Yf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fn=/\w*$/,Jf=/^[-+]0x[0-9a-f]+$/i,Qf=/^0b[01]+$/i,Xf=/^\[object .+?Constructor\]$/,e0=/^0o[0-7]+$/i,t0=/^(?:0|[1-9]\d*)$/,ei=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,no=/($^)/,r0=/['\n\r\u2028\u2029\\]/g,io="\\ud800-\\udfff",n0="\\u0300-\\u036f",i0="\\ufe20-\\ufe2f",so="\\u20d0-\\u20ff",ol=n0+i0+so,al="\\u2700-\\u27bf",Cn="a-z\\xdf-\\xf6\\xf8-\\xff",s0="\\xac\\xb1\\xd7\\xf7",o0="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",a0="\\u2000-\\u206f",c0=" \\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",cl="A-Z\\xc0-\\xd6\\xd8-\\xde",ll="\\ufe0e\\ufe0f",hs=s0+o0+a0+c0,Sa="['\u2019]",fs="["+io+"]",Oa="["+hs+"]",ds="["+ol+"]",ul="\\d+",l0="["+al+"]",hl="["+Cn+"]",fl="[^"+io+hs+ul+al+Cn+cl+"]",oo="\\ud83c[\\udffb-\\udfff]",u0="(?:"+ds+"|"+oo+")",dl="[^"+io+"]",ao="(?:\\ud83c[\\udde6-\\uddff]){2}",Di="[\\ud800-\\udbff][\\udc00-\\udfff]",tn="["+cl+"]",pl="\\u200d",gl="(?:"+hl+"|"+fl+")",Fn="(?:"+tn+"|"+fl+")",ml="(?:"+Sa+"(?:d|ll|m|re|s|t|ve))?",wl="(?:"+Sa+"(?:D|LL|M|RE|S|T|VE))?",vl=u0+"?",yl="["+ll+"]?",h0="(?:"+pl+"(?:"+[dl,ao,Di].join("|")+")"+yl+vl+")*",ti="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",bl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",_l=yl+vl+h0,co="(?:"+[l0,ao,Di].join("|")+")"+_l,f0="(?:"+[dl+ds+"?",ds,ao,Di,fs].join("|")+")",Da=RegExp(Sa,"g"),d0=RegExp(ds,"g"),lo=RegExp(oo+"(?="+oo+")|"+f0+_l,"g"),El=RegExp([tn+"?"+hl+"+"+ml+"(?="+[Oa,tn,"$"].join("|")+")",Fn+"+"+wl+"(?="+[Oa,tn+gl,"$"].join("|")+")",tn+"?"+gl+"+"+ml,tn+"+"+wl,bl,ti,ul,co].join("|"),"g"),xl=RegExp("["+pl+io+ol+ll+"]"),ps=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cl=["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"],p0=-1,Ct={};Ct[m]=Ct[A]=Ct[B]=Ct[K]=Ct[X]=Ct[Ee]=Ct[Re]=Ct[st]=Ct[ht]=!0,Ct[ye]=Ct[Me]=Ct[b]=Ct[Y]=Ct[p]=Ct[z]=Ct[F]=Ct[we]=Ct[Ue]=Ct[nt]=Ct[Ge]=Ct[Je]=Ct[He]=Ct[ke]=Ct[je]=!1;var xt={};xt[ye]=xt[Me]=xt[b]=xt[p]=xt[Y]=xt[z]=xt[m]=xt[A]=xt[B]=xt[K]=xt[X]=xt[Ue]=xt[nt]=xt[Ge]=xt[Je]=xt[He]=xt[ke]=xt[Ke]=xt[Ee]=xt[Re]=xt[st]=xt[ht]=!0,xt[F]=xt[we]=xt[je]=!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,Qe=parseInt,Tt=typeof Xo=="object"&&Xo&&Xo.Object===Object&&Xo,cr=typeof self=="object"&&self&&self.Object===Object&&self,mt=Tt||cr||Function("return this")(),St=e&&!e.nodeType&&e,Qt=St&&!0&&t&&!t.nodeType&&t,Vr=Qt&&Qt.exports===St,lr=Vr&&Tt.process,Rt=function(){try{var V=Qt&&Qt.require&&Qt.require("util").types;return V||lr&&lr.binding&&lr.binding("util")}catch{}}(),jr=Rt&&Rt.isArrayBuffer,In=Rt&&Rt.isDate,dn=Rt&&Rt.isMap,Bn=Rt&&Rt.isRegExp,Aa=Rt&&Rt.isSet,gs=Rt&&Rt.isTypedArray;function wr(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 ID(V,se,te,Ie){for(var Ye=-1,vt=V==null?0:V.length;++Ye<vt;){var hr=V[Ye];se(Ie,hr,te(hr),V)}return Ie}function pn(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie&&se(V[te],te,V)!==!1;);return V}function SD(V,se){for(var te=V==null?0:V.length;te--&&se(V[te],te,V)!==!1;);return V}function Om(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie;)if(!se(V[te],te,V))return!1;return!0}function Ai(V,se){for(var te=-1,Ie=V==null?0:V.length,Ye=0,vt=[];++te<Ie;){var hr=V[te];se(hr,te,V)&&(vt[Ye++]=hr)}return vt}function Il(V,se){var te=V==null?0:V.length;return!!te&&uo(V,se,0)>-1}function g0(V,se,te){for(var Ie=-1,Ye=V==null?0:V.length;++Ie<Ye;)if(te(se,V[Ie]))return!0;return!1}function Ut(V,se){for(var te=-1,Ie=V==null?0:V.length,Ye=Array(Ie);++te<Ie;)Ye[te]=se(V[te],te,V);return Ye}function $i(V,se){for(var te=-1,Ie=se.length,Ye=V.length;++te<Ie;)V[Ye+te]=se[te];return V}function m0(V,se,te,Ie){var Ye=-1,vt=V==null?0:V.length;for(Ie&&vt&&(te=V[++Ye]);++Ye<vt;)te=se(te,V[Ye],Ye,V);return te}function OD(V,se,te,Ie){var Ye=V==null?0:V.length;for(Ie&&Ye&&(te=V[--Ye]);Ye--;)te=se(te,V[Ye],Ye,V);return te}function w0(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie;)if(se(V[te],te,V))return!0;return!1}var DD=v0("length");function AD(V){return V.split("")}function $D(V){return V.match(ar)||[]}function Dm(V,se,te){var Ie;return te(V,function(Ye,vt,hr){if(se(Ye,vt,hr))return Ie=vt,!1}),Ie}function Sl(V,se,te,Ie){for(var Ye=V.length,vt=te+(Ie?1:-1);Ie?vt--:++vt<Ye;)if(se(V[vt],vt,V))return vt;return-1}function uo(V,se,te){return se===se?HD(V,se,te):Sl(V,Am,te)}function PD(V,se,te,Ie){for(var Ye=te-1,vt=V.length;++Ye<vt;)if(Ie(V[Ye],se))return Ye;return-1}function Am(V){return V!==V}function $m(V,se){var te=V==null?0:V.length;return te?b0(V,se)/te:ae}function v0(V){return function(se){return se==null?r:se[V]}}function y0(V){return function(se){return V==null?r:V[se]}}function Pm(V,se,te,Ie,Ye){return Ye(V,function(vt,hr,Ot){te=Ie?(Ie=!1,vt):se(te,vt,hr,Ot)}),te}function TD(V,se){var te=V.length;for(V.sort(se);te--;)V[te]=V[te].value;return V}function b0(V,se){for(var te,Ie=-1,Ye=V.length;++Ie<Ye;){var vt=se(V[Ie]);vt!==r&&(te=te===r?vt:te+vt)}return te}function _0(V,se){for(var te=-1,Ie=Array(V);++te<V;)Ie[te]=se(te);return Ie}function RD(V,se){return Ut(se,function(te){return[te,V[te]]})}function Tm(V){return V&&V.slice(0,Mm(V)+1).replace(Vt,"")}function rn(V){return function(se){return V(se)}}function E0(V,se){return Ut(se,function(te){return V[te]})}function $a(V,se){return V.has(se)}function Rm(V,se){for(var te=-1,Ie=V.length;++te<Ie&&uo(se,V[te],0)>-1;);return te}function Nm(V,se){for(var te=V.length;te--&&uo(se,V[te],0)>-1;);return te}function ND(V,se){for(var te=V.length,Ie=0;te--;)V[te]===se&&++Ie;return Ie}var LD=y0(R),MD=y0(q);function UD(V){return"\\"+Ce[V]}function jD(V,se){return V==null?r:V[se]}function ho(V){return xl.test(V)}function FD(V){return ps.test(V)}function BD(V){for(var se,te=[];!(se=V.next()).done;)te.push(se.value);return te}function x0(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie,Ye){te[++se]=[Ye,Ie]}),te}function Lm(V,se){return function(te){return V(se(te))}}function Pi(V,se){for(var te=-1,Ie=V.length,Ye=0,vt=[];++te<Ie;){var hr=V[te];(hr===se||hr===v)&&(V[te]=v,vt[Ye++]=te)}return vt}function Ol(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie){te[++se]=Ie}),te}function kD(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie){te[++se]=[Ie,Ie]}),te}function HD(V,se,te){for(var Ie=te-1,Ye=V.length;++Ie<Ye;)if(V[Ie]===se)return Ie;return-1}function WD(V,se,te){for(var Ie=te+1;Ie--;)if(V[Ie]===se)return Ie;return Ie}function fo(V){return ho(V)?qD(V):DD(V)}function Sn(V){return ho(V)?VD(V):AD(V)}function Mm(V){for(var se=V.length;se--&&Jt.test(V.charAt(se)););return se}var zD=y0(fe);function qD(V){for(var se=lo.lastIndex=0;lo.test(V);)++se;return se}function VD(V){return V.match(lo)||[]}function KD(V){return V.match(El)||[]}var GD=function V(se){se=se==null?mt:po.defaults(mt.Object(),se,po.pick(mt,Cl));var te=se.Array,Ie=se.Date,Ye=se.Error,vt=se.Function,hr=se.Math,Ot=se.Object,C0=se.RegExp,ZD=se.String,gn=se.TypeError,Dl=te.prototype,YD=vt.prototype,go=Ot.prototype,Al=se["__core-js_shared__"],$l=YD.toString,bt=go.hasOwnProperty,JD=0,Um=function(){var s=/[^.]+$/.exec(Al&&Al.keys&&Al.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Pl=go.toString,QD=$l.call(Ot),XD=mt._,eA=C0("^"+$l.call(bt).replace(qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tl=Vr?se.Buffer:r,Ti=se.Symbol,Rl=se.Uint8Array,jm=Tl?Tl.allocUnsafe:r,Nl=Lm(Ot.getPrototypeOf,Ot),Fm=Ot.create,Bm=go.propertyIsEnumerable,Ll=Dl.splice,km=Ti?Ti.isConcatSpreadable:r,Pa=Ti?Ti.iterator:r,ms=Ti?Ti.toStringTag:r,Ml=function(){try{var s=_s(Ot,"defineProperty");return s({},"",{}),s}catch{}}(),tA=se.clearTimeout!==mt.clearTimeout&&se.clearTimeout,rA=Ie&&Ie.now!==mt.Date.now&&Ie.now,nA=se.setTimeout!==mt.setTimeout&&se.setTimeout,Ul=hr.ceil,jl=hr.floor,I0=Ot.getOwnPropertySymbols,iA=Tl?Tl.isBuffer:r,Hm=se.isFinite,sA=Dl.join,oA=Lm(Ot.keys,Ot),fr=hr.max,Or=hr.min,aA=Ie.now,cA=se.parseInt,Wm=hr.random,lA=Dl.reverse,S0=_s(se,"DataView"),Ta=_s(se,"Map"),O0=_s(se,"Promise"),mo=_s(se,"Set"),Ra=_s(se,"WeakMap"),Na=_s(Ot,"create"),Fl=Ra&&new Ra,wo={},uA=Es(S0),hA=Es(Ta),fA=Es(O0),dA=Es(mo),pA=Es(Ra),Bl=Ti?Ti.prototype:r,La=Bl?Bl.valueOf:r,zm=Bl?Bl.toString:r;function C(s){if(Gt(s)&&!Xe(s)&&!(s instanceof dt)){if(s instanceof mn)return s;if(bt.call(s,"__wrapped__"))return q2(s)}return new mn(s)}var vo=function(){function s(){}return function(a){if(!Bt(a))return{};if(Fm)return Fm(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function kl(){}function mn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}C.templateSettings={escape:Wt,evaluate:zt,interpolate:Ft,variable:"",imports:{_:C}},C.prototype=kl.prototype,C.prototype.constructor=C,mn.prototype=vo(kl.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 gA(){var s=new dt(this.__wrapped__);return s.__actions__=Kr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Kr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Kr(this.__views__),s}function mA(){if(this.__filtered__){var s=new dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function wA(){var s=this.__wrapped__.value(),a=this.__dir__,u=Xe(s),g=a<0,y=u?s.length:0,D=A$(0,y,this.__views__),M=D.start,k=D.end,G=k-M,ue=g?k:M-1,he=this.__iteratees__,pe=he.length,be=0,Pe=Or(G,this.__takeCount__);if(!u||!g&&y==G&&Pe==G)return p2(s,this.__actions__);var ze=[];e:for(;G--&&be<Pe;){ue+=a;for(var ot=-1,qe=s[ue];++ot<pe;){var ft=he[ot],wt=ft.iteratee,on=ft.type,kr=wt(qe);if(on==U)qe=kr;else if(!kr){if(on==O)continue e;break e}}ze[be++]=qe}return ze}dt.prototype=vo(kl.prototype),dt.prototype.constructor=dt;function ws(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 vA(){this.__data__=Na?Na(null):{},this.size=0}function yA(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function bA(s){var a=this.__data__;if(Na){var u=a[s];return u===h?r:u}return bt.call(a,s)?a[s]:r}function _A(s){var a=this.__data__;return Na?a[s]!==r:bt.call(a,s)}function EA(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Na&&a===r?h:a,this}ws.prototype.clear=vA,ws.prototype.delete=yA,ws.prototype.get=bA,ws.prototype.has=_A,ws.prototype.set=EA;function ri(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 xA(){this.__data__=[],this.size=0}function CA(s){var a=this.__data__,u=Hl(a,s);if(u<0)return!1;var g=a.length-1;return u==g?a.pop():Ll.call(a,u,1),--this.size,!0}function IA(s){var a=this.__data__,u=Hl(a,s);return u<0?r:a[u][1]}function SA(s){return Hl(this.__data__,s)>-1}function OA(s,a){var u=this.__data__,g=Hl(u,s);return g<0?(++this.size,u.push([s,a])):u[g][1]=a,this}ri.prototype.clear=xA,ri.prototype.delete=CA,ri.prototype.get=IA,ri.prototype.has=SA,ri.prototype.set=OA;function ni(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 DA(){this.size=0,this.__data__={hash:new ws,map:new(Ta||ri),string:new ws}}function AA(s){var a=eu(this,s).delete(s);return this.size-=a?1:0,a}function $A(s){return eu(this,s).get(s)}function PA(s){return eu(this,s).has(s)}function TA(s,a){var u=eu(this,s),g=u.size;return u.set(s,a),this.size+=u.size==g?0:1,this}ni.prototype.clear=DA,ni.prototype.delete=AA,ni.prototype.get=$A,ni.prototype.has=PA,ni.prototype.set=TA;function vs(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new ni;++a<u;)this.add(s[a])}function RA(s){return this.__data__.set(s,h),this}function NA(s){return this.__data__.has(s)}vs.prototype.add=vs.prototype.push=RA,vs.prototype.has=NA;function On(s){var a=this.__data__=new ri(s);this.size=a.size}function LA(){this.__data__=new ri,this.size=0}function MA(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function UA(s){return this.__data__.get(s)}function jA(s){return this.__data__.has(s)}function FA(s,a){var u=this.__data__;if(u instanceof ri){var g=u.__data__;if(!Ta||g.length<i-1)return g.push([s,a]),this.size=++u.size,this;u=this.__data__=new ni(g)}return u.set(s,a),this.size=u.size,this}On.prototype.clear=LA,On.prototype.delete=MA,On.prototype.get=UA,On.prototype.has=jA,On.prototype.set=FA;function qm(s,a){var u=Xe(s),g=!u&&xs(s),y=!u&&!g&&Ui(s),D=!u&&!g&&!y&&Eo(s),M=u||g||y||D,k=M?_0(s.length,ZD):[],G=k.length;for(var ue in s)(a||bt.call(s,ue))&&!(M&&(ue=="length"||y&&(ue=="offset"||ue=="parent")||D&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||ai(ue,G)))&&k.push(ue);return k}function Vm(s){var a=s.length;return a?s[j0(0,a-1)]:r}function BA(s,a){return tu(Kr(s),ys(a,0,s.length))}function kA(s){return tu(Kr(s))}function D0(s,a,u){(u!==r&&!Dn(s[a],u)||u===r&&!(a in s))&&ii(s,a,u)}function Ma(s,a,u){var g=s[a];(!(bt.call(s,a)&&Dn(g,u))||u===r&&!(a in s))&&ii(s,a,u)}function Hl(s,a){for(var u=s.length;u--;)if(Dn(s[u][0],a))return u;return-1}function HA(s,a,u,g){return Ri(s,function(y,D,M){a(g,y,u(y),M)}),g}function Km(s,a){return s&&Hn(a,vr(a),s)}function WA(s,a){return s&&Hn(a,Zr(a),s)}function ii(s,a,u){a=="__proto__"&&Ml?Ml(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function A0(s,a){for(var u=-1,g=a.length,y=te(g),D=s==null;++u<g;)y[u]=D?r:ld(s,a[u]);return y}function ys(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,D){var M,k=a&E,G=a&_,ue=a&S;if(u&&(M=y?u(s,g,y,D):u(s)),M!==r)return M;if(!Bt(s))return s;var he=Xe(s);if(he){if(M=P$(s),!k)return Kr(s,M)}else{var pe=Dr(s),be=pe==we||pe==ve;if(Ui(s))return w2(s,k);if(pe==Ge||pe==ye||be&&!y){if(M=G||be?{}:M2(s),!k)return G?b$(s,WA(M,s)):y$(s,Km(M,s))}else{if(!xt[pe])return y?s:{};M=T$(s,pe,k)}}D||(D=new On);var Pe=D.get(s);if(Pe)return Pe;D.set(s,M),hw(s)?s.forEach(function(qe){M.add(wn(qe,a,u,qe,s,D))}):lw(s)&&s.forEach(function(qe,ft){M.set(ft,wn(qe,a,u,ft,s,D))});var ze=ue?G?Z0:G0:G?Zr:vr,ot=he?r:ze(s);return pn(ot||s,function(qe,ft){ot&&(ft=qe,qe=s[ft]),Ma(M,ft,wn(qe,a,u,ft,s,D))}),M}function zA(s){var a=vr(s);return function(u){return Gm(u,s,a)}}function Gm(s,a,u){var g=u.length;if(s==null)return!g;for(s=Ot(s);g--;){var y=u[g],D=a[y],M=s[y];if(M===r&&!(y in s)||!D(M))return!1}return!0}function Zm(s,a,u){if(typeof s!="function")throw new gn(c);return Wa(function(){s.apply(r,u)},a)}function Ua(s,a,u,g){var y=-1,D=Il,M=!0,k=s.length,G=[],ue=a.length;if(!k)return G;u&&(a=Ut(a,rn(u))),g?(D=g0,M=!1):a.length>=i&&(D=$a,M=!1,a=new vs(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;G.push(he)}else D(a,pe,g)||G.push(he)}return G}var Ri=E2(kn),Ym=E2(P0,!0);function qA(s,a){var u=!0;return Ri(s,function(g,y,D){return u=!!a(g,y,D),u}),u}function Wl(s,a,u){for(var g=-1,y=s.length;++g<y;){var D=s[g],M=a(D);if(M!=null&&(k===r?M===M&&!sn(M):u(M,k)))var k=M,G=D}return G}function VA(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:dw(g);u<g;)s[u++]=a;return s}function Jm(s,a){var u=[];return Ri(s,function(g,y,D){a(g,y,D)&&u.push(g)}),u}function xr(s,a,u,g,y){var D=-1,M=s.length;for(u||(u=N$),y||(y=[]);++D<M;){var k=s[D];a>0&&u(k)?a>1?xr(k,a-1,u,g,y):$i(y,k):g||(y[y.length]=k)}return y}var $0=x2(),Qm=x2(!0);function kn(s,a){return s&&$0(s,a,vr)}function P0(s,a){return s&&Qm(s,a,vr)}function zl(s,a){return Ai(a,function(u){return ci(s[u])})}function bs(s,a){a=Li(a,s);for(var u=0,g=a.length;s!=null&&u<g;)s=s[Wn(a[u++])];return u&&u==g?s:r}function Xm(s,a,u){var g=a(s);return Xe(s)?g:$i(g,u(s))}function Fr(s){return s==null?s===r?rt:at:ms&&ms in Ot(s)?D$(s):k$(s)}function T0(s,a){return s>a}function KA(s,a){return s!=null&&bt.call(s,a)}function GA(s,a){return s!=null&&a in Ot(s)}function ZA(s,a,u){return s>=Or(a,u)&&s<fr(a,u)}function R0(s,a,u){for(var g=u?g0:Il,y=s[0].length,D=s.length,M=D,k=te(D),G=1/0,ue=[];M--;){var he=s[M];M&&a&&(he=Ut(he,rn(a))),G=Or(he.length,G),k[M]=!u&&(a||y>=120&&he.length>=120)?new vs(M&&he):r}he=s[0];var pe=-1,be=k[0];e:for(;++pe<y&&ue.length<G;){var Pe=he[pe],ze=a?a(Pe):Pe;if(Pe=u||Pe!==0?Pe:0,!(be?$a(be,ze):g(ue,ze,u))){for(M=D;--M;){var ot=k[M];if(!(ot?$a(ot,ze):g(s[M],ze,u)))continue e}be&&be.push(ze),ue.push(Pe)}}return ue}function YA(s,a,u,g){return kn(s,function(y,D,M){a(g,u(y),D,M)}),g}function ja(s,a,u){a=Li(a,s),s=B2(s,a);var g=s==null?s:s[Wn(yn(a))];return g==null?r:wr(g,s,u)}function e2(s){return Gt(s)&&Fr(s)==ye}function JA(s){return Gt(s)&&Fr(s)==b}function QA(s){return Gt(s)&&Fr(s)==z}function Fa(s,a,u,g,y){return s===a?!0:s==null||a==null||!Gt(s)&&!Gt(a)?s!==s&&a!==a:XA(s,a,u,g,Fa,y)}function XA(s,a,u,g,y,D){var M=Xe(s),k=Xe(a),G=M?Me:Dr(s),ue=k?Me:Dr(a);G=G==ye?Ge:G,ue=ue==ye?Ge:ue;var he=G==Ge,pe=ue==Ge,be=G==ue;if(be&&Ui(s)){if(!Ui(a))return!1;M=!0,he=!1}if(be&&!he)return D||(D=new On),M||Eo(s)?R2(s,a,u,g,y,D):S$(s,a,G,u,g,y,D);if(!(u&P)){var Pe=he&&bt.call(s,"__wrapped__"),ze=pe&&bt.call(a,"__wrapped__");if(Pe||ze){var ot=Pe?s.value():s,qe=ze?a.value():a;return D||(D=new On),y(ot,qe,u,g,D)}}return be?(D||(D=new On),O$(s,a,u,g,y,D)):!1}function e$(s){return Gt(s)&&Dr(s)==Ue}function N0(s,a,u,g){var y=u.length,D=y,M=!g;if(s==null)return!D;for(s=Ot(s);y--;){var k=u[y];if(M&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++y<D;){k=u[y];var G=k[0],ue=s[G],he=k[1];if(M&&k[2]){if(ue===r&&!(G in s))return!1}else{var pe=new On;if(g)var be=g(ue,he,G,s,a,pe);if(!(be===r?Fa(he,ue,P|j,g,pe):be))return!1}}return!0}function t2(s){if(!Bt(s)||M$(s))return!1;var a=ci(s)?eA:Xf;return a.test(Es(s))}function t$(s){return Gt(s)&&Fr(s)==Je}function r$(s){return Gt(s)&&Dr(s)==He}function n$(s){return Gt(s)&&au(s.length)&&!!Ct[Fr(s)]}function r2(s){return typeof s=="function"?s:s==null?Yr:typeof s=="object"?Xe(s)?s2(s[0],s[1]):i2(s):Cw(s)}function L0(s){if(!Ha(s))return oA(s);var a=[];for(var u in Ot(s))bt.call(s,u)&&u!="constructor"&&a.push(u);return a}function i$(s){if(!Bt(s))return B$(s);var a=Ha(s),u=[];for(var g in s)g=="constructor"&&(a||!bt.call(s,g))||u.push(g);return u}function M0(s,a){return s<a}function n2(s,a){var u=-1,g=Gr(s)?te(s.length):[];return Ri(s,function(y,D,M){g[++u]=a(y,D,M)}),g}function i2(s){var a=J0(s);return a.length==1&&a[0][2]?j2(a[0][0],a[0][1]):function(u){return u===s||N0(u,s,a)}}function s2(s,a){return X0(s)&&U2(a)?j2(Wn(s),a):function(u){var g=ld(u,s);return g===r&&g===a?ud(u,s):Fa(a,g,P|j)}}function ql(s,a,u,g,y){s!==a&&$0(a,function(D,M){if(y||(y=new On),Bt(D))s$(s,a,M,u,ql,g,y);else{var k=g?g(td(s,M),D,M+"",s,a,y):r;k===r&&(k=D),D0(s,M,k)}},Zr)}function s$(s,a,u,g,y,D,M){var k=td(s,u),G=td(a,u),ue=M.get(G);if(ue){D0(s,u,ue);return}var he=D?D(k,G,u+"",s,a,M):r,pe=he===r;if(pe){var be=Xe(G),Pe=!be&&Ui(G),ze=!be&&!Pe&&Eo(G);he=G,be||Pe||ze?Xe(k)?he=k:Xt(k)?he=Kr(k):Pe?(pe=!1,he=w2(G,!0)):ze?(pe=!1,he=v2(G,!0)):he=[]:za(G)||xs(G)?(he=k,xs(k)?he=pw(k):(!Bt(k)||ci(k))&&(he=M2(G))):pe=!1}pe&&(M.set(G,he),y(he,G,g,D,M),M.delete(G)),D0(s,u,he)}function o2(s,a){var u=s.length;if(u)return a+=a<0?u:0,ai(a,u)?s[a]:r}function a2(s,a,u){a.length?a=Ut(a,function(D){return Xe(D)?function(M){return bs(M,D.length===1?D[0]:D)}:D}):a=[Yr];var g=-1;a=Ut(a,rn(We()));var y=n2(s,function(D,M,k){var G=Ut(a,function(ue){return ue(D)});return{criteria:G,index:++g,value:D}});return TD(y,function(D,M){return v$(D,M,u)})}function o$(s,a){return c2(s,a,function(u,g){return ud(s,g)})}function c2(s,a,u){for(var g=-1,y=a.length,D={};++g<y;){var M=a[g],k=bs(s,M);u(k,M)&&Ba(D,Li(M,s),k)}return D}function a$(s){return function(a){return bs(a,s)}}function U0(s,a,u,g){var y=g?PD:uo,D=-1,M=a.length,k=s;for(s===a&&(a=Kr(a)),u&&(k=Ut(s,rn(u)));++D<M;)for(var G=0,ue=a[D],he=u?u(ue):ue;(G=y(k,he,G,g))>-1;)k!==s&&Ll.call(k,G,1),Ll.call(s,G,1);return s}function l2(s,a){for(var u=s?a.length:0,g=u-1;u--;){var y=a[u];if(u==g||y!==D){var D=y;ai(y)?Ll.call(s,y,1):k0(s,y)}}return s}function j0(s,a){return s+jl(Wm()*(a-s+1))}function c$(s,a,u,g){for(var y=-1,D=fr(Ul((a-s)/(u||1)),0),M=te(D);D--;)M[g?D:++y]=s,s+=u;return M}function F0(s,a){var u="";if(!s||a<1||a>re)return u;do a%2&&(u+=s),a=jl(a/2),a&&(s+=s);while(a);return u}function ct(s,a){return rd(F2(s,a,Yr),s+"")}function l$(s){return Vm(xo(s))}function u$(s,a){var u=xo(s);return tu(u,ys(a,0,u.length))}function Ba(s,a,u,g){if(!Bt(s))return s;a=Li(a,s);for(var y=-1,D=a.length,M=D-1,k=s;k!=null&&++y<D;){var G=Wn(a[y]),ue=u;if(G==="__proto__"||G==="constructor"||G==="prototype")return s;if(y!=M){var he=k[G];ue=g?g(he,G,k):r,ue===r&&(ue=Bt(he)?he:ai(a[y+1])?[]:{})}Ma(k,G,ue),k=k[G]}return s}var u2=Fl?function(s,a){return Fl.set(s,a),s}:Yr,h$=Ml?function(s,a){return Ml(s,"toString",{configurable:!0,enumerable:!1,value:fd(a),writable:!0})}:Yr;function f$(s){return tu(xo(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 D=te(y);++g<y;)D[g]=s[g+a];return D}function d$(s,a){var u;return Ri(s,function(g,y,D){return u=a(g,y,D),!u}),!!u}function Vl(s,a,u){var g=0,y=s==null?g:s.length;if(typeof a=="number"&&a===a&&y<=ge){for(;g<y;){var D=g+y>>>1,M=s[D];M!==null&&!sn(M)&&(u?M<=a:M<a)?g=D+1:y=D}return y}return B0(s,a,Yr,u)}function B0(s,a,u,g){var y=0,D=s==null?0:s.length;if(D===0)return 0;a=u(a);for(var M=a!==a,k=a===null,G=sn(a),ue=a===r;y<D;){var he=jl((y+D)/2),pe=u(s[he]),be=pe!==r,Pe=pe===null,ze=pe===pe,ot=sn(pe);if(M)var qe=g||ze;else ue?qe=ze&&(g||be):k?qe=ze&&be&&(g||!Pe):G?qe=ze&&be&&!Pe&&(g||!ot):Pe||ot?qe=!1:qe=g?pe<=a:pe<a;qe?y=he+1:D=he}return Or(D,De)}function h2(s,a){for(var u=-1,g=s.length,y=0,D=[];++u<g;){var M=s[u],k=a?a(M):M;if(!u||!Dn(k,G)){var G=k;D[y++]=M===0?0:M}}return D}function f2(s){return typeof s=="number"?s:sn(s)?ae:+s}function nn(s){if(typeof s=="string")return s;if(Xe(s))return Ut(s,nn)+"";if(sn(s))return zm?zm.call(s):"";var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Ni(s,a,u){var g=-1,y=Il,D=s.length,M=!0,k=[],G=k;if(u)M=!1,y=g0;else if(D>=i){var ue=a?null:C$(s);if(ue)return Ol(ue);M=!1,y=$a,G=new vs}else G=a?[]:k;e:for(;++g<D;){var he=s[g],pe=a?a(he):he;if(he=u||he!==0?he:0,M&&pe===pe){for(var be=G.length;be--;)if(G[be]===pe)continue e;a&&G.push(pe),k.push(he)}else y(G,pe,u)||(G!==k&&G.push(pe),k.push(he))}return k}function k0(s,a){return a=Li(a,s),s=B2(s,a),s==null||delete s[Wn(yn(a))]}function d2(s,a,u,g){return Ba(s,a,u(bs(s,a)),g)}function Kl(s,a,u,g){for(var y=s.length,D=g?y:-1;(g?D--:++D<y)&&a(s[D],D,s););return u?vn(s,g?0:D,g?D+1:y):vn(s,g?D+1:0,g?y:D)}function p2(s,a){var u=s;return u instanceof dt&&(u=u.value()),m0(a,function(g,y){return y.func.apply(y.thisArg,$i([g],y.args))},u)}function H0(s,a,u){var g=s.length;if(g<2)return g?Ni(s[0]):[];for(var y=-1,D=te(g);++y<g;)for(var M=s[y],k=-1;++k<g;)k!=y&&(D[y]=Ua(D[y]||M,s[k],a,u));return Ni(xr(D,1),a,u)}function g2(s,a,u){for(var g=-1,y=s.length,D=a.length,M={};++g<y;){var k=g<D?a[g]:r;u(M,s[g],k)}return M}function W0(s){return Xt(s)?s:[]}function z0(s){return typeof s=="function"?s:Yr}function Li(s,a){return Xe(s)?s:X0(s,a)?[s]:z2(yt(s))}var p$=ct;function Mi(s,a,u){var g=s.length;return u=u===r?g:u,!a&&u>=g?s:vn(s,a,u)}var m2=tA||function(s){return mt.clearTimeout(s)};function w2(s,a){if(a)return s.slice();var u=s.length,g=jm?jm(u):new s.constructor(u);return s.copy(g),g}function q0(s){var a=new s.constructor(s.byteLength);return new Rl(a).set(new Rl(s)),a}function g$(s,a){var u=a?q0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function m$(s){var a=new s.constructor(s.source,fn.exec(s));return a.lastIndex=s.lastIndex,a}function w$(s){return La?Ot(La.call(s)):{}}function v2(s,a){var u=a?q0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function y2(s,a){if(s!==a){var u=s!==r,g=s===null,y=s===s,D=sn(s),M=a!==r,k=a===null,G=a===a,ue=sn(a);if(!k&&!ue&&!D&&s>a||D&&M&&G&&!k&&!ue||g&&M&&G||!u&&G||!y)return 1;if(!g&&!D&&!ue&&s<a||ue&&u&&y&&!g&&!D||k&&u&&y||!M&&y||!G)return-1}return 0}function v$(s,a,u){for(var g=-1,y=s.criteria,D=a.criteria,M=y.length,k=u.length;++g<M;){var G=y2(y[g],D[g]);if(G){if(g>=k)return G;var ue=u[g];return G*(ue=="desc"?-1:1)}}return s.index-a.index}function b2(s,a,u,g){for(var y=-1,D=s.length,M=u.length,k=-1,G=a.length,ue=fr(D-M,0),he=te(G+ue),pe=!g;++k<G;)he[k]=a[k];for(;++y<M;)(pe||y<D)&&(he[u[y]]=s[y]);for(;ue--;)he[k++]=s[y++];return he}function _2(s,a,u,g){for(var y=-1,D=s.length,M=-1,k=u.length,G=-1,ue=a.length,he=fr(D-k,0),pe=te(he+ue),be=!g;++y<he;)pe[y]=s[y];for(var Pe=y;++G<ue;)pe[Pe+G]=a[G];for(;++M<k;)(be||y<D)&&(pe[Pe+u[M]]=s[y++]);return pe}function Kr(s,a){var u=-1,g=s.length;for(a||(a=te(g));++u<g;)a[u]=s[u];return a}function Hn(s,a,u,g){var y=!u;u||(u={});for(var D=-1,M=a.length;++D<M;){var k=a[D],G=g?g(u[k],s[k],k,u,s):r;G===r&&(G=s[k]),y?ii(u,k,G):Ma(u,k,G)}return u}function y$(s,a){return Hn(s,Q0(s),a)}function b$(s,a){return Hn(s,N2(s),a)}function Gl(s,a){return function(u,g){var y=Xe(u)?ID:HA,D=a?a():{};return y(u,s,We(g,2),D)}}function yo(s){return ct(function(a,u){var g=-1,y=u.length,D=y>1?u[y-1]:r,M=y>2?u[2]:r;for(D=s.length>3&&typeof D=="function"?(y--,D):r,M&&Br(u[0],u[1],M)&&(D=y<3?r:D,y=1),a=Ot(a);++g<y;){var k=u[g];k&&s(a,k,g,D)}return a})}function E2(s,a){return function(u,g){if(u==null)return u;if(!Gr(u))return s(u,g);for(var y=u.length,D=a?y:-1,M=Ot(u);(a?D--:++D<y)&&g(M[D],D,M)!==!1;);return u}}function x2(s){return function(a,u,g){for(var y=-1,D=Ot(a),M=g(a),k=M.length;k--;){var G=M[s?k:++y];if(u(D[G],G,D)===!1)break}return a}}function _$(s,a,u){var g=a&H,y=ka(s);function D(){var M=this&&this!==mt&&this instanceof D?y:s;return M.apply(g?u:this,arguments)}return D}function C2(s){return function(a){a=yt(a);var u=ho(a)?Sn(a):r,g=u?u[0]:a.charAt(0),y=u?Mi(u,1).join(""):a.slice(1);return g[s]()+y}}function bo(s){return function(a){return m0(Ew(_w(a).replace(Da,"")),s,"")}}function ka(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=vo(s.prototype),g=s.apply(u,a);return Bt(g)?g:u}}function E$(s,a,u){var g=ka(s);function y(){for(var D=arguments.length,M=te(D),k=D,G=_o(y);k--;)M[k]=arguments[k];var ue=D<3&&M[0]!==G&&M[D-1]!==G?[]:Pi(M,G);if(D-=ue.length,D<u)return A2(s,a,Zl,y.placeholder,r,M,ue,r,r,u-D);var he=this&&this!==mt&&this instanceof y?g:s;return wr(he,this,M)}return y}function I2(s){return function(a,u,g){var y=Ot(a);if(!Gr(a)){var D=We(u,3);a=vr(a),u=function(k){return D(y[k],k,y)}}var M=s(a,u,g);return M>-1?y[D?a[M]:M]:r}}function S2(s){return oi(function(a){var u=a.length,g=u,y=mn.prototype.thru;for(s&&a.reverse();g--;){var D=a[g];if(typeof D!="function")throw new gn(c);if(y&&!M&&Xl(D)=="wrapper")var M=new mn([],!0)}for(g=M?g:u;++g<u;){D=a[g];var k=Xl(D),G=k=="wrapper"?Y0(D):r;G&&ed(G[0])&&G[1]==(d|L|T|x)&&!G[4].length&&G[9]==1?M=M[Xl(G[0])].apply(M,G[3]):M=D.length==1&&ed(D)?M[k]():M.thru(D)}return function(){var ue=arguments,he=ue[0];if(M&&ue.length==1&&Xe(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 Zl(s,a,u,g,y,D,M,k,G,ue){var he=a&d,pe=a&H,be=a&Z,Pe=a&(L|$),ze=a&J,ot=be?r:ka(s);function qe(){for(var ft=arguments.length,wt=te(ft),on=ft;on--;)wt[on]=arguments[on];if(Pe)var kr=_o(qe),an=ND(wt,kr);if(g&&(wt=b2(wt,g,y,Pe)),D&&(wt=_2(wt,D,M,Pe)),ft-=an,Pe&&ft<ue){var er=Pi(wt,kr);return A2(s,a,Zl,qe.placeholder,u,wt,er,k,G,ue-ft)}var An=pe?u:this,ui=be?An[s]:s;return ft=wt.length,k?wt=H$(wt,k):ze&&ft>1&&wt.reverse(),he&&G<ft&&(wt.length=G),this&&this!==mt&&this instanceof qe&&(ui=ot||ka(ui)),ui.apply(An,wt)}return qe}function O2(s,a){return function(u,g){return YA(u,s,a(g),{})}}function Yl(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=nn(u),g=nn(g)):(u=f2(u),g=f2(g)),y=s(u,g)}return y}}function V0(s){return oi(function(a){return a=Ut(a,rn(We())),ct(function(u){var g=this;return s(a,function(y){return wr(y,g,u)})})})}function Jl(s,a){a=a===r?" ":nn(a);var u=a.length;if(u<2)return u?F0(a,s):a;var g=F0(a,Ul(s/fo(a)));return ho(a)?Mi(Sn(g),0,s).join(""):g.slice(0,s)}function x$(s,a,u,g){var y=a&H,D=ka(s);function M(){for(var k=-1,G=arguments.length,ue=-1,he=g.length,pe=te(he+G),be=this&&this!==mt&&this instanceof M?D:s;++ue<he;)pe[ue]=g[ue];for(;G--;)pe[ue++]=arguments[++k];return wr(be,y?u:this,pe)}return M}function D2(s){return function(a,u,g){return g&&typeof g!="number"&&Br(a,u,g)&&(u=g=r),a=li(a),u===r?(u=a,a=0):u=li(u),g=g===r?a<u?1:-1:li(g),c$(a,u,g,s)}}function Ql(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=bn(a),u=bn(u)),s(a,u)}}function A2(s,a,u,g,y,D,M,k,G,ue){var he=a&L,pe=he?M:r,be=he?r:M,Pe=he?D:r,ze=he?r:D;a|=he?T:I,a&=~(he?I:T),a&N||(a&=~(H|Z));var ot=[s,a,y,Pe,pe,ze,be,k,G,ue],qe=u.apply(r,ot);return ed(s)&&k2(qe,ot),qe.placeholder=g,H2(qe,s,a)}function K0(s){var a=hr[s];return function(u,g){if(u=bn(u),g=g==null?0:Or(it(g),292),g&&Hm(u)){var y=(yt(u)+"e").split("e"),D=a(y[0]+"e"+(+y[1]+g));return y=(yt(D)+"e").split("e"),+(y[0]+"e"+(+y[1]-g))}return a(u)}}var C$=mo&&1/Ol(new mo([,-0]))[1]==le?function(s){return new mo(s)}:gd;function $2(s){return function(a){var u=Dr(a);return u==Ue?x0(a):u==He?kD(a):RD(a,s(a))}}function si(s,a,u,g,y,D,M,k){var G=a&Z;if(!G&&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:fr(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=G?r:Y0(s),Pe=[s,a,u,g,y,he,pe,D,M,k];if(be&&F$(Pe,be),s=Pe[0],a=Pe[1],u=Pe[2],g=Pe[3],y=Pe[4],k=Pe[9]=Pe[9]===r?G?0:s.length:fr(Pe[9]-ue,0),!k&&a&(L|$)&&(a&=~(L|$)),!a||a==H)var ze=_$(s,a,u);else a==L||a==$?ze=E$(s,a,k):(a==T||a==(H|T))&&!y.length?ze=x$(s,a,u,g):ze=Zl.apply(r,Pe);var ot=be?u2:k2;return H2(ot(ze,Pe),s,a)}function P2(s,a,u,g){return s===r||Dn(s,go[u])&&!bt.call(g,u)?a:s}function T2(s,a,u,g,y,D){return Bt(s)&&Bt(a)&&(D.set(a,s),ql(s,a,r,T2,D),D.delete(a)),s}function I$(s){return za(s)?r:s}function R2(s,a,u,g,y,D){var M=u&P,k=s.length,G=a.length;if(k!=G&&!(M&&G>k))return!1;var ue=D.get(s),he=D.get(a);if(ue&&he)return ue==a&&he==s;var pe=-1,be=!0,Pe=u&j?new vs:r;for(D.set(s,a),D.set(a,s);++pe<k;){var ze=s[pe],ot=a[pe];if(g)var qe=M?g(ot,ze,pe,a,s,D):g(ze,ot,pe,s,a,D);if(qe!==r){if(qe)continue;be=!1;break}if(Pe){if(!w0(a,function(ft,wt){if(!$a(Pe,wt)&&(ze===ft||y(ze,ft,u,g,D)))return Pe.push(wt)})){be=!1;break}}else if(!(ze===ot||y(ze,ot,u,g,D))){be=!1;break}}return D.delete(s),D.delete(a),be}function S$(s,a,u,g,y,D,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||!D(new Rl(s),new Rl(a)));case Y:case z:case nt:return Dn(+s,+a);case F:return s.name==a.name&&s.message==a.message;case Je:case ke:return s==a+"";case Ue:var k=x0;case He:var G=g&P;if(k||(k=Ol),s.size!=a.size&&!G)return!1;var ue=M.get(s);if(ue)return ue==a;g|=j,M.set(s,a);var he=R2(k(s),k(a),g,y,D,M);return M.delete(s),he;case Ke:if(La)return La.call(s)==La.call(a)}return!1}function O$(s,a,u,g,y,D){var M=u&P,k=G0(s),G=k.length,ue=G0(a),he=ue.length;if(G!=he&&!M)return!1;for(var pe=G;pe--;){var be=k[pe];if(!(M?be in a:bt.call(a,be)))return!1}var Pe=D.get(s),ze=D.get(a);if(Pe&&ze)return Pe==a&&ze==s;var ot=!0;D.set(s,a),D.set(a,s);for(var qe=M;++pe<G;){be=k[pe];var ft=s[be],wt=a[be];if(g)var on=M?g(wt,ft,be,a,s,D):g(ft,wt,be,s,a,D);if(!(on===r?ft===wt||y(ft,wt,u,g,D):on)){ot=!1;break}qe||(qe=be=="constructor")}if(ot&&!qe){var kr=s.constructor,an=a.constructor;kr!=an&&"constructor"in s&&"constructor"in a&&!(typeof kr=="function"&&kr instanceof kr&&typeof an=="function"&&an instanceof an)&&(ot=!1)}return D.delete(s),D.delete(a),ot}function oi(s){return rd(F2(s,r,G2),s+"")}function G0(s){return Xm(s,vr,Q0)}function Z0(s){return Xm(s,Zr,N2)}var Y0=Fl?function(s){return Fl.get(s)}:gd;function Xl(s){for(var a=s.name+"",u=wo[a],g=bt.call(wo,a)?u.length:0;g--;){var y=u[g],D=y.func;if(D==null||D==s)return y.name}return a}function _o(s){var a=bt.call(C,"placeholder")?C:s;return a.placeholder}function We(){var s=C.iteratee||dd;return s=s===dd?r2:s,arguments.length?s(arguments[0],arguments[1]):s}function eu(s,a){var u=s.__data__;return L$(a)?u[typeof a=="string"?"string":"hash"]:u.map}function J0(s){for(var a=vr(s),u=a.length;u--;){var g=a[u],y=s[g];a[u]=[g,y,U2(y)]}return a}function _s(s,a){var u=jD(s,a);return t2(u)?u:r}function D$(s){var a=bt.call(s,ms),u=s[ms];try{s[ms]=r;var g=!0}catch{}var y=Pl.call(s);return g&&(a?s[ms]=u:delete s[ms]),y}var Q0=I0?function(s){return s==null?[]:(s=Ot(s),Ai(I0(s),function(a){return Bm.call(s,a)}))}:md,N2=I0?function(s){for(var a=[];s;)$i(a,Q0(s)),s=Nl(s);return a}:md,Dr=Fr;(S0&&Dr(new S0(new ArrayBuffer(1)))!=p||Ta&&Dr(new Ta)!=Ue||O0&&Dr(O0.resolve())!=At||mo&&Dr(new mo)!=He||Ra&&Dr(new Ra)!=je)&&(Dr=function(s){var a=Fr(s),u=a==Ge?s.constructor:r,g=u?Es(u):"";if(g)switch(g){case uA:return p;case hA:return Ue;case fA:return At;case dA:return He;case pA:return je}return a});function A$(s,a,u){for(var g=-1,y=u.length;++g<y;){var D=u[g],M=D.size;switch(D.type){case"drop":s+=M;break;case"dropRight":a-=M;break;case"take":a=Or(a,s+M);break;case"takeRight":s=fr(s,a-M);break}}return{start:s,end:a}}function $$(s){var a=s.match(Pt);return a?a[1].split(or):[]}function L2(s,a,u){a=Li(a,s);for(var g=-1,y=a.length,D=!1;++g<y;){var M=Wn(a[g]);if(!(D=s!=null&&u(s,M)))break;s=s[M]}return D||++g!=y?D:(y=s==null?0:s.length,!!y&&au(y)&&ai(M,y)&&(Xe(s)||xs(s)))}function P$(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 M2(s){return typeof s.constructor=="function"&&!Ha(s)?vo(Nl(s)):{}}function T$(s,a,u){var g=s.constructor;switch(a){case b:return q0(s);case Y:case z:return new g(+s);case p:return g$(s,u);case m:case A:case B:case K:case X:case Ee:case Re:case st:case ht:return v2(s,u);case Ue:return new g;case nt:case ke:return new g(s);case Je:return m$(s);case He:return new g;case Ke:return w$(s)}}function R$(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 P$(s){return Xe(s)||xs(s)||!!(Bm&&s&&s[Bm])}function ci(s,a){var u=typeof s;return a=a??re,!!a&&(u=="number"||u!="symbol"&&e0.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"?Gr(u)&&ci(a,u.length):g=="string"&&a in u)?An(u[a],s):!1}function Q0(s,a){if(Xe(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||sn(s)?!0:nr.test(s)||!Mt.test(s)||a!=null&&s in Ot(a)}function T$(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function X0(s){var a=Jl(s),u=C[a];if(typeof u!="function"||!(a in dt.prototype))return!1;if(s===u)return!0;var g=Z0(u);return!!g&&s===g[0]}function R$(s){return!!Mm&&Mm in s}var N$=Ol?li:md;function Ba(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||fo;return s===u}function M2(s){return s===s&&!Bt(s)}function U2(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in Ot(u))}}function L$(s){var a=nu(s,function(g){return u.size===f&&u.clear(),g}),u=a.cache;return a}function M$(s,a){var u=s[1],g=a[1],y=u|g,D=y<(H|Z|d),M=g==d&&u==L||g==d&&u==x&&s[7].length<=a[8]||g==(d|x)&&a[7].length<=a[8]&&u==L;if(!(D||M))return s;g&H&&(s[2]=a[2],y|=u&H?0:N);var k=a[3];if(k){var G=s[3];s[3]=G?y2(G,k,a[4]):k,s[4]=G?Ti(s[3],v):a[4]}return k=a[5],k&&(G=s[5],s[5]=G?b2(G,k,a[6]):k,s[6]=G?Ti(s[5],v):a[6]),k=a[7],k&&(s[7]=k),g&d&&(s[8]=s[8]==null?a[8]:Or(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=y,s}function U$(s){var a=[];if(s!=null)for(var u in Ot(s))a.push(u);return a}function j$(s){return Al.call(s)}function j2(s,a,u){return a=fr(a===r?s.length-1:a,0),function(){for(var g=arguments,y=-1,D=fr(g.length-a,0),M=te(D);++y<D;)M[y]=g[a+y];y=-1;for(var k=te(a+1);++y<a;)k[y]=g[y];return k[a]=u(M),wr(s,this,k)}}function F2(s,a){return a.length<2?s:bs(s,yn(a,0,-1))}function F$(s,a){for(var u=s.length,g=Or(a.length,u),y=Kr(s);g--;){var D=a[g];s[g]=ci(D,u)?y[D]:r}return s}function ed(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var B2=H2(l2),ka=eA||function(s,a){return mt.setTimeout(s,a)},td=H2(c$);function k2(s,a,u){var g=a+"";return td(s,$$(g,B$(O$(g),u)))}function H2(s){var a=0,u=0;return function(){var g=iA(),y=me-(g-u);if(u=g,y>0){if(++a>=de)return arguments[0]}else a=0;return s.apply(r,arguments)}}function Xl(s,a){var u=-1,g=s.length,y=g-1;for(a=a===r?g:a;++u<a;){var D=U0(u,y),M=s[D];s[D]=s[u],s[u]=M}return s.length=a,s}var W2=L$(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(ir,function(u,g,y,D){a.push(y?D.replace(Gf,"$1"):g||u)}),a});function zn(s){if(typeof s=="string"||sn(s))return s;var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Es(s){if(s!=null){try{return Dl.call(s)}catch{}try{return s+""}catch{}}return""}function B$(s,a){return gn(Be,function(u){var g="_."+u[0];a&u[1]&&!xl(s,g)&&s.push(g)}),s.sort()}function z2(s){if(s instanceof dt)return s.clone();var a=new wn(s.__wrapped__,s.__chain__);return a.__actions__=Kr(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function k$(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=fr(it(a),0);var g=s==null?0:s.length;if(!g||a<1)return[];for(var y=0,D=0,M=te(Ll(g/a));y<g;)M[D++]=yn(s,y,y+=a);return M}function H$(s){for(var a=-1,u=s==null?0:s.length,g=0,y=[];++a<u;){var D=s[a];D&&(y[g++]=D)}return y}function W$(){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 Pi(Xe(u)?Kr(u):[u],xr(a,1))}var z$=ct(function(s,a){return Xt(s)?La(s,xr(a,1,Xt,!0)):[]}),q$=ct(function(s,a){var u=bn(a);return Xt(u)&&(u=r),Xt(s)?La(s,xr(a,1,Xt,!0),We(u,2)):[]}),V$=ct(function(s,a){var u=bn(a);return Xt(u)&&(u=r),Xt(s)?La(s,xr(a,1,Xt,!0),r,u):[]});function K$(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),yn(s,a<0?0:a,g)):[]}function G$(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,yn(s,0,a<0?0:a)):[]}function Z$(s,a){return s&&s.length?ql(s,We(a,3),!0,!0):[]}function Y$(s,a){return s&&s.length?ql(s,We(a,3),!0):[]}function J$(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),WA(s,a,u,g)):[]}function q2(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=fr(g+y,0)),Cl(s,We(a,3),y)}function V2(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?fr(g+y,0):Or(y,g-1)),Cl(s,We(a,3),y,!0)}function K2(s){var a=s==null?0:s.length;return a?xr(s,1):[]}function Q$(s){var a=s==null?0:s.length;return a?xr(s,le):[]}function X$(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:it(a),xr(s,a)):[]}function eP(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 G2(s){return s&&s.length?s[0]:r}function tP(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=fr(g+y,0)),co(s,a,y)}function rP(s){var a=s==null?0:s.length;return a?yn(s,0,-1):[]}var nP=ct(function(s){var a=Ut(s,H0);return a.length&&a[0]===s[0]?T0(a):[]}),iP=ct(function(s){var a=bn(s),u=Ut(s,H0);return a===bn(u)?a=r:u.pop(),u.length&&u[0]===s[0]?T0(u,We(a,2)):[]}),sP=ct(function(s){var a=bn(s),u=Ut(s,H0);return a=typeof a=="function"?a:r,a&&u.pop(),u.length&&u[0]===s[0]?T0(u,r,a):[]});function oP(s,a){return s==null?"":rA.call(s,a)}function bn(s){var a=s==null?0:s.length;return a?s[a-1]:r}function aP(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?fr(g+y,0):Or(y,g-1)),a===a?BD(s,a,y):Cl(s,Dm,y,!0)}function cP(s,a){return s&&s.length?s2(s,it(a)):r}var lP=ct(Z2);function Z2(s,a){return s&&s.length&&a&&a.length?M0(s,a):s}function uP(s,a,u){return s&&s.length&&a&&a.length?M0(s,a,We(u,2)):s}function hP(s,a,u){return s&&s.length&&a&&a.length?M0(s,a,r,u):s}var fP=ai(function(s,a){var u=s==null?0:s.length,g=D0(s,a);return c2(s,Ut(a,function(y){return ci(y,u)?+y:y}).sort(v2)),g});function dP(s,a){var u=[];if(!(s&&s.length))return u;var g=-1,y=[],D=s.length;for(a=We(a,3);++g<D;){var M=s[g];a(M,g,s)&&(u.push(M),y.push(g))}return c2(s,y),u}function rd(s){return s==null?s:oA.call(s)}function pP(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)),yn(s,a,u)):[]}function gP(s,a){return zl(s,a)}function mP(s,a,u){return F0(s,a,We(u,2))}function wP(s,a){var u=s==null?0:s.length;if(u){var g=zl(s,a);if(g<u&&An(s[g],a))return g}return-1}function vP(s,a){return zl(s,a,!0)}function yP(s,a,u){return F0(s,a,We(u,2),!0)}function bP(s,a){var u=s==null?0:s.length;if(u){var g=zl(s,a,!0)-1;if(An(s[g],a))return g}return-1}function _P(s){return s&&s.length?u2(s):[]}function EP(s,a){return s&&s.length?u2(s,We(a,2)):[]}function xP(s){var a=s==null?0:s.length;return a?yn(s,1,a):[]}function CP(s,a,u){return s&&s.length?(a=u||a===r?1:it(a),yn(s,0,a<0?0:a)):[]}function IP(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,yn(s,a<0?0:a,g)):[]}function SP(s,a){return s&&s.length?ql(s,We(a,3),!1,!0):[]}function OP(s,a){return s&&s.length?ql(s,We(a,3)):[]}var DP=ct(function(s){return Li(xr(s,1,Xt,!0))}),AP=ct(function(s){var a=bn(s);return Xt(a)&&(a=r),Li(xr(s,1,Xt,!0),We(a,2))}),$P=ct(function(s){var a=bn(s);return a=typeof a=="function"?a:r,Li(xr(s,1,Xt,!0),r,a)});function PP(s){return s&&s.length?Li(s):[]}function TP(s,a){return s&&s.length?Li(s,We(a,2)):[]}function RP(s,a){return a=typeof a=="function"?a:r,s&&s.length?Li(s,r,a):[]}function nd(s){if(!(s&&s.length))return[];var a=0;return s=$i(s,function(u){if(Xt(u))return a=fr(u.length,a),!0}),b0(a,function(u){return Ut(s,w0(u))})}function Y2(s,a){if(!(s&&s.length))return[];var u=nd(s);return a==null?u:Ut(u,function(g){return wr(a,r,g)})}var NP=ct(function(s,a){return Xt(s)?La(s,a):[]}),LP=ct(function(s){return k0($i(s,Xt))}),MP=ct(function(s){var a=bn(s);return Xt(a)&&(a=r),k0($i(s,Xt),We(a,2))}),UP=ct(function(s){var a=bn(s);return a=typeof a=="function"?a:r,k0($i(s,Xt),r,a)}),jP=ct(nd);function FP(s,a){return p2(s||[],a||[],Na)}function BP(s,a){return p2(s||[],a||[],ja)}var kP=ct(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,Y2(s,u)});function J2(s){var a=C(s);return a.__chain__=!0,a}function HP(s,a){return a(s),s}function eu(s,a){return a(s)}var WP=ai(function(s){var a=s.length,u=a?s[0]:0,g=this.__wrapped__,y=function(D){return D0(D,s)};return a>1||this.__actions__.length||!(g instanceof dt)||!ci(u)?this.thru(y):(g=g.slice(u,+u+(a?1:0)),g.__actions__.push({func:eu,args:[y],thisArg:r}),new wn(g,this.__chain__).thru(function(D){return a&&!D.length&&D.push(r),D}))});function zP(){return J2(this)}function qP(){return new wn(this.value(),this.__chain__)}function VP(){this.__values__===r&&(this.__values__=hw(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function KP(){return this}function GP(s){for(var a,u=this;u instanceof Fl;){var g=z2(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 ZP(){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:eu,args:[rd],thisArg:r}),new wn(a,this.__chain__)}return this.thru(rd)}function YP(){return d2(this.__wrapped__,this.__actions__)}var JP=Vl(function(s,a,u){bt.call(s,u)?++s[u]:si(s,u,1)});function QP(s,a,u){var g=Xe(s)?Sm:HA;return u&&Br(s,a,u)&&(a=r),g(s,We(a,3))}function XP(s,a){var u=Xe(s)?$i:Ym;return u(s,We(a,3))}var eT=C2(q2),tT=C2(V2);function rT(s,a){return xr(tu(s,a),1)}function nT(s,a){return xr(tu(s,a),le)}function iT(s,a,u){return u=u===r?1:it(u),xr(tu(s,a),u)}function Q2(s,a){var u=Xe(s)?gn:Ni;return u(s,We(a,3))}function X2(s,a){var u=Xe(s)?xD:Zm;return u(s,We(a,3))}var sT=Vl(function(s,a,u){bt.call(s,u)?s[u].push(a):si(s,u,[a])});function oT(s,a,u,g){s=Gr(s)?s:_o(s),u=u&&!g?it(u):0;var y=s.length;return u<0&&(u=fr(y+u,0)),ou(s)?u<=y&&s.indexOf(a,u)>-1:!!y&&co(s,a,u)>-1}var aT=ct(function(s,a,u){var g=-1,y=typeof a=="function",D=Gr(s)?te(s.length):[];return Ni(s,function(M){D[++g]=y?wr(a,M,u):Ma(M,a,u)}),D}),cT=Vl(function(s,a,u){si(s,u,a)});function tu(s,a){var u=Xe(s)?Ut:r2;return u(s,We(a,3))}function lT(s,a,u,g){return s==null?[]:(Xe(a)||(a=a==null?[]:[a]),u=g?r:u,Xe(u)||(u=u==null?[]:[u]),o2(s,a,u))}var uT=Vl(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function hT(s,a,u){var g=Xe(s)?g0:$m,y=arguments.length<3;return g(s,We(a,4),u,y,Ni)}function fT(s,a,u){var g=Xe(s)?CD:$m,y=arguments.length<3;return g(s,We(a,4),u,y,Zm)}function dT(s,a){var u=Xe(s)?$i:Ym;return u(s,iu(We(a,3)))}function pT(s){var a=Xe(s)?qm:o$;return a(s)}function gT(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=it(a);var g=Xe(s)?UA:a$;return g(s,a)}function mT(s){var a=Xe(s)?jA:l$;return a(s)}function wT(s){if(s==null)return 0;if(Gr(s))return ou(s)?uo(s):s.length;var a=Dr(s);return a==Ue||a==He?s.size:N0(s).length}function vT(s,a,u){var g=Xe(s)?m0:u$;return u&&Br(s,a,u)&&(a=r),g(s,We(a,3))}var yT=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]]),o2(s,xr(a,1),[])}),ru=XD||function(){return mt.Date.now()};function bT(s,a){if(typeof a!="function")throw new mn(c);return s=it(s),function(){if(--s<1)return a.apply(this,arguments)}}function ew(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,oi(s,d,r,r,r,r,a)}function tw(s,a){var u;if(typeof a!="function")throw new mn(c);return s=it(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=r),u}}var id=ct(function(s,a,u){var g=H;if(u.length){var y=Ti(u,yo(id));g|=T}return oi(s,g,a,u,y)}),rw=ct(function(s,a,u){var g=H|Z;if(u.length){var y=Ti(u,yo(rw));g|=T}return oi(a,g,s,u,y)});function nw(s,a,u){a=u?r:a;var g=oi(s,L,r,r,r,r,r,a);return g.placeholder=nw.placeholder,g}function iw(s,a,u){a=u?r:a;var g=oi(s,$,r,r,r,r,r,a);return g.placeholder=iw.placeholder,g}function sw(s,a,u){var g,y,D,M,k,G,ue=0,he=!1,pe=!1,be=!0;if(typeof s!="function")throw new mn(c);a=_n(a)||0,Bt(u)&&(he=!!u.leading,pe="maxWait"in u,D=pe?fr(_n(u.maxWait)||0,a):D,be="trailing"in u?!!u.trailing:be);function Pe(er){var $n=g,hi=y;return g=y=r,ue=er,M=s.apply(hi,$n),M}function ze(er){return ue=er,k=ka(ft,a),he?Pe(er):M}function ot(er){var $n=er-G,hi=er-ue,Cw=a-$n;return pe?Or(Cw,D-hi):Cw}function qe(er){var $n=er-G,hi=er-ue;return G===r||$n>=a||$n<0||pe&&hi>=D}function ft(){var er=ru();if(qe(er))return wt(er);k=ka(ft,ot(er))}function wt(er){return k=r,be&&g?Pe(er):(g=y=r,M)}function on(){k!==r&&g2(k),ue=0,g=G=y=k=r}function kr(){return k===r?M:wt(ru())}function an(){var er=ru(),$n=qe(er);if(g=arguments,y=this,G=er,$n){if(k===r)return ze(G);if(pe)return g2(k),k=ka(ft,a),Pe(G)}return k===r&&(k=ka(ft,a)),M}return an.cancel=on,an.flush=kr,an}var _T=ct(function(s,a){return Gm(s,1,a)}),ET=ct(function(s,a,u){return Gm(s,_n(a)||0,u)});function xT(s){return oi(s,J)}function nu(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new mn(c);var u=function(){var g=arguments,y=a?a.apply(this,g):g[0],D=u.cache;if(D.has(y))return D.get(y);var M=s.apply(this,g);return u.cache=D.set(y,M)||D,M};return u.cache=new(nu.Cache||ii),u}nu.Cache=ii;function iu(s){if(typeof s!="function")throw new mn(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 tw(2,s)}var IT=h$(function(s,a){a=a.length==1&&Xe(a[0])?Ut(a[0],rn(We())):Ut(xr(a,1),rn(We()));var u=a.length;return ct(function(g){for(var y=-1,D=Or(g.length,u);++y<D;)g[y]=a[y].call(this,g[y]);return wr(s,this,g)})}),sd=ct(function(s,a){var u=Ti(a,yo(sd));return oi(s,T,r,a,u)}),ow=ct(function(s,a){var u=Ti(a,yo(ow));return oi(s,I,r,a,u)}),ST=ai(function(s,a){return oi(s,x,r,r,r,a)});function OT(s,a){if(typeof s!="function")throw new mn(c);return a=a===r?a:it(a),ct(s,a)}function DT(s,a){if(typeof s!="function")throw new mn(c);return a=a==null?0:fr(it(a),0),ct(function(u){var g=u[a],y=Ui(u,0,a);return g&&Pi(y,g),wr(s,this,y)})}function AT(s,a,u){var g=!0,y=!0;if(typeof s!="function")throw new mn(c);return Bt(u)&&(g="leading"in u?!!u.leading:g,y="trailing"in u?!!u.trailing:y),sw(s,a,{leading:g,maxWait:a,trailing:y})}function $T(s){return ew(s,1)}function PT(s,a){return sd(W0(a),s)}function TT(){if(!arguments.length)return[];var s=arguments[0];return Xe(s)?s:[s]}function RT(s){return vn(s,S)}function NT(s,a){return a=typeof a=="function"?a:r,vn(s,S,a)}function LT(s){return vn(s,E|S)}function MT(s,a){return a=typeof a=="function"?a:r,vn(s,E|S,a)}function UT(s,a){return a==null||Km(s,a,vr(a))}function An(s,a){return s===a||s!==s&&a!==a}var jT=Yl(P0),FT=Yl(function(s,a){return s>=a}),xs=Xm(function(){return arguments}())?Xm:function(s){return Gt(s)&&bt.call(s,"callee")&&!Fm.call(s,"callee")},Xe=te.isArray,BT=jr?rn(jr):GA;function Gr(s){return s!=null&&su(s.length)&&!li(s)}function Xt(s){return Gt(s)&&Gr(s)}function kT(s){return s===!0||s===!1||Gt(s)&&Fr(s)==Y}var ji=tA||md,HT=Sn?rn(Sn):ZA;function WT(s){return Gt(s)&&s.nodeType===1&&!Ha(s)}function zT(s){if(s==null)return!0;if(Gr(s)&&(Xe(s)||typeof s=="string"||typeof s.splice=="function"||ji(s)||bo(s)||xs(s)))return!s.length;var a=Dr(s);if(a==Ue||a==He)return!s.size;if(Ba(s))return!N0(s).length;for(var u in s)if(bt.call(s,u))return!1;return!0}function qT(s,a){return Ua(s,a)}function VT(s,a,u){u=typeof u=="function"?u:r;var g=u?u(s,a):r;return g===r?Ua(s,a,r,u):!!g}function od(s){if(!Gt(s))return!1;var a=Fr(s);return a==F||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!Ha(s)}function KT(s){return typeof s=="number"&&km(s)}function li(s){if(!Bt(s))return!1;var a=Fr(s);return a==we||a==ve||a==Q||a==$t}function aw(s){return typeof s=="number"&&s==it(s)}function su(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 cw=pn?rn(pn):JA;function GT(s,a){return s===a||R0(s,a,Y0(a))}function ZT(s,a,u){return u=typeof u=="function"?u:r,R0(s,a,Y0(a),u)}function YT(s){return lw(s)&&s!=+s}function JT(s){if(N$(s))throw new Ye(o);return e2(s)}function QT(s){return s===null}function XT(s){return s==null}function lw(s){return typeof s=="number"||Gt(s)&&Fr(s)==nt}function Ha(s){if(!Gt(s)||Fr(s)!=Ge)return!1;var a=Tl(s);if(a===null)return!0;var u=bt.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&Dl.call(u)==ZD}var ad=kn?rn(kn):QA;function eR(s){return aw(s)&&s>=-re&&s<=re}var uw=Oa?rn(Oa):XA;function ou(s){return typeof s=="string"||!Xe(s)&&Gt(s)&&Fr(s)==ke}function sn(s){return typeof s=="symbol"||Gt(s)&&Fr(s)==Ke}var bo=gs?rn(gs):e$;function tR(s){return s===r}function rR(s){return Gt(s)&&Dr(s)==je}function nR(s){return Gt(s)&&Fr(s)==Ze}var iR=Yl(L0),sR=Yl(function(s,a){return s<=a});function hw(s){if(!s)return[];if(Gr(s))return ou(s)?On(s):Kr(s);if(Aa&&s[Aa])return UD(s[Aa]());var a=Dr(s),u=a==Ue?E0:a==He?Il:_o;return u(s)}function ui(s){if(!s)return s===0?s:0;if(s=_n(s),s===le||s===-le){var a=s<0?-1:1;return a*ne}return s===s?s:0}function it(s){var a=ui(s),u=a%1;return a===a?u?a-u:a:0}function fw(s){return s?ys(it(s),0,ie):0}function _n(s){if(typeof s=="number")return s;if(sn(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=Pm(s);var u=Jf.test(s);return u||Xf.test(s)?Qe(s.slice(2),u?2:8):Yf.test(s)?ae:+s}function dw(s){return Wn(s,Zr(s))}function oR(s){return s?ys(it(s),-re,re):s===0?s:0}function yt(s){return s==null?"":nn(s)}var aR=wo(function(s,a){if(Ba(a)||Gr(a)){Wn(a,vr(a),s);return}for(var u in a)bt.call(a,u)&&Na(s,u,a[u])}),pw=wo(function(s,a){Wn(a,Zr(a),s)}),au=wo(function(s,a,u,g){Wn(a,Zr(a),s,g)}),cR=wo(function(s,a,u,g){Wn(a,vr(a),s,g)}),lR=ai(D0);function uR(s,a){var u=mo(s);return a==null?u:Vm(u,a)}var hR=ct(function(s,a){s=Ot(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 D=a[u],M=Zr(D),k=-1,G=M.length;++k<G;){var ue=M[k],he=s[ue];(he===r||An(he,fo[ue])&&!bt.call(s,ue))&&(s[ue]=D[ue])}return s}),fR=ct(function(s){return s.push(r,P2),wr(gw,r,s)});function dR(s,a){return Om(s,We(a,3),Hn)}function pR(s,a){return Om(s,We(a,3),$0)}function gR(s,a){return s==null?s:A0(s,We(a,3),Zr)}function mR(s,a){return s==null?s:Jm(s,We(a,3),Zr)}function wR(s,a){return s&&Hn(s,We(a,3))}function vR(s,a){return s&&$0(s,We(a,3))}function yR(s){return s==null?[]:Hl(s,vr(s))}function bR(s){return s==null?[]:Hl(s,Zr(s))}function cd(s,a,u){var g=s==null?r:bs(s,a);return g===r?u:g}function _R(s,a){return s!=null&&N2(s,a,zA)}function ld(s,a){return s!=null&&N2(s,a,qA)}var ER=S2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Al.call(a)),s[a]=u},hd(Yr)),xR=S2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Al.call(a)),bt.call(s,a)?s[a].push(u):s[a]=[u]},We),CR=ct(Ma);function vr(s){return Gr(s)?zm(s):N0(s)}function Zr(s){return Gr(s)?zm(s,!0):t$(s)}function IR(s,a){var u={};return a=We(a,3),Hn(s,function(g,y,D){si(u,a(g,y,D),g)}),u}function SR(s,a){var u={};return a=We(a,3),Hn(s,function(g,y,D){si(u,y,a(g,y,D))}),u}var OR=wo(function(s,a,u){Wl(s,a,u)}),gw=wo(function(s,a,u,g){Wl(s,a,u,g)}),DR=ai(function(s,a){var u={};if(s==null)return u;var g=!1;a=Ut(a,function(D){return D=Mi(D,s),g||(g=D.length>1),D}),Wn(s,G0(s),u),g&&(u=vn(u,E|_|S,E$));for(var y=a.length;y--;)B0(u,a[y]);return u});function AR(s,a){return mw(s,iu(We(a)))}var $R=ai(function(s,a){return s==null?{}:n$(s,a)});function mw(s,a){if(s==null)return{};var u=Ut(G0(s),function(g){return[g]});return a=We(a),a2(s,u,function(g,y){return a(g,y[0])})}function PR(s,a,u){a=Mi(a,s);var g=-1,y=a.length;for(y||(y=1,s=r);++g<y;){var D=s==null?r:s[zn(a[g])];D===r&&(g=y,D=u),s=li(D)?D.call(s):D}return s}function TR(s,a,u){return s==null?s:ja(s,a,u)}function RR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:ja(s,a,u,g)}var ww=A2(vr),vw=A2(Zr);function NR(s,a,u){var g=Xe(s),y=g||ji(s)||bo(s);if(a=We(a,4),u==null){var D=s&&s.constructor;y?u=g?new D:[]:Bt(s)?u=li(D)?mo(Tl(s)):{}:u={}}return(y?gn:Hn)(s,function(M,k,G){return a(u,M,k,G)}),u}function LR(s,a){return s==null?!0:B0(s,a)}function MR(s,a,u){return s==null?s:f2(s,a,W0(u))}function UR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:f2(s,a,W0(u),g)}function _o(s){return s==null?[]:_0(s,vr(s))}function jR(s){return s==null?[]:_0(s,Zr(s))}function FR(s,a,u){return u===r&&(u=a,a=r),u!==r&&(u=_n(u),u=u===u?u:0),a!==r&&(a=_n(a),a=a===a?a:0),ys(_n(s),a,u)}function BR(s,a,u){return a=ui(a),u===r?(u=a,a=0):u=ui(u),s=_n(s),VA(s,a,u)}function kR(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=ui(s),a===r?(a=s,s=0):a=ui(a)),s>a){var g=s;s=a,a=g}if(u||s%1||a%1){var y=Hm();return Or(s+y*(a-s+It("1e-"+((y+"").length-1))),a)}return U0(s,a)}var HR=vo(function(s,a,u){return a=a.toLowerCase(),s+(u?yw(a):a)});function yw(s){return ud(yt(s).toLowerCase())}function bw(s){return s=yt(s),s&&s.replace(ti,TD).replace(f0,"")}function WR(s,a,u){s=yt(s),a=nn(a);var g=s.length;u=u===r?g:ys(it(u),0,g);var y=u;return u-=a.length,u>=0&&s.slice(u,y)==a}function zR(s){return s=yt(s),s&&Lt.test(s)?s.replace(us,RD):s}function qR(s){return s=yt(s),s&&sr.test(s)?s.replace(qt,"\\$&"):s}var VR=vo(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),KR=vo(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),GR=x2("toLowerCase");function ZR(s,a,u){s=yt(s),a=it(a);var g=a?uo(s):0;if(!a||g>=a)return s;var y=(a-g)/2;return Zl(Ml(y),u)+s+Zl(Ll(y),u)}function YR(s,a,u){s=yt(s),a=it(a);var g=a?uo(s):0;return a&&g<a?s+Zl(a-g,u):s}function JR(s,a,u){s=yt(s),a=it(a);var g=a?uo(s):0;return a&&g<a?Zl(a-g,u)+s:s}function QR(s,a,u){return u||a==null?a=0:a&&(a=+a),sA(yt(s).replace(Vt,""),a||0)}function XR(s,a,u){return(u?Br(s,a,u):a===r)?a=1:a=it(a),j0(yt(s),a)}function eN(){var s=arguments,a=yt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var tN=vo(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function rN(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&&!ad(a))&&(a=nn(a),!a&&lo(s))?Ui(On(s),0,u):s.split(a,u)):[]}var nN=vo(function(s,a,u){return s+(u?" ":"")+ud(a)});function iN(s,a,u){return s=yt(s),u=u==null?0:ys(it(u),0,s.length),a=nn(a),s.slice(u,u+a.length)==a}function sN(s,a,u){var g=C.templateSettings;u&&Br(s,a,u)&&(a=r),s=yt(s),a=au({},a,g,$2);var y=au({},a.imports,g.imports,$2),D=vr(y),M=_0(y,D),k,G,ue=0,he=a.interpolate||to,pe="__p += '",be=x0((a.escape||to).source+"|"+he.source+"|"+(he===Ft?Zf:to).source+"|"+(a.evaluate||to).source+"|$","g"),Pe="//# sourceURL="+(bt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++d0+"]")+`
|
|
82
|
-
`;s.replace(be,function(qe,ft,wt,on,kr,an){return wt||(wt=on),pe+=s.slice(ue,an).replace(
|
|
81
|
+
`)}function N$(s){return Xe(s)||xs(s)||!!(km&&s&&s[km])}function ai(s,a){var u=typeof s;return a=a??re,!!a&&(u=="number"||u!="symbol"&&t0.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"?Gr(u)&&ai(a,u.length):g=="string"&&a in u)?Dn(u[a],s):!1}function X0(s,a){if(Xe(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||sn(s)?!0:nr.test(s)||!Mt.test(s)||a!=null&&s in Ot(a)}function L$(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function ed(s){var a=Xl(s),u=C[a];if(typeof u!="function"||!(a in dt.prototype))return!1;if(s===u)return!0;var g=Y0(u);return!!g&&s===g[0]}function M$(s){return!!Um&&Um in s}var U$=Al?ci:wd;function Ha(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||go;return s===u}function U2(s){return s===s&&!Bt(s)}function j2(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in Ot(u))}}function j$(s){var a=su(s,function(g){return u.size===f&&u.clear(),g}),u=a.cache;return a}function F$(s,a){var u=s[1],g=a[1],y=u|g,D=y<(H|Z|d),M=g==d&&u==L||g==d&&u==x&&s[7].length<=a[8]||g==(d|x)&&a[7].length<=a[8]&&u==L;if(!(D||M))return s;g&H&&(s[2]=a[2],y|=u&H?0:N);var k=a[3];if(k){var G=s[3];s[3]=G?b2(G,k,a[4]):k,s[4]=G?Pi(s[3],v):a[4]}return k=a[5],k&&(G=s[5],s[5]=G?_2(G,k,a[6]):k,s[6]=G?Pi(s[5],v):a[6]),k=a[7],k&&(s[7]=k),g&d&&(s[8]=s[8]==null?a[8]:Or(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 Ot(s))a.push(u);return a}function k$(s){return Pl.call(s)}function F2(s,a,u){return a=fr(a===r?s.length-1:a,0),function(){for(var g=arguments,y=-1,D=fr(g.length-a,0),M=te(D);++y<D;)M[y]=g[a+y];y=-1;for(var k=te(a+1);++y<a;)k[y]=g[y];return k[a]=u(M),wr(s,this,k)}}function B2(s,a){return a.length<2?s:bs(s,vn(a,0,-1))}function H$(s,a){for(var u=s.length,g=Or(a.length,u),y=Kr(s);g--;){var D=a[g];s[g]=ai(D,u)?y[D]:r}return s}function td(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var k2=W2(u2),Wa=nA||function(s,a){return mt.setTimeout(s,a)},rd=W2(h$);function H2(s,a,u){var g=a+"";return rd(s,R$(g,W$($$(g),u)))}function W2(s){var a=0,u=0;return function(){var g=aA(),y=me-(g-u);if(u=g,y>0){if(++a>=de)return arguments[0]}else a=0;return s.apply(r,arguments)}}function tu(s,a){var u=-1,g=s.length,y=g-1;for(a=a===r?g:a;++u<a;){var D=j0(u,y),M=s[D];s[D]=s[u],s[u]=M}return s.length=a,s}var z2=j$(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(ir,function(u,g,y,D){a.push(y?D.replace(Zf,"$1"):g||u)}),a});function Wn(s){if(typeof s=="string"||sn(s))return s;var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Es(s){if(s!=null){try{return $l.call(s)}catch{}try{return s+""}catch{}}return""}function W$(s,a){return pn(Be,function(u){var g="_."+u[0];a&u[1]&&!Il(s,g)&&s.push(g)}),s.sort()}function q2(s){if(s instanceof dt)return s.clone();var a=new mn(s.__wrapped__,s.__chain__);return a.__actions__=Kr(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function z$(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=fr(it(a),0);var g=s==null?0:s.length;if(!g||a<1)return[];for(var y=0,D=0,M=te(Ul(g/a));y<g;)M[D++]=vn(s,y,y+=a);return M}function q$(s){for(var a=-1,u=s==null?0:s.length,g=0,y=[];++a<u;){var D=s[a];D&&(y[g++]=D)}return y}function V$(){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 $i(Xe(u)?Kr(u):[u],xr(a,1))}var K$=ct(function(s,a){return Xt(s)?Ua(s,xr(a,1,Xt,!0)):[]}),G$=ct(function(s,a){var u=yn(a);return Xt(u)&&(u=r),Xt(s)?Ua(s,xr(a,1,Xt,!0),We(u,2)):[]}),Z$=ct(function(s,a){var u=yn(a);return Xt(u)&&(u=r),Xt(s)?Ua(s,xr(a,1,Xt,!0),r,u):[]});function Y$(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 J$(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 Q$(s,a){return s&&s.length?Kl(s,We(a,3),!0,!0):[]}function X$(s,a){return s&&s.length?Kl(s,We(a,3),!0):[]}function eP(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),VA(s,a,u,g)):[]}function V2(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=fr(g+y,0)),Sl(s,We(a,3),y)}function K2(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?fr(g+y,0):Or(y,g-1)),Sl(s,We(a,3),y,!0)}function G2(s){var a=s==null?0:s.length;return a?xr(s,1):[]}function tP(s){var a=s==null?0:s.length;return a?xr(s,le):[]}function rP(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:it(a),xr(s,a)):[]}function nP(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 Z2(s){return s&&s.length?s[0]:r}function iP(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=fr(g+y,0)),uo(s,a,y)}function sP(s){var a=s==null?0:s.length;return a?vn(s,0,-1):[]}var oP=ct(function(s){var a=Ut(s,W0);return a.length&&a[0]===s[0]?R0(a):[]}),aP=ct(function(s){var a=yn(s),u=Ut(s,W0);return a===yn(u)?a=r:u.pop(),u.length&&u[0]===s[0]?R0(u,We(a,2)):[]}),cP=ct(function(s){var a=yn(s),u=Ut(s,W0);return a=typeof a=="function"?a:r,a&&u.pop(),u.length&&u[0]===s[0]?R0(u,r,a):[]});function lP(s,a){return s==null?"":sA.call(s,a)}function yn(s){var a=s==null?0:s.length;return a?s[a-1]:r}function uP(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?fr(g+y,0):Or(y,g-1)),a===a?WD(s,a,y):Sl(s,Am,y,!0)}function hP(s,a){return s&&s.length?o2(s,it(a)):r}var fP=ct(Y2);function Y2(s,a){return s&&s.length&&a&&a.length?U0(s,a):s}function dP(s,a,u){return s&&s.length&&a&&a.length?U0(s,a,We(u,2)):s}function pP(s,a,u){return s&&s.length&&a&&a.length?U0(s,a,r,u):s}var gP=oi(function(s,a){var u=s==null?0:s.length,g=A0(s,a);return l2(s,Ut(a,function(y){return ai(y,u)?+y:y}).sort(y2)),g});function mP(s,a){var u=[];if(!(s&&s.length))return u;var g=-1,y=[],D=s.length;for(a=We(a,3);++g<D;){var M=s[g];a(M,g,s)&&(u.push(M),y.push(g))}return l2(s,y),u}function nd(s){return s==null?s:lA.call(s)}function wP(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 vP(s,a){return Vl(s,a)}function yP(s,a,u){return B0(s,a,We(u,2))}function bP(s,a){var u=s==null?0:s.length;if(u){var g=Vl(s,a);if(g<u&&Dn(s[g],a))return g}return-1}function _P(s,a){return Vl(s,a,!0)}function EP(s,a,u){return B0(s,a,We(u,2),!0)}function xP(s,a){var u=s==null?0:s.length;if(u){var g=Vl(s,a,!0)-1;if(Dn(s[g],a))return g}return-1}function CP(s){return s&&s.length?h2(s):[]}function IP(s,a){return s&&s.length?h2(s,We(a,2)):[]}function SP(s){var a=s==null?0:s.length;return a?vn(s,1,a):[]}function OP(s,a,u){return s&&s.length?(a=u||a===r?1:it(a),vn(s,0,a<0?0:a)):[]}function DP(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 AP(s,a){return s&&s.length?Kl(s,We(a,3),!1,!0):[]}function $P(s,a){return s&&s.length?Kl(s,We(a,3)):[]}var PP=ct(function(s){return Ni(xr(s,1,Xt,!0))}),TP=ct(function(s){var a=yn(s);return Xt(a)&&(a=r),Ni(xr(s,1,Xt,!0),We(a,2))}),RP=ct(function(s){var a=yn(s);return a=typeof a=="function"?a:r,Ni(xr(s,1,Xt,!0),r,a)});function NP(s){return s&&s.length?Ni(s):[]}function LP(s,a){return s&&s.length?Ni(s,We(a,2)):[]}function MP(s,a){return a=typeof a=="function"?a:r,s&&s.length?Ni(s,r,a):[]}function id(s){if(!(s&&s.length))return[];var a=0;return s=Ai(s,function(u){if(Xt(u))return a=fr(u.length,a),!0}),_0(a,function(u){return Ut(s,v0(u))})}function J2(s,a){if(!(s&&s.length))return[];var u=id(s);return a==null?u:Ut(u,function(g){return wr(a,r,g)})}var UP=ct(function(s,a){return Xt(s)?Ua(s,a):[]}),jP=ct(function(s){return H0(Ai(s,Xt))}),FP=ct(function(s){var a=yn(s);return Xt(a)&&(a=r),H0(Ai(s,Xt),We(a,2))}),BP=ct(function(s){var a=yn(s);return a=typeof a=="function"?a:r,H0(Ai(s,Xt),r,a)}),kP=ct(id);function HP(s,a){return g2(s||[],a||[],Ma)}function WP(s,a){return g2(s||[],a||[],Ba)}var zP=ct(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,J2(s,u)});function Q2(s){var a=C(s);return a.__chain__=!0,a}function qP(s,a){return a(s),s}function ru(s,a){return a(s)}var VP=oi(function(s){var a=s.length,u=a?s[0]:0,g=this.__wrapped__,y=function(D){return A0(D,s)};return a>1||this.__actions__.length||!(g instanceof dt)||!ai(u)?this.thru(y):(g=g.slice(u,+u+(a?1:0)),g.__actions__.push({func:ru,args:[y],thisArg:r}),new mn(g,this.__chain__).thru(function(D){return a&&!D.length&&D.push(r),D}))});function KP(){return Q2(this)}function GP(){return new mn(this.value(),this.__chain__)}function ZP(){this.__values__===r&&(this.__values__=fw(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function YP(){return this}function JP(s){for(var a,u=this;u instanceof kl;){var g=q2(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 QP(){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:ru,args:[nd],thisArg:r}),new mn(a,this.__chain__)}return this.thru(nd)}function XP(){return p2(this.__wrapped__,this.__actions__)}var eT=Gl(function(s,a,u){bt.call(s,u)?++s[u]:ii(s,u,1)});function tT(s,a,u){var g=Xe(s)?Om:qA;return u&&Br(s,a,u)&&(a=r),g(s,We(a,3))}function rT(s,a){var u=Xe(s)?Ai:Jm;return u(s,We(a,3))}var nT=I2(V2),iT=I2(K2);function sT(s,a){return xr(nu(s,a),1)}function oT(s,a){return xr(nu(s,a),le)}function aT(s,a,u){return u=u===r?1:it(u),xr(nu(s,a),u)}function X2(s,a){var u=Xe(s)?pn:Ri;return u(s,We(a,3))}function ew(s,a){var u=Xe(s)?SD:Ym;return u(s,We(a,3))}var cT=Gl(function(s,a,u){bt.call(s,u)?s[u].push(a):ii(s,u,[a])});function lT(s,a,u,g){s=Gr(s)?s:xo(s),u=u&&!g?it(u):0;var y=s.length;return u<0&&(u=fr(y+u,0)),cu(s)?u<=y&&s.indexOf(a,u)>-1:!!y&&uo(s,a,u)>-1}var uT=ct(function(s,a,u){var g=-1,y=typeof a=="function",D=Gr(s)?te(s.length):[];return Ri(s,function(M){D[++g]=y?wr(a,M,u):ja(M,a,u)}),D}),hT=Gl(function(s,a,u){ii(s,u,a)});function nu(s,a){var u=Xe(s)?Ut:n2;return u(s,We(a,3))}function fT(s,a,u,g){return s==null?[]:(Xe(a)||(a=a==null?[]:[a]),u=g?r:u,Xe(u)||(u=u==null?[]:[u]),a2(s,a,u))}var dT=Gl(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function pT(s,a,u){var g=Xe(s)?m0:Pm,y=arguments.length<3;return g(s,We(a,4),u,y,Ri)}function gT(s,a,u){var g=Xe(s)?OD:Pm,y=arguments.length<3;return g(s,We(a,4),u,y,Ym)}function mT(s,a){var u=Xe(s)?Ai:Jm;return u(s,ou(We(a,3)))}function wT(s){var a=Xe(s)?Vm:l$;return a(s)}function vT(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=it(a);var g=Xe(s)?BA:u$;return g(s,a)}function yT(s){var a=Xe(s)?kA:f$;return a(s)}function bT(s){if(s==null)return 0;if(Gr(s))return cu(s)?fo(s):s.length;var a=Dr(s);return a==Ue||a==He?s.size:L0(s).length}function _T(s,a,u){var g=Xe(s)?w0:d$;return u&&Br(s,a,u)&&(a=r),g(s,We(a,3))}var ET=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]]),a2(s,xr(a,1),[])}),iu=rA||function(){return mt.Date.now()};function xT(s,a){if(typeof a!="function")throw new gn(c);return s=it(s),function(){if(--s<1)return a.apply(this,arguments)}}function tw(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,si(s,d,r,r,r,r,a)}function rw(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 sd=ct(function(s,a,u){var g=H;if(u.length){var y=Pi(u,_o(sd));g|=T}return si(s,g,a,u,y)}),nw=ct(function(s,a,u){var g=H|Z;if(u.length){var y=Pi(u,_o(nw));g|=T}return si(a,g,s,u,y)});function iw(s,a,u){a=u?r:a;var g=si(s,L,r,r,r,r,r,a);return g.placeholder=iw.placeholder,g}function sw(s,a,u){a=u?r:a;var g=si(s,$,r,r,r,r,r,a);return g.placeholder=sw.placeholder,g}function ow(s,a,u){var g,y,D,M,k,G,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,D=pe?fr(bn(u.maxWait)||0,a):D,be="trailing"in u?!!u.trailing:be);function Pe(er){var An=g,ui=y;return g=y=r,ue=er,M=s.apply(ui,An),M}function ze(er){return ue=er,k=Wa(ft,a),he?Pe(er):M}function ot(er){var An=er-G,ui=er-ue,Iw=a-An;return pe?Or(Iw,D-ui):Iw}function qe(er){var An=er-G,ui=er-ue;return G===r||An>=a||An<0||pe&&ui>=D}function ft(){var er=iu();if(qe(er))return wt(er);k=Wa(ft,ot(er))}function wt(er){return k=r,be&&g?Pe(er):(g=y=r,M)}function on(){k!==r&&m2(k),ue=0,g=G=y=k=r}function kr(){return k===r?M:wt(iu())}function an(){var er=iu(),An=qe(er);if(g=arguments,y=this,G=er,An){if(k===r)return ze(G);if(pe)return m2(k),k=Wa(ft,a),Pe(G)}return k===r&&(k=Wa(ft,a)),M}return an.cancel=on,an.flush=kr,an}var CT=ct(function(s,a){return Zm(s,1,a)}),IT=ct(function(s,a,u){return Zm(s,bn(a)||0,u)});function ST(s){return si(s,J)}function su(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],D=u.cache;if(D.has(y))return D.get(y);var M=s.apply(this,g);return u.cache=D.set(y,M)||D,M};return u.cache=new(su.Cache||ni),u}su.Cache=ni;function ou(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 OT(s){return rw(2,s)}var DT=p$(function(s,a){a=a.length==1&&Xe(a[0])?Ut(a[0],rn(We())):Ut(xr(a,1),rn(We()));var u=a.length;return ct(function(g){for(var y=-1,D=Or(g.length,u);++y<D;)g[y]=a[y].call(this,g[y]);return wr(s,this,g)})}),od=ct(function(s,a){var u=Pi(a,_o(od));return si(s,T,r,a,u)}),aw=ct(function(s,a){var u=Pi(a,_o(aw));return si(s,I,r,a,u)}),AT=oi(function(s,a){return si(s,x,r,r,r,a)});function $T(s,a){if(typeof s!="function")throw new gn(c);return a=a===r?a:it(a),ct(s,a)}function PT(s,a){if(typeof s!="function")throw new gn(c);return a=a==null?0:fr(it(a),0),ct(function(u){var g=u[a],y=Mi(u,0,a);return g&&$i(y,g),wr(s,this,y)})}function TT(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),ow(s,a,{leading:g,maxWait:a,trailing:y})}function RT(s){return tw(s,1)}function NT(s,a){return od(z0(a),s)}function LT(){if(!arguments.length)return[];var s=arguments[0];return Xe(s)?s:[s]}function MT(s){return wn(s,S)}function UT(s,a){return a=typeof a=="function"?a:r,wn(s,S,a)}function jT(s){return wn(s,E|S)}function FT(s,a){return a=typeof a=="function"?a:r,wn(s,E|S,a)}function BT(s,a){return a==null||Gm(s,a,vr(a))}function Dn(s,a){return s===a||s!==s&&a!==a}var kT=Ql(T0),HT=Ql(function(s,a){return s>=a}),xs=e2(function(){return arguments}())?e2:function(s){return Gt(s)&&bt.call(s,"callee")&&!Bm.call(s,"callee")},Xe=te.isArray,WT=jr?rn(jr):JA;function Gr(s){return s!=null&&au(s.length)&&!ci(s)}function Xt(s){return Gt(s)&&Gr(s)}function zT(s){return s===!0||s===!1||Gt(s)&&Fr(s)==Y}var Ui=iA||wd,qT=In?rn(In):QA;function VT(s){return Gt(s)&&s.nodeType===1&&!za(s)}function KT(s){if(s==null)return!0;if(Gr(s)&&(Xe(s)||typeof s=="string"||typeof s.splice=="function"||Ui(s)||Eo(s)||xs(s)))return!s.length;var a=Dr(s);if(a==Ue||a==He)return!s.size;if(Ha(s))return!L0(s).length;for(var u in s)if(bt.call(s,u))return!1;return!0}function GT(s,a){return Fa(s,a)}function ZT(s,a,u){u=typeof u=="function"?u:r;var g=u?u(s,a):r;return g===r?Fa(s,a,r,u):!!g}function ad(s){if(!Gt(s))return!1;var a=Fr(s);return a==F||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!za(s)}function YT(s){return typeof s=="number"&&Hm(s)}function ci(s){if(!Bt(s))return!1;var a=Fr(s);return a==we||a==ve||a==Q||a==$t}function cw(s){return typeof s=="number"&&s==it(s)}function au(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 lw=dn?rn(dn):e$;function JT(s,a){return s===a||N0(s,a,J0(a))}function QT(s,a,u){return u=typeof u=="function"?u:r,N0(s,a,J0(a),u)}function XT(s){return uw(s)&&s!=+s}function eR(s){if(U$(s))throw new Ye(o);return t2(s)}function tR(s){return s===null}function rR(s){return s==null}function uw(s){return typeof s=="number"||Gt(s)&&Fr(s)==nt}function za(s){if(!Gt(s)||Fr(s)!=Ge)return!1;var a=Nl(s);if(a===null)return!0;var u=bt.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&$l.call(u)==QD}var cd=Bn?rn(Bn):t$;function nR(s){return cw(s)&&s>=-re&&s<=re}var hw=Aa?rn(Aa):r$;function cu(s){return typeof s=="string"||!Xe(s)&&Gt(s)&&Fr(s)==ke}function sn(s){return typeof s=="symbol"||Gt(s)&&Fr(s)==Ke}var Eo=gs?rn(gs):n$;function iR(s){return s===r}function sR(s){return Gt(s)&&Dr(s)==je}function oR(s){return Gt(s)&&Fr(s)==Ze}var aR=Ql(M0),cR=Ql(function(s,a){return s<=a});function fw(s){if(!s)return[];if(Gr(s))return cu(s)?Sn(s):Kr(s);if(Pa&&s[Pa])return BD(s[Pa]());var a=Dr(s),u=a==Ue?x0:a==He?Ol:xo;return u(s)}function li(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=li(s),u=a%1;return a===a?u?a-u:a:0}function dw(s){return s?ys(it(s),0,ie):0}function bn(s){if(typeof s=="number")return s;if(sn(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=Tm(s);var u=Qf.test(s);return u||e0.test(s)?Qe(s.slice(2),u?2:8):Jf.test(s)?ae:+s}function pw(s){return Hn(s,Zr(s))}function lR(s){return s?ys(it(s),-re,re):s===0?s:0}function yt(s){return s==null?"":nn(s)}var uR=yo(function(s,a){if(Ha(a)||Gr(a)){Hn(a,vr(a),s);return}for(var u in a)bt.call(a,u)&&Ma(s,u,a[u])}),gw=yo(function(s,a){Hn(a,Zr(a),s)}),lu=yo(function(s,a,u,g){Hn(a,Zr(a),s,g)}),hR=yo(function(s,a,u,g){Hn(a,vr(a),s,g)}),fR=oi(A0);function dR(s,a){var u=vo(s);return a==null?u:Km(u,a)}var pR=ct(function(s,a){s=Ot(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 D=a[u],M=Zr(D),k=-1,G=M.length;++k<G;){var ue=M[k],he=s[ue];(he===r||Dn(he,go[ue])&&!bt.call(s,ue))&&(s[ue]=D[ue])}return s}),gR=ct(function(s){return s.push(r,T2),wr(mw,r,s)});function mR(s,a){return Dm(s,We(a,3),kn)}function wR(s,a){return Dm(s,We(a,3),P0)}function vR(s,a){return s==null?s:$0(s,We(a,3),Zr)}function yR(s,a){return s==null?s:Qm(s,We(a,3),Zr)}function bR(s,a){return s&&kn(s,We(a,3))}function _R(s,a){return s&&P0(s,We(a,3))}function ER(s){return s==null?[]:zl(s,vr(s))}function xR(s){return s==null?[]:zl(s,Zr(s))}function ld(s,a,u){var g=s==null?r:bs(s,a);return g===r?u:g}function CR(s,a){return s!=null&&L2(s,a,KA)}function ud(s,a){return s!=null&&L2(s,a,GA)}var IR=O2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Pl.call(a)),s[a]=u},fd(Yr)),SR=O2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Pl.call(a)),bt.call(s,a)?s[a].push(u):s[a]=[u]},We),OR=ct(ja);function vr(s){return Gr(s)?qm(s):L0(s)}function Zr(s){return Gr(s)?qm(s,!0):i$(s)}function DR(s,a){var u={};return a=We(a,3),kn(s,function(g,y,D){ii(u,a(g,y,D),g)}),u}function AR(s,a){var u={};return a=We(a,3),kn(s,function(g,y,D){ii(u,y,a(g,y,D))}),u}var $R=yo(function(s,a,u){ql(s,a,u)}),mw=yo(function(s,a,u,g){ql(s,a,u,g)}),PR=oi(function(s,a){var u={};if(s==null)return u;var g=!1;a=Ut(a,function(D){return D=Li(D,s),g||(g=D.length>1),D}),Hn(s,Z0(s),u),g&&(u=wn(u,E|_|S,I$));for(var y=a.length;y--;)k0(u,a[y]);return u});function TR(s,a){return ww(s,ou(We(a)))}var RR=oi(function(s,a){return s==null?{}:o$(s,a)});function ww(s,a){if(s==null)return{};var u=Ut(Z0(s),function(g){return[g]});return a=We(a),c2(s,u,function(g,y){return a(g,y[0])})}function NR(s,a,u){a=Li(a,s);var g=-1,y=a.length;for(y||(y=1,s=r);++g<y;){var D=s==null?r:s[Wn(a[g])];D===r&&(g=y,D=u),s=ci(D)?D.call(s):D}return s}function LR(s,a,u){return s==null?s:Ba(s,a,u)}function MR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:Ba(s,a,u,g)}var vw=$2(vr),yw=$2(Zr);function UR(s,a,u){var g=Xe(s),y=g||Ui(s)||Eo(s);if(a=We(a,4),u==null){var D=s&&s.constructor;y?u=g?new D:[]:Bt(s)?u=ci(D)?vo(Nl(s)):{}:u={}}return(y?pn:kn)(s,function(M,k,G){return a(u,M,k,G)}),u}function jR(s,a){return s==null?!0:k0(s,a)}function FR(s,a,u){return s==null?s:d2(s,a,z0(u))}function BR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:d2(s,a,z0(u),g)}function xo(s){return s==null?[]:E0(s,vr(s))}function kR(s){return s==null?[]:E0(s,Zr(s))}function HR(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),ys(bn(s),a,u)}function WR(s,a,u){return a=li(a),u===r?(u=a,a=0):u=li(u),s=bn(s),ZA(s,a,u)}function zR(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=li(s),a===r?(a=s,s=0):a=li(a)),s>a){var g=s;s=a,a=g}if(u||s%1||a%1){var y=Wm();return Or(s+y*(a-s+It("1e-"+((y+"").length-1))),a)}return j0(s,a)}var qR=bo(function(s,a,u){return a=a.toLowerCase(),s+(u?bw(a):a)});function bw(s){return hd(yt(s).toLowerCase())}function _w(s){return s=yt(s),s&&s.replace(ei,LD).replace(d0,"")}function VR(s,a,u){s=yt(s),a=nn(a);var g=s.length;u=u===r?g:ys(it(u),0,g);var y=u;return u-=a.length,u>=0&&s.slice(u,y)==a}function KR(s){return s=yt(s),s&&Lt.test(s)?s.replace(us,MD):s}function GR(s){return s=yt(s),s&&sr.test(s)?s.replace(qt,"\\$&"):s}var ZR=bo(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),YR=bo(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),JR=C2("toLowerCase");function QR(s,a,u){s=yt(s),a=it(a);var g=a?fo(s):0;if(!a||g>=a)return s;var y=(a-g)/2;return Jl(jl(y),u)+s+Jl(Ul(y),u)}function XR(s,a,u){s=yt(s),a=it(a);var g=a?fo(s):0;return a&&g<a?s+Jl(a-g,u):s}function eN(s,a,u){s=yt(s),a=it(a);var g=a?fo(s):0;return a&&g<a?Jl(a-g,u)+s:s}function tN(s,a,u){return u||a==null?a=0:a&&(a=+a),cA(yt(s).replace(Vt,""),a||0)}function rN(s,a,u){return(u?Br(s,a,u):a===r)?a=1:a=it(a),F0(yt(s),a)}function nN(){var s=arguments,a=yt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var iN=bo(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function sN(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&&!cd(a))&&(a=nn(a),!a&&ho(s))?Mi(Sn(s),0,u):s.split(a,u)):[]}var oN=bo(function(s,a,u){return s+(u?" ":"")+hd(a)});function aN(s,a,u){return s=yt(s),u=u==null?0:ys(it(u),0,s.length),a=nn(a),s.slice(u,u+a.length)==a}function cN(s,a,u){var g=C.templateSettings;u&&Br(s,a,u)&&(a=r),s=yt(s),a=lu({},a,g,P2);var y=lu({},a.imports,g.imports,P2),D=vr(y),M=E0(y,D),k,G,ue=0,he=a.interpolate||no,pe="__p += '",be=C0((a.escape||no).source+"|"+he.source+"|"+(he===Ft?Yf:no).source+"|"+(a.evaluate||no).source+"|$","g"),Pe="//# sourceURL="+(bt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++p0+"]")+`
|
|
82
|
+
`;s.replace(be,function(qe,ft,wt,on,kr,an){return wt||(wt=on),pe+=s.slice(ue,an).replace(r0,UD),ft&&(k=!0,pe+=`' +
|
|
83
83
|
__e(`+ft+`) +
|
|
84
84
|
'`),kr&&(G=!0,pe+=`';
|
|
85
85
|
`+kr+`;
|
|
@@ -89,36 +89,36 @@ __p += '`),wt&&(pe+=`' +
|
|
|
89
89
|
`;var ze=bt.call(a,"variable")&&a.variable;if(!ze)pe=`with (obj) {
|
|
90
90
|
`+pe+`
|
|
91
91
|
}
|
|
92
|
-
`;else if(
|
|
92
|
+
`;else if(Gf.test(ze))throw new Ye(l);pe=(G?pe.replace(lt,""):pe).replace(Ur,"$1").replace(Xn,"$1;"),pe="function("+(ze||"obj")+`) {
|
|
93
93
|
`+(ze?"":`obj || (obj = {});
|
|
94
94
|
`)+"var __t, __p = ''"+(k?", __e = _.escape":"")+(G?`, __j = Array.prototype.join;
|
|
95
95
|
function print() { __p += __j.call(arguments, '') }
|
|
96
96
|
`:`;
|
|
97
97
|
`)+pe+`return __p
|
|
98
|
-
}`;var ot=Ew(function(){return vt(D,Pe+"return "+pe).apply(r,M)});if(ot.source=pe,od(ot))throw ot;return ot}function oN(s){return yt(s).toLowerCase()}function aN(s){return yt(s).toUpperCase()}function cN(s,a,u){if(s=yt(s),s&&(u||a===r))return Pm(s);if(!s||!(a=nn(a)))return s;var g=On(s),y=On(a),D=Tm(g,y),M=Rm(g,y)+1;return Ui(g,D,M).join("")}function lN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.slice(0,Lm(s)+1);if(!s||!(a=nn(a)))return s;var g=On(s),y=Rm(g,On(a))+1;return Ui(g,0,y).join("")}function uN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.replace(Vt,"");if(!s||!(a=nn(a)))return s;var g=On(s),y=Tm(g,On(a));return Ui(g,y).join("")}function hN(s,a){var u=W,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?nn(a.omission):g}s=yt(s);var D=s.length;if(lo(s)){var M=On(s);D=M.length}if(u>=D)return s;var k=u-uo(g);if(k<1)return g;var G=M?Ui(M,0,k).join(""):s.slice(0,k);if(y===r)return G+g;if(M&&(k+=G.length-k),ad(y)){if(s.slice(k).search(y)){var ue,he=G;for(y.global||(y=x0(y.source,yt(dn.exec(y))+"g")),y.lastIndex=0;ue=y.exec(he);)var pe=ue.index;G=G.slice(0,pe===r?k:pe)}}else if(s.indexOf(nn(y),k)!=k){var be=G.lastIndexOf(y);be>-1&&(G=G.slice(0,be))}return G+g}function fN(s){return s=yt(s),s&&Ht.test(s)?s.replace(Di,kD):s}var dN=vo(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),ud=x2("toUpperCase");function _w(s,a,u){return s=yt(s),a=u?r:a,a===r?MD(s)?zD(s):OD(s):s.match(a)||[]}var Ew=ct(function(s,a){try{return wr(s,r,a)}catch(u){return od(u)?u:new Ye(u)}}),pN=ai(function(s,a){return gn(a,function(u){u=zn(u),si(s,u,id(s[u],s))}),s});function gN(s){var a=s==null?0:s.length,u=We();return s=a?Ut(s,function(g){if(typeof g[1]!="function")throw new mn(c);return[u(g[0]),g[1]]}):[],ct(function(g){for(var y=-1;++y<a;){var D=s[y];if(wr(D[0],this,g))return wr(D[1],this,g)}})}function mN(s){return kA(vn(s,E))}function hd(s){return function(){return s}}function wN(s,a){return s==null||s!==s?a:s}var vN=I2(),yN=I2(!0);function Yr(s){return s}function fd(s){return t2(typeof s=="function"?s:vn(s,E))}function bN(s){return n2(vn(s,E))}function _N(s,a){return i2(s,vn(a,E))}var EN=ct(function(s,a){return function(u){return Ma(u,s,a)}}),xN=ct(function(s,a){return function(u){return Ma(s,u,a)}});function dd(s,a,u){var g=vr(a),y=Hl(a,g);u==null&&!(Bt(a)&&(y.length||!g.length))&&(u=a,a=s,s=this,y=Hl(a,vr(a)));var D=!(Bt(u)&&"chain"in u)||!!u.chain,M=li(s);return gn(y,function(k){var G=a[k];s[k]=G,M&&(s.prototype[k]=function(){var ue=this.__chain__;if(D||ue){var he=s(this.__wrapped__),pe=he.__actions__=Kr(this.__actions__);return pe.push({func:G,args:arguments,thisArg:s}),he.__chain__=ue,he}return G.apply(s,Pi([this.value()],arguments))})}),s}function CN(){return mt._===this&&(mt._=YD),this}function pd(){}function IN(s){return s=it(s),ct(function(a){return s2(a,s)})}var SN=q0(Ut),ON=q0(Sm),DN=q0(m0);function xw(s){return Q0(s)?w0(zn(s)):i$(s)}function AN(s){return function(a){return s==null?r:bs(s,a)}}var $N=O2(),PN=O2(!0);function gd(){return[]}function md(){return!1}function TN(){return{}}function RN(){return""}function NN(){return!0}function LN(s,a){if(s=it(s),s<1||s>re)return[];var u=ie,g=Or(s,ie);a=We(a),s-=ie;for(var y=b0(g,a);++u<s;)a(u);return y}function MN(s){return Xe(s)?Ut(s,zn):sn(s)?[s]:Kr(W2(yt(s)))}function UN(s){var a=++GD;return yt(s)+a}var jN=Gl(function(s,a){return s+a},0),FN=V0("ceil"),BN=Gl(function(s,a){return s/a},1),kN=V0("floor");function HN(s){return s&&s.length?kl(s,Yr,P0):r}function WN(s,a){return s&&s.length?kl(s,We(a,2),P0):r}function zN(s){return Am(s,Yr)}function qN(s,a){return Am(s,We(a,2))}function VN(s){return s&&s.length?kl(s,Yr,L0):r}function KN(s,a){return s&&s.length?kl(s,We(a,2),L0):r}var GN=Gl(function(s,a){return s*a},1),ZN=V0("round"),YN=Gl(function(s,a){return s-a},0);function JN(s){return s&&s.length?y0(s,Yr):0}function QN(s,a){return s&&s.length?y0(s,We(a,2)):0}return C.after=bT,C.ary=ew,C.assign=aR,C.assignIn=pw,C.assignInWith=au,C.assignWith=cR,C.at=lR,C.before=tw,C.bind=id,C.bindAll=pN,C.bindKey=rw,C.castArray=TT,C.chain=J2,C.chunk=k$,C.compact=H$,C.concat=W$,C.cond=gN,C.conforms=mN,C.constant=hd,C.countBy=JP,C.create=uR,C.curry=nw,C.curryRight=iw,C.debounce=sw,C.defaults=hR,C.defaultsDeep=fR,C.defer=_T,C.delay=ET,C.difference=z$,C.differenceBy=q$,C.differenceWith=V$,C.drop=K$,C.dropRight=G$,C.dropRightWhile=Z$,C.dropWhile=Y$,C.fill=J$,C.filter=XP,C.flatMap=rT,C.flatMapDeep=nT,C.flatMapDepth=iT,C.flatten=K2,C.flattenDeep=Q$,C.flattenDepth=X$,C.flip=xT,C.flow=vN,C.flowRight=yN,C.fromPairs=eP,C.functions=yR,C.functionsIn=bR,C.groupBy=sT,C.initial=rP,C.intersection=nP,C.intersectionBy=iP,C.intersectionWith=sP,C.invert=ER,C.invertBy=xR,C.invokeMap=aT,C.iteratee=fd,C.keyBy=cT,C.keys=vr,C.keysIn=Zr,C.map=tu,C.mapKeys=IR,C.mapValues=SR,C.matches=bN,C.matchesProperty=_N,C.memoize=nu,C.merge=OR,C.mergeWith=gw,C.method=EN,C.methodOf=xN,C.mixin=dd,C.negate=iu,C.nthArg=IN,C.omit=DR,C.omitBy=AR,C.once=CT,C.orderBy=lT,C.over=SN,C.overArgs=IT,C.overEvery=ON,C.overSome=DN,C.partial=sd,C.partialRight=ow,C.partition=uT,C.pick=$R,C.pickBy=mw,C.property=xw,C.propertyOf=AN,C.pull=lP,C.pullAll=Z2,C.pullAllBy=uP,C.pullAllWith=hP,C.pullAt=fP,C.range=$N,C.rangeRight=PN,C.rearg=ST,C.reject=dT,C.remove=dP,C.rest=OT,C.reverse=rd,C.sampleSize=gT,C.set=TR,C.setWith=RR,C.shuffle=mT,C.slice=pP,C.sortBy=yT,C.sortedUniq=_P,C.sortedUniqBy=EP,C.split=rN,C.spread=DT,C.tail=xP,C.take=CP,C.takeRight=IP,C.takeRightWhile=SP,C.takeWhile=OP,C.tap=HP,C.throttle=AT,C.thru=eu,C.toArray=hw,C.toPairs=ww,C.toPairsIn=vw,C.toPath=MN,C.toPlainObject=dw,C.transform=NR,C.unary=$T,C.union=DP,C.unionBy=AP,C.unionWith=$P,C.uniq=PP,C.uniqBy=TP,C.uniqWith=RP,C.unset=LR,C.unzip=nd,C.unzipWith=Y2,C.update=MR,C.updateWith=UR,C.values=_o,C.valuesIn=jR,C.without=NP,C.words=_w,C.wrap=PT,C.xor=LP,C.xorBy=MP,C.xorWith=UP,C.zip=jP,C.zipObject=FP,C.zipObjectDeep=BP,C.zipWith=kP,C.entries=ww,C.entriesIn=vw,C.extend=pw,C.extendWith=au,dd(C,C),C.add=jN,C.attempt=Ew,C.camelCase=HR,C.capitalize=yw,C.ceil=FN,C.clamp=FR,C.clone=RT,C.cloneDeep=LT,C.cloneDeepWith=MT,C.cloneWith=NT,C.conformsTo=UT,C.deburr=bw,C.defaultTo=wN,C.divide=BN,C.endsWith=WR,C.eq=An,C.escape=zR,C.escapeRegExp=qR,C.every=QP,C.find=eT,C.findIndex=q2,C.findKey=dR,C.findLast=tT,C.findLastIndex=V2,C.findLastKey=pR,C.floor=kN,C.forEach=Q2,C.forEachRight=X2,C.forIn=gR,C.forInRight=mR,C.forOwn=wR,C.forOwnRight=vR,C.get=cd,C.gt=jT,C.gte=FT,C.has=_R,C.hasIn=ld,C.head=G2,C.identity=Yr,C.includes=oT,C.indexOf=tP,C.inRange=BR,C.invoke=CR,C.isArguments=xs,C.isArray=Xe,C.isArrayBuffer=BT,C.isArrayLike=Gr,C.isArrayLikeObject=Xt,C.isBoolean=kT,C.isBuffer=ji,C.isDate=HT,C.isElement=WT,C.isEmpty=zT,C.isEqual=qT,C.isEqualWith=VT,C.isError=od,C.isFinite=KT,C.isFunction=li,C.isInteger=aw,C.isLength=su,C.isMap=cw,C.isMatch=GT,C.isMatchWith=ZT,C.isNaN=YT,C.isNative=JT,C.isNil=XT,C.isNull=QT,C.isNumber=lw,C.isObject=Bt,C.isObjectLike=Gt,C.isPlainObject=Ha,C.isRegExp=ad,C.isSafeInteger=eR,C.isSet=uw,C.isString=ou,C.isSymbol=sn,C.isTypedArray=bo,C.isUndefined=tR,C.isWeakMap=rR,C.isWeakSet=nR,C.join=oP,C.kebabCase=VR,C.last=bn,C.lastIndexOf=aP,C.lowerCase=KR,C.lowerFirst=GR,C.lt=iR,C.lte=sR,C.max=HN,C.maxBy=WN,C.mean=zN,C.meanBy=qN,C.min=VN,C.minBy=KN,C.stubArray=gd,C.stubFalse=md,C.stubObject=TN,C.stubString=RN,C.stubTrue=NN,C.multiply=GN,C.nth=cP,C.noConflict=CN,C.noop=pd,C.now=ru,C.pad=ZR,C.padEnd=YR,C.padStart=JR,C.parseInt=QR,C.random=kR,C.reduce=hT,C.reduceRight=fT,C.repeat=XR,C.replace=eN,C.result=PR,C.round=ZN,C.runInContext=V,C.sample=pT,C.size=wT,C.snakeCase=tN,C.some=vT,C.sortedIndex=gP,C.sortedIndexBy=mP,C.sortedIndexOf=wP,C.sortedLastIndex=vP,C.sortedLastIndexBy=yP,C.sortedLastIndexOf=bP,C.startCase=nN,C.startsWith=iN,C.subtract=YN,C.sum=JN,C.sumBy=QN,C.template=sN,C.times=LN,C.toFinite=ui,C.toInteger=it,C.toLength=fw,C.toLower=oN,C.toNumber=_n,C.toSafeInteger=oR,C.toString=yt,C.toUpper=aN,C.trim=cN,C.trimEnd=lN,C.trimStart=uN,C.truncate=hN,C.unescape=fN,C.uniqueId=UN,C.upperCase=dN,C.upperFirst=ud,C.each=Q2,C.eachRight=X2,C.first=G2,dd(C,function(){var s={};return Hn(C,function(a,u){bt.call(C.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),C.VERSION=n,gn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){C[s].placeholder=C}),gn(["drop","take"],function(s,a){dt.prototype[s]=function(u){u=u===r?1:fr(it(u),0);var g=this.__filtered__&&!a?new dt(this):this.clone();return g.__filtered__?g.__takeCount__=Or(u,g.__takeCount__):g.__views__.push({size:Or(u,ie),type:s+(g.__dir__<0?"Right":"")}),g},dt.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),gn(["filter","map","takeWhile"],function(s,a){var u=a+1,g=u==O||u==ce;dt.prototype[s]=function(y){var D=this.clone();return D.__iteratees__.push({iteratee:We(y,3),type:u}),D.__filtered__=D.__filtered__||g,D}}),gn(["head","last"],function(s,a){var u="take"+(a?"Right":"");dt.prototype[s]=function(){return this[u](1).value()[0]}}),gn(["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(Yr)},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 Ma(u,s,a)})}),dt.prototype.reject=function(s){return this.filter(iu(We(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)},Hn(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],D=g||/^find/.test(a);y&&(C.prototype[a]=function(){var M=this.__wrapped__,k=g?[1]:arguments,G=M instanceof dt,ue=k[0],he=G||Xe(M),pe=function(ft){var wt=y.apply(C,Pi([ft],k));return g&&be?wt[0]:wt};he&&u&&typeof ue=="function"&&ue.length!=1&&(G=he=!1);var be=this.__chain__,Pe=!!this.__actions__.length,ze=D&&!be,ot=G&&!Pe;if(!D&&he){M=ot?M:new dt(this);var qe=s.apply(M,k);return qe.__actions__.push({func:eu,args:[pe],thisArg:r}),new wn(qe,be)}return ze&&ot?s.apply(this,k):(qe=this.thru(pe),ze?g?qe.value()[0]:qe.value():qe)})}),gn(["pop","push","shift","sort","splice","unshift"],function(s){var a=Sl[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 D=this.value();return a.apply(Xe(D)?D:[],y)}return this[u](function(M){return a.apply(Xe(M)?M:[],y)})}}),Hn(dt.prototype,function(s,a){var u=C[a];if(u){var g=u.name+"";bt.call(go,g)||(go[g]=[]),go[g].push({name:a,func:u})}}),go[Kl(r,Z).name]=[{name:"wrapper",func:r}],dt.prototype.clone=fA,dt.prototype.reverse=dA,dt.prototype.value=pA,C.prototype.at=WP,C.prototype.chain=zP,C.prototype.commit=qP,C.prototype.next=VP,C.prototype.plant=GP,C.prototype.reverse=ZP,C.prototype.toJSON=C.prototype.valueOf=C.prototype.value=YP,C.prototype.first=C.prototype.head,Aa&&(C.prototype[Aa]=KP),C},ho=qD();Qt?((Qt.exports=ho)._=ho,St._=ho):mt._=ho}).call(Jo)})(Ch,Ch.exports);var U7=Object.defineProperty,j7=Object.defineProperties,F7=Object.getOwnPropertyDescriptors,Pg=Object.getOwnPropertySymbols,B7=Object.prototype.hasOwnProperty,k7=Object.prototype.propertyIsEnumerable,Tg=(t,e,r)=>e in t?U7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gc=(t,e)=>{for(var r in e||(e={}))B7.call(e,r)&&Tg(t,r,e[r]);if(Pg)for(var r of Pg(e))k7.call(e,r)&&Tg(t,r,e[r]);return t},H7=(t,e)=>j7(t,F7(e));function ln(t,e,r){let n;const i=Ih(t);return e.rpcMap&&(n=e.rpcMap[i]),n||(n=`${M7}?chainId=eip155:${i}&projectId=${r}`),n}function Ih(t){return t.includes("eip155")?Number(t.split(":")[1]):Number(t)}function Rg(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function W7(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 z7(t={},e={}){const r=Ng(t),n=Ng(e);return Ch.exports.merge(r,n)}function Ng(t){var e,r,n,i;const o={};if(!Ps(t))return o;for(const[c,l]of Object.entries(t)){const h=Fu(c)?[c]:l.chains,f=l.methods||[],v=l.events||[],E=l.rpcMap||{},_=To(c);o[_]=H7(gc(gc({},o[_]),l),{chains:Uu(h,(e=o[_])==null?void 0:e.chains),methods:Uu(f,(r=o[_])==null?void 0:r.methods),events:Uu(v,(n=o[_])==null?void 0:n.events),rpcMap:gc(gc({},E),(i=o[_])==null?void 0:i.rpcMap)})}return o}function q7(t){return t.includes(":")?t.split(":")[2]:t}function V7(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],o=n.events||[],c=n.accounts||[],l=Fu(r)?[r]:n.chains?n.chains:Rg(n.accounts);e[r]={chains:l,methods:i,events:o,accounts:c}}return e}function Sh(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):t.includes(":")?Number(t.split(":")[1]):Number(t)}const Lg={},Yt=t=>Lg[t],Oh=(t,e)=>{Lg[t]=e};class K7{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||ln(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(mi.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||ln(e,this.namespace);return typeof n>"u"?void 0:new pi(new Gi(n,Yt("disableProviderPing")))}}class G7{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){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);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=Ih(e);if(!this.httpProviders[n]){const i=r||ln(`${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(mi.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||ln(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pi(new Gi(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=Ih(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}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const o=parseInt(i,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class Z7{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||ln(`${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(mi.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||ln(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pi(new Gi(n,Yt("disableProviderPing")))}}class Y7{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||ln(`${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(mi.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||ln(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pi(new Gi(n,Yt("disableProviderPing")))}}class J7{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(mi.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 pi(new Gi(n,Yt("disableProviderPing")))}}class Q7{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||ln(`${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(mi.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||ln(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pi(new Gi(n,Yt("disableProviderPing")))}}class X7{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||ln(`${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(mi.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||ln(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pi(new Gi(n,Yt("disableProviderPing")))}}var ex=Object.defineProperty,tx=Object.defineProperties,rx=Object.getOwnPropertyDescriptors,Mg=Object.getOwnPropertySymbols,nx=Object.prototype.hasOwnProperty,ix=Object.prototype.propertyIsEnumerable,Ug=(t,e,r)=>e in t?ex(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mc=(t,e)=>{for(var r in e||(e={}))nx.call(e,r)&&Ug(t,r,e[r]);if(Mg)for(var r of Mg(e))ix.call(e,r)&&Ug(t,r,e[r]);return t},Dh=(t,e)=>tx(t,rx(e));class Ah{constructor(e){this.events=new yr.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||Ag})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new Ah(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:mc({},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,this.namespaces||(this.namespaces=V7(o.namespaces),this.persist("namespaces",this.namespaces))}).catch(o=>{if(o.message!==xg)throw o;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;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(Tn(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 Eh.init({logger:this.providerOpts.logger||Ag,relayUrl:this.providerOpts.relayUrl||R7,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,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=>To(r)))];Oh("client",this.client),Oh("events",this.events),Oh("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=W7(r,this.session),i=Rg(n),o=z7(this.namespaces,this.optionalNamespaces),c=Dh(mc({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new G7({namespace:c});break;case"solana":this.rpcProviders[r]=new Z7({namespace:c});break;case"cosmos":this.rpcProviders[r]=new Y7({namespace:c});break;case"polkadot":this.rpcProviders[r]=new K7({namespace:c});break;case"cip34":this.rpcProviders[r]=new J7({namespace:c});break;case"elrond":this.rpcProviders[r]=new Q7({namespace:c});break;case"multiversx":this.rpcProviders[r]=new X7({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;if(n.name==="accountsChanged"){const i=n.data;i&&Tn(i)&&this.events.emit("accountsChanged",i.map(q7))}else if(n.name==="chainChanged"){const i=r.chainId,o=r.event.data,c=To(i),l=Sh(i)!==Sh(o)?`${c}:${Sh(o)}`:i;this.onChainChanged(l)}else 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=Dh(mc({},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",Dh(mc({},Zt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(mi.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;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(c=>To(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=To(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;if(!this.namespaces)return;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,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",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 sx=Ah,ox="wc",ax="ethereum_provider",cx=`${ox}@2:${ax}:`,lx="https://rpc.walletconnect.com/v1/",wc=["eth_sendTransaction","personal_sign"],jg=["eth_accounts","eth_requestAccounts","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"],vc=["chainChanged","accountsChanged"],Fg=["message","disconnect","connect"];var ux=Object.defineProperty,hx=Object.defineProperties,fx=Object.getOwnPropertyDescriptors,Bg=Object.getOwnPropertySymbols,dx=Object.prototype.hasOwnProperty,px=Object.prototype.propertyIsEnumerable,kg=(t,e,r)=>e in t?ux(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qo=(t,e)=>{for(var r in e||(e={}))dx.call(e,r)&&kg(t,r,e[r]);if(Bg)for(var r of Bg(e))px.call(e,r)&&kg(t,r,e[r]);return t},Hg=(t,e)=>hx(t,fx(e));function yc(t){return Number(t[0].split(":")[1])}function $h(t){return`0x${t.toString(16)}`}function gx(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:c,rpcMap:l}=t;if(!Tn(e))throw new Error("Invalid chains");const h={chains:e,methods:n||wc,events:o||vc,rpcMap:Qo({},e.length?{[yc(e)]:l[yc(e)]}:{})},f=o?.filter(S=>!vc.includes(S)),v=n?.filter(S=>!wc.includes(S));if(!r&&!c&&!i&&!(f!=null&&f.length)&&!(v!=null&&v.length))return{required:e.length?h:void 0};const E=f?.length&&v?.length||!r,_={chains:[...new Set(E?h.chains.concat(r||[]):r)],methods:[...new Set(h.methods.concat(i!=null&&i.length?i:jg))],events:[...new Set(h.events.concat(c||Fg))],rpcMap:l};return{required:e.length?h:void 0,optional:r.length?_:void 0}}class bc{constructor(){this.events=new yr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=cx,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 bc;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}=gx(this.rpc);try{const i=await new Promise(async(c,l)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Hg(Qo({namespaces:Qo({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(f=>{c(f)}).catch(f=>{l(new Error(f.message))})});if(!i)return;const o=V5(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),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",Hg(Qo({},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)})}switchEthereumChain(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.switchEthereumChain(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;const i=(r=e?.chains)!=null?r:[],o=(n=e?.optionalChains)!=null?n:[],c=i.concat(o);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=i.length?e?.methods||wc:[],h=i.length?e?.events||vc:[],f=e?.optionalMethods||[],v=e?.optionalEvents||[],E=e?.rpcMap||this.buildRpcMap(c,e.projectId),_=e?.qrModalOptions||void 0;return{chains:i?.map(S=>this.formatChainId(S)),optionalChains:o.map(S=>this.formatChainId(S)),methods:l,events:h,optionalMethods:f,optionalEvents:v,rpcMap:E,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:_,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=this.rpc.chains.length?yc(this.rpc.chains):yc(this.rpc.optionalChains),this.signer=await sx.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return Vx});r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Qo({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 WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&Tn(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&Tn(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])||`${lx}?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`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r?.accounts),this.setAccounts(r?.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 mx=bc,wx=Symbol(),Wg=Object.getPrototypeOf,Ph=new WeakMap,vx=t=>t&&(Ph.has(t)?Ph.get(t):Wg(t)===Object.prototype||Wg(t)===Array.prototype),yx=t=>vx(t)&&t[wx]||null,zg=(t,e=!0)=>{Ph.set(t,e)},Th=t=>typeof t=="object"&&t!==null,wi=new WeakMap,_c=new WeakSet,bx=(t=Object.is,e=(f,v)=>new Proxy(f,v),r=f=>Th(f)&&!_c.has(f)&&(Array.isArray(f)||!(Symbol.iterator in f))&&!(f instanceof WeakMap)&&!(f instanceof WeakSet)&&!(f instanceof Error)&&!(f instanceof Number)&&!(f instanceof Date)&&!(f instanceof String)&&!(f instanceof RegExp)&&!(f instanceof ArrayBuffer),n=f=>{switch(f.status){case"fulfilled":return f.value;case"rejected":throw f.reason;default:throw f}},i=new WeakMap,o=(f,v,E=n)=>{const _=i.get(f);if(_?.[0]===v)return _[1];const S=Array.isArray(f)?[]:Object.create(Object.getPrototypeOf(f));return zg(S,!0),i.set(f,[v,S]),Reflect.ownKeys(f).forEach(P=>{if(Object.getOwnPropertyDescriptor(S,P))return;const j=Reflect.get(f,P),H={value:j,enumerable:!0,configurable:!0};if(_c.has(j))zg(j,!1);else if(j instanceof Promise)delete H.value,H.get=()=>E(j);else if(wi.has(j)){const[Z,N]=wi.get(j);H.value=o(Z,N(),E)}Object.defineProperty(S,P,H)}),S},c=new WeakMap,l=[1,1],h=f=>{if(!Th(f))throw new Error("object required");const v=c.get(f);if(v)return v;let E=l[0];const _=new Set,S=(J,W=++l[0])=>{E!==W&&(E=W,_.forEach(ee=>ee(J,W)))};let P=l[1];const j=(J=++l[1])=>(P!==J&&!_.size&&(P=J,Z.forEach(([W])=>{const ee=W[1](J);ee>E&&(E=ee)})),E),H=J=>(W,ee)=>{const de=[...W];de[1]=[J,...de[1]],S(de,ee)},Z=new Map,N=(J,W)=>{if(Z.has(J))throw new Error("prop listener already exists");if(_.size){const ee=W[3](H(J));Z.set(J,[W,ee])}else Z.set(J,[W])},L=J=>{var W;const ee=Z.get(J);ee&&(Z.delete(J),(W=ee[1])==null||W.call(ee))},$=J=>(_.add(J),_.size===1&&Z.forEach(([ee,de],me)=>{if(de)throw new Error("remove already exists");const O=ee[3](H(me));Z.set(me,[ee,O])}),()=>{_.delete(J),_.size===0&&Z.forEach(([ee,de],me)=>{de&&(de(),Z.set(me,[ee]))})}),T=Array.isArray(f)?[]:Object.create(Object.getPrototypeOf(f)),d=e(T,{deleteProperty(J,W){const ee=Reflect.get(J,W);L(W);const de=Reflect.deleteProperty(J,W);return de&&S(["delete",[W],ee]),de},set(J,W,ee,de){const me=Reflect.has(J,W),O=Reflect.get(J,W,de);if(me&&(t(O,ee)||c.has(ee)&&t(O,c.get(ee))))return!0;L(W),Th(ee)&&(ee=yx(ee)||ee);let U=ee;if(ee instanceof Promise)ee.then(ce=>{ee.status="fulfilled",ee.value=ce,S(["resolve",[W],ce])}).catch(ce=>{ee.status="rejected",ee.reason=ce,S(["reject",[W],ce])});else{!wi.has(ee)&&r(ee)&&(U=h(ee));const ce=!_c.has(U)&&wi.get(U);ce&&N(W,ce)}return Reflect.set(J,W,U,de),S(["set",[W],ee,O]),!0}});c.set(f,d);const x=[T,j,o,$];return wi.set(d,x),Reflect.ownKeys(f).forEach(J=>{const W=Object.getOwnPropertyDescriptor(f,J);"value"in W&&(d[J]=f[J],delete W.value,delete W.writable),Object.defineProperty(T,J,W)}),d})=>[h,wi,_c,t,e,r,n,i,o,c,l],[_x]=bx();function Ln(t={}){return _x(t)}function Yn(t,e,r){const n=wi.get(t);n||console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const f=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,f()}}function Ex(t,e){const r=wi.get(t);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}var qg={},Ec={};Ec.byteLength=Ix,Ec.toByteArray=Ox,Ec.fromByteArray=$x;for(var Mn=[],un=[],xx=typeof Uint8Array<"u"?Uint8Array:Array,Rh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ns=0,Cx=Rh.length;Ns<Cx;++Ns)Mn[Ns]=Rh[Ns],un[Rh.charCodeAt(Ns)]=Ns;un["-".charCodeAt(0)]=62,un["_".charCodeAt(0)]=63;function Vg(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 Ix(t){var e=Vg(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Sx(t,e,r){return(e+r)*3/4-r}function Ox(t){var e,r=Vg(t),n=r[0],i=r[1],o=new xx(Sx(t,n,i)),c=0,l=i>0?n-4:n,h;for(h=0;h<l;h+=4)e=un[t.charCodeAt(h)]<<18|un[t.charCodeAt(h+1)]<<12|un[t.charCodeAt(h+2)]<<6|un[t.charCodeAt(h+3)],o[c++]=e>>16&255,o[c++]=e>>8&255,o[c++]=e&255;return i===2&&(e=un[t.charCodeAt(h)]<<2|un[t.charCodeAt(h+1)]>>4,o[c++]=e&255),i===1&&(e=un[t.charCodeAt(h)]<<10|un[t.charCodeAt(h+1)]<<4|un[t.charCodeAt(h+2)]>>2,o[c++]=e>>8&255,o[c++]=e&255),o}function Dx(t){return Mn[t>>18&63]+Mn[t>>12&63]+Mn[t>>6&63]+Mn[t&63]}function Ax(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 $x(t){for(var e,r=t.length,n=r%3,i=[],o=16383,c=0,l=r-n;c<l;c+=o)i.push(Ax(t,c,c+o>l?l:c+o));return n===1?(e=t[r-1],i.push(Mn[e>>2]+Mn[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Mn[e>>10]+Mn[e>>4&63]+Mn[e<<2&63]+"=")),i.join("")}var Nh={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Nh.read=function(t,e,r,n,i){var o,c,l=i*8-n-1,h=(1<<l)-1,f=h>>1,v=-7,E=r?i-1:0,_=r?-1:1,S=t[e+E];for(E+=_,o=S&(1<<-v)-1,S>>=-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-f;else{if(o===h)return c?NaN:(S?-1:1)*(1/0);c=c+Math.pow(2,n),o=o-f}return(S?-1:1)*c*Math.pow(2,o-n)},Nh.write=function(t,e,r,n,i,o){var c,l,h,f=o*8-i-1,v=(1<<f)-1,E=v>>1,_=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:o-1,P=n?1:-1,j=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+S]=l&255,S+=P,l/=256,i-=8);for(c=c<<i|l,f+=i;f>0;t[r+S]=c&255,S+=P,c/=256,f-=8);t[r+S-P]|=j*128};/*!
|
|
98
|
+
}`;var ot=xw(function(){return vt(D,Pe+"return "+pe).apply(r,M)});if(ot.source=pe,ad(ot))throw ot;return ot}function lN(s){return yt(s).toLowerCase()}function uN(s){return yt(s).toUpperCase()}function hN(s,a,u){if(s=yt(s),s&&(u||a===r))return Tm(s);if(!s||!(a=nn(a)))return s;var g=Sn(s),y=Sn(a),D=Rm(g,y),M=Nm(g,y)+1;return Mi(g,D,M).join("")}function fN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.slice(0,Mm(s)+1);if(!s||!(a=nn(a)))return s;var g=Sn(s),y=Nm(g,Sn(a))+1;return Mi(g,0,y).join("")}function dN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.replace(Vt,"");if(!s||!(a=nn(a)))return s;var g=Sn(s),y=Rm(g,Sn(a));return Mi(g,y).join("")}function pN(s,a){var u=W,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?nn(a.omission):g}s=yt(s);var D=s.length;if(ho(s)){var M=Sn(s);D=M.length}if(u>=D)return s;var k=u-fo(g);if(k<1)return g;var G=M?Mi(M,0,k).join(""):s.slice(0,k);if(y===r)return G+g;if(M&&(k+=G.length-k),cd(y)){if(s.slice(k).search(y)){var ue,he=G;for(y.global||(y=C0(y.source,yt(fn.exec(y))+"g")),y.lastIndex=0;ue=y.exec(he);)var pe=ue.index;G=G.slice(0,pe===r?k:pe)}}else if(s.indexOf(nn(y),k)!=k){var be=G.lastIndexOf(y);be>-1&&(G=G.slice(0,be))}return G+g}function gN(s){return s=yt(s),s&&Ht.test(s)?s.replace(Oi,zD):s}var mN=bo(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),hd=C2("toUpperCase");function Ew(s,a,u){return s=yt(s),a=u?r:a,a===r?FD(s)?KD(s):$D(s):s.match(a)||[]}var xw=ct(function(s,a){try{return wr(s,r,a)}catch(u){return ad(u)?u:new Ye(u)}}),wN=oi(function(s,a){return pn(a,function(u){u=Wn(u),ii(s,u,sd(s[u],s))}),s});function vN(s){var a=s==null?0:s.length,u=We();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 D=s[y];if(wr(D[0],this,g))return wr(D[1],this,g)}})}function yN(s){return zA(wn(s,E))}function fd(s){return function(){return s}}function bN(s,a){return s==null||s!==s?a:s}var _N=S2(),EN=S2(!0);function Yr(s){return s}function dd(s){return r2(typeof s=="function"?s:wn(s,E))}function xN(s){return i2(wn(s,E))}function CN(s,a){return s2(s,wn(a,E))}var IN=ct(function(s,a){return function(u){return ja(u,s,a)}}),SN=ct(function(s,a){return function(u){return ja(s,u,a)}});function pd(s,a,u){var g=vr(a),y=zl(a,g);u==null&&!(Bt(a)&&(y.length||!g.length))&&(u=a,a=s,s=this,y=zl(a,vr(a)));var D=!(Bt(u)&&"chain"in u)||!!u.chain,M=ci(s);return pn(y,function(k){var G=a[k];s[k]=G,M&&(s.prototype[k]=function(){var ue=this.__chain__;if(D||ue){var he=s(this.__wrapped__),pe=he.__actions__=Kr(this.__actions__);return pe.push({func:G,args:arguments,thisArg:s}),he.__chain__=ue,he}return G.apply(s,$i([this.value()],arguments))})}),s}function ON(){return mt._===this&&(mt._=XD),this}function gd(){}function DN(s){return s=it(s),ct(function(a){return o2(a,s)})}var AN=V0(Ut),$N=V0(Om),PN=V0(w0);function Cw(s){return X0(s)?v0(Wn(s)):a$(s)}function TN(s){return function(a){return s==null?r:bs(s,a)}}var RN=D2(),NN=D2(!0);function md(){return[]}function wd(){return!1}function LN(){return{}}function MN(){return""}function UN(){return!0}function jN(s,a){if(s=it(s),s<1||s>re)return[];var u=ie,g=Or(s,ie);a=We(a),s-=ie;for(var y=_0(g,a);++u<s;)a(u);return y}function FN(s){return Xe(s)?Ut(s,Wn):sn(s)?[s]:Kr(z2(yt(s)))}function BN(s){var a=++JD;return yt(s)+a}var kN=Yl(function(s,a){return s+a},0),HN=K0("ceil"),WN=Yl(function(s,a){return s/a},1),zN=K0("floor");function qN(s){return s&&s.length?Wl(s,Yr,T0):r}function VN(s,a){return s&&s.length?Wl(s,We(a,2),T0):r}function KN(s){return $m(s,Yr)}function GN(s,a){return $m(s,We(a,2))}function ZN(s){return s&&s.length?Wl(s,Yr,M0):r}function YN(s,a){return s&&s.length?Wl(s,We(a,2),M0):r}var JN=Yl(function(s,a){return s*a},1),QN=K0("round"),XN=Yl(function(s,a){return s-a},0);function eL(s){return s&&s.length?b0(s,Yr):0}function tL(s,a){return s&&s.length?b0(s,We(a,2)):0}return C.after=xT,C.ary=tw,C.assign=uR,C.assignIn=gw,C.assignInWith=lu,C.assignWith=hR,C.at=fR,C.before=rw,C.bind=sd,C.bindAll=wN,C.bindKey=nw,C.castArray=LT,C.chain=Q2,C.chunk=z$,C.compact=q$,C.concat=V$,C.cond=vN,C.conforms=yN,C.constant=fd,C.countBy=eT,C.create=dR,C.curry=iw,C.curryRight=sw,C.debounce=ow,C.defaults=pR,C.defaultsDeep=gR,C.defer=CT,C.delay=IT,C.difference=K$,C.differenceBy=G$,C.differenceWith=Z$,C.drop=Y$,C.dropRight=J$,C.dropRightWhile=Q$,C.dropWhile=X$,C.fill=eP,C.filter=rT,C.flatMap=sT,C.flatMapDeep=oT,C.flatMapDepth=aT,C.flatten=G2,C.flattenDeep=tP,C.flattenDepth=rP,C.flip=ST,C.flow=_N,C.flowRight=EN,C.fromPairs=nP,C.functions=ER,C.functionsIn=xR,C.groupBy=cT,C.initial=sP,C.intersection=oP,C.intersectionBy=aP,C.intersectionWith=cP,C.invert=IR,C.invertBy=SR,C.invokeMap=uT,C.iteratee=dd,C.keyBy=hT,C.keys=vr,C.keysIn=Zr,C.map=nu,C.mapKeys=DR,C.mapValues=AR,C.matches=xN,C.matchesProperty=CN,C.memoize=su,C.merge=$R,C.mergeWith=mw,C.method=IN,C.methodOf=SN,C.mixin=pd,C.negate=ou,C.nthArg=DN,C.omit=PR,C.omitBy=TR,C.once=OT,C.orderBy=fT,C.over=AN,C.overArgs=DT,C.overEvery=$N,C.overSome=PN,C.partial=od,C.partialRight=aw,C.partition=dT,C.pick=RR,C.pickBy=ww,C.property=Cw,C.propertyOf=TN,C.pull=fP,C.pullAll=Y2,C.pullAllBy=dP,C.pullAllWith=pP,C.pullAt=gP,C.range=RN,C.rangeRight=NN,C.rearg=AT,C.reject=mT,C.remove=mP,C.rest=$T,C.reverse=nd,C.sampleSize=vT,C.set=LR,C.setWith=MR,C.shuffle=yT,C.slice=wP,C.sortBy=ET,C.sortedUniq=CP,C.sortedUniqBy=IP,C.split=sN,C.spread=PT,C.tail=SP,C.take=OP,C.takeRight=DP,C.takeRightWhile=AP,C.takeWhile=$P,C.tap=qP,C.throttle=TT,C.thru=ru,C.toArray=fw,C.toPairs=vw,C.toPairsIn=yw,C.toPath=FN,C.toPlainObject=pw,C.transform=UR,C.unary=RT,C.union=PP,C.unionBy=TP,C.unionWith=RP,C.uniq=NP,C.uniqBy=LP,C.uniqWith=MP,C.unset=jR,C.unzip=id,C.unzipWith=J2,C.update=FR,C.updateWith=BR,C.values=xo,C.valuesIn=kR,C.without=UP,C.words=Ew,C.wrap=NT,C.xor=jP,C.xorBy=FP,C.xorWith=BP,C.zip=kP,C.zipObject=HP,C.zipObjectDeep=WP,C.zipWith=zP,C.entries=vw,C.entriesIn=yw,C.extend=gw,C.extendWith=lu,pd(C,C),C.add=kN,C.attempt=xw,C.camelCase=qR,C.capitalize=bw,C.ceil=HN,C.clamp=HR,C.clone=MT,C.cloneDeep=jT,C.cloneDeepWith=FT,C.cloneWith=UT,C.conformsTo=BT,C.deburr=_w,C.defaultTo=bN,C.divide=WN,C.endsWith=VR,C.eq=Dn,C.escape=KR,C.escapeRegExp=GR,C.every=tT,C.find=nT,C.findIndex=V2,C.findKey=mR,C.findLast=iT,C.findLastIndex=K2,C.findLastKey=wR,C.floor=zN,C.forEach=X2,C.forEachRight=ew,C.forIn=vR,C.forInRight=yR,C.forOwn=bR,C.forOwnRight=_R,C.get=ld,C.gt=kT,C.gte=HT,C.has=CR,C.hasIn=ud,C.head=Z2,C.identity=Yr,C.includes=lT,C.indexOf=iP,C.inRange=WR,C.invoke=OR,C.isArguments=xs,C.isArray=Xe,C.isArrayBuffer=WT,C.isArrayLike=Gr,C.isArrayLikeObject=Xt,C.isBoolean=zT,C.isBuffer=Ui,C.isDate=qT,C.isElement=VT,C.isEmpty=KT,C.isEqual=GT,C.isEqualWith=ZT,C.isError=ad,C.isFinite=YT,C.isFunction=ci,C.isInteger=cw,C.isLength=au,C.isMap=lw,C.isMatch=JT,C.isMatchWith=QT,C.isNaN=XT,C.isNative=eR,C.isNil=rR,C.isNull=tR,C.isNumber=uw,C.isObject=Bt,C.isObjectLike=Gt,C.isPlainObject=za,C.isRegExp=cd,C.isSafeInteger=nR,C.isSet=hw,C.isString=cu,C.isSymbol=sn,C.isTypedArray=Eo,C.isUndefined=iR,C.isWeakMap=sR,C.isWeakSet=oR,C.join=lP,C.kebabCase=ZR,C.last=yn,C.lastIndexOf=uP,C.lowerCase=YR,C.lowerFirst=JR,C.lt=aR,C.lte=cR,C.max=qN,C.maxBy=VN,C.mean=KN,C.meanBy=GN,C.min=ZN,C.minBy=YN,C.stubArray=md,C.stubFalse=wd,C.stubObject=LN,C.stubString=MN,C.stubTrue=UN,C.multiply=JN,C.nth=hP,C.noConflict=ON,C.noop=gd,C.now=iu,C.pad=QR,C.padEnd=XR,C.padStart=eN,C.parseInt=tN,C.random=zR,C.reduce=pT,C.reduceRight=gT,C.repeat=rN,C.replace=nN,C.result=NR,C.round=QN,C.runInContext=V,C.sample=wT,C.size=bT,C.snakeCase=iN,C.some=_T,C.sortedIndex=vP,C.sortedIndexBy=yP,C.sortedIndexOf=bP,C.sortedLastIndex=_P,C.sortedLastIndexBy=EP,C.sortedLastIndexOf=xP,C.startCase=oN,C.startsWith=aN,C.subtract=XN,C.sum=eL,C.sumBy=tL,C.template=cN,C.times=jN,C.toFinite=li,C.toInteger=it,C.toLength=dw,C.toLower=lN,C.toNumber=bn,C.toSafeInteger=lR,C.toString=yt,C.toUpper=uN,C.trim=hN,C.trimEnd=fN,C.trimStart=dN,C.truncate=pN,C.unescape=gN,C.uniqueId=BN,C.upperCase=mN,C.upperFirst=hd,C.each=X2,C.eachRight=ew,C.first=Z2,pd(C,function(){var s={};return kn(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:fr(it(u),0);var g=this.__filtered__&&!a?new dt(this):this.clone();return g.__filtered__?g.__takeCount__=Or(u,g.__takeCount__):g.__views__.push({size:Or(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 D=this.clone();return D.__iteratees__.push({iteratee:We(y,3),type:u}),D.__filtered__=D.__filtered__||g,D}}),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(Yr)},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 ja(u,s,a)})}),dt.prototype.reject=function(s){return this.filter(ou(We(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)},kn(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],D=g||/^find/.test(a);y&&(C.prototype[a]=function(){var M=this.__wrapped__,k=g?[1]:arguments,G=M instanceof dt,ue=k[0],he=G||Xe(M),pe=function(ft){var wt=y.apply(C,$i([ft],k));return g&&be?wt[0]:wt};he&&u&&typeof ue=="function"&&ue.length!=1&&(G=he=!1);var be=this.__chain__,Pe=!!this.__actions__.length,ze=D&&!be,ot=G&&!Pe;if(!D&&he){M=ot?M:new dt(this);var qe=s.apply(M,k);return qe.__actions__.push({func:ru,args:[pe],thisArg:r}),new mn(qe,be)}return ze&&ot?s.apply(this,k):(qe=this.thru(pe),ze?g?qe.value()[0]:qe.value():qe)})}),pn(["pop","push","shift","sort","splice","unshift"],function(s){var a=Dl[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 D=this.value();return a.apply(Xe(D)?D:[],y)}return this[u](function(M){return a.apply(Xe(M)?M:[],y)})}}),kn(dt.prototype,function(s,a){var u=C[a];if(u){var g=u.name+"";bt.call(wo,g)||(wo[g]=[]),wo[g].push({name:a,func:u})}}),wo[Zl(r,Z).name]=[{name:"wrapper",func:r}],dt.prototype.clone=gA,dt.prototype.reverse=mA,dt.prototype.value=wA,C.prototype.at=VP,C.prototype.chain=KP,C.prototype.commit=GP,C.prototype.next=ZP,C.prototype.plant=JP,C.prototype.reverse=QP,C.prototype.toJSON=C.prototype.valueOf=C.prototype.value=XP,C.prototype.first=C.prototype.head,Pa&&(C.prototype[Pa]=YP),C},po=GD();Qt?((Qt.exports=po)._=po,St._=po):mt._=po}).call(Xo)})(Sh,Sh.exports);var B7=Object.defineProperty,k7=Object.defineProperties,H7=Object.getOwnPropertyDescriptors,Tg=Object.getOwnPropertySymbols,W7=Object.prototype.hasOwnProperty,z7=Object.prototype.propertyIsEnumerable,Rg=(t,e,r)=>e in t?B7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wc=(t,e)=>{for(var r in e||(e={}))W7.call(e,r)&&Rg(t,r,e[r]);if(Tg)for(var r of Tg(e))z7.call(e,r)&&Rg(t,r,e[r]);return t},q7=(t,e)=>k7(t,H7(e));function Ls(t,e,r){var n;const i=G5(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${F7}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function Gi(t){return t.includes(":")?t.split(":")[1]:t}function Ng(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function V7(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 K7(t={},e={}){const r=Lg(t),n=Lg(e);return Sh.exports.merge(r,n)}function Lg(t){var e,r,n,i;const o={};if(!Ps(t))return o;for(const[c,l]of Object.entries(t)){const h=ku(c)?[c]:l.chains,f=l.methods||[],v=l.events||[],E=l.rpcMap||{},_=No(c);o[_]=q7(wc(wc({},o[_]),l),{chains:Fu(h,(e=o[_])==null?void 0:e.chains),methods:Fu(f,(r=o[_])==null?void 0:r.methods),events:Fu(v,(n=o[_])==null?void 0:n.events),rpcMap:wc(wc({},E),(i=o[_])==null?void 0:i.rpcMap)})}return o}function G7(t){return t.includes(":")?t.split(":")[2]:t}function Z7(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],o=n.events||[],c=n.accounts||[],l=ku(r)?[r]:n.chains?n.chains:Ng(n.accounts);e[r]={chains:l,methods:i,events:o,accounts:c}}return e}function Oh(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):t.includes(":")?Number(t.split(":")[1]):Number(t)}const Mg={},Yt=t=>Mg[t],Dh=(t,e)=>{Mg[t]=e};class Y7{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){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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;const i=Gi(r);e[i]=this.createHttpProvider(i,(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||Ls(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new di(new Ki(n,Yt("disableProviderPing")))}}class J7{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){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);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){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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||Ls(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new di(new Ki(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=parseInt(Gi(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}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const o=parseInt(i,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class Q7{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){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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;const i=Gi(r);e[i]=this.createHttpProvider(i,(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||Ls(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new di(new Ki(n,Yt("disableProviderPing")))}}class X7{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){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(gi.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;const i=Gi(r);e[i]=this.createHttpProvider(i,(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||Ls(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new di(new Ki(n,Yt("disableProviderPing")))}}class ex{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){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(gi.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),i=Gi(r);e[i]=this.createHttpProvider(i,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);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new di(new Ki(n,Yt("disableProviderPing")))}}class tx{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){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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;const i=Gi(r);e[i]=this.createHttpProvider(i,(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||Ls(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new di(new Ki(n,Yt("disableProviderPing")))}}class rx{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){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}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;const i=Gi(r);e[i]=this.createHttpProvider(i,(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||Ls(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new di(new Ki(n,Yt("disableProviderPing")))}}var nx=Object.defineProperty,ix=Object.defineProperties,sx=Object.getOwnPropertyDescriptors,Ug=Object.getOwnPropertySymbols,ox=Object.prototype.hasOwnProperty,ax=Object.prototype.propertyIsEnumerable,jg=(t,e,r)=>e in t?nx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vc=(t,e)=>{for(var r in e||(e={}))ox.call(e,r)&&jg(t,r,e[r]);if(Ug)for(var r of Ug(e))ax.call(e,r)&&jg(t,r,e[r]);return t},Ah=(t,e)=>ix(t,sx(e));class $h{constructor(e){this.events=new yr.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 $h(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:vc({},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,this.namespaces||(this.namespaces=Z7(o.namespaces),this.persist("namespaces",this.namespaces))}).catch(o=>{if(o.message!==Cg)throw o;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;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(Pn(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 Ch.init({logger:this.providerOpts.logger||$g,relayUrl:this.providerOpts.relayUrl||M7,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,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=>No(r)))];Dh("client",this.client),Dh("events",this.events),Dh("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=V7(r,this.session),i=Ng(n),o=K7(this.namespaces,this.optionalNamespaces),c=Ah(vc({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new J7({namespace:c});break;case"solana":this.rpcProviders[r]=new Q7({namespace:c});break;case"cosmos":this.rpcProviders[r]=new X7({namespace:c});break;case"polkadot":this.rpcProviders[r]=new Y7({namespace:c});break;case"cip34":this.rpcProviders[r]=new ex({namespace:c});break;case"elrond":this.rpcProviders[r]=new tx({namespace:c});break;case"multiversx":this.rpcProviders[r]=new rx({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;if(n.name==="accountsChanged"){const i=n.data;i&&Pn(i)&&this.events.emit("accountsChanged",i.map(G7))}else if(n.name==="chainChanged"){const i=r.chainId,o=r.event.data,c=No(i),l=Oh(i)!==Oh(o)?`${c}:${Oh(o)}`:i;this.onChainChanged(l)}else 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=Ah(vc({},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",Ah(vc({},Zt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(gi.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;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(c=>No(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=No(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;if(!this.namespaces)return;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,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${Pg}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${Pg}/${e}`)}}const cx=$h,lx="wc",ux="ethereum_provider",hx=`${lx}@2:${ux}:`,fx="https://rpc.walletconnect.com/v1/",yc=["eth_sendTransaction","personal_sign"],Fg=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],bc=["chainChanged","accountsChanged"],Bg=["chainChanged","accountsChanged","message","disconnect","connect"];var dx=Object.defineProperty,px=Object.defineProperties,gx=Object.getOwnPropertyDescriptors,kg=Object.getOwnPropertySymbols,mx=Object.prototype.hasOwnProperty,wx=Object.prototype.propertyIsEnumerable,Hg=(t,e,r)=>e in t?dx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ea=(t,e)=>{for(var r in e||(e={}))mx.call(e,r)&&Hg(t,r,e[r]);if(kg)for(var r of kg(e))wx.call(e,r)&&Hg(t,r,e[r]);return t},Wg=(t,e)=>px(t,gx(e));function _c(t){return Number(t[0].split(":")[1])}function Ph(t){return`0x${t.toString(16)}`}function vx(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:c,rpcMap:l}=t;if(!Pn(e))throw new Error("Invalid chains");const h={chains:e,methods:n||yc,events:o||bc,rpcMap:ea({},e.length?{[_c(e)]:l[_c(e)]}:{})},f=o?.filter(S=>!bc.includes(S)),v=n?.filter(S=>!yc.includes(S));if(!r&&!c&&!i&&!(f!=null&&f.length)&&!(v!=null&&v.length))return{required:e.length?h:void 0};const E=f?.length&&v?.length||!r,_={chains:[...new Set(E?h.chains.concat(r||[]):r)],methods:[...new Set(h.methods.concat(i!=null&&i.length?i:Fg))],events:[...new Set(h.events.concat(c!=null&&c.length?c:Bg))],rpcMap:l};return{required:e.length?h:void 0,optional:r.length?_:void 0}}class Ec{constructor(){this.events=new yr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=hx,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 Ec;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}=vx(this.rpc);try{const i=await new Promise(async(c,l)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Wg(ea({namespaces:ea({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(f=>{c(f)}).catch(f=>{l(new Error(f.message))})});if(!i)return;const o=Z5(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:Ph(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",Ph(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",Wg(ea({},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)})}switchEthereumChain(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",Ph(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(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;const i=(r=e?.chains)!=null?r:[],o=(n=e?.optionalChains)!=null?n:[],c=i.concat(o);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=i.length?e?.methods||yc:[],h=i.length?e?.events||bc:[],f=e?.optionalMethods||[],v=e?.optionalEvents||[],E=e?.rpcMap||this.buildRpcMap(c,e.projectId),_=e?.qrModalOptions||void 0;return{chains:i?.map(S=>this.formatChainId(S)),optionalChains:o.map(S=>this.formatChainId(S)),methods:l,events:h,optionalMethods:f,optionalEvents:v,rpcMap:E,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:_,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=this.rpc.chains.length?_c(this.rpc.chains):_c(this.rpc.optionalChains),this.signer=await cx.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return Zx});r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(ea({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 WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&Pn(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&Pn(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])||`${fx}?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`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r?.accounts),this.setAccounts(r?.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 yx=Ec,bx=Symbol(),zg=Object.getPrototypeOf,Th=new WeakMap,_x=t=>t&&(Th.has(t)?Th.get(t):zg(t)===Object.prototype||zg(t)===Array.prototype),Ex=t=>_x(t)&&t[bx]||null,qg=(t,e=!0)=>{Th.set(t,e)},Rh=t=>typeof t=="object"&&t!==null,mi=new WeakMap,xc=new WeakSet,xx=(t=Object.is,e=(f,v)=>new Proxy(f,v),r=f=>Rh(f)&&!xc.has(f)&&(Array.isArray(f)||!(Symbol.iterator in f))&&!(f instanceof WeakMap)&&!(f instanceof WeakSet)&&!(f instanceof Error)&&!(f instanceof Number)&&!(f instanceof Date)&&!(f instanceof String)&&!(f instanceof RegExp)&&!(f instanceof ArrayBuffer),n=f=>{switch(f.status){case"fulfilled":return f.value;case"rejected":throw f.reason;default:throw f}},i=new WeakMap,o=(f,v,E=n)=>{const _=i.get(f);if(_?.[0]===v)return _[1];const S=Array.isArray(f)?[]:Object.create(Object.getPrototypeOf(f));return qg(S,!0),i.set(f,[v,S]),Reflect.ownKeys(f).forEach(P=>{if(Object.getOwnPropertyDescriptor(S,P))return;const j=Reflect.get(f,P),H={value:j,enumerable:!0,configurable:!0};if(xc.has(j))qg(j,!1);else if(j instanceof Promise)delete H.value,H.get=()=>E(j);else if(mi.has(j)){const[Z,N]=mi.get(j);H.value=o(Z,N(),E)}Object.defineProperty(S,P,H)}),S},c=new WeakMap,l=[1,1],h=f=>{if(!Rh(f))throw new Error("object required");const v=c.get(f);if(v)return v;let E=l[0];const _=new Set,S=(J,W=++l[0])=>{E!==W&&(E=W,_.forEach(ee=>ee(J,W)))};let P=l[1];const j=(J=++l[1])=>(P!==J&&!_.size&&(P=J,Z.forEach(([W])=>{const ee=W[1](J);ee>E&&(E=ee)})),E),H=J=>(W,ee)=>{const de=[...W];de[1]=[J,...de[1]],S(de,ee)},Z=new Map,N=(J,W)=>{if(Z.has(J))throw new Error("prop listener already exists");if(_.size){const ee=W[3](H(J));Z.set(J,[W,ee])}else Z.set(J,[W])},L=J=>{var W;const ee=Z.get(J);ee&&(Z.delete(J),(W=ee[1])==null||W.call(ee))},$=J=>(_.add(J),_.size===1&&Z.forEach(([ee,de],me)=>{if(de)throw new Error("remove already exists");const O=ee[3](H(me));Z.set(me,[ee,O])}),()=>{_.delete(J),_.size===0&&Z.forEach(([ee,de],me)=>{de&&(de(),Z.set(me,[ee]))})}),T=Array.isArray(f)?[]:Object.create(Object.getPrototypeOf(f)),d=e(T,{deleteProperty(J,W){const ee=Reflect.get(J,W);L(W);const de=Reflect.deleteProperty(J,W);return de&&S(["delete",[W],ee]),de},set(J,W,ee,de){const me=Reflect.has(J,W),O=Reflect.get(J,W,de);if(me&&(t(O,ee)||c.has(ee)&&t(O,c.get(ee))))return!0;L(W),Rh(ee)&&(ee=Ex(ee)||ee);let U=ee;if(ee instanceof Promise)ee.then(ce=>{ee.status="fulfilled",ee.value=ce,S(["resolve",[W],ce])}).catch(ce=>{ee.status="rejected",ee.reason=ce,S(["reject",[W],ce])});else{!mi.has(ee)&&r(ee)&&(U=h(ee));const ce=!xc.has(U)&&mi.get(U);ce&&N(W,ce)}return Reflect.set(J,W,U,de),S(["set",[W],ee,O]),!0}});c.set(f,d);const x=[T,j,o,$];return mi.set(d,x),Reflect.ownKeys(f).forEach(J=>{const W=Object.getOwnPropertyDescriptor(f,J);"value"in W&&(d[J]=f[J],delete W.value,delete W.writable),Object.defineProperty(T,J,W)}),d})=>[h,mi,xc,t,e,r,n,i,o,c,l],[Cx]=xx();function Nn(t={}){return Cx(t)}function Zn(t,e,r){const n=mi.get(t);n||console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const f=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,f()}}function Ix(t,e){const r=mi.get(t);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}var Vg={},Cc={};Cc.byteLength=Dx,Cc.toByteArray=$x,Cc.fromByteArray=Rx;for(var Ln=[],ln=[],Sx=typeof Uint8Array<"u"?Uint8Array:Array,Nh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ms=0,Ox=Nh.length;Ms<Ox;++Ms)Ln[Ms]=Nh[Ms],ln[Nh.charCodeAt(Ms)]=Ms;ln["-".charCodeAt(0)]=62,ln["_".charCodeAt(0)]=63;function Kg(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 Dx(t){var e=Kg(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Ax(t,e,r){return(e+r)*3/4-r}function $x(t){var e,r=Kg(t),n=r[0],i=r[1],o=new Sx(Ax(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 Px(t){return Ln[t>>18&63]+Ln[t>>12&63]+Ln[t>>6&63]+Ln[t&63]}function Tx(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(Px(n));return i.join("")}function Rx(t){for(var e,r=t.length,n=r%3,i=[],o=16383,c=0,l=r-n;c<l;c+=o)i.push(Tx(t,c,c+o>l?l:c+o));return n===1?(e=t[r-1],i.push(Ln[e>>2]+Ln[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Ln[e>>10]+Ln[e>>4&63]+Ln[e<<2&63]+"=")),i.join("")}var Lh={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Lh.read=function(t,e,r,n,i){var o,c,l=i*8-n-1,h=(1<<l)-1,f=h>>1,v=-7,E=r?i-1:0,_=r?-1:1,S=t[e+E];for(E+=_,o=S&(1<<-v)-1,S>>=-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-f;else{if(o===h)return c?NaN:(S?-1:1)*(1/0);c=c+Math.pow(2,n),o=o-f}return(S?-1:1)*c*Math.pow(2,o-n)},Lh.write=function(t,e,r,n,i,o){var c,l,h,f=o*8-i-1,v=(1<<f)-1,E=v>>1,_=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:o-1,P=n?1:-1,j=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+S]=l&255,S+=P,l/=256,i-=8);for(c=c<<i|l,f+=i;f>0;t[r+S]=c&255,S+=P,c/=256,f-=8);t[r+S-P]|=j*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=Ec,r=Nh,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(ke(b,ArrayBuffer)||b&&ke(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(b,SharedArrayBuffer)||b&&ke(b.buffer,SharedArrayBuffer)))return j(b,p,m);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const A=b.valueOf&&b.valueOf();if(A!=null&&A!==b)return l.from(A,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 f(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 f(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 f(b),c(b<0?0:Z(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 A=c(m);const B=A.write(b,p);return B!==m&&(A=A.slice(0,B)),A}function S(b){const p=b.length<0?0:Z(b.length)|0,m=c(p);for(let A=0;A<p;A+=1)m[A]=b[A]&255;return m}function P(b){if(ke(b,Uint8Array)){const p=new Uint8Array(b);return j(p.buffer,p.byteOffset,p.byteLength)}return S(b)}function j(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 A;return p===void 0&&m===void 0?A=new Uint8Array(b):m===void 0?A=new Uint8Array(b,p):A=new Uint8Array(b,p,m),Object.setPrototypeOf(A,l.prototype),A}function H(b){if(l.isBuffer(b)){const p=Z(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):S(b);if(b.type==="Buffer"&&Array.isArray(b.data))return S(b.data)}function Z(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(ke(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),ke(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 A=p.length,B=m.length;for(let K=0,X=Math.min(A,B);K<X;++K)if(p[K]!==m[K]){A=p[K],B=m[K];break}return A<B?-1:B<A?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 A;if(m===void 0)for(m=0,A=0;A<p.length;++A)m+=p[A].length;const B=l.allocUnsafe(m);let K=0;for(A=0;A<p.length;++A){let X=p[A];if(ke(X,Uint8Array))K+X.length>B.length?(l.isBuffer(X)||(X=l.from(X)),X.copy(B,K)):Uint8Array.prototype.set.call(B,X,K);else if(l.isBuffer(X))X.copy(B,K);else throw new TypeError('"list" argument must be an Array of Buffers');K+=X.length}return B};function L(b,p){if(l.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||ke(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,A=arguments.length>2&&arguments[2]===!0;if(!A&&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 A?-1:Ge(b).length;p=(""+p).toLowerCase(),B=!0}}l.byteLength=L;function $(b,p,m){let A=!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(A)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),A=!0}}l.prototype._isBuffer=!0;function T(b,p,m){const A=b[p];b[p]=b[m],b[m]=A}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,A,B,K){if(ke(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),A===void 0&&(A=p?p.length:0),B===void 0&&(B=0),K===void 0&&(K=this.length),m<0||A>p.length||B<0||K>this.length)throw new RangeError("out of range index");if(B>=K&&m>=A)return 0;if(B>=K)return-1;if(m>=A)return 1;if(m>>>=0,A>>>=0,B>>>=0,K>>>=0,this===p)return 0;let X=K-B,Ee=A-m;const Re=Math.min(X,Ee),st=this.slice(B,K),ht=p.slice(m,A);for(let lt=0;lt<Re;++lt)if(st[lt]!==ht[lt]){X=st[lt],Ee=ht[lt];break}return X<Ee?-1:Ee<X?1:0};function I(b,p,m,A,B){if(b.length===0)return-1;if(typeof m=="string"?(A=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,A)),l.isBuffer(p))return p.length===0?-1:d(b,p,m,A,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):d(b,[p],m,A,B);throw new TypeError("val must be string, number or Buffer")}function d(b,p,m,A,B){let K=1,X=b.length,Ee=p.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(b.length<2||p.length<2)return-1;K=2,X/=2,Ee/=2,m/=2}function Re(ht,lt){return K===1?ht[lt]:ht.readUInt16BE(lt*K)}let st;if(B){let ht=-1;for(st=m;st<X;st++)if(Re(b,st)===Re(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>X&&(m=X-Ee),st=m;st>=0;st--){let ht=!0;for(let lt=0;lt<Ee;lt++)if(Re(b,st+lt)!==Re(p,lt)){ht=!1;break}if(ht)return st}return-1}l.prototype.includes=function(p,m,A){return this.indexOf(p,m,A)!==-1},l.prototype.indexOf=function(p,m,A){return I(this,p,m,A,!0)},l.prototype.lastIndexOf=function(p,m,A){return I(this,p,m,A,!1)};function x(b,p,m,A){m=Number(m)||0;const B=b.length-m;A?(A=Number(A),A>B&&(A=B)):A=B;const K=p.length;A>K/2&&(A=K/2);let X;for(X=0;X<A;++X){const Ee=parseInt(p.substr(X*2,2),16);if(Ke(Ee))return X;b[m+X]=Ee}return X}function J(b,p,m,A){return He(Ge(p,b.length-m),b,m,A)}function W(b,p,m,A){return He(At(p),b,m,A)}function ee(b,p,m,A){return He(Je(p),b,m,A)}function de(b,p,m,A){return He($t(p,b.length-m),b,m,A)}l.prototype.write=function(p,m,A,B){if(m===void 0)B="utf8",A=this.length,m=0;else if(A===void 0&&typeof m=="string")B=m,A=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(A)?(A=A>>>0,B===void 0&&(B="utf8")):(B=A,A=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const K=this.length-m;if((A===void 0||A>K)&&(A=K),p.length>0&&(A<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let X=!1;for(;;)switch(B){case"hex":return x(this,p,m,A);case"utf8":case"utf-8":return J(this,p,m,A);case"ascii":case"latin1":case"binary":return W(this,p,m,A);case"base64":return ee(this,p,m,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,p,m,A);default:if(X)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),X=!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 A=[];let B=p;for(;B<m;){const K=b[B];let X=null,Ee=K>239?4:K>223?3:K>191?2:1;if(B+Ee<=m){let Re,st,ht,lt;switch(Ee){case 1:K<128&&(X=K);break;case 2:Re=b[B+1],(Re&192)===128&&(lt=(K&31)<<6|Re&63,lt>127&&(X=lt));break;case 3:Re=b[B+1],st=b[B+2],(Re&192)===128&&(st&192)===128&&(lt=(K&15)<<12|(Re&63)<<6|st&63,lt>2047&&(lt<55296||lt>57343)&&(X=lt));break;case 4:Re=b[B+1],st=b[B+2],ht=b[B+3],(Re&192)===128&&(st&192)===128&&(ht&192)===128&&(lt=(K&15)<<18|(Re&63)<<12|(st&63)<<6|ht&63,lt>65535&<<1114112&&(X=lt))}}X===null?(X=65533,Ee=1):X>65535&&(X-=65536,A.push(X>>>10&1023|55296),X=56320|X&1023),A.push(X),B+=Ee}return ce(A)}const U=4096;function ce(b){const p=b.length;if(p<=U)return String.fromCharCode.apply(String,b);let m="",A=0;for(;A<p;)m+=String.fromCharCode.apply(String,b.slice(A,A+=U));return m}function le(b,p,m){let A="";m=Math.min(b.length,m);for(let B=p;B<m;++B)A+=String.fromCharCode(b[B]&127);return A}function re(b,p,m){let A="";m=Math.min(b.length,m);for(let B=p;B<m;++B)A+=String.fromCharCode(b[B]);return A}function ne(b,p,m){const A=b.length;(!p||p<0)&&(p=0),(!m||m<0||m>A)&&(m=A);let B="";for(let K=p;K<m;++K)B+=rt[b[K]];return B}function ae(b,p,m){const A=b.slice(p,m);let B="";for(let K=0;K<A.length-1;K+=2)B+=String.fromCharCode(A[K]+A[K+1]*256);return B}l.prototype.slice=function(p,m){const A=this.length;p=~~p,m=m===void 0?A:~~m,p<0?(p+=A,p<0&&(p=0)):p>A&&(p=A),m<0?(m+=A,m<0&&(m=0)):m>A&&(m=A),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,A){p=p>>>0,m=m>>>0,A||ie(p,m,this.length);let B=this[p],K=1,X=0;for(;++X<m&&(K*=256);)B+=this[p+X]*K;return B},l.prototype.readUintBE=l.prototype.readUIntBE=function(p,m,A){p=p>>>0,m=m>>>0,A||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=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],A=this[p+7];(m===void 0||A===void 0)&&Ue(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+A*2**24;return BigInt(B)+(BigInt(K)<<BigInt(32))}),l.prototype.readBigUInt64BE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],A=this[p+7];(m===void 0||A===void 0)&&Ue(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+A;return(BigInt(B)<<BigInt(32))+BigInt(K)}),l.prototype.readIntLE=function(p,m,A){p=p>>>0,m=m>>>0,A||ie(p,m,this.length);let B=this[p],K=1,X=0;for(;++X<m&&(K*=256);)B+=this[p+X]*K;return K*=128,B>=K&&(B-=Math.pow(2,8*m)),B},l.prototype.readIntBE=function(p,m,A){p=p>>>0,m=m>>>0,A||ie(p,m,this.length);let B=m,K=1,X=this[p+--B];for(;B>0&&(K*=256);)X+=this[p+--B]*K;return K*=128,X>=K&&(X-=Math.pow(2,8*m)),X},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 A=this[p]|this[p+1]<<8;return A&32768?A|4294901760:A},l.prototype.readInt16BE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const A=this[p+1]|this[p]<<8;return A&32768?A|4294901760:A},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=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],A=this[p+7];(m===void 0||A===void 0)&&Ue(p,this.length-8);const B=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(A<<24);return(BigInt(B)<<BigInt(32))+BigInt(m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),l.prototype.readBigInt64BE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],A=this[p+7];(m===void 0||A===void 0)&&Ue(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+A)}),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 De(b,p,m,A,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+A>b.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(p,m,A,B){if(p=+p,m=m>>>0,A=A>>>0,!B){const Ee=Math.pow(2,8*A)-1;De(this,p,m,A,Ee,0)}let K=1,X=0;for(this[m]=p&255;++X<A&&(K*=256);)this[m+X]=p/K&255;return m+A},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(p,m,A,B){if(p=+p,m=m>>>0,A=A>>>0,!B){const Ee=Math.pow(2,8*A)-1;De(this,p,m,A,Ee,0)}let K=A-1,X=1;for(this[m+K]=p&255;--K>=0&&(X*=256);)this[m+K]=p/X&255;return m+A},l.prototype.writeUint8=l.prototype.writeUInt8=function(p,m,A){return p=+p,m=m>>>0,A||De(this,p,m,1,255,0),this[m]=p&255,m+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(p,m,A){return p=+p,m=m>>>0,A||De(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,A){return p=+p,m=m>>>0,A||De(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,A){return p=+p,m=m>>>0,A||De(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,A){return p=+p,m=m>>>0,A||De(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,A,B){we(p,A,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 X=Number(p>>BigInt(32)&BigInt(4294967295));return b[m++]=X,X=X>>8,b[m++]=X,X=X>>8,b[m++]=X,X=X>>8,b[m++]=X,m}function Be(b,p,m,A,B){we(p,A,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 X=Number(p>>BigInt(32)&BigInt(4294967295));return b[m+3]=X,X=X>>8,b[m+2]=X,X=X>>8,b[m+1]=X,X=X>>8,b[m]=X,m+8}l.prototype.writeBigUInt64LE=je(function(p,m=0){return ge(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=je(function(p,m=0){return Be(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(p,m,A,B){if(p=+p,m=m>>>0,!B){const Re=Math.pow(2,8*A-1);De(this,p,m,A,Re-1,-Re)}let K=0,X=1,Ee=0;for(this[m]=p&255;++K<A&&(X*=256);)p<0&&Ee===0&&this[m+K-1]!==0&&(Ee=1),this[m+K]=(p/X>>0)-Ee&255;return m+A},l.prototype.writeIntBE=function(p,m,A,B){if(p=+p,m=m>>>0,!B){const Re=Math.pow(2,8*A-1);De(this,p,m,A,Re-1,-Re)}let K=A-1,X=1,Ee=0;for(this[m+K]=p&255;--K>=0&&(X*=256);)p<0&&Ee===0&&this[m+K+1]!==0&&(Ee=1),this[m+K]=(p/X>>0)-Ee&255;return m+A},l.prototype.writeInt8=function(p,m,A){return p=+p,m=m>>>0,A||De(this,p,m,1,127,-128),p<0&&(p=255+p+1),this[m]=p&255,m+1},l.prototype.writeInt16LE=function(p,m,A){return p=+p,m=m>>>0,A||De(this,p,m,2,32767,-32768),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeInt16BE=function(p,m,A){return p=+p,m=m>>>0,A||De(this,p,m,2,32767,-32768),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeInt32LE=function(p,m,A){return p=+p,m=m>>>0,A||De(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,A){return p=+p,m=m>>>0,A||De(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=je(function(p,m=0){return ge(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=je(function(p,m=0){return Be(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(b,p,m,A,B,K){if(m+A>b.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Me(b,p,m,A,B){return p=+p,m=m>>>0,B||ye(b,p,m,4),r.write(b,p,m,A,23,4),m+4}l.prototype.writeFloatLE=function(p,m,A){return Me(this,p,m,!0,A)},l.prototype.writeFloatBE=function(p,m,A){return Me(this,p,m,!1,A)};function Q(b,p,m,A,B){return p=+p,m=m>>>0,B||ye(b,p,m,8),r.write(b,p,m,A,52,8),m+8}l.prototype.writeDoubleLE=function(p,m,A){return Q(this,p,m,!0,A)},l.prototype.writeDoubleBE=function(p,m,A){return Q(this,p,m,!1,A)},l.prototype.copy=function(p,m,A,B){if(!l.isBuffer(p))throw new TypeError("argument should be a Buffer");if(A||(A=0),!B&&B!==0&&(B=this.length),m>=p.length&&(m=p.length),m||(m=0),B>0&&B<A&&(B=A),B===A||p.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(A<0||A>=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-A&&(B=p.length-m+A);const K=B-A;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,A,B):Uint8Array.prototype.set.call(p,this.subarray(A,B),m),K},l.prototype.fill=function(p,m,A,B){if(typeof p=="string"){if(typeof m=="string"?(B=m,m=0,A=this.length):typeof A=="string"&&(B=A,A=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 X=p.charCodeAt(0);(B==="utf8"&&X<128||B==="latin1")&&(p=X)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(m<0||this.length<m||this.length<A)throw new RangeError("Out of range index");if(A<=m)return this;m=m>>>0,A=A===void 0?this.length:A>>>0,p||(p=0);let K;if(typeof p=="number")for(K=m;K<A;++K)this[K]=p;else{const X=l.isBuffer(p)?p:l.from(p,B),Ee=X.length;if(Ee===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(K=0;K<A-m;++K)this[K+m]=X[K%Ee]}return this};const Y={};function z(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}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(b,p){return`The "${b}" argument must be of type number. Received type ${typeof p}`},TypeError),z("ERR_OUT_OF_RANGE",function(b,p,m){let A=`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"),A+=` It must be ${p}. Received ${B}`,A},RangeError);function w(b){let p="",m=b.length;const A=b[0]==="-"?1:0;for(;m>=A+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)&&Ue(p,b.length-(m+1))}function we(b,p,m,A,B,K){if(b>m||b<p){const X=typeof p=="bigint"?"n":"";let Ee;throw K>3?p===0||p===BigInt(0)?Ee=`>= 0${X} and < 2${X} ** ${(K+1)*8}${X}`:Ee=`>= -(2${X} ** ${(K+1)*8-1}${X}) and < 2 ** ${(K+1)*8-1}${X}`:Ee=`>= ${p}${X} and <= ${m}${X}`,new Y.ERR_OUT_OF_RANGE("value",Ee,b)}F(A,B,K)}function ve(b,p){if(typeof b!="number")throw new Y.ERR_INVALID_ARG_TYPE(p,"number",b)}function Ue(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 A=b.length;let B=null;const K=[];for(let X=0;X<A;++X){if(m=b.charCodeAt(X),m>55295&&m<57344){if(!B){if(m>56319){(p-=3)>-1&&K.push(239,191,189);continue}else if(X+1===A){(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 At(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,A,B;const K=[];for(let X=0;X<b.length&&!((p-=2)<0);++X)m=b.charCodeAt(X),A=m>>8,B=m%256,K.push(B),K.push(A);return K}function Je(b){return e.toByteArray(at(b))}function He(b,p,m,A){let B;for(B=0;B<A&&!(B+m>=p.length||B>=b.length);++B)p[B+m]=b[B];return B}function ke(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 A=m*16;for(let B=0;B<16;++B)p[A+B]=b[m]+b[B]}return p}();function je(b){return typeof BigInt>"u"?Ze:b}function Ze(){throw new Error("BigInt not supported")}})(qg);let Lh;const Nt={ethereumClient:void 0,setEthereumClient(t){Lh=t},client(){if(Lh)return Lh;throw new Error("ClientCtrl has no client set")}},gr=Ln({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),tt={state:gr,subscribe(t){return Yn(gr,()=>t(gr))},push(t,e){t!==gr.view&&(gr.view=t,e&&(gr.data=e),gr.history.push(t))},reset(t){gr.view=t,gr.history=[t]},replace(t){gr.history.length>1&&(gr.history[gr.history.length-1]=t,gr.view=t)},goBack(){if(gr.history.length>1){gr.history.pop();const[t]=gr.history.slice(-1);gr.view=t}},setData(t){gr.data=t}},Se={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 Se.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Se.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(Se.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(!Se.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(Se.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Se.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Se.WALLETCONNECT_DEEPLINK_CHOICE)},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(Se.W3M_VERSION,"2.4.2")},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(Se.W3M_PREFER_INJECTED_URL_FLAG):!1}},Px=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Sr=Ln({enabled:Px,userSessionId:"",events:[],connectedWalletId:void 0}),vi={state:Sr,subscribe(t){return Yn(Sr.events,()=>t(Ex(Sr.events[Sr.events.length-1])))},initialize(){Sr.enabled&&typeof crypto<"u"&&(Sr.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Sr.connectedWalletId=t},click(t){if(Sr.enabled){const e={type:"CLICK",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}},track(t){if(Sr.enabled){const e={type:"TRACK",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}},view(t){if(Sr.enabled){const e={type:"VIEW",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}}},Er=Ln({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}),Ae={state:Er,subscribe(t){return Yn(Er,()=>t(Er))},setChains(t){Er.chains=t},setStandaloneChains(t){Er.standaloneChains=t},setStandaloneUri(t){Er.standaloneUri=t},getSelectedChain(){const t=Nt.client().getNetwork().chain;return t&&(Er.selectedChain=t),Er.selectedChain},setSelectedChain(t){Er.selectedChain=t},setIsStandalone(t){Er.isStandalone=t},setIsCustomDesktop(t){Er.isCustomDesktop=t},setIsCustomMobile(t){Er.isCustomMobile=t},setIsDataLoaded(t){Er.isDataLoaded=t},setIsUiLoaded(t){Er.isUiLoaded=t},setWalletConnectVersion(t){Er.walletConnectVersion=t},setIsPreferInjected(t){Er.isPreferInjected=t},setIsAuth(t){Er.isAuth=t}},xc=Ln({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:xc,subscribe(t){return Yn(xc,()=>t(xc))},setConfig(t){var e,r,n,i;vi.initialize(),Ae.setStandaloneChains(t.standaloneChains),Ae.setIsStandalone(!!((e=t.standaloneChains)!=null&&e.length)||!!t.enableStandaloneMode),Ae.setIsAuth(!!t.enableAuthMode),Ae.setIsCustomMobile(!!((r=t.mobileWallets)!=null&&r.length)),Ae.setIsCustomDesktop(!!((n=t.desktopWallets)!=null&&n.length)),Ae.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),Ae.state.isStandalone||(Ae.setChains(Nt.client().chains),Ae.setIsPreferInjected(Nt.client().isInjectedProviderInstalled()&&Se.isPreferInjectedFlag())),t.defaultChain&&Ae.setSelectedChain(t.defaultChain),Se.setWeb3ModalVersionInStorage(),Object.assign(xc,t)}},kt=Ln({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),Et={state:kt,subscribe(t){return Yn(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=Ae.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}},Mh="https://explorer-api.walletconnect.com";async function Cc(t,e){const r=new URL(t,Mh);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 yi={async getDesktopListings(t){return Cc("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return Cc("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return Cc("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return Cc("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${Mh}/w3m/v1/getWalletImage/${t}?projectId=${jt.state.projectId}`},getAssetImageUrl(t){return`${Mh}/w3m/v1/getAssetImage/${t}?projectId=${jt.state.projectId}`}};var Tx=Object.defineProperty,Kg=Object.getOwnPropertySymbols,Rx=Object.prototype.hasOwnProperty,Nx=Object.prototype.propertyIsEnumerable,Gg=(t,e,r)=>e in t?Tx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Lx=(t,e)=>{for(var r in e||(e={}))Rx.call(e,r)&&Gg(t,r,e[r]);if(Kg)for(var r of Kg(e))Nx.call(e,r)&&Gg(t,r,e[r]);return t};const Zg=Se.isMobile(),hn=Ln({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),rr={state:hn,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=jt.state;if(t==="NONE"||e==="ALL"&&!t)return hn.recomendedWallets;if(Se.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await yi.getAllListings(r),i=Object.values(n);i.sort((o,c)=>{const l=t.indexOf(o.id),h=t.indexOf(c.id);return l-h}),hn.recomendedWallets=i}else{const{standaloneChains:r,walletConnectVersion:n,isAuth:i}=Ae.state,o=r?.join(","),c=Se.isArray(e),l={page:1,sdks:i?"auth_v1":void 0,entries:Se.RECOMMENDED_WALLET_AMOUNT,chains:o,version:n,excludedIds:c?e.join(","):void 0},{listings:h}=Zg?await yi.getMobileListings(l):await yi.getDesktopListings(l);hn.recomendedWallets=Object.values(h)}return hn.recomendedWallets},async getWallets(t){const e=Lx({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=jt.state,{recomendedWallets:i}=hn;if(n==="ALL")return hn.wallets;e.search||(i.length?e.excludedIds=i.map(E=>E.id).join(","):Se.isArray(r)&&(e.excludedIds=r.join(","))),Se.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Ae.state.isAuth&&(e.sdks="auth_v1");const{page:o,search:c}=t,{listings:l,total:h}=Zg?await yi.getMobileListings(e):await yi.getDesktopListings(e),f=Object.values(l),v=c?"search":"wallets";return hn[v]={listings:[...hn[v].listings,...f],total:h,page:o??1},{listings:f,total:h}},async getInjectedWallets(){const{listings:t}=await yi.getInjectedListings({}),e=Object.values(t);return hn.injectedWallets=e,hn.injectedWallets},getWalletImageUrl(t){return yi.getWalletImageUrl(t)},getAssetImageUrl(t){return yi.getAssetImageUrl(t)},resetSearch(){hn.search={listings:[],total:0,page:1}}},Xo=Ln({pairingUri:"",pairingError:!1}),ur={state:Xo,subscribe(t){return Yn(Xo,()=>t(Xo))},setPairingUri(t){Xo.pairingUri=t},setPairingError(t){Xo.pairingError=t}},Ls=Ln({open:!1}),Nr={state:Ls,subscribe(t){return Yn(Ls,()=>t(Ls))},async open(t){return new Promise(e=>{const{isStandalone:r,isUiLoaded:n,isDataLoaded:i,isPreferInjected:o,selectedChain:c}=Ae.state,{isConnected:l}=Et.state,{enableNetworkView:h}=jt.state;if(r)Ae.setStandaloneUri(t?.uri),Ae.setStandaloneChains(t?.standaloneChains),tt.reset("ConnectWallet");else if(t!=null&&t.route)tt.reset(t.route);else if(l)tt.reset("Account");else if(h)tt.reset("SelectNetwork");else if(o){Nt.client().connectConnector("injected",c?.id).catch(v=>console.error(v)),e();return}else tt.reset("ConnectWallet");const{pairingUri:f}=ur.state;if(n&&i&&(r||f||l))Ls.open=!0,e();else{const v=setInterval(()=>{const E=Ae.state,_=ur.state;E.isUiLoaded&&E.isDataLoaded&&(E.isStandalone||_.pairingUri||l)&&(clearInterval(v),Ls.open=!0,e())},200)}})},close(){Ls.open=!1}};var Mx=Object.defineProperty,Yg=Object.getOwnPropertySymbols,Ux=Object.prototype.hasOwnProperty,jx=Object.prototype.propertyIsEnumerable,Jg=(t,e,r)=>e in t?Mx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Fx=(t,e)=>{for(var r in e||(e={}))Ux.call(e,r)&&Jg(t,r,e[r]);if(Yg)for(var r of Yg(e))jx.call(e,r)&&Jg(t,r,e[r]);return t};function Bx(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const ea=Ln({themeMode:Bx()?"dark":"light"}),Un={state:ea,subscribe(t){return Yn(ea,()=>t(ea))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(ea.themeMode=e),r&&(ea.themeVariables=Fx({},r))}},Zi=Ln({open:!1,message:"",variant:"success"}),qr={state:Zi,subscribe(t){return Yn(Zi,()=>t(Zi))},openToast(t,e){Zi.open=!0,Zi.message=t,Zi.variant=e},closeToast(){Zi.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=qg.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var kx=Object.defineProperty,Qg=Object.getOwnPropertySymbols,Hx=Object.prototype.hasOwnProperty,Wx=Object.prototype.propertyIsEnumerable,Xg=(t,e,r)=>e in t?kx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zx=(t,e)=>{for(var r in e||(e={}))Hx.call(e,r)&&Xg(t,r,e[r]);if(Qg)for(var r of Qg(e))Wx.call(e,r)&&Xg(t,r,e[r]);return t};class qx{constructor(e){this.openModal=Nr.open,this.closeModal=Nr.close,this.subscribeModal=Nr.subscribe,this.setTheme=Un.setThemeConfig,Un.setThemeConfig(e),jt.setConfig(zx({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return _D});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),Ae.setIsUiLoaded(!0)}}}var Vx=Object.freeze({__proto__:null,WalletConnectModal:qx});/**
|
|
103
|
+
*/(function(t){const e=Cc,r=Lh,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(ke(b,ArrayBuffer)||b&&ke(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(b,SharedArrayBuffer)||b&&ke(b.buffer,SharedArrayBuffer)))return j(b,p,m);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const A=b.valueOf&&b.valueOf();if(A!=null&&A!==b)return l.from(A,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 f(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 f(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 f(b),c(b<0?0:Z(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 A=c(m);const B=A.write(b,p);return B!==m&&(A=A.slice(0,B)),A}function S(b){const p=b.length<0?0:Z(b.length)|0,m=c(p);for(let A=0;A<p;A+=1)m[A]=b[A]&255;return m}function P(b){if(ke(b,Uint8Array)){const p=new Uint8Array(b);return j(p.buffer,p.byteOffset,p.byteLength)}return S(b)}function j(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 A;return p===void 0&&m===void 0?A=new Uint8Array(b):m===void 0?A=new Uint8Array(b,p):A=new Uint8Array(b,p,m),Object.setPrototypeOf(A,l.prototype),A}function H(b){if(l.isBuffer(b)){const p=Z(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):S(b);if(b.type==="Buffer"&&Array.isArray(b.data))return S(b.data)}function Z(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(ke(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),ke(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 A=p.length,B=m.length;for(let K=0,X=Math.min(A,B);K<X;++K)if(p[K]!==m[K]){A=p[K],B=m[K];break}return A<B?-1:B<A?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 A;if(m===void 0)for(m=0,A=0;A<p.length;++A)m+=p[A].length;const B=l.allocUnsafe(m);let K=0;for(A=0;A<p.length;++A){let X=p[A];if(ke(X,Uint8Array))K+X.length>B.length?(l.isBuffer(X)||(X=l.from(X)),X.copy(B,K)):Uint8Array.prototype.set.call(B,X,K);else if(l.isBuffer(X))X.copy(B,K);else throw new TypeError('"list" argument must be an Array of Buffers');K+=X.length}return B};function L(b,p){if(l.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||ke(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,A=arguments.length>2&&arguments[2]===!0;if(!A&&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 A?-1:Ge(b).length;p=(""+p).toLowerCase(),B=!0}}l.byteLength=L;function $(b,p,m){let A=!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(A)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),A=!0}}l.prototype._isBuffer=!0;function T(b,p,m){const A=b[p];b[p]=b[m],b[m]=A}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,A,B,K){if(ke(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),A===void 0&&(A=p?p.length:0),B===void 0&&(B=0),K===void 0&&(K=this.length),m<0||A>p.length||B<0||K>this.length)throw new RangeError("out of range index");if(B>=K&&m>=A)return 0;if(B>=K)return-1;if(m>=A)return 1;if(m>>>=0,A>>>=0,B>>>=0,K>>>=0,this===p)return 0;let X=K-B,Ee=A-m;const Re=Math.min(X,Ee),st=this.slice(B,K),ht=p.slice(m,A);for(let lt=0;lt<Re;++lt)if(st[lt]!==ht[lt]){X=st[lt],Ee=ht[lt];break}return X<Ee?-1:Ee<X?1:0};function I(b,p,m,A,B){if(b.length===0)return-1;if(typeof m=="string"?(A=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,A)),l.isBuffer(p))return p.length===0?-1:d(b,p,m,A,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):d(b,[p],m,A,B);throw new TypeError("val must be string, number or Buffer")}function d(b,p,m,A,B){let K=1,X=b.length,Ee=p.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(b.length<2||p.length<2)return-1;K=2,X/=2,Ee/=2,m/=2}function Re(ht,lt){return K===1?ht[lt]:ht.readUInt16BE(lt*K)}let st;if(B){let ht=-1;for(st=m;st<X;st++)if(Re(b,st)===Re(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>X&&(m=X-Ee),st=m;st>=0;st--){let ht=!0;for(let lt=0;lt<Ee;lt++)if(Re(b,st+lt)!==Re(p,lt)){ht=!1;break}if(ht)return st}return-1}l.prototype.includes=function(p,m,A){return this.indexOf(p,m,A)!==-1},l.prototype.indexOf=function(p,m,A){return I(this,p,m,A,!0)},l.prototype.lastIndexOf=function(p,m,A){return I(this,p,m,A,!1)};function x(b,p,m,A){m=Number(m)||0;const B=b.length-m;A?(A=Number(A),A>B&&(A=B)):A=B;const K=p.length;A>K/2&&(A=K/2);let X;for(X=0;X<A;++X){const Ee=parseInt(p.substr(X*2,2),16);if(Ke(Ee))return X;b[m+X]=Ee}return X}function J(b,p,m,A){return He(Ge(p,b.length-m),b,m,A)}function W(b,p,m,A){return He(At(p),b,m,A)}function ee(b,p,m,A){return He(Je(p),b,m,A)}function de(b,p,m,A){return He($t(p,b.length-m),b,m,A)}l.prototype.write=function(p,m,A,B){if(m===void 0)B="utf8",A=this.length,m=0;else if(A===void 0&&typeof m=="string")B=m,A=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(A)?(A=A>>>0,B===void 0&&(B="utf8")):(B=A,A=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const K=this.length-m;if((A===void 0||A>K)&&(A=K),p.length>0&&(A<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let X=!1;for(;;)switch(B){case"hex":return x(this,p,m,A);case"utf8":case"utf-8":return J(this,p,m,A);case"ascii":case"latin1":case"binary":return W(this,p,m,A);case"base64":return ee(this,p,m,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,p,m,A);default:if(X)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),X=!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 A=[];let B=p;for(;B<m;){const K=b[B];let X=null,Ee=K>239?4:K>223?3:K>191?2:1;if(B+Ee<=m){let Re,st,ht,lt;switch(Ee){case 1:K<128&&(X=K);break;case 2:Re=b[B+1],(Re&192)===128&&(lt=(K&31)<<6|Re&63,lt>127&&(X=lt));break;case 3:Re=b[B+1],st=b[B+2],(Re&192)===128&&(st&192)===128&&(lt=(K&15)<<12|(Re&63)<<6|st&63,lt>2047&&(lt<55296||lt>57343)&&(X=lt));break;case 4:Re=b[B+1],st=b[B+2],ht=b[B+3],(Re&192)===128&&(st&192)===128&&(ht&192)===128&&(lt=(K&15)<<18|(Re&63)<<12|(st&63)<<6|ht&63,lt>65535&<<1114112&&(X=lt))}}X===null?(X=65533,Ee=1):X>65535&&(X-=65536,A.push(X>>>10&1023|55296),X=56320|X&1023),A.push(X),B+=Ee}return ce(A)}const U=4096;function ce(b){const p=b.length;if(p<=U)return String.fromCharCode.apply(String,b);let m="",A=0;for(;A<p;)m+=String.fromCharCode.apply(String,b.slice(A,A+=U));return m}function le(b,p,m){let A="";m=Math.min(b.length,m);for(let B=p;B<m;++B)A+=String.fromCharCode(b[B]&127);return A}function re(b,p,m){let A="";m=Math.min(b.length,m);for(let B=p;B<m;++B)A+=String.fromCharCode(b[B]);return A}function ne(b,p,m){const A=b.length;(!p||p<0)&&(p=0),(!m||m<0||m>A)&&(m=A);let B="";for(let K=p;K<m;++K)B+=rt[b[K]];return B}function ae(b,p,m){const A=b.slice(p,m);let B="";for(let K=0;K<A.length-1;K+=2)B+=String.fromCharCode(A[K]+A[K+1]*256);return B}l.prototype.slice=function(p,m){const A=this.length;p=~~p,m=m===void 0?A:~~m,p<0?(p+=A,p<0&&(p=0)):p>A&&(p=A),m<0?(m+=A,m<0&&(m=0)):m>A&&(m=A),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,A){p=p>>>0,m=m>>>0,A||ie(p,m,this.length);let B=this[p],K=1,X=0;for(;++X<m&&(K*=256);)B+=this[p+X]*K;return B},l.prototype.readUintBE=l.prototype.readUIntBE=function(p,m,A){p=p>>>0,m=m>>>0,A||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=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],A=this[p+7];(m===void 0||A===void 0)&&Ue(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+A*2**24;return BigInt(B)+(BigInt(K)<<BigInt(32))}),l.prototype.readBigUInt64BE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],A=this[p+7];(m===void 0||A===void 0)&&Ue(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+A;return(BigInt(B)<<BigInt(32))+BigInt(K)}),l.prototype.readIntLE=function(p,m,A){p=p>>>0,m=m>>>0,A||ie(p,m,this.length);let B=this[p],K=1,X=0;for(;++X<m&&(K*=256);)B+=this[p+X]*K;return K*=128,B>=K&&(B-=Math.pow(2,8*m)),B},l.prototype.readIntBE=function(p,m,A){p=p>>>0,m=m>>>0,A||ie(p,m,this.length);let B=m,K=1,X=this[p+--B];for(;B>0&&(K*=256);)X+=this[p+--B]*K;return K*=128,X>=K&&(X-=Math.pow(2,8*m)),X},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 A=this[p]|this[p+1]<<8;return A&32768?A|4294901760:A},l.prototype.readInt16BE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const A=this[p+1]|this[p]<<8;return A&32768?A|4294901760:A},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=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],A=this[p+7];(m===void 0||A===void 0)&&Ue(p,this.length-8);const B=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(A<<24);return(BigInt(B)<<BigInt(32))+BigInt(m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),l.prototype.readBigInt64BE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],A=this[p+7];(m===void 0||A===void 0)&&Ue(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+A)}),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 De(b,p,m,A,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+A>b.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(p,m,A,B){if(p=+p,m=m>>>0,A=A>>>0,!B){const Ee=Math.pow(2,8*A)-1;De(this,p,m,A,Ee,0)}let K=1,X=0;for(this[m]=p&255;++X<A&&(K*=256);)this[m+X]=p/K&255;return m+A},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(p,m,A,B){if(p=+p,m=m>>>0,A=A>>>0,!B){const Ee=Math.pow(2,8*A)-1;De(this,p,m,A,Ee,0)}let K=A-1,X=1;for(this[m+K]=p&255;--K>=0&&(X*=256);)this[m+K]=p/X&255;return m+A},l.prototype.writeUint8=l.prototype.writeUInt8=function(p,m,A){return p=+p,m=m>>>0,A||De(this,p,m,1,255,0),this[m]=p&255,m+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(p,m,A){return p=+p,m=m>>>0,A||De(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,A){return p=+p,m=m>>>0,A||De(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,A){return p=+p,m=m>>>0,A||De(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,A){return p=+p,m=m>>>0,A||De(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,A,B){we(p,A,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 X=Number(p>>BigInt(32)&BigInt(4294967295));return b[m++]=X,X=X>>8,b[m++]=X,X=X>>8,b[m++]=X,X=X>>8,b[m++]=X,m}function Be(b,p,m,A,B){we(p,A,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 X=Number(p>>BigInt(32)&BigInt(4294967295));return b[m+3]=X,X=X>>8,b[m+2]=X,X=X>>8,b[m+1]=X,X=X>>8,b[m]=X,m+8}l.prototype.writeBigUInt64LE=je(function(p,m=0){return ge(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=je(function(p,m=0){return Be(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(p,m,A,B){if(p=+p,m=m>>>0,!B){const Re=Math.pow(2,8*A-1);De(this,p,m,A,Re-1,-Re)}let K=0,X=1,Ee=0;for(this[m]=p&255;++K<A&&(X*=256);)p<0&&Ee===0&&this[m+K-1]!==0&&(Ee=1),this[m+K]=(p/X>>0)-Ee&255;return m+A},l.prototype.writeIntBE=function(p,m,A,B){if(p=+p,m=m>>>0,!B){const Re=Math.pow(2,8*A-1);De(this,p,m,A,Re-1,-Re)}let K=A-1,X=1,Ee=0;for(this[m+K]=p&255;--K>=0&&(X*=256);)p<0&&Ee===0&&this[m+K+1]!==0&&(Ee=1),this[m+K]=(p/X>>0)-Ee&255;return m+A},l.prototype.writeInt8=function(p,m,A){return p=+p,m=m>>>0,A||De(this,p,m,1,127,-128),p<0&&(p=255+p+1),this[m]=p&255,m+1},l.prototype.writeInt16LE=function(p,m,A){return p=+p,m=m>>>0,A||De(this,p,m,2,32767,-32768),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeInt16BE=function(p,m,A){return p=+p,m=m>>>0,A||De(this,p,m,2,32767,-32768),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeInt32LE=function(p,m,A){return p=+p,m=m>>>0,A||De(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,A){return p=+p,m=m>>>0,A||De(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=je(function(p,m=0){return ge(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=je(function(p,m=0){return Be(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(b,p,m,A,B,K){if(m+A>b.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Me(b,p,m,A,B){return p=+p,m=m>>>0,B||ye(b,p,m,4),r.write(b,p,m,A,23,4),m+4}l.prototype.writeFloatLE=function(p,m,A){return Me(this,p,m,!0,A)},l.prototype.writeFloatBE=function(p,m,A){return Me(this,p,m,!1,A)};function Q(b,p,m,A,B){return p=+p,m=m>>>0,B||ye(b,p,m,8),r.write(b,p,m,A,52,8),m+8}l.prototype.writeDoubleLE=function(p,m,A){return Q(this,p,m,!0,A)},l.prototype.writeDoubleBE=function(p,m,A){return Q(this,p,m,!1,A)},l.prototype.copy=function(p,m,A,B){if(!l.isBuffer(p))throw new TypeError("argument should be a Buffer");if(A||(A=0),!B&&B!==0&&(B=this.length),m>=p.length&&(m=p.length),m||(m=0),B>0&&B<A&&(B=A),B===A||p.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(A<0||A>=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-A&&(B=p.length-m+A);const K=B-A;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,A,B):Uint8Array.prototype.set.call(p,this.subarray(A,B),m),K},l.prototype.fill=function(p,m,A,B){if(typeof p=="string"){if(typeof m=="string"?(B=m,m=0,A=this.length):typeof A=="string"&&(B=A,A=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 X=p.charCodeAt(0);(B==="utf8"&&X<128||B==="latin1")&&(p=X)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(m<0||this.length<m||this.length<A)throw new RangeError("Out of range index");if(A<=m)return this;m=m>>>0,A=A===void 0?this.length:A>>>0,p||(p=0);let K;if(typeof p=="number")for(K=m;K<A;++K)this[K]=p;else{const X=l.isBuffer(p)?p:l.from(p,B),Ee=X.length;if(Ee===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(K=0;K<A-m;++K)this[K+m]=X[K%Ee]}return this};const Y={};function z(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}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(b,p){return`The "${b}" argument must be of type number. Received type ${typeof p}`},TypeError),z("ERR_OUT_OF_RANGE",function(b,p,m){let A=`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"),A+=` It must be ${p}. Received ${B}`,A},RangeError);function w(b){let p="",m=b.length;const A=b[0]==="-"?1:0;for(;m>=A+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)&&Ue(p,b.length-(m+1))}function we(b,p,m,A,B,K){if(b>m||b<p){const X=typeof p=="bigint"?"n":"";let Ee;throw K>3?p===0||p===BigInt(0)?Ee=`>= 0${X} and < 2${X} ** ${(K+1)*8}${X}`:Ee=`>= -(2${X} ** ${(K+1)*8-1}${X}) and < 2 ** ${(K+1)*8-1}${X}`:Ee=`>= ${p}${X} and <= ${m}${X}`,new Y.ERR_OUT_OF_RANGE("value",Ee,b)}F(A,B,K)}function ve(b,p){if(typeof b!="number")throw new Y.ERR_INVALID_ARG_TYPE(p,"number",b)}function Ue(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 A=b.length;let B=null;const K=[];for(let X=0;X<A;++X){if(m=b.charCodeAt(X),m>55295&&m<57344){if(!B){if(m>56319){(p-=3)>-1&&K.push(239,191,189);continue}else if(X+1===A){(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 At(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,A,B;const K=[];for(let X=0;X<b.length&&!((p-=2)<0);++X)m=b.charCodeAt(X),A=m>>8,B=m%256,K.push(B),K.push(A);return K}function Je(b){return e.toByteArray(at(b))}function He(b,p,m,A){let B;for(B=0;B<A&&!(B+m>=p.length||B>=b.length);++B)p[B+m]=b[B];return B}function ke(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 A=m*16;for(let B=0;B<16;++B)p[A+B]=b[m]+b[B]}return p}();function je(b){return typeof BigInt>"u"?Ze:b}function Ze(){throw new Error("BigInt not supported")}})(Vg);let Mh;const Nt={ethereumClient:void 0,setEthereumClient(t){Mh=t},client(){if(Mh)return Mh;throw new Error("ClientCtrl has no client set")}},gr=Nn({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),tt={state:gr,subscribe(t){return Zn(gr,()=>t(gr))},push(t,e){t!==gr.view&&(gr.view=t,e&&(gr.data=e),gr.history.push(t))},reset(t){gr.view=t,gr.history=[t]},replace(t){gr.history.length>1&&(gr.history[gr.history.length-1]=t,gr.view=t)},goBack(){if(gr.history.length>1){gr.history.pop();const[t]=gr.history.slice(-1);gr.view=t}},setData(t){gr.data=t}},Se={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 Se.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Se.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(Se.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(!Se.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(Se.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Se.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Se.WALLETCONNECT_DEEPLINK_CHOICE)},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(Se.W3M_VERSION,"2.4.2")},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(Se.W3M_PREFER_INJECTED_URL_FLAG):!1}},Nx=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Sr=Nn({enabled:Nx,userSessionId:"",events:[],connectedWalletId:void 0}),wi={state:Sr,subscribe(t){return Zn(Sr.events,()=>t(Ix(Sr.events[Sr.events.length-1])))},initialize(){Sr.enabled&&typeof crypto<"u"&&(Sr.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Sr.connectedWalletId=t},click(t){if(Sr.enabled){const e={type:"CLICK",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}},track(t){if(Sr.enabled){const e={type:"TRACK",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}},view(t){if(Sr.enabled){const e={type:"VIEW",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}}},Er=Nn({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}),Ae={state:Er,subscribe(t){return Zn(Er,()=>t(Er))},setChains(t){Er.chains=t},setStandaloneChains(t){Er.standaloneChains=t},setStandaloneUri(t){Er.standaloneUri=t},getSelectedChain(){const t=Nt.client().getNetwork().chain;return t&&(Er.selectedChain=t),Er.selectedChain},setSelectedChain(t){Er.selectedChain=t},setIsStandalone(t){Er.isStandalone=t},setIsCustomDesktop(t){Er.isCustomDesktop=t},setIsCustomMobile(t){Er.isCustomMobile=t},setIsDataLoaded(t){Er.isDataLoaded=t},setIsUiLoaded(t){Er.isUiLoaded=t},setWalletConnectVersion(t){Er.walletConnectVersion=t},setIsPreferInjected(t){Er.isPreferInjected=t},setIsAuth(t){Er.isAuth=t}},Ic=Nn({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:Ic,subscribe(t){return Zn(Ic,()=>t(Ic))},setConfig(t){var e,r,n,i;wi.initialize(),Ae.setStandaloneChains(t.standaloneChains),Ae.setIsStandalone(!!((e=t.standaloneChains)!=null&&e.length)||!!t.enableStandaloneMode),Ae.setIsAuth(!!t.enableAuthMode),Ae.setIsCustomMobile(!!((r=t.mobileWallets)!=null&&r.length)),Ae.setIsCustomDesktop(!!((n=t.desktopWallets)!=null&&n.length)),Ae.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),Ae.state.isStandalone||(Ae.setChains(Nt.client().chains),Ae.setIsPreferInjected(Nt.client().isInjectedProviderInstalled()&&Se.isPreferInjectedFlag())),t.defaultChain&&Ae.setSelectedChain(t.defaultChain),Se.setWeb3ModalVersionInStorage(),Object.assign(Ic,t)}},kt=Nn({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),Et={state:kt,subscribe(t){return Zn(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=Ae.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}},Uh="https://explorer-api.walletconnect.com";async function Sc(t,e){const r=new URL(t,Uh);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 vi={async getDesktopListings(t){return Sc("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return Sc("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return Sc("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return Sc("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${Uh}/w3m/v1/getWalletImage/${t}?projectId=${jt.state.projectId}`},getAssetImageUrl(t){return`${Uh}/w3m/v1/getAssetImage/${t}?projectId=${jt.state.projectId}`}};var Lx=Object.defineProperty,Gg=Object.getOwnPropertySymbols,Mx=Object.prototype.hasOwnProperty,Ux=Object.prototype.propertyIsEnumerable,Zg=(t,e,r)=>e in t?Lx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jx=(t,e)=>{for(var r in e||(e={}))Mx.call(e,r)&&Zg(t,r,e[r]);if(Gg)for(var r of Gg(e))Ux.call(e,r)&&Zg(t,r,e[r]);return t};const Yg=Se.isMobile(),un=Nn({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),rr={state:un,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=jt.state;if(t==="NONE"||e==="ALL"&&!t)return un.recomendedWallets;if(Se.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await vi.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}=Ae.state,o=r?.join(","),c=Se.isArray(e),l={page:1,sdks:i?"auth_v1":void 0,entries:Se.RECOMMENDED_WALLET_AMOUNT,chains:o,version:n,excludedIds:c?e.join(","):void 0},{listings:h}=Yg?await vi.getMobileListings(l):await vi.getDesktopListings(l);un.recomendedWallets=Object.values(h)}return un.recomendedWallets},async getWallets(t){const e=jx({},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(","):Se.isArray(r)&&(e.excludedIds=r.join(","))),Se.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Ae.state.isAuth&&(e.sdks="auth_v1");const{page:o,search:c}=t,{listings:l,total:h}=Yg?await vi.getMobileListings(e):await vi.getDesktopListings(e),f=Object.values(l),v=c?"search":"wallets";return un[v]={listings:[...un[v].listings,...f],total:h,page:o??1},{listings:f,total:h}},async getInjectedWallets(){const{listings:t}=await vi.getInjectedListings({}),e=Object.values(t);return un.injectedWallets=e,un.injectedWallets},getWalletImageUrl(t){return vi.getWalletImageUrl(t)},getAssetImageUrl(t){return vi.getAssetImageUrl(t)},resetSearch(){un.search={listings:[],total:0,page:1}}},ta=Nn({pairingUri:"",pairingError:!1}),ur={state:ta,subscribe(t){return Zn(ta,()=>t(ta))},setPairingUri(t){ta.pairingUri=t},setPairingError(t){ta.pairingError=t}},Us=Nn({open:!1}),Nr={state:Us,subscribe(t){return Zn(Us,()=>t(Us))},async open(t){return new Promise(e=>{const{isStandalone:r,isUiLoaded:n,isDataLoaded:i,isPreferInjected:o,selectedChain:c}=Ae.state,{isConnected:l}=Et.state,{enableNetworkView:h}=jt.state;if(r)Ae.setStandaloneUri(t?.uri),Ae.setStandaloneChains(t?.standaloneChains),tt.reset("ConnectWallet");else if(t!=null&&t.route)tt.reset(t.route);else if(l)tt.reset("Account");else if(h)tt.reset("SelectNetwork");else if(o){Nt.client().connectConnector("injected",c?.id).catch(v=>console.error(v)),e();return}else tt.reset("ConnectWallet");const{pairingUri:f}=ur.state;if(n&&i&&(r||f||l))Us.open=!0,e();else{const v=setInterval(()=>{const E=Ae.state,_=ur.state;E.isUiLoaded&&E.isDataLoaded&&(E.isStandalone||_.pairingUri||l)&&(clearInterval(v),Us.open=!0,e())},200)}})},close(){Us.open=!1}};var Fx=Object.defineProperty,Jg=Object.getOwnPropertySymbols,Bx=Object.prototype.hasOwnProperty,kx=Object.prototype.propertyIsEnumerable,Qg=(t,e,r)=>e in t?Fx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Hx=(t,e)=>{for(var r in e||(e={}))Bx.call(e,r)&&Qg(t,r,e[r]);if(Jg)for(var r of Jg(e))kx.call(e,r)&&Qg(t,r,e[r]);return t};function Wx(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const ra=Nn({themeMode:Wx()?"dark":"light"}),Mn={state:ra,subscribe(t){return Zn(ra,()=>t(ra))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(ra.themeMode=e),r&&(ra.themeVariables=Hx({},r))}},Zi=Nn({open:!1,message:"",variant:"success"}),qr={state:Zi,subscribe(t){return Zn(Zi,()=>t(Zi))},openToast(t,e){Zi.open=!0,Zi.message=t,Zi.variant=e},closeToast(){Zi.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=Vg.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var zx=Object.defineProperty,Xg=Object.getOwnPropertySymbols,qx=Object.prototype.hasOwnProperty,Vx=Object.prototype.propertyIsEnumerable,e3=(t,e,r)=>e in t?zx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kx=(t,e)=>{for(var r in e||(e={}))qx.call(e,r)&&e3(t,r,e[r]);if(Xg)for(var r of Xg(e))Vx.call(e,r)&&e3(t,r,e[r]);return t};class Gx{constructor(e){this.openModal=Nr.open,this.closeModal=Nr.close,this.subscribeModal=Nr.subscribe,this.setTheme=Mn.setThemeConfig,Mn.setThemeConfig(e),jt.setConfig(Kx({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return CD});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),Ae.setIsUiLoaded(!0)}}}var Zx=Object.freeze({__proto__:null,WalletConnectModal:Gx});/**
|
|
104
104
|
* @license
|
|
105
105
|
* Copyright 2019 Google LLC
|
|
106
106
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
107
|
-
*/const
|
|
107
|
+
*/const Oc=window,jh=Oc.ShadowRoot&&(Oc.ShadyCSS===void 0||Oc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fh=Symbol(),t3=new WeakMap;class r3{constructor(e,r,n){if(this._$cssResult$=!0,n!==Fh)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(jh&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=t3.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&t3.set(r,e))}return e}toString(){return this.cssText}}const Yx=t=>new r3(typeof t=="string"?t:t+"",void 0,Fh),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 r3(r,t,Fh)},Jx=(t,e)=>{jh?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=Oc.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},n3=jh?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return Yx(r)})(t):t;/**
|
|
108
108
|
* @license
|
|
109
109
|
* Copyright 2017 Google LLC
|
|
110
110
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
111
|
-
*/var
|
|
111
|
+
*/var Bh;const Dc=window,i3=Dc.trustedTypes,Qx=i3?i3.emptyScript:"",s3=Dc.reactiveElementPolyfillSupport,kh={toAttribute(t,e){switch(e){case Boolean:t=t?Qx: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}},o3=(t,e)=>e!==t&&(e==e||t==t),Hh={attribute:!0,type:String,converter:kh,reflect:!1,hasChanged:o3};class js 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=Hh){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)||Hh}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(n3(i))}else e!==void 0&&r.push(n3(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 Jx(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=Hh){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:kh).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:kh;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||o3)(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){}}js.finalized=!0,js.elementProperties=new Map,js.elementStyles=[],js.shadowRootOptions={mode:"open"},s3?.({ReactiveElement:js}),((Bh=Dc.reactiveElementVersions)!==null&&Bh!==void 0?Bh:Dc.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 Wh;const Ac=window,Fs=Ac.trustedTypes,a3=Fs?Fs.createPolicy("lit-html",{createHTML:t=>t}):void 0,zh="$lit$",yi=`lit$${(Math.random()+"").slice(9)}$`,c3="?"+yi,Xx=`<${c3}>`,Yi=document,na=()=>Yi.createComment(""),ia=t=>t===null||typeof t!="object"&&typeof t!="function",l3=Array.isArray,e9=t=>l3(t)||typeof t?.[Symbol.iterator]=="function",qh=`[
|
|
116
|
+
\f\r]`,sa=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,u3=/-->/g,h3=/>/g,Ji=RegExp(`>|${qh}(?:([^\\s"'>=/]+)(${qh}*=${qh}*(?:[^
|
|
117
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),f3=/'/g,d3=/"/g,p3=/^(?:script|style|textarea|title)$/i,g3=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),oe=g3(1),ut=g3(2),Qi=Symbol.for("lit-noChange"),mr=Symbol.for("lit-nothing"),m3=new WeakMap,Xi=Yi.createTreeWalker(Yi,129,null,!1),t9=(t,e)=>{const r=t.length-1,n=[];let i,o=e===2?"<svg>":"",c=sa;for(let h=0;h<r;h++){const f=t[h];let v,E,_=-1,S=0;for(;S<f.length&&(c.lastIndex=S,E=c.exec(f),E!==null);)S=c.lastIndex,c===sa?E[1]==="!--"?c=u3:E[1]!==void 0?c=h3:E[2]!==void 0?(p3.test(E[2])&&(i=RegExp("</"+E[2],"g")),c=Ji):E[3]!==void 0&&(c=Ji):c===Ji?E[0]===">"?(c=i??sa,_=-1):E[1]===void 0?_=-2:(_=c.lastIndex-E[2].length,v=E[1],c=E[3]===void 0?Ji:E[3]==='"'?d3:f3):c===d3||c===f3?c=Ji:c===u3||c===h3?c=sa:(c=Ji,i=void 0);const P=c===Ji&&t[h+1].startsWith("/>")?" ":"";o+=c===sa?f+Xx:_>=0?(n.push(v),f.slice(0,_)+zh+f.slice(_)+yi+P):f+yi+(_===-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[a3!==void 0?a3.createHTML(l):l,n]};class oa{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let o=0,c=0;const l=e.length-1,h=this.parts,[f,v]=t9(e,r);if(this.el=oa.createElement(f,n),Xi.currentNode=this.el.content,r===2){const E=this.el.content,_=E.firstChild;_.remove(),E.append(..._.childNodes)}for(;(i=Xi.nextNode())!==null&&h.length<l;){if(i.nodeType===1){if(i.hasAttributes()){const E=[];for(const _ of i.getAttributeNames())if(_.endsWith(zh)||_.startsWith(yi)){const S=v[c++];if(E.push(_),S!==void 0){const P=i.getAttribute(S.toLowerCase()+zh).split(yi),j=/([.?@])?(.*)/.exec(S);h.push({type:1,index:o,name:j[2],strings:P,ctor:j[1]==="."?n9:j[1]==="?"?s9:j[1]==="@"?o9:$c})}else h.push({type:6,index:o})}for(const _ of E)i.removeAttribute(_)}if(p3.test(i.tagName)){const E=i.textContent.split(yi),_=E.length-1;if(_>0){i.textContent=Fs?Fs.emptyScript:"";for(let S=0;S<_;S++)i.append(E[S],na()),Xi.nextNode(),h.push({type:2,index:++o});i.append(E[_],na())}}}else if(i.nodeType===8)if(i.data===c3)h.push({type:2,index:o});else{let E=-1;for(;(E=i.data.indexOf(yi,E+1))!==-1;)h.push({type:7,index:o}),E+=yi.length-1}o++}}static createElement(e,r){const n=Yi.createElement("template");return n.innerHTML=e,n}}function Bs(t,e,r=t,n){var i,o,c,l;if(e===Qi)return e;let h=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const f=ia(e)?void 0:e._$litDirective$;return h?.constructor!==f&&((o=h?._$AO)===null||o===void 0||o.call(h,!1),f===void 0?h=void 0:(h=new f(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=Bs(t,h._$AS(t,e.values),h,n)),e}class r9{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:Yi).importNode(n,!0);Xi.currentNode=o;let c=Xi.nextNode(),l=0,h=0,f=i[0];for(;f!==void 0;){if(l===f.index){let v;f.type===2?v=new aa(c,c.nextSibling,this,e):f.type===1?v=new f.ctor(c,f.name,f.strings,this,e):f.type===6&&(v=new a9(c,this,e)),this._$AV.push(v),f=i[++h]}l!==f?.index&&(c=Xi.nextNode(),l++)}return Xi.currentNode=Yi,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 aa{constructor(e,r,n,i){var o;this.type=2,this._$AH=mr,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=Bs(this,e,r),ia(e)?e===mr||e==null||e===""?(this._$AH!==mr&&this._$AR(),this._$AH=mr):e!==this._$AH&&e!==Qi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):e9(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!==mr&&ia(this._$AH)?this._$AA.nextSibling.data=e:this.$(Yi.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=oa.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 r9(o,this),l=c.u(this.options);c.v(n),this.$(l),this._$AH=c}}_$AC(e){let r=m3.get(e.strings);return r===void 0&&m3.set(e.strings,r=new oa(e)),r}T(e){l3(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 aa(this.k(na()),this.k(na()),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 $c{constructor(e,r,n,i,o){this.type=1,this._$AH=mr,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=mr}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=Bs(this,e,r,0),c=!ia(e)||e!==this._$AH&&e!==Qi,c&&(this._$AH=e);else{const l=e;let h,f;for(e=o[0],h=0;h<o.length-1;h++)f=Bs(this,l[n+h],r,h),f===Qi&&(f=this._$AH[h]),c||(c=!ia(f)||f!==this._$AH[h]),f===mr?e=mr:e!==mr&&(e+=(f??"")+o[h+1]),this._$AH[h]=f}c&&!i&&this.j(e)}j(e){e===mr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class n9 extends $c{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===mr?void 0:e}}const i9=Fs?Fs.emptyScript:"";class s9 extends $c{constructor(){super(...arguments),this.type=4}j(e){e&&e!==mr?this.element.setAttribute(this.name,i9):this.element.removeAttribute(this.name)}}class o9 extends $c{constructor(e,r,n,i,o){super(e,r,n,i,o),this.type=5}_$AI(e,r=this){var n;if((e=(n=Bs(this,e,r,0))!==null&&n!==void 0?n:mr)===Qi)return;const i=this._$AH,o=e===mr&&i!==mr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,c=e!==mr&&(i===mr||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 a9{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){Bs(this,e)}}const w3=Ac.litHtmlPolyfillSupport;w3?.(oa,aa),((Wh=Ac.litHtmlVersions)!==null&&Wh!==void 0?Wh:Ac.litHtmlVersions=[]).push("2.7.4");const c9=(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 aa(e.insertBefore(na(),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
|
|
121
|
+
*/var Vh,Kh;class $e extends js{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=c9(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 Qi}}$e.finalized=!0,$e._$litElement$=!0,(Vh=globalThis.litElementHydrateSupport)===null||Vh===void 0||Vh.call(globalThis,{LitElement:$e});const v3=globalThis.litElementPolyfillSupport;v3?.({LitElement:$e}),((Kh=globalThis.litElementVersions)!==null&&Kh!==void 0?Kh: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 l9=(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 Oe(t){return(e,r)=>r!==void 0?((n,i,o)=>{i.constructor.createProperty(o,n)})(t,e,r):l9(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 Gh;((Gh=window.HTMLSlotElement)===null||Gh===void 0?void 0:Gh.prototype.assignedElements)!=null;/**
|
|
138
138
|
* @license
|
|
139
139
|
* Copyright 2017 Google LLC
|
|
140
140
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
141
|
-
*/const
|
|
141
|
+
*/const u9={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},h9=t=>(...e)=>({_$litDirective$:t,values:e});class f9{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=c9(class extends l9{constructor(t){var e;if(super(t),t.type!==a9.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 Qi}});function u9(t,e){t.indexOf(e)===-1&&t.push(e)}const v3=(t,e,r)=>Math.min(Math.max(r,t),e),fn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Ac=t=>typeof t=="number",Fs=t=>Array.isArray(t)&&!Ac(t[0]),h9=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function f9(t,e){return Fs(t)?t[h9(0,t.length,e)]:t}const y3=(t,e,r)=>-r*t+r*e+t,b3=()=>{},_i=t=>t,Gh=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function _3(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Gh(0,e,n);t.push(y3(r,1,i))}}function d9(t){const e=[0];return _3(e,t-1),e}function p9(t,e=d9(t.length),r=_i){const n=t.length,i=n-e.length;return i>0&&_3(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=v3(0,1,Gh(e[c],e[c+1],o));return l=f9(r,c)(l),y3(t[c],t[c+1],l)}}const E3=t=>Array.isArray(t)&&Ac(t[0]),Zh=t=>typeof t=="object"&&!!t.createAnimation,es=t=>typeof t=="function",g9=t=>typeof t=="string",oa={ms:t=>t*1e3,s:t=>t/1e3},x3=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,m9=1e-7,w9=12;function v9(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=x3(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>m9&&++l<w9);return c}function aa(t,e,r,n){if(t===e&&r===n)return _i;const i=o=>v9(o,0,1,t,r);return o=>o===0||o===1?o:x3(i(o),e,n)}const y9=(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 v3(0,1,i/t)},C3={ease:aa(.25,.1,.25,1),"ease-in":aa(.42,0,1,1),"ease-in-out":aa(.42,0,.58,1),"ease-out":aa(0,0,.58,1)},b9=/\((.*?)\)/;function I3(t){if(es(t))return t;if(E3(t))return aa(...t);if(C3[t])return C3[t];if(t.startsWith("steps")){const e=b9.exec(t);if(e){const r=e[1].split(",");return y9(parseFloat(r[0]),r[1].trim())}}return _i}class S3{constructor(e,r=[0,1],{easing:n,duration:i=fn.duration,delay:o=fn.delay,endDelay:c=fn.endDelay,repeat:l=fn.repeat,offset:h,direction:f="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=_i,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((E,_)=>{this.resolve=E,this.reject=_}),n=n||fn.easing,Zh(n)){const E=n.createAnimation(r);n=E.easing,r=E.keyframes||r,i=E.duration||i}this.repeat=l,this.easing=Fs(n)?_i:I3(n),this.updateDuration(i);const v=p9(r,h,Fs(n)?n.map(I3):_i);this.tick=E=>{var _;o=o;let S=0;this.pauseTime!==void 0?S=this.pauseTime:S=(E-this.startTime)*this.rate,this.t=S,S/=1e3,S=Math.max(S-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(S=this.totalDuration);const P=S/this.duration;let j=Math.floor(P),H=P%1;!H&&P>=1&&(H=1),H===1&&j--;const Z=j%2;(f==="reverse"||f==="alternate"&&Z||f==="alternate-reverse"&&!Z)&&(H=1-H);const N=S>=this.totalDuration?1:Math.min(H,1),L=v(this.easing(N));e(L),this.pauseTime===void 0&&(this.playState==="finished"||S>=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 Yh=function(){};process.env.NODE_ENV!=="production"&&(Yh=function(t,e){if(!t)throw new Error(e)});class _9{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Jh=new WeakMap;function O3(t){return Jh.has(t)||Jh.set(t,{transforms:[],values:new Map}),Jh.get(t)}function E9(t,e){return t.has(e)||t.set(e,new _9),t.get(e)}const x9=["","X","Y","Z"],C9=["translate","scale","rotate","skew"],$c={x:"translateX",y:"translateY",z:"translateZ"},D3={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},I9={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:D3,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:_i},skew:D3},ca=new Map,Qh=t=>`--motion-${t}`,Pc=["x","y","z"];C9.forEach(t=>{x9.forEach(e=>{Pc.push(t+e),ca.set(Qh(t+e),I9[t])})});const S9=(t,e)=>Pc.indexOf(t)-Pc.indexOf(e),O9=new Set(Pc),A3=t=>O9.has(t),D9=(t,e)=>{$c[e]&&(e=$c[e]);const{transforms:r}=O3(t);u9(r,e),t.style.transform=A9(r)},A9=t=>t.sort(S9).reduce($9,"").trim(),$9=(t,e)=>`${t} ${e}(var(${Qh(e)}))`,Xh=t=>t.startsWith("--"),$3=new Set;function P9(t){if(!$3.has(t)){$3.add(t);try{const{syntax:e,initialValue:r}=ca.has(t)?ca.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const ef=(t,e)=>document.createElement("div").animate(t,e),P3={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{ef({opacity:[1]})}catch{return!1}return!0},finished:()=>!!ef({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{ef({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},tf={},Bs={};for(const t in P3)Bs[t]=()=>(tf[t]===void 0&&(tf[t]=P3[t]()),tf[t]);const T9=.015,R9=(t,e)=>{let r="";const n=Math.round(e/T9);for(let i=0;i<n;i++)r+=t(Gh(0,n-1,i))+", ";return r.substring(0,r.length-2)},T3=(t,e)=>es(t)?Bs.linearEasing()?`linear(${R9(t,e)})`:fn.easing:E3(t)?N9(t):t,N9=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function L9(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const M9=t=>Array.isArray(t)?t:[t];function rf(t){return $c[t]&&(t=$c[t]),A3(t)?Qh(t):t}const Tc={get:(t,e)=>{e=rf(e);let r=Xh(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=ca.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=rf(e),Xh(e)?t.style.setProperty(e,r):t.style[e]=r}};function R3(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function U9(t,e){var r;let n=e?.toDefaultUnit||_i;const i=t[t.length-1];if(g9(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 j9(){return window.__MOTION_DEV_TOOLS_RECORD}function F9(t,e,r,n={},i){const o=j9(),c=n.record!==!1&&o;let l,{duration:h=fn.duration,delay:f=fn.delay,endDelay:v=fn.endDelay,repeat:E=fn.repeat,easing:_=fn.easing,persist:S=!1,direction:P,offset:j,allowWebkitAcceleration:H=!1}=n;const Z=O3(t),N=A3(e);let L=Bs.waapi();N&&D9(t,e);const $=rf(e),T=E9(Z.values,$),I=ca.get($);return R3(T.animation,!(Zh(_)&&T.generator)&&n.record!==!1),()=>{const d=()=>{var W,ee;return(ee=(W=Tc.get(t,$))!==null&&W!==void 0?W:I?.initialValue)!==null&&ee!==void 0?ee:0};let x=L9(M9(r),d);const J=U9(x,I);if(Zh(_)){const W=_.createAnimation(x,e!=="opacity",d,$,T);_=W.easing,x=W.keyframes||x,h=W.duration||h}if(Xh($)&&(Bs.cssRegisterProperty()?P9($):L=!1),N&&!Bs.linearEasing()&&(es(_)||Fs(_)&&_.some(es))&&(L=!1),L){I&&(x=x.map(de=>Ac(de)?I.toDefaultUnit(de):de)),x.length===1&&(!Bs.partialKeyframes()||c)&&x.unshift(d());const W={delay:oa.ms(f),duration:oa.ms(h),endDelay:oa.ms(v),easing:Fs(_)?void 0:T3(_,h),direction:P,iterations:E+1,fill:"both"};l=t.animate({[$]:x,offset:j,easing:Fs(_)?_.map(de=>T3(de,h)):void 0},W),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=x[x.length-1];l.finished.then(()=>{S||(Tc.set(t,$,ee),l.cancel())}).catch(b3),H||(l.playbackRate=1.000001)}else if(i&&N)x=x.map(W=>typeof W=="string"?parseFloat(W):W),x.length===1&&x.unshift(parseFloat(d())),l=new i(W=>{Tc.set(t,$,J?J(W):W)},x,Object.assign(Object.assign({},n),{duration:h,easing:_}));else{const W=x[x.length-1];Tc.set(t,$,I&&Ac(W)?I.toDefaultUnit(W):W)}return c&&o(t,e,x,{duration:h,delay:f,easing:_,repeat:E,offset:j},"motion-one"),T.setAnimation(l),l}}const B9=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function N3(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 k9=t=>t(),L3=(t,e,r=fn.duration)=>new Proxy({animations:t.map(k9).filter(Boolean),duration:r,options:e},W9),H9=t=>t.animations[0],W9={get:(t,e)=>{const r=H9(t);switch(e){case"duration":return t.duration;case"currentTime":return oa.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(z9)).catch(b3)),t.finished;case"stop":return()=>{t.animations.forEach(n=>R3(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=oa.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},z9=t=>t.finished;function q9(t,e,r){return es(t)?t(e,r):t}function V9(t){return function(r,n,i={}){r=N3(r);const o=r.length;Yh(!!o,"No valid element provided."),Yh(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const h=r[l];for(const f in n){const v=B9(i,f);v.delay=q9(v.delay,l,o);const E=F9(h,f,n[f],v,t);c.push(E)}}return L3(c,i,i.duration)}}const K9=V9(S3);function G9(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 Z9={any:0,all:1};function Y9(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=N3(t),c=new WeakMap,l=f=>{f.forEach(v=>{const E=c.get(v.target);if(v.isIntersecting!==!!E)if(v.isIntersecting){const _=e(v);es(_)?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:Z9[i]});return o.forEach(f=>h.observe(f)),()=>h.disconnect()}function nf(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function M3(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const J9={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=G9(n,["once"]);return Y9(t,c=>{if(e(),M3(t,"viewenter",c),!i)return l=>{r(),M3(t,"viewleave",l)}},o)}},U3=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),nf(t,e,n))};[...Object.keys({inView:J9,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=U3(t,"hoverstart",e),i=U3(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(),nf(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),nf(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function Q9(t,e={}){return L3([()=>{const r=new S3(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function ts(t,e,r){return(es(t)?Q9:K9)(t,e,r)}var la={},X9=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},j3={},Xr={};let sf;const eC=[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];Xr.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},Xr.getSymbolTotalCodewords=function(e){return eC[e]},Xr.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},Xr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');sf=e},Xr.isKanjiModeEnabled=function(){return typeof sf<"u"},Xr.toSJIS=function(e){return sf(e)};var Rc={};(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}}})(Rc);function F3(){this.buffer=[],this.length=0}F3.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 tC=F3;function ua(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)}ua.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},ua.prototype.get=function(t,e){return this.data[t*this.size+e]},ua.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},ua.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var rC=ua,B3={};(function(t){const e=Xr.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}})(B3);var k3={};const nC=Xr.getSymbolSize,H3=7;k3.getPositions=function(e){const r=nC(e);return[[0,0],[r-H3,0],[0,r-H3]]};var W3={};(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,f=null,v=null;for(let E=0;E<o;E++){l=h=0,f=v=null;for(let _=0;_<o;_++){let S=i.get(E,_);S===f?l++:(l>=5&&(c+=e.N1+(l-5)),f=S,l=1),S=i.get(_,E),S===v?h++:(h>=5&&(c+=e.N1+(h-5)),v=S,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 f=i.get(l,h)+i.get(l,h+1)+i.get(l+1,h)+i.get(l+1,h+1);(f===4||f===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,h=0;for(let f=0;f<o;f++){l=h=0;for(let v=0;v<o;v++)l=l<<1&2047|i.get(f,v),v>=10&&(l===1488||l===93)&&c++,h=h<<1&2047|i.get(v,f),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 f=0;f<c;f++){o(f),t.applyMask(f,i);const v=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(f,i),v<h&&(h=v,l=f)}return l}})(W3);var Nc={};const Ei=Rc,Lc=[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],Mc=[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];Nc.getBlocksCount=function(e,r){switch(r){case Ei.L:return Lc[(e-1)*4+0];case Ei.M:return Lc[(e-1)*4+1];case Ei.Q:return Lc[(e-1)*4+2];case Ei.H:return Lc[(e-1)*4+3];default:return}},Nc.getTotalCodewordsCount=function(e,r){switch(r){case Ei.L:return Mc[(e-1)*4+0];case Ei.M:return Mc[(e-1)*4+1];case Ei.Q:return Mc[(e-1)*4+2];case Ei.H:return Mc[(e-1)*4+3];default:return}};var z3={},Uc={};const ha=new Uint8Array(512),jc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ha[r]=e,jc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ha[r]=ha[r-255]})(),Uc.log=function(e){if(e<1)throw new Error("log("+e+")");return jc[e]},Uc.exp=function(e){return ha[e]},Uc.mul=function(e,r){return e===0||r===0?0:ha[jc[e]+jc[r]]},function(t){const e=Uc;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}}(z3);const q3=z3;function of(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}of.prototype.initialize=function(e){this.degree=e,this.genPoly=q3.generateECPolynomial(this.degree)},of.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=q3.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 iC=of,V3={},xi={},af={};af.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var jn={};const K3="[0-9]+",sC="[A-Z $%*+\\-./:]+";let fa="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";fa=fa.replace(/u/g,"\\u");const oC="(?:(?![A-Z0-9 $%*+\\-./:]|"+fa+`)(?:.|[\r
|
|
146
|
-
]))+`;
|
|
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(Z);case e.ALPHANUMERIC:return new n(Z);case e.KANJI:return new o(Z);case e.BYTE:return new i(Z)}}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=j(T,L),d=h.find_path(I.map,"start","end"),x=[];for(let J=1;J<d.length-1;J++)x.push(I.table[d[J]].node);return t.fromArray(S(x))},t.rawSplit=function(N){return t.fromArray(E(N,l.isKanjiModeEnabled()))}}(
|
|
145
|
+
*/const Lr=h9(class extends f9{constructor(t){var e;if(super(t),t.type!==u9.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 Qi}});function d9(t,e){t.indexOf(e)===-1&&t.push(e)}const y3=(t,e,r)=>Math.min(Math.max(r,t),e),hn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Pc=t=>typeof t=="number",ks=t=>Array.isArray(t)&&!Pc(t[0]),p9=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function g9(t,e){return ks(t)?t[p9(0,t.length,e)]:t}const b3=(t,e,r)=>-r*t+r*e+t,_3=()=>{},bi=t=>t,Zh=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function E3(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Zh(0,e,n);t.push(b3(r,1,i))}}function m9(t){const e=[0];return E3(e,t-1),e}function w9(t,e=m9(t.length),r=bi){const n=t.length,i=n-e.length;return i>0&&E3(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=y3(0,1,Zh(e[c],e[c+1],o));return l=g9(r,c)(l),b3(t[c],t[c+1],l)}}const x3=t=>Array.isArray(t)&&Pc(t[0]),Yh=t=>typeof t=="object"&&!!t.createAnimation,es=t=>typeof t=="function",v9=t=>typeof t=="string",ca={ms:t=>t*1e3,s:t=>t/1e3},C3=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,y9=1e-7,b9=12;function _9(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=C3(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>y9&&++l<b9);return c}function la(t,e,r,n){if(t===e&&r===n)return bi;const i=o=>_9(o,0,1,t,r);return o=>o===0||o===1?o:C3(i(o),e,n)}const E9=(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 y3(0,1,i/t)},I3={ease:la(.25,.1,.25,1),"ease-in":la(.42,0,1,1),"ease-in-out":la(.42,0,.58,1),"ease-out":la(0,0,.58,1)},x9=/\((.*?)\)/;function S3(t){if(es(t))return t;if(x3(t))return la(...t);if(I3[t])return I3[t];if(t.startsWith("steps")){const e=x9.exec(t);if(e){const r=e[1].split(",");return E9(parseFloat(r[0]),r[1].trim())}}return bi}class O3{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:f="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=bi,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,Yh(n)){const E=n.createAnimation(r);n=E.easing,r=E.keyframes||r,i=E.duration||i}this.repeat=l,this.easing=ks(n)?bi:S3(n),this.updateDuration(i);const v=w9(r,h,ks(n)?n.map(S3):bi);this.tick=E=>{var _;o=o;let S=0;this.pauseTime!==void 0?S=this.pauseTime:S=(E-this.startTime)*this.rate,this.t=S,S/=1e3,S=Math.max(S-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(S=this.totalDuration);const P=S/this.duration;let j=Math.floor(P),H=P%1;!H&&P>=1&&(H=1),H===1&&j--;const Z=j%2;(f==="reverse"||f==="alternate"&&Z||f==="alternate-reverse"&&!Z)&&(H=1-H);const N=S>=this.totalDuration?1:Math.min(H,1),L=v(this.easing(N));e(L),this.pauseTime===void 0&&(this.playState==="finished"||S>=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 Jh=function(){};process.env.NODE_ENV!=="production"&&(Jh=function(t,e){if(!t)throw new Error(e)});class C9{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Qh=new WeakMap;function D3(t){return Qh.has(t)||Qh.set(t,{transforms:[],values:new Map}),Qh.get(t)}function I9(t,e){return t.has(e)||t.set(e,new C9),t.get(e)}const S9=["","X","Y","Z"],O9=["translate","scale","rotate","skew"],Tc={x:"translateX",y:"translateY",z:"translateZ"},A3={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},D9={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:A3,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:bi},skew:A3},ua=new Map,Xh=t=>`--motion-${t}`,Rc=["x","y","z"];O9.forEach(t=>{S9.forEach(e=>{Rc.push(t+e),ua.set(Xh(t+e),D9[t])})});const A9=(t,e)=>Rc.indexOf(t)-Rc.indexOf(e),$9=new Set(Rc),$3=t=>$9.has(t),P9=(t,e)=>{Tc[e]&&(e=Tc[e]);const{transforms:r}=D3(t);d9(r,e),t.style.transform=T9(r)},T9=t=>t.sort(A9).reduce(R9,"").trim(),R9=(t,e)=>`${t} ${e}(var(${Xh(e)}))`,ef=t=>t.startsWith("--"),P3=new Set;function N9(t){if(!P3.has(t)){P3.add(t);try{const{syntax:e,initialValue:r}=ua.has(t)?ua.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const tf=(t,e)=>document.createElement("div").animate(t,e),T3={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{tf({opacity:[1]})}catch{return!1}return!0},finished:()=>!!tf({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{tf({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},rf={},Hs={};for(const t in T3)Hs[t]=()=>(rf[t]===void 0&&(rf[t]=T3[t]()),rf[t]);const L9=.015,M9=(t,e)=>{let r="";const n=Math.round(e/L9);for(let i=0;i<n;i++)r+=t(Zh(0,n-1,i))+", ";return r.substring(0,r.length-2)},R3=(t,e)=>es(t)?Hs.linearEasing()?`linear(${M9(t,e)})`:hn.easing:x3(t)?U9(t):t,U9=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function j9(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const F9=t=>Array.isArray(t)?t:[t];function nf(t){return Tc[t]&&(t=Tc[t]),$3(t)?Xh(t):t}const Nc={get:(t,e)=>{e=nf(e);let r=ef(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=ua.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=nf(e),ef(e)?t.style.setProperty(e,r):t.style[e]=r}};function N3(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function B9(t,e){var r;let n=e?.toDefaultUnit||bi;const i=t[t.length-1];if(v9(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 k9(){return window.__MOTION_DEV_TOOLS_RECORD}function H9(t,e,r,n={},i){const o=k9(),c=n.record!==!1&&o;let l,{duration:h=hn.duration,delay:f=hn.delay,endDelay:v=hn.endDelay,repeat:E=hn.repeat,easing:_=hn.easing,persist:S=!1,direction:P,offset:j,allowWebkitAcceleration:H=!1}=n;const Z=D3(t),N=$3(e);let L=Hs.waapi();N&&P9(t,e);const $=nf(e),T=I9(Z.values,$),I=ua.get($);return N3(T.animation,!(Yh(_)&&T.generator)&&n.record!==!1),()=>{const d=()=>{var W,ee;return(ee=(W=Nc.get(t,$))!==null&&W!==void 0?W:I?.initialValue)!==null&&ee!==void 0?ee:0};let x=j9(F9(r),d);const J=B9(x,I);if(Yh(_)){const W=_.createAnimation(x,e!=="opacity",d,$,T);_=W.easing,x=W.keyframes||x,h=W.duration||h}if(ef($)&&(Hs.cssRegisterProperty()?N9($):L=!1),N&&!Hs.linearEasing()&&(es(_)||ks(_)&&_.some(es))&&(L=!1),L){I&&(x=x.map(de=>Pc(de)?I.toDefaultUnit(de):de)),x.length===1&&(!Hs.partialKeyframes()||c)&&x.unshift(d());const W={delay:ca.ms(f),duration:ca.ms(h),endDelay:ca.ms(v),easing:ks(_)?void 0:R3(_,h),direction:P,iterations:E+1,fill:"both"};l=t.animate({[$]:x,offset:j,easing:ks(_)?_.map(de=>R3(de,h)):void 0},W),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=x[x.length-1];l.finished.then(()=>{S||(Nc.set(t,$,ee),l.cancel())}).catch(_3),H||(l.playbackRate=1.000001)}else if(i&&N)x=x.map(W=>typeof W=="string"?parseFloat(W):W),x.length===1&&x.unshift(parseFloat(d())),l=new i(W=>{Nc.set(t,$,J?J(W):W)},x,Object.assign(Object.assign({},n),{duration:h,easing:_}));else{const W=x[x.length-1];Nc.set(t,$,I&&Pc(W)?I.toDefaultUnit(W):W)}return c&&o(t,e,x,{duration:h,delay:f,easing:_,repeat:E,offset:j},"motion-one"),T.setAnimation(l),l}}const W9=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function L3(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 z9=t=>t(),M3=(t,e,r=hn.duration)=>new Proxy({animations:t.map(z9).filter(Boolean),duration:r,options:e},V9),q9=t=>t.animations[0],V9={get:(t,e)=>{const r=q9(t);switch(e){case"duration":return t.duration;case"currentTime":return ca.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(K9)).catch(_3)),t.finished;case"stop":return()=>{t.animations.forEach(n=>N3(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=ca.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},K9=t=>t.finished;function G9(t,e,r){return es(t)?t(e,r):t}function Z9(t){return function(r,n,i={}){r=L3(r);const o=r.length;Jh(!!o,"No valid element provided."),Jh(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const h=r[l];for(const f in n){const v=W9(i,f);v.delay=G9(v.delay,l,o);const E=H9(h,f,n[f],v,t);c.push(E)}}return M3(c,i,i.duration)}}const Y9=Z9(O3);function J9(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 Q9={any:0,all:1};function X9(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=L3(t),c=new WeakMap,l=f=>{f.forEach(v=>{const E=c.get(v.target);if(v.isIntersecting!==!!E)if(v.isIntersecting){const _=e(v);es(_)?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:Q9[i]});return o.forEach(f=>h.observe(f)),()=>h.disconnect()}function sf(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function U3(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const eC={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=J9(n,["once"]);return X9(t,c=>{if(e(),U3(t,"viewenter",c),!i)return l=>{r(),U3(t,"viewleave",l)}},o)}},j3=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),sf(t,e,n))};[...Object.keys({inView:eC,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=j3(t,"hoverstart",e),i=j3(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(),sf(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),sf(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function tC(t,e={}){return M3([()=>{const r=new O3(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function ts(t,e,r){return(es(t)?tC:Y9)(t,e,r)}var ha={},rC=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},F3={},Xr={};let of;const nC=[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];Xr.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},Xr.getSymbolTotalCodewords=function(e){return nC[e]},Xr.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},Xr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');of=e},Xr.isKanjiModeEnabled=function(){return typeof of<"u"},Xr.toSJIS=function(e){return of(e)};var Lc={};(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}}})(Lc);function B3(){this.buffer=[],this.length=0}B3.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 iC=B3;function fa(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)}fa.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},fa.prototype.get=function(t,e){return this.data[t*this.size+e]},fa.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},fa.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var sC=fa,k3={};(function(t){const e=Xr.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}})(k3);var H3={};const oC=Xr.getSymbolSize,W3=7;H3.getPositions=function(e){const r=oC(e);return[[0,0],[r-W3,0],[0,r-W3]]};var z3={};(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,f=null,v=null;for(let E=0;E<o;E++){l=h=0,f=v=null;for(let _=0;_<o;_++){let S=i.get(E,_);S===f?l++:(l>=5&&(c+=e.N1+(l-5)),f=S,l=1),S=i.get(_,E),S===v?h++:(h>=5&&(c+=e.N1+(h-5)),v=S,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 f=i.get(l,h)+i.get(l,h+1)+i.get(l+1,h)+i.get(l+1,h+1);(f===4||f===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,h=0;for(let f=0;f<o;f++){l=h=0;for(let v=0;v<o;v++)l=l<<1&2047|i.get(f,v),v>=10&&(l===1488||l===93)&&c++,h=h<<1&2047|i.get(v,f),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 f=0;f<c;f++){o(f),t.applyMask(f,i);const v=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(f,i),v<h&&(h=v,l=f)}return l}})(z3);var Mc={};const _i=Lc,Uc=[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],jc=[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];Mc.getBlocksCount=function(e,r){switch(r){case _i.L:return Uc[(e-1)*4+0];case _i.M:return Uc[(e-1)*4+1];case _i.Q:return Uc[(e-1)*4+2];case _i.H:return Uc[(e-1)*4+3];default:return}},Mc.getTotalCodewordsCount=function(e,r){switch(r){case _i.L:return jc[(e-1)*4+0];case _i.M:return jc[(e-1)*4+1];case _i.Q:return jc[(e-1)*4+2];case _i.H:return jc[(e-1)*4+3];default:return}};var q3={},Fc={};const da=new Uint8Array(512),Bc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)da[r]=e,Bc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)da[r]=da[r-255]})(),Fc.log=function(e){if(e<1)throw new Error("log("+e+")");return Bc[e]},Fc.exp=function(e){return da[e]},Fc.mul=function(e,r){return e===0||r===0?0:da[Bc[e]+Bc[r]]},function(t){const e=Fc;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}}(q3);const V3=q3;function af(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}af.prototype.initialize=function(e){this.degree=e,this.genPoly=V3.generateECPolynomial(this.degree)},af.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=V3.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 aC=af,K3={},Ei={},cf={};cf.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Un={};const G3="[0-9]+",cC="[A-Z $%*+\\-./:]+";let pa="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";pa=pa.replace(/u/g,"\\u");const lC="(?:(?![A-Z0-9 $%*+\\-./:]|"+pa+`)(?:.|[\r
|
|
146
|
+
]))+`;Un.KANJI=new RegExp(pa,"g"),Un.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Un.BYTE=new RegExp(lC,"g"),Un.NUMERIC=new RegExp(G3,"g"),Un.ALPHANUMERIC=new RegExp(cC,"g");const uC=new RegExp("^"+pa+"$"),hC=new RegExp("^"+G3+"$"),fC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Un.testKanji=function(e){return uC.test(e)},Un.testNumeric=function(e){return hC.test(e)},Un.testAlphanumeric=function(e){return fC.test(e)},function(t){const e=cf,r=Un;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}}}(Ei),function(t){const e=Xr,r=Mc,n=Lc,i=Ei,o=cf,c=7973,l=e.getBCHDigit(c);function h(_,S,P){for(let j=1;j<=40;j++)if(S<=t.getCapacity(j,P,_))return j}function f(_,S){return i.getCharCountIndicator(_,S)+4}function v(_,S){let P=0;return _.forEach(function(j){const H=f(j.mode,S);P+=H+j.getBitsLength()}),P}function E(_,S){for(let P=1;P<=40;P++)if(v(_,P)<=t.getCapacity(P,S,i.MIXED))return P}t.from=function(S,P){return o.isValid(S)?parseInt(S,10):P},t.getCapacity=function(S,P,j){if(!o.isValid(S))throw new Error("Invalid QR Code version");typeof j>"u"&&(j=i.BYTE);const H=e.getSymbolTotalCodewords(S),Z=r.getTotalCodewordsCount(S,P),N=(H-Z)*8;if(j===i.MIXED)return N;const L=N-f(j,S);switch(j){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(S,P){let j;const H=n.from(P,n.M);if(Array.isArray(S)){if(S.length>1)return E(S,H);if(S.length===0)return 1;j=S[0]}else j=S;return h(j.mode,j.getLength(),H)},t.getEncodedBits=function(S){if(!o.isValid(S)||S<7)throw new Error("Invalid QR Code version");let P=S<<12;for(;e.getBCHDigit(P)-l>=0;)P^=c<<e.getBCHDigit(P)-l;return S<<12|P}}(K3);var Z3={};const lf=Xr,Y3=1335,dC=21522,J3=lf.getBCHDigit(Y3);Z3.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;lf.getBCHDigit(i)-J3>=0;)i^=Y3<<lf.getBCHDigit(i)-J3;return(n<<10|i)^dC};var Q3={};const pC=Ei;function Ws(t){this.mode=pC.NUMERIC,this.data=t.toString()}Ws.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Ws.prototype.getLength=function(){return this.data.length},Ws.prototype.getBitsLength=function(){return Ws.getBitsLength(this.data.length)},Ws.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 gC=Ws;const mC=Ei,uf=["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 zs(t){this.mode=mC.ALPHANUMERIC,this.data=t}zs.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},zs.prototype.getLength=function(){return this.data.length},zs.prototype.getBitsLength=function(){return zs.getBitsLength(this.data.length)},zs.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=uf.indexOf(this.data[r])*45;n+=uf.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(uf.indexOf(this.data[r]),6)};var wC=zs,vC=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 yC=vC,bC=Ei;function qs(t){this.mode=bC.BYTE,typeof t=="string"&&(t=yC(t)),this.data=new Uint8Array(t)}qs.getBitsLength=function(e){return e*8},qs.prototype.getLength=function(){return this.data.length},qs.prototype.getBitsLength=function(){return qs.getBitsLength(this.data.length)},qs.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var _C=qs;const EC=Ei,xC=Xr;function Vs(t){this.mode=EC.KANJI,this.data=t}Vs.getBitsLength=function(e){return e*13},Vs.prototype.getLength=function(){return this.data.length},Vs.prototype.getBitsLength=function(){return Vs.getBitsLength(this.data.length)},Vs.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=xC.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 CC=Vs,X3={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,f,v,E,_,S,P,j,H;!l.empty();){h=l.pop(),f=h.value,E=h.cost,_=r[f]||{};for(v in _)_.hasOwnProperty(v)&&(S=_[v],P=E+S,j=c[v],H=typeof c[v]>"u",(H||j>P)&&(c[v]=P,l.push(v,P),o[v]=f))}if(typeof i<"u"&&typeof c[i]>"u"){var Z=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(Z)}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})(X3),function(t){const e=Ei,r=gC,n=wC,i=_C,o=CC,c=Un,l=Xr,h=X3.exports;function f(Z){return unescape(encodeURIComponent(Z)).length}function v(Z,N,L){const $=[];let T;for(;(T=Z.exec(L))!==null;)$.push({data:T[0],index:T.index,mode:N,length:T[0].length});return $}function E(Z){const N=v(c.NUMERIC,e.NUMERIC,Z),L=v(c.ALPHANUMERIC,e.ALPHANUMERIC,Z);let $,T;return l.isKanjiModeEnabled()?($=v(c.BYTE,e.BYTE,Z),T=v(c.KANJI,e.KANJI,Z)):($=v(c.BYTE_KANJI,e.BYTE,Z),T=[]),N.concat(L,$,T).sort(function(d,x){return d.index-x.index}).map(function(d){return{data:d.data,mode:d.mode,length:d.length}})}function _(Z,N){switch(N){case e.NUMERIC:return r.getBitsLength(Z);case e.ALPHANUMERIC:return n.getBitsLength(Z);case e.KANJI:return o.getBitsLength(Z);case e.BYTE:return i.getBitsLength(Z)}}function S(Z){return Z.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(Z){const N=[];for(let L=0;L<Z.length;L++){const $=Z[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:f($.data)}]);break;case e.BYTE:N.push([{data:$.data,mode:e.BYTE,length:f($.data)}])}}return N}function j(Z,N){const L={},$={start:{}};let T=["start"];for(let I=0;I<Z.length;I++){const d=Z[I],x=[];for(let J=0;J<d.length;J++){const W=d[J],ee=""+I+J;x.push(ee),L[ee]={node:W,lastCount:0},$[ee]={};for(let de=0;de<T.length;de++){const me=T[de];L[me]&&L[me].node.mode===W.mode?($[me][ee]=_(L[me].lastCount+W.length,W.mode)-_(L[me].lastCount,W.mode),L[me].lastCount+=W.length):(L[me]&&(L[me].lastCount=W.length),$[me][ee]=_(W.length,W.mode)+4+e.getCharCountIndicator(W.mode,N))}}T=x}for(let I=0;I<T.length;I++)$[T[I]].end=0;return{map:$,table:L}}function H(Z,N){let L;const $=e.getBestModeForData(Z);if(L=e.from(N,$),L!==e.BYTE&&L.bit<$.bit)throw new Error('"'+Z+'" 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(Z);case e.ALPHANUMERIC:return new n(Z);case e.KANJI:return new o(Z);case e.BYTE:return new i(Z)}}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=j(T,L),d=h.find_path(I.map,"start","end"),x=[];for(let J=1;J<d.length-1;J++)x.push(I.table[d[J]].node);return t.fromArray(S(x))},t.rawSplit=function(N){return t.fromArray(E(N,l.isKanjiModeEnabled()))}}(Q3);const kc=Xr,hf=Lc,IC=iC,SC=sC,OC=k3,DC=H3,ff=z3,df=Mc,AC=aC,Hc=K3,$C=Z3,PC=Ei,pf=Q3;function TC(t,e){const r=t.size,n=DC.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 RC(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 NC(t,e){const r=OC.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 LC(t,e){const r=t.size,n=Hc.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 gf(t,e,r){const n=t.size,i=$C.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 MC(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 f=!1;c<e.length&&(f=(e[c]>>>o&1)===1),t.set(i,l-h,f),o--,o===-1&&(c++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function UC(t,e,r){const n=new IC;r.forEach(function(h){n.put(h.mode.bit,4),n.put(h.getLength(),PC.getCharCountIndicator(h.mode,t)),h.write(n)});const i=kc.getSymbolTotalCodewords(t),o=df.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 jC(n,t,e)}function jC(t,e,r){const n=kc.getSymbolTotalCodewords(e),i=df.getTotalCodewordsCount(e,r),o=n-i,c=df.getBlocksCount(e,r),l=n%c,h=c-l,f=Math.floor(n/c),v=Math.floor(o/c),E=v+1,_=f-v,S=new AC(_);let P=0;const j=new Array(c),H=new Array(c);let Z=0;const N=new Uint8Array(t.buffer);for(let d=0;d<c;d++){const x=d<h?v:E;j[d]=N.slice(P,P+x),H[d]=S.encode(j[d]),P+=x,Z=Math.max(Z,x)}const L=new Uint8Array(n);let $=0,T,I;for(T=0;T<Z;T++)for(I=0;I<c;I++)T<j[I].length&&(L[$++]=j[I][T]);for(T=0;T<_;T++)for(I=0;I<c;I++)L[$++]=H[I][T];return L}function FC(t,e,r,n){let i;if(Array.isArray(t))i=pf.fromArray(t);else if(typeof t=="string"){let f=e;if(!f){const v=pf.rawSplit(t);f=Hc.getBestVersionForData(v,r)}i=pf.fromString(t,f||40)}else throw new Error("Invalid data");const o=Hc.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 FC=X9,wf=j3,rm=X3,BC=em;function vf(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!FC())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,f){try{const v=wf.create(r,n);h(t(v,e,n))}catch(v){f(v)}})}try{const h=wf.create(r,n);i(null,t(h,e,n))}catch(h){i(h)}}la.create=wf.create,la.toCanvas=vf.bind(null,rm.render),la.toDataURL=vf.bind(null,rm.renderToDataURL),la.toString=vf.bind(null,function(t,e,r){return BC.render(t,r)});var kC=Object.defineProperty,nm=Object.getOwnPropertySymbols,HC=Object.prototype.hasOwnProperty,WC=Object.prototype.propertyIsEnumerable,im=(t,e,r)=>e in t?kC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,kc=(t,e)=>{for(var r in e||(e={}))HC.call(e,r)&&im(t,r,e[r]);if(nm)for(var r of nm(e))WC.call(e,r)&&im(t,r,e[r]);return t};function zC(){var t;const e=(t=Un.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 sm(){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 qC(){const{themeVariables:t}=Un.state;return{"--w3m-background-image-url":t!=null&&t["--w3m-background-image-url"]?`url(${t["--w3m-background-image-url"]})`:"none"}}const Fe={getPreset(t){return sm()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=Un.state;if(t){const r=kc(kc(kc(kc({},zC()),sm()),e),qC());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)}`},VC=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 KC=Object.defineProperty,GC=Object.getOwnPropertyDescriptor,Hc=(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 qs=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>`}};qs.styles=[Fe.globalCss,VC],Hc([Oe()],qs.prototype,"icon",2),Hc([Oe()],qs.prototype,"label",2),Hc([Oe()],qs.prototype,"onClick",2),qs=Hc([Ne("w3m-box-button")],qs);const ZC=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 YC=Object.defineProperty,JC=Object.getOwnPropertyDescriptor,Vs=(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&&YC(e,r,i),i};let Ci=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>`}};Ci.styles=[Fe.globalCss,ZC],Vs([Oe()],Ci.prototype,"disabled",2),Vs([Oe()],Ci.prototype,"iconLeft",2),Vs([Oe()],Ci.prototype,"iconRight",2),Vs([Oe()],Ci.prototype,"onClick",2),Vs([Oe()],Ci.prototype,"variant",2),Ci=Vs([Ne("w3m-button")],Ci);const QC=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 XC=Object.defineProperty,eI=Object.getOwnPropertyDescriptor,yf=(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&&XC(e,r,i),i};let da=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>`}};da.styles=[Fe.globalCss,QC],yf([Oe()],da.prototype,"disabled",2),yf([Oe()],da.prototype,"variant",2),da=yf([Ne("w3m-button-big")],da);const tI=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 rI=Object.defineProperty,nI=Object.getOwnPropertyDescriptor,iI=(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 bf=class extends $e{render(){return oe`<div><slot></slot></div>`}};bf.styles=[Fe.globalCss,tI],bf=iI([Ne("w3m-info-footer")],bf);const Le={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>`},sI=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 oI=Object.defineProperty,aI=Object.getOwnPropertyDescriptor,om=(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 Wc=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=Un.state.themeVariables)==null?void 0:t["--w3m-logo-image-url"];return e?oe`<img src="${e}">`:Le.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}">${Le.HELP_ICON}</button> <button @click="${Nr.close}">${Le.CROSS_ICON}</button></div></div>`}};Wc.styles=[Fe.globalCss,sI],om([gt()],Wc.prototype,"isHelp",2),Wc=om([Ne("w3m-modal-backcard")],Wc);const cI=Ve`main{padding:20px;padding-top:0;width:100%}`;var lI=Object.defineProperty,uI=Object.getOwnPropertyDescriptor,hI=(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 _f=class extends $e{render(){return oe`<main><slot></slot></main>`}};_f.styles=[Fe.globalCss,cI],_f=hI([Ne("w3m-modal-content")],_f);const fI=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 dI=Object.defineProperty,pI=Object.getOwnPropertyDescriptor,gI=(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 Ef=class extends $e{render(){return oe`<footer><slot></slot></footer>`}};Ef.styles=[Fe.globalCss,fI],Ef=gI([Ne("w3m-modal-footer")],Ef);const mI=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 wI=Object.defineProperty,vI=Object.getOwnPropertyDescriptor,pa=(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&&wI(e,r,i),i};let rs=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}">${Le.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>`}};rs.styles=[Fe.globalCss,mI],pa([Oe()],rs.prototype,"title",2),pa([Oe()],rs.prototype,"onAction",2),pa([Oe()],rs.prototype,"actionIcon",2),pa([Oe()],rs.prototype,"border",2),rs=pa([Ne("w3m-modal-header")],rs);const yI={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"},bI={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"}},en={externalWallets(){const{isStandalone:t}=Ae.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=en.recentWallet())==null?void 0:t.id,o=Se.isMobile()?r:n,c=o?.filter(l=>i!==l.id);return(e=Se.isMobile()?c?.map(({id:l,name:h,links:f})=>({id:l,name:h,mobile:f,links:f})):c?.map(({id:l,name:h,links:f})=>({id:l,name:h,desktop:f,links:f})))!=null?e:[]},installedInjectedWallets(){const{isStandalone:t}=Ae.state;if(t)return[];if(!Nt.client().isInjectedProviderInstalled())return[];const{namespace:e}=Nt.client(),{injectedWallets:r}=rr.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}=Ae.state,{explorerExcludedWalletIds:e,explorerRecommendedWalletIds:r}=jt.state,n=Se.isMobile();if(t||e==="ALL"||n)return[];const{namespace:i}=Nt.client(),{injectedWallets:o}=rr.state;return o.filter(({id:c,injected:l})=>{const h=Se.isArray(e)?e:[],f=Se.isArray(r)?r:[];return!!l.some(v=>v.namespace===i&&!h.includes(c)&&!f.includes(c))})},recentWallet(){return xe.getRecentWallet()},recomendedWallets(t=!1){var e;const r=en.installedInjectedWallets().map(({id:c})=>c),n=t||(e=en.recentWallet())==null?void 0:e.id,i=[...r,n],{recomendedWallets:o}=rr.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}=Ae.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?rr.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e?t.split(" ")[0]:t},getChainIcon(t){var e;const r=yI[t],{projectId:n,chainImages:i}=jt.state;return(e=i?.[t])!=null?e:n&&r?rr.getAssetImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=bI[t])==null?void 0:e.icon,{projectId:i,tokenImages:o}=jt.state;return(r=o?.[t])!=null?r:i&&n?rr.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,Se.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}=Ae.state,{pairingUri:r}=ur.state,{mobile:n,name:i}=t,o=n?.native,c=n?.universal;xe.setRecentWallet(t);function l(h){let f="";o?f=Se.formatUniversalUrl(o,h,i):c&&(f=Se.formatNativeUrl(c,h,i)),Se.openHref(f,"_self")}l(e||r)},handleAndroidLinking(){const{standaloneUri:t}=Ae.state,{pairingUri:e}=ur.state;t?(Se.setWalletConnectAndroidDeepLink(t),Se.openHref(t,"_self")):(Se.setWalletConnectAndroidDeepLink(e),Se.openHref(e,"_self"))},async handleUriCopy(){const{standaloneUri:t}=Ae.state,{pairingUri:e}=ur.state;t?await navigator.clipboard.writeText(t):await navigator.clipboard.writeText(e),qr.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=Ae.state;await Nt.client().connectConnector(t,r?.id),Nr.close()}catch(r){console.error(r),e?e():qr.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 f=c>>h*8&255;l[h]=f}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}=Ae.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}=Ae.state,r=JSON.parse(t);if(r[e])return r[e]}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Se.openHref(xe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{id:t,desktop:e,mobile:r,injected:n}=Se.getWalletRouterData(),i=en.installedInjectedWallets(),o=!!(n!=null&&n.length),c=i.some(v=>v.id===t),l=!!(e!=null&&e.native),h=!!(e!=null&&e.universal),f=!!(r!=null&&r.native)||!!(r!=null&&r.universal);return{isInjectedInstalled:c,isInjected:o,isDesktop:l,isMobile:f,isWeb:h}},goToConnectingView(t){tt.setData({Wallet:t});const e=Se.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")}},_I=Ve`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var EI=Object.defineProperty,xI=Object.getOwnPropertyDescriptor,xf=(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 ga=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"&&ts(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 ts(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=tt.state.view,ts(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>`}};ga.styles=[Fe.globalCss,_I],xf([gt()],ga.prototype,"view",2),xf([gt()],ga.prototype,"prevView",2),ga=xf([Ne("w3m-modal-router")],ga);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 II=Object.defineProperty,SI=Object.getOwnPropertyDescriptor,am=(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&&II(e,r,i),i};let zc=class extends $e{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=qr.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>qr.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),qr.closeToast()}render(){const{message:t,variant:e}=qr.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?oe`<div class="${Lr(r)}">${e==="success"?Le.CHECKMARK_ICON:null} ${e==="error"?Le.CROSS_ICON:null}<w3m-text variant="small-regular">${t}</w3m-text></div>`:null}};zc.styles=[Fe.globalCss,CI],am([gt()],zc.prototype,"open",2),zc=am([Ne("w3m-modal-toast")],zc);const OI=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,AI=Object.getOwnPropertyDescriptor,ma=(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&&DI(e,r,i),i};let ns=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>`}};ns.styles=[Fe.globalCss,OI],ma([Oe()],ns.prototype,"onClick",2),ma([Oe()],ns.prototype,"name",2),ma([Oe()],ns.prototype,"chainId",2),ma([Oe()],ns.prototype,"unsupported",2),ns=ma([Ne("w3m-network-button")],ns);const $I=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 PI=Object.defineProperty,TI=Object.getOwnPropertyDescriptor,cm=(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 qc=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`${Le.NETWORK_PLACEHOLDER}`}};qc.styles=[Fe.globalCss,$I],cm([Oe()],qc.prototype,"chainId",2),qc=cm([Ne("w3m-network-image")],qc);const RI=.1,lm=2.5,Jn=7;function Cf(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+RI}function NI(t,e){const r=Array.prototype.slice.call(la.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 LI={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",o=n==="light"?"#fff":"#141414",c=[],l=NI(t,"Q"),h=e/l.length,f=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];f.forEach(({x:j,y:H})=>{const Z=(l.length-Jn)*h*j,N=(l.length-Jn)*h*H,L=.32;for(let $=0;$<f.length;$+=1){const T=h*(Jn-$*2);c.push(ut`<rect fill="${$%2===0?i:o}" height="${T}" rx="${T*L}" ry="${T*L}" width="${T}" x="${Z+h*$}" y="${N+h*$}">`)}});const v=Math.floor((r+25)/h),E=l.length/2-v/2,_=l.length/2+v/2-1,S=[];l.forEach((j,H)=>{j.forEach((Z,N)=>{if(l[H][N]&&!(H<Jn&&N<Jn||H>l.length-(Jn+1)&&N<Jn||H<Jn&&N>l.length-(Jn+1))&&!(H>E&&H<_&&N>E&&N<_)){const L=H*h+h/2,$=N*h+h/2;S.push([L,$])}})});const P={};return S.forEach(([j,H])=>{P[j]?P[j].push(H):P[j]=[H]}),Object.entries(P).map(([j,H])=>{const Z=H.filter(N=>H.every(L=>!Cf(N,L,h)));return[Number(j),Z]}).forEach(([j,H])=>{H.forEach(Z=>{c.push(ut`<circle cx="${j}" cy="${Z}" fill="${i}" r="${h/lm}">`)})}),Object.entries(P).filter(([j,H])=>H.length>1).map(([j,H])=>{const Z=H.filter(N=>H.some(L=>Cf(N,L,h)));return[Number(j),Z]}).map(([j,H])=>{H.sort((N,L)=>N<L?-1:1);const Z=[];for(const N of H){const L=Z.find($=>$.some(T=>Cf(N,T,h)));L?L.push(N):Z.push([N])}return[j,Z.map(N=>[N[0],N[N.length-1]])]}).forEach(([j,H])=>{H.forEach(([Z,N])=>{c.push(ut`<line x1="${j}" x2="${j}" y1="${Z}" y2="${N}" stroke="${i}" stroke-width="${h/(lm/2)}" stroke-linecap="round">`)})}),c}},MI=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 UI=Object.defineProperty,jI=Object.getOwnPropertyDescriptor,Ks=(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 Qn=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=Un.state.themeMode)!=null?t:"light";return ut`<svg height="${this.size}" width="${this.size}">${LI.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>`:Le.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}<w3m-theme-context></w3m-theme-context></div>`}};Qn.styles=[Fe.globalCss,MI],Ks([Oe()],Qn.prototype,"uri",2),Ks([Oe({type:Number})],Qn.prototype,"size",2),Ks([Oe()],Qn.prototype,"imageId",2),Ks([Oe()],Qn.prototype,"walletId",2),Ks([Oe()],Qn.prototype,"imageUrl",2),Qn=Ks([Ne("w3m-qrcode")],Qn);const FI=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:var(--w3m-color-fg-1);background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);caret-color:var(--w3m-accent-color)}input::placeholder{color:var(--w3m-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var BI=Object.defineProperty,kI=Object.getOwnPropertyDescriptor,um=(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 Vc=class extends $e{constructor(){super(...arguments),this.onChange=()=>null}render(){return oe`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Le.SEARCH_ICON}`}};Vc.styles=[Fe.globalCss,FI],um([Oe()],Vc.prototype,"onChange",2),Vc=um([Ne("w3m-search-input")],Vc);const HI=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 WI=Object.defineProperty,zI=Object.getOwnPropertyDescriptor,qI=(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&&WI(e,r,i),i};let If=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>`}};If.styles=[Fe.globalCss,HI],If=qI([Ne("w3m-spinner")],If);const VI=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 KI=Object.defineProperty,GI=Object.getOwnPropertyDescriptor,Sf=(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 wa=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>`}};wa.styles=[Fe.globalCss,VI],Sf([Oe()],wa.prototype,"variant",2),Sf([Oe()],wa.prototype,"color",2),wa=Sf([Ne("w3m-text")],wa);const ZI=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 YI=Object.defineProperty,JI=Object.getOwnPropertyDescriptor,hm=(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 Kc=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>`:Le.TOKEN_PLACEHOLDER}};Kc.styles=[Fe.globalCss,ZI],hm([Oe()],Kc.prototype,"symbol",2),Kc=hm([Ne("w3m-token-image")],Kc);const QI=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 XI=Object.defineProperty,eS=Object.getOwnPropertyDescriptor,Ii=(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&&XI(e,r,i),i};let Fn=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(){vi.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>`}};Fn.styles=[Fe.globalCss,QI],Ii([Oe()],Fn.prototype,"onClick",2),Ii([Oe()],Fn.prototype,"name",2),Ii([Oe()],Fn.prototype,"walletId",2),Ii([Oe()],Fn.prototype,"label",2),Ii([Oe()],Fn.prototype,"imageId",2),Ii([Oe()],Fn.prototype,"installed",2),Ii([Oe()],Fn.prototype,"recent",2),Fn=Ii([Ne("w3m-wallet-button")],Fn);const tS=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 rS=Object.defineProperty,nS=Object.getOwnPropertyDescriptor,Gc=(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 Gs=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>`:Le.WALLET_PLACEHOLDER}`}};Gs.styles=[Fe.globalCss,tS],Gc([Oe()],Gs.prototype,"walletId",2),Gc([Oe()],Gs.prototype,"imageId",2),Gc([Oe()],Gs.prototype,"imageUrl",2),Gs=Gc([Ne("w3m-wallet-image")],Gs);var iS=Object.defineProperty,sS=Object.getOwnPropertyDescriptor,oS=(t,e,r,n)=>{for(var i=n>1?void 0:n?sS(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&&iS(e,r,i),i};let fm=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?vi.track({name:"ACCOUNT_CONNECTED"}):r&&!t.isConnected&&vi.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=Ae.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),qr.openToast(xe.getErrorMessage(n),"error")}}async fetchBalance(t){if(jt.state.enableAccountView)try{await Et.fetchBalance(t)}catch(e){console.error(e),qr.openToast(xe.getErrorMessage(e),"error")}}};fm=oS([Ne("w3m-account-context")],fm);var aS=Object.defineProperty,cS=Object.getOwnPropertyDescriptor,dm=(t,e,r,n)=>{for(var i=n>1?void 0:n?cS(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&&aS(e,r,i),i};let Of=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}=Ae.state;await Promise.all([rr.getRecomendedWallets(),rr.getInjectedWallets()]),Ae.setIsDataLoaded(!0);const{recomendedWallets:r}=rr.state,n=en.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 Ae.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),qr.openToast("Failed preloading","error")}}};dm([gt()],Of.prototype,"preload",2),Of=dm([Ne("w3m-explorer-context")],Of);var lS=Object.defineProperty,uS=Object.getOwnPropertyDescriptor,pm=(t,e,r,n)=>{for(var i=n>1?void 0:n?uS(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&&lS(e,r,i),i};let Df=class extends $e{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const t=Ae.getSelectedChain();this.activeChainId=t?.id,this.unwatchNetwork=Nt.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(Ae.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),qr.openToast(xe.getErrorMessage(t),"error")}}};pm([gt()],Df.prototype,"activeChainId",2),Df=pm([Ne("w3m-network-context")],Df);var hS=Object.defineProperty,fS=Object.getOwnPropertyDescriptor,dS=(t,e,r,n)=>{for(var i=n>1?void 0:n?fS(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&&hS(e,r,i),i};let gm=class extends $e{constructor(){super(),this.unsubscribeTheme=void 0,Fe.setTheme(),this.unsubscribeTheme=Un.subscribe(Fe.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=Un.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")}}};gm=dS([Ne("w3m-theme-context")],gm);var pS=Object.defineProperty,gS=Object.getOwnPropertyDescriptor,mS=(t,e,r,n)=>{for(var i=n>1?void 0:n?gS(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&&pS(e,r,i),i};const wS=24e4,vS=1e3;var mm;let wm=class extends $e{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=(mm=Ae.state.selectedChain)==null?void 0:mm.id,this.isAccountConnected=Et.state.isConnected,this.lastRetry=Date.now(),this.unwatchOptions=Ae.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))})}disconnectedCallback(){var t,e;(t=this.unwatchOptions)==null||t.call(this),(e=this.unwatchAccount)==null||e.call(this)}async connectAndWait(){if(clearTimeout(this.timeout),!this.isAccountConnected){this.isGenerated=!0,this.timeout=setTimeout(this.connectAndWait.bind(this),wS);try{const{standaloneUri:t,selectedChain:e}=Ae.state;t?ur.setPairingUri(t):await Nt.client().connectWalletConnect(r=>ur.setPairingUri(r),e?.id)}catch(t){console.error(t),ur.setPairingError(!0),qr.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=vS&&(this.lastRetry=Date.now(),this.connectAndWait())}}}};wm=mS([Ne("w3m-wc-connection-context")],wm);const yS=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 bS=Object.defineProperty,_S=Object.getOwnPropertyDescriptor,Af=(t,e,r,n)=>{for(var i=n>1?void 0:n?_S(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&&bS(e,r,i),i};let Zs=class extends $e{constructor(){super(),this.balance="hide",this.avatar="show",xe.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=Ae.state;t||(vi.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>`}};Zs.styles=[Fe.globalCss,yS],Af([Oe()],Zs.prototype,"balance",2),Af([Oe()],Zs.prototype,"avatar",2),Zs=Af([Ne("w3m-account-button")],Zs);const ES=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 xS=Object.defineProperty,CS=Object.getOwnPropertyDescriptor,$f=(t,e,r,n)=>{for(var i=n>1?void 0:n?CS(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&&xS(e,r,i),i};let va=class extends $e{constructor(){super(),this.chainId=0,this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=Ae.state;this.chainId=t?.id,this.label=t?.name,this.unsubscribeNetwork=Ae.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}=Ae.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>`}};va.styles=[Fe.globalCss,ES],$f([gt()],va.prototype,"chainId",2),$f([gt()],va.prototype,"label",2),va=$f([Ne("w3m-account-network-button")],va);const IS=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 SS=Object.defineProperty,OS=Object.getOwnPropertyDescriptor,ya=(t,e,r,n)=>{for(var i=n>1?void 0:n?OS(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&&SS(e,r,i),i};let is=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>`}};is.styles=[Fe.globalCss,IS],ya([gt()],is.prototype,"address",2),ya([gt()],is.prototype,"name",2),ya([gt()],is.prototype,"loading",2),ya([Oe()],is.prototype,"variant",2),is=ya([Ne("w3m-address-text")],is);const Mr={onConnecting(t){xe.goToConnectingView(t)},onExternal(t){xe.handleConnectorConnection(t)},manualWalletsTemplate(){return en.manualWallets().map(t=>oe`<w3m-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},recomendedWalletsTemplate(t=!1){return en.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 en.externalWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${()=>this.onExternal(t.id)}"></w3m-wallet-button>`)},recentWalletTemplate(){const t=en.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 en.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 en.injectedWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)}},DS=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 AS=Object.defineProperty,$S=Object.getOwnPropertyDescriptor,PS=(t,e,r,n)=>{for(var i=n>1?void 0:n?$S(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&&AS(e,r,i),i};let Pf=class extends $e{onGoToQrcode(){tt.push("Qrcode")}onGetWallet(){tt.push("GetWallet")}render(){const{recomendedWallets:t}=rr.state,e=[...t,...t],r=Mr.externalWalletsTemplate(),n=Mr.installedInjectedWalletsTemplate(),i=[...n,...r].length>0,o=Se.RECOMMENDED_WALLET_AMOUNT*2;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Le.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-title">${Le.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>`:Le.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">${Le.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="${Le.ARROW_UP_RIGHT_ICON}" .onClick="${()=>this.onGetWallet()}">I don't have a wallet</w3m-button></w3m-info-footer>`}};Pf.styles=[Fe.globalCss,DS],Pf=PS([Ne("w3m-android-wallet-selection")],Pf);const TS=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 RS=Object.defineProperty,NS=Object.getOwnPropertyDescriptor,ba=(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 ss=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}};ss.styles=[Fe.globalCss,TS],ba([gt()],ss.prototype,"address",2),ba([gt()],ss.prototype,"avatar",2),ba([gt()],ss.prototype,"loading",2),ba([Oe()],ss.prototype,"size",2),ss=ba([Ne("w3m-avatar")],ss);const LS=Ve`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var MS=Object.defineProperty,US=Object.getOwnPropertyDescriptor,Tf=(t,e,r,n)=>{for(var i=n>1?void 0:n?US(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&&MS(e,r,i),i};let _a=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=this.amount.substring(0,6):typeof this.amount=="string"&&(t=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>`}};_a.styles=[Fe.globalCss,LS],Tf([gt()],_a.prototype,"symbol",2),Tf([gt()],_a.prototype,"amount",2),_a=Tf([Ne("w3m-balance")],_a);const jS=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 FS=Object.defineProperty,BS=Object.getOwnPropertyDescriptor,Zc=(t,e,r,n)=>{for(var i=n>1?void 0:n?BS(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&&FS(e,r,i),i};let os=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"?Le.WALLET_CONNECT_ICON:null}onClick(){Et.state.isConnected?this.onDisconnect():this.onConnect()}async onConnect(){this.loading=!0,vi.click({name:"CONNECT_BUTTON"}),await Nr.open(),Nr.state.open||(this.loading=!1)}async onDisconnect(){vi.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>`}};os.styles=[Fe.globalCss,jS],Zc([gt()],os.prototype,"loading",2),Zc([Oe()],os.prototype,"label",2),Zc([Oe()],os.prototype,"icon",2),os=Zc([Ne("w3m-connect-button")],os);const kS=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 HS=Object.defineProperty,WS=Object.getOwnPropertyDescriptor,Ys=(t,e,r,n)=>{for(var i=n>1?void 0:n?WS(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&&HS(e,r,i),i};let Si=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=Un.state.themeVariables)==null?void 0:t["--w3m-wallet-icon-large-border-radius"])!=null?e:Fe.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>`}};Si.styles=[Fe.globalCss,kS],Ys([Oe()],Si.prototype,"walletId",2),Ys([Oe()],Si.prototype,"imageId",2),Ys([Oe()],Si.prototype,"isError",2),Ys([Oe()],Si.prototype,"isStale",2),Ys([Oe()],Si.prototype,"label",2),Si=Ys([Ne("w3m-connector-waiting")],Si);var zS=Object.defineProperty,qS=Object.getOwnPropertyDescriptor,Js=(t,e,r,n)=>{for(var i=n>1?void 0:n?qS(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&&zS(e,r,i),i};let Oi=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>`}};Js([gt()],Oi.prototype,"isConnected",2),Js([Oe()],Oi.prototype,"label",2),Js([Oe()],Oi.prototype,"icon",2),Js([Oe()],Oi.prototype,"avatar",2),Js([Oe()],Oi.prototype,"balance",2),Oi=Js([Ne("w3m-core-button")],Oi);const VS=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 KS=Object.defineProperty,GS=Object.getOwnPropertyDescriptor,ZS=(t,e,r,n)=>{for(var i=n>1?void 0:n?GS(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&&KS(e,r,i),i};let Rf=class extends $e{render(){const{isStandalone:t}=Ae.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 f=[l,...i,...o];t||(f=[...h,l,...c,...i,...o]),f=f.filter(Boolean);const v=f.length>4||n;let E=[];v?E=f.slice(0,3):E=f;const _=!!E.length;return oe`<w3m-modal-header .border="${!0}" title="Connect your wallet" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${Le.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${Le.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">${Le.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}`}};Rf.styles=[Fe.globalCss,VS],Rf=ZS([Ne("w3m-desktop-wallet-selection")],Rf);const YS=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 JS=Object.defineProperty,QS=Object.getOwnPropertyDescriptor,XS=(t,e,r,n)=>{for(var i=n>1?void 0:n?QS(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&&JS(e,r,i),i};let Nf=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}};Nf.styles=[Fe.globalCss,YS],Nf=XS([Ne("w3m-legal-notice")],Nf);const eO=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var tO=Object.defineProperty,rO=Object.getOwnPropertyDescriptor,nO=(t,e,r,n)=>{for(var i=n>1?void 0:n?rO(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&&tO(e,r,i),i};let Lf=class extends $e{onQrcode(){tt.push("Qrcode")}render(){const{isStandalone:t}=Ae.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 f=[l,...i,...o];t||(f=[...h,l,...c,...i,...o]),f=f.filter(Boolean);const v=f.length>8||n;let E=[];v?E=f.slice(0,7):E=f;const _=!!E.length;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Le.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}`}};Lf.styles=[Fe.globalCss,eO],Lf=nO([Ne("w3m-mobile-wallet-selection")],Lf);const iO=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 sO=Object.defineProperty,oO=Object.getOwnPropertyDescriptor,Mf=(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&&sO(e,r,i),i};let Qs=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([ts(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,ts(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([ts(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,ts(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}=Ae.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>`}};Qs.styles=[Fe.globalCss,iO],Mf([gt()],Qs.prototype,"open",2),Mf([gt()],Qs.prototype,"active",2),Qs=Mf([Ne("w3m-modal")],Qs);const aO=Ve`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var cO=Object.defineProperty,lO=Object.getOwnPropertyDescriptor,Yc=(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&&cO(e,r,i),i};let as=class extends $e{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,xe.rejectStandaloneButtonComponent();const{selectedChain:t}=Ae.state;this.onSetChainData(t),this.unsubscribeNetwork=Ae.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=Ae.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(){vi.click({name:"NETWORK_BUTTON"}),Nr.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=Ae.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>`}};as.styles=[Fe.globalCss,aO],Yc([gt()],as.prototype,"chainId",2),Yc([gt()],as.prototype,"label",2),Yc([gt()],as.prototype,"wrongNetwork",2),as=Yc([Ne("w3m-network-switch")],as);const uO=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 hO=Object.defineProperty,fO=Object.getOwnPropertyDescriptor,Jc=(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&&hO(e,r,i),i};let Xs=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>`}};Xs.styles=[Fe.globalCss,uO],Jc([Oe()],Xs.prototype,"chainId",2),Jc([Oe()],Xs.prototype,"isError",2),Jc([Oe()],Xs.prototype,"label",2),Xs=Jc([Ne("w3m-network-waiting")],Xs);const dO=Ve`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var pO=Object.defineProperty,gO=Object.getOwnPropertyDescriptor,cs=(t,e,r,n)=>{for(var i=n>1?void 0:n?gO(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 Xn=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(){Se.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}=Ae.state;return oe`<div>${this.isRetry?oe`<slot></slot>`:null} ${this.isMobile?oe`<w3m-button .onClick="${this.onMobile}" .iconLeft="${Le.MOBILE_ICON}" variant="outline">Mobile</w3m-button>`:null} ${this.isInjected&&!t?oe`<w3m-button .onClick="${this.onInjected}" .iconLeft="${Le.WALLET_ICON}" variant="outline">Browser</w3m-button>`:null} ${this.isDesktop?oe`<w3m-button .onClick="${this.onDesktop}" .iconLeft="${Le.DESKTOP_ICON}" variant="outline">Desktop</w3m-button>`:null} ${this.isWeb?oe`<w3m-button .onClick="${this.onWeb}" .iconLeft="${Le.GLOBE_ICON}" variant="outline">Web</w3m-button>`:null}</div>`}};Xn.styles=[Fe.globalCss,dO],cs([Oe()],Xn.prototype,"isMobile",2),cs([Oe()],Xn.prototype,"isInjected",2),cs([Oe()],Xn.prototype,"isInjectedInstalled",2),cs([Oe()],Xn.prototype,"isDesktop",2),cs([Oe()],Xn.prototype,"isWeb",2),cs([Oe()],Xn.prototype,"isRetry",2),Xn=cs([Ne("w3m-platform-selection")],Xn);const mO=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 wO=Object.defineProperty,vO=Object.getOwnPropertyDescriptor,yO=(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 Uf=class extends $e{onClick(){tt.push("WalletExplorer")}render(){const{recomendedWallets:t}=rr.state,e=en.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}">`:Le.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Le.WALLET_PLACEHOLDER)}</div><w3m-text variant="xsmall-regular">View All</w3m-text></button>`}};Uf.styles=[Fe.globalCss,mO],Uf=yO([Ne("w3m-view-all-wallets-button")],Uf);const bO=Ve`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var _O=Object.defineProperty,EO=Object.getOwnPropertyDescriptor,Qc=(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&&_O(e,r,i),i};let eo=class extends $e{constructor(){super(),this.walletId="",this.imageId="",this.uri="",this.unwatchWcConnection=void 0,setTimeout(()=>{const{pairingUri:t}=ur.state,{standaloneUri:e}=Ae.state;this.uri=e??t},0),this.unwatchWcConnection=ur.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>`}};eo.styles=[Fe.globalCss,bO],Qc([Oe()],eo.prototype,"walletId",2),Qc([Oe()],eo.prototype,"imageId",2),Qc([gt()],eo.prototype,"uri",2),eo=Qc([Ne("w3m-walletconnect-qr")],eo);const xO=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 CO=Object.defineProperty,IO=Object.getOwnPropertyDescriptor,SO=(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&&CO(e,r,i),i};let jf=class extends $e{async onDisconnect(){await Nt.client().disconnect()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=Et.state.address)!=null?t:""),qr.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="${Le.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${Le.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};jf.styles=[Fe.globalCss,xO],jf=SO([Ne("w3m-account-view")],jf);var OO=Object.defineProperty,DO=Object.getOwnPropertyDescriptor,AO=(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&&OO(e,r,i),i};let Ff=class extends $e{viewTemplate(){return Se.isAndroid()?oe`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Se.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>`}};Ff.styles=[Fe.globalCss],Ff=AO([Ne("w3m-connect-wallet-view")],Ff);const $O=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var PO=Object.defineProperty,TO=Object.getOwnPropertyDescriptor,vm=(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 Xc=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openDesktopApp(),this.unwatchConnection=ur.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Se.getWalletRouterData(),n=e?.native;if(n){const i=Se.formatNativeUrl(n,t,r);Se.openHref(i,"_self")}}openDesktopApp(){ur.setPairingError(!1);const{standaloneUri:t}=Ae.state,{pairingUri:e}=ur.state,r=Se.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isMobile:n,isInjected:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.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="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};Xc.styles=[Fe.globalCss,$O],vm([gt()],Xc.prototype,"isError",2),Xc=vm([Ne("w3m-desktop-connecting-view")],Xc);const RO=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 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 Bf=class extends $e{onGet(t){Se.openHref(t,"_blank")}render(){const t=rr.state.recomendedWallets.slice(0,5),e=en.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="${Le.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="${Le.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="${Le.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Bf.styles=[Fe.globalCss,RO],Bf=MO([Ne("w3m-get-wallet-view")],Bf);const UO=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 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 kf=class extends $e{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){jt.state.enableExplorer?tt.push("GetWallet"):xe.openWalletExplorerUrl()}onLearnMore(){Se.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">${Le.HELP_CHART_IMG} ${Le.HELP_PAINTING_IMG} ${Le.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">${Le.HELP_KEY_IMG} ${Le.HELP_USER_IMG} ${Le.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">${Le.HELP_COMPAS_IMG} ${Le.HELP_NOUN_IMG} ${Le.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="${Le.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${Le.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};kf.styles=[Fe.globalCss,UO],kf=BO([Ne("w3m-help-view")],kf);const kO=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var HO=Object.defineProperty,WO=Object.getOwnPropertyDescriptor,ym=(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&&HO(e,r,i),i};let el=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}=Se.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="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};el.styles=[Fe.globalCss,kO],ym([gt()],el.prototype,"isError",2),el=ym([Ne("w3m-injected-connecting-view")],el);const zO=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 qO=Object.defineProperty,VO=Object.getOwnPropertyDescriptor,KO=(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 Hf=class extends $e{onInstall(t){t&&Se.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:n}=Se.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="${Le.ARROW_DOWN_ICON}">Download</w3m-button></w3m-info-footer>`}};Hf.styles=[Fe.globalCss,zO],Hf=KO([Ne("w3m-install-wallet-view")],Hf);const GO=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{margin-top:-15px}.w3m-note w3m-text{margin-top:15px}.w3m-note w3m-text span{color:var(--w3m-accent-color)}`;var ZO=Object.defineProperty,YO=Object.getOwnPropertyDescriptor,bm=(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 tl=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openMobileApp(),this.unwatchConnection=ur.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}=Se.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!e){const c=Se.formatNativeUrl(i,t,n);Se.openHref(c,"_self")}else if(o){const c=Se.formatUniversalUrl(o,t,n);Se.openHref(c,"_self")}}openMobileApp(t=!1){ur.setPairingError(!1);const{standaloneUri:e}=Ae.state,{pairingUri:r}=ur.state,n=Se.getWalletRouterData();xe.setRecentWallet(n),e?this.onFormatAndRedirect(e,t):this.onFormatAndRedirect(r,t)}onGoToAppStore(t){t&&Se.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:n,mobile:i}=Se.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-platform-selection .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection>${l?oe`<w3m-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></w3m-text>`:null}</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="${Le.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</w3m-button></w3m-info-footer>`}};tl.styles=[Fe.globalCss,GO],bm([gt()],tl.prototype,"isError",2),tl=bm([Ne("w3m-mobile-connecting-view")],tl);const JO=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var QO=Object.defineProperty,XO=Object.getOwnPropertyDescriptor,eD=(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&&QO(e,r,i),i};let Wf=class extends $e{render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isInjected:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.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 QR Code 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>`}};Wf.styles=[Fe.globalCss,JO],Wf=eD([Ne("w3m-mobile-qr-connecting-view")],Wf);var tD=Object.defineProperty,rD=Object.getOwnPropertyDescriptor,nD=(t,e,r,n)=>{for(var i=n>1?void 0:n?rD(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&&tD(e,r,i),i};let zf=class extends $e{render(){return oe`<w3m-modal-header title="Scan the code" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};zf.styles=[Fe.globalCss],zf=nD([Ne("w3m-qrcode-view")],zf);const iD=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 _m=Object.defineProperty,sD=Object.defineProperties,oD=Object.getOwnPropertyDescriptor,aD=Object.getOwnPropertyDescriptors,Em=Object.getOwnPropertySymbols,cD=Object.prototype.hasOwnProperty,lD=Object.prototype.propertyIsEnumerable,xm=(t,e,r)=>e in t?_m(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,uD=(t,e)=>{for(var r in e||(e={}))cD.call(e,r)&&xm(t,r,e[r]);if(Em)for(var r of Em(e))lD.call(e,r)&&xm(t,r,e[r]);return t},hD=(t,e)=>sD(t,aD(e)),qf=(t,e,r,n)=>{for(var i=n>1?void 0:n?oD(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&&_m(e,r,i),i};let Ea=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}=Ae.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?(Ae.setSelectedChain(t),Nr.close()):(Ae.setSelectedChain(t),tt.push("ConnectWallet"))}catch(e){console.error(e),qr.openToast("Unsupported chain","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}=Ae.state,e=t?.map(n=>hD(uD({},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}`}};Ea.styles=[Fe.globalCss,iD],qf([gt()],Ea.prototype,"connectedChains",2),qf([gt()],Ea.prototype,"isUnsupportedChains",2),Ea=qf([Ne("w3m-select-network-view")],Ea);const fD=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 dD=Object.defineProperty,pD=Object.getOwnPropertyDescriptor,Cm=(t,e,r,n)=>{for(var i=n>1?void 0:n?pD(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&&dD(e,r,i),i};let rl=class extends $e{constructor(){super(),this.isError=!1,this.onSwitchNetwork()}async onSwitchNetwork(){try{this.isError=!1;const t=Se.getSwitchNetworkRouterData();await Nt.client().switchNetwork({chainId:t.id}),Ae.setSelectedChain(t),tt.reset("Account")}catch{this.isError=!0}}render(){const{id:t,name:e}=Se.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="${Le.RETRY_ICON}">Try Again</w3m-button></w3m-info-footer>`}};rl.styles=[Fe.globalCss,fD],Cm([gt()],rl.prototype,"isError",2),rl=Cm([Ne("w3m-switch-network-view")],rl);const gD=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 mD=Object.defineProperty,wD=Object.getOwnPropertyDescriptor,xa=(t,e,r,n)=>{for(var i=n>1?void 0:n?wD(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&&mD(e,r,i),i};const Vf=40;let ls=class extends $e{constructor(){super(...arguments),this.loading=!rr.state.wallets.listings.length,this.firstFetch=!rr.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,rr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),rr.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}=rr.state,{listings:r,total:n}=this.search?e:t;return n<=Vf||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r,injectedWallets:n}=rr.state,{listings:i,total:o,page:c}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>Vf&&i.length<o))try{this.loading=!0;const l=(t=Ae.state.standaloneChains)==null?void 0:t.join(","),{listings:h}=await rr.getWallets({page:this.firstFetch?1:c+1,entries:Vf,search:this.search,version:Ae.state.walletConnectVersion,chains:l}),f=h.map(E=>xe.getWalletIcon(E)),v=n.map(E=>xe.getWalletIcon(E));await Promise.all([...f.map(async E=>xe.preloadImage(E)),...v.map(async E=>xe.preloadImage(E)),Se.wait(300)]),this.endReached=this.isLastPage()}catch(l){console.error(l),qr.openToast(xe.getErrorMessage(l),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Se.isAndroid()?xe.handleMobileLinking(t):xe.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=rr.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,f=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(f)].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>`}};ls.styles=[Fe.globalCss,gD],xa([gt()],ls.prototype,"loading",2),xa([gt()],ls.prototype,"firstFetch",2),xa([gt()],ls.prototype,"search",2),xa([gt()],ls.prototype,"endReached",2),ls=xa([Ne("w3m-wallet-explorer-view")],ls);const vD=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var yD=Object.defineProperty,bD=Object.getOwnPropertyDescriptor,Im=(t,e,r,n)=>{for(var i=n>1?void 0:n?bD(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&&yD(e,r,i),i};let nl=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openWebWallet(),this.unwatchConnection=ur.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Se.getWalletRouterData(),n=e?.universal;if(n){const i=Se.formatUniversalUrl(n,t,r);Se.openHref(i,"_blank")}}openWebWallet(){ur.setPairingError(!1);const{standaloneUri:t}=Ae.state,{pairingUri:e}=ur.state,r=Se.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isMobile:n,isInjected:i,isDesktop:o}=xe.getCachedRouterWalletPlatforms(),c=Se.isMobile();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.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="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};nl.styles=[Fe.globalCss,vD],Im([gt()],nl.prototype,"isError",2),nl=Im([Ne("w3m-web-connecting-view")],nl);var _D=Object.freeze({__proto__:null,get W3mAccountButton(){return Zs},get W3mConnectButton(){return os},get W3mCoreButton(){return Oi},get W3mModal(){return Qs},get W3mNetworkSwitch(){return as},get W3mQrCode(){return Qn}});En.EthereumProvider=mx,En.OPTIONAL_EVENTS=Fg,En.OPTIONAL_METHODS=jg,En.REQUIRED_EVENTS=vc,En.REQUIRED_METHODS=wc,En.default=bc,Object.defineProperty(En,"__esModule",{value:!0})});
|
|
151
|
+
`);const c=UC(e,r,i),l=kc.getSymbolSize(e),h=new SC(l);return TC(h,e),RC(h),NC(h,e),gf(h,r,0),e>=7&&LC(h,e),MC(h,c),isNaN(n)&&(n=ff.getBestMask(h,gf.bind(null,h,r))),ff.applyMask(n,h),gf(h,r,n),{modules:h,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}F3.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=hf.M,i,o;return typeof r<"u"&&(n=hf.from(r.errorCorrectionLevel,hf.M),i=Hc.from(r.version),o=ff.from(r.maskPattern),r.toSJISFunc&&kc.setToSJISFunction(r.toSJISFunc)),FC(e,i,n,o)};var em={},mf={};(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),f=Math.floor((c+o.margin*2)*h),v=o.margin*h,E=[o.color.light,o.color.dark];for(let _=0;_<f;_++)for(let S=0;S<f;S++){let P=(_*f+S)*4,j=o.color.light;if(_>=v&&S>=v&&_<f-v&&S<f-v){const H=Math.floor((_-v)/h),Z=Math.floor((S-v)/h);j=E[l[H*c+Z]?1:0]}n[P++]=j.r,n[P++]=j.g,n[P++]=j.b,n[P]=j.a}}})(mf),function(t){const e=mf;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,f=c;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),c||(f=n()),h=e.getOptions(h);const v=e.getImageWidth(o.modules.size,h),E=f.getContext("2d"),_=E.createImageData(v,v);return e.qrToImageData(_.data,o,h),r(E,f,v),E.putImageData(_,0,0),f},t.renderToDataURL=function(o,c,l){let h=l;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),h||(h={});const f=t.render(o,c,h),v=h.type||"image/png",E=h.rendererOpts||{};return f.toDataURL(v,E.quality)}}(em);var tm={};const BC=mf;function rm(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function wf(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function kC(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),f=Math.floor(l/e);!h&&!o&&(o=!0),t[l]?(c++,l>0&&h>0&&t[l-1]||(n+=o?wf("M",h+r,.5+f+r):wf("m",i,0),i=0,o=!1),h+1<e&&t[l+1]||(n+=wf("h",c),c=0)):i++}return n}tm.render=function(e,r,n){const i=BC.getOptions(r),o=e.modules.size,c=e.modules.data,l=o+i.margin*2,h=i.color.light.a?"<path "+rm(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",f="<path "+rm(i.color.dark,"stroke")+' d="'+kC(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+f+`</svg>
|
|
152
|
+
`;return typeof n=="function"&&n(null,_),_};const HC=rC,vf=F3,nm=em,WC=tm;function yf(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!HC())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,f){try{const v=vf.create(r,n);h(t(v,e,n))}catch(v){f(v)}})}try{const h=vf.create(r,n);i(null,t(h,e,n))}catch(h){i(h)}}ha.create=vf.create,ha.toCanvas=yf.bind(null,nm.render),ha.toDataURL=yf.bind(null,nm.renderToDataURL),ha.toString=yf.bind(null,function(t,e,r){return WC.render(t,r)});var zC=Object.defineProperty,im=Object.getOwnPropertySymbols,qC=Object.prototype.hasOwnProperty,VC=Object.prototype.propertyIsEnumerable,sm=(t,e,r)=>e in t?zC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wc=(t,e)=>{for(var r in e||(e={}))qC.call(e,r)&&sm(t,r,e[r]);if(im)for(var r of im(e))VC.call(e,r)&&sm(t,r,e[r]);return t};function KC(){var t;const e=(t=Mn.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 om(){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 GC(){const{themeVariables:t}=Mn.state;return{"--w3m-background-image-url":t!=null&&t["--w3m-background-image-url"]?`url(${t["--w3m-background-image-url"]})`:"none"}}const Fe={getPreset(t){return om()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=Mn.state;if(t){const r=Wc(Wc(Wc(Wc({},KC()),om()),e),GC());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)}`},ZC=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 YC=Object.defineProperty,JC=Object.getOwnPropertyDescriptor,zc=(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&&YC(e,r,i),i};let Ks=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>`}};Ks.styles=[Fe.globalCss,ZC],zc([Oe()],Ks.prototype,"icon",2),zc([Oe()],Ks.prototype,"label",2),zc([Oe()],Ks.prototype,"onClick",2),Ks=zc([Ne("w3m-box-button")],Ks);const QC=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 XC=Object.defineProperty,eI=Object.getOwnPropertyDescriptor,Gs=(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&&XC(e,r,i),i};let xi=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>`}};xi.styles=[Fe.globalCss,QC],Gs([Oe()],xi.prototype,"disabled",2),Gs([Oe()],xi.prototype,"iconLeft",2),Gs([Oe()],xi.prototype,"iconRight",2),Gs([Oe()],xi.prototype,"onClick",2),Gs([Oe()],xi.prototype,"variant",2),xi=Gs([Ne("w3m-button")],xi);const tI=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 rI=Object.defineProperty,nI=Object.getOwnPropertyDescriptor,bf=(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 ga=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>`}};ga.styles=[Fe.globalCss,tI],bf([Oe()],ga.prototype,"disabled",2),bf([Oe()],ga.prototype,"variant",2),ga=bf([Ne("w3m-button-big")],ga);const iI=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 sI=Object.defineProperty,oI=Object.getOwnPropertyDescriptor,aI=(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&&sI(e,r,i),i};let _f=class extends $e{render(){return oe`<div><slot></slot></div>`}};_f.styles=[Fe.globalCss,iI],_f=aI([Ne("w3m-info-footer")],_f);const Le={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>`},cI=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 lI=Object.defineProperty,uI=Object.getOwnPropertyDescriptor,am=(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 qc=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=Mn.state.themeVariables)==null?void 0:t["--w3m-logo-image-url"];return e?oe`<img src="${e}">`:Le.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}">${Le.HELP_ICON}</button> <button @click="${Nr.close}">${Le.CROSS_ICON}</button></div></div>`}};qc.styles=[Fe.globalCss,cI],am([gt()],qc.prototype,"isHelp",2),qc=am([Ne("w3m-modal-backcard")],qc);const hI=Ve`main{padding:20px;padding-top:0;width:100%}`;var fI=Object.defineProperty,dI=Object.getOwnPropertyDescriptor,pI=(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 Ef=class extends $e{render(){return oe`<main><slot></slot></main>`}};Ef.styles=[Fe.globalCss,hI],Ef=pI([Ne("w3m-modal-content")],Ef);const gI=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 mI=Object.defineProperty,wI=Object.getOwnPropertyDescriptor,vI=(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 xf=class extends $e{render(){return oe`<footer><slot></slot></footer>`}};xf.styles=[Fe.globalCss,gI],xf=vI([Ne("w3m-modal-footer")],xf);const yI=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 bI=Object.defineProperty,_I=Object.getOwnPropertyDescriptor,ma=(t,e,r,n)=>{for(var i=n>1?void 0:n?_I(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 rs=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}">${Le.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>`}};rs.styles=[Fe.globalCss,yI],ma([Oe()],rs.prototype,"title",2),ma([Oe()],rs.prototype,"onAction",2),ma([Oe()],rs.prototype,"actionIcon",2),ma([Oe()],rs.prototype,"border",2),rs=ma([Ne("w3m-modal-header")],rs);const EI={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"},xI={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"}},en={externalWallets(){const{isStandalone:t}=Ae.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=en.recentWallet())==null?void 0:t.id,o=Se.isMobile()?r:n,c=o?.filter(l=>i!==l.id);return(e=Se.isMobile()?c?.map(({id:l,name:h,links:f})=>({id:l,name:h,mobile:f,links:f})):c?.map(({id:l,name:h,links:f})=>({id:l,name:h,desktop:f,links:f})))!=null?e:[]},installedInjectedWallets(){const{isStandalone:t}=Ae.state;if(t)return[];if(!Nt.client().isInjectedProviderInstalled())return[];const{namespace:e}=Nt.client(),{injectedWallets:r}=rr.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}=Ae.state,{explorerExcludedWalletIds:e,explorerRecommendedWalletIds:r}=jt.state,n=Se.isMobile();if(t||e==="ALL"||n)return[];const{namespace:i}=Nt.client(),{injectedWallets:o}=rr.state;return o.filter(({id:c,injected:l})=>{const h=Se.isArray(e)?e:[],f=Se.isArray(r)?r:[];return!!l.some(v=>v.namespace===i&&!h.includes(c)&&!f.includes(c))})},recentWallet(){return xe.getRecentWallet()},recomendedWallets(t=!1){var e;const r=en.installedInjectedWallets().map(({id:c})=>c),n=t||(e=en.recentWallet())==null?void 0:e.id,i=[...r,n],{recomendedWallets:o}=rr.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}=Ae.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?rr.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e?t.split(" ")[0]:t},getChainIcon(t){var e;const r=EI[t],{projectId:n,chainImages:i}=jt.state;return(e=i?.[t])!=null?e:n&&r?rr.getAssetImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=xI[t])==null?void 0:e.icon,{projectId:i,tokenImages:o}=jt.state;return(r=o?.[t])!=null?r:i&&n?rr.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,Se.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}=Ae.state,{pairingUri:r}=ur.state,{mobile:n,name:i}=t,o=n?.native,c=n?.universal;xe.setRecentWallet(t);function l(h){let f="";o?f=Se.formatUniversalUrl(o,h,i):c&&(f=Se.formatNativeUrl(c,h,i)),Se.openHref(f,"_self")}l(e||r)},handleAndroidLinking(){const{standaloneUri:t}=Ae.state,{pairingUri:e}=ur.state;t?(Se.setWalletConnectAndroidDeepLink(t),Se.openHref(t,"_self")):(Se.setWalletConnectAndroidDeepLink(e),Se.openHref(e,"_self"))},async handleUriCopy(){const{standaloneUri:t}=Ae.state,{pairingUri:e}=ur.state;t?await navigator.clipboard.writeText(t):await navigator.clipboard.writeText(e),qr.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=Ae.state;await Nt.client().connectConnector(t,r?.id),Nr.close()}catch(r){console.error(r),e?e():qr.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 f=c>>h*8&255;l[h]=f}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}=Ae.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}=Ae.state,r=JSON.parse(t);if(r[e])return r[e]}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Se.openHref(xe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{id:t,desktop:e,mobile:r,injected:n}=Se.getWalletRouterData(),i=en.installedInjectedWallets(),o=!!(n!=null&&n.length),c=i.some(v=>v.id===t),l=!!(e!=null&&e.native),h=!!(e!=null&&e.universal),f=!!(r!=null&&r.native)||!!(r!=null&&r.universal);return{isInjectedInstalled:c,isInjected:o,isDesktop:l,isMobile:f,isWeb:h}},goToConnectingView(t){tt.setData({Wallet:t});const e=Se.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")}},CI=Ve`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var II=Object.defineProperty,SI=Object.getOwnPropertyDescriptor,Cf=(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&&II(e,r,i),i};let wa=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"&&ts(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 ts(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=tt.state.view,ts(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>`}};wa.styles=[Fe.globalCss,CI],Cf([gt()],wa.prototype,"view",2),Cf([gt()],wa.prototype,"prevView",2),wa=Cf([Ne("w3m-modal-router")],wa);const OI=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 DI=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,cm=(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&&DI(e,r,i),i};let Vc=class extends $e{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=qr.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>qr.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),qr.closeToast()}render(){const{message:t,variant:e}=qr.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?oe`<div class="${Lr(r)}">${e==="success"?Le.CHECKMARK_ICON:null} ${e==="error"?Le.CROSS_ICON:null}<w3m-text variant="small-regular">${t}</w3m-text></div>`:null}};Vc.styles=[Fe.globalCss,OI],cm([gt()],Vc.prototype,"open",2),Vc=cm([Ne("w3m-modal-toast")],Vc);const $I=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 PI=Object.defineProperty,TI=Object.getOwnPropertyDescriptor,va=(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 ns=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>`}};ns.styles=[Fe.globalCss,$I],va([Oe()],ns.prototype,"onClick",2),va([Oe()],ns.prototype,"name",2),va([Oe()],ns.prototype,"chainId",2),va([Oe()],ns.prototype,"unsupported",2),ns=va([Ne("w3m-network-button")],ns);const RI=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 NI=Object.defineProperty,LI=Object.getOwnPropertyDescriptor,lm=(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 Kc=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`${Le.NETWORK_PLACEHOLDER}`}};Kc.styles=[Fe.globalCss,RI],lm([Oe()],Kc.prototype,"chainId",2),Kc=lm([Ne("w3m-network-image")],Kc);const MI=.1,um=2.5,Yn=7;function If(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+MI}function UI(t,e){const r=Array.prototype.slice.call(ha.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 jI={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",o=n==="light"?"#fff":"#141414",c=[],l=UI(t,"Q"),h=e/l.length,f=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];f.forEach(({x:j,y:H})=>{const Z=(l.length-Yn)*h*j,N=(l.length-Yn)*h*H,L=.32;for(let $=0;$<f.length;$+=1){const T=h*(Yn-$*2);c.push(ut`<rect fill="${$%2===0?i:o}" height="${T}" rx="${T*L}" ry="${T*L}" width="${T}" x="${Z+h*$}" y="${N+h*$}">`)}});const v=Math.floor((r+25)/h),E=l.length/2-v/2,_=l.length/2+v/2-1,S=[];l.forEach((j,H)=>{j.forEach((Z,N)=>{if(l[H][N]&&!(H<Yn&&N<Yn||H>l.length-(Yn+1)&&N<Yn||H<Yn&&N>l.length-(Yn+1))&&!(H>E&&H<_&&N>E&&N<_)){const L=H*h+h/2,$=N*h+h/2;S.push([L,$])}})});const P={};return S.forEach(([j,H])=>{P[j]?P[j].push(H):P[j]=[H]}),Object.entries(P).map(([j,H])=>{const Z=H.filter(N=>H.every(L=>!If(N,L,h)));return[Number(j),Z]}).forEach(([j,H])=>{H.forEach(Z=>{c.push(ut`<circle cx="${j}" cy="${Z}" fill="${i}" r="${h/um}">`)})}),Object.entries(P).filter(([j,H])=>H.length>1).map(([j,H])=>{const Z=H.filter(N=>H.some(L=>If(N,L,h)));return[Number(j),Z]}).map(([j,H])=>{H.sort((N,L)=>N<L?-1:1);const Z=[];for(const N of H){const L=Z.find($=>$.some(T=>If(N,T,h)));L?L.push(N):Z.push([N])}return[j,Z.map(N=>[N[0],N[N.length-1]])]}).forEach(([j,H])=>{H.forEach(([Z,N])=>{c.push(ut`<line x1="${j}" x2="${j}" y1="${Z}" y2="${N}" stroke="${i}" stroke-width="${h/(um/2)}" stroke-linecap="round">`)})}),c}},FI=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 BI=Object.defineProperty,kI=Object.getOwnPropertyDescriptor,Zs=(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 Jn=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=Mn.state.themeMode)!=null?t:"light";return ut`<svg height="${this.size}" width="${this.size}">${jI.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>`:Le.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}<w3m-theme-context></w3m-theme-context></div>`}};Jn.styles=[Fe.globalCss,FI],Zs([Oe()],Jn.prototype,"uri",2),Zs([Oe({type:Number})],Jn.prototype,"size",2),Zs([Oe()],Jn.prototype,"imageId",2),Zs([Oe()],Jn.prototype,"walletId",2),Zs([Oe()],Jn.prototype,"imageUrl",2),Jn=Zs([Ne("w3m-qrcode")],Jn);const HI=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:var(--w3m-color-fg-1);background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);caret-color:var(--w3m-accent-color)}input::placeholder{color:var(--w3m-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var WI=Object.defineProperty,zI=Object.getOwnPropertyDescriptor,hm=(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&&WI(e,r,i),i};let Gc=class extends $e{constructor(){super(...arguments),this.onChange=()=>null}render(){return oe`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Le.SEARCH_ICON}`}};Gc.styles=[Fe.globalCss,HI],hm([Oe()],Gc.prototype,"onChange",2),Gc=hm([Ne("w3m-search-input")],Gc);const qI=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 VI=Object.defineProperty,KI=Object.getOwnPropertyDescriptor,GI=(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 Sf=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>`}};Sf.styles=[Fe.globalCss,qI],Sf=GI([Ne("w3m-spinner")],Sf);const ZI=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 YI=Object.defineProperty,JI=Object.getOwnPropertyDescriptor,Of=(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 ya=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>`}};ya.styles=[Fe.globalCss,ZI],Of([Oe()],ya.prototype,"variant",2),Of([Oe()],ya.prototype,"color",2),ya=Of([Ne("w3m-text")],ya);const QI=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 XI=Object.defineProperty,eS=Object.getOwnPropertyDescriptor,fm=(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&&XI(e,r,i),i};let Zc=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>`:Le.TOKEN_PLACEHOLDER}};Zc.styles=[Fe.globalCss,QI],fm([Oe()],Zc.prototype,"symbol",2),Zc=fm([Ne("w3m-token-image")],Zc);const tS=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 rS=Object.defineProperty,nS=Object.getOwnPropertyDescriptor,Ci=(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 jn=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(){wi.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>`}};jn.styles=[Fe.globalCss,tS],Ci([Oe()],jn.prototype,"onClick",2),Ci([Oe()],jn.prototype,"name",2),Ci([Oe()],jn.prototype,"walletId",2),Ci([Oe()],jn.prototype,"label",2),Ci([Oe()],jn.prototype,"imageId",2),Ci([Oe()],jn.prototype,"installed",2),Ci([Oe()],jn.prototype,"recent",2),jn=Ci([Ne("w3m-wallet-button")],jn);const iS=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 sS=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,Yc=(t,e,r,n)=>{for(var i=n>1?void 0:n?oS(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&&sS(e,r,i),i};let Ys=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>`:Le.WALLET_PLACEHOLDER}`}};Ys.styles=[Fe.globalCss,iS],Yc([Oe()],Ys.prototype,"walletId",2),Yc([Oe()],Ys.prototype,"imageId",2),Yc([Oe()],Ys.prototype,"imageUrl",2),Ys=Yc([Ne("w3m-wallet-image")],Ys);var aS=Object.defineProperty,cS=Object.getOwnPropertyDescriptor,lS=(t,e,r,n)=>{for(var i=n>1?void 0:n?cS(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&&aS(e,r,i),i};let dm=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?wi.track({name:"ACCOUNT_CONNECTED"}):r&&!t.isConnected&&wi.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=Ae.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),qr.openToast(xe.getErrorMessage(n),"error")}}async fetchBalance(t){if(jt.state.enableAccountView)try{await Et.fetchBalance(t)}catch(e){console.error(e),qr.openToast(xe.getErrorMessage(e),"error")}}};dm=lS([Ne("w3m-account-context")],dm);var uS=Object.defineProperty,hS=Object.getOwnPropertyDescriptor,pm=(t,e,r,n)=>{for(var i=n>1?void 0:n?hS(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&&uS(e,r,i),i};let Df=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}=Ae.state;await Promise.all([rr.getRecomendedWallets(),rr.getInjectedWallets()]),Ae.setIsDataLoaded(!0);const{recomendedWallets:r}=rr.state,n=en.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 Ae.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),qr.openToast("Failed preloading","error")}}};pm([gt()],Df.prototype,"preload",2),Df=pm([Ne("w3m-explorer-context")],Df);var fS=Object.defineProperty,dS=Object.getOwnPropertyDescriptor,gm=(t,e,r,n)=>{for(var i=n>1?void 0:n?dS(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&&fS(e,r,i),i};let Af=class extends $e{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const t=Ae.getSelectedChain();this.activeChainId=t?.id,this.unwatchNetwork=Nt.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(Ae.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),qr.openToast(xe.getErrorMessage(t),"error")}}};gm([gt()],Af.prototype,"activeChainId",2),Af=gm([Ne("w3m-network-context")],Af);var pS=Object.defineProperty,gS=Object.getOwnPropertyDescriptor,mS=(t,e,r,n)=>{for(var i=n>1?void 0:n?gS(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&&pS(e,r,i),i};let mm=class extends $e{constructor(){super(),this.unsubscribeTheme=void 0,Fe.setTheme(),this.unsubscribeTheme=Mn.subscribe(Fe.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=Mn.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")}}};mm=mS([Ne("w3m-theme-context")],mm);var wS=Object.defineProperty,vS=Object.getOwnPropertyDescriptor,yS=(t,e,r,n)=>{for(var i=n>1?void 0:n?vS(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&&wS(e,r,i),i};const bS=24e4,_S=1e3;var wm;let vm=class extends $e{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=(wm=Ae.state.selectedChain)==null?void 0:wm.id,this.isAccountConnected=Et.state.isConnected,this.lastRetry=Date.now(),this.unwatchOptions=Ae.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))})}disconnectedCallback(){var t,e;(t=this.unwatchOptions)==null||t.call(this),(e=this.unwatchAccount)==null||e.call(this)}async connectAndWait(){if(clearTimeout(this.timeout),!this.isAccountConnected){this.isGenerated=!0,this.timeout=setTimeout(this.connectAndWait.bind(this),bS);try{const{standaloneUri:t,selectedChain:e}=Ae.state;t?ur.setPairingUri(t):await Nt.client().connectWalletConnect(r=>ur.setPairingUri(r),e?.id)}catch(t){console.error(t),ur.setPairingError(!0),qr.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=_S&&(this.lastRetry=Date.now(),this.connectAndWait())}}}};vm=yS([Ne("w3m-wc-connection-context")],vm);const ES=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 xS=Object.defineProperty,CS=Object.getOwnPropertyDescriptor,$f=(t,e,r,n)=>{for(var i=n>1?void 0:n?CS(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&&xS(e,r,i),i};let Js=class extends $e{constructor(){super(),this.balance="hide",this.avatar="show",xe.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=Ae.state;t||(wi.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>`}};Js.styles=[Fe.globalCss,ES],$f([Oe()],Js.prototype,"balance",2),$f([Oe()],Js.prototype,"avatar",2),Js=$f([Ne("w3m-account-button")],Js);const IS=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 SS=Object.defineProperty,OS=Object.getOwnPropertyDescriptor,Pf=(t,e,r,n)=>{for(var i=n>1?void 0:n?OS(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&&SS(e,r,i),i};let ba=class extends $e{constructor(){super(),this.chainId=0,this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=Ae.state;this.chainId=t?.id,this.label=t?.name,this.unsubscribeNetwork=Ae.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}=Ae.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>`}};ba.styles=[Fe.globalCss,IS],Pf([gt()],ba.prototype,"chainId",2),Pf([gt()],ba.prototype,"label",2),ba=Pf([Ne("w3m-account-network-button")],ba);const DS=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 AS=Object.defineProperty,$S=Object.getOwnPropertyDescriptor,_a=(t,e,r,n)=>{for(var i=n>1?void 0:n?$S(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&&AS(e,r,i),i};let is=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>`}};is.styles=[Fe.globalCss,DS],_a([gt()],is.prototype,"address",2),_a([gt()],is.prototype,"name",2),_a([gt()],is.prototype,"loading",2),_a([Oe()],is.prototype,"variant",2),is=_a([Ne("w3m-address-text")],is);const Mr={onConnecting(t){xe.goToConnectingView(t)},onExternal(t){xe.handleConnectorConnection(t)},manualWalletsTemplate(){return en.manualWallets().map(t=>oe`<w3m-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},recomendedWalletsTemplate(t=!1){return en.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 en.externalWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${()=>this.onExternal(t.id)}"></w3m-wallet-button>`)},recentWalletTemplate(){const t=en.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 en.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 en.injectedWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)}},PS=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 TS=Object.defineProperty,RS=Object.getOwnPropertyDescriptor,NS=(t,e,r,n)=>{for(var i=n>1?void 0:n?RS(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&&TS(e,r,i),i};let Tf=class extends $e{onGoToQrcode(){tt.push("Qrcode")}onGetWallet(){tt.push("GetWallet")}render(){const{recomendedWallets:t}=rr.state,e=[...t,...t],r=Mr.externalWalletsTemplate(),n=Mr.installedInjectedWalletsTemplate(),i=[...n,...r].length>0,o=Se.RECOMMENDED_WALLET_AMOUNT*2;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Le.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-title">${Le.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>`:Le.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">${Le.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="${Le.ARROW_UP_RIGHT_ICON}" .onClick="${()=>this.onGetWallet()}">I don't have a wallet</w3m-button></w3m-info-footer>`}};Tf.styles=[Fe.globalCss,PS],Tf=NS([Ne("w3m-android-wallet-selection")],Tf);const LS=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 MS=Object.defineProperty,US=Object.getOwnPropertyDescriptor,Ea=(t,e,r,n)=>{for(var i=n>1?void 0:n?US(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&&MS(e,r,i),i};let ss=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}};ss.styles=[Fe.globalCss,LS],Ea([gt()],ss.prototype,"address",2),Ea([gt()],ss.prototype,"avatar",2),Ea([gt()],ss.prototype,"loading",2),Ea([Oe()],ss.prototype,"size",2),ss=Ea([Ne("w3m-avatar")],ss);const jS=Ve`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var FS=Object.defineProperty,BS=Object.getOwnPropertyDescriptor,Rf=(t,e,r,n)=>{for(var i=n>1?void 0:n?BS(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&&FS(e,r,i),i};let xa=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=this.amount.substring(0,6):typeof this.amount=="string"&&(t=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>`}};xa.styles=[Fe.globalCss,jS],Rf([gt()],xa.prototype,"symbol",2),Rf([gt()],xa.prototype,"amount",2),xa=Rf([Ne("w3m-balance")],xa);const kS=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 HS=Object.defineProperty,WS=Object.getOwnPropertyDescriptor,Jc=(t,e,r,n)=>{for(var i=n>1?void 0:n?WS(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&&HS(e,r,i),i};let os=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"?Le.WALLET_CONNECT_ICON:null}onClick(){Et.state.isConnected?this.onDisconnect():this.onConnect()}async onConnect(){this.loading=!0,wi.click({name:"CONNECT_BUTTON"}),await Nr.open(),Nr.state.open||(this.loading=!1)}async onDisconnect(){wi.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>`}};os.styles=[Fe.globalCss,kS],Jc([gt()],os.prototype,"loading",2),Jc([Oe()],os.prototype,"label",2),Jc([Oe()],os.prototype,"icon",2),os=Jc([Ne("w3m-connect-button")],os);const zS=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 qS=Object.defineProperty,VS=Object.getOwnPropertyDescriptor,Qs=(t,e,r,n)=>{for(var i=n>1?void 0:n?VS(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&&qS(e,r,i),i};let Ii=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=Mn.state.themeVariables)==null?void 0:t["--w3m-wallet-icon-large-border-radius"])!=null?e:Fe.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>`}};Ii.styles=[Fe.globalCss,zS],Qs([Oe()],Ii.prototype,"walletId",2),Qs([Oe()],Ii.prototype,"imageId",2),Qs([Oe()],Ii.prototype,"isError",2),Qs([Oe()],Ii.prototype,"isStale",2),Qs([Oe()],Ii.prototype,"label",2),Ii=Qs([Ne("w3m-connector-waiting")],Ii);var KS=Object.defineProperty,GS=Object.getOwnPropertyDescriptor,Xs=(t,e,r,n)=>{for(var i=n>1?void 0:n?GS(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&&KS(e,r,i),i};let Si=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>`}};Xs([gt()],Si.prototype,"isConnected",2),Xs([Oe()],Si.prototype,"label",2),Xs([Oe()],Si.prototype,"icon",2),Xs([Oe()],Si.prototype,"avatar",2),Xs([Oe()],Si.prototype,"balance",2),Si=Xs([Ne("w3m-core-button")],Si);const ZS=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 YS=Object.defineProperty,JS=Object.getOwnPropertyDescriptor,QS=(t,e,r,n)=>{for(var i=n>1?void 0:n?JS(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&&YS(e,r,i),i};let Nf=class extends $e{render(){const{isStandalone:t}=Ae.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 f=[l,...i,...o];t||(f=[...h,l,...c,...i,...o]),f=f.filter(Boolean);const v=f.length>4||n;let E=[];v?E=f.slice(0,3):E=f;const _=!!E.length;return oe`<w3m-modal-header .border="${!0}" title="Connect your wallet" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${Le.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${Le.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">${Le.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}`}};Nf.styles=[Fe.globalCss,ZS],Nf=QS([Ne("w3m-desktop-wallet-selection")],Nf);const XS=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 eO=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&&eO(e,r,i),i};let Lf=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}};Lf.styles=[Fe.globalCss,XS],Lf=rO([Ne("w3m-legal-notice")],Lf);const nO=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var iO=Object.defineProperty,sO=Object.getOwnPropertyDescriptor,oO=(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 Mf=class extends $e{onQrcode(){tt.push("Qrcode")}render(){const{isStandalone:t}=Ae.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 f=[l,...i,...o];t||(f=[...h,l,...c,...i,...o]),f=f.filter(Boolean);const v=f.length>8||n;let E=[];v?E=f.slice(0,7):E=f;const _=!!E.length;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Le.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}`}};Mf.styles=[Fe.globalCss,nO],Mf=oO([Ne("w3m-mobile-wallet-selection")],Mf);const aO=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 cO=Object.defineProperty,lO=Object.getOwnPropertyDescriptor,Uf=(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&&cO(e,r,i),i};let eo=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([ts(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,ts(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([ts(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,ts(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}=Ae.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>`}};eo.styles=[Fe.globalCss,aO],Uf([gt()],eo.prototype,"open",2),Uf([gt()],eo.prototype,"active",2),eo=Uf([Ne("w3m-modal")],eo);const uO=Ve`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var hO=Object.defineProperty,fO=Object.getOwnPropertyDescriptor,Qc=(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&&hO(e,r,i),i};let as=class extends $e{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,xe.rejectStandaloneButtonComponent();const{selectedChain:t}=Ae.state;this.onSetChainData(t),this.unsubscribeNetwork=Ae.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=Ae.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(){wi.click({name:"NETWORK_BUTTON"}),Nr.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=Ae.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>`}};as.styles=[Fe.globalCss,uO],Qc([gt()],as.prototype,"chainId",2),Qc([gt()],as.prototype,"label",2),Qc([gt()],as.prototype,"wrongNetwork",2),as=Qc([Ne("w3m-network-switch")],as);const dO=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 pO=Object.defineProperty,gO=Object.getOwnPropertyDescriptor,Xc=(t,e,r,n)=>{for(var i=n>1?void 0:n?gO(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 to=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>`}};to.styles=[Fe.globalCss,dO],Xc([Oe()],to.prototype,"chainId",2),Xc([Oe()],to.prototype,"isError",2),Xc([Oe()],to.prototype,"label",2),to=Xc([Ne("w3m-network-waiting")],to);const mO=Ve`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var wO=Object.defineProperty,vO=Object.getOwnPropertyDescriptor,cs=(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 Qn=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(){Se.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}=Ae.state;return oe`<div>${this.isRetry?oe`<slot></slot>`:null} ${this.isMobile?oe`<w3m-button .onClick="${this.onMobile}" .iconLeft="${Le.MOBILE_ICON}" variant="outline">Mobile</w3m-button>`:null} ${this.isInjected&&!t?oe`<w3m-button .onClick="${this.onInjected}" .iconLeft="${Le.WALLET_ICON}" variant="outline">Browser</w3m-button>`:null} ${this.isDesktop?oe`<w3m-button .onClick="${this.onDesktop}" .iconLeft="${Le.DESKTOP_ICON}" variant="outline">Desktop</w3m-button>`:null} ${this.isWeb?oe`<w3m-button .onClick="${this.onWeb}" .iconLeft="${Le.GLOBE_ICON}" variant="outline">Web</w3m-button>`:null}</div>`}};Qn.styles=[Fe.globalCss,mO],cs([Oe()],Qn.prototype,"isMobile",2),cs([Oe()],Qn.prototype,"isInjected",2),cs([Oe()],Qn.prototype,"isInjectedInstalled",2),cs([Oe()],Qn.prototype,"isDesktop",2),cs([Oe()],Qn.prototype,"isWeb",2),cs([Oe()],Qn.prototype,"isRetry",2),Qn=cs([Ne("w3m-platform-selection")],Qn);const yO=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 bO=Object.defineProperty,_O=Object.getOwnPropertyDescriptor,EO=(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 jf=class extends $e{onClick(){tt.push("WalletExplorer")}render(){const{recomendedWallets:t}=rr.state,e=en.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}">`:Le.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Le.WALLET_PLACEHOLDER)}</div><w3m-text variant="xsmall-regular">View All</w3m-text></button>`}};jf.styles=[Fe.globalCss,yO],jf=EO([Ne("w3m-view-all-wallets-button")],jf);const xO=Ve`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var CO=Object.defineProperty,IO=Object.getOwnPropertyDescriptor,el=(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&&CO(e,r,i),i};let ro=class extends $e{constructor(){super(),this.walletId="",this.imageId="",this.uri="",this.unwatchWcConnection=void 0,setTimeout(()=>{const{pairingUri:t}=ur.state,{standaloneUri:e}=Ae.state;this.uri=e??t},0),this.unwatchWcConnection=ur.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>`}};ro.styles=[Fe.globalCss,xO],el([Oe()],ro.prototype,"walletId",2),el([Oe()],ro.prototype,"imageId",2),el([gt()],ro.prototype,"uri",2),ro=el([Ne("w3m-walletconnect-qr")],ro);const SO=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 OO=Object.defineProperty,DO=Object.getOwnPropertyDescriptor,AO=(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&&OO(e,r,i),i};let Ff=class extends $e{async onDisconnect(){await Nt.client().disconnect()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=Et.state.address)!=null?t:""),qr.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="${Le.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${Le.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};Ff.styles=[Fe.globalCss,SO],Ff=AO([Ne("w3m-account-view")],Ff);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 Bf=class extends $e{viewTemplate(){return Se.isAndroid()?oe`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Se.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>`}};Bf.styles=[Fe.globalCss],Bf=TO([Ne("w3m-connect-wallet-view")],Bf);const RO=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var NO=Object.defineProperty,LO=Object.getOwnPropertyDescriptor,ym=(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 tl=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openDesktopApp(),this.unwatchConnection=ur.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Se.getWalletRouterData(),n=e?.native;if(n){const i=Se.formatNativeUrl(n,t,r);Se.openHref(i,"_self")}}openDesktopApp(){ur.setPairingError(!1);const{standaloneUri:t}=Ae.state,{pairingUri:e}=ur.state,r=Se.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isMobile:n,isInjected:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.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="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};tl.styles=[Fe.globalCss,RO],ym([gt()],tl.prototype,"isError",2),tl=ym([Ne("w3m-desktop-connecting-view")],tl);const MO=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 UO=Object.defineProperty,jO=Object.getOwnPropertyDescriptor,FO=(t,e,r,n)=>{for(var i=n>1?void 0:n?jO(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 kf=class extends $e{onGet(t){Se.openHref(t,"_blank")}render(){const t=rr.state.recomendedWallets.slice(0,5),e=en.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="${Le.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="${Le.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="${Le.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};kf.styles=[Fe.globalCss,MO],kf=FO([Ne("w3m-get-wallet-view")],kf);const BO=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 kO=Object.defineProperty,HO=Object.getOwnPropertyDescriptor,WO=(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&&kO(e,r,i),i};let Hf=class extends $e{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){jt.state.enableExplorer?tt.push("GetWallet"):xe.openWalletExplorerUrl()}onLearnMore(){Se.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">${Le.HELP_CHART_IMG} ${Le.HELP_PAINTING_IMG} ${Le.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">${Le.HELP_KEY_IMG} ${Le.HELP_USER_IMG} ${Le.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">${Le.HELP_COMPAS_IMG} ${Le.HELP_NOUN_IMG} ${Le.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="${Le.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${Le.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};Hf.styles=[Fe.globalCss,BO],Hf=WO([Ne("w3m-help-view")],Hf);const zO=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var qO=Object.defineProperty,VO=Object.getOwnPropertyDescriptor,bm=(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 rl=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}=Se.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="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};rl.styles=[Fe.globalCss,zO],bm([gt()],rl.prototype,"isError",2),rl=bm([Ne("w3m-injected-connecting-view")],rl);const KO=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 GO=Object.defineProperty,ZO=Object.getOwnPropertyDescriptor,YO=(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 Wf=class extends $e{onInstall(t){t&&Se.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:n}=Se.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="${Le.ARROW_DOWN_ICON}">Download</w3m-button></w3m-info-footer>`}};Wf.styles=[Fe.globalCss,KO],Wf=YO([Ne("w3m-install-wallet-view")],Wf);const JO=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{margin-top:-15px}.w3m-note w3m-text{margin-top:15px}.w3m-note w3m-text span{color:var(--w3m-accent-color)}`;var QO=Object.defineProperty,XO=Object.getOwnPropertyDescriptor,_m=(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&&QO(e,r,i),i};let nl=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openMobileApp(),this.unwatchConnection=ur.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}=Se.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!e){const c=Se.formatNativeUrl(i,t,n);Se.openHref(c,"_self")}else if(o){const c=Se.formatUniversalUrl(o,t,n);Se.openHref(c,"_self")}}openMobileApp(t=!1){ur.setPairingError(!1);const{standaloneUri:e}=Ae.state,{pairingUri:r}=ur.state,n=Se.getWalletRouterData();xe.setRecentWallet(n),e?this.onFormatAndRedirect(e,t):this.onFormatAndRedirect(r,t)}onGoToAppStore(t){t&&Se.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:n,mobile:i}=Se.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-platform-selection .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection>${l?oe`<w3m-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></w3m-text>`:null}</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="${Le.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</w3m-button></w3m-info-footer>`}};nl.styles=[Fe.globalCss,JO],_m([gt()],nl.prototype,"isError",2),nl=_m([Ne("w3m-mobile-connecting-view")],nl);const eD=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var tD=Object.defineProperty,rD=Object.getOwnPropertyDescriptor,nD=(t,e,r,n)=>{for(var i=n>1?void 0:n?rD(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&&tD(e,r,i),i};let zf=class extends $e{render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isInjected:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.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 QR Code 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>`}};zf.styles=[Fe.globalCss,eD],zf=nD([Ne("w3m-mobile-qr-connecting-view")],zf);var iD=Object.defineProperty,sD=Object.getOwnPropertyDescriptor,oD=(t,e,r,n)=>{for(var i=n>1?void 0:n?sD(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&&iD(e,r,i),i};let qf=class extends $e{render(){return oe`<w3m-modal-header title="Scan the code" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};qf.styles=[Fe.globalCss],qf=oD([Ne("w3m-qrcode-view")],qf);const aD=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 Em=Object.defineProperty,cD=Object.defineProperties,lD=Object.getOwnPropertyDescriptor,uD=Object.getOwnPropertyDescriptors,xm=Object.getOwnPropertySymbols,hD=Object.prototype.hasOwnProperty,fD=Object.prototype.propertyIsEnumerable,Cm=(t,e,r)=>e in t?Em(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dD=(t,e)=>{for(var r in e||(e={}))hD.call(e,r)&&Cm(t,r,e[r]);if(xm)for(var r of xm(e))fD.call(e,r)&&Cm(t,r,e[r]);return t},pD=(t,e)=>cD(t,uD(e)),Vf=(t,e,r,n)=>{for(var i=n>1?void 0:n?lD(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&&Em(e,r,i),i};let Ca=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}=Ae.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?(Ae.setSelectedChain(t),Nr.close()):(Ae.setSelectedChain(t),tt.push("ConnectWallet"))}catch(e){console.error(e),qr.openToast("Unsupported chain","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}=Ae.state,e=t?.map(n=>pD(dD({},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}`}};Ca.styles=[Fe.globalCss,aD],Vf([gt()],Ca.prototype,"connectedChains",2),Vf([gt()],Ca.prototype,"isUnsupportedChains",2),Ca=Vf([Ne("w3m-select-network-view")],Ca);const gD=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 mD=Object.defineProperty,wD=Object.getOwnPropertyDescriptor,Im=(t,e,r,n)=>{for(var i=n>1?void 0:n?wD(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&&mD(e,r,i),i};let il=class extends $e{constructor(){super(),this.isError=!1,this.onSwitchNetwork()}async onSwitchNetwork(){try{this.isError=!1;const t=Se.getSwitchNetworkRouterData();await Nt.client().switchNetwork({chainId:t.id}),Ae.setSelectedChain(t),tt.reset("Account")}catch{this.isError=!0}}render(){const{id:t,name:e}=Se.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="${Le.RETRY_ICON}">Try Again</w3m-button></w3m-info-footer>`}};il.styles=[Fe.globalCss,gD],Im([gt()],il.prototype,"isError",2),il=Im([Ne("w3m-switch-network-view")],il);const vD=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 yD=Object.defineProperty,bD=Object.getOwnPropertyDescriptor,Ia=(t,e,r,n)=>{for(var i=n>1?void 0:n?bD(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&&yD(e,r,i),i};const Kf=40;let ls=class extends $e{constructor(){super(...arguments),this.loading=!rr.state.wallets.listings.length,this.firstFetch=!rr.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,rr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),rr.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}=rr.state,{listings:r,total:n}=this.search?e:t;return n<=Kf||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r,injectedWallets:n}=rr.state,{listings:i,total:o,page:c}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>Kf&&i.length<o))try{this.loading=!0;const l=(t=Ae.state.standaloneChains)==null?void 0:t.join(","),{listings:h}=await rr.getWallets({page:this.firstFetch?1:c+1,entries:Kf,search:this.search,version:Ae.state.walletConnectVersion,chains:l}),f=h.map(E=>xe.getWalletIcon(E)),v=n.map(E=>xe.getWalletIcon(E));await Promise.all([...f.map(async E=>xe.preloadImage(E)),...v.map(async E=>xe.preloadImage(E)),Se.wait(300)]),this.endReached=this.isLastPage()}catch(l){console.error(l),qr.openToast(xe.getErrorMessage(l),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Se.isAndroid()?xe.handleMobileLinking(t):xe.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=rr.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,f=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(f)].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>`}};ls.styles=[Fe.globalCss,vD],Ia([gt()],ls.prototype,"loading",2),Ia([gt()],ls.prototype,"firstFetch",2),Ia([gt()],ls.prototype,"search",2),Ia([gt()],ls.prototype,"endReached",2),ls=Ia([Ne("w3m-wallet-explorer-view")],ls);const _D=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var ED=Object.defineProperty,xD=Object.getOwnPropertyDescriptor,Sm=(t,e,r,n)=>{for(var i=n>1?void 0:n?xD(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&&ED(e,r,i),i};let sl=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openWebWallet(),this.unwatchConnection=ur.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Se.getWalletRouterData(),n=e?.universal;if(n){const i=Se.formatUniversalUrl(n,t,r);Se.openHref(i,"_blank")}}openWebWallet(){ur.setPairingError(!1);const{standaloneUri:t}=Ae.state,{pairingUri:e}=ur.state,r=Se.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isMobile:n,isInjected:i,isDesktop:o}=xe.getCachedRouterWalletPlatforms(),c=Se.isMobile();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.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="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};sl.styles=[Fe.globalCss,_D],Sm([gt()],sl.prototype,"isError",2),sl=Sm([Ne("w3m-web-connecting-view")],sl);var CD=Object.freeze({__proto__:null,get W3mAccountButton(){return Js},get W3mConnectButton(){return os},get W3mCoreButton(){return Si},get W3mModal(){return eo},get W3mNetworkSwitch(){return as},get W3mQrCode(){return Jn}});_n.EthereumProvider=yx,_n.OPTIONAL_EVENTS=Bg,_n.OPTIONAL_METHODS=Fg,_n.REQUIRED_EVENTS=bc,_n.REQUIRED_METHODS=yc,_n.default=Ec,Object.defineProperty(_n,"__esModule",{value:!0})});
|
|
153
153
|
//# sourceMappingURL=index.umd.js.map
|